/* QA Hub — design tokens and components. Light and dark themes. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --bg: #F5F6F8; --side: #FFFFFF; --surface: #FFFFFF; --surface2: #F1F3F6; --border: #E2E6EC; --border-strong: #CBD2DC;
  --text: #111827; --muted: #586273; --on-accent: #FFFFFF; --on-solid: #FFFFFF;
  --accent: #3651D9; --accent-text: #2B45C6; --accent-soft: #ECEFFD;
  --pass: #0F7B45; --pass-soft: #E4F4EB; --fail: #C2352B; --fail-soft: #FCEAE8;
  --warn: #A35D06; --warn-soft: #FDF0DC; --violet: #6C3ED0; --violet-soft: #F0E9FD;
  --teal: #0E7490; --teal-soft: #E0F3F7; --pink: #B62A74; --pink-soft: #FBE7F1;
  --shadow: 0 1px 2px rgba(16,24,40,.05); --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
  --radius: 14px; --radius-sm: 10px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0B0E14; --side: #10141C; --surface: #141A24; --surface2: #1B2231; --border: #262F40; --border-strong: #36425A;
  --text: #E8EBF1; --muted: #9CA5B6; --on-accent: #0B0E14; --on-solid: #0B0E14;
  --pass: #44CF8E; --pass-soft: rgba(68,207,142,.14); --fail: #FF7B70; --fail-soft: rgba(255,123,112,.14);
  --warn: #F2B24C; --warn-soft: rgba(242,178,76,.14); --violet: #BA9CFF; --violet-soft: rgba(186,156,255,.15);
  --teal: #4FD1E0; --teal-soft: rgba(79,209,224,.14); --pink: #F58CC2; --pink-soft: rgba(245,140,194,.14);
  --shadow: none; --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.btn:hover, .nav a:hover, .list-row:hover, .row-link:hover, .tabs a:hover, .tree a:hover, .rc-item:hover, .bcard:hover, .file:hover, .menu-pop a:hover, .brand:hover, .proj-card:hover, .pill:hover, .seg-ctl a:hover { text-decoration: none; }
.prose a, .step-a a, .step-e a, .comment .body a { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 15.5px; font-weight: 600; }
h3 { font-size: 14.5px; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ic { flex: none; vertical-align: middle; }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* ---------- app shell ---------- */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 240px; max-width: 100%; background: var(--side); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; }
.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.nav-toggle { display: none; }
@media (max-width: 899px) {
  .sidebar { display: none; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
  .nav-open .sidebar { display: flex; }
  .nav-toggle { display: inline-flex; }
  .topbar .search { order: 3; flex-basis: 100%; max-width: none; }
}
@media (min-width: 900px) { .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; max-width: 260px; } }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; text-decoration: none; color: var(--text); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; display: block; }
.brand-sub { font-size: 11.5px; color: var(--muted); display: block; }
.proj-switch { position: relative; }
.proj-switch > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); cursor: pointer; }
.proj-switch > summary::-webkit-details-marker { display: none; }
.keychip { font-family: var(--mono); font-size: 11.5px; font-weight: 600; padding: 3px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 9px; text-decoration: none; font-weight: 500; color: var(--muted); }
.nav a:hover { background: var(--surface2); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent-text); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--surface2); color: var(--muted); }
.nav .count.hot { background: var(--fail-soft); color: var(--fail); }
.nav-label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 10px 4px; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.pdot { width: 8px; height: 8px; border-radius: 3px; flex: none; background: var(--accent); }
.theme-switch { margin-top: 8px; display: flex; gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface2); }
.theme-switch button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; }
.theme-switch button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.12); }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--border); background: var(--side); position: sticky; top: 0; z-index: 20; }
.search { flex: 1 1 260px; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface2); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; color: var(--text); }
.kbd { font-family: var(--mono); font-size: 11.5px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.icon-btn .badge { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--fail); color: var(--on-solid); font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; display: flex; flex-direction: column; }
.menu-pop.left { left: 0; right: auto; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 8px; text-decoration: none; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface2); color: var(--text); }
.menu-pop .sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu-pop .head { padding: 8px 10px; font-size: 12.5px; color: var(--muted); }
.notif-pop { width: 340px; max-height: 420px; overflow-y: auto; }
.notif { display: block !important; padding: 10px !important; min-height: 0 !important; }
.notif.unread { background: var(--accent-soft); }
.notif .t { display: block; font-size: 13px; }
.notif .w { display: block; font-size: 12px; color: var(--muted); }

.page { width: 100%; max-width: 1240px; padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.page.wide { max-width: none; }
.page.narrow { max-width: 820px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.page-head .titles { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- buttons & forms ---------- */
.btn { height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface2); color: var(--text); }
.btn-primary { border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent); color: var(--on-accent); filter: brightness(1.06); }
.btn-danger { border: 0; background: var(--fail); color: var(--on-solid); font-weight: 600; }
.btn-danger:hover { background: var(--fail); color: var(--on-solid); filter: brightness(1.06); }
.btn-pass { border: 0; background: var(--pass); color: var(--on-solid); font-weight: 600; }
.btn-pass:hover { background: var(--pass); color: var(--on-solid); filter: brightness(1.06); }
.btn-fail { border: 1px solid var(--fail); background: var(--fail-soft); color: var(--fail); font-weight: 600; }
.btn-fail:hover { background: var(--fail-soft); color: var(--fail); filter: brightness(.98); }
.btn-warn { border: 1px solid var(--warn); background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.btn-warn:hover { background: var(--warn-soft); color: var(--warn); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 34px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-link { border: 0; background: none; color: var(--accent-text); padding: 0; height: auto; font: inherit; cursor: pointer; }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; }
form { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field > label:not(.check), .label { font-size: 13px; font-weight: 600; }
.field small, .hint { font-size: 12.5px; color: var(--muted); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .field select, .field textarea, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 9px 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; outline: none;
}
.field textarea, textarea.input { min-height: 84px; resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.err input, .field.err select, .field.err textarea { border-color: var(--fail); }
.field .err-msg { color: var(--fail); font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid .span-2 { grid-column: auto; } }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; min-height: 28px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.radio-cards label { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.radio-cards label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-cards input { accent-color: var(--accent); margin-top: 2px; }
input[type=color] { width: 52px; height: 42px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }

/* ---------- cards, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { flex: 1; }
.card-body { padding: 20px; }
.grid { display: flex; flex-wrap: wrap; gap: 14px; }
.grid > .g2 { flex: 2 1 460px; min-width: 0; }
.grid > .g1 { flex: 1 1 300px; min-width: 0; }
.kpis { display: flex; flex-wrap: wrap; gap: 14px; }
.kpi { flex: 1 1 200px; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 6px; }
.kpi .l { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface2); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface2) 60%, transparent); }
.table .id { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.table .title-cell { min-width: 240px; }
.table .title-cell a { color: var(--text); text-decoration: none; font-weight: 500; }
.table .title-cell a:hover { color: var(--accent-text); }
.table .cb { width: 36px; }
.table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
.row-link { color: inherit; text-decoration: none; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); text-decoration: none; color: var(--text); }
.list-row:hover { background: var(--surface2); color: var(--text); }
.list-row .id { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); flex: none; }
.list-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 16px; }
.empty p { max-width: 420px; }
.empty .btn { margin-top: 8px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; font-size: 13.5px; }
.kv > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv .k { color: var(--muted); font-size: 12px; }
.section-label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- pills, dots, avatars ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; background: var(--surface2); color: var(--muted); line-height: 1.5; }
.pill .dot { width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.st-gray { background: var(--surface2); color: var(--muted); }
.st-blue { background: var(--accent-soft); color: var(--accent-text); }
.st-violet { background: var(--violet-soft); color: var(--violet); }
.st-amber { background: var(--warn-soft); color: var(--warn); }
.st-green { background: var(--pass-soft); color: var(--pass); }
.st-red { background: var(--fail-soft); color: var(--fail); }
.st-teal { background: var(--teal-soft); color: var(--teal); }
.st-pink { background: var(--pink-soft); color: var(--pink); }
.sev-blocker, .sev-critical { background: var(--fail-soft); color: var(--fail); }
.sev-major { background: var(--warn-soft); color: var(--warn); }
.sev-minor, .sev-trivial { background: var(--surface2); color: var(--muted); }
.pri-critical, .pri-p1 { background: var(--fail-soft); color: var(--fail); }
.pri-high, .pri-p2 { background: var(--warn-soft); color: var(--warn); }
.pri-medium, .pri-p3 { background: var(--accent-soft); color: var(--accent-text); }
.pri-low, .pri-p4 { background: var(--surface2); color: var(--muted); }
.res-passed { background: var(--pass-soft); color: var(--pass); }
.res-failed { background: var(--fail-soft); color: var(--fail); }
.res-blocked { background: var(--warn-soft); color: var(--warn); }
.res-retest { background: var(--violet-soft); color: var(--violet); }
.res-skipped, .res-untested { background: var(--surface2); color: var(--muted); }
.rdot { width: 10px; height: 10px; border-radius: 99px; flex: none; display: inline-block; }
.rdot-passed { background: var(--pass); } .rdot-failed { background: var(--fail); } .rdot-blocked { background: var(--warn); }
.rdot-retest { background: var(--violet); } .rdot-skipped { background: var(--muted); }
.rdot-untested { border: 2px solid var(--muted); }
.tag { display: inline-flex; font-size: 12px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border); color: var(--muted); }
.ref-chip { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); text-decoration: none; }
.av { display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; font-weight: 600; flex: none; object-fit: cover; }
.av-sm { width: 28px; height: 28px; font-size: 11px; }
.av-md { width: 36px; height: 36px; font-size: 13px; }
.av-lg { width: 56px; height: 56px; font-size: 18px; }
.av-empty { background: var(--surface2); color: var(--muted); border: 1px dashed var(--border-strong); }
.av-c0 { background: var(--accent-soft); color: var(--accent-text); } .av-c1 { background: var(--pass-soft); color: var(--pass); }
.av-c2 { background: var(--violet-soft); color: var(--violet); } .av-c3 { background: var(--warn-soft); color: var(--warn); }
.av-c4 { background: var(--teal-soft); color: var(--teal); } .av-c5 { background: var(--pink-soft); color: var(--pink); }

/* progress bars */
.pbar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface2); gap: 2px; }
.pbar.thin { height: 8px; }
.seg-passed { background: var(--pass); } .seg-failed { background: var(--fail); } .seg-blocked { background: var(--warn); }
.seg-retest { background: var(--violet); } .seg-skipped { background: var(--border-strong); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hbar { flex: 1; height: 22px; border-radius: 6px; background: var(--surface2); overflow: hidden; }
.hbar > div { height: 100%; border-radius: 6px; }

/* alerts */
.flashes { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.alert-ok { background: var(--pass-soft); border-color: transparent; }
.alert-err { background: var(--fail-soft); border-color: transparent; }
.alert-warn { background: var(--warn-soft); border-color: transparent; }
.alert-info { background: var(--accent-soft); border-color: transparent; }
.alert .x { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }

/* tabs and chips */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .n { font-size: 12px; padding: 0 7px; border-radius: 99px; background: var(--surface2); color: var(--muted); }
.seg-ctl { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--border); }
.seg-ctl a, .seg-ctl button, .seg-ctl label { height: 34px; padding: 0 12px; border-radius: 8px; border: 0; font: inherit; font-weight: 500; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.seg-ctl .on, .seg-ctl label:has(input:checked) { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.seg-ctl input { position: absolute; opacity: 0; pointer-events: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select, .filters input[type=search] { height: 36px; min-height: 36px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.filters select.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.filters input[type=search] { border-radius: 10px; min-width: 200px; }

/* ---------- two-pane layouts ---------- */
.split { display: flex; flex-wrap: wrap; align-items: stretch; flex: 1; }
.split > .pane-side { flex: 1 1 260px; max-width: 100%; border-right: 1px solid var(--border); background: var(--side); padding: 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.split > .pane-main { flex: 999 1 520px; min-width: 0; }
.split > .pane-aside { flex: 1 1 320px; max-width: 100%; border-left: 1px solid var(--border); background: var(--side); padding: 22px 20px; display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 1100px) { .split > .pane-side { max-width: 300px; } .split > .pane-aside { max-width: 400px; } }
.tree a { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: 8px; text-decoration: none; font-size: 13.5px; color: var(--muted); }
.tree a:hover { background: var(--surface2); color: var(--text); }
.tree a.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.tree a .n { margin-left: auto; font-size: 12px; }
.tree .sub { padding-left: 18px; }

/* steps editor & view */
.steps { display: flex; flex-direction: column; }
.step-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.step-row:last-child { border-bottom: 0; }
.step-n { width: 24px; height: 24px; border-radius: 99px; background: var(--surface2); color: var(--muted); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; margin-top: 1px; }
.step-a, .step-e { flex: 1 1 150px; min-width: 0; white-space: pre-wrap; }
.step-e { color: var(--muted); }
.step-head { display: flex; gap: 12px; padding: 10px 18px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface2); border-bottom: 1px solid var(--border); }
.step-edit { display: grid; grid-template-columns: 28px 1fr 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.step-edit textarea { min-height: 60px; }
.step-edit .tools { display: flex; flex-direction: column; gap: 4px; }
.step-edit .tools button { width: 32px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
@media (max-width: 700px) { .step-edit { grid-template-columns: 28px 1fr auto; } .step-edit .exp { grid-column: 2; } }
.shared-tag { font-size: 11.5px; color: var(--violet); font-weight: 600; }

/* run focus mode */
.focus-top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 24px; background: var(--side); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.timer { font-family: var(--mono); font-size: 13px; padding: 8px 10px; border-radius: 9px; background: var(--surface2); color: var(--muted); }
.rc-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 9px; text-decoration: none; color: var(--text); }
.rc-item:hover { background: var(--surface2); color: var(--text); }
.rc-item.on { background: var(--accent-soft); }
.rc-item .id { font-family: var(--mono); font-size: 11.5px; color: var(--muted); display: block; }
.rc-item .t { font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-res { display: flex; gap: 6px; margin-left: auto; flex: none; }
.step-res label { position: relative; height: 36px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; }
.step-res input { position: absolute; opacity: 0; pointer-events: none; }
.step-res label.r-pass:has(input:checked) { border-color: var(--pass); background: var(--pass-soft); color: var(--pass); }
.step-res label.r-fail:has(input:checked) { border-color: var(--fail); background: var(--fail-soft); color: var(--fail); }
.step-res label.r-block:has(input:checked) { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.step-row:has(.r-fail input:checked) { background: var(--fail-soft); }
.bug-prompt { border-radius: 14px; border: 1px solid var(--fail); background: var(--fail-soft); padding: 16px 18px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.exec-bar { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.exec-bar .grow { flex: 1; }
.kb-hint { padding: 12px 14px; border-radius: 12px; background: var(--surface2); font-size: 12.5px; color: var(--muted); }

/* board */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.col { flex: 0 0 280px; background: var(--surface2); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.col.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-weight: 600; font-size: 13px; }
.col-head .n { margin-left: auto; color: var(--muted); font-weight: 500; }
.bcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); cursor: grab; }
.bcard:hover { border-color: var(--border-strong); color: var(--text); }
.bcard .meta { display: flex; align-items: center; gap: 8px; }
.bcard .id { font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* comments & activity */
.feed { display: flex; flex-direction: column; gap: 14px; }
.feed-item { display: flex; gap: 10px; align-items: flex-start; }
.feed-item .b { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.feed-item .w { color: var(--muted); font-size: 12px; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment .bubble { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px; background: var(--surface2); }
.comment .who { font-size: 12.5px; font-weight: 600; display: flex; gap: 8px; }
.comment .who span { font-weight: 400; color: var(--muted); }
.comment .body { margin-top: 4px; overflow-wrap: anywhere; }

/* attachments */
.files { display: flex; flex-wrap: wrap; gap: 10px; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); max-width: 280px; }
.file:hover { border-color: var(--border-strong); color: var(--text); }
.file .ext { width: 34px; height: 34px; border-radius: 8px; background: var(--surface2); color: var(--muted); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; text-transform: uppercase; }
.file .ext img { width: 100%; height: 100%; object-fit: cover; }
.file .nm { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 190px; }
.file .sz { font-size: 12px; color: var(--muted); display: block; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs a img { width: 140px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type=file] { font: inherit; font-size: 13px; color: var(--muted); max-width: 100%; }
.pending-files { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.pending-files span { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--surface2); color: var(--text); }

/* workflow chips */
.flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.flow .pill { padding: 4px 9px; }
.flow .cur { background: var(--accent); color: var(--on-accent); }
.flow .past { background: var(--accent-soft); color: var(--accent-text); }

/* import */
.stepper { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.stepper li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; color: var(--muted); font-weight: 600; font-size: 13px; }
.stepper li .n { width: 24px; height: 24px; border-radius: 99px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--surface2); }
.stepper li.done { color: var(--text); } .stepper li.done .n { background: var(--pass); color: var(--on-solid); }
.stepper li.cur { background: var(--accent-soft); color: var(--accent-text); } .stepper li.cur .n { background: var(--accent); color: var(--on-accent); }
.err-box { border-radius: 14px; border: 1px solid var(--fail); background: var(--fail-soft); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.err-box .path { font-family: var(--mono); font-size: 12px; color: var(--fail); word-break: break-all; }
.choice { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--border); }
.choice label { height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { background: var(--surface); color: var(--text); font-weight: 600; }
.choice label.ow:has(input:checked) { background: var(--warn-soft); color: var(--warn); }
.diff { font-size: 12.5px; color: var(--muted); }

/* dialog */
dialog { border: 1px solid var(--border); border-radius: 16px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(9, 12, 18, .5); }
dialog .dlg-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
dialog .dlg-head h2 { flex: 1; font-size: 16px; }
dialog .dlg-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; max-height: 70vh; overflow-y: auto; }
dialog .dlg-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* auth pages */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.auth-card .brand { padding: 0; }
.auth-card h1 { font-size: 22px; }
.code-input { font-family: var(--mono) !important; font-size: 26px !important; letter-spacing: 10px; text-align: center; }

/* installer */
.install { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 20px; }
.checks { display: flex; flex-direction: column; }
.checks .row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.checks .row:last-child { border-bottom: 0; }
.checks .row .what { flex: 1; }
.ok-ic { color: var(--pass); } .bad-ic { color: var(--fail); } .warn-ic { color: var(--warn); }

.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.bulkbar { display: none; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); }
.bulkbar.show { display: flex; }
.dash-row { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.dash-row:last-child { border-bottom: 0; padding-bottom: 0; }
.proj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.proj-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--text); }
.proj-card:hover { border-color: var(--border-strong); color: var(--text); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { width: 34px; height: 34px; border-radius: 99px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border: 2px solid transparent; }
.swatches label:has(input:checked) { border-color: var(--text); }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches i { width: 24px; height: 24px; border-radius: 99px; display: block; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix .cell { display: flex; flex-direction: column; gap: 4px; align-items: center; min-width: 110px; }
.matrix .roles { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.matrix .roles label { font-size: 11.5px; display: inline-flex; gap: 3px; align-items: center; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border); cursor: pointer; }
.matrix .roles input { width: 13px; height: 13px; accent-color: var(--accent); }
.matrix .na { color: var(--border-strong); }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); }

@media (max-width: 700px) {
  .page { padding: 18px 16px; }
  .topbar { padding: 10px 16px; }
  .kbd { display: none; }
  .kv { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .topbar { display: none; }
}

/* ---------- knowledge base ---------- */
.kb-body { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.kb-body > * + * { margin-top: 12px; }
.kb-body h2 { font-size: 21px; margin-top: 26px; letter-spacing: -0.015em; }
.kb-body h3 { font-size: 17px; margin-top: 20px; }
.kb-body h4 { font-size: 15px; margin-top: 16px; }
.kb-body p, .kb-body ul, .kb-body ol, .kb-body pre, .kb-body blockquote, .kb-body table, .kb-body details { margin: 0; }
.kb-body ul, .kb-body ol { padding-left: 24px; }
.kb-body li + li { margin-top: 4px; }
.kb-body a { text-decoration: underline; text-underline-offset: 2px; }
.kb-body a.ref-chip, .kb-body a.link-card, .kb-body a.embed-open { text-decoration: none; }
.kb-body code { background: var(--surface2); padding: 1px 5px; border-radius: 5px; }
.kb-body pre { background: var(--surface2); border: 1px solid var(--border); padding: 12px 14px; border-radius: 10px; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; }
.kb-body pre code { background: none; padding: 0; }
.kb-body blockquote { border-left: 3px solid var(--border-strong); padding: 2px 0 2px 14px; color: var(--muted); }
.kb-body img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); }
.kb-body table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; background: var(--surface); border-radius: 10px; }
.kb-body th, .kb-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; min-width: 90px; }
.kb-body th { background: var(--surface2); font-size: 13px; font-weight: 600; }
.kb-body hr { margin: 20px 0; }
.kb-body details { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; background: var(--surface); }
.kb-body summary { cursor: pointer; font-weight: 600; }
.kb-body details[open] summary { margin-bottom: 8px; }
.kb-body .callout { display: block; padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); border: 0; }
.kb-body .callout-warn { background: var(--warn-soft); }
.kb-body .callout-tip { background: var(--pass-soft); }
.kb-body .callout-danger { background: var(--fail-soft); }
.kb-body .callout > * + * { margin-top: 6px; }
.kb-body ul.checklist { list-style: none; padding-left: 4px; }
.kb-body ul.checklist li { position: relative; padding-left: 28px; }
.kb-body ul.checklist li::before { content: ''; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong); background: var(--surface); }
.kb-body ul.checklist li[data-checked="1"]::before { background: var(--accent); border-color: var(--accent); }
.kb-body ul.checklist li[data-checked="1"]::after { content: ''; position: absolute; left: 5px; top: 6px; width: 5px; height: 9px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.kb-body ul.checklist li[data-checked="1"] { color: var(--muted); text-decoration: line-through; }
[data-can-check="1"] ul.checklist li::before { cursor: pointer; }
.embed-frame { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface2); }
.embed-frame iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.embed-doc iframe { aspect-ratio: auto; height: 520px; background: #fff; }
.embed-open { display: flex; gap: 6px; align-items: center; padding: 8px 12px; font-size: 13px; border-top: 1px solid var(--border); background: var(--surface); }
.link-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.link-card > span { display: flex; flex-direction: column; min-width: 0; }
.ref-chip .ref-state { margin-left: 6px; padding-left: 6px; border-left: 1px solid currentColor; font-family: var(--font); font-weight: 500; opacity: .85; display: inline-flex; align-items: center; gap: 4px; }
.ref-chip .cdot { width: 7px; height: 7px; border-radius: 99px; display: inline-block; background: currentColor; }
.ref-chip .cdot.st-gray { background: var(--muted); } .ref-chip .cdot.st-blue { background: var(--accent); } .ref-chip .cdot.st-violet { background: var(--violet); }
.ref-chip .cdot.st-amber { background: var(--warn); } .ref-chip .cdot.st-green { background: var(--pass); } .ref-chip .cdot.st-red { background: var(--fail); }
.ref-chip .cdot.st-teal { background: var(--teal); } .ref-chip .cdot.st-pink { background: var(--pink); }
.ref-missing { background: var(--surface2); color: var(--muted); text-decoration: line-through; }
.kb-title-input { font-size: 26px !important; font-weight: 700; letter-spacing: -0.02em; min-height: 56px !important; }
.editor { overflow: hidden; }
.editor-bar { position: sticky; top: 66px; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.editor-bar button { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; font: inherit; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.editor-bar button:hover { background: var(--surface); border-color: var(--border); }
.editor-bar select { width: auto !important; min-height: 34px !important; padding: 4px 8px !important; }
.editor-bar .sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.editor-area { min-height: 380px; padding: 22px 26px; outline: none; }
.editor-area:focus { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.editor-area .embed-placeholder, .editor-area div[data-embed] { padding: 12px 14px; border: 1.5px dashed var(--border-strong); border-radius: 10px; color: var(--muted); font-size: 13px; }
.editor-area div[data-embed]::before { content: 'Embed: '; font-weight: 600; }
.editor-foot { padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface2); }
.diff-view { font-family: var(--mono); font-size: 12.5px; max-height: 70vh; overflow: auto; }
.dl { display: flex; gap: 10px; padding: 3px 14px; white-space: pre-wrap; }
.dl .dm { width: 12px; flex: none; color: var(--muted); }
.dl-add { background: var(--pass-soft); } .dl-add .dm { color: var(--pass); }
.dl-del { background: var(--fail-soft); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--fail) 50%, transparent); } .dl-del .dm { color: var(--fail); }
.print-doc { max-width: 820px; margin: 0 auto; padding: 28px 20px; background: var(--bg); }
.print-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.print-page + .print-page { margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--border); }
@media print {
  .print-bar { display: none; }
  .print-doc { padding: 0; max-width: none; }
  html, body { background: #fff !important; color: #111 !important; }
  .embed-frame iframe { display: none; }
  .kb-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 11px; color: #555; }
}

/* ---------- Requirements and traceability ---------- */
.cov-sum { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.cov-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); transition: border-color .15s; }
.cov-card:hover { text-decoration: none; border-color: var(--accent); }
.cov-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cov-n { font-size: 22px; font-weight: 700; background: none !important; line-height: 1.1; }
.cov-n.st-gray { color: var(--text); }
.cov-passing { background: var(--pass); } .cov-failing, .cov-none { background: var(--fail); } .cov-blocked { background: var(--warn); } .cov-notrun { background: var(--muted); }
.mx-cases { display: flex; flex-wrap: wrap; gap: 6px; }
.mx-case { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); font-family: var(--mono); font-size: 12.5px; color: var(--text); text-decoration: none; white-space: nowrap; margin: 0 4px 4px 0; }
.mx-case:hover { border-color: var(--accent); text-decoration: none; }
.table.matrix td { vertical-align: top; }
.table.matrix th, .table.matrix td { text-align: left; }
.ac-list { margin: 8px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.ac-row { display: flex; gap: 8px; align-items: center; }
.ac-row .input { flex: 1; min-width: 0; }
.ac-n { width: 22px; text-align: right; color: var(--muted); font-size: 13px; flex: none; }
@media (max-width: 900px) { .cov-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cov-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- AI ---------- */
.ai-meter { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--border); }
.ai-case { padding: 0; overflow: hidden; }
.ai-case-head { display: flex; gap: 12px; align-items: center; padding: 14px 18px; cursor: pointer; }
.ai-case-head input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.ai-case details { padding: 0 18px 14px 48px; }
.ai-case summary { cursor: pointer; color: var(--accent-text); font-weight: 500; }
.ai-steps { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ai-steps li span { display: block; }
.gap-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gap-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.gap-list li svg { color: var(--warn); margin-top: 3px; flex: none; }
.btn-ai { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); color: var(--accent-text); }
.btn-ai svg { color: var(--accent); }
.ai-busy { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.spinner { width: 16px; height: 16px; border-radius: 99px; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.ai-tip { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 13.5px; }
.ai-tip > svg { color: var(--accent); flex: none; }
.ai-filled { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-slot .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ai-slot .form-grid .span-2 { grid-column: span 3; }
.ai-slot .form-grid .ai-model { grid-column: span 2; }
@media (max-width: 760px) { .ai-slot .form-grid { grid-template-columns: 1fr 1fr; } .ai-slot .form-grid .span-2, .ai-slot .form-grid .ai-model, .ai-slot .form-grid > :first-child { grid-column: 1 / -1; } }
