/* Layout: one phone-width column, centred on larger screens. Night ground, paper tickets, yellow = action. Single dark look by design. */
:root {
  --night: #0b1533;
  --night-2: #16214a;
  --night-line: #2a3563;
  --paper: #fcf9f4;
  --paper-2: #f4efe6;
  --paper-line: #e4ded3;
  --yellow: #fbc90f;
  --yellow-soft: #fff3c4;
  --blue: #2340c8;
  --ink: #0b1533;
  --ink-2: #3a4466;
  --ink-3: #5a6385;
  --mist: #aeb5d3;
  --mist-2: #c9cee3;
  --display: 'Outfit', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r-sm: 8px; --r-md: 14px; --r-lg: 22px; --r-xl: 28px;
  color-scheme: dark;
}
html, body { height: 100%; }
[hidden] { display: none !important; }
body { background: var(--night); color: var(--paper); font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
*, *::before, *::after { box-sizing: border-box; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.on-paper :focus-visible { outline-color: var(--blue); }
h1, h2, h3 { text-wrap: balance; }
.label { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { position: relative; height: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 520px) { .app { border-left: 1px solid var(--night-line); border-right: 1px solid var(--night-line); } }
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pad { padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 20px; border-radius: var(--r-md); font-size: 16px; font-weight: 700; text-decoration: none; }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow:hover { background: #ffd83d; }
.btn-line { border: 2px solid currentColor; }
.btn-ghost-dark { background: var(--night-2); border: 1px solid var(--night-line); color: var(--paper); }
.btn[disabled] { opacity: .4; cursor: default; }

/* ---------- welcome ---------- */
.welcome { overflow-y: auto; padding-block: 28px 24px; gap: 22px; position: relative; }
.welcome .route-bg { position: absolute; left: 0; top: 140px; width: 100%; height: 200px; pointer-events: none; }
.welcome > * { position: relative; }
.welcome .logo { width: 168px; height: auto; }
.hero { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.hero h1 { margin: 0; font-family: var(--display); font-size: clamp(42px, 13vw, 54px); line-height: 1; font-weight: 800; letter-spacing: -.035em; }
.hero h1 span { color: var(--yellow); }
.hero p { margin: 0; font-size: 17px; line-height: 26px; color: var(--mist); max-width: 34ch; }
fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; }
legend { padding: 0 0 10px; color: var(--mist); }
.role { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 66px; padding: 12px 16px; border-radius: var(--r-md); border: 1px solid var(--night-line); text-align: left; cursor: pointer; }
.role input { position: absolute; opacity: 0; pointer-events: none; }
.role .dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--mist); }
.role:has(input:checked) { background: var(--night-2); border: 2px solid var(--yellow); padding: 11px 15px; }
.role:has(input:checked) .dot { border: 6px solid var(--yellow); }
.role:has(input:focus-visible) { outline: 3px solid var(--yellow); outline-offset: 2px; }
.role b { display: block; font-size: 16px; font-weight: 700; }
.role small { display: block; font-size: 13px; line-height: 18px; color: var(--mist); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .label { color: var(--mist); }
.select { appearance: none; width: 100%; min-height: 52px; padding: 0 44px 0 16px; border-radius: var(--r-md); border: 1px solid var(--night-line); background: var(--night-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23aeb5d3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center; color: var(--paper); font: 600 16px var(--body); }
.hint-small { margin: 0; font-size: 12px; line-height: 18px; color: var(--mist); }
.welcome .cta { margin-top: auto; }
.byline { margin: -8px 0 0; text-align: center; font-size: 12px; color: var(--mist); }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px 8px; }
.topbar .logo { width: 112px; height: auto; display: block; }
.topbar .right { display: flex; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--night-line); font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--paper); }
.pill:hover { border-color: var(--mist); }
.pill .flag { color: var(--yellow); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--night-line); }
.icon-btn:hover { border-color: var(--mist); }

/* filter chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-block: 6px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--night-line); font-size: 14px; font-weight: 600; color: var(--mist-2); white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.chip.where[data-active="true"] { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

/* ---------- deck ---------- */
.deck-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-block: 4px 0; }
.deck { position: relative; flex: 1; min-height: 300px; }
.card { position: absolute; inset: 0 0 6px; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border-radius: var(--r-lg); overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; will-change: transform; box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.card:active { cursor: grabbing; }
.card.behind { pointer-events: none; }
.card.behind-1 { transform: translateY(10px) scale(.955); opacity: .9; }
.card.behind-2 { transform: translateY(20px) scale(.91); opacity: .7; }
.card .top { flex: 1; min-height: 0; padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--night); color: var(--yellow); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.due { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: var(--paper-2); color: var(--ink); border: 1px solid var(--paper-line); }
.due.urgent { background: var(--yellow); border-color: var(--yellow); }
.due.open { background: var(--blue); border-color: var(--blue); color: var(--paper); }
.card h2 { margin: 4px 0 0; font-family: var(--display); font-size: clamp(30px, 9vw, 38px); line-height: 1.02; font-weight: 800; letter-spacing: -.03em; overflow-wrap: anywhere; }
.card .sub { margin: -4px 0 0; font-size: 15px; line-height: 21px; color: var(--ink-2); }
.route { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; font-weight: 600; min-width: 0; }
.route svg { flex: none; }
.route .to { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .spacer { flex: 1; }
.card .top > :not(.spacer) { flex-shrink: 0; }
.card .note { margin: 0; font-size: 15px; line-height: 22px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .with { display: flex; flex-direction: column; gap: 8px; }
.card .with .label { color: var(--ink-3); font-size: 10px; }
.card .with-note { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.verified { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--blue); }
.perf { position: relative; height: 0; border-top: 2px dashed var(--paper-line); margin: 0 18px; }
.perf::before, .perf::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--night); }
.perf::before { left: -30px; } .perf::after { right: -30px; }
.stub { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 20px 14px; background: var(--paper-2); }
.stub dt { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }
.stub dd { margin: 2px 0 0; font-size: 15px; line-height: 20px; font-weight: 700; }
.card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 20px 14px; background: var(--paper-2); font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--paper-line); }
.card .foot b { color: var(--ink); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.stamp { position: absolute; top: 22px; padding: 6px 14px; border: 4px solid; border-radius: 12px; font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: .02em; opacity: 0; pointer-events: none; }
.stamp.save { left: 18px; color: var(--ink); background: var(--yellow); border-color: var(--ink); transform: rotate(-12deg); }
.stamp.pass { right: 18px; color: var(--ink-3); border-color: var(--ink-3); background: var(--paper); transform: rotate(12deg); }

.controls { display: flex; justify-content: center; align-items: center; gap: 22px; padding-block: 14px 4px; }
.ctrl { display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.ctrl.pass { width: 64px; height: 64px; border: 2px solid var(--night-line); background: var(--night-2); }
.ctrl.pass:hover { border-color: var(--mist); }
.ctrl.undo { width: 46px; height: 46px; border: 1px solid var(--night-line); }
.ctrl.undo[disabled] { opacity: .35; cursor: default; }
.ctrl.save { width: 64px; height: 64px; background: var(--yellow); }
.ctrl.save:hover { background: #ffd83d; }
.ctrl[disabled] { opacity: .35; cursor: default; }
.deck-hint { margin: 0; text-align: center; font-size: 12px; color: var(--mist); padding-block: 6px 8px; }

.empty { flex: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; padding-block: 24px; }
.empty h2 { margin: 0; font-family: var(--display); font-size: 30px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; }
.empty p { margin: 0; color: var(--mist); max-width: 32ch; }
.empty .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- nav ---------- */
.nav { display: flex; justify-content: space-around; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #1d2850; background: var(--night); }
.nav button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 76px; padding: 6px 0; font-size: 12px; font-weight: 700; color: var(--mist); }
.nav button[aria-current="page"] { color: var(--yellow); }
.badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; }

/* ---------- saved ---------- */
.list-head { padding-block: 22px 10px; display: flex; flex-direction: column; gap: 4px; }
.list-head h1 { margin: 0; font-family: var(--display); font-size: 34px; line-height: 38px; font-weight: 800; letter-spacing: -.03em; }
.list-head p { margin: 0; font-size: 14px; color: var(--mist); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; padding-block: 8px 24px; }
.saved-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mini { display: flex; width: 100%; text-align: left; background: var(--paper); color: var(--ink); border-radius: 18px; overflow: hidden; }
.mini .main { flex: 1; min-width: 0; padding: 14px 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.mini .t { font-family: var(--display); font-size: 20px; line-height: 23px; font-weight: 800; letter-spacing: -.02em; }
.mini .when { flex: none; width: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px; border-left: 2px dashed var(--paper-line); background: var(--paper-2); text-align: center; }
.mini .when b { font-family: var(--display); font-size: 16px; line-height: 19px; font-weight: 800; }
.mini .due { align-self: flex-start; }
.list-note { margin: 18px 0 0; text-align: center; font-size: 13px; line-height: 19px; color: var(--mist); }

/* ---------- prepare ---------- */
.prep-grid { display: flex; flex-direction: column; gap: 12px; }
.prep { padding: 18px; border-radius: 18px; border: 1px solid var(--night-line); background: var(--night-2); display: flex; flex-direction: column; gap: 6px; }
.prep h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.prep p { margin: 0; font-size: 14px; line-height: 21px; color: var(--mist-2); }
.soon { align-self: flex-start; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--night-line); color: var(--mist); }
.org-box { margin-top: 18px; padding: 20px; border-radius: 18px; background: var(--yellow); color: var(--ink); display: flex; flex-direction: column; gap: 10px; }
.org-box h2 { margin: 0; font-family: var(--display); font-size: 24px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.org-box p { margin: 0; font-size: 15px; line-height: 22px; }
.org-box .btn { background: var(--ink); color: var(--paper); }

/* ---------- sheets ---------- */
.scrim { position: absolute; inset: 0; z-index: 20; background: rgba(5, 10, 26, .62); display: flex; align-items: flex-end; }
.sheet { width: 100%; max-height: calc(100% - 36px); display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border-radius: var(--r-xl) var(--r-xl) 0 0; animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.grab { display: flex; justify-content: center; padding: 10px 0 8px; cursor: grab; touch-action: none; }
.sheet-head { touch-action: none; }
.grab span { width: 40px; height: 4px; border-radius: 4px; background: #d9d4cb; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 20px 0; }
.close { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: #efe9df; flex: none; }
.close:hover { background: var(--paper-line); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.sheet-body > * { flex-shrink: 0; }
.sheet-body h1 { margin: 0; font-family: var(--display); font-size: 32px; line-height: 1.06; font-weight: 800; letter-spacing: -.03em; overflow-wrap: anywhere; }
.sheet-foot { padding: 12px 20px calc(18px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--paper-line); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--paper-line); border: 1px solid var(--paper-line); border-radius: 16px; overflow: hidden; }
.facts div { padding: 12px 14px; background: var(--paper); min-width: 0; }
.facts div.hl { background: var(--yellow-soft); }
.facts div.wide { grid-column: 1 / -1; }
.facts dt { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }
.facts dd { margin: 4px 0 0; font-size: 15px; line-height: 20px; font-weight: 700; overflow-wrap: anywhere; }
.block { display: flex; flex-direction: column; gap: 8px; }
.block > .label { color: var(--ink-3); }
.block p { margin: 0; font-size: 15px; line-height: 22px; color: var(--ink-2); }
.codes { display: flex; flex-wrap: wrap; gap: 6px; }
.code { padding: 4px 10px; border-radius: var(--r-sm); background: #efe9df; font-family: var(--mono); font-size: 13px; font-weight: 600; }
.code.me { background: var(--night); color: var(--yellow); }
.locked { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 16px; border: 2px dashed #c9c2b5; }
.locked .h { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.unlocked { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 16px; background: var(--night); color: var(--paper); }
.unlocked .h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
.unlocked p { color: var(--mist-2); font-size: 14px; line-height: 20px; margin: 0; }
.unlocked .src { font-size: 12px; line-height: 18px; color: var(--mist); }
.doc-link { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--night-line); background: var(--night-2); color: var(--paper); text-decoration: none; }
.doc-link:hover { border-color: var(--mist); }
.doc-link span.t { flex: 1; display: flex; flex-direction: column; }
.doc-link small { font-family: var(--mono); font-size: 11px; color: var(--mist); }
.email-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--night-2); }
.email-row code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.mini-btn { min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--night-line); font-size: 13px; font-weight: 700; }
.on-paper .mini-btn { border-color: var(--paper-line); }
.sheet .btn-line { color: var(--ink); }

/* filter sheet */
.opt-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--paper-line); background: var(--paper); font-weight: 700; font-size: 14px; color: var(--ink); }
.opt[aria-pressed="true"] { background: var(--night); color: var(--yellow); border-color: var(--night); }

/* submit form */
.form { display: flex; flex-direction: column; gap: 14px; }
.form .f { display: flex; flex-direction: column; gap: 6px; }
.form label { font-size: 14px; font-weight: 700; }
.form label small { font-weight: 400; color: var(--ink-3); }
.form input, .form select, .form textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid #d3ccbf; background: #fff; color: var(--ink); font: 16px var(--body); }
.form textarea { min-height: 84px; resize: vertical; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .two > * { min-width: 0; }
.err { margin: 0; font-size: 13px; color: #a3261b; font-weight: 700; }
.result pre { margin: 0; padding: 14px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--paper-line); font-family: var(--mono); font-size: 12px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow-y: auto; }

.toast { position: absolute; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 40; transform: translateX(-50%); max-width: calc(100% - 40px); padding: 12px 16px; border-radius: 12px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; align-items: center; gap: 12px; }
.toast button { text-decoration: underline; font-weight: 700; }
.loading { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--mist); }

@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .card { transition: none !important; } }

/* ---------- organisations: partner finding ---------- */
.tabs { display: flex; gap: 4px; margin: 2px 0 8px; padding: 4px; border-radius: 22px; background: var(--night-2); border: 1px solid var(--night-line); margin-inline: max(20px, env(safe-area-inset-left, 0px)); padding-inline: 4px; }
.tabs button { flex: 1; min-width: 0; min-height: 46px; padding: 4px 6px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; color: var(--mist-2); }
.tabs button b { font-size: 14px; font-weight: 700; }
.tabs button small { font-size: 10.5px; font-weight: 600; opacity: .8; line-height: 1.15; text-align: center; }
.tab-intro { margin: -2px 0 6px; font-size: 13px; line-height: 18px; color: var(--mist); }
.org-links a.site { font-family: var(--mono); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); }
.org-logo { flex: none; display: block; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--paper-line); }
.org-logo.initials { display: inline-flex; align-items: center; justify-content: center; background: var(--night); color: var(--yellow); border: 0; font-family: var(--display); font-weight: 800; letter-spacing: -.02em; }
.by { display: flex; align-items: center; gap: 10px; text-align: left; color: var(--ink); }
.by > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.by b { font-size: 15px; overflow-wrap: anywhere; }
.by small { font-size: 13px; color: var(--ink-3); }
.as-link { text-align: left; }
.as-link:hover b { text-decoration: underline; }
.org-head { display: flex; align-items: center; gap: 14px; }
.org-head > div { min-width: 0; }
.card .org-head h2 { margin: 0; font-size: clamp(26px, 7.5vw, 32px); }
.org-head h1, .org-head h2 { margin: 0; }
.org-head .sub { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.topic-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-tags span { padding: 4px 10px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--paper-line); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.org-links { display: flex; flex-wrap: wrap; gap: 8px; }
.org-links a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--paper-line); font-size: 13px; font-weight: 700; text-decoration: none; color: var(--ink); }
.org-links a:hover { background: var(--paper-2); }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.plain-list button { display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.plain-list small { font-size: 13px; color: var(--ink-3); }
.form fieldset.f { gap: 8px; }
.form legend { padding: 0 0 8px; color: var(--ink); font-size: 14px; font-weight: 700; }
.form legend small { font-weight: 400; color: var(--ink-3); }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check { position: relative; display: inline-flex; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid #d3ccbf; background: #fff; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.check input:checked + span { background: var(--night); border-color: var(--night); color: var(--yellow); }
.check input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.check.wide span { min-height: 48px; border-radius: 12px; padding: 10px 14px; width: 100%; }
.check.wide input:checked + span { background: var(--paper-2); color: var(--ink); border-color: var(--night); }
.check.wide input:checked + span::before { content: '✓'; margin-right: 8px; font-weight: 800; }
.logo-field { display: flex; align-items: flex-end; gap: 14px; }
.logo-field input[type=file] { padding: 10px; font-size: 14px; }
.match-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 24px; }
.sec { margin: 14px 0 0; font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--paper); }
.sec-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 18px 0 10px; }
.sec-row .sec { margin: 0; }
.match { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: var(--paper); color: var(--ink); }
.match .msg, .org-card .msg { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--paper-2); font-size: 14px; line-height: 20px; color: var(--ink-2); white-space: pre-line; }
.row2 { display: flex; gap: 10px; }
.row2 .btn { flex: 1; min-height: 46px; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; gap: 6px; }
.org-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 18px; background: var(--paper); color: var(--ink); }
.org-card h2 { margin: 0; font-family: var(--display); font-size: 24px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.org-card .btn-line { color: var(--ink); }
.mini.as-div .stack { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 10px; border-left: 2px dashed var(--paper-line); background: var(--paper-2); }
.mini.as-div .stack .mini-btn { border-color: var(--paper-line); color: var(--ink); }

/* ---------- profile switcher ---------- */
.switch-list { display: flex; flex-direction: column; gap: 10px; }
.switch-opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--paper-line); background: #fff; color: var(--ink); text-align: left; }
.switch-opt > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.switch-opt b { font-size: 16px; overflow-wrap: anywhere; }
.switch-opt small { font-size: 13px; color: var(--ink-3); }
.switch-opt.on { border-color: var(--ink); }
.switch-opt .now { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.sw-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink); }
.sw-dot.n { background: var(--night); }
.sw-dot.y { background: var(--yellow); }

/* ---------- organisation mode: yellow ground, ink everywhere ---------- */
body[data-mode="org"] { --org-ground: #fbf1cf; background: var(--org-ground); color: var(--ink); }
body[data-mode="org"] .app { border-color: rgba(11, 21, 51, .18); }
body[data-mode="org"] .pill, body[data-mode="org"] .icon-btn { color: var(--ink); border-color: rgba(11, 21, 51, .3); }
body[data-mode="org"] .pill .flag { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
body[data-mode="org"] .pill:hover, body[data-mode="org"] .icon-btn:hover { border-color: var(--ink); }
body[data-mode="org"] .tabs { background: rgba(11, 21, 51, .08); border-color: rgba(11, 21, 51, .18); }
body[data-mode="org"] .tabs button { color: var(--ink-2); }
body[data-mode="org"] .tabs button[aria-selected="true"] { background: var(--ink); color: var(--yellow); }
body[data-mode="org"] .chip { color: var(--ink-2); border-color: rgba(11, 21, 51, .25); }
body[data-mode="org"] .chip[aria-pressed="true"] { background: var(--ink); color: var(--yellow); border-color: var(--ink); }
body[data-mode="org"] .chip.where[data-active="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
body[data-mode="org"] .card { box-shadow: 0 18px 40px rgba(11, 21, 51, .22); }
body[data-mode="org"] .ctrl.pass { background: var(--paper); border-color: var(--ink); color: var(--ink); }
body[data-mode="org"] .ctrl.undo { border-color: rgba(11, 21, 51, .35); color: var(--ink); }
body[data-mode="org"] .ctrl.save { background: var(--ink); }
body[data-mode="org"] .ctrl.save svg path { fill: var(--yellow); }
body[data-mode="org"] .deck-hint, body[data-mode="org"] .list-head p, body[data-mode="org"] .empty p, body[data-mode="org"] .list-note, body[data-mode="org"] .loading { color: var(--ink-2); }
body[data-mode="org"] .sec { color: var(--ink); }
body[data-mode="org"] .main-screen .btn-yellow, body[data-mode="org"] .screen .btn-yellow { background: var(--ink); color: var(--yellow); }
body[data-mode="org"] .screen .btn-yellow:hover { background: var(--night-2); }
body[data-mode="org"] .btn-ghost-dark { background: transparent; border: 2px solid var(--ink); color: var(--ink); }
body[data-mode="org"] .nav { background: var(--org-ground); border-top-color: rgba(11, 21, 51, .18); }
body[data-mode="org"] .nav button { color: var(--ink-2); }
body[data-mode="org"] .nav button[aria-current="page"] { color: var(--ink); }
body[data-mode="org"] .nav button[aria-current="page"]::after { content: ''; position: absolute; bottom: -2px; left: 30%; right: 30%; height: 3px; border-radius: 3px; background: var(--ink); }
body[data-mode="org"] .badge { background: var(--ink); color: var(--yellow); }
body[data-mode="org"] .org-box { background: var(--ink); color: var(--paper); }
body[data-mode="org"] .org-box .btn { background: var(--yellow); color: var(--ink); }
body[data-mode="org"] .scrim { background: rgba(11, 21, 51, .55); }
body[data-mode="org"] .toast { background: var(--ink); color: var(--paper); }
.lh-row { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 10px; }
.lh-row h1 { min-width: 0; overflow-wrap: anywhere; }
.lh-row .pill { flex: none; align-self: flex-end; }
body[data-mode="org"] .tab-intro { color: var(--ink-2); }
body[data-mode="org"] .tabs button[aria-selected="true"] small { opacity: .9; }

/* profile switch button */
.profile-btn { min-height: 44px; padding: 0 14px 0 10px; gap: 8px; font-family: var(--body); letter-spacing: 0; text-transform: none; border-width: 1.5px; border-color: var(--mist); background: var(--night-2); }
.profile-btn svg { flex: none; color: var(--yellow); }
.profile-btn > span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; min-width: 0; }
.profile-btn small { font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mist); }
.profile-btn b { font-size: 14px; font-weight: 700; white-space: nowrap; color: var(--paper); }
body[data-mode="org"] .profile-btn { background: var(--paper); border-color: var(--ink); }
body[data-mode="org"] .profile-btn svg, body[data-mode="org"] .profile-btn b { color: var(--ink); }
body[data-mode="org"] .profile-btn small { color: var(--ink-3); }
.switch-opt.locked-opt { opacity: .55; border-style: dashed; cursor: default; }

/* cards on short screens */
.card.compact .top { gap: 9px; padding-top: 16px; }
.card.compact h2 { font-size: clamp(24px, 7vw, 30px); }
.card.tight .top { gap: 7px; padding: 14px 18px 12px; }
.card.tight h2 { font-size: 22px; line-height: 1.05; }
.card.tight .org-head .org-logo { width: 44px; height: 44px; }
.card .foot > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .foot b { flex: none; }
@media (max-height: 640px) {
  .controls { gap: 16px; padding-block: 8px 2px; }
  .ctrl.pass, .ctrl.save { width: 54px; height: 54px; }
  .ctrl.undo { width: 40px; height: 40px; }
  .deck-hint { padding-block: 4px; }
}

/* verification note, problem report, install */
.verify { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--paper-line); }
.verify p { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.verify b { color: var(--ink); }
.verify svg { flex: none; margin-top: 2px; }
.verify .i { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--ink-3); color: var(--ink-3); font: 700 12px/15px var(--mono); text-align: center; }
.verify.ok { background: #eef1fc; border-color: #d3dbf6; }
.report-link { align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
.report-link:hover { color: var(--ink); }
.report-done { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.form.report { padding: 14px 16px; border-radius: 14px; border: 1px dashed #c9c2b5; }
.install p { margin: 0; }
.ios-share { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--paper-line); font-size: 12px; vertical-align: middle; }
.sheet.still { animation: none; }
.add-opt { align-items: flex-start; }
.add-opt small { line-height: 1.35; margin-top: 2px; }
.add-opt > span:last-child { align-self: center; font-weight: 700; }
.add-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--paper-2); display: flex; align-items: center; justify-content: center; font-size: 20px; }
