/* VoipMemory customer app — ONE stylesheet, wearing Dan's comp pack.
 *
 * Tokens extracted in design/TOKENS.md from design/reference/Tokens.dc.html
 * (canonical), App.dc.html and Landing.dc.html. Every value here is either a
 * comp value or a value marked "derived" in that file; the three deliberate
 * deviations (tertiary text lifted to AA in both themes, control borders lifted
 * to 3:1) are listed in TOKENS.md §0.
 *
 * Deep ink is the default because the comps are dark-first ("default" on the
 * dark surface card, "first-class equal" on paper); paper light arrives via
 * prefers-color-scheme, and both are complete. A [data-theme] hook is present
 * in both directions so a future toggle needs no CSS change and no JS lives
 * here.
 *
 * Rules kept from DESIGN-BRIEF §3: hairline borders, never shadow soup (one
 * shadow token, overlays only); 16/12/8/pill radii and nothing between;
 * 150-250ms ease-out on state changes only; mono for transcripts, timestamps,
 * addresses and keys; accent reserved for primary action / live / speaker A.
 *
 * Fonts are self-hosted woff2 (OFL licences beside them in assets/fonts/).
 * NOTHING in this file may ever reference a third-party host: the product
 * promise is that reading your own vault does not phone anyone.
 */

/* --------------------------------------------------------------- typefaces */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/instrument-sans-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/instrument-sans-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: dark;

  /* grounds — five layers, depth by stacking */
  --bg: #08090b;
  --bg2: #0d0f13;
  --bg3: #12151a;
  --bg4: #171b21;
  --bg5: #1d222a;

  /* hairlines */
  --ln: #232932;
  --ln2: #313947;
  --line-field: #646f84;

  /* text tiers */
  --tx: #e9edf2;
  --tx2: #9aa5b2;
  --tx3: #828d9c;

  /* accent — signal green (the comps' own recommendation) */
  --acc: #2fe08a;
  --acch: #5ceba6;
  --accfg: #06170f;
  --accdim: #7cf0b8;
  --acctint: rgba(47, 224, 138, 0.12);
  --accln: rgba(47, 224, 138, 0.32);

  /* semantics — accent stays reserved, these carry meaning */
  --in: #6bc6f5;
  --out: #b08cff;
  --mail: #e0b274;
  --warn: #e8a33d;
  --danger: #ff7a70;
  --intint: rgba(107, 198, 245, 0.14);
  --outtint: rgba(176, 140, 255, 0.14);
  --mailtint: rgba(224, 178, 116, 0.14);
  --warntint: rgba(232, 163, 61, 0.1);
  --warnln: rgba(232, 163, 61, 0.32);
  --dangertint: rgba(255, 122, 112, 0.1);
  --dangerln: rgba(255, 122, 112, 0.3);

  /* type */
  --ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  /* shape */
  --r-panel: 16px;
  --r-card: 12px;
  --r-ctl: 8px;
  --r-pill: 999px;

  /* rhythm */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 32px;
  --s8: 48px;
  --s9: 72px;

  /* motion + the one shadow (overlays; the landing hero mock is the comps' single
     exception, and the only other place it is used) */
  --t: 180ms ease-out;
  --shadow: 0 22px 54px -18px rgba(0, 0, 0, 0.66);

  /* compatibility aliases: nothing written against the placeholder sheet breaks */
  --panel: var(--bg3);
  --ink: var(--tx);
  --muted: var(--tx2);
  --line: var(--ln);
  --accent: var(--acc);
  --accent-soft: var(--acctint);
  --good: var(--acc);
  --good-soft: var(--acctint);
  --warn-soft: var(--warntint);
  --bad: var(--danger);
  --bad-soft: var(--dangertint);
  --radius: var(--r-card);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f5f5f2;
    --bg2: #fbfbf9;
    --bg3: #ffffff;
    --bg4: #ffffff;
    --bg5: #f2f3f1;
    --ln: #e3e5e1;
    --ln2: #cdd0cb;
    --line-field: #878c85;
    --tx: #14171b;
    --tx2: #5a6470;
    --tx3: #646d78;
    --acc: #067a4b;
    --acch: #05603b;
    --accfg: #ffffff;
    --accdim: #05603b;
    --acctint: rgba(6, 122, 75, 0.09);
    --accln: rgba(6, 122, 75, 0.28);
    --in: #0b72a8;
    --out: #6b3fcf;
    --mail: #8a5a16;
    --warn: #8e5400;
    --danger: #be3a2c;
    --intint: rgba(11, 114, 168, 0.1);
    --outtint: rgba(107, 63, 207, 0.1);
    --mailtint: rgba(138, 90, 22, 0.1);
    --warntint: rgba(142, 84, 0, 0.1);
    --warnln: rgba(142, 84, 0, 0.3);
    --dangertint: rgba(190, 58, 44, 0.09);
    --dangerln: rgba(190, 58, 44, 0.28);
    --shadow: 0 22px 54px -22px rgba(20, 23, 27, 0.24);
  }
}

/* Explicit overrides, both directions, for a future toggle. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f2;
  --bg2: #fbfbf9;
  --bg3: #ffffff;
  --bg4: #ffffff;
  --bg5: #f2f3f1;
  --ln: #e3e5e1;
  --ln2: #cdd0cb;
  --line-field: #878c85;
  --tx: #14171b;
  --tx2: #5a6470;
  --tx3: #646d78;
  --acc: #067a4b;
  --acch: #05603b;
  --accfg: #ffffff;
  --accdim: #05603b;
  --acctint: rgba(6, 122, 75, 0.09);
  --accln: rgba(6, 122, 75, 0.28);
  --in: #0b72a8;
  --out: #6b3fcf;
  --mail: #8a5a16;
  --warn: #8e5400;
  --danger: #be3a2c;
  --intint: rgba(11, 114, 168, 0.1);
  --outtint: rgba(107, 63, 207, 0.1);
  --mailtint: rgba(138, 90, 22, 0.1);
  --warntint: rgba(142, 84, 0, 0.1);
  --warnln: rgba(142, 84, 0, 0.3);
  --dangertint: rgba(190, 58, 44, 0.09);
  --dangerln: rgba(190, 58, 44, 0.28);
  --shadow: 0 22px 54px -22px rgba(20, 23, 27, 0.24);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08090b;
  --bg2: #0d0f13;
  --bg3: #12151a;
  --bg4: #171b21;
  --bg5: #1d222a;
  --ln: #232932;
  --ln2: #313947;
  --line-field: #646f84;
  --tx: #e9edf2;
  --tx2: #9aa5b2;
  --tx3: #828d9c;
  --acc: #2fe08a;
  --acch: #5ceba6;
  --accfg: #06170f;
  --accdim: #7cf0b8;
  --acctint: rgba(47, 224, 138, 0.12);
  --accln: rgba(47, 224, 138, 0.32);
  --in: #6bc6f5;
  --out: #b08cff;
  --mail: #e0b274;
  --warn: #e8a33d;
  --danger: #ff7a70;
  --intint: rgba(107, 198, 245, 0.14);
  --outtint: rgba(176, 140, 255, 0.14);
  --mailtint: rgba(224, 178, 116, 0.14);
  --warntint: rgba(232, 163, 61, 0.1);
  --warnln: rgba(232, 163, 61, 0.32);
  --dangertint: rgba(255, 122, 112, 0.1);
  --dangerln: rgba(255, 122, 112, 0.3);
  --shadow: 0 22px 54px -18px rgba(0, 0, 0, 0.66);
}

/* -------------------------------------------------------------------- base */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font: 15px/1.6 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
::selection { background: var(--acctint); }

main {
  max-width: 1160px;
  margin: 0 auto;
  padding: var(--s6) var(--s7) 80px;
}

a { color: var(--accdim); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--acc); }
p a, li a, dd a, td a { text-decoration: underline; text-underline-offset: 2px; }

h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.018em; font-weight: 600; margin: var(--s1) 0 var(--s3); }
h2 { font-size: 20px; line-height: 1.25; letter-spacing: -0.012em; font-weight: 600; margin: var(--s7) 0 var(--s3); }
h3 { font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; margin: 0 0 var(--s2); }
p { margin: 0 0 var(--s3); }
section { margin: 0 0 var(--s7); }
strong, b { font-weight: 600; }

/* ------------------------------------------------------------------ chrome */

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4);
  padding: 10px var(--s5);
  background: var(--bg2);
  border-bottom: 1px solid var(--ln);
}
.topbar .brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--tx); text-decoration: none; margin-right: var(--s1);
}
.topbar .brand:hover { color: var(--tx); }
/* The wordmark's stand-in: a hairline square holding one live dot. */
.topbar .brand .mark {
  width: 22px; height: 22px; flex-shrink: 0;
  border: 1.5px solid var(--acc); border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.topbar .brand .mark::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--acc);
}
.topbar nav { display: flex; flex-wrap: wrap; gap: 6px; margin-right: auto; }
.topbar nav a {
  padding: 7px 13px; border-radius: var(--r-pill);
  border: 1px solid transparent; background: transparent;
  color: var(--tx2); font-size: 13.5px; text-decoration: none; white-space: nowrap;
  transition: color var(--t), background var(--t), border-color var(--t);
}
.topbar nav a:hover { color: var(--tx); background: var(--bg3); }
.topbar nav a[aria-current="page"] {
  color: var(--acc); background: var(--acctint); border-color: var(--accln); font-weight: 500;
}
.topbar form.inline { margin: 0; }

.footfine {
  max-width: 1160px; margin: 0 auto;
  padding: var(--s5) var(--s7) var(--s7);
  border-top: 1px solid var(--ln);
  color: var(--tx3); font-size: 13px;
}

/* ----------------------------------------------------------------- notices */

.banner, .notice {
  margin: 0 0 var(--s4);
  padding: 11px 15px;
  border: 1px solid var(--ln);
  border-radius: var(--r-card);
  background: var(--bg3);
  font-size: 14px;
}
.banner.warn, .notice.warn { background: var(--warntint); border-color: var(--warnln); color: var(--warn); }
.banner.bad, .notice.bad { background: var(--dangertint); border-color: var(--dangerln); color: var(--danger); }
.notice.good { background: var(--acctint); border-color: var(--accln); color: var(--acc); }
.banner a, .notice a { color: inherit; text-decoration: underline; }

/* -------------------------------------------------------------------- type */

.lead { color: var(--tx2); font-size: 16px; line-height: 1.62; max-width: 68ch; text-wrap: pretty; }
.muted { color: var(--tx2); }
.small { font-size: 13px; line-height: 1.55; }
.muted.small, .small.muted { color: var(--tx3); }
.ok { color: var(--acc); }
.warn { color: var(--warn); }
.bad { color: var(--danger); }

.big { font-size: 15px; color: var(--tx2); display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.big strong {
  font-family: var(--mono); font-size: 36px; line-height: 1;
  letter-spacing: -0.01em; font-weight: 500; color: var(--tx);
}

.mono, code, pre, .transcript, .email, time, .ts { font-family: var(--mono); }
code.mono { font-size: 13px; }
pre.block {
  white-space: pre-wrap; word-break: break-word;
  font-size: 13.5px; line-height: 1.72;
  background: var(--bg2); color: var(--tx);
  border: 1px solid var(--ln); border-radius: var(--r-card);
  padding: var(--s5); margin: 0 0 var(--s4);
  max-height: 70vh; overflow: auto;
}
.hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Section eyebrow: the comps' 10-11px uppercase mono label. */
.tag {
  display: inline-block; vertical-align: middle;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--acc); color: var(--accfg);
  border-radius: 5px; padding: 3px 7px;
}

/* ---------------------------------------------------------------- surfaces */

.card, .panel, .feature, .meter {
  background: var(--bg3);
  border: 1px solid var(--ln);
  border-radius: var(--r-panel);
  padding: var(--s5) 22px;
}
.feature, .meter { margin: 0 0 var(--s6); }
.feature > h2:first-child, .meter > h2:first-child, .panel > h2:first-child { margin-top: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.chosen { background: var(--bg5); border-color: var(--accln); }
.card.muted { background: var(--bg2); }
.card.muted h2, .card.muted h3 { color: var(--tx2); }
.card.muted p { color: var(--tx3); }
.meter { border-color: var(--accln); }
.devbox { border-style: dashed; border-color: var(--ln2); background: transparent; }

ul.cards {
  list-style: none; margin: 0 0 var(--s4); padding: 0;
  display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
ul.cards.modes { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
ul.cards > li.card { display: flex; flex-direction: column; gap: 2px; }
ul.cards > li.card p:last-child { margin-bottom: 0; }

ul.plain, ul.keylist, ul.stats { list-style: none; margin: 0 0 var(--s3); padding: 0; }
ul.plain li, ul.keylist li { padding: 9px 0; border-bottom: 1px solid var(--ln); }
ul.plain li:last-child, ul.keylist li:last-child { border-bottom: 0; }
ul.plain.mono, ul.keylist { font-family: var(--mono); font-size: 12.5px; }

ul.stats { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s7); color: var(--tx2); }
ul.stats li { display: flex; align-items: baseline; gap: var(--s2); }
ul.stats strong {
  font-family: var(--mono); font-size: 24px; font-weight: 500; letter-spacing: -0.01em; color: var(--tx);
}

ol.steps { margin: 0 0 var(--s4); padding-left: 22px; color: var(--tx2); }
ol.steps li { margin-bottom: var(--s2); }
ol.steps li::marker { color: var(--acc); font-family: var(--mono); font-size: 12px; }

.two { display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* In-address / endpoint / token: secrets are mono, never the UI face. */
.copyrow { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.copyrow code {
  background: var(--bg5); border: 1px solid var(--ln);
  border-radius: var(--r-ctl); padding: 9px 12px;
  font-size: 13px; color: var(--tx); word-break: break-all;
}

/* --------------------------------------------------------------- checklist */

ol.checklist { list-style: none; margin: 0 0 var(--s6); padding: 0; display: grid; gap: var(--s3); }
ol.checklist li {
  position: relative;
  background: var(--bg3); border: 1px solid var(--ln); border-radius: var(--r-card);
  padding: var(--s4) var(--s5) var(--s4) 48px;
  transition: border-color var(--t);
}
ol.checklist li::before {
  content: ""; position: absolute; left: 18px; top: 20px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--ln2); background: transparent;
}
ol.checklist li.done { border-color: var(--accln); }
ol.checklist li.done::before { border-color: var(--acc); background: var(--acc); }
ol.checklist h2 { margin: 0 0 var(--s1); font-size: 16px; letter-spacing: -0.01em; }
ol.checklist p { margin: 0 0 var(--s2); color: var(--tx2); font-size: 14px; }
ol.checklist p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ tables */

table.list {
  width: 100%; border-collapse: collapse; margin: 0 0 var(--s5);
  font-size: 14px;
  background: var(--bg3); border: 1px solid var(--ln); border-radius: var(--r-card);
  overflow: hidden;
}
table.list th, table.list td {
  text-align: left; padding: 12px var(--s4); border-bottom: 1px solid var(--ln); vertical-align: top;
}
table.list tbody tr:last-child td { border-bottom: 0; }
table.list th {
  font-family: var(--mono); font-size: 10px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.09em; color: var(--tx3);
  background: var(--bg2);
}
table.list td.mono { font-family: var(--mono); font-size: 12.5px; }

dl.kv {
  display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s4);
  margin: 0 0 var(--s4);
  border-left: 2px solid var(--ln2); padding: 2px 0 2px var(--s3);
}
dl.kv dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tx3); }
dl.kv dd { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--tx2); }

/* ---------------------------------------------------------------- timeline */

ol.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.item article {
  background: var(--bg3); border: 1px solid var(--ln); border-radius: var(--r-card);
  padding: var(--s4) var(--s5);
  transition: border-color var(--t), background var(--t);
}
.item article:hover { border-color: var(--ln2); }
.item header {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2);
  margin-bottom: var(--s3); font-size: 13.5px;
}
.item header time { font-size: 11.5px; color: var(--tx3); }
.item .body { margin: 0 0 var(--s3); color: var(--tx); line-height: 1.62; text-wrap: pretty; }
.item .body.muted { color: var(--tx2); }
.item footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3);
  font-size: 13.5px; border-top: 1px solid var(--ln); padding-top: var(--s3);
}

/* Type glyph: a tinted square, coloured by what the thing IS. */
.item .glyph {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: var(--r-ctl);
  font-size: 10px; letter-spacing: 0.04em;
  background: var(--acctint); color: var(--acc);
}
.item.kind-call .glyph { background: var(--intint); color: var(--in); }
.item.kind-email .glyph { background: var(--mailtint); color: var(--mail); }
.item.kind-note .glyph { background: var(--acctint); color: var(--acc); }
/* Direction refines the call glyph: out is the complementary hue, per Tokens §04. */
.item.kind-call:has(.chip.dir-out) .glyph { background: var(--outtint); color: var(--out); }

.chip {
  display: inline-block; white-space: nowrap;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.7; letter-spacing: 0.02em;
  padding: 3px 10px;
  border: 1px solid var(--ln); border-radius: var(--r-pill);
  background: transparent; color: var(--tx2);
}
.chip.mono { font-family: var(--mono); }
.chip.subject { white-space: normal; font-family: var(--ui); font-size: 12.5px; letter-spacing: 0; }
.chip.dir-in { color: var(--in); border-color: transparent; background: var(--intint); }
.chip.dir-out { color: var(--out); border-color: transparent; background: var(--outtint); }
.chip.warn { color: var(--warn); border-color: var(--warnln); background: var(--warntint); }
.chip.fidelity { color: var(--warn); border-color: var(--warnln); background: var(--warntint); white-space: normal; }
/* Processing states from Tokens §04 — wired now, used the moment WP4 emits them. */
.chip.state-done { color: var(--tx2); border-color: var(--ln); background: var(--bg4); }
.chip.state-transcribing { color: var(--warn); border-color: var(--warnln); background: var(--warntint); }
.chip.state-failed { color: var(--danger); border-color: var(--dangerln); background: var(--dangertint); }
.chip.state-waiting { color: var(--in); border-color: transparent; background: var(--intint); }
.chip.state-transcribing::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 6px; height: 6px; margin-right: 7px; border-radius: 50%;
  background: currentColor; animation: vb-pulse 1.4s ease-in-out infinite;
}

/* --------------------------------------------------------- reader surfaces */

/* Speaker-coloured turns: accent + its complementary hue, by parity, because the
 * markup labels speakers by name rather than by index. Both clear AA on both
 * grounds (TOKENS.md §6). */
ol.transcript {
  list-style: none; margin: 0 0 var(--s4); padding: var(--s5) 22px;
  background: var(--bg2); border: 1px solid var(--ln); border-radius: var(--r-card);
  font-family: var(--mono); font-size: 13.5px; line-height: 1.72;
}
ol.transcript li {
  display: grid; grid-template-columns: max-content minmax(110px, max-content) 56px 1fr; gap: var(--s3);
  padding: 10px 0; border-bottom: 1px solid var(--ln);
}
ol.transcript li:first-child { padding-top: 0; }
ol.transcript li:last-child { border-bottom: 0; padding-bottom: 0; }
ol.transcript .speaker {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase;
  padding-top: 3px; overflow-wrap: anywhere;
}
ol.transcript li:nth-child(odd) .speaker { color: var(--acc); }
ol.transcript li:nth-child(even) .speaker { color: var(--out); }
ol.transcript .ts { color: var(--tx3); font-size: 12px; padding-top: 2px; }
/* The time span is conditional, so pin the text to the last column rather than
 * letting auto-placement drop it into the 56px slot on time-less turns. */
ol.transcript .turn { color: var(--tx); grid-column: 4; }

pre.transcript.block, pre.email.block { background: var(--bg2); }
.email { line-height: 1.72; }

details.panel, details.quoted { margin: 0 0 var(--s5); }
details.panel { padding: var(--s4) var(--s5); }
details.quoted {
  background: var(--bg2); border: 1px solid var(--ln); border-radius: var(--r-card);
  padding: var(--s4) var(--s5);
}
details.quoted[open] { padding-bottom: var(--s2); }
details.reassign { display: inline-block; }
summary {
  cursor: pointer; font-weight: 500;
  border-radius: var(--r-ctl); padding: 2px 0;
  transition: color var(--t);
}
summary:hover { color: var(--acc); }
details.quoted summary { color: var(--tx2); font-family: var(--mono); font-size: 12px; font-weight: 400; }
details.reassign summary { color: var(--tx2); font-size: 13.5px; }
details[open] > summary { margin-bottom: var(--s3); }

/* ------------------------------------------------------------------- forms */

form { margin: 0 0 var(--s3); }
form.inline, form.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
form.assign { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); width: 100%; }
form.row.small { font-size: 13.5px; }

label {
  display: block; margin: var(--s3) 0 6px;
  font-family: var(--mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--tx3);
}
form.inline label, form.row label, form.assign label, label.check { display: inline-block; margin: 0; }
label.check {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--ui); font-size: 13.5px; letter-spacing: 0; text-transform: none;
  color: var(--tx2); cursor: pointer;
}
/* Mode-picker rows: radio, name, and the "default" badge on one baseline. */
li.card label {
  display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0 0 var(--s2);
  font-family: var(--ui); font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--tx);
  cursor: pointer;
}

input[type="text"], input[type="email"], input[type="search"], input[type="password"], select, textarea {
  font: inherit; color: var(--tx); background: var(--bg5);
  border: 1px solid var(--line-field); border-radius: var(--r-ctl);
  padding: 10px 12px; max-width: 100%;
  transition: border-color var(--t);
}
input[type="text"], input[type="email"], input[type="password"] { min-width: 260px; }
/* Mono is for secrets and machine text — a name typed into search is neither. */
input[type="password"] { font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em; }
textarea {
  width: 100%; display: block; resize: vertical;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
}
input:focus, select:focus, textarea:focus { border-color: var(--acc); }
input::placeholder, textarea::placeholder { color: var(--tx3); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--acc); width: 15px; height: 15px; cursor: pointer; }

button, .button {
  font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.4;
  cursor: pointer; text-decoration: none; display: inline-block;
  background: var(--acc); color: var(--accfg);
  border: 1px solid transparent; border-radius: var(--r-ctl);
  padding: 10px 16px;
  transition: background var(--t), border-color var(--t), color var(--t);
}
button:hover, .button:hover { background: var(--acch); color: var(--accfg); }
button[disabled], button[disabled]:hover { opacity: 0.5; cursor: not-allowed; background: var(--acc); }

/* The copy button lives inside the address field, so it stays accent-filled and
 * small — the comps' in-address treatment exactly. */
button.copy {
  background: var(--acc); color: var(--accfg); border-color: transparent;
  font-family: var(--mono); font-size: 11.5px; padding: 8px 12px;
}
button.copy:hover { background: var(--acch); color: var(--accfg); }

.button.ghost {
  background: transparent; color: var(--tx);
  border-color: var(--line-field); font-weight: 500;
}
.button.ghost:hover { background: transparent; color: var(--tx); border-color: var(--acc); }

button.linky {
  background: transparent; border: 0; padding: 4px 2px;
  color: var(--tx2); font-weight: 400; font-size: 13.5px;
}
button.linky:hover { background: transparent; color: var(--tx); }

button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.danger:hover { background: var(--dangertint); color: var(--danger); border-color: var(--danger); }

:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ------------------------------------------------------------------ motion */

@keyframes vb-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  main { padding: var(--s5) var(--s5) 64px; }
  .footfine { padding: var(--s5); }
}

@media (max-width: 640px) {
  main { padding: var(--s4) var(--s4) var(--s8); }
  .topbar { padding: 10px var(--s4); }
  .footfine { padding: var(--s4); }
  h1 { font-size: 23px; }
  h2 { font-size: 18px; }
  .big strong { font-size: 30px; }
  ul.stats strong { font-size: 20px; }
  ol.transcript { padding: var(--s4); }
  ol.transcript li { grid-template-columns: max-content max-content 1fr; gap: 2px var(--s3); padding: var(--s3) 0; }
  ol.transcript .turn { grid-column: 1 / -1; }
  ol.transcript .speaker { padding-top: 0; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list thead { display: none; }
  table.list tr { border-bottom: 1px solid var(--ln); padding: var(--s2) 0; }
  table.list td { border-bottom: 0; padding: 4px var(--s4); }
  input[type="text"], input[type="email"], input[type="password"] { min-width: 0; width: 100%; }
  .two { gap: var(--s5); }
}

/* ==================================================================== shell
 * The comps' app frame (App.dc.html): one topbar with search, the Simple/Full
 * switch, Fetch now and the account menu; a VAULT sidebar in Full, chip tabs in
 * Simple. Below 900px everyone gets the chips — a sidebar has no business on a
 * phone. Everything from here down is additive: nothing above may be removed
 * (tests/wp13.php pins the selector list the older markup leans on). */

/* Electric cobalt — the comps' second accent, applied per-browser via
 * [data-accent]; green stays the default and needs no attribute. */
:root[data-accent="cobalt"] {
  --acc: #5c7cff;
  --acch: #7d97ff;
  --accfg: #ffffff;
  --accdim: #8aa0ff;
  --acctint: rgba(92, 124, 255, 0.14);
  --accln: rgba(92, 124, 255, 0.34);
}
:root[data-accent="cobalt"][data-theme="light"] {
  --acc: #2b45d9;
  --acch: #1f35b8;
  --accfg: #ffffff;
  --accdim: #1f35b8;
  --acctint: rgba(43, 69, 217, 0.09);
  --accln: rgba(43, 69, 217, 0.28);
}

@keyframes vb-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* JS-off keeps every control usable; JS-on hides the redundant fallbacks. */
html.js .jsfallback { display: none; }

.shell { display: flex; align-items: stretch; min-height: calc(100vh - 53px); }
.shell .content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shell .content main { width: 100%; }
.shell .content .footfine { width: 100%; margin-top: auto; }
html[data-mode="simple"] main, html[data-mode="simple"] .footfine { max-width: 860px; }
html[data-mode="full"] main, html[data-mode="full"] .footfine { max-width: 1240px; }

/* ----- topbar additions ----- */

.topbar.apptop { flex-wrap: nowrap; gap: var(--s3); position: relative; z-index: 40; }
.topbar .brandname { white-space: nowrap; }

.topsearch { flex: 1; max-width: 420px; min-width: 120px; position: relative; margin: 0; }
.topsearch::before {
  content: "⌕"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--tx3); pointer-events: none;
}
.topsearch input[type="search"] {
  width: 100%; min-width: 0;
  background: var(--bg5); border: 1px solid var(--ln); border-radius: var(--r-ctl);
  padding: 8px 12px 8px 30px; font-size: 13.5px;
}
.topsearch input[type="search"]:focus { border-color: var(--acc); }

.topactions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); flex-shrink: 0; }
/* Every control in the bar is a form or a button; the document form margin
 * would ride one of them off the shared centre line (the Simple/Full segment
 * is a form, Fetch now is form.inline — only the latter was reset). */
.topbar form, .topactions form { margin: 0; }

.seg {
  display: inline-flex; align-items: center;
  background: var(--bg5); border: 1px solid var(--ln); border-radius: var(--r-ctl); padding: 2px;
}
.segbtn {
  border: 0; border-radius: 6px; padding: 5px 11px;
  background: transparent; color: var(--tx2);
  font-size: 12px; font-weight: 500; line-height: 1.4; cursor: pointer;
  transition: background var(--t), color var(--t);
}
.segbtn:hover { background: transparent; color: var(--tx); }
.segbtn.on, .segbtn.on:hover { background: var(--acc); color: var(--accfg); }
.segbtn[disabled], .segbtn[disabled]:hover { opacity: 0.5; cursor: not-allowed; background: transparent; }
.segbtn.on[disabled] { background: var(--acc); }
/* Theme buttons light up from the root attribute alone — no state class to drift. */
:root:not([data-theme="light"]) .segbtn[data-set-theme="dark"],
:root[data-theme="light"] .segbtn[data-set-theme="light"] { background: var(--acc); color: var(--accfg); }

.fetchbtn { font-size: 12.5px; padding: 7px 13px; white-space: nowrap; }

.swatches { display: inline-flex; gap: 6px; }
.swatch {
  width: 24px; height: 24px; padding: 0; border-radius: 7px; cursor: pointer;
  border: 2px solid transparent; box-shadow: 0 0 0 1px var(--ln2);
  transition: border-color var(--t);
}
.swatch.green { background: #2fe08a; }
.swatch.cobalt { background: #5c7cff; }
:root[data-theme="light"] .swatch.green { background: #067a4b; }
:root[data-theme="light"] .swatch.cobalt { background: #2b45d9; }
:root:not([data-accent="cobalt"]) .swatch.green,
:root[data-accent="cobalt"] .swatch.cobalt { border-color: var(--tx); }

/* ----- account menu ----- */

details.menu { position: relative; margin: 0; }
details.menu > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 6px 0 2px; border-radius: var(--r-pill);
  border: 1px solid transparent; cursor: pointer; font-weight: 400;
  transition: background var(--t), border-color var(--t);
}
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { background: var(--bg5); border-color: var(--ln2); margin-bottom: 0; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--acctint); border: 1px solid var(--accln); color: var(--acc);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.avatar.lg { width: 34px; height: 34px; font-size: 12.5px; }
.caret { font-size: 11px; line-height: 1; color: var(--tx3); transform: translateY(-1px); transition: transform var(--t); }
details.menu[open] .caret { transform: translateY(-1px) rotate(180deg); }

.menupanel {
  position: absolute; top: calc(100% + 9px); right: 0; z-index: 80;
  width: 286px; overflow: hidden;
  background: var(--bg4); border: 1px solid var(--ln2); border-radius: 14px;
  box-shadow: var(--shadow); animation: vb-rise 160ms ease-out;
}
.menuhead {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4) var(--s4) 14px; border-bottom: 1px solid var(--ln);
}
.menuwho { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.menuname { font-size: 14px; font-weight: 500; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menusub { font-size: 10.5px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menulist { padding: 6px; display: flex; flex-direction: column; }
.menuitem {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: var(--r-ctl);
  background: transparent; color: var(--tx); text-align: left;
  font-size: 13.5px; font-weight: 400; line-height: 1.4; text-decoration: none;
  cursor: pointer; transition: background 140ms ease-out;
}
.menuitem:hover { background: var(--bg5); color: var(--tx); }
.menuitem.off, .menuitem.off:hover { color: var(--tx3); background: transparent; cursor: default; }
.mglyph { width: 16px; text-align: center; flex-shrink: 0; color: var(--tx3); }
.mhint { margin-left: auto; font-size: 10px; color: var(--tx3); }
.menusect { border-top: 1px solid var(--ln); padding: 14px var(--s4); display: flex; flex-direction: column; gap: 13px; }
.menusect.menuout { padding: 6px; }
.menusect.menuout form { margin: 0; }
.approw { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); font-size: 13.5px; color: var(--tx2); }

/* ----- sidebar (Full) and chip tabs (Simple / narrow) ----- */

.sidenav {
  display: none; width: 216px; flex-shrink: 0;
  flex-direction: column; gap: 4px;
  padding: var(--s4) var(--s3);
  background: var(--bg2); border-right: 1px solid var(--ln);
}
.sidelabel, .sectionlabel {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--tx3);
}
.sidelabel { padding: 6px 10px 8px; }
.navlink {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--r-ctl);
  color: var(--tx2); font-size: 13.5px; text-decoration: none;
  transition: background 160ms ease-out, color 160ms ease-out;
}
.navlink:hover { background: var(--bg5); color: var(--tx); }
.navlink.active { background: var(--bg5); color: var(--tx); font-weight: 500; }
.nglyph { width: 16px; text-align: center; flex-shrink: 0; opacity: 0.9; }
.badge {
  margin-left: auto; min-width: 19px; text-align: center;
  font-family: var(--mono); font-size: 10px; line-height: 1.5;
  border-radius: var(--r-pill); padding: 2px 6px;
  background: var(--acc); color: var(--accfg);
}

.credits { margin-top: auto; border-top: 1px solid var(--ln); padding: 14px 10px 4px; display: flex; flex-direction: column; gap: 10px; }
.creditshead { display: flex; justify-content: space-between; align-items: baseline; }
.creditsval { font-size: 12px; color: var(--tx); }
.creditsmode { font-family: var(--mono); font-size: 10px; color: var(--tx3); }
progress.creditbar {
  width: 100%; height: 5px; display: block; border: 0; border-radius: 3px; overflow: hidden;
  background: var(--bg5); appearance: none; -webkit-appearance: none;
}
progress.creditbar::-webkit-progress-bar { background: var(--bg5); }
progress.creditbar::-webkit-progress-value { background: var(--acc); border-radius: 3px; transition: width 300ms ease-out; }
progress.creditbar::-moz-progress-bar { background: var(--acc); border-radius: 3px; }
progress.creditbar.low::-webkit-progress-value { background: var(--warn); }
progress.creditbar.low::-moz-progress-bar { background: var(--warn); }

.tabnav {
  display: flex; gap: 6px; padding: var(--s3) var(--s5);
  background: var(--bg2); border-bottom: 1px solid var(--ln);
  overflow-x: auto; flex-shrink: 0;
}
.tabchip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--r-pill); white-space: nowrap;
  background: var(--bg3); border: 1px solid var(--ln);
  color: var(--tx2); font-size: 14px; text-decoration: none;
  transition: border-color 160ms ease-out, color 160ms ease-out;
}
.tabchip:hover { color: var(--tx); border-color: var(--ln2); }
.tabchip.active { background: var(--acctint); border-color: var(--accln); color: var(--acc); font-weight: 500; }
.tabchip .badge { margin-left: 2px; }

@media (min-width: 901px) {
  html[data-mode="full"] .sidenav { display: flex; }
  html[data-mode="full"] .tabnav { display: none; }
}

@media (max-width: 640px) {
  .topsearch { display: none; }
  .topbar .modeseg { display: none; }
}

/* =============================================================== components
 * Connections, the account menu's cousins and the Home feed — the comps'
 * card-per-thing grammar. */

.sectionhead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: 0 0 var(--s3); }
.sectionhead .right { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--tx2); }
.stack { display: flex; flex-direction: column; gap: var(--s2); }
.pagesub { color: var(--tx2); font-size: 14px; margin: -6px 0 var(--s5); max-width: 68ch; text-wrap: pretty; }

/* One connected account = one card. */
.connrow { border-radius: 14px; padding: var(--s4) 18px; }
.connrow.needsfix { border-color: var(--warnln); }
.connline { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; }
.provbadge {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: var(--r-ctl); background: var(--bg5); border: 1px solid var(--ln);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; color: var(--tx2);
}
.provbadge.sm { width: 30px; height: 30px; font-size: 11px; }
.connmain { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.connname { font-size: 15px; font-weight: 500; color: var(--tx); }
.connname .connprov { margin-left: 9px; }
.connprov { font-family: var(--mono); font-size: 10.5px; font-weight: 400; color: var(--tx3); }
.conndetail { font-family: var(--mono); font-size: 11px; color: var(--tx3); overflow-wrap: anywhere; }
.connactions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.fixcopy { margin: var(--s3) 0 0; padding: var(--s3) 0 0; border-top: 1px solid var(--ln); font-size: 13.5px; line-height: 1.6; color: var(--tx2); }

.pill {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  border-radius: var(--r-pill); padding: 4px 11px;
  font-family: var(--mono); font-size: 10.5px; white-space: nowrap;
}
.pill.ok { background: var(--acctint); color: var(--acc); }
.pill.warn { background: var(--warntint); color: var(--warn); }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.ok .dot { animation: vb-pulse 2s ease-in-out infinite; }

/* Small secondary/primary buttons for card rows. */
button.btnsm, .button.btnsm {
  background: transparent; color: var(--tx); border-color: var(--ln2);
  font-size: 12.5px; font-weight: 400; padding: 7px 12px;
}
button.btnsm:hover, .button.btnsm:hover { background: transparent; color: var(--tx); border-color: var(--acc); }
button.btnsm.primary, .button.btnsm.primary { background: var(--acc); color: var(--accfg); border-color: transparent; font-weight: 600; }
button.btnsm.primary:hover, .button.btnsm.primary:hover { background: var(--acch); color: var(--accfg); }
button.btnsm.revoke:hover { color: var(--danger); border-color: var(--danger); }
button.iconbtn {
  width: 30px; height: 30px; padding: 0; flex-shrink: 0;
  background: transparent; border: 1px solid var(--ln2); border-radius: var(--r-ctl);
  color: var(--tx3); font-size: 12px; font-weight: 400; line-height: 1;
  transition: color 160ms ease-out, border-color 160ms ease-out;
}
button.iconbtn:hover { background: transparent; color: var(--danger); border-color: var(--danger); }

/* "+ New connection": a details toggle wearing the accent button. */
details.addwrap { margin: 0; display: contents; }
details.addwrap > summary {
  list-style: none; display: inline-block; margin-left: auto; order: 2;
  background: var(--acc); color: var(--accfg);
  border: 1px solid transparent; border-radius: var(--r-ctl);
  padding: 7px 13px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t);
}
details.addwrap > summary::-webkit-details-marker { display: none; }
details.addwrap > summary:hover { background: var(--acch); color: var(--accfg); }
details.addwrap[open] > summary { background: transparent; border-color: var(--ln2); color: var(--tx2); margin-bottom: 0; }
details.addwrap > summary .when-open { display: none; }
details.addwrap[open] > summary .when-open { display: inline; }
details.addwrap[open] > summary .when-closed { display: none; }
.addpanel {
  order: 3; width: 100%;
  background: var(--bg3); border: 1px solid var(--ln2); border-radius: 14px;
  padding: 18px; margin-top: var(--s2);
  display: flex; flex-direction: column; gap: 14px;
  animation: vb-rise 180ms ease-out;
}
.addpanel .intro { font-size: 14px; color: var(--tx2); line-height: 1.6; max-width: 66ch; margin: 0; text-wrap: pretty; }
.picklist { display: flex; flex-direction: column; gap: 7px; }
.pickrow, .voterow {
  display: flex; align-items: center; gap: 13px;
  border: 1px solid var(--ln); border-radius: 10px; padding: 13px 15px;
}
a.pickrow { background: var(--bg5); color: inherit; text-decoration: none; transition: border-color var(--t); }
a.pickrow:hover { border-color: var(--acc); }
.voterow { background: var(--bg2); }
.pickmain { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.pickname { font-size: 14.5px; font-weight: 500; color: var(--tx); }
.voterow .pickname { color: var(--tx2); }
.picknote { font-size: 12.5px; color: var(--tx2); line-height: 1.5; }
.voterow .picknote { color: var(--tx3); }
.pickrow .go { margin-left: auto; flex-shrink: 0; font-family: var(--mono); font-size: 11px; color: var(--acc); }
.votebtn.voted, .votebtn.voted:hover { color: var(--acc); border-color: var(--accln); cursor: default; }

/* The section header's right-hand controls. */
.sectionhead .button.addbtn { margin-left: auto; padding: 7px 13px; font-size: 12.5px; }
.sectionhead .button.addbtn.cancel { background: transparent; border-color: var(--ln2); color: var(--tx2); }
.sectionhead .button.addbtn.cancel:hover { background: transparent; border-color: var(--acc); color: var(--tx); }
.sectionhead form.inline { margin: 0 0 0 auto; }
.checkstack { display: flex; flex-direction: column; gap: 12px; }
.tight { margin-bottom: 0; }
.fixcopy.warn { color: var(--warn); }
.keyfine.tight { margin: 0; }
.codewrap { position: relative; margin: 0 0 var(--s3); }
.codewrap button.copy {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  background: var(--bg5); color: var(--tx2); border: 1px solid var(--ln2);
  font-size: 10px; padding: 4px 9px;
}
.codewrap button.copy:hover { background: var(--bg5); color: var(--tx); }
.codewrap pre.block { padding-right: 70px; margin: 0; }
details.pastewrap { margin: 0; }
details.pastewrap > summary { color: var(--tx2); font-size: 14px; }
details.pastewrap > summary:hover { color: var(--acc); }

/* Empty states: dashed, quiet, true. */
.emptycard {
  border: 1px dashed var(--ln2); border-radius: 14px;
  padding: 34px; text-align: center;
  display: flex; flex-direction: column; gap: 7px;
}
.emptycard .first { font-size: 15.5px; color: var(--tx); }
.emptycard .then { font-size: 13.5px; color: var(--tx2); }

/* Checkbox rows in the email card. */
.checkrow {
  display: flex; align-items: flex-start; gap: 11px;
  font-family: var(--ui); font-size: 14.5px; letter-spacing: 0; text-transform: none;
  color: var(--tx); margin: 0; cursor: pointer;
}
.checkrow input[type="checkbox"] { width: 16px; height: 16px; margin-top: 3px; flex-shrink: 0; }
.checkrow .sub { display: block; font-size: 13px; line-height: 1.55; color: var(--tx2); margin-top: 4px; }
.checkrow.off { cursor: default; color: var(--tx2); }
.divider { border-top: 1px solid var(--ln); padding-top: var(--s4); margin-top: var(--s4); }
.card .tight { margin-bottom: 0; }

/* Transcription mode rows. */
.modes2 { display: flex; flex-direction: column; gap: var(--s2); padding: 14px; }
.moderow { border: 1px solid var(--ln); border-radius: 11px; padding: var(--s4) 18px; transition: border-color var(--t), background var(--t); }
.moderow.chosen { background: var(--bg5); border-color: var(--accln); }
.modehead {
  display: flex; align-items: flex-start; gap: 14px; margin: 0; cursor: pointer;
  font-family: var(--ui); font-size: 15.5px; letter-spacing: 0; text-transform: none; color: var(--tx);
}
.moderow.off .modehead { cursor: default; }
.modehead input[type="radio"] { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.modemain { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.modename { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; font-weight: 600; }
.modedesc { font-size: 13.5px; font-weight: 400; color: var(--tx2); line-height: 1.6; margin: 0; }
.modeextra { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ln); }
.modeextra p:last-child, .modeextra ul:last-child { margin-bottom: 0; }
.keyfine { font-family: var(--mono); font-size: 10.5px; color: var(--tx3); }

/* Your AI: client rows, token rows, the guide. */
.listrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 13px;
  background: var(--bg5); border: 1px solid var(--ln); border-radius: 10px;
  padding: 13px 15px;
}
.listrow .rowmain { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.listrow .rowname { font-size: 14.5px; font-weight: 500; color: var(--tx); }
.listrow .rowsub { font-family: var(--mono); font-size: 10.5px; color: var(--tx3); overflow-wrap: anywhere; }
.listrow .scopes { font-family: var(--mono); font-size: 10.5px; color: var(--tx3); flex-shrink: 0; }
.chiprow { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 var(--s4); }
a.chip { text-decoration: none; }
a.chip, .chiprow .chip { font-family: var(--ui); font-size: 12.5px; letter-spacing: 0; padding: 7px 14px; color: var(--tx2); }
a.chip:hover { color: var(--tx); border-color: var(--ln2); }
a.chip.on { background: var(--acctint); border-color: var(--accln); color: var(--acc); font-weight: 500; }
.nsteps { display: flex; flex-direction: column; gap: 11px; margin: 0 0 var(--s3); }
.nstep { display: flex; align-items: flex-start; gap: 13px; }
.nstep .n { font-family: var(--mono); font-size: 11px; color: var(--acc); width: 16px; flex-shrink: 0; padding-top: 3px; }
.nstep .t { font-size: 14.5px; line-height: 1.6; color: var(--tx); text-wrap: pretty; }
.freshtoken {
  background: var(--acctint); border: 1px solid var(--accln); border-radius: 10px;
  padding: 15px; display: flex; flex-direction: column; gap: 10px;
  animation: vb-rise 180ms ease-out;
}
.canlist { display: flex; flex-direction: column; gap: 7px; }
.canline { display: flex; gap: 11px; font-size: 14px; line-height: 1.55; }
.canline .yes { color: var(--acc); flex-shrink: 0; }
.canline .no { color: var(--danger); flex-shrink: 0; }
.canline.cant span:last-child { color: var(--tx2); }

/* Home: the recent-interactions feed. */
.rowlist { display: flex; flex-direction: column; gap: 6px; }
.rowitem {
  display: flex; align-items: center; gap: 13px;
  background: var(--bg3); border: 1px solid var(--ln); border-radius: 10px;
  padding: 11px 14px; color: var(--tx); text-decoration: none;
  transition: border-color var(--t);
}
.rowitem:hover { border-color: var(--ln2); color: var(--tx); }
html[data-mode="simple"] .rowitem { padding: var(--s4) 18px; border-radius: 14px; }
.glyphsq {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: var(--r-ctl);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.g-call-in { background: var(--intint); color: var(--in); }
.g-call-out { background: var(--outtint); color: var(--out); }
.g-email { background: var(--mailtint); color: var(--mail); }
.g-note { background: var(--acctint); color: var(--acc); }
.rowitem .rowmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rowitem .rowname { font-size: 14.5px; font-weight: 500; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowitem .rowtitle { font-size: 13.5px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowitem .chip { flex-shrink: 0; }
.rowwhen { flex-shrink: 0; font-family: var(--mono); font-size: 11px; color: var(--tx3); white-space: nowrap; }

/* ------------------------------------------------------------- plain forms
 * The layout primitive the older pages were missing: a vertical form where no
 * control ever touches its neighbour. Labels hug their control, buttons stand
 * off from whatever is above them, and inputs/selects/textareas fill the line. */

form.stackform { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
form.stackform label { margin: var(--s2) 0 2px; }
form.stackform label:first-of-type { margin-top: 0; }
form.stackform input[type="text"], form.stackform input[type="email"],
form.stackform input[type="search"], form.stackform input[type="password"],
form.stackform select, form.stackform textarea { align-self: stretch; min-width: 0; width: auto; }
form.stackform textarea { width: 100%; }
form.stackform > button, form.stackform > .button { margin-top: var(--s2); }
form.stackform label.check { margin: var(--s2) 0 0; }
form.stackform p { align-self: stretch; margin: 2px 0 0; }

/* Selects wear the same clothes as inputs — never the OS menulist chrome. */
select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237D8894' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* Both segments are twin cells — the active fill must never read as a bigger
 * control than its quiet neighbour (it did, on paper light). */
.seg .segbtn { min-width: 64px; text-align: center; }

/* ------------------------------------------------------- topbar chrome scale
 * The comp pins the frame's controls to one 30px track (fetchBtn height:30,
 * avatar 28 + hairline, seg cells filling a 30px well). Fixed heights, every
 * viewport — content grows for thumbs below; the frame never does. */

/* No inset on the well: the cells fill the 30px track edge to edge, so the
 * active fill stands the same height as Fetch now beside it. With the 2px
 * inset the track matched the button but the green block inside it read 24
 * against the button's 30 — the toggle looked the shorter control. */
.topbar .seg { height: 30px; padding: 0; align-items: stretch; margin: 0; }
/* Cells take their natural width, exactly as App.dc.html has them (padding
 * 0 11px, no min-width): comp segment 111px against Fetch now's 98, ratio
 * 1.14. The 64px twins rule this replaces padded the segment out to 134px —
 * a third wider than the primary control standing next to it. */
.topbar .segbtn {
  min-height: 0; height: auto; min-width: 0;
  padding: 0 11px; font-size: 12px;
  /* 7px inside the track's 8px, over a 1px border — concentric corners. */
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
}
.fetchbtn {
  height: 30px; min-height: 0; padding: 0 13px; font-size: 12.5px;
  display: inline-flex; align-items: center; justify-content: center;
}
details.menu > summary { height: 30px; }

/* ------------------------------------------------------------ touch targets
 * Mobile browsers must never substitute native control chrome for ours, and on
 * a phone every real button grows to the 44pt Apple/Android target — desktop
 * densities read as "no padding" under a thumb. Utility controls (copy, small
 * row buttons, icon buttons, segments) get a 36–38pt floor instead; link-shaped
 * buttons stay links. */

button, .button,
input[type="search"], input[type="text"], input[type="email"], input[type="password"], textarea {
  -webkit-appearance: none;
  appearance: none;
}

@media (max-width: 640px) {
  button, .button { padding: 12px 18px; font-size: 14px; min-height: 44px; }
  button.copy { min-height: 38px; padding: 9px 14px; font-size: 12px; }
  button.btnsm, .button.btnsm, .sectionhead .button.addbtn { min-height: 38px; padding: 9px 14px; font-size: 13px; }
  button.iconbtn { width: 38px; height: 38px; min-height: 38px; padding: 0; }
  .topbar button, .topbar .button { min-height: 0; }
  button.linky { min-height: 0; padding: 4px 2px; font-size: 13.5px; }
  button.menuitem { min-height: 0; padding: 11px 10px; font-size: 13.5px; }
  .codewrap button.copy { min-height: 0; padding: 5px 10px; font-size: 10px; }
  a.chip, .chiprow .chip { padding: 9px 15px; }
  .tabchip { padding: 10px 16px; }
  input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; }
  .modehead input[type="radio"] { width: 20px; height: 20px; }
}

/* ----- WP17: the action bar ------------------------------------------------
 * One row directly under a page title where ALL of that page's actions live,
 * stowed behind disclosures until used. Destructive actions go in the ⋯
 * overflow at the right end — never at the foot of the page. */

.actionbar {
  position: relative; display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px; padding: 2px 0 14px; margin: 0 0 var(--s5);
  border-bottom: 1px solid var(--ln);
}
.actionbar details.act { position: static; margin: 0; }
.actionbar details.act > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border: 1px solid var(--ln2); border-radius: var(--r-ctl);
  background: transparent; color: var(--tx2); font-size: 12.5px; cursor: pointer;
  transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out;
}
.actionbar details.act > summary::-webkit-details-marker { display: none; }
.actionbar details.act > summary:hover { color: var(--tx); border-color: var(--acc); }
.actionbar details.act[open] > summary { background: var(--bg5); color: var(--tx); margin: 0; }
.actglyph { color: var(--tx3); font-size: 12px; }
.actionbar details.act[open] .actglyph, .actionbar details.act > summary:hover .actglyph { color: var(--acc); }
.actpanel {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 60; margin-top: 8px;
  background: var(--bg4); border: 1px solid var(--ln2); border-radius: 12px;
  padding: var(--s4) var(--s5); box-shadow: var(--shadow);
  animation: vb-rise 160ms ease-out; max-height: 70vh; overflow: auto;
}
.actpanel .stackform { margin: 0; }
.actionbar .chip { font-size: 11.5px; }

/* the ⋯ overflow: the account menu's cousin, wearing a ghost button */
.actionbar .actmore { margin-left: auto; }
.actionbar details.menu > summary {
  height: auto; padding: 6px 11px; border: 1px solid var(--ln2);
  border-radius: var(--r-ctl); color: var(--tx2); font-size: 14px; line-height: 1.2;
}
.actionbar details.menu > summary:hover { color: var(--tx); border-color: var(--ln2); background: var(--bg5); }
.menupanel.slim { width: 248px; padding: 6px; }
.menupanel.slim form { margin: 0; }
.menufine { margin: 2px 10px 8px; font-family: var(--mono); font-size: 10px; color: var(--tx3); }
.menuitem.danger { color: var(--bad); }
.menuitem.danger:hover { background: var(--bad-soft); color: var(--bad); }
.menuitem.danger .mglyph { color: var(--bad); }

@media (max-width: 640px) {
  .actionbar details.act > summary, .actionbar details.menu > summary { min-height: 38px; }
}

/* ----- WP17b: one action idiom everywhere + the de-cramping pass -----------
 * The systemic "elements touching" cause was the base 12px form margin leaking
 * into table cells, flex rows and chips, plus control rows with no breathing
 * room before full-width blocks. Everything here is ADDITIVE: rules above the
 * shell marker are pinned by tests/wp13.php and stay untouched. */

/* Inline forms sit in the flow of their host row — flush, shrink-wrapped. */
form.inline { margin: 0; display: inline-flex; }
.item footer form, .connactions form, .voterow form, .listrow form, table.list td form { margin: 0; }
form.assign { gap: var(--s3); }

/* Control rows (search, timeline window, top-up packs) breathe before the
 * full-width block that follows. */
form.row { margin: 0 0 var(--s5); }

/* A span.row (the Turns from/to pair) aligns its bits like the form flavour. */
span.row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }

/* Number inputs join the field family instead of wearing native chrome. */
input[type="number"] {
  font: inherit; color: var(--tx); background: var(--bg5);
  border: 1px solid var(--line-field); border-radius: var(--r-ctl);
  padding: 10px 12px; max-width: 100%; width: 84px;
  transition: border-color var(--t);
  -webkit-appearance: none; appearance: none;
}

/* Chips hosting a ✕ form (item-page project tags): the button stays inside
 * the pill instead of blowing it apart. */
.chip form.inline { margin: 0; vertical-align: middle; }
.chip button.btnsm { padding: 1px 6px; min-height: 0; border: 0; font-size: 11px; line-height: 1.4; }

/* Per-row table controls: compact, and clear of the neighbouring column. */
table.list select { max-width: 240px; }
table.list .chip.warn { margin-left: var(--s1); }

/* The action bar generalized beyond the item page. Panels normalize any form;
 * a direct action in the bar (Restore, Archive) wears the summary's ghost. */
.actpanel form { margin: 0 0 var(--s3); }
.actpanel form:last-child, .actpanel > :last-child { margin-bottom: 0; }
.actpanel .intro { margin: 0 0 var(--s3); }
button.barbtn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border: 1px solid var(--ln2); border-radius: var(--r-ctl);
  background: transparent; color: var(--tx2); font-size: 12.5px; font-weight: 400; cursor: pointer;
  transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out;
}
button.barbtn:hover { color: var(--tx); border-color: var(--acc); background: transparent; }
button.barbtn:hover .actglyph { color: var(--acc); }

/* A sectionhead can host a stowed disclosure (Connections' + New connection):
 * same ghost summary as the action bar, panel spanning the section width. */
.sectionhead { position: relative; }
.sectionhead h1 { margin: 0; }
.sectionhead details.act { position: static; margin: 0 0 0 auto; }
.sectionhead details.act > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border: 1px solid var(--ln2); border-radius: var(--r-ctl);
  background: transparent; color: var(--tx2); font-size: 12.5px; cursor: pointer;
  transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out;
}
.sectionhead details.act > summary::-webkit-details-marker { display: none; }
.sectionhead details.act > summary:hover { color: var(--tx); border-color: var(--acc); }
.sectionhead details.act[open] > summary { background: var(--bg5); color: var(--tx); margin: 0; }
.sectionhead details.act[open] .actglyph, .sectionhead details.act > summary:hover .actglyph { color: var(--acc); }

@media (max-width: 640px) {
  button.barbtn, .sectionhead details.act > summary { min-height: 38px; padding: 9px 14px; font-size: 13px; }
  table.list td form.inline { margin: var(--s1) 0 var(--s2); }
}

/* Verify-pass fix-ups: number fields get the same focus accent as every other
 * field (the border shorthand above out-cascades the pinned input:focus rule);
 * a danger flavour for visible bar actions (the bin's ticked-flush); and the
 * most recently opened panel paints above a dirty ungrouped one held open. */
input[type="number"]:focus { border-color: var(--acc); }
button.barbtn.danger, button.barbtn.danger .actglyph { color: var(--bad); }
button.barbtn.danger:hover { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
details.act.front .actpanel { z-index: 75; }
