/* Layout: a frosted sidebar and one frosted working sheet floating over a slow, blurred skin-tone gradient.
   Hierarchy comes from type and spacing; only modals, drawers and toasts are lifted off the sheet. */
:root {
  --porcelain: #F3F4F7;
  --apricot: #F6C9B0;
  --rose: #E9B7C4;
  --lilac: #C9C3E8;
  --ink: #1C2340;
  --indigo: #3D4BB8;

  --bg: var(--porcelain);
  --fg: var(--ink);
  --fg-2: #4C5373;
  --fg-3: #7B819C;
  --accent: var(--indigo);
  --accent-hover: #3240A3;
  --accent-soft: rgba(61, 75, 184, 0.10);
  --accent-softer: rgba(61, 75, 184, 0.05);
  --on-accent: #FFFFFF;

  --blob-1: var(--apricot);
  --blob-2: var(--rose);
  --blob-3: var(--lilac);
  --blob-opacity: 0.85;

  --glass: rgba(255, 255, 255, 0.52);
  --glass-strong: rgba(255, 255, 255, 0.74);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --panel: rgba(255, 255, 255, 0.55);
  --panel-hover: rgba(255, 255, 255, 0.85);
  --field: rgba(255, 255, 255, 0.8);
  --line: rgba(28, 35, 64, 0.08);
  --line-2: rgba(28, 35, 64, 0.15);
  --overlay: rgba(28, 35, 64, 0.28);
  --float-shadow: 0 24px 60px -28px rgba(28, 35, 64, 0.35), 0 2px 8px -4px rgba(28, 35, 64, 0.12);

  --lv-green: #2B8462;
  --lv-yellow: #A67A0B;
  --lv-orange: #C65A1F;
  --lv-red: #BC2E45;
  --lv-green-bg: rgba(43, 132, 98, 0.12);
  --lv-yellow-bg: rgba(196, 150, 30, 0.16);
  --lv-orange-bg: rgba(198, 90, 31, 0.12);
  --lv-red-bg: rgba(188, 46, 69, 0.11);
  --bar-green: #6DB596;
  --bar-yellow: #E3BE5A;
  --bar-orange: #E38E5B;
  --bar-red: #D9667A;

  --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.90625rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.625rem;
  --fs-2xl: 2.125rem;

  --r-sheet: 28px;
  --r-panel: 18px;
  --r-control: 11px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12142A;
    --fg: #E9EAF4;
    --fg-2: #B5B8CF;
    --fg-3: #858AA6;
    --accent: #9AA5FF;
    --accent-hover: #B3BBFF;
    --accent-soft: rgba(154, 165, 255, 0.16);
    --accent-softer: rgba(154, 165, 255, 0.07);
    --on-accent: #141733;
    --blob-1: #7A4A3E;
    --blob-2: #6E3B5C;
    --blob-3: #3E3F8C;
    --blob-opacity: 0.7;
    --glass: rgba(26, 29, 56, 0.55);
    --glass-strong: rgba(24, 27, 52, 0.72);
    --glass-edge: rgba(255, 255, 255, 0.07);
    --panel: rgba(255, 255, 255, 0.045);
    --panel-hover: rgba(255, 255, 255, 0.09);
    --field: rgba(255, 255, 255, 0.06);
    --line: rgba(233, 234, 244, 0.08);
    --line-2: rgba(233, 234, 244, 0.16);
    --overlay: rgba(6, 7, 18, 0.55);
    --float-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
    --lv-green: #6FD0A6;
    --lv-yellow: #E8C45E;
    --lv-orange: #F29A64;
    --lv-red: #F27D90;
    --lv-green-bg: rgba(111, 208, 166, 0.13);
    --lv-yellow-bg: rgba(232, 196, 94, 0.13);
    --lv-orange-bg: rgba(242, 154, 100, 0.13);
    --lv-red-bg: rgba(242, 125, 144, 0.13);
    --bar-green: #4E9C7D;
    --bar-yellow: #C2A048;
    --bar-orange: #C9774A;
    --bar-red: #C25668;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12142A;
  --fg: #E9EAF4;
  --fg-2: #B5B8CF;
  --fg-3: #858AA6;
  --accent: #9AA5FF;
  --accent-hover: #B3BBFF;
  --accent-soft: rgba(154, 165, 255, 0.16);
  --accent-softer: rgba(154, 165, 255, 0.07);
  --on-accent: #141733;
  --blob-1: #7A4A3E;
  --blob-2: #6E3B5C;
  --blob-3: #3E3F8C;
  --blob-opacity: 0.7;
  --glass: rgba(26, 29, 56, 0.55);
  --glass-strong: rgba(24, 27, 52, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.07);
  --panel: rgba(255, 255, 255, 0.045);
  --panel-hover: rgba(255, 255, 255, 0.09);
  --field: rgba(255, 255, 255, 0.06);
  --line: rgba(233, 234, 244, 0.08);
  --line-2: rgba(233, 234, 244, 0.16);
  --overlay: rgba(6, 7, 18, 0.55);
  --float-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --lv-green: #6FD0A6;
  --lv-yellow: #E8C45E;
  --lv-orange: #F29A64;
  --lv-red: #F27D90;
  --lv-green-bg: rgba(111, 208, 166, 0.13);
  --lv-yellow-bg: rgba(232, 196, 94, 0.13);
  --lv-orange-bg: rgba(242, 154, 100, 0.13);
  --lv-red-bg: rgba(242, 125, 144, 0.13);
  --bar-green: #4E9C7D;
  --bar-yellow: #C2A048;
  --bar-orange: #C9774A;
  --bar-red: #C25668;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-3); }
.dim { color: var(--fg-2); }

/* ---------- Gradient atmosphere ---------- */
.atmosphere { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.atmosphere span {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: var(--blob-opacity);
  animation: drift 46s ease-in-out infinite alternate;
}
.atmosphere .b1 { width: 52vw; height: 52vw; left: -12vw; top: -18vw; background: var(--blob-1); }
.atmosphere .b2 { width: 46vw; height: 46vw; right: -10vw; top: 8vh; background: var(--blob-2); animation-duration: 58s; animation-delay: -12s; }
.atmosphere .b3 { width: 58vw; height: 58vw; left: 22vw; bottom: -30vw; background: var(--blob-3); animation-duration: 64s; animation-delay: -30s; }
.atmosphere .b4 { width: 26vw; height: 26vw; left: 8vw; bottom: 6vh; background: var(--blob-2); opacity: calc(var(--blob-opacity) * 0.55); animation-duration: 52s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4vw, 3vh) scale(1.06); }
  100% { transform: translate(-3vw, 5vh) scale(0.97); }
}
@media (prefers-reduced-motion: reduce) {
  .atmosphere span { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Shell ---------- */
.app {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky; top: 0; height: 100vh;
  padding: 14px 0 14px 14px;
}
.sidebar-inner {
  height: 100%; display: flex; flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  padding: 18px 12px 12px;
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-weight: 600; font-size: 0.95rem; line-height: 1.15; letter-spacing: -0.01em; }
.brand-sub { font-size: var(--fs-xs); color: var(--fg-3); }
.nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.nav-group { padding: 10px 0 4px; }
.nav-group-label { font-size: var(--fs-xs); color: var(--fg-3); padding: 0 10px 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 10px;
  color: var(--fg-2); font-size: var(--fs-sm); font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: 0.8; }
.nav a:hover { background: var(--panel-hover); color: var(--fg); }
.nav a.active { background: var(--glass-strong); color: var(--accent); box-shadow: 0 1px 0 var(--glass-edge) inset, 0 6px 16px -10px rgba(61,75,184,0.45); }
.nav a.active svg { opacity: 1; }
.nav a .soon { margin-left: auto; font-size: 0.6875rem; color: var(--fg-3); font-weight: 500; }
.nav a .count {
  margin-left: auto; min-width: 20px; padding: 0 6px; height: 18px; border-radius: 9px;
  background: var(--lv-orange-bg); color: var(--lv-orange); font-size: 0.6875rem; font-weight: 600;
  display: inline-grid; place-items: center;
}
.me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; border-top: 1px solid var(--line); margin-top: 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 600;
  background: linear-gradient(135deg, var(--apricot), var(--lilac)); color: #1C2340;
}
.me-name { font-size: var(--fs-sm); font-weight: 600; line-height: 1.2; }
.me-role { font-size: var(--fs-xs); color: var(--fg-3); }

.main { min-width: 0; padding: 14px 18px 48px; display: flex; flex-direction: column; gap: 14px; }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 4px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--fg-3); min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; }
.crumbs a:hover { color: var(--fg); }
.crumbs .sep { opacity: 0.5; }
.crumbs .here { color: var(--fg); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.search { position: relative; width: min(320px, 34vw); }
.search input {
  width: 100%; height: 38px; border-radius: 12px; border: 1px solid var(--glass-edge);
  background: var(--glass); padding: 0 12px 0 36px; font-size: var(--fs-sm);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.search input::placeholder { color: var(--fg-3); }
.search > svg { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--fg-3); }
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; z-index: 40;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 14px;
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  box-shadow: var(--float-shadow); padding: 6px; max-height: 360px; overflow-y: auto;
}
.search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 9px; font-size: var(--fs-sm); }
.search-results a:hover, .search-results a.hl { background: var(--accent-soft); }
.search-results .kind { color: var(--fg-3); font-size: var(--fs-xs); }
.search-results .empty { padding: 10px; color: var(--fg-3); font-size: var(--fs-sm); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center; position: relative; cursor: pointer;
  border: 1px solid var(--glass-edge); background: var(--glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.icon-btn:hover { background: var(--glass-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--lv-orange); box-shadow: 0 0 0 2px var(--bg); }
.menu-btn { display: none; }
.popover {
  position: absolute; top: 46px; right: 0; width: 340px; z-index: 40;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 16px;
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  box-shadow: var(--float-shadow); padding: 8px; text-align: left; cursor: default;
}
.popover h3 { font-size: var(--fs-sm); padding: 6px 8px 8px; }
.popover a { display: block; padding: 9px 10px; border-radius: 10px; font-size: var(--fs-sm); line-height: 1.4; }
.popover a:hover { background: var(--accent-soft); }
.popover a .when { display: block; color: var(--fg-3); font-size: var(--fs-xs); margin-top: 2px; }

.sheet {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-sheet);
  backdrop-filter: blur(30px) saturate(1.3);
  -webkit-backdrop-filter: blur(30px) saturate(1.3);
  padding: 30px 34px 38px;
  min-height: calc(100vh - 110px);
  display: flex; flex-direction: column; gap: 28px;
  min-width: 0;
}

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; max-width: 64ch; }
.page-title {
  font-size: var(--fs-2xl); line-height: 1.08; letter-spacing: -0.025em;
  font-weight: 600; font-stretch: 88%; font-variation-settings: "wdth" 88;
}
.lede { margin-top: 8px; color: var(--fg-2); font-size: var(--fs-md); max-width: 62ch; }
.head-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--fg-2); font-size: var(--fs-sm); }
.head-meta span { display: inline-flex; align-items: center; gap: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--fg-3); margin-bottom: 10px; }
.back:hover { color: var(--fg); }
.back svg { width: 15px; height: 15px; }

.section-title { font-size: var(--fs-lg); letter-spacing: -0.012em; font-weight: 600; }
.section-sub { color: var(--fg-3); font-size: var(--fs-sm); margin-top: 2px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: var(--r-control);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px -12px var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--field); border-color: var(--line-2); color: var(--fg); }
.btn-secondary:hover { background: var(--panel-hover); }
.btn-ghost { background: transparent; color: var(--accent); padding: 0 10px; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: transparent; color: var(--lv-red); border-color: var(--line-2); }
.btn-danger:hover { background: var(--lv-red-bg); }
.btn-sm { height: 32px; padding: 0 12px; font-size: var(--fs-xs); border-radius: 9px; }
.btn[disabled], .btn.is-disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.link { color: var(--accent); font-weight: 500; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
  background: var(--accent-softer); color: var(--fg-2);
}
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lv-green { color: var(--lv-green); background: var(--lv-green-bg); }
.lv-yellow { color: var(--lv-yellow); background: var(--lv-yellow-bg); }
.lv-orange { color: var(--lv-orange); background: var(--lv-orange-bg); }
.lv-red { color: var(--lv-red); background: var(--lv-red-bg); }
.st-live { color: var(--accent); background: var(--accent-soft); }
.st-live .d { box-shadow: 0 0 0 3px var(--accent-soft); }
.st-shadow { color: #8A55B8; background: rgba(138, 85, 184, 0.12); }
.st-bench { color: var(--fg-2); background: var(--accent-softer); }
.st-retired { color: var(--fg-3); background: transparent; border: 1px dashed var(--line-2); }
.st-failed { color: var(--lv-red); background: var(--lv-red-bg); }
.st-ready { color: var(--lv-green); background: var(--lv-green-bg); }
:root[data-theme="dark"] .st-shadow { color: #C9A4F0; background: rgba(201, 164, 240, 0.13); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st-shadow { color: #C9A4F0; background: rgba(201, 164, 240, 0.13); } }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: var(--fs-xs); background: var(--field); border: 1px solid var(--line); color: var(--fg-2); white-space: nowrap; }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px 22px; min-width: 0; }
.panel h2 { font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head p { color: var(--fg-3); font-size: var(--fs-sm); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- Dashboard ---------- */
.dash-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 16px; align-items: stretch; }
.needs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.needs-list li { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.needs-list li:first-child { border-top: 0; padding-top: 4px; }
.needs-list .stripe { align-self: stretch; border-radius: 4px; background: var(--fg-3); }
.needs-list .t { font-weight: 600; font-size: var(--fs-sm); }
.needs-list .s { color: var(--fg-2); font-size: var(--fs-sm); margin-top: 1px; }
.stripe.ok { background: var(--lv-green); }
.stripe.warn { background: var(--lv-orange); }
.stripe.bad { background: var(--lv-red); }
.stripe.info { background: #8A55B8; }

.pipeline { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.pipe-col { display: flex; flex-direction: column; justify-content: center; gap: 8px; flex: 0 1 auto; min-width: 0; max-width: 190px; }
.pipe-col .pipe-node.start, .pipe-col .pipe-node.end { max-width: 160px; }
.pipe-col.models { flex: 1 1 0; min-width: 180px; max-width: none; }
.pipe-link { flex: none; width: 20px; display: grid; place-items: center; color: var(--fg-3); }
.pipe-link svg { width: 18px; height: 18px; }
.pipe-node {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 12px; background: var(--field); border: 1px solid var(--line);
  font-size: var(--fs-sm); transition: border-color 0.15s, background 0.15s;
}
a.pipe-node:hover { border-color: var(--accent); }
.pipe-node .n { font-weight: 600; line-height: 1.25; }
.pipe-col.models .pipe-node > span:first-child { min-width: 0; }
.pipe-node .v { font-size: var(--fs-xs); color: var(--accent); font-weight: 600; white-space: nowrap; }
.pipe-node .sh { font-size: 0.6875rem; color: #8A55B8; display: block; font-weight: 500; }
.pipe-node.start, .pipe-node.end { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; }
.pipe-cap { font-size: var(--fs-xs); color: var(--fg-3); }
.level-dots { display: flex; gap: 4px; }
.level-dots i { width: 12px; height: 12px; border-radius: 50%; display: block; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 16px 20px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; padding-left: 2px; }
.stat .k { font-size: var(--fs-sm); color: var(--fg-2); }
.stat .v { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; display: flex; align-items: baseline; gap: 8px; }
.stat .delta { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0; }
.up { color: var(--lv-green); }
.down { color: var(--lv-red); }
.stat svg { display: block; margin-top: 6px; width: 100%; height: 26px; }

.split { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; }
.split i { display: block; height: 100%; }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: var(--fs-xs); color: var(--fg-2); }
.split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.split-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--fg-3); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--line); }
.chart rect.bar:hover { opacity: 0.8; }

.resp-list { display: flex; flex-direction: column; gap: 12px; }
.resp-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 4px 12px; align-items: center; font-size: var(--fs-sm); }
.resp-row .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resp-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.track { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.track i.warn { background: var(--lv-orange); }
.resp-row .sub { grid-column: 1 / -1; color: var(--fg-3); font-size: var(--fs-xs); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.data th { text-align: left; font-weight: 500; color: var(--fg-3); font-size: var(--fs-xs); padding: 0 12px 10px; white-space: nowrap; border-bottom: 1px solid var(--line-2); }
table.data td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th:first-child, table.data td:first-child { padding-left: 4px; }
table.data tr.click { cursor: pointer; transition: background 0.12s; }
table.data tr.click:hover td { background: var(--accent-softer); }
table.data tr.group td { padding: 22px 4px 8px; border-bottom: 0; font-weight: 600; color: var(--fg-2); font-size: var(--fs-sm); background: transparent !important; cursor: default; }
table.data .strong { font-weight: 600; }
table.data .sub { color: var(--fg-3); font-size: var(--fs-xs); margin-top: 1px; }
table.data td.r, table.data th.r { text-align: right; }
table.data tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--lv-orange); }
.mini-progress { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.mini-progress .track { flex: 1; height: 5px; }
.mini-progress .track i { background: #8A55B8; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 32px; padding: 0 12px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 500;
  border: 1px solid var(--line-2); background: transparent; color: var(--fg-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { background: var(--panel-hover); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip .c { font-size: var(--fs-xs); opacity: 0.7; font-variant-numeric: tabular-nums; }
.field-search { position: relative; }
.field-search input { height: 34px; width: 240px; max-width: 100%; border-radius: 10px; border: 1px solid var(--line-2); background: var(--field); padding: 0 12px 0 32px; font-size: var(--fs-sm); }
.field-search svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--fg-3); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button {
  padding: 10px 14px; font-size: var(--fs-sm); font-weight: 500; color: var(--fg-3);
  border: 0; background: none; cursor: pointer; white-space: nowrap; position: relative;
}
.tabs a:hover, .tabs button:hover { color: var(--fg); }
.tabs .on { color: var(--fg); }
.tabs .on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }

/* ---------- Key/value ---------- */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 10px 22px; font-size: var(--fs-sm); }
.kv dt { color: var(--fg-3); }
.kv dd { margin: 0; min-width: 0; }
.live-strip { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.live-strip > div { padding: 14px 22px 14px 0; margin-right: 22px; border-right: 1px solid var(--line); min-width: 0; }
.live-strip > div:last-child { border-right: 0; }
.live-strip .k { color: var(--fg-3); font-size: var(--fs-xs); }
.live-strip .v { font-weight: 600; font-size: var(--fs-md); font-variant-numeric: tabular-nums; }

/* ---------- Stage track (version lifecycle) ---------- */
.stage-track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; margin: 4px 0 0; }
.stage-track::before { content: ""; position: absolute; left: 10%; right: 10%; top: 13px; height: 2px; background: var(--line-2); border-radius: 2px; }
.stage-track .fill { position: absolute; left: 10%; top: 13px; height: 2px; background: var(--accent); border-radius: 2px; transition: width 0.5s ease; }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 0 4px; }
.stage .node {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); border: 2px solid var(--line-2); color: var(--fg-3); position: relative; z-index: 1;
}
.stage .node svg { width: 14px; height: 14px; }
.stage.done .node { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stage.now .node { border-color: var(--accent); color: var(--accent); background: var(--bg); box-shadow: 0 0 0 6px var(--accent-soft); }
.stage.now .node::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.stage.now.shadow .node { border-color: #8A55B8; box-shadow: 0 0 0 6px rgba(138,85,184,0.14); }
.stage.now.shadow .node::after { background: #8A55B8; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.6); opacity: 0.6; } }
.stage .lbl { font-size: var(--fs-sm); font-weight: 600; }
.stage .when { font-size: var(--fs-xs); color: var(--fg-3); margin-top: -6px; }
.stage.future .lbl { color: var(--fg-3); font-weight: 500; }

/* ---------- Comparison ---------- */
.compare-rows { display: flex; flex-direction: column; }
.compare-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 80px 80px 70px; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.compare-row.head { border-top: 0; color: var(--fg-3); font-size: var(--fs-xs); padding-top: 0; }
.compare-row .r { text-align: right; font-variant-numeric: tabular-nums; }
.compare-row .new { font-weight: 600; }
.pairs { display: flex; flex-direction: column; gap: 14px; }
.pair-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; font-size: var(--fs-sm); }
.pair-bars { display: flex; flex-direction: column; gap: 4px; }
.pair-bars div { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; color: var(--fg-2); }
.pair-bars i { display: block; height: 8px; border-radius: 4px; }
.pair-bars i.n { background: var(--accent); }
.pair-bars i.o { background: var(--line-2); }
.legend { display: flex; gap: 14px; font-size: var(--fs-xs); color: var(--fg-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.matrix { display: grid; gap: 3px; font-size: var(--fs-xs); }
.matrix .cell { aspect-ratio: 1.6; border-radius: 6px; display: grid; place-items: center; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 0; }
.matrix .lab { color: var(--fg-3); display: flex; align-items: center; font-size: 0.6875rem; line-height: 1.2; min-width: 0; overflow: hidden; }
.matrix .lab.top { justify-content: center; text-align: center; align-items: flex-end; padding-bottom: 2px; }
.matrix-axis { font-size: var(--fs-xs); color: var(--fg-3); }

.shadow-box { border-radius: var(--r-panel); padding: 20px 22px; background: linear-gradient(135deg, rgba(138,85,184,0.10), rgba(201,195,232,0.18)); border: 1px solid rgba(138,85,184,0.22); }
.big-progress { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 12px 0 8px; }
.big-progress i { display: block; height: 100%; background: #8A55B8; border-radius: 6px; }
.shadow-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.shadow-stats .k { font-size: var(--fs-xs); color: var(--fg-2); }
.shadow-stats .v { font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.lock-note { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); color: var(--fg-2); margin-top: 14px; }
.lock-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* ---------- Wizard ---------- */
.wizard { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 34px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.steps li button {
  width: 100%; display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 12px; border: 0; background: none; text-align: left; cursor: pointer;
}
.steps li button:hover:not([disabled]) { background: var(--panel-hover); }
.steps li button[disabled] { cursor: default; }
.steps .sn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 600; border: 1.5px solid var(--line-2); color: var(--fg-3); font-variant-numeric: tabular-nums; }
.steps .sn svg { width: 14px; height: 14px; }
.steps .st { font-size: var(--fs-sm); font-weight: 500; color: var(--fg-3); }
.steps .sd { font-size: var(--fs-xs); color: var(--fg-3); }
.steps li.done .sn { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.steps li.done .st { color: var(--fg-2); }
.steps li.cur button { background: var(--glass-strong); }
.steps li.cur .sn { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.steps li.cur .st { color: var(--fg); font-weight: 600; }
.wiz-body { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.wiz-body h2 { font-size: var(--fs-xl); letter-spacing: -0.02em; font-stretch: 90%; font-variation-settings: "wdth" 90; }
.wiz-body .intro { color: var(--fg-2); margin-top: 6px; max-width: 64ch; }
.wiz-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.model-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.model-pick label {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--field); transition: border-color 0.15s, background 0.15s;
}
.model-pick label:hover { border-color: var(--line-2); }
.model-pick input { position: absolute; opacity: 0; pointer-events: none; }
.model-pick label.on { border-color: var(--accent); background: var(--accent-softer); }
.model-pick .n { font-weight: 600; font-size: var(--fs-sm); }
.model-pick .s { color: var(--fg-3); font-size: var(--fs-xs); }

.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: 20px; padding: 34px 24px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  background: var(--panel); transition: border-color 0.15s, background 0.15s;
}
.dropzone.drag { border-color: var(--accent); background: var(--accent-softer); }
.dropzone .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.dropzone .ic svg { width: 22px; height: 22px; }
.dropzone .t { font-weight: 600; font-size: var(--fs-md); }
.dropzone .s { color: var(--fg-3); font-size: var(--fs-sm); max-width: 52ch; }
.dropzone .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.file-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 16px; background: var(--field); border: 1px solid var(--line); }
.file-card .fi { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 0.6875rem; font-weight: 700; }
.file-card .fn { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card .fs { color: var(--fg-3); font-size: var(--fs-xs); }
.inspect { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.inspect > div { padding: 12px 14px; border-left: 1px solid var(--line); background: var(--panel); }
.inspect > div:first-child { border-left: 0; }
.inspect .k { font-size: var(--fs-xs); color: var(--fg-3); }
.inspect .v { font-weight: 600; font-variant-numeric: tabular-nums; }

.toggle-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.toggle-row .t { font-weight: 600; font-size: var(--fs-sm); }
.toggle-row .s { color: var(--fg-3); font-size: var(--fs-xs); margin-top: 1px; }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 38px; height: 22px; flex: none; margin-top: 1px; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 11px; background: var(--line-2); transition: background 0.15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: var(--fs-sm); font-weight: 500; }
.field .hint { font-size: var(--fs-xs); color: var(--fg-3); }
.input, .select, .textarea {
  width: 100%; height: 40px; border-radius: var(--r-control); border: 1px solid var(--line-2);
  background: var(--field); padding: 0 12px; font-size: var(--fs-sm);
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%), linear-gradient(135deg, var(--fg-3) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.select.sm { height: 34px; background-position: calc(100% - 17px) 14px, calc(100% - 12px) 14px; }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; font-size: var(--fs-sm); font-weight: 500; color: var(--fg-2); cursor: pointer; }
.seg button.on { background: var(--glass-strong); color: var(--fg); box-shadow: 0 1px 3px rgba(28,35,64,0.12); }
.setting-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.setting-row:first-child { border-top: 0; }
.setting-row .label { font-size: var(--fs-sm); font-weight: 500; }
.setting-row .hint { font-size: var(--fs-xs); color: var(--fg-3); }

.prep-preview { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.prep-preview figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.prep-preview figcaption { font-size: var(--fs-xs); color: var(--fg-3); }
.prep-preview svg.arrow { width: 22px; height: 22px; color: var(--fg-3); }

.zone-bar { position: relative; height: 40px; border-radius: 12px; overflow: hidden; display: flex; font-size: var(--fs-xs); font-weight: 600; }
.zone-bar div { display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; transition: width 0.2s; min-width: 0; }
.zone-bar .z0 { background: var(--line); color: var(--fg-3); }
.zone-bar .z1 { background: var(--accent-soft); color: var(--accent); }
.zone-bar .z2 { background: var(--accent); color: var(--on-accent); }
.zone-scale { display: flex; justify-content: space-between; font-size: 0.6875rem; color: var(--fg-3); margin-top: 6px; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(54px, auto); gap: 12px; align-items: center; }
.range-row output { white-space: nowrap; }
.range-row output { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.check-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.check-list li:first-child { border-top: 0; }
.check-list .ci { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-2); }
.check-list .ci svg { width: 12px; height: 12px; }
.check-list li.ok .ci { background: var(--lv-green); border-color: var(--lv-green); color: #fff; }
.check-list li.run .ci { border-color: var(--accent); border-top-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check-list .res { color: var(--fg-2); font-variant-numeric: tabular-nums; font-size: var(--fs-xs); }
.diff { color: var(--accent); font-weight: 600; font-size: var(--fs-xs); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: var(--fs-sm); background: var(--accent-softer); color: var(--fg-2); border: 1px solid var(--line); }
.notice svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.notice.warn { background: var(--lv-orange-bg); border-color: transparent; color: var(--fg); }
.notice.warn svg { color: var(--lv-orange); }
.notice.ok { background: var(--lv-green-bg); border-color: transparent; color: var(--fg); }
.notice.ok svg { color: var(--lv-green); }

/* ---------- Photos ---------- */
.photo { border-radius: 14px; position: relative; overflow: hidden; flex: none; aspect-ratio: 1; max-width: 100%; }
.photo::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,0.18), transparent 55%), radial-gradient(140% 120% at 50% 50%, transparent 55%, rgba(0,0,0,0.18)); }
.photo .ph-tag { position: absolute; left: 8px; bottom: 8px; z-index: 1; font-size: 0.6875rem; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: rgba(20,22,40,0.55); color: #fff; }
.photo-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Patient / check ---------- */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-head .avatar { width: 56px; height: 56px; font-size: 1.05rem; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; position: relative; font-size: var(--fs-sm); }
.timeline li::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: -2px; width: 2px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.timeline .tn { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--bg); display: grid; place-items: center; z-index: 1; }
.timeline .tn svg { width: 11px; height: 11px; }
.timeline li.done .tn { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.timeline li.done::before { background: var(--accent); }
.timeline .tt { font-weight: 600; }
.timeline .tw { color: var(--fg-3); font-size: var(--fs-xs); }
.timeline li.future .tt { color: var(--fg-3); font-weight: 500; }

.cond-bars { display: flex; flex-direction: column; gap: 10px; }
.cond-bar { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 48px; gap: 12px; align-items: center; font-size: var(--fs-sm); }
.cond-bar .track { height: 8px; }
.cond-bar .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cond-bar.below .track i { background: var(--fg-3); opacity: 0.5; }
.model-result { padding: 14px 0; border-top: 1px solid var(--line); }
.model-result:first-of-type { border-top: 0; padding-top: 0; }
.model-result .mh { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; font-size: var(--fs-sm); flex-wrap: wrap; }
.model-result.shadowed { opacity: 0.75; }
.flag-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--lv-orange-bg); font-size: var(--fs-sm); }
.flag-row svg { width: 16px; height: 16px; color: var(--lv-orange); flex: none; margin-top: 2px; }
.answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; font-size: var(--fs-sm); }
.answers .q { color: var(--fg-3); font-size: var(--fs-xs); }
.answers .a { font-weight: 500; }
.result-hero { border-radius: var(--r-panel); padding: 20px 22px; border: 1px solid var(--line); }
.result-hero.lv-orange { background: linear-gradient(135deg, var(--lv-orange-bg), transparent 80%); color: inherit; }
.result-hero.lv-green { background: linear-gradient(135deg, var(--lv-green-bg), transparent 80%); color: inherit; }
.result-hero.lv-yellow { background: linear-gradient(135deg, var(--lv-yellow-bg), transparent 80%); color: inherit; }
.result-hero.lv-red { background: linear-gradient(135deg, var(--lv-red-bg), transparent 80%); color: inherit; }
.result-hero .lvl { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.01em; margin: 8px 0 4px; }
.doctor-note { padding: 14px 16px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); font-size: var(--fs-sm); line-height: 1.6; }
.spots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.spot-series { display: flex; gap: 8px; margin-top: 10px; }
.spot-series .photo { width: 31%; }
.spot-series small { display: block; font-size: 0.6875rem; color: var(--fg-3); margin-top: 4px; }

/* ---------- Coming soon ---------- */
.soon-wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 34px; align-items: center; flex: 1; }
.soon-art { aspect-ratio: 1.15; border-radius: 26px; position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); max-width: 100%; }
.soon-art span { position: absolute; border-radius: 50%; filter: blur(30px); }
.soon-art em { position: absolute; left: 24px; bottom: 20px; font-style: normal; font-size: var(--fs-sm); color: var(--fg-2); font-weight: 500; }
.soon-list { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 10px; }
.soon-list li { display: flex; gap: 10px; font-size: var(--fs-sm); color: var(--fg-2); }
.soon-list li svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: var(--overlay); display: grid; place-items: center; padding: 20px; animation: fade 0.18s ease; }
.overlay.drawer-ov { place-items: stretch end; padding: 12px; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--bg); border: 1px solid var(--glass-edge); border-radius: 24px; box-shadow: var(--float-shadow);
  padding: 26px; display: flex; flex-direction: column; gap: 18px; animation: rise 0.22s ease;
}
.drawer { width: min(520px, 100%); background: var(--bg); border-radius: 24px; box-shadow: var(--float-shadow); display: flex; flex-direction: column; animation: slide 0.25s ease; overflow: hidden; border: 1px solid var(--glass-edge); }
.drawer-body { flex: 1; overflow-y: auto; padding: 26px; display: flex; flex-direction: column; gap: 20px; }
.drawer-foot { padding: 16px 26px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.modal h2, .drawer h2 { font-size: var(--fs-lg); letter-spacing: -0.015em; }
.modal .mfoot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.change-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); }
.change-list li { display: flex; gap: 10px; align-items: flex-start; }
.change-list li svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-list label { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; font-size: var(--fs-sm); }
.radio-list label.on { border-color: var(--accent); background: var(--accent-softer); }
.radio-list input { accent-color: var(--accent); margin: 0; }
.radio-list .s { color: var(--fg-3); font-size: var(--fs-xs); }

.toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; padding: 0 16px; width: 100%; }
.toast { background: var(--fg); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-size: var(--fs-sm); font-weight: 500; box-shadow: var(--float-shadow); display: flex; gap: 10px; align-items: center; animation: rise 0.2s ease; max-width: 100%; }
.toast svg { width: 16px; height: 16px; flex: none; }

.empty-state { padding: 36px 20px; text-align: center; color: var(--fg-3); font-size: var(--fs-sm); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .dash-top, .grid-main { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; padding-left: 2px; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 920px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 70; left: 0; top: 0; width: 270px; transform: translateX(-105%); transition: transform 0.25s ease; padding: 10px; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: var(--overlay); z-index: 65; }
  .menu-btn { display: grid; }
  .main { padding: 10px 16px 40px; }
  .sheet { padding: 22px 18px 28px; border-radius: 22px; }
  .wizard { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .steps { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .steps li { flex: none; }
  .steps .sd { display: none; }
  .soon-wrap, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .search { width: auto; flex: 1; max-width: 260px; }
  .crumbs { display: none; }
}
@media (max-width: 640px) {
  .page-title { font-size: var(--fs-xl); }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat { border-left: 0 !important; padding-left: 2px !important; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: 0; }
  .form-grid, .answers, .shadow-stats { grid-template-columns: minmax(0, 1fr); }
  .form-grid .full { grid-column: auto; }
  .inspect { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspect > div:nth-child(3) { border-left: 0; }
  .inspect > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .setting-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pair-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .compare-row { grid-template-columns: minmax(0, 1fr) 56px 56px 50px; }
  .cond-bar { grid-template-columns: minmax(0, 110px) minmax(0, 1fr) 42px; }
  .search { max-width: none; }
  .top-upload span { display: none; }
  .top-upload { width: 38px; padding: 0; }
  .popover { width: min(320px, calc(100vw - 32px)); }
  .stage .lbl { font-size: var(--fs-xs); }
}

/* ---------- Additions ---------- */
.stage.now.failed .node { border-color: var(--lv-red); color: var(--lv-red); box-shadow: 0 0 0 6px var(--lv-red-bg); }
.stage.now.failed .node::after { display: none; }
.stage.now.failed .lbl { color: var(--lv-red); }
.stage.future.next .node { border-color: var(--lv-green); border-style: dashed; }
.cond-bar .track { position: relative; overflow: visible; }
.cond-bar .track i { border-radius: 4px; }
.cond-bar .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--fg-2); opacity: 0.7; }
a.resp-row:hover .name { color: var(--accent); }
.steps li button > span:last-child { min-width: 0; }
.wiz-body .panel h2 { font-size: var(--fs-md); letter-spacing: -0.01em; font-stretch: 100%; font-variation-settings: normal; }
.kv dd .link { margin-left: 6px; font-size: var(--fs-xs); }
.nowrap { white-space: nowrap; }

/* ---------- Performance ---------- */
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; font-size: 0.6875rem; font-weight: 600; background: rgba(138, 85, 184, 0.14); color: #8A55B8; }
.sub-k { font-size: var(--fs-xs); color: var(--fg-3); margin-top: 2px; }
.hbar { display: block; height: 8px; border-radius: 5px; background: var(--line); overflow: hidden; min-width: 60px; flex: 1; }
.hbar i { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.hbar.warn i { background: var(--lv-orange); }
.hbar.big { height: 14px; border-radius: 8px; }
.hbar.big.t i { background: var(--fg-3); opacity: 0.55; }
.hbar.big.b i { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.bar-cell { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.bar-cell .num { min-width: 38px; text-align: right; font-weight: 600; }
table.data tr.is-low td { color: var(--fg-3); }
table.data tr.is-low .hbar i { opacity: 0.4; }
.ladder { display: flex; flex-direction: column; gap: 16px; }
.ladder-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 64px; gap: 16px; align-items: center; }
.ladder-row .lk { font-weight: 600; font-size: var(--fs-sm); }
.ladder-row .ls { font-size: var(--fs-xs); color: var(--fg-3); }
.ladder-row .lv { font-size: var(--fs-lg); font-weight: 600; text-align: right; letter-spacing: -0.01em; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.mini-stats > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini-stats .k { font-size: var(--fs-xs); color: var(--fg-3); }
.mini-stats .v { font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.other-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; font-size: var(--fs-sm); }
.other-grid .strong { font-weight: 600; }
.th-out { display: flex; flex-direction: column; margin-top: 14px; }
.th-row { display: grid; grid-template-columns: minmax(0, 1.5fr) 64px 64px 70px; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); align-items: center; }
.th-row > span:not(:first-child) { text-align: right; }
.th-row.head { border-top: 0; color: var(--fg-3); font-size: var(--fs-xs); padding-top: 0; }
.th-row .strong { font-weight: 600; }
.compare-box { display: flex; flex-direction: column; }
.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.duel > div { padding: 14px 16px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
.duel .dk { font-size: var(--fs-xs); color: var(--fg-3); }
.duel .dv { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.02em; }
.win-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.win-row .strong { font-weight: 600; }
.verdict { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: var(--fs-sm); background: var(--accent-softer); border: 1px solid var(--line); }
.verdict svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.verdict.real { background: var(--lv-green-bg); border-color: transparent; }
.verdict.real svg { color: var(--lv-green); }
.mix-list { list-style: none; margin: 0; padding: 0; counter-reset: mix; }
.mix-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.mix-list li:first-child { border-top: 0; padding-top: 0; }
.mix-list .strong { font-weight: 600; }
.mix-list .sub { color: var(--fg-3); font-size: var(--fs-xs); }
.matrix .cell.off { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lv-orange) 35%, transparent); }
table.data.heat td.c, table.data.heat th.c { text-align: center; }
.heat-cell { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 96px; padding: 7px 10px; border-radius: 10px; line-height: 1.2; }
.heat-cell b { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.heat-cell small { font-size: 0.6875rem; opacity: 0.75; }
.heat-cell.low { background: repeating-linear-gradient(135deg, var(--line), var(--line) 4px, transparent 4px, transparent 8px); color: var(--fg-3); }
.heat-cell.flag { background: var(--lv-orange-bg); color: var(--lv-orange); box-shadow: inset 0 0 0 1.5px var(--lv-orange); }
.heat-cell.none { color: var(--fg-3); font-size: var(--fs-xs); }
.level-table { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: var(--fs-sm); min-width: 440px; }
.level-table th { font-weight: 500; color: var(--fg-3); font-size: var(--fs-xs); text-align: center; padding: 4px; }
.level-table tbody th { text-align: left; color: var(--fg); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
.lc { text-align: center; padding: 12px 6px; border-radius: 12px; }
.lc b { display: block; font-size: var(--fs-lg); }
.lc small { font-size: 0.6875rem; }
.lc.ok { background: var(--lv-green-bg); color: var(--lv-green); }
.lc.under { background: var(--lv-red-bg); color: var(--lv-red); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--lv-red) 40%, transparent); }
.lc.over { background: var(--lv-orange-bg); color: var(--lv-orange); }
.cov-list { display: flex; flex-direction: column; gap: 10px; }
.cov-row { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr) 36px; gap: 12px; align-items: center; font-size: var(--fs-sm); }
.cov-row .num { text-align: right; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); font-size: var(--fs-sm); }
.bulk-bar > span { margin-right: 6px; }
.cbx { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.tree { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); font-size: var(--fs-xs); line-height: 1.7; white-space: pre; overflow-x: auto; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--fg-2); }
@media (max-width: 640px) {
  .ladder-row { grid-template-columns: minmax(0, 1fr) 60px; }
  .ladder-row .hbar { grid-column: 1 / -1; grid-row: 2; }
  .mini-stats, .other-grid { grid-template-columns: minmax(0, 1fr); }
  .th-row { grid-template-columns: minmax(0, 1fr) 50px 50px 60px; }
  .cov-row { grid-template-columns: minmax(0, 110px) minmax(0, 1fr) 30px; }
}

/* ---------- Content and settings pages ---------- */
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.icon-btn[disabled] { opacity: 0.35; cursor: default; }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85em; padding: 1px 5px; border-radius: 5px; background: var(--line); }
.sticky-col { position: sticky; top: 16px; align-self: start; }
.rb-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rb-row .select, .rb-row .input { flex: 1; min-width: 140px; width: auto; }

.photo-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.photo-grid figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.photo-grid figcaption { font-size: var(--fs-xs); color: var(--fg-3); }
.add-tile { width: 120px; aspect-ratio: 1; border-radius: 14px; border: 1.5px dashed var(--line-2); background: transparent; color: var(--fg-3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-size: var(--fs-xs); }
.add-tile:hover { border-color: var(--accent); color: var(--accent); }
.add-tile svg { width: 20px; height: 20px; }
.add-tile.sm { width: 44px; height: 44px; aspect-ratio: auto; border-radius: 12px; }

.level-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.level-pick button { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--field); cursor: pointer; color: var(--fg); font-size: var(--fs-sm); }
.level-pick button .d { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; margin-top: 4px; }
.level-pick button.lv-green .d { color: var(--lv-green); } .level-pick button.lv-yellow .d { color: var(--lv-yellow); }
.level-pick button.lv-orange .d { color: var(--lv-orange); } .level-pick button.lv-red .d { color: var(--lv-red); }
.level-pick button { background: var(--field); }
.level-pick button small { color: var(--fg-3); font-size: var(--fs-xs); }
.level-pick button.on { border-color: var(--accent); background: var(--accent-softer); box-shadow: 0 0 0 3px var(--accent-soft); }
.cov-model { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); font-size: var(--fs-sm); }
.cov-model:hover { border-color: var(--accent); }

.suggest-card { display: flex; justify-content: space-between; gap: 20px; align-items: center; flex-wrap: wrap; padding: 20px 22px; border-radius: var(--r-panel); background: linear-gradient(135deg, rgba(138,85,184,0.10), rgba(201,195,232,0.18)); border: 1px solid rgba(138,85,184,0.22); }
.suggest-card > div:first-child { flex: 1; min-width: 260px; }
.suggest-card h3 { font-size: var(--fs-md); margin: 10px 0 4px; }
.suggest-card p { font-size: var(--fs-sm); color: var(--fg-2); max-width: 70ch; }
.rule-when { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.cond-chip { display: inline-flex; gap: 4px; align-items: center; padding: 3px 9px; border-radius: 8px; background: var(--field); border: 1px solid var(--line); font-size: var(--fs-xs); color: var(--fg-2); }
.cond-chip b { color: var(--fg); font-weight: 600; }
.rule-when .join { font-size: var(--fs-xs); color: var(--fg-3); }
table.data tr.is-off td { opacity: 0.55; }
table.data tr.is-off td:first-child { opacity: 1; }

.q-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.q-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.q-list li.on { border-color: var(--accent); background: var(--accent-softer); }
.q-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; border: 0; background: none; padding: 6px; cursor: pointer; border-radius: 10px; }
.qn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: var(--fs-xs); }
.qt { display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-sm); }
.q-meta { display: flex; gap: 4px; flex-wrap: wrap; }
.q-when { font-size: var(--fs-xs); color: var(--fg-3); }
.q-tools { display: flex; gap: 4px; flex: none; }

.phone-wrap { display: flex; flex-direction: column; align-items: center; }
.phone { width: 272px; max-width: 100%; height: 560px; border-radius: 40px; padding: 10px; background: #1C2340; box-shadow: var(--float-shadow); position: relative; }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 76px; height: 20px; border-radius: 12px; background: #0E1226; z-index: 2; }
.phone-screen { height: 100%; border-radius: 31px; overflow-y: auto; background: #F6F5F8; color: #1C2340; padding: 46px 14px 16px; font-size: 12.5px; line-height: 1.45; scrollbar-width: none; position: relative; }
.phone-screen::-webkit-scrollbar { display: none; }
.chat { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 86%; padding: 9px 12px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(28,35,64,0.08); }
.bubble.bot { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: #3D4BB8; color: #fff; border-bottom-right-radius: 6px; }
.bubble.sos { align-self: flex-start; background: #FBE3E7; color: #8E1F33; font-weight: 600; }
.bubble.hl { box-shadow: 0 0 0 2px #3D4BB8; }
.bubble small { display: block; color: #7B819C; font-size: 11px; margin-top: 4px; }
.qr { display: flex; flex-wrap: wrap; gap: 6px; }
.qr span { padding: 6px 11px; border-radius: 999px; border: 1.5px solid #3D4BB8; color: #3D4BB8; font-weight: 600; font-size: 11.5px; background: #fff; }
.body-map { height: 150px; border-radius: 14px; background: #fff; position: relative; }
.body-map span { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: 46px; height: 122px; border-radius: 23px 23px 12px 12px; background: linear-gradient(#E6D3C8, #DCC4B6); box-shadow: 0 -18px 0 -6px #E6D3C8; }
.chat-input { padding: 10px 12px; border-radius: 12px; background: #fff; color: #9AA0B8; }
.chat-try { position: sticky; bottom: -16px; display: flex; gap: 6px; margin: 12px -14px -16px; padding: 10px 12px; background: #F6F5F8; border-top: 1px solid rgba(28,35,64,0.08); }
.chat-try input { flex: 1; min-width: 0; border: 1px solid rgba(28,35,64,0.15); border-radius: 10px; padding: 0 10px; font-size: 12px; background: #fff; color: #1C2340; }
.chat-try .btn { height: 30px; }

.plan-prev { display: flex; flex-direction: column; gap: 12px; }
.pp-head { background: #fff; border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pp-head h4 { font-size: 15px; }
.pp-head p { color: #4C5373; }
.pp-sec { background: #fff; border-radius: 14px; padding: 10px 12px; }
.pp-sec h5 { font-size: 11px; color: #7B819C; font-weight: 600; margin: 0 0 4px; }
.pp-sec ol, .pp-sec ul { margin: 0; padding-left: 18px; }
.pp-sec.warn { background: #FDF0E8; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pp-chips span { padding: 3px 8px; border-radius: 999px; background: #ECEDFA; color: #3D4BB8; font-size: 11px; font-weight: 600; }
.pp-check { text-align: center; padding: 10px; border-radius: 12px; background: #3D4BB8; color: #fff; font-weight: 600; }
.phone-screen .pill { font-size: 10.5px; height: 20px; }

.list-ed { display: flex; flex-direction: column; gap: 8px; }
.le-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 30px; gap: 8px; align-items: center; }
.le-n { font-size: var(--fs-xs); color: var(--fg-3); text-align: right; font-variant-numeric: tabular-nums; }
.list-ed .btn-ghost { align-self: flex-start; }
.title-input { width: 100%; border: 0; background: transparent; font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.025em; font-stretch: 88%; font-variation-settings: "wdth" 88; padding: 2px 6px; margin-left: -6px; border-radius: 10px; color: var(--fg); }
.title-input:hover { background: var(--panel); }
.title-input:focus { outline: none; background: var(--field); box-shadow: 0 0 0 3px var(--accent-soft); }
.chip-x { border: 0; background: none; color: inherit; padding: 0; margin-left: 2px; cursor: pointer; display: inline-grid; place-items: center; opacity: 0.7; }
.chip-x svg { width: 13px; height: 13px; }

.post-list { display: flex; flex-direction: column; gap: 8px; }
.post-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); transition: border-color 0.15s; }
.post-row:hover { border-color: var(--accent); }
.post-cover { border-radius: 12px; min-height: 72px; }
.post-main { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-sm); min-width: 0; }
.post-main .strong { font-weight: 600; font-size: var(--fs-base); }
.post-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: var(--fs-xs); }
.cover-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.cover-pick button { width: 44px; height: 44px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; }
.cover-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.md-toolbar { display: flex; gap: 4px; flex-wrap: wrap; }
.md-toolbar button { border: 1px solid var(--line-2); background: var(--field); border-radius: 8px; padding: 4px 10px; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; color: var(--fg-2); }
.md-toolbar button:hover { color: var(--accent); border-color: var(--accent); }
.textarea.md { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: var(--fs-xs); line-height: 1.7; }
.post-prev h4 { font-size: 16px; margin: 10px 0 4px; }
.pv-cover { height: 120px; border-radius: 16px; position: relative; }
.pv-cover span { position: absolute; left: 10px; bottom: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,0.8); font-size: 10.5px; font-weight: 600; color: #1C2340; }
.pv-sum { color: #4C5373; margin-bottom: 8px; }
.pv-body h5 { font-size: 13px; margin: 10px 0 4px; }
.pv-body p { margin: 0 0 8px; }
.pv-body ul { margin: 0 0 8px; padding-left: 18px; }

.act-day { display: flex; flex-direction: column; gap: 10px; }
.act-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.act-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.act-list li:first-child { border-top: 0; }
.act-list li.new .act-ic { background: var(--accent); color: var(--on-accent); }
.act-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.act-ic svg { width: 16px; height: 16px; }
.act-main a:hover { color: var(--accent); }
.act-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--fg-3); font-size: var(--fs-xs); margin-top: 3px; }

.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.set-nav a { padding: 9px 12px; border-radius: 10px; font-size: var(--fs-sm); font-weight: 500; color: var(--fg-2); }
.set-nav a:hover { background: var(--panel-hover); color: var(--fg); }
.set-nav a.on { background: var(--glass-strong); color: var(--accent); }
.set-body { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.notif-row { display: flex; flex-direction: column; gap: 12px; }
.notif-head { display: flex; gap: 12px; align-items: center; }
.notif-prev { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); max-width: 420px; font-size: var(--fs-xs); }
.notif-prev.off { opacity: 0.45; }
.notif-prev div { display: flex; flex-direction: column; }
.np-app { width: 26px; height: 26px; border-radius: 7px; flex: none; background: linear-gradient(135deg, var(--apricot), var(--lilac)); }
.sos-screen { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sos-screen h4 { font-size: 17px; color: #8E1F33; }
.sos-btn { width: 100%; text-align: center; padding: 12px; border-radius: 14px; background: #BC2E45; color: #fff; font-weight: 700; font-size: 14px; }
.sos-near { width: 100%; padding: 10px 12px; border-radius: 12px; background: #fff; font-size: 12px; }

@media (max-width: 1180px) { .sticky-col { position: static; } }
@media (max-width: 920px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; }
  .set-nav a { white-space: nowrap; }
}
@media (max-width: 640px) {
  .level-pick { grid-template-columns: minmax(0, 1fr); }
  .title-input { font-size: var(--fs-xl); }
  .post-row { grid-template-columns: 60px minmax(0, 1fr); }
  .q-list li { flex-wrap: wrap; }
  .q-tools { margin-left: 42px; }
}

/* ---------- Feedback round 1: line-up, labels, chat history ---------- */
.lineup .panel-head { margin-bottom: 10px; }
.lineup-table td { padding-top: 10px; padding-bottom: 10px; }
.slot-select { width: 100%; max-width: 340px; }
.live-strip .slot-select { font-size: var(--fs-sm); font-weight: 600; height: 32px; min-width: 170px; margin-top: 2px; }
.pipe-node.off { opacity: 0.55; border-style: dashed; }
.rule-box { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: var(--fs-sm); background: var(--lv-green-bg); color: var(--fg); }
.rule-box svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--lv-green); }
.labels-table .lbl-prompt { height: 34px; font-size: var(--fs-sm); }
.labels-table td { vertical-align: middle; }
.ci-spin { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin 0.8s linear infinite; vertical-align: -1px; }
.compare-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 14px; margin-top: 6px; border-top: 1px dashed var(--line-2); }
.model-result.compare { border-top: 0; padding-top: 12px; }
.transcript-wrap { max-height: 520px; overflow-y: auto; padding: 4px 6px 4px 2px; border-radius: 12px; }
.transcript { display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-sm); }
.t-msg { display: flex; flex-direction: column; max-width: 78%; gap: 3px; }
.t-msg.t-me { align-self: flex-end; align-items: flex-end; }
.t-msg.t-bot { align-self: flex-start; }
.t-who { font-size: var(--fs-xs); color: var(--fg-3); font-weight: 600; }
.t-who time { font-weight: 400; margin-left: 4px; }
.t-bubble { padding: 9px 13px; border-radius: 16px; background: var(--field); border: 1px solid var(--line); line-height: 1.45; }
.t-msg.t-bot .t-bubble { border-bottom-left-radius: 6px; }
.t-msg.t-me .t-bubble { background: var(--accent); color: var(--on-accent); border-color: transparent; border-bottom-right-radius: 6px; }
.t-tag { font-size: 0.6875rem; color: var(--accent); font-weight: 600; }
.t-sys { align-self: center; text-align: center; font-size: var(--fs-xs); color: var(--fg-2); padding: 5px 12px; border-radius: 999px; background: var(--accent-softer); border: 1px solid var(--line); max-width: 90%; }
.chat-card-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.chat-card-head .strong { font-weight: 600; }
@media (max-width: 640px) { .t-msg { max-width: 92%; } .slot-select { max-width: none; } }
.cond-bar .track { grid-column: auto; }
