/* CircuitProver redesign (11-17 CEO decision): one theme layer loaded after every other stylesheet.
   Light and dark follow the visitor's system setting (prefers-color-scheme); the footer switch (theme.js) can pin one.
   Token values come from the CircuitProver design system (tokens.json). The old variable names are mapped onto them,
   so the existing pages and the review app change look without changing their scripts. */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400..700&display=swap');

:root {
  color-scheme: light;
  --bg: #ffffff; --surface: #f4f4f3; --surface-2: #ebebe9; --raised: #ffffff;
  --line-soft: #e3e3e0; --line-mid: #d3d3cf; --line-strong: #8a8c91;
  --ink: #141619; --ink-2: #55585e; --ink-3: #6a6d73; --on-ink: #ffffff;
  --accent: #c2372c; --on-accent: #ffffff;
  --issue-c: #c2372c; --issue-soft: #fbeae7; --check-c: #8f5600; --check-soft: #fcf0dc; --clear-c: #2b6f4c; --clear-soft: #e4f1e9;
  --issue-dot: #c2372c; --check-dot: #b26e00; --clear-dot: #2b8a57;
  --sheet-c: #ffffff; --focus: #1f5fd1; --scrim: rgba(20, 22, 25, .40);
  --shadow-pop: 0 12px 32px rgba(20, 22, 25, .12);
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 32px; --r-pill: 999px;
  --font-sans: Geist, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111214; --surface: #1b1c1f; --surface-2: #25262a; --raised: #1f2024;
    --line-soft: #2e2f33; --line-mid: #3a3b40; --line-strong: #6e7076;
    --ink: #f3f3f1; --ink-2: #b0b2b7; --ink-3: #909298; --on-ink: #111214;
    --accent: #f26a5d; --on-accent: #111214;
    --issue-c: #f26a5d; --issue-soft: #3a1f1c; --check-c: #f0b14d; --check-soft: #382a14; --clear-c: #62c391; --clear-soft: #173022;
    --focus: #86adff; --scrim: rgba(0, 0, 0, .60); --shadow-pop: 0 12px 32px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214; --surface: #1b1c1f; --surface-2: #25262a; --raised: #1f2024;
  --line-soft: #2e2f33; --line-mid: #3a3b40; --line-strong: #6e7076;
  --ink: #f3f3f1; --ink-2: #b0b2b7; --ink-3: #909298; --on-ink: #111214;
  --accent: #f26a5d; --on-accent: #111214;
  --issue-c: #f26a5d; --issue-soft: #3a1f1c; --check-c: #f0b14d; --check-soft: #382a14; --clear-c: #62c391; --clear-soft: #173022;
  --focus: #86adff; --scrim: rgba(0, 0, 0, .60); --shadow-pop: 0 12px 32px rgba(0, 0, 0, .55);
}

/* Old names used by site.css, review.css and app.css, pointed at the new tokens */
:root, :root[data-theme] {
  --paper: var(--bg); --sheet: var(--surface); --rule: var(--line-soft); --line: var(--line-mid);
  --red: var(--accent); --red-hover: var(--ink); --red-shadow: transparent;
  --blue: var(--focus); --green: var(--clear-c);
  --sans: var(--font-sans); --mono: var(--font-mono);
}
.rv { --issue: var(--issue-c) !important; --check: var(--check-c) !important; --ok: var(--clear-c) !important;
  --issue-bg: var(--issue-soft) !important; --check-bg: var(--check-soft) !important; --ok-bg: var(--clear-soft) !important; }

/* ---------- Base ---------- */
html { background: var(--bg); }
body { background: var(--bg) !important; color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
body::before { display: none !important; }
:focus-visible { outline: 2px solid var(--focus) !important; outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-sans); color: var(--ink); letter-spacing: -0.015em; }
h1 { font-weight: 650; } h2, h3 { font-weight: 620; }
a { color: inherit; }
a:hover { color: var(--accent); }
.hand { font-family: var(--font-sans) !important; }

/* Buttons: pills */
.btn { border-radius: var(--r-pill) !important; box-shadow: none !important; font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; transform: none; }
.btn-red, .btn-primary { background: var(--ink) !important; color: var(--on-ink) !important; border-color: var(--ink) !important; }
.btn-red:hover, .btn-primary:hover { background: var(--ink-2) !important; border-color: var(--ink-2) !important; color: var(--on-ink) !important; }
.btn-outline { background: transparent !important; color: var(--ink) !important; border: 1.5px solid var(--line-strong) !important; }
.btn-outline:hover { border-color: var(--ink) !important; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; }
.tag { border-radius: var(--r-pill); }
.eyebrow { font-family: var(--font-sans) !important; color: var(--ink-3) !important; letter-spacing: .04em; }

/* Header: the logo is the word only (CEO 11-17: no check mark anywhere) */
.site-header { background: var(--bg) !important; border-bottom: 1px solid var(--line-soft) !important; box-shadow: none !important; }
.brand-mark { display: none !important; }
.brand-name { font-family: var(--font-sans) !important; font-weight: 650 !important; letter-spacing: -0.02em; color: var(--ink) !important; }
.nav-desktop a, .menu a { color: var(--ink-2) !important; font-family: var(--font-sans); }
.nav-desktop a:hover, .menu a:hover, .nav-desktop a[aria-current] { color: var(--ink) !important; }
.menu { background: var(--bg) !important; border-color: var(--line-soft) !important; border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }

/* Footer */
.site-footer, footer.site-footer { background: var(--bg) !important; color: var(--ink-3); border-top: 1px solid var(--line-soft) !important; }

/* Legal and text pages */
.legal { max-width: 760px; }
.legal h2 { font-size: 22px; margin-top: 36px; }
.legal p, .legal li { color: var(--ink-2); line-height: 1.65; }
.legal a { text-decoration: underline; text-underline-offset: 3px; }
.legal-back { color: var(--ink-2) !important; border-radius: var(--r-pill); padding: 6px 14px; background: var(--surface-2); text-decoration: none; }
.legal-date { color: var(--ink-3) !important; }

/* Forms (login, account, contact) */
input, select, textarea { font-family: var(--font-sans); }
input[type="email"], input[type="text"], input[type="password"], input[type="search"], select, textarea {
  background: var(--bg); color: var(--ink); border: 1.5px solid var(--line-strong) !important; border-radius: var(--r-md) !important; }

/* ---------- Review app and sample review ---------- */
.rv-btn, .rv-icon, .rv-count, .rv-chips button, .rv-suggest button, .rv-filter-row select, .rv-filter-row input, .rv-find input,
.rv-linkform input, .rv-report select, .rv-report textarea, .rv-ask input, .ap-rev, .ap-new-slot, .ap-chip, .ap-ws-open, .rv-msg.is-bot, .rv-chat-crop,
.ap-quote, .ap-q, .ap-warn.is-strong, .ap-warn.is-check, .ap-premium, .ap-src-note, .ap-crop canvas, .ap-menu ul, .ap-guide, .ap-doc {
  background: var(--raised) !important; color: var(--ink); }
.rv-btn { border-radius: var(--r-pill) !important; border-color: var(--line-mid) !important; padding: 7px 14px; }
.rv-btn-ink, .rv-btn.rv-btn-ink { background: var(--ink) !important; color: var(--on-ink) !important; border-color: var(--ink) !important; }
.rv-icon { border-radius: var(--r-pill) !important; border-color: var(--line-mid) !important; }
.rv-count { border-radius: var(--r-lg) !important; border: 0 !important; background: var(--surface) !important; padding: 12px 14px !important; }
.rv-chips button { border-color: var(--line-mid) !important; }
.rv-chips button[aria-pressed="true"] { background: var(--ink) !important; color: var(--on-ink) !important; border-color: var(--ink) !important; }
.rv-filter-row select, .rv-filter-row input, .rv-find input, .rv-ask input, .rv-linkform input { border-radius: var(--r-pill) !important; border-color: var(--line-mid) !important; }
.rv-ask textarea, #rv-ask-input { border-radius: var(--r-lg) !important; background: var(--raised) !important; color: var(--ink) !important; border: 1.5px solid var(--line-mid) !important; }
.rv-card { border: 1px solid var(--line-soft) !important; border-left-width: 1px !important; border-radius: var(--r-lg) !important; background: var(--raised) !important; overflow: hidden; }
.rv-tag { border-radius: var(--r-pill) !important; }
.is-check .rv-tag, .rv-needs h4, .rv-ds .st.is-missing { color: var(--check-c) !important; }
.rv-msg { border-radius: 20px !important; }
.rv-msg.is-you { background: var(--ink) !important; color: var(--on-ink) !important; border-radius: 20px 20px 6px 20px !important; }
.rv-msg.is-bot { border: 0 !important; background: var(--surface) !important; border-radius: 20px 20px 20px 6px !important; }
.rv-viewport { background: var(--surface) !important; }
.rv-stage { background: #ffffff !important; box-shadow: 0 2px 14px rgba(0, 0, 0, .18) !important; border-radius: 4px; }
.dot { border-color: #ffffff !important; }
.rv-proto { border-radius: var(--r-pill); }
.rv-tabs [role="tab"][aria-selected="true"] { color: var(--ink) !important; }
.ap-dialog { border: 0 !important; border-radius: var(--r-xl) !important; background: var(--raised) !important; box-shadow: var(--shadow-pop); padding: 8px !important; }
.ap-dialog::backdrop, .ap-doc::backdrop { background: var(--scrim) !important; }
.ap-doc { border: 0 !important; border-radius: var(--r-lg) !important; overflow: hidden; }
.ap-doc-view { background: var(--surface) !important; }
.ap-doc-stage canvas { background: #ffffff !important; }
.ap-new-slot { border-radius: var(--r-md) !important; border-color: var(--line-mid) !important; }
.ap-new-mark { color: var(--on-ink) !important; }
.ap-new-match { background: var(--surface) !important; border-radius: var(--r-md); }
.ap-menu ul { border: 0 !important; border-radius: var(--r-lg) !important; box-shadow: var(--shadow-pop); padding: 6px !important; }
.ap-menu li > a, .ap-menu li > button { border-radius: var(--r-md); }
.ap-menu li > a:hover, .ap-menu li > button:hover, .ap-boards > li.is-current, .ap-ds tr.is-drag td { background: var(--surface-2) !important; }
.ap-guide { border: 0 !important; border-radius: var(--r-lg) !important; box-shadow: var(--shadow-pop) !important; }
.ap-chip { border-color: var(--line-strong) !important; }
.ap-warn-btns [aria-pressed="true"] { color: var(--on-ink) !important; }
#ap-pick[aria-pressed="true"] { background: var(--ink) !important; color: var(--on-ink) !important; border-color: var(--ink) !important; }
.ap-yours { background: var(--check-soft) !important; color: var(--check-c) !important; }
.ap-help-pop { background: var(--raised) !important; border-radius: var(--r-md) !important; box-shadow: var(--shadow-pop); }
.ap-q, .ap-premium, .ap-src-note, .ap-warn.is-check { border-radius: var(--r-md); }
.ap-sev { border-radius: var(--r-pill) !important; }

/* ---------- Theme switch (footer) ---------- */
.cp-theme { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); }
.cp-theme button { height: 30px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2);
  font: 600 13px/1 var(--font-sans); cursor: pointer; }
.cp-theme button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.cp-theme-float { position: fixed; right: 16px; bottom: 16px; z-index: 50; box-shadow: var(--shadow-pop); }
.cp-local { position: fixed; left: 16px; bottom: 16px; z-index: 50; background: var(--ink); color: var(--on-ink); font: 600 12px/1 var(--font-sans);
  padding: 8px 12px; border-radius: var(--r-pill); opacity: .85; }

/* ---------- Run Review: pick main ICs (CEO 11-17) ---------- */
#ap-quote.ap-quote { border: 0 !important; background: transparent !important; padding: 4px 2px !important; margin: 0 !important; gap: 12px !important; }
.ap-run-head { display: flex; align-items: center; gap: 10px; }
.ap-run-head h2 { margin: 0; font-size: 17px; font-weight: 620; }
.ap-run-count { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
.ap-run-head .rv-btn { margin-left: auto; }
.ap-run-list { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; background: var(--surface); border-radius: var(--r-lg); }
.ap-run-list label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); cursor: pointer; }
.ap-run-list li:hover label { background: var(--surface-2); }
.ap-run-list li.is-on label { background: var(--raised); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.ap-run-list input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--bg); display: grid; place-items: center; cursor: pointer; }
.ap-run-list input:checked { background: var(--ink); border-color: var(--ink); }
.ap-run-list input:checked::after { content: ''; width: 8px; height: 4px; border: solid var(--on-ink); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.ap-run-ref { font-family: var(--font-mono); font-size: 13px; font-weight: 600; min-width: 34px; }
.ap-run-val { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-run-nods { font-size: 11px; font-weight: 600; color: var(--check-c); background: var(--check-soft); border-radius: var(--r-pill); padding: 2px 8px; white-space: nowrap; }
.ap-run-pins { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); min-width: 24px; text-align: right; }
.ap-run-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.ap-run-mode { margin: 0 !important; }
.ap-run-price { margin-left: auto; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ap-run.rv-btn { height: 44px; padding: 0 22px !important; font-size: 15px; }
.ap-run.rv-btn[disabled] { opacity: .4; cursor: not-allowed; }
/* On the schematic: outlines of the main ICs while picking; picked ones are filled */
.rv-pick { position: absolute; pointer-events: none; border: calc(1.5px * var(--s, 1)) dashed rgba(106, 109, 115, .7); border-radius: calc(6px * var(--s, 1)); }
.rv-pick span { position: absolute; left: 0; top: 0; transform: translateY(-100%) scale(var(--s, 1)); transform-origin: 0 100%; font: 600 11px/1 var(--font-mono); padding: 3px 6px; border-radius: 6px 6px 6px 0; background: rgba(106, 109, 115, .85); color: #fff; white-space: nowrap; }
.rv-pick.is-on { border-style: solid; border-color: #1f5fd1; background: rgba(31, 95, 209, .10); }
.rv-pick.is-on span { background: #1f5fd1; }
.rv-pick.is-flash { animation: rv-pick-flash .9s ease 1; }
@keyframes rv-pick-flash { 50% { background: rgba(31, 95, 209, .28); } }
.rv-pick-box { position: absolute; pointer-events: none; border: calc(1.5px * var(--s, 1)) solid #1f5fd1; background: rgba(31, 95, 209, .08); border-radius: calc(4px * var(--s, 1)); }
@media (prefers-reduced-motion: reduce) { .rv-pick.is-flash { animation: none; } }

/* ---------- Customer pass (11-17 night) ---------- */
/* The step switcher (Prototype · Analysing · Results) is for us, not customers */
body.app .rv-proto { display: none !important; }
/* Collapsed finding card: at most two lines of title, then the pins */
.rv-card:not(.is-open) .rv-card-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rv-card-title .rv-pin { display: block; margin-top: 4px; }
.ap-fold-mid:empty { display: none; }
/* Local preview badge sits above the theme switch, clear of page text */
.cp-local { left: 50% !important; right: auto; top: 8px; bottom: auto !important; transform: translateX(-50%); pointer-events: none; }
/* On phones the review app has no room for the floating switch: the theme follows the phone setting there */
@media (max-width: 820px) { body.rv .cp-theme-float { display: none; } }

/* Sign-in and account pages (auth.css): rounded cards, readable Google button in both themes */
.auth-card { background: var(--raised) !important; border: 1px solid var(--line-soft) !important; border-radius: var(--r-xl) !important; box-shadow: none !important; }
.btn-google { background: var(--raised) !important; color: var(--ink) !important; border: 1.5px solid var(--line-strong) !important; border-radius: var(--r-pill) !important; }
.btn-google:hover { border-color: var(--ink) !important; }
.auth-card .btn, .auth-card button[type="submit"] { border-radius: var(--r-pill) !important; }
.auth-card input { border-radius: var(--r-md) !important; }

/* ---------- Narrow screens (11-17 customer pass): boards drawer and the Run tab ---------- */
.ap-ws-open-narrow { display: none; }
@media (max-width:1100px) {
  body.app .ap-ws-open { display: inline-flex !important; align-items: center; width: auto; height: auto; padding: 8px 16px; left: 12px; bottom: 44px; border-radius: var(--r-pill); background: var(--ink) !important; color: var(--bg) !important; border: 0 !important; font-weight: 600; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
  body.app .ap-ws-open-wide { display: none; }
  body.app .ap-ws-open-narrow { display: inline; }
  body.app.ap-ws-drawer .ap-ws { display: flex !important; position: fixed; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); z-index: 60; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  body.app.ap-ws-drawer .ap-ws-open { display: none !important; }
}

/* The 'Sample' row of the boards list is a link that looks like a board name (CEO 11-19) */
.ap-sample > a.ap-board-name { color: inherit; text-decoration: none; }
.ap-sample > a.ap-board-name:hover { text-decoration: underline; }
/* Dragging a board to a new place in the list (11-19) */
.ap-boards > li { touch-action: pan-y; }
.ap-boards a { -webkit-user-drag: none; }
body.is-ordering, body.is-ordering * { cursor: grabbing !important; user-select: none; }
.ap-boards > li.is-dragged { opacity: .45; }
.ap-boards > li.is-drop-before { box-shadow: inset 0 2px 0 var(--ink); }
.ap-boards > li.is-drop-after { box-shadow: inset 0 -2px 0 var(--ink); }
/* Phone, Chat tab: the question box sits at the bottom, so the Boards button steps aside (it is on the other tabs) (CEO 11-19) */


/* Launch: the step switcher (Prototype · Analysing · Results) is for us, on the public sample too */
.rv-proto { display: none !important; }
/* Re-check parts on a finished review (ADR-0012) */
.ap-rerun { display: grid; gap: 8px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.ap-rerun-refs { margin: 0; font-family: var(--font-mono, var(--mono)); font-weight: 600; }
.ap-rerun-warn { margin: 0; font-size: 13px; }
.rv-rechecked { margin: 0 0 12px; font-size: 13px; color: var(--ink-soft, inherit); }
/* App header theme switch (11-19): compact, hidden on phones like the floating one */
.rv-top-actions { display: flex; align-items: center; gap: 8px; }
.rv-top-actions .cp-theme button { height: 26px; padding: 0 10px; font-size: 12px; }
@media (max-width: 820px) { .rv-top-actions .cp-theme { display: none; } }
/* Schematic window on a second monitor (?view=schematic): the schematic takes the whole width (hub button test 11-19) */
body.app.is-sheet-only .ap-main { grid-template-columns: minmax(0, 1fr) !important; }
/* Pin marks, style B "see-through fill" (CEO 11-20): a light tint with a thin ring, so the pin number under it still shows.
   The schematic sheet is always white, so the marks and the selected ring keep the light-theme colours in dark mode too. */
.rv-mark::before { width: calc(14px * var(--s, 1)) !important; height: calc(14px * var(--s, 1)) !important; border: calc(1.5px * var(--s, 1)) solid; box-shadow: none; }
.rv-mark.is-ok::before { background: rgba(43, 111, 76, .25); border-color: #2b6f4c; }
.rv-mark.is-check::before { background: rgba(143, 86, 0, .25); border-color: #8f5600; }
.rv-mark.is-issue::before { background: rgba(194, 55, 44, .25); border-color: #c2372c; }
.rv-mark.is-selected::after { width: calc(24px * var(--s, 1)); height: calc(24px * var(--s, 1)); border-color: #141619; }
/* Links in card text and Chat light only the pins, a ring on each (CEO 11-20) */
.rv-glow.is-ring { width: calc(26px * var(--s, 1)); height: calc(26px * var(--s, 1)); margin: calc(-13px * var(--s, 1)) 0 0 calc(-13px * var(--s, 1)); border-radius: 50%; background: rgba(255, 230, 120, .12); }
/* Schematic dots (CEO 11-20): the dot layer sits above the PDF text layer (its pin-number letters used to catch the click),
   and each dot has an invisible tap area of at least 24px, 32px on touch screens */
.rv-marks { z-index: 2; }
.rv { --hit: 24px; }
@media (pointer: coarse) { .rv { --hit: 32px; } }
/* Hub 11-20 ②④⑪㉑: Boards button in the header on narrow screens; phone header shows the board path, revision and status on a second line;
   phone dots shrink at small zoom (--k); the column-width handle only where it works */
@media (max-width:1100px) {
  body.app .ap-ws-open { position: static !important; order: -1; padding: 6px 12px !important; font-size: 13px !important; flex: none; }
}
@media (max-width:820px) {
  body.app .rv-top { flex-wrap: wrap; row-gap: 6px; }
  body.app .rv-title { order: 3; flex-basis: 100%; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
  body.app .rv-title .rv-board { white-space: normal; }
  body.app .rv-status { display: inline !important; white-space: normal; }
  .rv-mtabs button.is-dim, .rv-mtabs button:disabled { opacity: .4; cursor: not-allowed; }
  /* six tabs with Datasheet: slightly smaller, and the bar scrolls sideways if it still doesn't fit */
  .rv-mtabs { overflow-x: auto; scrollbar-width: none; }
  .rv-mtabs::-webkit-scrollbar { display: none; }
  .rv-mtabs button { flex: 1 0 auto !important; padding: 10px 7px !important; font-size: 13px !important; }
}
.rv-mark::before { width: calc(14px * var(--s, 1) * var(--k, 1)) !important; height: calc(14px * var(--s, 1) * var(--k, 1)) !important; }
.rv-mark.is-selected::after { width: calc(24px * var(--s, 1) * var(--k, 1)); height: calc(24px * var(--s, 1) * var(--k, 1)); }
@media (max-width:1100px) { .ap-resize { display: none; } }
/* Hub 11-20 ⑤⑦⑨: re-check summary, words beside the folded card icons, the picking line over the schematic */
.ap-rerun-sum { margin: 0 0 8px; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }
.ap-fold-done { display: inline-flex; align-items: center; gap: 4px; }
.ap-fold-word { font-size: 12px; color: var(--ink-3); }
.ap-fold-act { display: inline-flex !important; align-items: center; gap: 4px; width: auto !important; padding: 2px 8px !important; border-radius: var(--r-pill); }
.ap-pick-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 5; margin: 0; padding: 6px 12px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-size: 13px; pointer-events: none; max-width: calc(100% - 24px); text-align: center; }
body.is-picking .rv-viewport { cursor: crosshair; }
/* Phone: the .md report download is a computer task; hiding it keeps the header to two lines (team call 11-20) */
@media (max-width:820px) { body.app #rv-export { display: none; } }
/* Boards list edge: drag to resize or fold (CEO 11-20). A thin line shows on hover and while dragging; wide screens only */
.ap-ws-resize { position: absolute; top: 0; bottom: 0; width: 7px; margin-left: -1px; cursor: col-resize; z-index: 16; touch-action: none; }
.ap-ws-resize::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 1px; background: transparent; transition: background .15s; }
.ap-ws-resize:hover::after, .ap-ws-resize:focus-visible::after, body.is-ws-dragging .ap-ws-resize::after { background: var(--focus, #1f5fd1); width: 2px; left: 2px; }
.ap-ws-resize:focus-visible { outline: none; }
body.is-ws-dragging, body.is-ws-dragging * { cursor: col-resize !important; user-select: none; }
body.is-ws-dragging .rv-stage { transition: none !important; }
@media (max-width:1100px) { .ap-ws-resize { display: none; } }

/* ---------- Account plans and credit in both themes (CEO 11-20: "both dark and light look bad") ----------
   site.css drew these as white 2px-corner boxes, so in dark mode the light text sat on white. Tokens only, like the canvas Account screen. */
#account-signed-in { margin-top: 28px; }
.plan-pick { gap: 8px; }
.plan-pick li { padding: 10px 10px 10px 18px; border: 1.5px solid transparent; border-radius: var(--r-lg); background: var(--surface-2); }
.plan-pick li.is-picked { border-color: var(--ink); box-shadow: none; background: var(--raised); }
.plan-pick li.is-current { border-color: var(--clear-c); background: var(--clear-soft); }
.plan-pick .plan-pick-name { font-weight: 620; color: var(--ink); }
.plan-pick .plan-pick-price { color: var(--ink-2); }
.plan-confirm { border: 0; border-radius: var(--r-md); background: var(--surface-2); padding: 14px 16px; }
/* Amount choice: a row of pills on a soft track (canvas cp-seg) */
.credit-amounts { gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); }
.credit-amounts span { height: 40px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); }
.credit-amounts label:hover span { background: var(--line-mid); color: var(--ink); }
.credit-amounts input:checked + span { background: var(--ink); color: var(--on-ink); }
.credit-amounts input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Error lines: a soft rounded note in place of the thin red bar */
.auth-error { border: 0; border-radius: var(--r-md); background: var(--issue-soft); color: var(--issue-c); padding: 10px 14px; }
.btn-plain { border-radius: var(--r-pill); border-color: var(--line-strong); }
.btn-plain:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
/* App: white text on the light dark-mode status colours was hard to read; the pop-out button had a fixed white face */
.rv-steps .is-done .st, .ap-sev { color: var(--bg) !important; }
.ap-rtabs .ap-popout { background: var(--raised) !important; color: var(--ink) !important; border-radius: var(--r-pill) !important; border-color: var(--line-mid) !important; }

/* Datasheet links (CEO 11-20): a link per part from the row, and a box for links whose part we work out */
.ap-ds-linkrow td { padding-top: 0 !important; }
.ap-ds-linkform { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ap-ds-linkform input { flex: 1 1 160px; min-width: 0; height: 30px; padding: 0 12px; border-radius: var(--r-pill) !important; border: 1.5px solid var(--line-mid) !important; background: var(--raised); color: var(--ink); font: inherit; font-size: 13px; }
/* The action column holds 'Upload PDF' and 'Use a link': a little wider so it doesn't spill when a scroll bar shows */
@media (min-width:601px) { .ap-ds-col-ref { width: 26%; } .ap-ds-col-val { width: 26%; } .ap-ds-col-st { width: 28%; } .ap-ds-col-act { width: 20%; } }
.ap-ds-uselink { display: block; margin: 4px auto 0; font-size: 12.5px; white-space: nowrap; }
.ap-ds-link { font-weight: 500; }
/* The approved status lines are full sentences: on their own line under the link or the part's status */
.ap-ds-st .ap-ds-link { display: block; margin-top: 2px; }
.ap-ds-linklist li { flex-wrap: wrap; row-gap: 2px; }
.ap-ds-linklist .ap-ds-link { order: 3; flex-basis: 100%; }
.ap-ds-link.is-used { color: var(--clear-c); }
.ap-ds-link.is-waiting { color: var(--ink-3); }
.ap-ds-link.is-not_pdf, .ap-ds-link.is-too_big, .ap-ds-link.is-no_match, .ap-ds-link.is-failed { color: var(--check-c); }
.ap-ds-links { margin: 16px 0 0; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); display: grid; gap: 8px; }
.ap-ds-links h4 { margin: 0; font-size: 14px; }
.ap-ds-links .ap-ds-note { margin: 0; }
.ap-ds-linklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ap-ds-linklist li { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.ap-ds-linkurl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }
.ap-ds-linkbox { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: var(--r-md) !important; border: 1.5px solid var(--line-mid) !important; background: var(--raised); color: var(--ink); font: 13px/1.5 var(--font-mono); resize: vertical; }
.ap-ds-links > .rv-btn { justify-self: start; }

/* New board dialog help and problem reports (CEO 11-21, sales 73; shown only once approved) */
.ap-new-help { display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.ap-new-help p { margin: 0; }
.ap-new-tools button[aria-pressed="true"] { color: var(--ink); font-weight: 600; text-decoration: none; }
.ap-new-tool { display: grid; gap: 4px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface); color: var(--ink); }
.ap-new-tool strong { font-weight: 600; }
.ap-new-tool a, .ap-quote .ap-basis a { text-decoration: underline; text-underline-offset: 3px; }
.ap-report { display: grid; gap: 6px; justify-items: start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); }
.ap-report p { margin: 0; }
.ap-report-sorry { font-weight: 600; color: var(--ink); }
.ap-report-note { font-size: 12.5px; color: var(--ink-3); }
.ap-report-sent { color: var(--ink); }
.ap-report-sent.is-bad { color: var(--issue-c); }
/* Netlist and PDF don't match: what goes wrong, then Fix files / Upload anyway (CEO 11-21) */
.ap-new-warn { display: grid; gap: 6px; margin-top: 8px; }
.ap-new-warn p, .ap-new-warn ul { margin: 0; }
.ap-new-warn ul { padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.ap-new-warn-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ap-new-warn-btns [aria-pressed="true"] { background: var(--ink) !important; color: var(--on-ink) !important; border-color: var(--ink) !important; }
.ap-new-warn-title { margin: 0 0 4px; font-weight: 650; color: var(--ink); }
/* Upload assistant in the New board dialog (CEO 11-21, free) */
.ap-new-askbtn { justify-self: start; font-size: 13.5px; }
.ap-ask { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface); }
.ap-ask-list { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; }
.ap-ask-msg { margin: 0; font-size: 13.5px; line-height: 1.5; white-space: pre-line; color: var(--ink); }
.ap-ask-msg.is-you { justify-self: end; max-width: 85%; padding: 6px 10px; border-radius: 14px 14px 4px 14px; background: var(--ink); color: var(--on-ink); }
.ap-ask-msg.is-bot { max-width: 95%; }
.ap-ask-form { display: flex; gap: 6px; }
.ap-ask-form input { flex: 1; min-width: 0; height: 32px; padding: 0 12px; border-radius: var(--r-pill) !important; border: 1.5px solid var(--line-mid) !important; background: var(--raised); color: var(--ink); font: inherit; font-size: 13.5px; }
.ap-macwarn { display: grid; gap: 6px; }
.ap-macwarn p { margin: 0; }
.ap-macwarn-what { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }

.ap-assist-wrap { display: grid; margin-top: 8px; }
