/* SEO/AEO Tracker. A working table with a slide-over detail panel; state is carried by severity
   stripes and run badges. */
:root {
  --bg: #f4f5f8; --surface: #ffffff; --surface-2: #f0f2f6; --ink: #151821; --muted: #5a6273; --faint: #8a91a0;
  --line: #e1e4ea; --line-strong: #cdd2db; --accent: #2f55d4; --accent-ink: #ffffff; --accent-soft: #e6ecfd;
  --high: #c43b3b; --high-soft: #fbe9e9; --med: #b0731a; --med-soft: #fbf1df; --low: #66748a; --low-soft: #edf0f4;
  --ok: #2c7a4f; --ok-soft: #e3f3ea; --warn: #b4521f; --warn-soft: #fcebdf;
  --shadow: 0 10px 40px rgb(16 22 40 / .16); --pop: 0 8px 28px rgb(16 22 40 / .14);
  --f-ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e1116; --surface: #161a21; --surface-2: #1c212a; --ink: #e7eaf0; --muted: #a0a8b6; --faint: #737c8c;
  --line: #262c36; --line-strong: #353c48; --accent: #7d9bff; --accent-ink: #0e1116; --accent-soft: #1f2a4a;
  --high: #f07575; --high-soft: #3a1d20; --med: #e1ab50; --med-soft: #36290f; --low: #8f9bb0; --low-soft: #222833;
  --ok: #5fc58d; --ok-soft: #15301f; --warn: #f0965c; --warn-soft: #3a2314; --shadow: 0 10px 40px rgb(0 0 0 / .5);
  --pop: 0 8px 28px rgb(0 0 0 / .45); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0e1116; --surface: #161a21; --surface-2: #1c212a; --ink: #e7eaf0; --muted: #a0a8b6; --faint: #737c8c;
  --line: #262c36; --line-strong: #353c48; --accent: #7d9bff; --accent-ink: #0e1116; --accent-soft: #1f2a4a;
  --high: #f07575; --high-soft: #3a1d20; --med: #e1ab50; --med-soft: #36290f; --low: #8f9bb0; --low-soft: #222833;
  --ok: #5fc58d; --ok-soft: #15301f; --warn: #f0965c; --warn-soft: #3a2314; --shadow: 0 10px 40px rgb(0 0 0 / .5);
  --pop: 0 8px 28px rgb(0 0 0 / .45); color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
h3 { font-size: 15px; font-weight: 600; margin: 0; }
p { margin: 0; }
code, .mono { font-family: var(--f-mono); font-size: 12.5px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 15; }
.topbar .inner { max-width: 1320px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 14px; min-height: 56px; }
.brand { font-weight: 650; text-decoration: none; color: var(--ink); white-space: nowrap; letter-spacing: -.01em; }
.tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; align-self: stretch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: flex; align-items: center; padding: 0 12px; color: var(--muted); text-decoration: none; font-weight: 550;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.who a { color: var(--muted); }
.who a:hover { color: var(--ink); }

/* site picker */
.sitepick { position: relative; }
.sitebtn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 12px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: var(--surface); cursor: pointer; font-weight: 600; max-width: 260px; }
.sitebtn:hover { border-color: var(--faint); }
.sitebtn .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sitebtn svg { width: 14px; height: 14px; color: var(--muted); flex: none; transition: transform .15s; }
.sitebtn[aria-expanded="true"] svg { transform: rotate(180deg); }
.sitemenu { position: absolute; top: calc(100% + 6px); left: 0; width: 300px; max-width: calc(100vw - 32px); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop); z-index: 30; padding: 8px; display: grid; gap: 6px; }
.sitemenu input { width: 100%; }
.sitemenu ul { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; display: grid; gap: 2px; }
.sitemenu a { display: grid; gap: 1px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.sitemenu a:hover, .sitemenu a.hl { background: var(--surface-2); }
.sitemenu a[aria-current="true"] { background: var(--accent-soft); }
.sitemenu a .addr { font-size: 12px; color: var(--muted); font-family: var(--f-mono); }
.sitemenu a .tagline { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.sitemenu .none { padding: 8px 10px; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .topbar .inner { flex-wrap: wrap; gap: 8px 12px; padding: 8px 16px 0; }
  .brand { order: 1; }
  .sitepick { order: 2; flex: 1; min-width: 0; }
  .sitebtn { max-width: 100%; }
  .who { order: 3; }
  .who .nm { display: none; }
  .tabs { order: 4; flex-basis: 100%; margin: 0 -16px; padding: 0 6px; min-height: 42px; }
  .sitemenu { left: auto; right: auto; }
}

/* ---------- page ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 22px 20px 60px; display: grid; gap: 18px; }
@media (max-width: 640px) { .wrap { padding-inline: 16px; } }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.pagehead p { margin-top: 4px; color: var(--muted); max-width: 78ch; }
.flash { padding: 10px 12px; border-radius: 9px; background: var(--accent-soft); color: var(--ink); font-size: 13.5px; }
.flash.error { background: var(--high-soft); color: var(--high); }
.note-run { font-size: 12.5px; color: var(--muted); }

/* ---------- controls ---------- */
.field { height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); min-width: 0; }
textarea.field { height: auto; min-height: 70px; padding: 9px 11px; resize: vertical; width: 100%; }
select.field { padding-right: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 550; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.danger { color: var(--high); border-color: var(--high); }
.btn.link { border: 0; background: none; padding: 0; height: auto; color: var(--accent); font-weight: 500; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.switch { width: 36px; height: 20px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface-2); position: relative; cursor: pointer; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--faint); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { left: 18px; background: var(--accent-ink); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- badges, pills, tags ---------- */
.tag { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; border: 1px solid var(--line); }
.pill { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; font-weight: 550; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--high-soft); color: var(--high); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.b-found { background: var(--med-soft); color: var(--med); }
.b-new { background: var(--high-soft); color: var(--high); }
.b-gone { background: var(--ok-soft); color: var(--ok); }
.b-none { background: var(--low-soft); color: var(--low); }
.b-regress { background: var(--warn-soft); color: var(--warn); }
.b-run { background: var(--accent-soft); color: var(--accent); }
.b-run::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .b-run::before { animation: none; } }
.sevlabel { font-size: 11.5px; font-weight: 600; }
.sevlabel.High { color: var(--high); } .sevlabel.Medium { color: var(--med); } .sevlabel.Low { color: var(--low); }
.tally { display: block; font-size: 11.5px; color: var(--faint); margin-top: 3px; font-variant-numeric: tabular-nums; }

/* ---------- tables ---------- */
.tablebox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- cards, chips, setting groups ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 10px; min-width: 0; }
.card > p, .card .help { color: var(--muted); font-size: 13px; }
.card .meta { color: var(--faint); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; max-width: 100%; }
.chip > span { overflow-wrap: anywhere; }
.chip.re > span { font-family: var(--f-mono); font-size: 12px; }
.chip button { border: 0; background: none; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; color: var(--muted); font-size: 14px; line-height: 1; flex: none; }
.chip button:hover { background: var(--line); color: var(--ink); }
.chipadd { display: flex; gap: 6px; }
.chipadd .field { flex: 1 1 0; width: 0; min-width: 0; }
.topicrow { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.topicrow:first-of-type { border-top: 0; padding-top: 0; }
.topicrow header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topicrow header b { font-weight: 600; }
.setgroups { display: grid; gap: 26px; }
.wrap > *, .setgroups > *, .setgroup > *, .about > *, .about section > * { min-width: 0; }
.setgroup { display: grid; gap: 10px; }
.setgroup > header p { margin-top: 4px; color: var(--muted); font-size: 13px; max-width: 86ch; }
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.form label .field { width: 100%; color: var(--ink); font-weight: 400; }
.form .hint { font-weight: 400; color: var(--faint); }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .form .two { grid-template-columns: 1fr; } }
.kvlist { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; margin: 0; }
.kvlist dt { color: var(--muted); } .kvlist dd { margin: 0; overflow-wrap: anywhere; }
details.fold { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
details.fold > summary { cursor: pointer; padding: 12px 14px; display: flex; align-items: baseline; gap: 10px; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; color: var(--faint); width: 12px; transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary span { color: var(--muted); font-size: 13px; }
details.fold > .foldbody { padding: 0 14px 14px; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.subtabs a { padding: 9px 14px; color: var(--muted); text-decoration: none; font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* connected services */
.svc { list-style: none; margin: 0; padding: 0; display: grid; }
.svc li { padding: 9px 0; border-top: 1px solid var(--line); display: grid; gap: 3px; }
.svc li:first-child { border-top: 0; padding-top: 0; }
.svc .head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.svc .name { font-weight: 600; }
.svc .detail { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.svc details summary { cursor: pointer; color: var(--accent); font-size: 12.5px; }
.svc details p { font-size: 12.5px; margin-top: 4px; }

/* ---------- briefs ---------- */
.runbox { display: grid; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: min(100%, 420px); max-width: 640px; }
.runbox .state { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.runbox .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.runkinds { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 12.5px; color: var(--muted); }
.runkinds dt { font-weight: 600; color: var(--ink); white-space: nowrap; }
.runkinds dd { margin: 0; }
.runkinds b { color: var(--ink); font-weight: 600; }
@media (max-width: 520px) { .runkinds { grid-template-columns: 1fr; } .runkinds dd { margin-bottom: 4px; } }
.runbox .hint { font-size: 12.5px; color: var(--muted); }
.steps { display: flex; flex-wrap: wrap; gap: 4px; }
.step { font-family: var(--f-mono); font-size: 11.5px; padding: 2px 7px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); }
.step.bad { background: var(--high-soft); color: var(--high); }
.step.skip, .step.todo { background: var(--low-soft); color: var(--low); }
.step.now { background: var(--accent-soft); color: var(--accent); }
.briefs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.blist { display: grid; gap: 6px; position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; padding: 2px; }
.bitem { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: grid; gap: 3px; text-decoration: none; color: var(--ink); }
.bitem:hover { border-color: var(--line-strong); }
.bitem[aria-current="true"] { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.bitem .bd { font-weight: 600; font-variant-numeric: tabular-nums; }
.bitem .bl { font-size: 12.5px; color: var(--muted); }
.bitem .bt { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.brief { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px 26px; min-width: 0; display: grid; gap: 16px; }
.bmeta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--muted); font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.kpi { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; background: var(--surface-2); align-content: start; }
.kpi .kl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi .kv { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .kc { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.kpi .kc.up { color: var(--ok); } .kpi .kc.down { color: var(--high); }
.kpi .kp { font-size: 11.5px; color: var(--faint); line-height: 1.35; margin-top: 3px; }
.md { max-width: 78ch; display: grid; gap: 10px; min-width: 0; font-size: 14.5px; line-height: 1.55; }
.md > * { margin: 0; }
.md h1 { font-size: 20px; }
.md h2 { font-size: 13px; margin-top: 10px; }
.md h3 { font-size: 15px; margin-top: 6px; }
.md ul, .md ol { padding-left: 22px; display: grid; gap: 5px; }
.md li > ul, .md li > ol { margin-top: 5px; }
.md li p { margin: 0; }
.md em { color: var(--muted); }
.md a { color: var(--accent); }
.md a.flink { text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-weight: 550; }
.md a.flink:hover { border-bottom-color: var(--accent); }
.md table { display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; }
.md table td, .md table th { padding: 7px 9px; }
.md pre { background: var(--surface-2); padding: 10px; border-radius: 9px; overflow-x: auto; }
.alert { padding: 10px 12px; border-radius: 9px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--surface-2); }
.alert.warn, .alert.regress { background: var(--warn-soft); color: var(--warn); }
.alert.gone { background: var(--ok-soft); color: var(--ok); }
.alert .btn { margin-left: auto; }
@media (max-width: 820px) {
  .briefs { grid-template-columns: 1fr; }
  .blist { position: static; max-height: none; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); overflow-x: auto; padding-bottom: 4px; }
  .brief { padding: 16px; }
}

/* ---------- findings ---------- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; display: grid; gap: 2px; }
.stat:hover { border-color: var(--line-strong); }
.stat[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.stat .n { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .l { font-size: 12.5px; color: var(--muted); }
.stat[aria-pressed="true"] .n { color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input[type=search] { flex: 1 1 220px; }
.filters label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.count { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
table.ftable { min-width: 980px; }
.ftable tbody tr { cursor: pointer; }
.ftable tbody tr:hover td { background: var(--surface-2); }
.ftable tbody tr.sel td { background: var(--accent-soft); }
td.sev { width: 6px; padding: 0; }
td.sev i { display: block; width: 4px; min-height: 52px; height: 100%; border-radius: 0 3px 3px 0; }
.s-High i, .dot.s-High { background: var(--high); } .s-Medium i, .dot.s-Medium { background: var(--med); } .s-Low i, .dot.s-Low { background: var(--low); }
.ftable .title { font-weight: 550; display: block; }
.ftable .metric { color: var(--muted); font-size: 12.5px; display: block; margin-top: 2px; }
.ftable td select, .ftable td input { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 0 8px; max-width: 150px; }
.ftable td input { width: 130px; }
.ftable td select:hover, .ftable td input:hover { border-color: var(--line-strong); }
select.st-New { color: var(--accent); } select.st-Done { color: var(--ok); } select.st-Ignored { color: var(--faint); } select.st-In-progress { color: var(--med); }
.notes-n { font-variant-numeric: tabular-nums; color: var(--muted); }
.upd { color: var(--faint); font-size: 12px; white-space: nowrap; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgb(10 14 24 / .35); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--surface); box-shadow: var(--shadow); z-index: 21;
  display: flex; flex-direction: column; border-left: 1px solid var(--line); }
@media (prefers-reduced-motion: no-preference) {
  .drawer.open { animation: slide .2s ease-out; }
  @keyframes slide { from { transform: translateX(40px); opacity: .5; } }
  @media (max-width: 640px) { .drawer.open { animation: rise .2s ease-out; } @keyframes rise { from { transform: translateY(40px); opacity: .5; } } }
}
.dhead { padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.dhead .row { flex-wrap: wrap; }
.dhead h3 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; text-wrap: balance; }
.x { border: 1px solid var(--line); background: var(--surface); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; flex: none; margin-left: auto; }
.controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.controls label { display: grid; gap: 4px; font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.controls .field { width: 100%; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); }
.dbody { overflow-y: auto; padding: 16px 20px calc(28px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 20px; align-content: start; flex: 1; }
.sec { display: grid; gap: 8px; min-width: 0; }
.sec .md { font-size: 14px; }
.kv { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 12.5px; }
.kv b { color: var(--ink); font-weight: 550; }
.mini { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.mini table { font-size: 13px; }
.mini td, .mini th { padding: 7px 9px; }
.urls { display: grid; gap: 4px; }
.urls a { color: var(--accent); text-decoration: none; word-break: break-all; font-family: var(--f-mono); font-size: 12.5px; }
.urls a:hover { text-decoration: underline; }
.timeline { display: grid; gap: 6px; }
.tl { display: grid; grid-template-columns: 92px auto 1fr; gap: 10px; align-items: baseline; font-size: 13px; }
.tl .d { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.notebox { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; display: grid; gap: 4px; }
.notebox .by { font-size: 12px; color: var(--muted); }
.notebox .txt { white-space: pre-wrap; word-break: break-word; }
.addnote { display: grid; gap: 8px; justify-items: end; }
@media (max-width: 640px) {
  .drawer { width: 100%; border-left: 0; }
  .controls { grid-template-columns: 1fr; }
  .tl { grid-template-columns: 80px 1fr; }
  .tl .n2 { grid-column: 2; }
}

/* ---------- AI questions ---------- */
.addq { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.addq label { display: grid; gap: 4px; font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.addq .field { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); }
.addq .grow { flex: 1 1 260px; min-width: 0; }
.addq .grow .field { width: 100%; }
table.qtable { min-width: 900px; }
.qtable tr.paused td { opacity: .55; }
.qtable tr.paused td:nth-last-child(-n+2) { opacity: 1; }
.qtext { display: block; font-weight: 500; }
.qwhy { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.res { display: grid; gap: 3px; font-size: 12.5px; }
.res .badge { justify-self: start; }
.resbtn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; cursor: pointer; justify-self: start; text-align: left; }
.resbtn .read { font-size: 12px; color: var(--accent); opacity: 0; transition: opacity .12s; }
.resbtn:hover .read, .resbtn:focus-visible .read { opacity: 1; }
.resbtn:hover .badge { box-shadow: inset 0 0 0 1px currentColor; }
@media (hover: none) { .resbtn .read { opacity: 1; } }
.res .cmp { color: var(--faint); font-size: 11.5px; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--faint); }
.trend i { width: 7px; height: 7px; border-radius: 2px; background: var(--line); display: inline-block; }
.trend i.m { background: var(--ok); opacity: .55; }
.trend i.c { background: var(--ok); }
.trend i.e { background: var(--high); opacity: .6; }
.trend span { margin-left: 4px; }
.asof { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; font-size: 13px; }
.asof label { color: var(--muted); }
.asof .field { width: auto; max-width: 100%; min-width: 0; }
.asofcard { margin-bottom: 14px; }
.asofcard p { margin: 0 0 8px; }
.asofcard .rates { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
details.retired { margin-top: 18px; }
details.retired > summary { cursor: pointer; font-weight: 500; font-size: 14px; padding: 6px 0; }
details.retired > p { margin: 4px 0 10px; }
.rowbtns { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.qedit { display: grid; gap: 6px; }
.qedit .warn { font-size: 12px; color: var(--warn); }

/* ---------- how it works ---------- */
.about { display: grid; gap: 28px; max-width: 1080px; }
.about section { display: grid; gap: 10px; }
.ab-intro p { max-width: 80ch; font-size: 15px; }
.ab-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; max-width: 86ch; }
.ab-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; max-width: 86ch; }
.about .mini table { min-width: 720px; font-size: 13.5px; }
.about .mini td:first-child { width: 180px; }
.about .mini td:last-child { width: 180px; color: var(--muted); }
.ab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.ab-grid .card p { color: var(--muted); }
.ab-dl { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; margin: 0; }
.ab-dl dt { font-weight: 600; } .ab-dl dd { margin: 0; line-height: 1.9; }
.ab-dl .badge { margin-right: 4px; }
@media (max-width: 640px) { .ab-dl { grid-template-columns: 1fr; gap: 2px; } .ab-dl dd { margin-bottom: 10px; } }

/* ---------- run page ---------- */
.track { list-style: none; padding: 0; margin: 0; counter-reset: step; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.track li { display: grid; grid-template-columns: 26px 170px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid var(--line); counter-increment: step; }
.track li:last-child { border-bottom: 0; }
.track li::before { content: counter(step); font-size: 12px; color: var(--faint); text-align: right; }
.track .name { font-weight: 600; }
.track .detail { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.track .secs { color: var(--faint); font-size: 12px; white-space: nowrap; margin-left: 6px; }
@media (max-width: 640px) { .track li { grid-template-columns: 22px 1fr auto; } .track .detail { grid-column: 2 / -1; } }
pre.log { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: 12.5px/1.45 var(--f-mono); max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

/* ---------- sign in ---------- */
.signin { max-width: 440px; margin: 10vh auto 0; display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg);
  padding: 9px 14px; border-radius: 9px; z-index: 40; font-size: 13px; max-width: calc(100% - 32px); }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } }

/* run costs */
table.costs td.num, table.costs th.num, td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.costs tfoot td { border-top: 1px solid var(--line-strong); }

/* brief list: keep each item inside its column; long summaries end in an ellipsis */
.bitem { min-width: 0; overflow: hidden; }
.bitem .bt { min-width: 0; flex-wrap: nowrap; }
.bitem .bt .pill { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.savestate { margin: 0; min-height: 18px; font-size: 12.5px; color: var(--faint); }
.savestate.ok { color: var(--ok); }
.savestate.bad { color: var(--high); }
.field[aria-invalid="true"] { border-color: var(--high); }

/* Setup wizard */
.wizard { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.wsteps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ws { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; row-gap: 2px; align-items: center; padding: 9px 10px;
  border-radius: 10px; color: var(--ink); text-decoration: none; border: 1px solid transparent; }
a.ws:hover { background: var(--surface); border-color: var(--line); }
.ws[aria-current="step"] { background: var(--surface); border-color: var(--line-strong); box-shadow: 0 1px 2px rgb(16 22 40 / .05); }
.ws .num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.ws[aria-current="step"] .num { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ws.done .num { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.ws.warn .num { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.ws.bad .num { background: var(--high-soft); color: var(--high); border-color: transparent; }
.ws.later { color: var(--faint); }
.ws .wt { font-weight: 550; font-size: 13.5px; }
.ws .wst { grid-column: 2; line-height: 1; }
.wbody { padding: 18px; gap: 14px; }
.wbody h2 { font-size: 17px; margin: 0; text-transform: none; letter-spacing: -.005em; color: var(--ink); font-weight: 650; }
.wbody > p { margin: 0; color: var(--muted); max-width: 75ch; }
.wnav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.wnav .grow { flex: 1; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ck { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; font-size: 13.5px; align-items: start; }
.ck .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; margin-top: 1px; }
.ck.ok .ic { background: var(--ok-soft); color: var(--ok); }
.ck.warn .ic { background: var(--warn-soft); color: var(--warn); }
.ck.bad .ic { background: var(--high-soft); color: var(--high); }
.ck.off .ic { background: var(--surface-2); color: var(--faint); }
.ck.bad { color: var(--high); }
.copyrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.copyrow code { font-family: var(--f-mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; overflow-wrap: anywhere; }
.howto { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; }
details.more > summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 500; }
details.more > .form { margin-top: 10px; }
.cards.two-up { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.cardstack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.drafted .note { display: block; margin-top: 4px; color: var(--ink); }
table.wq { min-width: 560px; }
table.wq td { vertical-align: top; }
.wqform { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px; }
.wqform .field { width: 100%; }
.wqform textarea.qta { min-height: 34px; padding: 6px 10px; resize: vertical; line-height: 1.4; field-sizing: content; }
.alert.bad { background: var(--high-soft); color: var(--high); }
.alert.good { background: var(--ok-soft); color: var(--ok); }
.alert.setupbanner { background: var(--accent-soft); color: var(--ink); }
.readylist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.readylist > li { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.readylist .rh { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-weight: 600; }
.wfinal { border-top: 1px solid var(--line); padding-top: 14px; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.card.suggest { margin: 0 0 14px; }
.sghead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sglist { list-style: none; margin: 0; padding: 0; display: grid; }
.sglist > li { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sglist > li > div:first-child { flex: 1 1 320px; min-width: 0; }
@media (max-width: 820px) {
  .wizard { grid-template-columns: minmax(0, 1fr); }
  .wsteps ol { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: thin; }
  .wsteps li { flex: none; }
  .ws { grid-template-columns: 22px auto; padding: 6px 9px; }
  .ws .wst { display: none; }
  .ws .wt { font-size: 12.5px; white-space: nowrap; }
  .wqform { grid-template-columns: minmax(0, 1fr); }
  table.wq { min-width: 0; }
  table.wq thead { display: none; }
}
