:root {
  /* Neutral until the brand's theme loads (each brand sets these from Organic iD). */
  --bg: #ffffff; --panel: #f4f6f3; --ink: #171a18; --muted: #5f6762; --line: #e1e6df;
  --accent: #3DA62C; --accent-ink: #ffffff; --warn: #c0392b; --radius: 7px; --field: #ffffff;
  --display: "Helvetica Neue", Arial, sans-serif; --ui: "Helvetica Neue", Arial, sans-serif;
  --serif: "Fraunces", Georgia, serif; --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--ui); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shell { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right)); }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 14px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 19px; letter-spacing: -.01em; }
/* The Organic logo, flat: black on light brands, white on dark ones. */
.organic-mark { display: inline-block; width: 74px; height: 32px; background: currentColor; color: var(--ink);
  -webkit-mask: url(/organic-logo.png) center / contain no-repeat; mask: url(/organic-logo.png) center / contain no-repeat; opacity: .9; }
.for { margin: 10px 0 0; font-size: 13px; color: var(--muted); min-height: 1em; }
.for a { color: inherit; }
main { flex: 1; padding: 22px 0 28px; }
.foot { padding: 14px 0 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pad { padding: 8px 0; }
.muted { color: var(--muted); }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 6vw, 34px); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 10px; color: var(--heading, var(--ink)); text-wrap: balance; }
h1 em, h2 em { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.1em; letter-spacing: -.01em; }
h2 { font-family: var(--display); font-size: 21px; letter-spacing: -.01em; margin: 0 0 8px; color: var(--heading, var(--ink)); }
p { margin: 0 0 14px; }
label { display: block; font-weight: 500; font-size: 14px; margin: 14px 0 6px; }
input, select, textarea { font: 17px var(--ui); color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: min(var(--radius), 10px); padding: 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.row { display: flex; gap: 8px; } .row > :first-child { flex: 0 0 120px; }
.code { letter-spacing: .5em; text-align: center; font-family: var(--mono); font-size: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: 600 15px var(--ui); cursor: pointer; border-radius: var(--radius); text-decoration: none; }
.btn-mono .btn { font: 600 13px var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.btn:hover { background: transparent; color: var(--accent); }
.btn[disabled] { opacity: .5; cursor: progress; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent); color: var(--accent-ink); }
.btn.wide { width: 100%; margin-top: 18px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; padding: 8px 0; }
.err { color: var(--warn); font-size: 14px; margin-top: 10px; min-height: 1em; }
.ok { color: var(--accent); }
.who { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--panel) center/cover no-repeat; border: 2px solid var(--accent); flex: 0 0 auto; display: grid; place-items: center;
  font: 700 26px var(--display); color: var(--accent); cursor: pointer; position: relative; overflow: hidden; }
.avatar span.edit { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.6); font: 600 9px var(--mono); letter-spacing: .14em; text-align: center; padding: 3px 0; color: var(--ink); }
.who h1 { margin: 0; font-size: 26px; }
.list .num, .total .num { color: var(--heading, var(--ink)); }
.uid { font: 12px var(--mono); color: var(--muted); }
.badge { display: inline-block; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border: 1px solid currentColor; color: var(--accent); }
.badge.dim { color: var(--muted); }
.tabs { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 18px; scrollbar-width: none; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 500 14px var(--ui); padding: 10px 12px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs button.chain { color: var(--accent); }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li b { font-weight: 600; } .list .num { font: 600 18px var(--mono); font-variant-numeric: tabular-nums; color: var(--accent); }
.total { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 0 14px; }
.total .num { font: 700 40px var(--display); letter-spacing: -.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.toggle small { display: block; color: var(--muted); font-size: 13px; }
.switch { appearance: none; width: 46px; height: 26px; border: 1px solid var(--line); background: var(--field); border-radius: 999px; position: relative; cursor: pointer; flex: 0 0 auto; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s; }
.switch:checked { background: var(--accent); border-color: var(--accent); } .switch:checked::after { transform: translateX(20px); background: var(--accent-ink); }
.chain-card { border: 1px solid var(--accent); border-radius: min(var(--radius), 14px); padding: 20px; margin-bottom: 16px; background: var(--panel); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 14px 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s); font: 700 14px var(--mono); color: var(--accent-ink); background: var(--accent); width: 24px; height: 24px; display: grid; place-items: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-top: 12px; }
.check input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--accent); }
.hash { font: 12px var(--mono); word-break: break-all; color: var(--muted); }
.cards .card { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
#dropin { margin-top: 12px; background: #fff; color: #000; padding: 8px; }
@media (prefers-reduced-motion: reduce) { .switch::after { transition: none; } }
