/* Grow With Ahmad — dashboard styles. No external fonts, light + dark via CSS variables. */
:root {
  color-scheme: light;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --radius: 10px; --radius-sm: 6px; --radius-lg: 14px;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --border: #e2e5ea;
  --border-strong: #cdd2da;
  --text: #14171c;
  --text-2: #4b5260;
  --text-3: #6f7685;
  --primary: #2563eb;
  --primary-hover: #1d4fd7;
  --primary-soft: #e8efff;
  --primary-text: #ffffff;
  --focus: #2563eb;

  --critical: #d92d20; --critical-soft: #fdecea; --critical-text: #b42318;
  --warning: #dc8a00;  --warning-soft: #fff4dc;  --warning-text: #935f00;
  --notice: #2a78d6;   --notice-soft: #e8f1fc;   --notice-text: #1d5aa6;
  --good: #12854a;     --good-soft: #e3f5ea;     --good-text: #0e6b3b;
  --muted-soft: #eef0f4;

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: #e6e8ec;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 12px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --sidebar-w: 248px;
  --topbar-h: 56px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1c2027;
    --surface-3: #242932;
    --border: #2a3039;
    --border-strong: #3a414d;
    --text: #eceef2;
    --text-2: #b7bcc7;
    --text-3: #8b92a0;
    --primary: #4c8dff;
    --primary-hover: #6aa0ff;
    --primary-soft: #1c2a45;
    --primary-text: #0b1220;
    --focus: #6aa0ff;
    --critical: #f0605a; --critical-soft: #3a1c1c; --critical-text: #ff8f88;
    --warning: #e0a030;  --warning-soft: #362a14;  --warning-text: #f2bd5c;
    --notice: #4f97ec;   --notice-soft: #182a42;   --notice-text: #8cbcf5;
    --good: #2fb36b;     --good-soft: #15301f;     --good-text: #6fd59b;
    --muted-soft: #242932;
    --series-1: #3987e5;
    --series-2: #d95926;
    --grid: #262b33;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 1px 3px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.25);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; }
h1 { font-size: 22px; letter-spacing: -.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 var(--s3); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.app { min-height: 100%; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(90deg, var(--surface) calc(var(--sidebar-w) - 1px), var(--border) calc(var(--sidebar-w) - 1px), var(--border) var(--sidebar-w), var(--bg) var(--sidebar-w)); }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: var(--s4) var(--s3); gap: var(--s4);
}
.brand { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s2); color: var(--text); font-weight: 700; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); display: grid; place-items: center; color: #fff; flex: none; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--text-3); letter-spacing: .02em; }
.switcher label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 0 var(--s2) var(--s1); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: var(--s3) var(--s2) var(--s1); }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px var(--s2); border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.nav a svg { flex: none; opacity: .9; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--text-3); padding: 0 var(--s2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s5);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .crumb { min-width: 0; display: flex; align-items: baseline; gap: var(--s2); flex-wrap: nowrap; overflow: hidden; }
.topbar .crumb strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumb .domain { color: var(--text-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.btn.menu-btn { display: none; }
main:focus { outline: none; }
.content { padding: var(--s5); max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head p { color: var(--text-3); margin: 4px 0 0; }
.page-head .actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.scrim { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: min(84vw, 280px);
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg);
  }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.35); }
  .btn.menu-btn { display: inline-flex; }
  .shell { background: var(--bg); }
  .topbar { padding: 0 var(--s3); }
  .content { padding: var(--s4) var(--s3); }
}

/* ---------- grid / cards ---------- */
.grid { display: grid; gap: var(--s4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); } .mt-5 { margin-top: var(--s5); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s4) 0; flex-wrap: wrap; }
.card-head h2 { font-size: 14.5px; }
.card-head .sub { color: var(--text-3); font-size: 12.5px; }
.card-body { padding: var(--s4); }
.card-body.flush { padding: var(--s3) 0 0; }
.card.link-card { transition: border-color .15s, box-shadow .15s, transform .15s; color: inherit; display: block; }
.card.link-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .label { font-size: 12px; color: var(--text-3); font-weight: 550; }
.stat .value { font-size: 24px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 12px; color: var(--text-3); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s4); }
.kpi { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); }

/* project card */
.proj-card { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.proj-card .top { display: flex; align-items: center; gap: var(--s3); }
.proj-card .name { font-weight: 650; font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-card .domain { color: var(--text-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-card .meta { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--text-3); }
.add-card { border: 1.5px dashed var(--border-strong); background: transparent; display: grid; place-items: center; min-height: 160px; color: var(--text-2); cursor: pointer; font: inherit; border-radius: var(--radius-lg); }
.add-card:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.add-card .inner { display: flex; flex-direction: column; align-items: center; gap: var(--s2); font-weight: 600; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 560; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn.danger:hover:not(:disabled) { filter: brightness(.94); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.icon.sm { width: 28px; }
.btn .spin { width: 14px; height: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-width: 0; height: 36px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit;
}
.textarea { height: auto; min-height: 110px; padding: 8px 10px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.input.sm, .select.sm { height: 30px; font-size: 13px; }
.form-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: start; }
.field.btn-field::before { content: '\00a0'; font-size: 12.5px; font-weight: 600; line-height: 1.5; }
@media (max-width: 700px) { .field.btn-field::before { display: none; } .form-grid { grid-template-columns: minmax(0, 1fr) !important; } }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--text-2); font: inherit; font-weight: 560; padding: 0 12px; height: 34px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 620; background: var(--muted-soft); color: var(--text-2); white-space: nowrap; }
.badge.critical { background: var(--critical-soft); color: var(--critical-text); }
.badge.warning { background: var(--warning-soft); color: var(--warning-text); }
.badge.notice { background: var(--notice-soft); color: var(--notice-text); }
.badge.good { background: var(--good-soft); color: var(--good-text); }
.badge.info { background: var(--primary-soft); color: var(--primary); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.critical { background: var(--critical); } .dot.warning { background: var(--warning); } .dot.notice { background: var(--notice); } .dot.good { background: var(--good); } .dot.muted { background: var(--text-3); }
.status-code { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: var(--muted-soft); }
.status-code.s2 { background: var(--good-soft); color: var(--good-text); }
.status-code.s3 { background: var(--notice-soft); color: var(--notice-text); }
.status-code.s4, .status-code.s5, .status-code.s0 { background: var(--critical-soft); color: var(--critical-text); }

/* ---------- severity counts ---------- */
.sev-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.sev-tile { border-radius: var(--radius); padding: var(--s3); border: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.sev-tile .n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sev-tile .l { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; font-weight: 560; }
.sev-tile.critical { border-left: 3px solid var(--critical); }
.sev-tile.warning { border-left: 3px solid var(--warning); }
.sev-tile.notice { border-left: 3px solid var(--notice); }

/* issue groups */
.issue-group + .issue-group { margin-top: var(--s4); }
.issue-group h3 { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: var(--s2); }
.issue-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.issue-item + .issue-item { border-top: 1px solid var(--border); }
.issue-item button {
  width: 100%; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: var(--s3); align-items: center;
  padding: 10px var(--s3); background: var(--surface); border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.issue-item button:hover { background: var(--surface-2); }
.issue-item button[aria-expanded="true"] { background: var(--primary-soft); }
.issue-item .t { font-weight: 560; }
.issue-item .c { color: var(--text-3); font-size: 12px; }
.issue-item .count { font-variant-numeric: tabular-nums; font-weight: 650; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 8px var(--s3); text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 11.5px; font-weight: 640; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.table th button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.table th[aria-sort="ascending"], .table th[aria-sort="descending"] { color: var(--text); }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.url { max-width: 420px; }
.table .truncate { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.table .sub { color: var(--text-3); font-size: 12px; }
.table tbody tr:last-child td { border-bottom: 0; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3); border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; }
.pager .row { gap: var(--s1); }
.toolbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: 0 var(--s4) var(--s3); }
.toolbar .input { max-width: 280px; }
.toolbar .select, .card-head .select { width: auto; max-width: 100%; }
.change { display: inline-flex; align-items: center; gap: 2px; font-weight: 640; font-variant-numeric: tabular-nums; }
.change.up { color: var(--good-text); } .change.down { color: var(--critical-text); } .change.flat { color: var(--text-3); }

/* ---------- states ---------- */
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--s2); padding: var(--s6) var(--s4); color: var(--text-3); }
.state .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); margin-bottom: var(--s1); }
.state h3 { color: var(--text); font-size: 15px; }
.state p { max-width: 440px; margin: 0; }
.state .actions { margin-top: var(--s3); display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: center; }
.state.error .ico { background: var(--critical-soft); color: var(--critical-text); }
.state.compact { padding: var(--s5) var(--s3); }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin, .skeleton { animation: none; } * { transition: none !important; } }

.note { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.note svg { flex: none; margin-top: 2px; color: var(--notice); }
.note.warn { background: var(--warning-soft); border-color: transparent; color: var(--warning-text); }
.note.warn svg { color: var(--warning); }
.note p:last-child { margin: 0; }

/* progress */
.progress { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s ease; }
.progress.indeterminate > div { width: 35% !important; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.crawl-log { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow-y: auto; font-size: 12.5px; border-top: 1px solid var(--border); }
.crawl-log li { display: flex; gap: var(--s2); align-items: center; padding: 5px var(--s4); border-bottom: 1px solid var(--border); }
.crawl-log li .u { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--border-strong); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .1; }
.chart .crosshair { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hover-dot { stroke: var(--surface); stroke-width: 2; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 120px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow);
  padding: 8px 10px; font-size: 12px; color: var(--text); transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap;
}
.chart-tip .tt { font-weight: 650; margin-bottom: 4px; color: var(--text-2); }
.chart-tip .tr { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.chart-tip .tr b { font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.gauge { position: relative; display: inline-grid; place-items: center; }
.gauge .gv { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .gv b { font-size: 30px; font-weight: 720; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge .gv small { display: block; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.gauge.sm .gv b { font-size: 16px; }
.gauge.sm .gv small { display: none; }
.score-good { color: var(--good-text); } .score-ok { color: var(--warning-text); } .score-bad { color: var(--critical-text); }
.bars { display: flex; flex-direction: column; gap: var(--s2); }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 52px; gap: var(--s3); align-items: center; font-size: 12.5px; }
.bar-row .bl { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bt { height: 10px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.bar-row .bt > div { height: 100%; border-radius: 0 4px 4px 0; }
.bar-row .bv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(10, 14, 22, .45); display: flex; align-items: center; justify-content: center; padding: var(--s4); animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; border: 1px solid var(--border); }
.modal.wide { width: min(820px, 100%); }
.modal-head, .drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.modal-body { padding: var(--s5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--s4); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s3) var(--s5); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap; }
.overlay.right { justify-content: flex-end; padding: 0; align-items: stretch; }
.drawer { background: var(--surface); width: min(720px, 100%); height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .2s ease; border-left: 1px solid var(--border); }
@keyframes slide { from { transform: translateX(30px); opacity: .6; } }
.drawer-head h2 { font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.drawer-body { padding: var(--s5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--s5); }
.drawer-body section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: var(--s2); }
@media (max-width: 600px) { .drawer-body, .modal-body { padding: var(--s4); } .modal-head, .drawer-head { padding: var(--s3) var(--s4); } }

dl.facts { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr); margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
dl.facts dt, dl.facts dd { margin: 0; padding: 7px var(--s3); border-bottom: 1px solid var(--border); font-size: 13px; }
dl.facts dt { color: var(--text-3); background: var(--surface-2); font-weight: 560; }
dl.facts dd { overflow-wrap: anywhere; }
dl.facts dt:nth-last-of-type(1), dl.facts dd:last-of-type { border-bottom: 0; }
@media (max-width: 480px) { dl.facts { grid-template-columns: minmax(0, 1fr); } dl.facts dt { border-bottom: 0; padding-bottom: 2px; } }

.fix-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.fix-list li { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); display: flex; gap: var(--s3); }
.fix-list .ft { font-weight: 600; }
.fix-list .fd { font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.fix-list .ff { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.link-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.link-list li { padding: 4px 0; overflow-wrap: anywhere; border-bottom: 1px dashed var(--border); }
.advice { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); font-size: 13.5px; }
.advice h4 { margin: var(--s3) 0 var(--s1); font-size: 13.5px; }
.advice ul, .advice ol { margin: var(--s1) 0 var(--s2); padding-left: 20px; }
.advice p { margin: 0 0 var(--s2); }

/* toasts */
.toasts { position: fixed; z-index: 100; right: var(--s4); bottom: var(--s4); display: flex; flex-direction: column; gap: var(--s2); max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: var(--s2); align-items: flex-start; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-left: 4px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 13px; animation: fade .2s ease; }
.toast.error { border-left-color: var(--critical); }
.toast.success { border-left-color: var(--good); }
.toast .msg { flex: 1; overflow-wrap: anywhere; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--s4); background: radial-gradient(1200px 600px at 10% -10%, var(--primary-soft), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); padding: var(--s6); display: flex; flex-direction: column; gap: var(--s4); }
.login-card .brand { padding: 0; font-size: 17px; }
.login-card p { color: var(--text-3); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 var(--s4); overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; color: var(--text-3); font-weight: 600; padding: 10px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.kbd-list { display: flex; flex-direction: column; gap: var(--s3); }
.integration { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.integration:last-child { border-bottom: 0; }
.integration .who { display: flex; flex-direction: column; min-width: 180px; }
.integration .who span { font-size: 12.5px; color: var(--text-3); }
.integration .ctl { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.integration .ctl .input { width: 220px; }
.danger-zone { border-color: color-mix(in srgb, var(--critical) 40%, var(--border)); }
.danger-zone .card-head h2 { color: var(--critical-text); }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mover-list { list-style: none; margin: 0; padding: 0; }
.mover-list li { display: flex; align-items: center; gap: var(--s3); padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.mover-list li:last-child { border-bottom: 0; }
.mover-list .k { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2); }
.quick-actions a { display: flex; align-items: center; gap: var(--s2); padding: 10px var(--s3); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-weight: 560; background: var(--surface-2); }
.quick-actions a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.preview-table { font-size: 12px; }
.preview-table td, .preview-table th { padding: 5px 8px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ======================= v0.2 — assistant, content, knowledge, AI providers, WordPress ======================= */
.mb-3 { margin-bottom: var(--s3); }
.section-title { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 0 0 var(--s2); }
.linklike { all: unset; color: var(--primary); cursor: pointer; font-weight: 560; overflow-wrap: anywhere; }
.linklike:hover { text-decoration: underline; }
.linklike:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.textarea.plain { font-family: var(--font); font-size: 13.5px; line-height: 1.5; }
pre.json { margin: var(--s2) 0 0; padding: var(--s3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--mono); font-size: 12px; max-height: 280px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.counter { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 600; }
.input.file { height: auto; padding: 6px; }
.card .tabs { padding: 0; margin-bottom: var(--s3); }
.tabs button:focus-visible { outline-offset: -2px; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 36px; height: 20px; margin: 0; cursor: pointer; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .track { background: var(--good); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .6; }

/* safe markdown answer */
.advice h3 { margin: var(--s4) 0 var(--s2); font-size: 15px; }
.advice h3:first-child, .advice h4:first-child { margin-top: 0; }
.advice pre { background: var(--surface-3); padding: var(--s3); border-radius: var(--radius-sm); overflow-x: auto; font-size: 12px; }
.advice blockquote { margin: 0 0 var(--s2); padding: 2px var(--s3); border-left: 3px solid var(--border-strong); color: var(--text-2); }
.advice code { background: var(--surface-3); padding: 1px 4px; border-radius: 4px; }
.advice a { overflow-wrap: anywhere; }

/* assistant */
.assistant-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s4); align-items: start; }
.history-card { position: sticky; top: calc(var(--topbar-h) + var(--s4)); }
@media (max-width: 1100px) { .assistant-layout { grid-template-columns: minmax(0, 1fr); } .history-card { position: static; } }
.command-input { font-family: var(--font); font-size: 15px; min-height: 84px; line-height: 1.5; }
.command-box .row.between > .small { display: inline-flex; align-items: center; gap: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow-y: auto; }
.history-item { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.history-item:hover { background: var(--surface-3); }
.history-item:focus-visible { outline: 2px solid var(--focus); }
.history-item[aria-current="true"] { background: var(--primary-soft); }
.history-item .hc { font-size: 13px; font-weight: 560; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.run-card .card-body { display: flex; flex-direction: column; gap: var(--s4); }
.run-head { display: flex; gap: var(--s3); align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.run-command { font-size: 15px; font-weight: 600; margin: 2px 0 0; overflow-wrap: anywhere; }
.provider-line { margin: -8px 0 0; display: inline-flex; align-items: center; gap: 4px; }
.plan-summary { margin: 0; }
.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.step { display: flex; gap: var(--s3); align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); background: var(--surface); }
.step.write { border-left: 3px solid var(--warning); background: color-mix(in srgb, var(--warning-soft) 45%, var(--surface)); }
.step.failed { border-color: color-mix(in srgb, var(--critical) 45%, var(--border)); }
.step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; font-weight: 700; flex: none; color: var(--text-2); }
.step.done .step-n { background: var(--good-soft); color: var(--good-text); }
.step.failed .step-n { background: var(--critical-soft); color: var(--critical-text); }
.step .tool { font-weight: 650; overflow-wrap: anywhere; }
.step-reason { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.step-summary { margin: 6px 0 0; font-size: 13px; }
.step-args { margin-top: 6px; font-size: 12.5px; }
.step-args summary { cursor: pointer; color: var(--text-3); font-weight: 560; }
.approve { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13px; padding: 6px 10px; border: 1px solid var(--warning); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex: none; color: var(--warning-text); }
.approve input { width: 16px; height: 16px; accent-color: var(--warning); }
.approve-bar { display: flex; flex-direction: column; gap: var(--s3); }
.run-answer { border-top: 1px solid var(--border); padding-top: var(--s4); }
.sources { margin-top: var(--s3); }
.sources h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: var(--s2); }
.sources ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.followup { display: flex; flex-direction: column; gap: var(--s2); border-top: 1px solid var(--border); padding-top: var(--s4); }
.followup .textarea { font-family: var(--font); font-size: 13.5px; min-height: 60px; }

/* content kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: var(--s3); overflow-x: auto; padding-bottom: var(--s2); align-items: start; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s3); min-width: 0; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: var(--s3); }
.kanban-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm); }
.kanban-card:hover { border-color: var(--border-strong); }
.kc-title { font-weight: 620; color: var(--text); overflow-wrap: anywhere; }
.kc-kw { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kc-kw svg { vertical-align: -1px; }
.kc-foot .select { width: auto; max-width: 120px; }
.kanban-empty { margin: 0; padding: var(--s2); text-align: center; }
.score-pill.score-good { background: var(--good-soft); } .score-pill.score-ok { background: var(--warning-soft); } .score-pill.score-bad { background: var(--critical-soft); }
@media (max-width: 900px) { .kanban { grid-template-columns: minmax(0, 1fr); overflow-x: visible; } }
.idea-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.idea-list li { display: flex; gap: var(--s3); align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); }
.ideas-form { flex-wrap: nowrap; }

/* content editor */
.editor-head h1 { overflow-wrap: anywhere; }
.editor-head .actions { align-items: center; flex-wrap: wrap; }
.editor-head .actions .select { width: auto; }
.editor-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.save-state { display: inline-flex; align-items: center; gap: 2px; min-width: 70px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s4); align-items: start; }
@media (max-width: 1150px) { .editor-layout { grid-template-columns: minmax(0, 1fr); } }
.brief { display: flex; flex-direction: column; gap: var(--s4); }
.brief-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s3); margin: 0; }
.brief-meta dt { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.brief-meta dd { margin: 2px 0 0; font-size: 13px; }
.outline { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: var(--s2); }
.outline ul { margin: 4px 0; padding-left: 18px; }
.link-suggest { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.link-suggest li { display: flex; gap: var(--s3); align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; overflow-wrap: anywhere; }
.link-suggest li:last-child { border-bottom: 0; }
.editor-toolbar { display: flex; gap: 2px; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; background: var(--surface-2); }
.editor-toolbar .tb { min-width: 30px; padding: 0 8px; }
.textarea.editor { min-height: 460px; font-size: 13.5px; line-height: 1.6; }
.textarea.editor[readonly] { background: var(--surface-2); }
.ai-progress { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); background: var(--surface-2); }
.ai-progress .note { border: 0; padding: 0; background: transparent; }
.prose { font-size: 15px; line-height: 1.7; max-width: 72ch; overflow-wrap: anywhere; }
.prose h1 { font-size: 26px; margin: 0 0 var(--s4); }
.prose h2 { font-size: 20px; margin: var(--s5) 0 var(--s2); }
.prose h3 { font-size: 16px; margin: var(--s4) 0 var(--s2); }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre { margin: 0 0 var(--s3); }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); background: var(--surface-3); }
.prose blockquote { border-left: 3px solid var(--border-strong); padding-left: var(--s3); color: var(--text-2); }
.prose pre { background: var(--surface-3); padding: var(--s3); border-radius: var(--radius-sm); overflow-x: auto; }
.score-top { display: flex; gap: var(--s4); align-items: center; margin-bottom: var(--s3); }
.score-stats { margin: 0; display: grid; gap: 4px; font-size: 12.5px; flex: 1; min-width: 0; }
.score-stats div { display: flex; justify-content: space-between; gap: var(--s2); }
.score-stats dt { color: var(--text-3); }
.score-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.checks li { display: flex; gap: var(--s2); padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; align-items: flex-start; }
.checks li:last-child { border-bottom: 0; }
.checks .ci { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.checks li.ok .ci { background: var(--good-soft); color: var(--good-text); }
.checks li.fail .ci { background: var(--critical-soft); color: var(--critical-text); }
.checks .cd { text-align: right; overflow-wrap: anywhere; max-width: 50%; }
.suggest-meta { margin-top: var(--s3); border-top: 1px solid var(--border); padding-top: var(--s3); }
.opt-list li { display: block; }
.serp { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3) var(--s4); background: var(--surface); font-family: Arial, var(--font); overflow-wrap: anywhere; }
.serp-site { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.serp-fav { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-2); flex: none; }
.serp-name { font-size: 13px; color: var(--text); line-height: 1.2; }
.serp-url { font-size: 12px; color: var(--text-3); line-height: 1.3; }
.serp-title { color: #1a0dab; font-size: 18px; line-height: 1.3; margin-bottom: 3px; }
.serp-desc { font-size: 13px; color: var(--text-2); line-height: 1.5; }
@media (prefers-color-scheme: dark) { .serp-title { color: #99c3ff; } }
.radio-card { display: flex; gap: var(--s2); align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-card input { margin-top: 3px; accent-color: var(--primary); }
.radio-card > span { display: flex; flex-direction: column; }
.wp-link { display: inline-flex; gap: 4px; align-items: center; overflow-wrap: anywhere; word-break: break-all; }

/* knowledge */
.search-results { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--s2); }
.search-results li { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); }
.snippet { margin: 6px 0 0; color: var(--text-2); overflow-wrap: anywhere; }
.mem-list { list-style: none; margin: 0; padding: 0; }
.mem-list li { display: flex; gap: var(--s2); align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; overflow-wrap: anywhere; }
.mem-list li:last-child { border-bottom: 0; }
.conflict-list li > svg { color: var(--warning); flex: none; margin-top: 2px; }
.doc-text { min-height: 280px; }

/* AI providers */
.provider { padding: var(--s4) 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s2); }
.provider:last-child { border-bottom: 0; padding-bottom: 0; }
.privacy { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; }
.privacy svg { flex: none; margin-top: 2px; color: var(--good); }
.privacy.warn { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
.privacy.warn svg { color: var(--warning); }
.provider-form { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.test-result { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.test-result:empty { display: none; }
@media (max-width: 600px) {
  .integration .ctl { width: 100%; }
  .integration .ctl .input, .integration .ctl .select { width: 100%; flex: 1; min-width: 0; }
  .topbar .btn.ghost.sm:not(.icon) { display: none; }
  .score-top { flex-direction: column; align-items: stretch; }
  .score-top .gauge { align-self: center; }
}
.provider-tag { color: var(--text-3); font-size: 12px; }
.dropped summary { cursor: pointer; }
.dropped ul { margin: 4px 0 0; padding-left: 18px; }

/* ======================= v0.3 — Bing · Topics · Internal links · Alerts · Report ======================= */
.spacer { flex: 1; }
.btn.bell { position: relative; }
.btn.bell[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.bell-count { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--critical); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--bg); }
.perf-tabs > .tabs { padding: 0; margin-bottom: var(--s4); }
.panel-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.panel-bar > span { min-width: 0; overflow-wrap: anywhere; }
.howto { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.howto code { overflow-wrap: anywhere; }

/* topics */
.topic-ctl-row { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.4fr); gap: var(--s5); align-items: start; }
@media (max-width: 1000px) { .topic-ctl-row { grid-template-columns: minmax(0, 1fr); } }
.range { flex: 1; min-width: 120px; accent-color: var(--primary); height: 28px; }
.range-out { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 36px; text-align: right; }
.topic-stats { display: grid; grid-template-columns: auto auto minmax(180px, 1fr); gap: var(--s3) var(--s5); align-items: end; }
.topic-stats .src-line { grid-column: 1 / -1; margin: 0; }
@media (max-width: 600px) { .topic-stats { grid-template-columns: 1fr 1fr; } .topic-stats .cov-bar { grid-column: 1 / -1; } }
.cov-bar { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cov-track { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.cov-track span { min-width: 0; }
.cov-covered { background: var(--good); } .cov-partial { background: var(--warning); } .cov-gap { background: var(--critical); }
.cov-legend { display: flex; gap: var(--s3); flex-wrap: wrap; color: var(--text-2); }
.cov-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cov-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.topic-filters { border-top: 1px solid var(--border); padding-top: var(--s3); }
.topic-filters .input { width: 220px; max-width: 100%; }
.topic-filters .select { width: auto; }
.cluster-table td { vertical-align: middle; }
.cl-cell { min-width: 220px; }
.expander { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: flex-start; gap: 6px; max-width: 100%; }
.expander svg { flex: none; margin-top: 2px; color: var(--text-3); }
.expander .cl-head { font-weight: 620; color: var(--text); overflow-wrap: anywhere; }
.expander .sub { display: block; }
.expander:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.cluster-row.open td { background: var(--primary-soft); }
.table tbody tr.kw-row:hover td, .kw-row > td { background: var(--surface-2); }
.kw-row > td { padding: 0 var(--s3) var(--s3) 34px; }
.kw-sub { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.kw-sub .table th { position: static; }
.cov-cell { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; min-width: 0; }
.cov-cell a { min-width: 0; }
.badge.intent-informational { background: var(--notice-soft); color: var(--notice-text); }
.badge.intent-commercial { background: var(--warning-soft); color: var(--warning-text); }
.badge.intent-transactional { background: var(--good-soft); color: var(--good-text); }
.badge.intent-navigational { background: var(--muted-soft); color: var(--text-2); }
.pillar-grid { align-items: start; }
.pillar .card-head { align-items: flex-start; }
.pillar-url { display: inline-flex; align-items: center; gap: 2px; overflow-wrap: anywhere; }
.pillar.unassigned { border-style: dashed; }
.pillar-clusters { list-style: none; margin: 0; padding: 0; }
.pillar-clusters li { display: flex; align-items: center; gap: var(--s2); padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.pillar-clusters li:last-child { border-bottom: 0; }
.pillar-clusters .k { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.maps-list .k { white-space: normal; }

/* internal links */
.link-groups { gap: var(--s3); }
.lg-title { overflow-wrap: anywhere; }
.truncate-line { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; min-width: 0; }
.link-group .card-head { align-items: flex-start; flex-wrap: nowrap; }
.suggest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.suggest { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3) 0; border-top: 1px solid var(--border); }
.suggest:first-child { border-top: 0; padding-top: 0; }
.suggest-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) 64px; gap: var(--s3); align-items: start; }
.suggest-main > div { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.suggest-score { text-align: right; }
.suggest-score b { font-variant-numeric: tabular-nums; }
.anchor { background: var(--primary-soft); color: var(--primary); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; align-self: flex-start; }
@media (max-width: 600px) { .suggest-main { grid-template-columns: minmax(0, 1fr) 56px; } .suggest-src { grid-column: 1 / -1; } }
.chips.terms { gap: 4px; }
.sentence { display: flex; flex-direction: column; gap: var(--s2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); background: var(--surface-2); }
.sentence .advice { background: transparent; border: 0; padding: 0; }
.sentence .advice p { margin: 0; }
.sentence-raw { margin: 0; max-height: 120px; }
.btn.copied { border-color: var(--good); color: var(--good-text); }
.sentence-out:empty { display: none; }

/* alerts */
.alerts-toolbar { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.alerts-toolbar .select { width: auto; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: var(--s3); align-items: start; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.alert-item:last-child { border-bottom: 0; }
.alert-item.unread { background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
.alert-sev { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.alert-sev.critical { background: var(--critical-soft); color: var(--critical-text); }
.alert-sev.warning { background: var(--warning-soft); color: var(--warning-text); }
.alert-sev.notice { background: var(--notice-soft); color: var(--notice-text); }
.alert-top { gap: 6px; flex-wrap: wrap; }
.alert-title { overflow-wrap: anywhere; }
.alert-item.read .alert-title { font-weight: 560; color: var(--text-2); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; }
.alert-detail { margin: 4px 0 0; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.alert-meta { margin-top: 4px; gap: 4px; }
.alert-urls { margin-top: 6px; font-size: 12.5px; }
.alert-urls summary { cursor: pointer; color: var(--text-3); }
.alert-actions { display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) { .alert-item { grid-template-columns: 28px minmax(0, 1fr); padding: var(--s3); } .alert-sev { width: 28px; height: 28px; } .alert-actions { grid-column: 2; justify-content: flex-start; } }
.alerts-summary { display: flex; gap: var(--s5); align-items: flex-start; }
@media (max-width: 500px) { .alerts-summary { flex-direction: column; gap: var(--s2); } .alerts-summary .grow { width: 100%; } }
.bing-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.bing-tiles .kpi { flex-direction: column; align-items: flex-start; }
.bing-tiles .stat .value { font-size: 20px; }

/* settings: alerts & telegram */
.telegram { display: flex; flex-direction: column; gap: var(--s3); padding-bottom: var(--s4); border-bottom: 1px solid var(--border); }
.telegram > .row svg { color: #229ed9; }
.howto-box { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); background: var(--surface-2); }
.howto-box summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.howto-box[open] summary { margin-bottom: var(--s2); }
.alert-thresholds { padding-top: var(--s4); }
.thresholds-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.toggle-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s2) var(--s4); }
.toggle-list li { display: flex; align-items: center; gap: var(--s2); font-size: 13px; }

/* report */
.report { display: flex; flex-direction: column; gap: var(--s4); }
.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); flex-wrap: wrap; padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); border-top: 4px solid var(--primary); }
.report-brand { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.report-title { font-size: 22px; margin: 4px 0 2px; }
.report-sub { margin: 0; color: var(--text-2); font-size: 13px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s3); }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-card .label { font-size: 12px; color: var(--text-3); font-weight: 560; }
.kpi-card .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-change { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.report-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 800px) { .report-grid { grid-template-columns: minmax(0, 1fr); } }
.engines { gap: var(--s5); }
.report-table th[scope="row"] { font-weight: 560; color: var(--text-2); text-transform: none; letter-spacing: 0; font-size: 13px; background: transparent; position: static; }
.report-table th { position: static; }
.report-advice { font-size: 14px; }
.report-foot { margin: 0; }

@media print {
  :root, :root * { color-scheme: light; }
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #f7f8fa; --surface-3: #eef0f4; --border: #d9dde3; --border-strong: #c3c9d2;
    --text: #111; --text-2: #3d4450; --text-3: #5c6370; --primary: #1d4fd7; --primary-soft: #e8efff; --muted-soft: #eef0f4;
    --critical: #c4271c; --critical-soft: #fdecea; --critical-text: #a61f15; --warning: #c07800; --warning-soft: #fff4dc; --warning-text: #7d5200;
    --notice: #2a78d6; --notice-soft: #e8f1fc; --notice-text: #1d5aa6; --good: #12854a; --good-soft: #e3f5ea; --good-text: #0e6b3b;
    --series-1: #2a78d6; --series-2: #eb6834; --grid: #e6e8ec; --shadow-sm: none; --shadow: none;
  }
  @page { size: A4; margin: 12mm; }
  html, body { background: #fff !important; height: auto; }
  body { font-size: 11.5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .topbar, .scrim, .toasts, .skip-link, .no-print, .btn, .seg, .toolbar, .pager { display: none !important; }
  .shell { display: block; background: #fff !important; }
  .main, .content { display: block; padding: 0 !important; max-width: none !important; }
  .card, .kpi-card, .report-head { box-shadow: none !important; break-inside: avoid; page-break-inside: avoid; }
  .report { gap: 10px; }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .card-head { padding: 10px 12px 0; } .card-body { padding: 10px 12px; }
  .kpi-card .value { font-size: 19px; }
  .report-head { padding: 10px 14px; }
  .report-title { font-size: 18px; }
  .chart-tip, .crosshair { display: none !important; }
  .report-summary { break-inside: auto; }
  a { color: inherit; text-decoration: none; }
  .table th { position: static; }
}
.report-table tbody tr:last-child th { border-bottom: 0; }
.form-grid.key-form { grid-template-columns: minmax(0, 420px) auto; justify-content: start; }
.report .change { white-space: nowrap; }
@media print { .report .mover-list .k { white-space: normal; } }
@media (max-width: 700px) {
  .cluster-table thead { display: none; }
  .cluster-table, .cluster-table tbody { display: block; }
  .cluster-table tr.cluster-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px var(--s3); border-bottom: 1px solid var(--border); }
  .cluster-table tr.cluster-row td { display: block; border: 0; padding: 0; text-align: left; }
  .cluster-table tr.cluster-row td.cl-cell { flex-basis: 100%; min-width: 0; }
  .cluster-table tr.cluster-row td[data-label]::before { content: attr(data-label) " "; color: var(--text-3); font-size: 11.5px; }
  .cluster-table tr.cluster-row td.cov-td, .cluster-table tr.cluster-row td.act-td { flex-basis: 100%; }
  .cluster-table tr.kw-row { display: block; }
  .cluster-table tr.kw-row > td { display: block; padding: 0 var(--s3) var(--s3); border-bottom: 1px solid var(--border); }
  .report-table th, .report-table td { padding: 6px 8px; }
}
.badge.src-bing { background: #e6f4f1; color: #00695c; }
@media (prefers-color-scheme: dark) { .badge.src-bing { background: #133029; color: #6fd5c3; } }
@media (max-width: 700px) {
  .cluster-table tr.cluster-row td.cov-td { flex: 1 1 160px; }
  .cluster-table tr.cluster-row td.act-td { flex: 0 0 auto; margin-left: auto; }
}

/* ---------------- v0.4 Master site audit ---------------- */
.nav-tag { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; background: var(--primary); color: var(--primary-text); }
.print-only { display: none; }
.linklike { all: unset; cursor: pointer; color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.linklike:hover { text-decoration: underline; }
.linklike:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
:root { --ma-good: #D9F2E3; --ma-good-t: #0e5c33; --ma-warn: #FFF1CC; --ma-warn-t: #7a5200; --ma-bad: #F9D7D5; --ma-bad-t: #9b1c13; --ma-unk: #EEEEEE; --ma-unk-t: #555b66; }
@media (prefers-color-scheme: dark) { :root { --ma-good: #173d28; --ma-good-t: #8fe0b2; --ma-warn: #3e3215; --ma-warn-t: #f5cc6d; --ma-bad: #44201e; --ma-bad-t: #ffa49d; --ma-unk: #2a2f38; --ma-unk-t: #b7bcc7; } }
.score-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; height: 26px; padding: 0 10px; border-radius: 999px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--ma-unk); color: var(--ma-unk-t); }
.score-pill.sm { min-width: 48px; height: 22px; font-size: 12px; padding: 0 8px; }
.score-pill.s-good, .overall-pill.s-good { background: var(--ma-good); color: var(--ma-good-t); }
.score-pill.s-warn, .overall-pill.s-warn { background: var(--ma-warn); color: var(--ma-warn-t); }
.score-pill.s-bad, .overall-pill.s-bad { background: var(--ma-bad); color: var(--ma-bad-t); }
.overall-pill { display: inline-flex; align-items: baseline; gap: 1px; padding: 2px 10px; border-radius: 999px; font-weight: 750; font-variant-numeric: tabular-nums; }
.overall-pill small { font-size: 11px; font-weight: 600; opacity: .75; }
.ma-src { margin-left: 6px; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--notice-text); background: var(--notice-soft); padding: 1px 6px; border-radius: 999px; }
.form-grid.ma-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.ma-run { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; padding-top: var(--s3); border-top: 1px solid var(--border); }
.ma-history .num .row { gap: 4px; }
/* runner */
.ma-stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s2); counter-reset: s; }
.ma-step { display: flex; flex-direction: column; gap: 4px; padding: var(--s3); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.ma-step-dot { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-3); }
.ma-step-label { font-weight: 650; font-size: 13px; }
.ma-step-count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ma-step.active { border-color: var(--primary); background: var(--primary-soft); }
.ma-step.active .ma-step-dot { background: var(--primary); color: var(--primary-text); }
.ma-step.done .ma-step-dot { background: var(--good); color: #fff; }
.ma-step.skipped .ma-step-dot { background: var(--warning); color: #fff; }
.ma-live { margin: 0; min-height: 1.5em; }
/* report */
.ma-head h1 { margin: 0; }
.ma-head p a { display: inline-flex; align-items: center; gap: 2px; }
.ma-toc { position: sticky; top: var(--topbar-h); z-index: 5; display: flex; gap: 4px; overflow-x: auto; padding: 6px; margin: 0 0 var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); scrollbar-width: thin; }
.ma-toc a { flex: none; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.ma-toc a:hover { background: var(--surface-3); text-decoration: none; }
.ma-report { display: flex; flex-direction: column; gap: var(--s5); }
.ma-report section[id] { scroll-margin-top: calc(var(--topbar-h) + 60px); }
.ma-cover, .ma-sec, .ma-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s5); box-shadow: var(--shadow-sm); min-width: 0; }
.ma-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.ma-cover-title { font-size: 32px; letter-spacing: .02em; margin: var(--s3) 0 var(--s2); line-height: 1.1; }
.ma-tagline { font-style: italic; color: var(--text-2); margin: 0 0 var(--s5); font-size: 15px; }
.ma-cover-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ma-cover-cell { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.ma-cover-cell:nth-child(odd) { border-right: 1px solid var(--border); }
.ma-cover-cell:nth-last-child(-n+2) { border-bottom: 0; }
.ma-cover-cell .l, .ma-cover-scores .l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 650; }
.ma-cover-cell strong { font-size: 15px; }
.ma-cover-scores { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); margin: var(--s5) 0 var(--s3); }
.ma-overall { display: flex; flex-direction: column; gap: 4px; }
.ma-overall .overall-pill { font-size: 26px; padding: 4px 14px; }
.ma-secscore { display: flex; flex-direction: column; gap: 4px; }
.ma-counts { display: flex; gap: var(--s3); flex-wrap: wrap; width: 100%; color: var(--text-2); }
.ma-count b { font-variant-numeric: tabular-nums; }
.ma-confidential { font-style: italic; color: var(--text-3); font-size: 12.5px; margin: var(--s4) 0 0; }
.ma-h1 { font-size: 21px; margin: 0 0 var(--s3); line-height: 1.25; }
.ma-h1 em, .ma-divider p { font-weight: 450; color: var(--text-3); font-style: italic; }
.ma-h1 em { font-size: 15px; }
.ma-h2 { font-size: 16px; margin: var(--s4) 0 var(--s2); }
.ma-h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: var(--s4) 0 var(--s2); }
.ma-ref { color: var(--primary); font-variant-numeric: tabular-nums; }
.ma-ai { border-left: 3px solid var(--primary); padding: var(--s2) var(--s4); background: var(--primary-soft); border-radius: var(--radius-sm); margin-bottom: var(--s3); }
.ma-ai .advice p:last-child { margin-bottom: 0; }
.ma-priorities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.ma-prio { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3) var(--s4); border-top: 3px solid var(--critical); min-width: 0; }
.ma-prio.p-technical { border-top-color: var(--warning); }
.ma-prio.p-ai { border-top-color: var(--primary); }
.ma-prio h4 { margin: 0 0 var(--s2); font-size: 13.5px; }
.ma-prio ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.ma-scorecard th[scope="row"], .ma-table tbody th { text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 600; color: var(--text); background: transparent; white-space: normal; position: static; }
.ma-scorecard td, .ma-scorecard th { vertical-align: middle; }
.ma-scorecard tr.ma-group th, .ma-scorecard tr.ma-group td { background: var(--surface-3); color: var(--text-2); font-size: 11.5px; letter-spacing: .06em; position: static; }
.ma-scorecard .ma-weight { color: var(--text-3); white-space: nowrap; font-size: 12.5px; }
.ma-scorecard .ma-finding { min-width: 220px; color: var(--text-2); }
.ma-scorecard .ma-score-td { white-space: nowrap; }
.ma-el-link { color: inherit; }
.ma-el-link:hover { color: var(--primary); }
.ma-scorecard tbody tr:not(.ma-group):hover { background: var(--surface-2); }
.ma-divider { margin: calc(-1 * var(--s5)) calc(-1 * var(--s5)) var(--s5); padding: var(--s5); border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; }
.ma-divider h2 { margin: 4px 0; font-size: 24px; color: #fff; }
.ma-divider p { margin: 0; color: rgba(255, 255, 255, .85); }
.ma-secnum { font-size: 12px; font-weight: 750; letter-spacing: .12em; opacity: .85; }
.ma-divider-score { margin-top: var(--s3); display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ma-item { padding: var(--s4) 0; border-top: 1px solid var(--border); }
.ma-item:first-of-type, .ma-divider + .ma-item, .ma-callout + .ma-item { border-top: 0; }
.ma-el { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s2) var(--s3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); margin: var(--s2) 0; }
.ma-el-main { flex: 1 1 260px; min-width: 0; }
.ma-note { color: var(--text-2); margin-top: 2px; }
.ma-el-act { gap: 4px; }
.ma-table th:first-child { width: 42%; }
.ma-table.cols-4 th:first-child, .ma-table.cols-5 th:first-child { width: 30%; }
.ma-table td { overflow-wrap: anywhere; }
.ma-table td.ma-manual { background: var(--notice-soft); }
.ma-unknown { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--surface-2) 6px 12px); }
.ma-cell-form { display: flex; gap: 4px; align-items: center; min-width: 200px; }
.ma-cell-form .input { flex: 1; min-width: 0; }
.ma-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.ma-callout { margin: var(--s3) 0; padding: var(--s3) var(--s4); border-radius: var(--radius); border-left: 4px solid var(--notice); background: var(--notice-soft); }
.ma-callout p { margin: 4px 0 0; color: var(--text); }
.ma-callout-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; letter-spacing: .08em; color: var(--notice-text); }
.ma-callout.t-update { border-color: #7c4dcc; background: #f1ecfa; } .ma-callout.t-update .ma-callout-label { color: #5b30a6; }
.ma-callout.t-tip { border-color: var(--good); background: var(--good-soft); } .ma-callout.t-tip .ma-callout-label { color: var(--good-text); }
.ma-callout.t-warn { border-color: var(--warning); background: var(--warning-soft); } .ma-callout.t-warn .ma-callout-label { color: var(--warning-text); }
.ma-callout.t-critical { border-color: var(--critical); background: var(--critical-soft); } .ma-callout.t-critical .ma-callout-label { color: var(--critical-text); }
@media (prefers-color-scheme: dark) { .ma-callout.t-update { background: #2a2140; border-color: #a07fe6; } .ma-callout.t-update .ma-callout-label { color: #c8b2f5; } .ma-divider { background: linear-gradient(135deg, #1b2c5e, #23479c); } }
.ma-phase { margin-top: var(--s3); }
.ma-roadmap { margin: var(--s2) 0 0; padding-left: 28px; display: flex; flex-direction: column; gap: 6px; }
.ma-roadmap li { padding-left: 4px; }
.ma-roadmap li > .tick { display: inline-flex; vertical-align: -3px; margin-right: 6px; color: var(--good); }
.ma-roadmap .tick-empty { display: inline-block; width: 15px; height: 15px; border: 1.5px solid var(--border-strong); border-radius: 50%; }
.ma-roadmap li.notrel { color: var(--text-3); }
.ma-rnote { font-weight: 650; color: var(--good-text); font-size: 12.5px; }
.ma-rnote::before { content: "· "; }
.ma-sign { margin-top: var(--s4); }
.ma-drawer .ma-issues { list-style: none; margin: var(--s3) 0 0; padding: 0; border-top: 1px solid var(--border); }
.ma-issues li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.ma-issues .u { overflow-wrap: anywhere; font-size: 13px; }
.ma-issues .d { font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
@media (max-width: 1100px) { .ma-stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ma-priorities { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .form-grid.ma-meta, .form-grid.ma-run { grid-template-columns: minmax(0, 1fr); }
  .ma-stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ma-cover, .ma-sec, .ma-section { padding: var(--s4); }
  .ma-divider { margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s4); padding: var(--s4); }
  .ma-cover-title { font-size: 24px; }
  .ma-cover-grid { grid-template-columns: minmax(0, 1fr); }
  .ma-cover-cell:nth-child(odd) { border-right: 0; }
  .ma-cover-cell:nth-last-child(2) { border-bottom: 1px solid var(--border); }
  .ma-scorecard thead { display: none; }
  .ma-scorecard, .ma-scorecard tbody { display: block; }
  .ma-scorecard tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px var(--s3); border-bottom: 1px solid var(--border); }
  .ma-scorecard tr > * { border: 0 !important; padding: 0 !important; }
  .ma-scorecard tr.ma-group { display: flex; justify-content: space-between; background: var(--surface-3); }
  .ma-scorecard .ma-weight { grid-column: 2; grid-row: 2; text-align: right; }
  .ma-scorecard .ma-finding { grid-column: 1; grid-row: 2; min-width: 0; font-size: 12.5px; }
  .ma-scorecard .ma-act { grid-column: 1 / -1; }
  .ma-scorecard .ma-act .row { justify-content: flex-start !important; }
  .ma-table th:first-child { width: auto; }
  .ma-h1 { font-size: 18px; }
}
@media print {
  .print-only { display: inline !important; }
  .ma-toc, .ma-el-act, .ma-act, .ma-cell-form, .ma-runner { display: none !important; }
  .ma-report { gap: 0; display: block; }
  .ma-cover, .ma-sec, .ma-section { border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 0 0 8mm; }
  .ma-cover { break-after: page; page-break-after: always; min-height: 250mm; display: flex; flex-direction: column; justify-content: center; }
  .ma-cover-title { font-size: 34px; }
  .ma-sec#ma-exec, .ma-sec#ma-scorecard { break-after: page; page-break-after: always; }
  .ma-section { break-before: page; page-break-before: always; }
  .ma-divider { margin: 0 0 6mm; border-radius: 0; break-after: avoid; }
  .ma-item { break-inside: auto; }
  .ma-h1, .ma-h2, .ma-h3 { break-after: avoid; page-break-after: avoid; }
  .ma-table, .ma-callout, .ma-el, .ma-prio { break-inside: avoid; page-break-inside: avoid; }
  .ma-scorecard tr { break-inside: avoid; }
  .ma-scorecard thead { display: table-header-group; }
  .ma-unknown { background: #f3f3f3 !important; }
  .ma-priorities { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  :root { --ma-good: #D9F2E3; --ma-good-t: #0e5c33; --ma-warn: #FFF1CC; --ma-warn-t: #7a5200; --ma-bad: #F9D7D5; --ma-bad-t: #9b1c13; --ma-unk: #EEEEEE; --ma-unk-t: #555b66; }
  .ma-callout.t-update { background: #f1ecfa !important; border-color: #7c4dcc !important; } .ma-callout.t-update .ma-callout-label { color: #5b30a6 !important; }
  .ma-divider { background: #1e3a8a !important; }
  .table-wrap { overflow: visible; }
}
.ma-secscore, .ma-overall { align-items: flex-start; }
.ma-table tbody tr:last-child > * { border-bottom: 0; }
.ma-table tbody tr > * { border-bottom: 1px solid var(--border); }
.ma-runner .card-body > div:empty { display: none; }
.ma-table.cols-4, .ma-table.cols-5 { min-width: 600px; }
.ma-table td.muted { white-space: nowrap; }
@media print { .ma-table.cols-4, .ma-table.cols-5 { min-width: 0; } }
@media print { .ma-item > h3, .ma-item > .ma-el, .ma-h3 { break-after: avoid; page-break-after: avoid; } .ma-item > .ma-el { break-inside: avoid; } }
