/* P.A.T.H's design, ported: the same tokens, top bar, panels, forms, tables, badges and stepper, with Soapbox branding.
   The primary is the Soapbox orange from the logo; the derived tokens follow P.A.T.H's applyBrandTheme. */
:root {
  --background: #f2f6f8; --foreground: #141b24; --card: #ffffff; --secondary: #ecf1f5; --muted: #eff2f5; --muted-foreground: #606a74;
  --primary: #f29c17; --primary-foreground: #141b24; --accent: #f6b753; --destructive: #d01d21; --border: #dadfe3;
  --brand-navy: #020306; --brand-blue: #f29c17; --brand-blue-dark: #8a5607; --logo-blue: #f8c76f;
  --gradient-brand: linear-gradient(160deg, #b9730a, #f29c17 55%, #f6b753);
  --shadow-card: 0 12px 30px -18px rgba(3, 23, 44, 0.45);
  --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px; --radius-xl: 12px; --radius-2xl: 16px;
  --font: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ok: #1f8f4e; --ok-text: #176b3b; --warn: #8a4600; --bad: #d01d21;
  --link: #1b5fb8; --link-hover: #124a93; --amber-bg: #fff4e0; --amber-text: #8a4600; --row-line: #e8ecf0;
}
* { box-sizing: border-box; border-color: var(--border); }
[hidden] { display: none !important; }
html { background: var(--background); }
body { margin: 0; font-family: var(--font); color: var(--foreground); background: var(--background); font-size: 14px; line-height: 1.45; }

/* ---- Top bar ---- */
.topbar { background: var(--brand-navy); color: #fff; }
.topbar-inner { max-width: 1280px; margin: 0 auto; height: 64px; display: flex; align-items: center; gap: 24px; padding: 0 24px; }
.topbar .logo { height: 36px; width: auto; }
.topbar .app-name { color: rgba(255,255,255,.7); font-size: 13px; font-weight: 500; letter-spacing: .02em; border-left: 1px solid rgba(255,255,255,.15); padding-left: 16px; white-space: nowrap; }
.topbar nav { margin-left: auto; display: flex; gap: 4px; }
.topbar nav a { color: rgba(255,255,255,.7); text-decoration: none; padding: 8px 12px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; white-space: nowrap; }
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar nav a.active { background: var(--primary); color: var(--primary-foreground); }
.rule { height: 4px; background: var(--primary); }
.session-box { margin-left: 12px; font-size: 12px; color: rgba(255,255,255,.7); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.banner { background: var(--brand-navy); color: #fff; text-align: center; padding: 8px; font-size: 13px; }
.banner button { margin-left: 10px; padding: 4px 10px; font-size: 12px; }
/* loading state: a spinner, never a blank page */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 40vh; color: var(--muted-foreground); font-size: 13px; }
.loading .spinner { width: 34px; height: 34px; border: 3px solid color-mix(in srgb, var(--primary) 18%, transparent); border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Layout ---- */
main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 60px; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 16px; }
h2 { font-size: 16px; font-weight: 600; margin: 22px 0 10px; }
h3 { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted-foreground); margin: 14px 0 6px; }
p { margin: 0 0 8px; }
p.muted, .muted { color: var(--muted-foreground); }
.small { font-size: 12px; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
.panel { background: var(--card); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); padding: 18px 20px; margin-bottom: 16px; }
.panel h2:first-child { margin-top: 0; }
details.panel summary { cursor: pointer; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-review { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); gap: 18px; align-items: start; }
.courses-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.courses-head h1 { margin-bottom: 10px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted-foreground); }
.sticky { position: sticky; top: 20px; }

/* ---- Forms ---- */
label { display: block; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted-foreground); margin-bottom: 5px; }
input[type=text], input[type=number], input[type=password], input[type=url], input[type=email], select, textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); font: inherit; background: #fff; color: var(--foreground); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 1px; border-color: var(--primary); }
textarea { resize: vertical; min-height: 60px; line-height: 1.45; }
textarea.code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; line-height: 1.55; }
.field { margin-bottom: 12px; }
button, .button { font: inherit; font-weight: 500; padding: 8px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: #fff; cursor: pointer; color: var(--foreground); box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: background .15s, opacity .15s; }
button:hover, .button:hover { background: var(--secondary); }
button.primary, .button.primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
button.primary:hover, .button.primary:hover { background: var(--primary); opacity: .9; }
button.danger { color: var(--destructive); }
button.small, .button.small { padding: 4px 9px; font-size: 12px; }
button.link { border: none; background: none; box-shadow: none; color: var(--link); padding: 4px 6px; }
button.link:hover { background: var(--secondary); }
button:disabled { opacity: 1; background: var(--muted); color: var(--muted-foreground); border-color: var(--border); cursor: default; }
button.link:disabled { background: none; }
a.button, label.button { display: inline-block; text-decoration: none; } label.button { text-transform: none; letter-spacing: 0; font-size: inherit; margin: 0; }
.inline { display: inline; width: auto; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 9px 8px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted-foreground); background: var(--secondary); border-bottom: 1px solid var(--border); }
th:first-child { border-radius: var(--radius-md) 0 0 0; } th:last-child { border-radius: 0 var(--radius-md) 0 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover, th.sortable:focus-visible { color: var(--foreground); }
th[aria-sort]::after { content: " \2191"; color: var(--foreground); }
th[aria-sort="descending"]::after { content: " \2193"; }
td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--row-line); vertical-align: top; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: rgba(236,241,245,.5); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--muted); color: #4a5560; white-space: nowrap; }
.badge.PASS, .badge.done { background: rgba(31,143,78,.12); color: var(--ok-text); }
.badge.FAIL, .badge.failed, .badge.hard { background: rgba(208,29,33,.1); color: var(--destructive); }
.badge.review, .badge.major { background: #fff4e0; color: #8a4600; }
.badge.minor { background: var(--muted); color: #4a5560; }
.badge.running, .badge.queued { background: rgba(27,95,184,.12); color: var(--link-hover); }
.badge.warn { background: var(--amber-bg); color: var(--amber-text); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--border); background: #fff; }

/* ---- Progress / logs / notices ---- */
.progress { height: 8px; background: var(--muted); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: var(--gradient-brand); transition: width .4s; }
.log { background: var(--brand-navy); color: #cbd5e1; font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; padding: 12px; border-radius: var(--radius-lg); max-height: 320px; overflow: auto; white-space: pre-wrap; }
.error { background: rgba(208,29,33,.08); color: #8a1418; padding: 10px 12px; border-radius: var(--radius-lg); margin: 10px 0; border-left: 3px solid var(--destructive); }
.notice { background: var(--secondary); color: var(--foreground); padding: 10px 12px; border-radius: var(--radius-lg); margin: 10px 0; border-left: 3px solid var(--muted-foreground); }
.notice.warn { background: var(--amber-bg); color: var(--amber-text); border-left-color: #e8a33d; }
.ok { color: var(--ok); } .bad { color: var(--destructive); }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 8px 14px; font-size: 13px; }
.kv b { color: var(--muted-foreground); font-weight: 600; font-size: 11px; letter-spacing: 0; text-transform: none; padding-top: 2px; }
code { background: var(--muted); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--brand-navy); color: #fff; padding: 10px 14px; border-radius: var(--radius-lg); z-index: 10; max-width: 420px; box-shadow: var(--shadow-card); }
.toast.bad { background: var(--destructive); }

/* ---- Stage stepper (P.A.T.H) ---- */
.stepper { list-style: none; display: flex; margin: 0 0 22px; padding: 14px 8px 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(0,0,0,.04); overflow-x: auto; }
.stepper .step { flex: 1; position: relative; min-width: 96px; text-align: center; }
.stepper .step a, .stepper .step .step-link { display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none; color: var(--muted-foreground); font-size: 12px; font-weight: 500; }
.stepper .step.blocked { opacity: 1; }
.stepper .step.blocked .label, .stepper .step.blocked .dot { color: var(--muted-foreground); }
.stepper .step::before, .stepper .step::after { content: ""; position: absolute; top: 15px; height: 3px; background: var(--border); width: 50%; z-index: 0; }
.stepper .step::before { left: 0; } .stepper .step::after { right: 0; }
.stepper .step:first-child::before, .stepper .step:last-child::after { display: none; }
.stepper .step.done::before, .stepper .step.done::after, .stepper .step.active::before, .stepper .step.working::before, .stepper .step.error::before { background: var(--primary); }
.stepper .dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: #fff; border: 3px solid var(--border); color: var(--muted-foreground); }
.stepper .step.done .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.stepper .step.done .label { color: var(--foreground); }
.stepper .step.active .dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent); }
.stepper .step.active .label { color: var(--brand-blue-dark); font-weight: 700; }
.stepper .step.working .dot { border-color: var(--primary); }
.stepper .dot-spin { width: 14px; height: 14px; border: 3px solid color-mix(in srgb, var(--primary) 25%, transparent); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
.stepper .step.error .dot { background: var(--destructive); border-color: var(--destructive); color: #fff; }
.stepper .step.error .label { color: var(--destructive); font-weight: 700; }
.stepper .step.skipped .dot { border-color: var(--primary); border-style: dashed; color: var(--primary); }
.stepper .step.skipped::before, .stepper .step.skipped::after { background: var(--primary); }
.stepper .step.blocked .step-link { cursor: not-allowed; }
.stepper .step.current .label { text-decoration: underline; text-underline-offset: 4px; }
.stage-lock .lock-icon { font-size: 20px; }
.stage-lock .lock-icon { display: inline-flex; color: var(--muted-foreground); }
.stage-lock { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 18px; background: var(--secondary); border: 1px solid var(--border); border-left: 4px solid var(--muted-foreground); border-radius: var(--radius-lg); color: #6b4a00; font-size: 13px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(2,3,6,.45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; overflow-y: auto; padding: 24px 0; }
.modal { background: #fff; border-radius: var(--radius-xl); padding: 22px 26px; max-width: 520px; width: calc(100% - 40px); box-shadow: 0 20px 60px rgba(0,0,0,.25); margin: auto; }

/* ---- History lists (agents, rulebooks) ---- */
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--border); font-size: 12px; }
.history li:first-child { border-top: 0; }
.history .v { color: var(--muted-foreground); min-width: 28px; font-weight: 600; }

/* ---- The AI check: the copy in a panel with each finding marked, the verdict and the findings beside it ---- */
.copy { font-size: 15px; line-height: 1.6; max-width: 72ch; }
.copy .copy-head { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted-foreground); font-size: 12px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.copy h2 { font-size: 20px; margin: 22px 0 8px; } .copy h3 { font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--foreground); margin: 18px 0 6px; }
.copy p, .copy li { margin: 0 0 12px; } .copy li { margin-left: 18px; }
.copy mark { background: transparent; color: inherit; padding: 1px 0; border-bottom: 2px solid; cursor: pointer; border-radius: 2px; }
.copy mark.hard { border-color: var(--destructive); background: rgba(208,29,33,.12); }
.copy mark.major { border-color: #e8a33d; background: #fff1d6; }
.copy mark.minor { border-color: #9aa3ad; background: rgba(154,163,173,.18); }
.copy mark.on { outline: 2px solid var(--foreground); outline-offset: 1px; }
.score { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.score svg { width: 92px; height: 92px; flex: none; }
.score .num { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.score .of { color: var(--muted-foreground); font-size: 13px; margin-left: 3px; }
.score .reasons { color: var(--muted-foreground); font-size: 12px; margin-top: 4px; }
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 10px; align-items: center; font-size: 12px; margin: 12px 0; }
.bars .progress { margin: 0; height: 6px; }
.bars .val { font-variant-numeric: tabular-nums; min-width: 24px; text-align: right; font-weight: 600; }
.findings { list-style: none; padding: 0; margin: 10px 0 0; }
.findings li { border-top: 1px solid var(--border); padding: 10px 4px; cursor: pointer; }
.findings li:hover, .findings li.on { background: rgba(236,241,245,.6); }
.findings .pat { font-weight: 600; margin-left: 6px; }
.findings .quote { display: block; color: #344054; font-size: 13px; margin-top: 4px; font-style: italic; }
.findings .more { display: none; margin-top: 8px; font-size: 13px; color: #344054; }
.findings li.on .more { display: block; }
.findings .more b { font-weight: 600; color: var(--foreground); }
/* the side of the Checks stage scrolls on its own so the criteria stay beside the copy */
.grid-review > .side { max-height: calc(100vh - 32px); overflow: auto; padding: 2px; margin: -2px; }
.score .num { font-size: 36px; }
.crits { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.crit { border-bottom: 1px solid var(--border); }
.crit-head { display: flex; align-items: center; gap: 6px; padding: 8px 4px; cursor: pointer; }
.crit.clear .crit-head { padding: 5px 4px; cursor: default; color: var(--muted-foreground); }
.crit.clear .pat { font-weight: 400; color: var(--foreground); }
.crit .pts { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--destructive); }
.crit .tick { color: var(--ok); font-weight: 700; width: 18px; text-align: center; }
.crit-body { display: none; padding: 0 4px 8px 4px; }
.crit.on .crit-body { display: block; }
.crit.on .crit-head { background: rgba(236,241,245,.6); }
.quote { padding: 8px 10px; margin: 4px 0; border-left: 3px solid var(--border); cursor: pointer; font-size: 13px; color: #344054; }
.quote q { font-style: italic; display: block; margin-bottom: 4px; }
.quote.on, .quote:hover { border-left-color: var(--primary); background: rgba(236,241,245,.6); }
.quote b { color: var(--foreground); font-weight: 600; }
.voice .status { font-weight: 700; } .voice .INTACT { color: var(--ok); } .voice .AT_RISK { color: #b35c00; } .voice .STRIPPED { color: var(--destructive); } .voice .UNKNOWN { color: var(--muted-foreground); }
.runmeta { font-size: 12px; color: var(--muted-foreground); }
.runmeta summary { cursor: pointer; }
.pending .score .num { color: var(--border); }
/* library of existing pages */
.lib { max-height: 440px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.lib details summary { padding: 8px 12px; cursor: pointer; font-weight: 500; border-bottom: 1px solid var(--border); background: #fff; }
.lib a { display: block; padding: 6px 12px 6px 24px; color: var(--foreground); text-decoration: none; border-bottom: 1px solid var(--border); font-size: 13px; }
.lib a:hover, .lib a.on { background: color-mix(in srgb, var(--primary) 12%, #fff); }
.lib .kind { color: var(--muted-foreground); font-size: 11px; margin-left: 6px; }

/* the set-up menu: a cog at the end of the top navigation holding the pages the team visits to change how the app works */
.nav-menu { position: relative; display: flex; align-items: center; }
.topbar .nav-cog { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 8px 0 10px; border: 0; border-radius: var(--radius-md); background: transparent; color: rgba(255,255,255,.7); box-shadow: none; }
.topbar .nav-cog svg { width: 20px; height: 20px; }
.topbar .nav-cog svg.caret { width: 12px; height: 12px; }
.topbar .nav-cog:hover, .topbar .nav-cog[aria-expanded="true"] { color: #fff; background: rgba(255,255,255,.08); }
.topbar .nav-cog.active { background: var(--primary); color: var(--primary-foreground); }
.topbar .nav-cog:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.nav-list { position: fixed; z-index: 60; min-width: 200px; padding: 6px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 16px 40px -12px rgba(2,3,6,.35); }
.topbar .nav-list a { display: block; padding: 8px 12px; color: var(--foreground); font-size: 14px; border-radius: var(--radius-md); }
.topbar .nav-list a:hover, .topbar .nav-list a:focus-visible { background: var(--secondary); color: var(--foreground); outline: none; }
.topbar .nav-list a.active { background: color-mix(in srgb, var(--primary) 18%, #fff); color: var(--foreground); }
/* Sign out is an action, not a page: a line sets it apart from the pages above */
.topbar .nav-list #sign-out { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-md) var(--radius-md); padding-top: 10px; }

/* the top navigation: twelve links must fit beside the logo down to 1100px; narrower, the nav scrolls on its own */
.topbar-inner { min-width: 0; }
.topbar nav { min-width: 0; flex-wrap: nowrap; }
@media (max-width: 1200px) { .topbar-inner { gap: 16px; } .topbar nav { gap: 2px; } .topbar nav a { padding: 8px 8px; font-size: 13px; } .topbar .app-name { display: none; } }
@media (max-width: 1024px) { .topbar nav { overflow-x: auto; scrollbar-width: none; } .topbar nav::-webkit-scrollbar { display: none; } }
@media (max-width: 900px) { .grid2, .grid-review { grid-template-columns: 1fr; } .sticky { position: static; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- shared additions ---- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.tabs .button, .tabs button { border-radius: 999px; }
.tabs .on, .tabs button.on { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.warn { color: var(--warn); }
ul.small li.ok::marker, ul.small li.ok { color: var(--ok); }
ul.small li.bad { color: var(--destructive); }
ul.small li.warn { color: var(--warn); }
ul.small li b { color: var(--foreground); }
.inline-spin { display: inline-block; width: 14px; height: 14px; border: 3px solid color-mix(in srgb, var(--primary) 25%, transparent); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
.qmark { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; background: #fff1d6; color: #7a4a00; border: 1px solid #f0cf8a; font-family: Consolas, "Cascadia Mono", monospace; }
.answer { margin-top: 6px; padding: 6px 10px; background: rgba(31,143,78,.07); border-left: 3px solid var(--ok); border-radius: 4px; font-size: 13px; }
.termrow { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.copy .page-h1 { font-size: 24px; margin: 0 0 12px; }
.copy .mark-hard { background: rgba(208,29,33,.08); box-shadow: -3px 0 0 var(--destructive); }
.copy .mark-major { background: #fff7e6; box-shadow: -3px 0 0 #e8a33d; }

/* ---- the editor ---- */
.grid-editor { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, .75fr); gap: 18px; align-items: start; }
.editor-side { max-height: calc(100vh - 32px); overflow: auto; padding: 2px; margin: -2px; }
.editor-doc.readonly { opacity: .65; pointer-events: none; }
.editor-doc .count { margin-left: 6px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.editor-doc .count.bad { color: var(--destructive); }
.blocks { margin-top: 8px; }
.blk { position: relative; padding: 2px 0 2px 64px; border-radius: var(--radius-md); }
.blk:hover, .blk:focus-within { background: rgba(236,241,245,.6); }
.blk-tools { position: absolute; left: 0; top: 4px; width: 60px; display: flex; flex-direction: column; gap: 2px; opacity: 0; transition: opacity .12s; }
.blk:hover .blk-tools, .blk:focus-within .blk-tools { opacity: 1; }
.blk-type { padding: 2px 4px; font-size: 11px; width: 58px; }
.blk-text { outline: none; min-height: 1.4em; font-size: 15px; line-height: 1.6; margin: 0; padding: 4px 6px; }
.blk-text.t-h2 { font-size: 20px; font-weight: 700; margin-top: 14px; }
.blk-text.t-h3 { font-size: 16px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--foreground); margin-top: 10px; }
.blk-text.t-li { padding-left: 22px; position: relative; }
.blk-text.t-li::before { content: "•"; position: absolute; left: 8px; }
.blk-text:empty::before { content: "Type here"; color: var(--muted-foreground); }
.blk-text a { color: var(--link); }
.terms-body { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; max-height: 340px; overflow: auto; }
.term { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: #fff; white-space: nowrap; }
.term b { font-weight: 600; margin-left: 2px; }
.term.ok { border-color: rgba(31,143,78,.45); background: rgba(31,143,78,.08); }
.term.missing { border-color: rgba(208,29,33,.35); background: rgba(208,29,33,.05); }
.term.under { border-color: #f0cf8a; background: #fff7e6; }
.term.over { border-color: #9aa3ad; background: rgba(154,163,173,.18); text-decoration: line-through; }
.tabs .tabn { color: inherit; opacity: .7; font-size: 11px; }
.wc { margin: 6px 0; font-weight: 600; }
.chat { max-height: 260px; overflow: auto; margin-bottom: 8px; }
.chat .msg { padding: 6px 8px; border-radius: var(--radius-md); margin-bottom: 6px; background: var(--secondary); }
.chat .msg.you { background: color-mix(in srgb, var(--primary) 10%, #fff); }
.qlist li { cursor: pointer; margin-bottom: 4px; }

/* ---- plan ---- */
.plan-sections { border-top: 1px solid var(--border); margin-top: 8px; }
.plan-section { padding: 8px 0; border-bottom: 1px solid var(--border); }
.plan-section.lvl3 { padding-left: 28px; }
.plan-section .chip { margin: 2px 3px 2px 0; }

/* ---- checks and batches ---- */
.checks-summary td { padding: 8px 6px; }
.check-tabs { margin-top: 4px; }
.batch-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.batch-step { display: grid; grid-template-columns: 34px 1fr; gap: 6px 10px; align-items: start; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.batch-step > div:last-child { grid-column: 2; }
.batch-step .dot { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; border: 2px solid var(--primary); color: var(--brand-blue-dark); }

/* ---- the client's answer page ---- */
body.portal main { max-width: 720px; }
.portal-card h1 { font-size: 22px; }
.portal-card.answered { opacity: .8; }
.portal-q { display: grid; grid-template-columns: 30px 1fr; gap: 10px; margin-bottom: 10px; }
.portal-n { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--primary-foreground); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.portal-q blockquote { margin: 6px 0 0; padding: 8px 12px; border-left: 3px solid var(--primary); background: var(--secondary); border-radius: 4px; }
.portal-card textarea { margin: 10px 0 8px; }

@media (max-width: 900px) { .grid-editor, .batch-steps { grid-template-columns: 1fr; } .editor-side { max-height: none; } .blk { padding-left: 0; } .blk-tools { position: static; flex-direction: row; width: auto; opacity: 1; } }
.chip.guessed { border-style: dashed; color: var(--muted-foreground); }

/* reports */
.rep-img { display: block; max-width: 420px; max-height: 260px; margin-top: 6px; border: 1px solid var(--border); border-radius: var(--radius-md); object-fit: contain; background: #fff; }

/* the SERP Shapes dashboard inside the SERP shapes stage */
.shapes-board { display: block; width: 100%; min-height: 320px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; }

/* GEO spins */
.spin-blocks td { vertical-align: top; }
.variations { margin: 0; padding-left: 18px; }
.variations li { margin-bottom: 6px; line-height: 1.45; }
.swap { color: var(--muted-foreground); background: color-mix(in srgb, var(--primary) 8%, transparent); border-radius: 3px; }
.dragon { color: var(--primary); }
.sop { list-style: none; padding: 0; margin: 8px 0; }
.sop li { margin-bottom: 6px; }

/* NeuronWriter, in full */
.term.must { font-weight: 600; border-width: 2px; }
.term.optional { opacity: .8; }
.term.brand { text-decoration: line-through; opacity: .55; border-style: dashed; }
.term .u { color: var(--muted-foreground); font-size: 11px; text-decoration: none; }
.nwq { margin: 6px 0 0; padding-left: 16px; max-height: 320px; overflow: auto; }
.nwq li { margin-bottom: 4px; }
.nwq li.ok { color: var(--ok, #1f8f4e); }
.nwc table td, .nwc table th { padding: 4px 6px; }
.outline { list-style: none; margin: 4px 0 8px; padding: 0; }
.outline .o-h1 { font-weight: 600; }
.outline .o-h3 { padding-left: 14px; }
.outline .o-h4 { padding-left: 28px; color: var(--muted-foreground); }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- How it works: the map, then the agents as profiles, the checks as blocks, the rest as it was ---- */
.how-section { margin-bottom: 28px; scroll-margin-top: 64px; }
.how-section > h2 { font-size: 18px; margin: 26px 0 8px; }
.how-section .panel h3, .how-places h3 { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--foreground); margin: 0 0 10px; }
.how-section details.panel > summary { font-weight: 600; }
.how-nav { position: sticky; top: 0; z-index: 2; background: var(--background); padding: 8px 0; margin: 0 0 8px; gap: 8px; }
/* the map: one column per stage of the road, one row per question, the row's question down the left */
.how-map-panel { padding: 0; overflow-x: auto; }
.how-map { min-width: 1040px; }
.how-map th, .how-map td { vertical-align: top; padding: 10px; border-bottom: 1px solid var(--border); font-size: 12.5px; line-height: 1.45; }
.how-map thead th { text-align: left; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--foreground); padding: 12px 10px 10px; border-radius: 0; }
.how-map thead th .stage { display: block; margin-top: 6px; }
.how-map tbody th { width: 108px; white-space: nowrap; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted-foreground); background: var(--secondary); position: sticky; left: 0; }
.how-map td { color: #344054; min-width: 112px; }
.how-map tbody tr:last-child th, .how-map tbody tr:last-child td { border-bottom: 0; }
.how-map .n, .how-steps .n { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--primary); color: var(--brand-blue-dark); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; background: #fff; }
.how-places .place { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 6px 16px; align-items: start; padding: 10px 0; border-top: 1px solid var(--border); }
.how-places .place:first-of-type { border-top: 0; }
.how-places .place-what { font-size: 13px; color: #344054; line-height: 1.45; }
.how-places .place-agents .who, .how-key .who { margin-bottom: 0; }
.how-key { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.who { display: inline-block; margin: 0 6px 6px 0; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 12px; font-weight: 500; line-height: 1.3; color: var(--foreground); text-decoration: none; white-space: nowrap; }
a.who:hover { background: var(--secondary); }
.who.claude { border-color: var(--brand-navy); color: var(--brand-navy); }
.who.codex { border-color: var(--brand-blue-dark); color: var(--brand-blue-dark); }
.who.service { background: var(--secondary); border-color: var(--secondary); }
.who.person { border-style: dashed; }
/* an agent's profile: the name, model and version on the left, the purpose and the four lines on the right */
.agent-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px 20px; padding: 14px 0; border-top: 1px solid var(--border); }
.agent-row:first-of-type { border-top: 0; padding-top: 4px; }
.agent-head .agent-name { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.agent-head .who { margin: 0 0 6px; }
.agent-purpose { font-size: 14px; line-height: 1.5; margin: 0 0 8px; max-width: 80ch; }
.kv.tight { grid-template-columns: 96px minmax(0, 1fr); gap: 6px 12px; }
.kv.tight span { font-size: 13px; color: #344054; line-height: 1.45; }
.kv.tight .chips-wrap { gap: 8px; }
.kv.tight .chip { text-decoration: none; color: var(--link); }
.check-block { padding: 12px 0; border-top: 1px solid var(--border); }
.check-block:first-child { border-top: 0; padding-top: 0; }
.check-block > b { display: block; font-size: 14px; margin-bottom: 6px; }
.matrix { font-size: 12px; min-width: 760px; }
.matrix th { text-align: center; font-size: 11px; line-height: 1.3; padding: 8px 4px; vertical-align: bottom; }
.matrix th a { color: var(--foreground); text-decoration: none; }
.matrix th:first-child, .matrix td:first-child { text-align: left; padding-left: 8px; }
.matrix td { text-align: center; padding: 7px 4px; }
.matrix td:first-child a { color: var(--foreground); font-weight: 600; text-decoration: none; }
.matrix .on { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }
.how-steps { list-style: none; margin: 0; padding: 0; }
.how-steps li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.how-steps li:first-child { border-top: 0; padding-top: 0; }
.how-steps b { display: block; margin-bottom: 3px; }
.how-steps p { margin: 0; font-size: 13px; line-height: 1.5; color: #344054; }
.formula { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--secondary); font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; color: var(--foreground); }
.flow { display: flex; flex-wrap: wrap; gap: 12px; }
.flow .fstep { flex: 1 1 170px; min-width: 170px; max-width: 300px; display: flex; flex-direction: column; padding: 10px 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.flow .fstep b { display: block; font-size: 13px; margin-bottom: 4px; }
.flow .fstep p { flex: 1; margin: 0 0 8px; font-size: 12.5px; line-height: 1.45; color: #344054; }
.flow .fstep .who { margin: 0; align-self: flex-start; }
@media (max-width: 900px) { .agent-row, .how-places .place { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .how-section .grid2 { grid-template-columns: 1fr; } }
.who { margin-right: 8px; }

/* agent runs */
.run-text { white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.5; max-height: 60vh; overflow: auto; background: var(--muted); padding: 10px; border-radius: var(--radius-md); margin: 0; font-family: inherit; }
.run-text.small { max-height: 220px; }
a.session-box { color: inherit; text-decoration: none; }

/* ---- the Month page: filters, task rows, notes ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 0 0 12px; }
.filters .f { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.filters .f label { margin: 0; }
.filters input[type=text] { width: 220px; }
.cell-actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; flex-wrap: nowrap; }
.cell-actions button, .cell-actions .button { padding: 4px 9px; font-size: 12px; }
.cell-actions button.link { padding: 4px 6px; border: 1px solid transparent; box-shadow: none; }
td:has(> .cell-actions) { white-space: nowrap; }
.counts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted-foreground); }
.counts b { color: var(--foreground); font-weight: 600; }
.tick { display: inline-flex; align-items: center; gap: 6px; color: var(--ok-text); font-weight: 600; }
.tick svg { width: 16px; height: 16px; }
.group-row td { background: var(--secondary); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted-foreground); padding: 6px 8px; }
.note-missing { color: var(--amber-text); }
.suggested { margin: 0 0 12px; padding: 10px 12px; background: var(--secondary); border-radius: var(--radius-md); }
.suggested .suggestion { grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--border); padding: 8px 0; }
.suggested .suggestion:first-child { border-top: 0; }
.field-error { color: var(--destructive); font-size: 12px; margin-top: 4px; }
.field-buttons { display: flex; gap: 8px; margin-top: 6px; }

/* ---- the Reports page: the editor on the left, the PDF on the right ---- */
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 18px; align-items: start; }
.report-preview { position: sticky; top: 16px; }
.report-frame { width: 100%; height: calc(100vh - 230px); min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; }
/* One action-row convention: .actions for a row of controls (one height, 8px apart), .cell-actions inside table
   cells (small controls, never wrapping). A .row that still holds buttons gets the same control sizes. */
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions button, .actions .button, .actions select, .row > button, .row > .button { padding: 8px 14px; font-size: 14px; }
.actions button.small, .actions .button.small, .row > button.small, .row > .button.small { padding: 8px 14px; font-size: 14px; }
.actions button.link, .row > button.link { padding: 8px 10px; }
.actions > select, .row > select { width: auto; }
.actions > input[type=number], .row > input[type=number] { width: 90px; }
.actions > input[type=text], .row > input[type=text] { width: auto; flex: 1 1 200px; }
.row-state { font-size: 12px; color: var(--muted-foreground); }
.suggestion { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--border); }
.report-editor h2 { margin-top: 18px; }
@media (max-width: 1100px) { .report-grid { grid-template-columns: 1fr; } .report-preview { position: static; } .report-frame { height: 70vh; } }
.actions button.link, .row > button.link { border: 1px solid transparent; box-shadow: none; }

/* the danger zone at the end of a page: the one destructive action, apart from everything else */
.danger-zone { margin-top: 24px; border-color: color-mix(in srgb, var(--destructive) 35%, var(--border)); }
.danger-zone h2 { color: var(--destructive); }

/* ---- the Outline stage: the plan as a document, the coverage beside it ---- */
.outline-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.outline-side { position: sticky; top: 16px; }
.outline-side .panel h3 { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--foreground); margin: 0 0 10px; }
.outline-side .eyebrow { margin-bottom: 4px; }
.outline-doc input.h { font: inherit; font-size: 18px; font-weight: 600; width: 100%; padding: 6px 8px; border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; }
.outline-doc input.h.h3 { font-size: 15px; }
.outline-doc input.h:hover, .outline-doc input.h:focus { border-color: var(--border); background: #fff; }
.outline-doc .panel h3 { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--foreground); margin: 0 0 6px; }
.outline-section { padding: 14px 0; border-top: 1px solid var(--border); }
.outline-section:first-of-type { border-top: 0; padding-top: 4px; }
.outline-section.lvl3 { padding-left: 28px; }
.outline-why { margin: 6px 0 8px; font-size: 14px; line-height: 1.5; color: var(--foreground); }
.outline-why.muted { color: var(--muted-foreground); }
.outline-evidence { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 12px; color: var(--muted-foreground); margin-top: 4px; }
.outline-evidence .chip.req { border-color: var(--brand-blue-dark); color: var(--brand-blue-dark); }
.outline-evidence .chip.win { border-color: var(--ok); color: var(--ok-text); }
.outline-evidence .chip.ok { border-color: rgba(31,143,78,.45); background: rgba(31,143,78,.08); color: var(--ok-text); }
.cover-list { list-style: none; margin: 0 0 6px; padding: 0; font-size: 13px; }
.cover-list li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-top: 1px solid var(--border); }
.cover-list li.gap { color: var(--destructive); }
@media (max-width: 1100px) { .outline-grid { grid-template-columns: 1fr; } .outline-side { position: static; } }
.rule-text { resize: vertical; overflow: hidden; min-height: 44px; line-height: 1.45; }
.looked { margin-top: 10px; } .looked summary { cursor: pointer; } .looked table td { padding: 8px 8px; font-size: 13px; } .looked table tr:first-child td { border-top: 1px solid var(--border); }
.area-title { font-size: 17px; margin: 22px 0 2px; } .area-title + p { margin: 0 0 10px; }

/* ---- the design pass, 2026-10-26: one accent, many greys ---- */
.month-nav { display: inline-flex; align-items: center; gap: 8px; }
.month-nav a.arrow { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; color: var(--foreground); text-decoration: none; font-size: 18px; line-height: 1; }
.month-nav a.arrow:hover { background: var(--secondary); }
.suggestion details > summary { cursor: pointer; color: var(--muted-foreground); }
.suggestion details[open] > summary { margin-bottom: 4px; }
@media (max-width: 700px) {
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filters .f { min-width: 0; }
  .filters input[type=text], .filters select { width: 100%; }
  .courses-head .actions { flex-wrap: wrap; }
  .suggested, .suggestion, .suggestion > div { min-width: 0; overflow-wrap: anywhere; }
  .suggestion { grid-template-columns: 1fr; }
  .counts { gap: 8px 12px; }
  .suggested .cell-actions { white-space: normal; flex-wrap: wrap; }
  .suggested .cell-actions .small { white-space: normal; }
}
