/* SecondSource: newswire paper, navy ink, and one loud thing: the verdict stamp. */
:root {
  --paper: #edf1f4;
  --paper-2: #e1e7ec;
  --card: #f8fafb;
  --ink: #16202e;
  --ink-2: #4a5668;
  --ink-3: #6b7789;
  --rule: #c3ccd6;
  --wire: #2340c8;
  --deny: #c8102e;
  --confirm: #13784b;
  --unconf: #9a6300;
  --focus: #2340c8;
  --display: 'Archivo', system-ui, sans-serif;
  --body: 'Archivo', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --measure: 68ch;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0f1622;
    --paper-2: #172131;
    --card: #141d2b;
    --ink: #e7ecf2;
    --ink-2: #b2bccb;
    --ink-3: #8a96a8;
    --rule: #2c3a4f;
    --wire: #8ea2ff;
    --deny: #ff5a6e;
    --confirm: #4fd394;
    --unconf: #f0b44c;
    --focus: #8ea2ff;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #0f1622;
  --paper-2: #172131;
  --card: #141d2b;
  --ink: #e7ecf2;
  --ink-2: #b2bccb;
  --ink-3: #8a96a8;
  --rule: #2c3a4f;
  --wire: #8ea2ff;
  --deny: #ff5a6e;
  --confirm: #4fd394;
  --unconf: #f0b44c;
  --focus: #8ea2ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  font-variation-settings: 'wdth' 100;
}
a { color: var(--wire); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
img, svg { max-width: 100%; }
code, .mono { font-family: var(--mono); font-size: 0.88em; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.masthead .wrap { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand {
  font: 800 1.35rem/1 var(--display);
  font-variation-settings: 'wdth' 75;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}
.brand .seal { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current='page'] { color: var(--ink); border-bottom-color: var(--ink); }
@media (max-width: 640px) {
  .masthead { position: static; }
  .nav { margin-left: 0; width: 100%; padding-bottom: 8px; }
}

/* Type scale */
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; letter-spacing: -0.015em; }
h1 { font-weight: 850; font-variation-settings: 'wdth' 70; font-size: clamp(2.6rem, 6.5vw, 5.4rem); }
h2 { font-weight: 800; font-variation-settings: 'wdth' 78; font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
h3 { font-weight: 700; font-size: 1.2rem; line-height: 1.25; }
p { margin: 0 0 1em; max-width: var(--measure); }
.lede { font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.small { font-size: 0.9rem; }

section.band { padding: 72px 0; border-bottom: 1px solid var(--rule); }
section.band > .wrap > h2 { margin-bottom: 16px; }
section.band > .wrap > .lede { margin-bottom: 40px; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  appearance: none; border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  font: 700 1rem/1 var(--body); padding: 14px 20px; border-radius: 4px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover { background: var(--ink); color: var(--paper); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.small { padding: 9px 12px; font-size: 0.9rem; }

/* Hero: the wire flash and the stamp */
.hero { padding: 56px 0 64px; border-bottom: 1px solid var(--rule); overflow: hidden; }
.dateline { font-weight: 600; color: var(--ink-2); margin-bottom: 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.dateline .flash { background: var(--ink); color: var(--paper); font-weight: 800; padding: 3px 8px; border-radius: 2px; font-variation-settings: 'wdth' 75; }
.headline-stage { position: relative; max-width: 980px; }
.headline-stage h1 q { quotes: '\201C' '\201D'; }
.stamp {
  position: absolute; right: -8px; bottom: -28px;
  border: 5px solid currentColor; border-radius: 6px; padding: 8px 18px 6px;
  font: 900 clamp(2.2rem, 6vw, 4.4rem)/1 var(--display); font-variation-settings: 'wdth' 100; letter-spacing: 0.04em;
  transform: rotate(-9deg); color: var(--deny); background: color-mix(in srgb, var(--paper) 70%, transparent);
  mix-blend-mode: multiply; pointer-events: none;
}
.stamp small { display: block; font: 700 0.8rem/1.2 var(--body); letter-spacing: 0; margin-top: 4px; }
:root[data-theme='dark'] .stamp, .stamp.no-blend { mix-blend-mode: normal; }
@media (prefers-color-scheme: dark) { .stamp { mix-blend-mode: normal; } }
.stamp.confirmed { color: var(--confirm); }
.stamp.unconfirmed { color: var(--unconf); }
.stamp.animate { animation: stamp 520ms cubic-bezier(0.2, 1.6, 0.4, 1) both; animation-delay: var(--delay, 0ms); }
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-9deg) scale(2.4); }
  60% { opacity: 1; transform: rotate(-9deg) scale(0.94); }
  100% { opacity: 1; transform: rotate(-9deg) scale(1); }
}
@media (max-width: 640px) { .stamp { position: static; display: inline-block; margin-top: 20px; } }
@media (prefers-reduced-motion: reduce) { .stamp.animate { animation: none; } }

/* Timeline of the real event */
.timeline { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); }
.timeline li { padding: 14px 16px 0 0; border-right: 1px solid var(--rule); margin-right: 16px; }
.timeline li:last-child { border-right: 0; }
.timeline time { font-weight: 800; font-variation-settings: 'wdth' 75; font-size: 1.35rem; display: block; }
.timeline .bad { color: var(--deny); }
@media (max-width: 760px) { .timeline { grid-template-columns: 1fr 1fr; row-gap: 20px; } }

/* Process: a real sequence, so numbers are earned */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; counter-reset: step; }
.steps li { counter-increment: step; padding: 0 20px 0 0; border-left: 1px solid var(--rule); padding-left: 16px; }
.steps li::before { content: counter(step); font: 850 2.6rem/1 var(--display); font-variation-settings: 'wdth' 70; color: var(--wire); display: block; margin-bottom: 10px; }
.steps h3 { margin-bottom: 6px; }
.steps p { font-size: 0.95rem; color: var(--ink-2); }
@media (max-width: 900px) { .steps { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.cols > div { border-top: 2px solid var(--ink); padding-top: 14px; }
@media (max-width: 800px) { .cols { grid-template-columns: minmax(0, 1fr); } }

/* A signed response, shown as a document with marginal notes */
.specimen { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.specimen pre { margin: 0; background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--wire); padding: 18px; overflow-x: auto; font: 0.82rem/1.6 var(--mono); }
.specimen dl { margin: 0; }
.specimen dt { font-weight: 700; }
.specimen dd { margin: 0 0 14px; color: var(--ink-2); }
@media (max-width: 800px) { .specimen { grid-template-columns: minmax(0, 1fr); } }

.tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.tracks > div { background: var(--card); border: 1px solid var(--rule); padding: 24px; border-radius: 6px; }
@media (max-width: 760px) { .tracks { grid-template-columns: minmax(0, 1fr); } }

footer.site { padding: 32px 0 48px; color: var(--ink-3); font-size: 0.9rem; }

/* Check page */
.page-head { padding: 40px 0 24px; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.checker { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 40px; padding-bottom: 72px; align-items: start; }
@media (max-width: 900px) { .checker { grid-template-columns: minmax(0, 1fr); } }
form.panel, .panel { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .hint { display: block; font-size: 0.85rem; color: var(--ink-3); margin-top: 4px; }
input[type='text'], input[type='datetime-local'], input[type='password'], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 10px 12px;
}
textarea { font-family: var(--mono); font-size: 0.85rem; min-height: 220px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
details.key { margin: 4px 0 16px; }
details.key summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--rule); margin-bottom: 18px; }
.tabs button { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; font: 700 1rem var(--body); color: var(--ink-3); padding: 10px 14px 8px; cursor: pointer; }
.tabs button[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--ink); }

.report-head { position: relative; padding: 4px 0 28px; min-height: 120px; }
.report-head .claim { font: 800 clamp(1.6rem, 3vw, 2.3rem)/1.1 var(--display); font-variation-settings: 'wdth' 75; max-width: 30ch; }
.report-head .stamp { right: 0; bottom: auto; top: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); }
@media (max-width: 640px) { .report-head .stamp { position: static; } }
.reasoning { font-size: 1.1rem; border-left: 4px solid var(--rule); padding-left: 16px; margin: 8px 0 28px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--ink-2); font-size: 0.92rem; margin-bottom: 28px; }
.meta b { color: var(--ink); }

.receipts { list-style: none; margin: 0 0 32px; padding: 0; border-top: 2px solid var(--ink); }
.receipt { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.receipt .tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 0.8rem; color: var(--paper); background: var(--confirm); margin-top: 2px; }
.receipt.failed .tick { background: var(--deny); }
.receipt.pending .tick { background: var(--ink-3); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .receipt.pending .tick { animation: none; } }
.receipt .what { font-weight: 700; }
.receipt .sub { grid-column: 2 / 4; font-size: 0.85rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.receipt .price { font-weight: 700; white-space: nowrap; }
.receipt details { grid-column: 2 / 4; }
.receipt details pre { white-space: pre-wrap; word-break: break-all; font: 0.75rem/1.5 var(--mono); background: var(--paper-2); padding: 12px; border-radius: 4px; max-height: 280px; overflow: auto; }

.evidence { list-style: none; padding: 0; margin: 0; }
.evidence li { padding: 12px 0 12px 14px; border-left: 3px solid var(--rule); margin-bottom: 10px; }
.evidence li.cited { border-left-color: var(--wire); background: color-mix(in srgb, var(--wire) 6%, transparent); }
.evidence .eid { font-weight: 800; color: var(--wire); margin-right: 6px; }
.evidence .src { font-size: 0.85rem; color: var(--ink-3); display: block; }

.empty { border: 2px dashed var(--rule); border-radius: 6px; padding: 40px 24px; text-align: center; color: var(--ink-2); }
.empty p { margin-inline: auto; }
.error { border-left: 4px solid var(--deny); padding: 10px 14px; background: color-mix(in srgb, var(--deny) 8%, transparent); margin: 12px 0; }

table.list { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.list th, table.list td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.list th { border-bottom: 2px solid var(--ink); font-weight: 700; }
.table-scroll { overflow-x: auto; }
.badge { display: inline-block; font-weight: 700; font-size: 0.8rem; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.badge.ok { color: var(--confirm); }
.badge.bad { color: var(--deny); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, .claim { overflow-wrap: anywhere; hyphens: auto; }
.theme-toggle { appearance: none; background: none; border: 1px solid var(--rule); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font: 600 0.85rem var(--body); cursor: pointer; }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
/* Keep the verdict stamp clear of the checked headline on wide screens. */
@media (min-width: 641px) { .report-head .claim { max-width: calc(100% - 300px); } .report-head { min-height: 150px; } }

/* Conversation with the agent (/check) */
.chat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 40px; padding-bottom: 72px; align-items: start; }
@media (max-width: 900px) { .chat { grid-template-columns: minmax(0, 1fr); } }
.thread { display: flex; flex-direction: column; gap: 18px; min-height: 120px; }
.msg { max-width: 100%; }
.msg.user { align-self: flex-end; max-width: min(620px, 92%); background: var(--ink); color: var(--paper); border-radius: 14px 14px 4px 14px; padding: 12px 16px; font-size: 1.05rem; }
.msg.agent { border-left: 3px solid var(--wire); padding: 2px 0 2px 16px; }
.msg.agent .who { font-weight: 800; font-size: 0.85rem; color: var(--wire); margin-bottom: 4px; display: block; }
.msg.agent p { margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.chip { display: inline-block; border: 1px solid var(--rule); background: var(--card); border-radius: 999px; padding: 2px 10px; font-size: 0.85rem; }
.chip b { font-weight: 700; }
.composer { position: sticky; bottom: 0; background: var(--paper); padding: 16px 0 8px; border-top: 1px solid var(--rule); margin-top: 24px; }
.composer textarea { font-family: var(--body); font-size: 1.05rem; min-height: 72px; }
.composer .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.suggest button { appearance: none; border: 1px dashed var(--rule); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font: 500 0.9rem var(--body); cursor: pointer; text-align: left; }
.suggest button:hover { border-color: var(--ink); color: var(--ink); }
.side .panel h3 { margin-bottom: 6px; }

/* ===== Lean redesign (31 Oct): fewer words, evidence as cards, one loud stamp ===== */
.masthead .wrap { min-height: 64px; }
.nav { gap: 4px 22px; align-items: center; }
.nav a { font-weight: 600; }
.theme-toggle { padding: 4px 10px; font-size: 0.8rem; }

/* Verdict card */
.verdict { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 26px 28px 20px; }
.verdict-head { position: relative; padding-right: 220px; min-height: 96px; }
.verdict-head .eyeline { margin: 0 0 6px; font-size: 0.85rem; color: var(--ink-3); }
.verdict-head .claim { font: 800 clamp(1.5rem, 2.6vw, 2.1rem)/1.12 var(--display); font-variation-settings: 'wdth' 75; margin: 0; max-width: none; }
.verdict-head .stamp { position: absolute; right: 0; top: 4px; bottom: auto; font-size: clamp(1.6rem, 3vw, 2.3rem); }
@media (max-width: 640px) { .verdict-head { padding-right: 0; } .verdict-head .stamp { position: static; margin-top: 14px; } }
.verdict .reasoning { border: 0; padding: 0; margin: 18px 0 20px; font-size: 1.08rem; color: var(--ink-2); }
.verdict .meta { margin: 18px 0 10px; color: var(--ink-3); }
.verdict-actions { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 0.92rem; }
.linklike { appearance: none; background: none; border: 0; padding: 0; color: var(--wire); font: inherit; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; color: var(--ink-3); font-size: 0.9rem; }
details.more .evidence { margin-top: 10px; }
details.more .evidence li { font-size: 0.92rem; }

/* Cited posts */
.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.post { background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--wire); border-radius: 8px; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.post header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 0.9rem; }
.post header time { color: var(--ink-3); font-size: 0.8rem; white-space: nowrap; }
.post p { margin: 0; font-size: 1rem; line-height: 1.45; }
.post footer { display: flex; justify-content: space-between; gap: 8px; font-size: 0.78rem; color: var(--ink-3); margin-top: auto; }
.seal-line::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--confirm); margin-right: 6px; vertical-align: 1px; }

/* Receipts, one line each */
.rcs { list-style: none; margin: 4px 0 0; padding: 0; }
.rc { display: grid; grid-template-columns: 12px 108px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 0.92rem; }
.rc:last-child { border-bottom: 0; }
.rc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--confirm); }
.rc.failed .rc-dot { background: var(--ink-3); }
.rc.pending .rc-dot { background: var(--wire); animation: pulse 0.8s infinite alternate; }
.rc-src { font-weight: 700; }
.rc-what { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-pay, .rc-note { font-size: 0.82rem; white-space: nowrap; }
.rc-note { color: var(--ink-3); }
.rc-more { grid-column: 3 / 5; font-size: 0.8rem; }
.rc-more summary { cursor: pointer; color: var(--ink-3); }
.rc-more pre { white-space: pre-wrap; word-break: break-all; font: 0.72rem/1.5 var(--mono); background: var(--paper-2); padding: 10px; border-radius: 6px; max-height: 240px; overflow: auto; }
@media (max-width: 640px) { .rc { grid-template-columns: 12px minmax(0, 1fr) auto; } .rc-what { grid-column: 2 / 4; } .rc-more { grid-column: 2 / 4; } }

/* Home */
.hero-lean { padding: 64px 0 56px; border-bottom: 1px solid var(--rule); overflow: hidden; }
.hero-lean .sub { font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.5; color: var(--ink-2); max-width: 46ch; margin: 44px 0 0; }
.hero-lean .sub b { color: var(--ink); }
.band-lean { padding: 64px 0; border-bottom: 1px solid var(--rule); }
.band-lean h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 8px; }
.band-lean .kicker { color: var(--ink-2); margin-bottom: 28px; max-width: 60ch; }
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; counter-reset: flow; }
.flow > div { counter-increment: flow; padding: 22px 24px 4px 0; border-top: 3px solid var(--ink); margin-right: 18px; }
.flow > div::before { content: counter(flow); display: block; font: 850 2.2rem/1 var(--display); font-variation-settings: 'wdth' 70; color: var(--wire); margin-bottom: 10px; }
.flow h3 { margin-bottom: 6px; }
.flow p { color: var(--ink-2); font-size: 0.98rem; margin: 0; }
@media (max-width: 800px) { .flow { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.rails { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rail { border: 1px solid var(--rule); border-radius: 10px; padding: 20px 22px; background: var(--card); }
.rail h3 { margin-bottom: 4px; }
.rail p { color: var(--ink-2); margin: 0 0 12px; font-size: 0.98rem; }
.rail a { font-weight: 600; font-size: 0.95rem; }
@media (max-width: 760px) { .rails { grid-template-columns: minmax(0, 1fr); } }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.post header { flex-wrap: wrap; row-gap: 2px; }
.post header b { overflow-wrap: anywhere; }
.post footer { flex-wrap: wrap; }

/* ===== Chat, second pass (31 Oct): wallet up front, a live agent, a paper receipt for every payment ===== */
.chatwrap { max-width: 880px; }
.chat-head { padding-bottom: 18px; }
.chat-head .lede { font-size: 1.08rem; margin: 10px 0 0; max-width: 62ch; }

/* Wallet bar */
.walletbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; margin: 6px 0 22px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); font-size: 0.95rem; }
.walletbar .wb-text { color: var(--ink-2); flex: 1 1 260px; }
.walletbar .wb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.walletbar.busy { opacity: 0.75; }
.walletbar.busy .wb-actions { pointer-events: none; }
.walletbar.on { border-color: color-mix(in srgb, var(--confirm) 45%, var(--rule)); }
.wb-icon { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.wb-dot { display: inline-block; background: var(--wire); }
.wb-name { display: flex; flex-direction: column; line-height: 1.2; }
.wb-name .mono { color: var(--ink-3); font-size: 0.8rem; }
.wb-bal { font-weight: 800; font-variation-settings: 'wdth' 80; font-size: 1.15rem; }
.wb-bal.low { color: var(--unconf); }
.wb-net { font-size: 0.8rem; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 2px 10px; }
.wb-net::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--confirm); margin-right: 6px; vertical-align: 1px; }
.walletbar.on [data-disconnect] { margin-left: auto; color: var(--ink-3); }
.error-inline { color: var(--deny); }
.error-inline a { color: inherit; }

/* Messages arrive instead of appearing */
.thread { gap: 20px; }
.msg { animation: arrive 260ms ease-out both; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }
.msg.agent { position: relative; border-left: 0; padding: 0 0 0 44px; }
.msg.agent::before { content: ''; position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--card) url('/assets/seal.svg') center / 20px no-repeat; border: 1px solid var(--rule); }
.msg.agent .who { color: var(--ink); font-size: 0.82rem; margin-bottom: 2px; }
.msg.user { box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 20%, transparent); }

/* The agent at work */
.typing-line { display: flex; align-items: center; gap: 10px; color: var(--ink-2); margin: 0; }
.dots { display: inline-flex; gap: 4px; padding: 8px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--rule); }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--wire); animation: blink 1.1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.composer.working textarea { opacity: 0.6; }

/* The plan, by where the agent will look */
.plan { margin: 10px 0 8px; display: grid; gap: 6px; border-left: 2px solid var(--rule); padding-left: 14px; }
.plan > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px; align-items: baseline; animation: arrive 300ms ease-out both; animation-delay: calc(var(--i, 0) * 90ms); }
.plan dt { font-size: 0.85rem; color: var(--ink-3); }
.plan dd { margin: 0; }
@media (max-width: 640px) { .plan > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* Receipts list */
.rcs-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: baseline; }
.rcs-count { font-size: 0.82rem; font-weight: 700; color: var(--confirm); border: 1px solid currentColor; border-radius: 999px; padding: 1px 9px; }
.msg .rcs { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 4px 14px; }
.msg .rcs .rc { animation: arrive 240ms ease-out both; }
.rc-dot { position: relative; }
.rc.ok .rc-dot { animation: pop 380ms cubic-bezier(0.2, 1.8, 0.4, 1) both; }
@keyframes pop { from { transform: scale(0); } }

/* Verdict: the card takes the verdict's colour */
.verdict { border-top: 5px solid var(--ink-3); }
.verdict.v-confirmed { border-top-color: var(--confirm); }
.verdict.v-denied { border-top-color: var(--deny); }
.verdict.v-unconfirmed { border-top-color: var(--unconf); }
.confidence { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: var(--ink-2); margin: 16px 0 0; }
.confidence b { color: var(--ink); }
.meter { width: 160px; height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; display: inline-block; }
.meter span { display: block; height: 100%; width: var(--w); background: var(--ink-3); border-radius: inherit; animation: fill 900ms 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.v-confirmed .meter span { background: var(--confirm); }
.v-denied .meter span { background: var(--deny); }
.v-unconfirmed .meter span { background: var(--unconf); }
@keyframes fill { from { width: 0; } }
.verdict .posts .post { animation: arrive 320ms ease-out both; }
.verdict .posts .post:nth-child(2) { animation-delay: 80ms; }
.verdict .posts .post:nth-child(3) { animation-delay: 160ms; }
.verdict .posts .post:nth-child(n + 4) { animation-delay: 240ms; }

/* Payment receipt: a till slip with a torn edge */
.payslip {
  --edge: var(--card);
  position: relative; max-width: 440px; background: var(--card); color: var(--ink);
  padding: 18px 22px 16px; margin: 6px 0 2px; border: 1px solid var(--rule); border-top: 0; border-bottom: 0;
  font-size: 0.92rem;
}
.payslip::before, .payslip::after {
  content: ''; position: absolute; left: -1px; right: -1px; height: 8px;
  background: radial-gradient(circle at 6px 0, transparent 5px, var(--edge) 5.5px) 0 0 / 12px 8px repeat-x;
}
.payslip::before { top: -8px; transform: scaleY(-1); }
.payslip::after { bottom: -8px; }
.payslip header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--rule); }
.ps-title { font-weight: 800; font-variation-settings: 'wdth' 80; }
.ps-status { font-size: 0.8rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; border: 1px solid currentColor; }
.payslip.ok .ps-status { color: var(--confirm); }
.payslip.pending .ps-status { color: var(--wire); animation: pulse 0.9s infinite alternate; }
.payslip.off .ps-status { color: var(--ink-3); }
.ps-amount { font: 850 2.2rem/1 var(--display); font-variation-settings: 'wdth' 70; margin: 14px 0 10px; }
.payslip.off .ps-amount { text-decoration: line-through; color: var(--ink-3); }
.payslip dl { margin: 0; }
.payslip dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 5px 0; border-bottom: 1px dotted var(--rule); }
.payslip dt { color: var(--ink-3); }
.payslip dd { margin: 0; overflow-wrap: anywhere; }
.payslip footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: 12px; font-size: 0.82rem; color: var(--ink-3); }
.msg.slip { animation: slip 420ms cubic-bezier(0.2, 1.2, 0.4, 1) both; }
@keyframes slip { from { opacity: 0; transform: translateY(-10px) scaleY(0.92); transform-origin: top; } }

/* Composer */
.payrow { display: inline-flex; flex-wrap: wrap; gap: 10px; }
.suggest button.replay { border-style: solid; background: var(--card); }

@media (prefers-reduced-motion: reduce) {
  .msg, .msg.slip, .plan > div, .msg .rcs .rc, .rc.ok .rc-dot, .meter span, .verdict .posts .post, .dots i, .payslip.pending .ps-status { animation: none; }
}

/* Proof page: paid Cardano jobs first */
.proof-cardano { padding: 8px 0 48px; }
.proof-cardano h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 6px; }
.proof-cardano .kicker { color: var(--ink-2); margin-bottom: 18px; }
.jobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.job { background: var(--card); border: 1px solid var(--rule); border-top: 4px solid #0033ad; border-radius: 10px; padding: 16px 18px; }
:root[data-theme='dark'] .job { border-top-color: #6f8cff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .job { border-top-color: #6f8cff; } }
.job header { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.job .mono { overflow-wrap: anywhere; margin: 4px 0 8px; }
.steps-mini { list-style: none; margin: 8px 0 0; padding: 0; }
.steps-mini li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px dotted var(--rule); font-size: 0.93rem; }
.steps-mini li:last-child { border-bottom: 0; }
.steps-mini li > .small { grid-column: 2 / 4; }
.ok-dot, .dot-off { width: 8px; height: 8px; border-radius: 50%; background: var(--confirm); align-self: center; }
.dot-off { background: var(--rule); }

/* ===== Ask page, third pass: a calm chat with a slim dock ===== */
.chatwrap { max-width: 820px; min-width: 0; }
.ask-head { padding: 36px 0 18px; }
.ask-head h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); }
.ask-head .lede { font-size: 1.02rem; margin: 8px 0 0; max-width: 60ch; }

/* Wallet bar: one quiet line */
.walletbar { margin: 0 0 26px; padding: 10px 14px; gap: 8px 14px; }
.walletbar .wb-text { flex: 1 1 200px; font-size: 0.92rem; }
.walletbar .wb-actions { flex-wrap: wrap; }
.walletbar .btn.small { padding: 7px 11px; font-size: 0.85rem; }
@media (max-width: 560px) {
  .walletbar .wb-actions { width: 100%; }
  .walletbar .wb-actions .btn { flex: 1 1 0; justify-content: center; }
  .walletbar.on [data-disconnect] { margin-left: 0; }
}

/* Thread */
.thread { gap: 22px; min-height: 0; padding-bottom: 8px; }
.thread > * { min-width: 0; }
.msg.user { max-width: min(560px, 88%); font-size: 1rem; line-height: 1.45; overflow-wrap: anywhere; }
.msg.agent > p:last-child { margin-bottom: 0; }

/* Starter: questions and free replays, only before the first question */
.starter { padding-left: 44px; animation: arrive 300ms ease-out both; }
.starter[hidden] { display: none; }
.starter-label { font-size: 0.85rem; color: var(--ink-3); margin: 0 0 8px; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 20px; }
.start-card {
  appearance: none; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  transition: border-color 120ms ease, transform 120ms ease;
}
.start-card b { font-size: 0.97rem; line-height: 1.3; }
.start-card span { font-size: 0.85rem; color: var(--ink-3); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.start-card:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.start-card:disabled { opacity: 0.5; cursor: default; transform: none; }
.start-card.replay { border-left: 4px solid var(--ink-3); }
.start-card.replay.v-confirmed { border-left-color: var(--confirm); }
.start-card.replay.v-denied { border-left-color: var(--deny); }
.vchip { font-style: normal; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.02em; margin-right: 6px; }
.v-confirmed .vchip { color: var(--confirm); }
.v-denied .vchip { color: var(--deny); }
.starter-note { font-size: 0.85rem; color: var(--ink-3); margin: 0; }
@media (max-width: 560px) { .starter { padding-left: 0; } }

/* Dock: the input stays small and out of the way */
.dock { position: sticky; bottom: 0; z-index: 5; margin-top: 18px; padding: 12px 0 14px; background: linear-gradient(to bottom, transparent, var(--paper) 18px); }
.dock-box { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 10px 10px 8px 14px; box-shadow: 0 6px 24px -14px color-mix(in srgb, var(--ink) 45%, transparent); transition: border-color 120ms ease; }
.dock-box:focus-within { border-color: var(--focus); }
.dock textarea { display: block; width: 100%; min-height: 0; max-height: 200px; resize: none; border: 0; background: transparent; padding: 4px 0 8px; font: 400 1.02rem/1.45 var(--body); color: var(--ink); box-shadow: none; overflow-y: auto; }
.dock textarea:focus { box-shadow: none; outline: none; }
.dock-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.paysel { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); }
.paysel button { appearance: none; border: 0; background: transparent; color: var(--ink-2); font: 500 0.82rem var(--body); padding: 5px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.paysel button b { font-weight: 700; }
.paysel button[aria-checked='true'] { background: var(--ink); color: var(--paper); }
.paysel button:disabled { cursor: default; }
.btn.send { padding: 9px 16px; font-size: 0.95rem; border-radius: 999px; }
.dock-hint { display: flex; justify-content: space-between; gap: 10px; font-size: 0.78rem; color: var(--ink-3); margin: 6px 4px 0; max-width: none; }
.dock.working .dock-box { opacity: 0.85; }
@media (max-width: 560px) {
  .dock-hint span { display: none; }
  .btn.send { flex: 1 1 100%; justify-content: center; }
  .paysel { flex: 1 1 100%; }
  .paysel button { flex: 1 1 0; }
}

/* ===== Ask page: conversation sidebar on the left, output on the right ===== */
.ask-app { display: grid; grid-template-columns: minmax(340px, 410px) minmax(0, 1fr); height: calc(100dvh - 65px); }
.ask-side { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--rule); background: color-mix(in srgb, var(--paper-2) 55%, var(--paper)); padding: 12px 16px 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.side-head b { font-size: 0.85rem; color: var(--ink-2); }
.iconbtn { appearance: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--rule); background: var(--card); color: var(--ink-2); cursor: pointer; }
.iconbtn:hover { color: var(--ink); border-color: var(--ink-2); }
.ask-side .walletbar { margin: 0 0 10px; }
.ask-side .walletbar .wb-text { flex-basis: 100%; }
.ask-side .walletbar .wb-actions { width: 100%; }
.ask-side .walletbar .wb-actions .btn { flex: 1 1 0; justify-content: center; }
.ask-side .walletbar.on [data-disconnect] { margin-left: 0; }
.ask-side .thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 4px 14px 0; gap: 16px; scrollbar-width: thin; }
.ask-side .msg.agent { padding-left: 36px; }
.ask-side .msg.agent::before { width: 26px; height: 26px; background-size: 17px; }
.ask-side .msg.agent p { font-size: 0.95rem; }
.ask-side .msg.user { max-width: 92%; font-size: 0.95rem; padding: 10px 14px; }
.ask-side .plan { padding-left: 10px; }
.ask-side .plan > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.ask-side .chip { font-size: 0.78rem; }
.ask-side .msg .rcs { padding: 2px 10px; }
.ask-side .rc { grid-template-columns: 10px 86px minmax(0, 1fr) auto; font-size: 0.84rem; gap: 2px 8px; }
.ask-side .rc-more { grid-column: 2 / 5; }
.ask-side .dock { position: static; margin: 0; padding: 8px 0 12px; background: none; border-top: 1px solid var(--rule); }
.ask-side .dock-box { border-radius: 12px; }
.ask-side .paysel button { padding: 5px 9px; }
.verdict-line b { font-weight: 800; }
.verdict-line.v-confirmed b { color: var(--confirm); }
.verdict-line.v-denied b { color: var(--deny); }
.verdict-line.v-unconfirmed b { color: var(--unconf); }

/* Output side */
.ask-main { min-width: 0; min-height: 0; overflow-y: auto; padding: 34px clamp(20px, 4vw, 60px) 64px; scroll-behavior: smooth; }
.ask-main > * { max-width: 920px; }
.out-empty h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); margin-bottom: 10px; }
.out-empty .lede { font-size: 1.05rem; margin-bottom: 26px; max-width: 62ch; }
.out-empty .start-grid { margin-bottom: 22px; }
.out-empty[hidden], .out-live[hidden] { display: none; }
.out-h { font-size: 1.1rem; font-weight: 800; font-variation-settings: 'wdth' 85; margin: 28px 0 10px; letter-spacing: 0; }
.out-error { border-left: 4px solid var(--deny); padding: 6px 0 6px 16px; }
.out-error .out-h { margin-top: 0; }

/* While the agent works: the claim, what it is doing, and each signed source as it arrives */
.out-live { padding: 8px 0 12px; animation: arrive 260ms ease-out both; }
.live-q { font: 800 clamp(1.5rem, 2.8vw, 2.2rem)/1.15 var(--display); font-variation-settings: 'wdth' 75; max-width: 34ch; margin-bottom: 14px; }
.live-status { display: flex; align-items: center; gap: 10px; color: var(--ink-2); margin-bottom: 18px; }
.live-sources { display: flex; flex-wrap: wrap; gap: 8px; }
.src-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 0.85rem; padding: 5px 12px 5px 10px; border-radius: 999px; border: 1px solid var(--rule); background: var(--card); animation: arrive 240ms ease-out both; }
.src-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--confirm); }
.src-pill.off { color: var(--ink-3); }
.src-pill.off::before { background: var(--ink-3); }
#out-verdict .verdict { animation: arrive 320ms ease-out both; }
#out-payment .payslip { margin-top: 4px; }

/* Collapsed: the output takes the whole width; a button brings the conversation back */
.ask-app.collapsed { grid-template-columns: minmax(0, 1fr); }
.ask-app.collapsed .ask-side { display: none; }
.side-open { position: fixed; left: 16px; bottom: 18px; z-index: 20; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font: 700 0.92rem var(--body); cursor: pointer; box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--ink) 60%, transparent); }
.side-open[hidden] { display: none; }

/* Phones and small tablets: one column, output first, the input pinned to the bottom */
@media (max-width: 900px) {
  .ask-app { display: flex; flex-direction: column; height: auto; }
  .ask-main { order: 1; overflow: visible; padding: 22px 16px 8px; }
  .ask-side { order: 2; border-right: 0; border-top: 1px solid var(--rule); padding: 12px 16px 0; }
  .ask-side .thread { overflow: visible; }
  .ask-side .dock { position: sticky; bottom: 0; background: var(--paper); margin: 0 -16px; padding: 8px 16px 12px; }
  .ask-app.collapsed .ask-side { display: flex; }
  .ask-app.collapsed .ask-side .thread, .ask-app.collapsed .ask-side .walletbar { display: none; }
  .side-open { bottom: auto; top: 76px; left: auto; right: 16px; padding: 8px 12px; }
}

/* Split layout, refinements */
.ask-side .dock-bar { flex-wrap: nowrap; }
.ask-side .btn.send { flex: none; }
@media (max-width: 900px) {
  .ask-app { padding-bottom: 150px; }
  .ask-side .dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; margin: 0; padding: 8px 16px 10px; border-top: 1px solid var(--rule); box-shadow: 0 -8px 24px -18px color-mix(in srgb, var(--ink) 50%, transparent); }
  .ask-side .dock-hint { display: none; }
  .ask-side .dock-bar { flex-wrap: nowrap; }
  .ask-side .paysel { flex: 1 1 auto; }
  .ask-side .btn.send { flex: none; }
}
@media (min-width: 901px) { .ask-app.collapsed .ask-main > * { margin-inline: auto; } }
