:root {
  color-scheme: dark;
  --bg: #080d19;
  --panel: #101827;
  --panel-2: #141d30;
  --line: rgba(180, 198, 235, .14);
  --text: #f5f7fb;
  --muted: #aeb8ca;
  --blue: #3d73ff;
  --blue-2: #6c8cff;
  --green: #38dc7d;
  --red: #ff5f71;
  --yellow: #f4c84a;
  --shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(54, 104, 230, .18), transparent 34%),
    linear-gradient(135deg, #070b15 0%, #0b1220 52%, #08101d 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a { color: #5d8cff; text-decoration: none; }
a:hover { color: #8fb0ff; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 25, .84);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #8159ff, #337cff);
  font-size: 14px;
  letter-spacing: 0;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.muted { color: var(--muted); }

.btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(104, 139, 255, .55);
  background: linear-gradient(180deg, rgba(80, 116, 255, .22), rgba(255,255,255,.04));
}

.btn.primary {
  border-color: rgba(87, 126, 255, .65);
  background: linear-gradient(180deg, #3f73ff, #1f4ed2);
}

.btn.danger:hover {
  border-color: rgba(255, 95, 113, .65);
  background: rgba(255, 95, 113, .14);
}

.btn.ghost { background: rgba(255,255,255,.04); }
.btn.small { padding: 8px 12px; }
.btn.wide { width: 100%; }

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  padding: 34px 40px 48px;
}

.sidebar {
  position: sticky;
  top: 104px;
  height: calc(100vh - 128px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 24, 39, .68);
}

.nav-link {
  display: block;
  padding: 13px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(68, 111, 255, .16);
}

.content {
  min-width: 0;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.hero-actions,
.terminal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vdsina-panel {
  margin-bottom: 28px;
  padding: 22px;
  border: 1px solid rgba(110, 142, 255, .22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(63, 115, 255, .13), rgba(56, 220, 125, .05)),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  box-shadow: var(--shadow);
  scroll-margin-top: 110px;
}

.vdsina-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.vdsina-head h2 {
  margin-top: 4px;
}

.vdsina-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.6fr) repeat(2, minmax(180px, .7fr));
  gap: 14px;
}

.vdsina-card {
  min-height: 142px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 25, .48);
}

.vdsina-card.wide {
  min-width: 0;
}

.metric-topline,
.traffic-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.metric-value {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.metric-value-sm {
  font-size: clamp(22px, 2.2vw, 28px);
  white-space: nowrap;
}

.metric-note {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.metric-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
}

.metric-pill.ok { background: rgba(56, 220, 125, .18); color: var(--green); }
.metric-pill.warn { background: rgba(244, 200, 74, .18); color: var(--yellow); }
.metric-pill.bad { background: rgba(255, 95, 113, .18); color: var(--red); }

.traffic-bar {
  height: 12px;
  margin: 18px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.traffic-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width .35s ease;
}

.traffic-bar span.ok { background: linear-gradient(90deg, #38dc7d, #58b8ff); }
.traffic-bar span.warn { background: linear-gradient(90deg, #f4c84a, #ff9f43); }
.traffic-bar span.bad { background: linear-gradient(90deg, #ff5f71, #ff8a5c); }

.traffic-split {
  color: var(--muted);
  font-size: 14px;
}

.traffic-split strong {
  color: var(--text);
}

.danger-card {
  border-color: rgba(255, 95, 113, .45);
}

.eyebrow {
  color: var(--blue-2);
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(30px, 4vw, 46px); }
h2 { margin-bottom: 0; font-size: 26px; }

.panel-section {
  margin-bottom: 28px;
  scroll-margin-top: 110px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bot-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.status-card,
.terminal-panel,
.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  box-shadow: var(--shadow);
}

.card {
  padding: 22px;
}

.card-title {
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 800;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 86px;
  padding: 18px;
}

.status-name {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 18px currentColor;
}

.status-dot.active { background: var(--green); color: var(--green); }
.status-dot.inactive { background: var(--red); color: var(--red); }
.status-dot.missing { background: var(--yellow); color: var(--yellow); }

.command-card { margin-top: 16px; }

.terminal-panel {
  margin-top: 28px;
  margin-bottom: 28px;
  overflow: hidden;
}

.terminal-panel.hidden {
  display: none;
}

.terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  font-weight: 800;
}

.terminal-output {
  min-height: 220px;
  max-height: 460px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #d9e3ff;
  font: 14px/1.55 Consolas, "SFMono-Regular", Menlo, monospace;
  white-space: pre-wrap;
}

.terminal-output pre {
  margin: 14px 0 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
  color: #d9e3ff;
  font: inherit;
  white-space: pre-wrap;
}

.term-grid {
  display: grid;
  gap: 10px;
  white-space: normal;
}

.term-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1.4fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.term-row span:last-child {
  color: var(--muted);
}

.site-link {
  color: var(--text);
  font-weight: 900;
}

.site-link:hover {
  color: var(--blue-2);
}

.term-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 800;
}

.term-badge.ok {
  color: #102315;
  background: var(--green);
}

.term-badge.bad {
  color: #2c0b10;
  background: var(--red);
}

.term-badge.warn {
  color: #2b2104;
  background: var(--yellow);
}

.term-table {
  width: 100%;
  border-collapse: collapse;
  white-space: normal;
}

.term-table th,
.term-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.term-table th {
  color: var(--muted);
  font-weight: 800;
}

.loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--blue-2);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.hidden { display: none; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  opacity: 0;
  transform: translateY(12px);
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(255, 95, 113, .65); }

.editor-dialog {
  width: min(980px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
}

.editor-dialog::backdrop { background: rgba(0,0,0,.64); }

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}

textarea {
  display: block;
  width: 100%;
  min-height: 56vh;
  border: 0;
  padding: 18px;
  resize: vertical;
  background: #080d19;
  color: var(--text);
  font: 14px/1.55 Consolas, "SFMono-Regular", Menlo, monospace;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(430px, 100%);
}

.login-card {
  padding: 32px;
}

.login-brand { margin-bottom: 28px; }
.login-card h1 { font-size: 34px; margin-bottom: 8px; }

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(255,255,255,.055);
  color: var(--text);
  font: inherit;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(92, 132, 255, .45);
  outline-offset: 2px;
}

.alert {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 95, 113, .55);
  border-radius: 8px;
  background: rgba(255, 95, 113, .12);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1100px) {
  .project-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; padding: 24px; }
  .sidebar {
    position: static;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vdsina-grid { grid-template-columns: 1fr 1fr; }
  .vdsina-card.wide { grid-column: 1 / -1; }
  .bot-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .project-head,
  .project-meta div { grid-template-columns: 1fr; }
  .project-head { flex-direction: column; }
  .badge-row { justify-content: flex-start; }
  .topbar,
  .hero,
  .user-box,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .topbar { padding: 18px; }
  .hero-actions,
  .terminal-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .hero-actions .btn,
  .terminal-actions .btn {
    width: 100%;
  }
  .app-shell { padding: 18px; }
  .card-grid,
  .status-grid,
  .vdsina-grid { grid-template-columns: 1fr; }
  .vdsina-head,
  .metric-topline,
  .traffic-split {
    align-items: stretch;
    flex-direction: column;
  }
  .vdsina-card.wide { grid-column: auto; }
  .button-row .btn { flex: 1 1 100%; }
  .term-row { grid-template-columns: 1fr; }
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  display: grid;
  gap: 18px;
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.project-head h3 {
  margin-bottom: 6px;
  font-size: 22px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.project-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.project-meta div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(180, 198, 235, .08);
}

.project-meta dt {
  color: var(--muted);
  font-weight: 800;
}

.project-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #d9e3ff;
}

.project-actions .btn {
  flex: 1 1 145px;
}

.card-note {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.5;
}

.legacy-card {
  border-color: rgba(244, 200, 74, .32);
}

.nginx-projects {
  margin-bottom: 16px;
}

.term-badge.warn {
  box-shadow: 0 0 0 1px rgba(244, 200, 74, .25);
}

.term-badge.bad {
  box-shadow: 0 0 0 1px rgba(255, 95, 113, .25);
}

.disk-warn {
  color: var(--yellow);
  font-weight: 900;
}

.disk-danger {
  color: var(--red);
  font-weight: 900;
}

.ops-grid {
  align-items: stretch;
}

.ops-card .button-row {
  gap: 12px;
}

.ops-card .btn {
  flex: 1 1 180px;
}
.bot-hero .hero-actions {
  justify-content: flex-end;
}

.bot-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bot-form {
  display: grid;
  gap: 14px;
}

.bot-form-card input {
  min-height: 46px;
}

.bot-item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.bot-item-card {
  overflow: hidden;
  padding: 0;
}

.bot-item-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: rgba(255,255,255,.04);
}

.bot-item-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.bot-item-body h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.bot-item-body p {
  margin: 0;
  color: var(--muted);
}

.bot-manage-link { margin-bottom: 0; }

.alert-ok {
  border-color: rgba(56, 220, 125, .55);
  background: rgba(56, 220, 125, .12);
}

.alert-error {
  border-color: rgba(255, 95, 113, .55);
  background: rgba(255, 95, 113, .12);
}

@media (max-width: 1100px) {
  .bot-admin-grid,
  .bot-item-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .bot-admin-grid,
  .bot-item-grid { grid-template-columns: 1fr; }
}
.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}
.bot-service-card {
  display: grid;
  gap: 14px;
}

.bot-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bot-card-head .card-title {
  margin-bottom: 0;
}

.bot-service-actions .btn {
  flex: 0 1 auto;
}

.bot-page-shell {
  padding: 34px 30px 48px;
}

.bot-page-content {
  max-width: 1680px;
  margin: 0 auto;
}

.bot-hero-clean {
  align-items: flex-start;
  margin-bottom: 18px;
}

.bot-hero-clean .hero-actions {
  justify-content: flex-end;
  max-width: 760px;
}

.bot-menu-tabs {
  position: sticky;
  top: 86px;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 18, 34, .84);
  backdrop-filter: blur(14px);
}

.bot-menu-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 800;
  background: rgba(255,255,255,.045);
}

.bot-menu-tabs a:hover {
  background: rgba(68, 111, 255, .18);
}

.bot-menu-tabs span {
  color: var(--muted);
  font-size: 12px;
}

.bot-forms-section {
  scroll-margin-top: 150px;
}

.bot-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.bot-form-head h2 {
  font-size: 21px;
}

.bot-form-card {
  min-height: 0;
}

.bot-form-card .btn.primary {
  min-height: 44px;
}

.bot-list-section {
  scroll-margin-top: 150px;
}

.bot-item-grid-games,
.bot-item-grid-books {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bot-item-card img {
  border-bottom: 1px solid var(--line);
}

.bot-item-body .term-badge {
  justify-self: start;
  min-width: auto;
}

@media (max-width: 1100px) {
  .bot-page-shell { padding: 24px; }
  .bot-hero-clean .hero-actions { justify-content: flex-start; max-width: none; }
  .bot-service-actions .btn { flex: 1 1 150px; }
}

@media (max-width: 720px) {
  .bot-page-shell { padding: 18px; }
  .bot-card-head { align-items: stretch; flex-direction: column; }
  .bot-card-head .btn { width: 100%; }
  .bot-menu-tabs { position: static; }
}
/* Mylife bot polish v10 */
.bot-grid .bot-service-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  min-height: 118px;
}

.bot-grid .bot-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
}

.bot-grid .bot-card-head .card-title {
  margin: 0;
  line-height: 1.2;
}

.bot-grid .bot-card-head .btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 9px 14px;
}

.bot-grid .bot-service-actions {
  align-items: flex-start;
}

.bot-grid .bot-service-actions .btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 9px 13px;
}

.bot-page-shell {
  padding: 28px 24px 46px;
}

.bot-page-content {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.bot-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.bot-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.bot-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.bot-title-row h1 {
  margin: 4px 0 0;
}

.bot-menu-tabs {
  position: static;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 24, 39, .72);
}

.bot-menu-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 800;
  background: rgba(255,255,255,.045);
}

.bot-menu-tabs a:hover {
  background: rgba(68, 111, 255, .18);
}

.bot-menu-tabs span {
  color: var(--muted);
  font-size: 12px;
}

.bot-workspace {
  scroll-margin-top: 110px;
}

.bot-workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.bot-workspace-form {
  position: sticky;
  top: 92px;
  min-height: 0;
}

.bot-form-head {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.bot-form-head h3 {
  margin: 0;
  font-size: 21px;
}

.bot-form {
  display: grid;
  gap: 14px;
}

.bot-form label {
  display: grid;
  gap: 8px;
}

.bot-form input {
  min-height: 46px;
}

.bot-form .btn.primary {
  min-height: 46px;
}

.bot-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.bot-item-card {
  overflow: hidden;
  padding: 0;
}

.bot-item-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}

.bot-item-body {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.bot-item-body .term-badge {
  justify-self: start;
  min-width: auto;
}

.bot-item-body h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.bot-item-body p {
  margin: 0;
  color: var(--muted);
}

.empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 1180px) {
  .bot-workspace-grid { grid-template-columns: 1fr; }
  .bot-workspace-form { position: static; }
  .bot-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .bot-page-shell { padding: 18px; }
  .bot-toolbar,
  .bot-title-row,
  .bot-grid .bot-card-head {
    align-items: stretch;
    flex-direction: column;
  }
  .bot-toolbar-actions,
  .bot-menu-tabs { justify-content: flex-start; }
  .bot-toolbar .btn,
  .bot-toolbar-actions .btn,
  .bot-grid .bot-card-head .btn { width: 100%; }
  .bot-gallery { grid-template-columns: 1fr; }
}
/* Mylife tabs and card alignment v11 */
.bot-grid .bot-service-card {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.bot-grid .bot-service-card .card-title {
  margin: 0;
  line-height: 1.2;
}

.bot-grid .bot-service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.bot-grid .bot-service-actions .btn {
  flex: 0 0 auto;
  min-height: 36px;
  margin: 0;
  padding: 9px 13px;
}

.bot-grid .bot-service-actions .btn.primary {
  min-width: 138px;
}

.bot-menu-tabs a.active {
  color: #102315;
  background: var(--green);
}

.bot-page-content {
  width: min(1180px, 100%);
}

.bot-workspace-grid {
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
}

.bot-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .bot-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Mylife covers no-crop v12 */
.bot-item-card img {
  object-fit: contain;
  object-position: center;
  background: #0b1220;
}

#games-panel .bot-item-card img {
  aspect-ratio: 16 / 9;
}

#books-panel .bot-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

#books-panel .bot-item-card img {
  aspect-ratio: 3 / 4;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
}

#books-panel .bot-item-card {
  align-self: start;
}

#books-panel .bot-item-body h3,
#games-panel .bot-item-body h3 {
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  #books-panel .bot-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  #books-panel .bot-gallery { grid-template-columns: 1fr; }
}
/* Mylife game covers no-crop v13 */
#games-panel .bot-item-card img {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center;
  padding: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
}

#games-panel .bot-gallery {
  align-items: start;
}
.sg-bot-page .bot-title-row,
.sg-bot-page .bot-toolbar {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.sg-workspace-grid {
  align-items: stretch;
}

.sg-stats-card {
  min-height: 100%;
}

.sg-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.sg-stats-grid h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.sg-stat-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
}

.sg-stat-line strong {
  color: var(--text);
}

.sg-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sg-person-card img {
  aspect-ratio: 3 / 4;
  width: 100%;
  object-fit: contain;
  background: rgba(255,255,255,.04);
  padding: 8px;
}

.sg-edit-details {
  margin-top: 10px;
}

.sg-edit-details summary {
  cursor: pointer;
  color: var(--accent);
  margin-bottom: 10px;
}

@media (max-width: 980px) {
  .sg-gallery,
  .sg-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sg-gallery,
  .sg-stats-grid {
    grid-template-columns: 1fr;
  }
}
/* Operations polish v15 */
.project-live-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 10px 0 2px;
}

.project-live-text {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.035);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  white-space: normal;
}

.health-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}

.health-card pre {
  max-height: 180px;
  overflow: auto;
  margin: 0;
}

@media (max-width: 720px) {
  .health-grid { grid-template-columns: 1fr; }
}
/* Layout cleanup v16 */
.app-shell {
  display: block;
  max-width: 1680px;
  margin: 0 auto;
  padding: 34px 40px 48px;
}

.content {
  width: 100%;
}

.sidebar {
  display: none;
}

.host-metrics-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.host-metric-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  box-shadow: var(--shadow);
}

.host-metric-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--green);
}

.host-metric-card.warn::before { background: var(--yellow); }
.host-metric-card.danger::before { background: var(--red); }
.host-metric-card.loading::before { background: var(--blue-2); }

.host-metric-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.host-metric-card strong {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.host-metric-card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.metric-mini-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.metric-mini-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue-2));
}

.host-metric-card.warn .metric-mini-bar i { background: linear-gradient(90deg, var(--yellow), #ff9f43); }
.host-metric-card.danger .metric-mini-bar i { background: linear-gradient(90deg, var(--red), #ff8a5c); }

.project-head {
  display: block;
}

.project-head h3 {
  margin-bottom: 8px;
}

@media (max-width: 1100px) {
  .app-shell { padding: 24px; }
  .host-metrics-panel { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell { padding: 18px; }
  .hero { align-items: stretch; flex-direction: column; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .project-grid { grid-template-columns: 1fr; }
}


/* Terminal modal v19 */
.terminal-dialog {
  width: min(980px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 14px;
  background: transparent;
  color: inherit;
}

.terminal-dialog::backdrop {
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(4px);
}

.terminal-modal {
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(15, 23, 42, .98), rgba(2, 6, 23, .98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
}

.terminal-output-modal {
  max-height: min(620px, calc(100vh - 150px));
  overflow: auto;
  border-radius: 0;
  border-inline: 0;
  border-bottom: 0;
}

@media (max-width: 620px) {
  .terminal-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .terminal-dialog .terminal-head {
    align-items: stretch;
    flex-direction: column;
  }

  .terminal-dialog .terminal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .terminal-output-modal {
    max-height: calc(100vh - 170px);
  }
}
