/* Majani Relay styles: high contrast for outdoor use, big touch targets (min 52 px),
   one column, bottom tab bar reachable with one thumb. */
:root {
  --bg: #ffffff;
  --fg: #111511;
  --muted: #3f4a3f;
  --card: #f2f5ef;
  --line: #b9c4b3;
  --primary: #154727;
  --primary-fg: #ffffff;
  --ok: #17692c;
  --ok-bg: #e3f3e5;
  --bad: #9c2f0b;
  --bad-bg: #fdeadf;
  --unsure: #1f4a87;
  --unsure-bg: #e4edf9;
  --warn: #7a4e00;
  --warn-bg: #fff3d6;
  --focus: #e0761e;
  --radius: 14px;
  --tabbar-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d130e;
    --fg: #f1f5ef;
    --muted: #c3cdbf;
    --card: #18221a;
    --line: #3b4a3c;
    --primary: #8fd47a;
    --primary-fg: #0d130e;
    --ok: #8fd47a;
    --ok-bg: #16301b;
    --bad: #ffab85;
    --bad-bg: #3a1c10;
    --unsure: #9cc2ff;
    --unsure-bg: #15243b;
    --warn: #ffd27a;
    --warn-bg: #352a10;
    color-scheme: dark;
  }
}


* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: .4em 0; }
a { color: var(--primary); }
small, .small { font-size: .86rem; color: var(--muted); }
.ic { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-lg { width: 40px; height: 40px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 2px solid var(--line); padding: calc(8px + env(safe-area-inset-top)) 16px 8px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; }
.brand img { border-radius: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1.5px solid currentColor; white-space: nowrap; }
.chip:empty { display: none; }
.chip-ok { color: var(--ok); }
.chip-wait { color: var(--warn); }
.chip-bad { color: var(--bad); }
.lang { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.lang button { min-height: 44px; border-radius: 10px; border: 2px solid var(--primary); background: var(--bg); color: var(--primary); font: inherit; font-size: .95rem; font-weight: 700; }
.lang button[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); }

main { max-width: 640px; margin: 0 auto; padding: 12px 16px; }
.tab > * + * { margin-top: 14px; }

/* Cards */
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card.ok { background: var(--ok-bg); border-color: var(--ok); }
.card.bad { background: var(--bad-bg); border-color: var(--bad); }
.card.unsure { background: var(--unsure-bg); border-color: var(--unsure); }
.card.warn { background: var(--warn-bg); border-color: var(--warn); }
.card-head { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; }
.ok .card-head { color: var(--ok); }
.bad .card-head { color: var(--bad); }
.unsure .card-head { color: var(--unsure); }
.warn .card-head { color: var(--warn); }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 0; min-width: 140px; } /* basis 0: long tag rows wrap inside, not below the photo */
.notice { border-left: 5px solid var(--warn); background: var(--warn-bg); padding: 10px 12px; border-radius: 8px; font-size: .95rem; }
.label-nonai { display: inline-block; font-size: .86rem; font-weight: 600; color: var(--muted); }

/* Buttons: big and high contrast */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 10px 18px; border-radius: 12px; border: 2px solid var(--primary); background: var(--primary); color: var(--primary-fg); font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; text-align: center; }
.btn.secondary { background: var(--bg); color: var(--primary); }
.btn.danger { background: var(--bg); color: var(--bad); border-color: var(--bad); }
.btn.small { min-height: 46px; padding: 6px 12px; font-size: .95rem; }
.btn.block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-grid .wide { grid-column: 1 / -1; }

/* Answer block: fixed text + audio button */
.answer { display: flex; gap: 10px; align-items: flex-start; }
.answer .txt { flex: 1 1 auto; min-width: 0; }
.answer .txt p { margin: 0; font-size: 1.05rem; font-weight: 600; }
.play { flex: none; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--primary); background: var(--bg); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.play[disabled] { opacity: .35; cursor: not-allowed; }
.play.playing { background: var(--primary); color: var(--primary-fg); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tag { display: inline-block; max-width: 100%; line-height: 1.3; font-size: .74rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; border: 1.5px solid var(--muted); color: var(--muted); }
.tag.warn { border-color: var(--warn); color: var(--warn); }
.tag.syn { border-color: var(--unsure); color: var(--unsure); }

/* Forms */
label.field { display: block; font-weight: 700; }
label.field span { display: block; margin-bottom: 4px; }
input[type=text], input[type=search], input:not([type]) { width: 100%; min-height: 54px; font: inherit; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); color: var(--fg); }
input:focus { border-color: var(--primary); }
textarea, select { display: block; width: 100%; min-height: 54px; font: inherit; font-weight: 400; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); color: var(--fg); }
textarea { resize: vertical; line-height: 1.4; }
textarea:focus, select:focus { border-color: var(--primary); }

/* Wording corrections: a quiet text button under each sentence, the report sheet, the officer list */
.link-btn { display: inline-flex; align-items: center; min-height: 44px; margin: 2px 0 -8px; padding: 0 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .86rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wc-quote { margin: 4px 0 0; padding: 8px 12px; border-left: 4px solid var(--line); background: var(--card); border-radius: 0 8px 8px 0; font-weight: 600; }
.wc-list { list-style: none; margin: 8px 0 12px; padding: 0; }
.wc-list li { border-top: 1.5px solid var(--line); padding: 10px 0; }
.wc-list li:first-child { border-top: 0; }
.wc-sugg { font-weight: 600; overflow-wrap: anywhere; }

/* Progress */
.progress { height: 14px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }
.steps { font-weight: 800; font-size: 1.1rem; }

/* Result details */
.thumb { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; border: 1.5px solid var(--line); background: var(--line); flex: none; }
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 8px; align-items: center; font-size: .86rem; }
.bar { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar > div { height: 100%; background: var(--muted); }
details summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; }

/* Checklist */
.q { border-top: 1.5px solid var(--line); padding-top: 10px; }
.q:first-of-type { border-top: 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.seg button { min-height: 48px; border-radius: 10px; border: 2px solid var(--primary); background: var(--bg); color: var(--primary); font: inherit; font-weight: 700; font-size: .95rem; }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); }

/* Officer review */
.review-item { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: start; }
.review-item .thumb { width: 112px; height: 112px; }
.label-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.label-btns .btn { min-height: 48px; font-size: .9rem; padding: 6px 8px; }

/* Dashboard table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1.5px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: 9px 6px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
td:first-child { overflow-wrap: anywhere; }
th:first-child, td:first-child { text-align: left; }
th { background: var(--card); font-size: .8rem; }
tr.alert td { background: var(--bad-bg); }
.alert-flag { color: var(--bad); font-weight: 800; white-space: nowrap; }
.kv { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 6px 14px; font-size: .92rem; }
.kv dt { font-weight: 700; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .kv dd { margin-bottom: 10px; color: var(--muted, #555); } }

/* Bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg); border-top: 2px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { position: relative; height: var(--tabbar-h); border: 0; background: none; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.tabbar button[aria-current="page"] { color: var(--primary); box-shadow: inset 0 4px 0 var(--primary); }
[hidden] { display: none !important; }
.badge { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 22px; height: 22px; border-radius: 11px; background: var(--bad); color: var(--bg); font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

/* Bottom sheet (sample photo picker) */
.sheet { position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-body { background: var(--bg); width: 100%; max-width: 640px; max-height: 85vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.sample-row { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 8px; min-height: 80px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--fg); font: inherit; cursor: pointer; }
.sample-row + .sample-row { margin-top: 8px; }
.sample-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }

/* Toast */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); z-index: 20; max-width: 600px; margin: 0 auto; background: var(--fg); color: var(--bg); padding: 12px 14px; border-radius: 12px; font-weight: 700; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.toast[hidden] { display: none; }
.toast button { background: none; border: 2px solid var(--bg); color: var(--bg); border-radius: 8px; font: inherit; font-weight: 800; min-height: 40px; padding: 4px 10px; }

.busy { display: inline-block; width: 18px; height: 18px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy { animation: none; } .progress > div { transition: none; } }
@media (max-width: 360px) { body { font-size: 17px; } .btn-grid { grid-template-columns: 1fr; } }

/* Result card extras: "What does this mean?" guide, "I think it's something else" confirm and sent state */
.sent-box, .confirm-box { border: 2px solid var(--unsure); background: var(--unsure-bg); color: var(--fg); border-radius: 12px; padding: 10px 12px; }
.sent-box p, .confirm-box p { margin: 2px 0; }
.sent-box > p:first-child { display: flex; align-items: center; gap: 6px; color: var(--unsure); }
.sent-box .btn { margin-top: 6px; }
.confirm-box .btn-grid { margin-top: 8px; }
.guide .guide-sec { border-top: 1.5px solid var(--line); padding-top: 10px; margin-top: 10px; }
.guide .guide-sec h3 { margin: 0 0 4px; }
.guide .guide-sec p { margin: 0; font-size: 1.02rem; }
.guide .tags { margin-top: 8px; }
.guide-sources { border-top: 1.5px solid var(--line); padding-top: 10px; margin-top: 12px; }
.src-list { margin: 6px 0 0; padding-left: 18px; }
.src-list li { margin: 4px 0; overflow-wrap: anywhere; }
.guide > .btn.block { margin-top: 14px; }

/* Farm details taps (for the officer; the AI does not use them) */
.farm-q { margin-top: 10px; }
.farm-label { display: block; font-weight: 700; }
.seg.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg.seg-4 { grid-template-columns: repeat(4, 1fr); }
.seg button { padding: 4px 6px; line-height: 1.15; }
.farm-line { overflow-wrap: anywhere; }
@media (max-width: 400px) { .seg.seg-4 { grid-template-columns: repeat(2, 1fr); } }

/* collapsible technical section on About */
details.tech > summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; }
details.tech > summary::-webkit-details-marker { display: none; }
details.tech[open] > summary::before { transform: rotate(90deg); }
details.tech h3 { margin: 18px 0 8px; font-size: 1rem; }

/* Display font: Avenir Next on headings, buttons and the tab bar (Apple devices); paragraph text keeps the phone's own font. */
:root { --font-display: "Avenir Next", "Avenir", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
h1, h2, h3, .brand, .card-head, .steps, .btn, .seg button, .lang button, .tabbar button, details summary { font-family: var(--font-display); }
h1, h2, h3, .brand span { letter-spacing: -0.01em; }
.btn, .brand, .card-head, .steps { font-weight: 700; } /* Avenir Next Bold; 800 would pick the much blockier Heavy */

/* About page */
.how { list-style: none; counter-reset: how; padding: 0; margin: 14px 0; display: grid; gap: 12px; }
.how li { counter-increment: how; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; }
.how li::before { content: counter(how); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--primary-fg); font-family: var(--font-display); font-weight: 700; font-size: .9rem; }
.facts { list-style: none; padding: 0; margin: 10px 0 4px; display: grid; gap: 12px; }
.facts li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; }
.facts li .ic { width: 24px; height: 24px; margin-top: 1px; color: var(--primary); }
.langs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 10px 0; }
.langs dt { font-weight: 700; }
.langs dd { margin: 0; }
details.more { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 4px; }
details.more > summary { color: var(--primary); font-size: .95rem; list-style: none; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before, details.tech > summary::before { content: "▸"; display: inline-block; width: 1em; text-align: center; font-size: 1.1em; transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more h3 { margin: 12px 0 4px; font-size: 1rem; }
details.more p { font-size: .9rem; }

/* Co-op table: fixed column widths so the village name gets the most room on a phone */
.coop-table { table-layout: fixed; }
.coop-table col.c-village { width: 37%; }
.coop-table col.c-raw { width: 20%; }
.coop-table col.c-adj { width: 22%; }
.coop-table col.c-chance { width: 21%; }
.coop-table th, .coop-table td { padding: 10px 6px; }
.coop-table .alert-flag { white-space: normal; }
.coop-table td:first-child { overflow-wrap: break-word; }
.coop-table .alert-flag .ic { width: 16px; height: 16px; vertical-align: -2px; }
.card > details.more:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.pin-row { display: grid; gap: 18px; margin: 18px 0 6px; }
.pin-row label.field span { display: block; margin-bottom: 8px; }
.pin-row .pin-input { display: block; width: 100%; max-width: 220px; min-height: 60px; font-size: 1.6rem; letter-spacing: .5em; text-align: center; -webkit-text-security: disc; }
.pin-row p { margin: 0; }

/* ===================== Re-skin: "field notebook" =====================
   Paper background, coffee-ink text and main buttons, leaf green and amber as accents only.
   Fraunces (headings) + IBM Plex Sans (text), both OFL, self-hosted in fonts/ so they work offline. */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/fraunces-latin-600-normal.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: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/fraunces-latin-ext-600-normal.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: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.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: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-ext-400-normal.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: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.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: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-ext-600-normal.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; }

:root {
  --bg: #f6f1e7; --fg: #231c15; --muted: #685b4e; --card: #fffcf6; --line: #dcd1be;
  --primary: #2a2019; --primary-fg: #f8f3ea; --accent: #2f5d3e; --amber: #a8681a;
  --ok: #2f6b3a; --ok-bg: #edf3e5; --bad: #9a3412; --bad-bg: #fbebe2; --unsure: #2b4f7e; --unsure-bg: #e9eff6;
  --warn: #855600; --warn-bg: #fbefd6; --focus: #c07a1a; --radius: 10px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130f; --fg: #f1eadf; --muted: #c2b5a4; --card: #211b15; --line: #3f352b;
    --primary: #efe6d6; --primary-fg: #1a1510; --accent: #8fc79a; --amber: #e5a64a;
    --ok: #8fc79a; --ok-bg: #1d2a1f; --bad: #f2a07b; --bad-bg: #3a2016; --unsure: #9dbbe6; --unsure-bg: #1c2633; --warn: #f0c46e; --warn-bg: #352a14;
  }
}
body { font-family: var(--font-text); }
h1, h2, h3, .brand, .card-head, .steps, details.tech > summary { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.005em; }
.btn, .seg button, .lang button, .tabbar button, details.more > summary, .chip, .label-btns .btn, .toast { font-family: var(--font-text); font-weight: 600; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.16rem; }
.brand { font-size: 1.3rem; font-weight: 600; }
.top { border-bottom: 1px solid var(--line); }
.chip { border-width: 1px; font-size: .74rem; letter-spacing: .02em; padding: 3px 9px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(60, 40, 20, .05); }
.card.ok, .card.bad, .card.unsure, .card.warn { border-width: 1px; border-left-width: 6px; }
.card-head { font-size: 1.3rem; }
.btn { border-width: 1.5px; border-radius: 10px; }
.btn.secondary { background: transparent; }
.btn.danger { background: transparent; }
.lang button, .seg button { border-width: 1.5px; border-radius: 8px; }
.play { border-width: 1.5px; background: transparent; }
input[type=text], input[type=search], input:not([type]), textarea, select { border-width: 1.5px; border-radius: 8px; background: var(--card); }
.thumb { border-width: 1px; border-radius: 8px; }
.tag { border-width: 1px; border-radius: 4px; font-weight: 600; }
.progress { height: 10px; background: var(--line); }
.progress > div { background: var(--accent); }
.tabbar { border-top: 1px solid var(--line); }
.tabbar button { color: var(--muted); }
.tabbar button[aria-current="page"] { color: var(--fg); box-shadow: inset 0 3px 0 var(--accent); }
a, details.more > summary { color: var(--accent); }
.how li::before { background: var(--accent); font-family: var(--font-display); }
.facts li .ic { color: var(--accent); }
.table-wrap { border-width: 1px; background: var(--card); }
th { background: transparent; font-weight: 600; color: var(--muted); }
.sample-row { background: var(--card); border-width: 1px; }
.sheet-body { background: var(--bg); }
.sent-box, .confirm-box { border-width: 1px; border-left-width: 5px; border-radius: 8px; }
.notice { border-left-width: 4px; }

/* The relay, on the first screen: who does what */
.relay { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: start; gap: 4px; padding: 12px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.relay-step { display: grid; justify-items: center; text-align: center; gap: 6px; font-size: .78rem; line-height: 1.25; color: var(--muted); }
.relay-step b { display: block; font-family: var(--font-display); font-weight: 600; font-size: .98rem; color: var(--fg); }
.relay-step .ic { width: 28px; height: 28px; color: var(--accent); }
.relay-step:nth-child(3) .ic { color: var(--fg); }
.relay-step:nth-child(5) .ic { color: var(--amber); }
.relay-arrow { align-self: center; color: var(--line); font-size: 1.2rem; padding-top: 4px; }
.relay-step { font-size: .74rem; }
.relay-step b { font-size: .9rem; }
.relay { padding: 10px 8px; gap: 2px; }

/* ===================== Shapes: "index card" =====================
   Square corners, a dark ink rule along the top of each card, small capital labels. Status cards keep their tint,
   with a thicker rule in the status colour on top. */
:root { --radius: 2px; }
.card { border-radius: 2px; border: 1px solid var(--line); border-top: 3px solid var(--fg); box-shadow: none; }
.card.ok, .card.bad, .card.unsure, .card.warn { border-width: 1px; border-left-width: 1px; border-left-color: var(--line); border-right-color: var(--line); border-bottom-color: var(--line); border-top-width: 6px; }
.card.ok { border-top-color: var(--ok); }
.card.bad { border-top-color: var(--bad); }
.card.unsure { border-top-color: var(--unsure); }
.card.warn { border-top-color: var(--warn); }
.relay { border-radius: 2px; border-top: 3px solid var(--fg); }
.btn, .lang button, .seg button, .sample-row, .toast, .toast button, .link-btn { border-radius: 2px; }
input[type=text], input[type=search], input:not([type]), textarea, select, .pin-row .pin-input { border-radius: 2px; }
.thumb, .sample-row img, .review-item .thumb { border-radius: 0; }
.tag { border-radius: 0; text-transform: uppercase; letter-spacing: .06em; font-size: .66rem; padding: 2px 6px; }
.chip { border-radius: 2px; text-transform: uppercase; letter-spacing: .05em; font-size: .64rem; padding: 3px 7px; }
.progress, .progress > div, .bar, .bar > div { border-radius: 0; }
.table-wrap { border-radius: 2px; border-top: 3px solid var(--fg); }
.sheet-body { border-radius: 2px 2px 0 0; border-top: 3px solid var(--fg); }
.sent-box, .confirm-box { border-radius: 2px; border: 1px solid var(--line); border-top: 4px solid var(--unsure); }
.notice { border-radius: 2px; }
.label-nonai { text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; }
