/* Portal styles. Every colour and font comes from the --brand-* variables Brand Swap writes,
   so changing the brand package restyles the whole site. Fallbacks keep it readable before the brand loads. */
:root {
  --bg: var(--brand-background, #faf6f1);
  --surface: var(--brand-surface, #ffffff);
  --ink: var(--brand-text, #1b1419);
  --muted: var(--brand-muted, #5e5359);
  --accent: var(--brand-accent, #b3123a);
  --accent-ink: var(--brand-accent-text, #ffffff);
  --line: var(--brand-border, #e8dfd8);
  --good: #1f7a4a;
  --warn: #9a5b00;
  --bad: #b0322b;
  --radius: 10px;
  color-scheme: light dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* buttons and cards set display; hidden must still win */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--brand-font-body, system-ui, sans-serif); }
h1, h2, h3 { font-family: var(--brand-font-heading, Georgia, serif); font-weight: 400; line-height: 1.15; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: clamp(28px, 4vw, 38px); }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
a { color: var(--accent); }
code, .mono { font-family: var(--brand-font-mono, ui-monospace, monospace); font-size: .92em; }
img { max-width: 100%; }
.dark-only { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dark-only { display: inline; } :root:not([data-theme="light"]) .light-only { display: none; } }

header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
header.top .brand { display: flex; align-items: center; }
header.top .logo { height: 34px; width: auto; }
header.top nav { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 15px; }
header.top nav a { text-decoration: none; color: var(--ink); }
header.top nav a:hover { color: var(--accent); }

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
main.narrow { max-width: 460px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.lede { color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

button, .button { font: 600 15px/1 var(--brand-font-body, system-ui, sans-serif); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 11px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.link { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 400; font-size: 15px; }
button.link:hover { color: var(--accent); }
button:disabled, button[aria-disabled="true"] { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
input[type="color"] { padding: 2px; height: 38px; width: 52px; }
form.stack > button { align-self: flex-start; }

.notice { border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; background: var(--surface); border: 1px solid var(--line); }
.notice.error { border-color: var(--bad); color: var(--bad); }
.notice.warn { border-color: var(--warn); }
.notice.good { border-color: var(--good); color: var(--good); }

.pill { display: inline-block; font: 600 12px/1 var(--brand-font-body, system-ui); padding: 4px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.good { color: var(--good); border-color: var(--good); }
.pill.warn { color: var(--warn); border-color: var(--warn); }
.pill.unconfirmed { color: var(--warn); border-color: var(--warn); border-style: dashed; }
.pill.curated { color: var(--muted); border-style: dotted; }
.pill.inf { border-style: dashed; } /* Inferred: the dashed pill approved for the topic pages (03 §39, front.css .fp-pill-inf) */
.pill.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lab { font: 500 11px/1 var(--brand-font-mono, ui-monospace); padding: 3px 5px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.lab.PUBLIC { color: var(--good); border-color: var(--good); }
.lab.INFERRED { color: var(--warn); border-color: var(--warn); }

/* Dashboard (modelled on the Seabird staff dashboard: tiles with a number, a trend and a note) */
.tile { display: flex; flex-direction: column; gap: 4px; }
.tile .k { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile .v { font: 400 34px/1 var(--brand-font-heading, Georgia, serif); font-variant-numeric: tabular-nums; }
.tile .n { font-size: 13px; color: var(--muted); }
.spark { display: block; margin-top: 6px; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; }
.bars rect { fill: var(--accent); opacity: .85; }
.bars text { fill: var(--muted); font: 10px var(--brand-font-body, system-ui); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 6px 10px; align-items: start; }
.steps li > button { grid-column: 2; justify-self: start; }
.steps .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.steps li.done .num { background: var(--good); border-color: var(--good); color: #fff; }
.steps li.now .num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps .label b { display: block; }
.steps .label span { font-size: 13px; color: var(--muted); }

.card dl dd { margin: 0 0 8px; }
.feed { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.feed li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.feed li:last-child { border-bottom: 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }

/* Review */
.profile header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.profile dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 10px 0; font-size: 14px; }
.profile dt { color: var(--muted); }
.profile dd { margin: 0; }
@media (max-width: 560px) { .profile dl { grid-template-columns: 1fr; } .profile dt { margin-top: 6px; } }
.decide { display: flex; gap: 8px; flex-wrap: wrap; }
.profile header .decide { align-self: center; }
.profile .tags { margin: 6px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); }
details summary { cursor: pointer; font-weight: 600; font-size: 14px; }

/* Brand Swap */
.wizard-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; }
.wizard-steps li { font-size: 13px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.wizard-steps li.now { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.wizard-steps li.done { color: var(--good); border-color: var(--good); }
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.swatch { display: flex; gap: 10px; align-items: center; }
.swatch label { flex: 1; }
.preview { border-radius: var(--radius); border: 1px solid var(--line); padding: 16px; }
.check-ok { color: var(--good); }
.check-bad { color: var(--bad); }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 20px; text-align: center; }
.dropzone.over { border-color: var(--accent); }
footer.site { text-align: center; font-size: 12px; color: var(--muted); padding: 24px 16px; }

/* Review: a decided profile rolls up to one line with an arrow to reopen it */
.profile.rolling { overflow: hidden; transition: max-height .35s ease, opacity .35s ease; opacity: .7; }
.profile.rolled { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; animation: saved-in .3s ease; }
.profile .saved { font-weight: 600; font-size: 14px; }
.profile .saved.good { color: var(--good); }
button.link.roll { background: none; border: 0; color: var(--muted); padding: 2px 6px; font-size: 16px; min-height: 0; cursor: pointer; }
button.link.roll:hover { color: var(--ink, inherit); }
@keyframes saved-in { from { opacity: .4; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .profile.rolled { animation: none; } }

/* Header: view switcher and settings gear */
header.top nav .switch { font-size: 14px; color: var(--muted); }
header.top nav .gear { font-size: 20px; line-height: 1; padding: 2px 4px; }

/* Member app */
main.narrowish { max-width: 760px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; margin-bottom: 18px; position: sticky; top: 64px; z-index: 4; }
.tabs a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 7px; font-size: 15px; }
.tabs a[aria-selected="true"] { background: var(--ink); color: var(--surface); }
.steps-dots { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; }
.steps-dots i { width: 34px; height: 6px; border-radius: 3px; background: var(--line); }
.steps-dots i.on { background: var(--accent); }
.steps-dots span { margin-left: 6px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
label.check input { width: auto; margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 600; padding: 0 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.seg input { width: auto; margin: 0; }
.seg label:has(input:checked) { border-color: var(--ink); background: var(--bg); }
.labels { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.lab.conf { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.facts li { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.facts li:last-child { border-bottom: 0; padding-bottom: 0; }
.stat { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 15px; }
.stat .bar { grid-column: 1 / -1; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--good); }
.stat .bar i.mid { background: var(--warn); }
.stat .bar i.low { background: var(--bad); }
.split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.split div { background: var(--bg); border-radius: 8px; padding: 8px; text-align: center; }
.split b { display: block; font-size: 22px; }
.split span { font-size: 12px; color: var(--muted); }
blockquote { margin: 0; padding: 10px 12px; background: var(--bg); border-radius: 8px; }
blockquote small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
blockquote.reply { border-left: 3px solid var(--ink); }
.empty { text-align: center; }
.meter { display: flex; gap: 4px; justify-content: center; }
.meter i { width: 34px; height: 8px; border-radius: 4px; background: var(--line); }
.meter i.on { background: var(--accent); }
.search { display: flex; gap: 6px; }
.search input { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
button.chip { font-weight: 500; font-size: 14px; padding: 6px 12px; border-radius: 999px; background: var(--surface); color: var(--ink); border-color: var(--line); }
button.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
/* Check a company type filters: outlined until picked (the theme's filled button would read as all picked). */
:is(body, body.th) #co-dir button.chip { background: transparent; color: var(--ink); border: 1px solid var(--line); }
:is(body, body.th) #co-dir button.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.kind { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; align-self: flex-start; display: inline-block; }
.k-new { color: var(--good); border: 1px solid var(--good); }
.k-move { color: var(--accent); border: 1px solid var(--accent); }
.k-cross { background: var(--ink); color: var(--surface); }
.k-change { color: var(--warn); border: 1px solid var(--warn); }
ul.credits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
ul.credits li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
@media (max-width: 560px) { .tabs { top: 58px; } .tabs a { padding: 7px 9px; font-size: 14px; } }

/* Claim verification */
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.verify .code { font: 600 28px/1 var(--brand-font-mono, ui-monospace, monospace); letter-spacing: .06em; margin: 0; }
.verify .route { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; }
.verify .route button { align-self: flex-start; margin-top: auto; }
.feed li.mail { align-items: flex-start; }

/* Claim states */
.pill.bad { color: var(--bad); border-color: var(--bad); }
.verify .route.tried { opacity: .6; }
.feed li.claim { align-items: flex-start; flex-wrap: wrap; }
.feed li.claim select { width: auto; padding: 6px 8px; font-size: 14px; }

/* Market figures (03 §15): strip chart and source cards. Scope colours (Okabe–Ito, readable on light and dark);
   every dot also carries a text label, so colour is never the only cue. */
.strip { margin: 0; }
.strip svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.strip .grid { stroke: var(--line); stroke-width: 1; }
.strip .lane-line { stroke: var(--line); stroke-width: 2; }
.strip .tick, .strip .dot-label { font: 500 11px/1 var(--brand-font-body, system-ui); fill: var(--muted); }
.strip .lane { font: 600 12px/1 var(--brand-font-body, system-ui); fill: var(--ink); }
.strip .dot { stroke: var(--surface); stroke-width: 1.5; }
.strip .dot.hollow { fill: var(--surface) !important; stroke-width: 2.5; }
.strip .range { stroke-width: 4; stroke-linecap: round; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 11px; height: 11px; border-radius: 50%; display: inline-block; background: var(--muted); }
.legend .sw.hollow { background: transparent; border: 2px solid var(--muted); }
.k-MKT { --k: #0072b2; } .k-CS { --k: #d55e00; } .k-NET { --k: #e69f00; } .k-CO { --k: #cc79a7; } .k-Cost { --k: #009e73; }
.k-installs { --k: #0072b2; } .k-downloads { --k: #009e73; } .k-spend { --k: #d55e00; } .k-revenue { --k: #cc79a7; }
.strip .dot[class*="k-"] { fill: var(--k); } .strip .dot.hollow[class*="k-"] { stroke: var(--k); }
.strip .range[class*="k-"] { stroke: var(--k); } .legend .sw[class*="k-"] { background: var(--k); }
.source-card .figure { font: 700 1.25rem/1.25 var(--brand-font-heading, system-ui); margin: 0; }
.source-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.source-card dl { display: grid; gap: 6px; margin: 0; }
.source-card dt { font-size: 12px; color: var(--muted); }
.source-card dd { margin: 0; font-size: 14px; }
@media (max-width: 600px) { .strip { overflow-x: auto; } .strip svg { min-width: 600px; } }

/* Send feedback dialog (every app page) */
dialog.feedback { width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 20px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
dialog.feedback::backdrop { background: rgb(0 0 0 / 0.45); }
dialog.feedback textarea { width: 100%; font: inherit; }

/* Setup banner (D-49, 03 §21.1): under the header on every app page; nothing blocks. */
.setup { background: var(--bg-surface-elevated); border-bottom: 1px solid var(--input-border); }
.setup-in { max-width: 1280px; margin: 0 auto; padding: 12px 16px; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.setup.folded .setup-in { justify-content: space-between; padding-block: 6px; }
.setup-t { display: flex; flex-direction: column; gap: 2px; flex: 0 1 240px; }
.setup-t h2 { margin: 0; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 24px; flex: 1 1 520px; }
.setup-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 20px; min-height: 44px; }
.setup .tick { width: 24px; height: 24px; border-radius: 9999px; border: 1px solid var(--input-border); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 24px; font: 600 12px/1 var(--font-sans); color: var(--text-secondary); }
.setup .tick.done { background: var(--ok); border-color: var(--ok); color: var(--acc-on); }
.setup .button.sm, .setup button.sm, .follow-row button.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.follow-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; border-bottom: 1px solid var(--line); }
/* Directors: view-only bar above admin and Owner pages (Austen, 2026-10-13) */
.view-only-bar { max-width: min(1200px, calc(100% - 32px)); margin: 16px auto 0; box-sizing: border-box; }

/* E9 Briefs and Who's buying (approved 2026-10-27, 03 §38; boards Preview-E9-Brief, Preview-E9-WhosBuying). */
.e9-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.e9-head p { margin: 0; max-width: 72ch; }
.e9-cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.e9-past { flex: 0 1 300px; display: flex; flex-direction: column; gap: 4px; }
.e9-past a[aria-current="page"] { font-weight: 700; color: var(--ink); }
.e9-brief { flex: 1 1 640px; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.e9-brief section, .e9-sec { display: flex; flex-direction: column; gap: 8px; }
.e9-brief h3, .e9-sec h2 { margin: 0; }
.e9-line { display: flex; flex-direction: column; gap: 4px; }
.e9-row { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.e9-brief ul, .e9-sec ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.e9-brief p, .e9-sec p { margin: 0; }
.e9-grid { display: flex; flex-wrap: wrap; gap: 20px; margin: 20px 0; }
.e9-grid > .card { flex: 1 1 420px; }
.e9-wb > .card + .card { margin-top: 20px; }
