/* IO PATINA HereQ — shared web styles. One UX, two visual themes (design/VISUAL_DIRECTION.md, DESIGN.md):
   Light "Calm Utility" and Dark "Ink & Gold". No inline styles (CSP style-src 'self').
   Brand source values: Deep Ink #0F1114, Paper #F3F1ED, Bronze #7C5F3E (light accent), Portal Gold #C8B092 (dark
   accent and dark primary fill). Every other value is a HereQ-local semantic role from the owner's Two-Theme Spec v1.0,
   checked by e2e/capture/token-check.py. Gold marks action, selection and focus only — never a status. Semantic states
   (ok / warn / bad / info) are separate hues and always come with a word and a glyph. `--info` is HereQ-local: the
   "awaiting review" state. The appearance preference (System / Light / Dark) lives in theme.js; System follows the OS. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/archivo-latin.woff2") format("woff2"); }
@font-face { font-family: "Martian Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("fonts/martian-mono-latin.woff2") format("woff2"); }

:root {
  --bg: #f3f1ed; --surface: #ffffff; --sunken: #f7f5f2; --rule: #d3d0cb; --hairline: #e4e1dc; --control-edge: #827e77;
  --text: #0f1114; --body: #4a4c4e; --muted: #5a5c5a;
  --accent: #7c5f3e; --accent-wash: #f4eee6; --focus: #7c5f3e; --selected: #7c5f3e;
  --action: #0f1114; --action-ink: #f3f1ed; --action-hover: #5e4730;
  --ok: #216644; --ok-soft: #eaf3ee; --ok-edge: #a9cdb9;
  --warn: #76511a; --warn-soft: #f7f0e3; --warn-edge: #d9c29a;
  --bad: #aa2838; --bad-soft: #faebec; --bad-edge: #e2afb5;
  --info: #245b78; --info-soft: #e9f1f6; --info-edge: #a9c5d8;
  --pending: var(--info); --pending-soft: var(--info-soft);
  --qr-bg: #ffffff; --scrim: rgb(15 17 20 / 55%);
  --radius: 14px; --radius-sm: 10px; --radius-xs: 6px;
  --shadow: 0 1px 2px rgb(15 17 20 / 7%);
  --ui: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", Roboto, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
/* Ink & Gold. Declared twice on purpose: once for System (OS dark, no override) and once for an explicit Dark choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1114; --surface: #171a1f; --sunken: #1e2227; --rule: #41474f; --hairline: #2a2f36; --control-edge: #6b727b;
    --text: #f3f1ed; --body: #c3c6cb; --muted: #a9adb3;
    --accent: #c8b092; --accent-wash: #2a261f; --focus: #c8b092; --selected: #c8b092;
    --action: #c8b092; --action-ink: #0f1114; --action-hover: #d9c6ab;
    --ok: #7bd3a5; --ok-soft: #13231b; --ok-edge: #2f5a44;
    --warn: #f3c36b; --warn-soft: #261e0f; --warn-edge: #5e4a22;
    --bad: #ff9fa4; --bad-soft: #2a1517; --bad-edge: #6a3036;
    --info: #9bc5eb; --info-soft: #132131; --info-edge: #2f4d6a;
    --scrim: rgb(0 0 0 / 65%); --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1114; --surface: #171a1f; --sunken: #1e2227; --rule: #41474f; --hairline: #2a2f36; --control-edge: #6b727b;
  --text: #f3f1ed; --body: #c3c6cb; --muted: #a9adb3;
  --accent: #c8b092; --accent-wash: #2a261f; --focus: #c8b092; --selected: #c8b092;
  --action: #c8b092; --action-ink: #0f1114; --action-hover: #d9c6ab;
  --ok: #7bd3a5; --ok-soft: #13231b; --ok-edge: #2f5a44;
  --warn: #f3c36b; --warn-soft: #261e0f; --warn-edge: #5e4a22;
  --bad: #ff9fa4; --bad-soft: #2a1517; --bad-edge: #6a3036;
  --info: #9bc5eb; --info-soft: #132131; --info-edge: #2f4d6a;
  --scrim: rgb(0 0 0 / 65%); --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.5 var(--ui); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); text-underline-offset: .18em; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.01em; margin: 4px 0 12px; }
h2 { font-size: 19px; line-height: 1.3; margin: 0; }
h3 { font-size: 16px; margin: 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 560px; }

/* ------------------------------------------------------------- app bar */
header.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; min-height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--hairline); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; text-decoration: none; color: var(--text); }
.brand .product { font-weight: 750; font-size: 19px; letter-spacing: -.015em; }
.brand .surface { font-weight: 550; font-size: 14px; color: var(--muted); }
.brand .endorse { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bar-actions { display: flex; align-items: center; gap: 8px; }
.who { color: var(--muted); font-size: 14px; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .brand .endorse { display: none; }
  header.bar { padding: 6px 12px; }
}

/* ------------------------------------------------------------- layout */
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 24px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.scan-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) {
  .grid2, .scan-layout { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 > :last-child:nth-child(odd) { grid-column: 1 / -1; } /* an odd last tile takes the full row */
}
/* Narrow screens: the five session tabs fit one row; the seven admin tabs wrap (every tab visible, none clipped). */
@media (max-width: 560px) {
  .tabs button { padding: 10px 9px; font-size: 15px; }
  .tabs.wrap { flex-wrap: wrap; overflow-x: visible; }
}
.section-label { font: 600 11px/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
.hidden { display: none !important; }
/* Korean: break between words, not inside them; small caps labels read badly in Hangul, so they use the UI face. */
:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
:lang(ko) .section-label, :lang(ko) .candidate .eyebrow { font: 700 13px/1.3 var(--ui); letter-spacing: 0; text-transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------- surfaces */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h2, .card h3 { margin: 0 0 4px; }
.card.flat { box-shadow: none; }
button.card { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; min-height: 64px; }
button.card:hover { border-color: var(--accent); }
.muted { color: var(--muted); }
.body { color: var(--body); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.big { font-size: 22px; font-weight: 700; line-height: 1.25; }
.num, .mono { font-variant-numeric: tabular-nums; }
td.num, td.mono { white-space: nowrap; } /* an ID never breaks (leading zeros matter) */
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--body); margin: 6px 0 0; padding: 0; list-style: none; }
.facts b { color: var(--text); font-weight: 600; }
.session-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; margin-bottom: 12px; }
.session-head h1 { margin: 0; }

/* ------------------------------------------------------------- controls */
button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--control-edge); background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: var(--radius-sm); cursor: pointer; min-height: 44px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color .12s ease, border-color .12s ease; }
button:hover, .btn:hover { border-color: var(--accent); background: var(--accent-wash); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; }
[aria-invalid="true"] { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
[aria-invalid="true"]:focus-visible { outline-color: var(--bad); } /* the error stays visible while the field has focus */
button.primary, .btn.primary { background: var(--action); color: var(--action-ink); border-color: var(--action); }
button.primary:hover, .btn.primary:hover { background: var(--action-hover); border-color: var(--action-hover); color: var(--action-ink); }
button.danger { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
button.danger:hover { background: var(--bad-soft); border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
button.quiet, .btn.quiet { border-color: transparent; background: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: .2em; padding-inline: 8px; }
button.quiet:hover, .btn.quiet:hover { background: var(--accent-wash); }
button.huge, .btn.huge { width: 100%; min-height: 56px; font-size: 18px; }
button:disabled, button:disabled:hover { opacity: .5; cursor: not-allowed; background: var(--surface); border-color: var(--rule); color: var(--text); }
button.primary:disabled { background: var(--action); color: var(--action-ink); }
.actions { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.actions .row > * { flex: 1 1 auto; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--control-edge);
  border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; width: 100%; }
input[type="file"] { padding: 8px; }
input::placeholder { color: var(--muted); opacity: 1; }
label { display: block; font-size: 14px; font-weight: 550; color: var(--body); margin-bottom: 4px; }
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.field { margin-bottom: 12px; }
details > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; color: var(--text); }
details.panel { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 0 14px; background: var(--surface); }
details.panel[open] { padding-bottom: 14px; }

/* ------------------------------------------------------------- status (word + colour, never colour alone) */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 600;
  border: 1px solid var(--rule); background: var(--sunken); color: var(--text); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.plain::before { display: none; }
.pill.ok::before, .pill.warn::before, .pill.bad::before, .pill.info::before, .pill.pending::before,
:is(.notice, .result).ok::before, :is(.notice, .result).warn::before, :is(.notice, .result).bad::before, :is(.notice, .result):is(.info, .pending)::before {
  content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 0; background: currentColor; flex: none; vertical-align: -1px;
  -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat; }
/* notices: the glyph sits in a left gutter whatever the content; results: above the title, larger */
.notice:is(.ok, .warn, .bad, .info, .pending) { position: relative; padding-left: 38px; }
.notice:is(.ok, .warn, .bad, .info, .pending)::before { position: absolute; left: 14px; top: 15px; width: 14px; height: 14px; }
.result:is(.ok, .warn, .bad, .pending)::before { display: block; width: 26px; height: 26px; margin: 0 auto 6px; }
.ok { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 6.5l3 3 6-7' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.warn { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 1.2L11.2 10.8H.8z' fill='none' stroke='%23000' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M6 4.6v2.8M6 9v.1' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.bad { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 2l8 8M10 2l-8 8' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.info, .pending { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Cpath d='M6 3v3.2l2 1.3' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-edge); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-edge); }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-edge); }
.pill.pending, .pill.info { background: var(--info-soft); color: var(--info); border-color: var(--info-edge); }
.notice { border-radius: var(--radius-sm); padding: 12px 14px; background: var(--sunken); border: 1px solid var(--rule); color: var(--text); }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-edge); }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-edge); }
.notice.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-edge); }
.notice.pending, .notice.info { background: var(--info-soft); color: var(--info); border-color: var(--info-edge); }
.notice strong { display: block; margin-bottom: 2px; }

/* ------------------------------------------------------------- results and receipts */
.result { border-radius: var(--radius); padding: 20px 16px; text-align: center; border: 1px solid var(--rule); background: var(--sunken); }
.result .big { font-size: 26px; font-weight: 750; }
.result .time { font: 600 22px/1.3 var(--mono); color: var(--text); margin-top: 4px; font-variant-numeric: tabular-nums; }
.result .sub { color: var(--body); font-size: 14px; margin-top: 6px; }
.result.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-edge); }
.result.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-edge); }
.result.pending { background: var(--info-soft); color: var(--info); border-color: var(--info-edge); }
.result.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-edge); }
.result .actions { margin-top: 14px; }

/* ------------------------------------------------------------- tabs, stats, tables */
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--rule); margin: 8px 0 16px; scrollbar-width: thin; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--body); font-weight: 550; padding: 10px 12px; white-space: nowrap; }
.tabs button:hover { background: var(--accent-wash); border-color: transparent; border-bottom-color: var(--rule); }
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 700; border-bottom-color: var(--selected); }
.tabs button:focus-visible { outline-offset: -3px; }
.stat { background: var(--sunken); border-radius: var(--radius-sm); padding: 12px 14px; }
.stat .v { font: 600 24px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.stat .v.text { font: 700 20px/1.5 var(--ui); }
.stat .k { color: var(--body); font-size: 13px; }
.stat.warn { background: var(--warn-soft); color: var(--warn); }
.stat.warn .k { color: var(--warn); }
.stat.info { background: var(--info-soft); color: var(--info); }
.stat.info .k { color: var(--info); }
.progress { height: 8px; border-radius: 8px; background: var(--sunken); overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: var(--ok); width: 0; transition: width .4s ease; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.scroll-x { overflow-x: auto; }
.steps { display: flex; list-style: none; margin: 0 0 14px; padding: 0; font-size: 14px; }
.steps li { flex: 1; padding: 8px 6px; border-bottom: 3px solid var(--hairline); color: var(--muted); }
.steps li.done { border-bottom-color: var(--ok-edge); color: var(--ok); }
.steps li[aria-current="step"] { border-bottom-color: var(--text); color: var(--text); font-weight: 650; }
.choice { display: flex; gap: 12px; align-items: flex-start; justify-content: flex-start; width: 100%; text-align: left; font-weight: 400; padding: 12px 14px; }
.choice .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--control-edge); flex: none; margin-top: 3px; }
.choice[aria-pressed="true"] { border-color: var(--selected); box-shadow: inset 0 0 0 1px var(--selected); background: var(--surface); }
.choice[aria-pressed="true"] .dot { border: 6px solid var(--selected); }
.choice strong { display: block; }
.choice span.body { display: block; }

/* ------------------------------------------------------------- scanner */
.video-box { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; max-height: 46vh; width: 100%; }
.video-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-box .frame { position: absolute; inset: 18% 12%; border: 3px solid rgba(255,255,255,.9); border-radius: 12px; box-shadow: 0 0 0 999px rgb(0 0 0 / 25%); }
.candidate { border: 2px solid var(--selected); }
.candidate .eyebrow { font: 600 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--body); }
.candidate .big { font-size: 24px; margin-top: 4px; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); min-height: 48px; color: var(--text); font-size: 16px; font-weight: 400; margin: 0; }
.member input[type="checkbox"] { width: 24px; height: 24px; min-height: 0; flex: none; accent-color: var(--action); }

/* ------------------------------------------------------------- QR, pass, projector */
.qr-box { background: var(--qr-bg); padding: 16px; border-radius: var(--radius); display: inline-block; line-height: 0; border: 1px solid var(--rule); }
.qr-box svg { width: min(72vmin, 520px); height: auto; }
.pass svg { width: min(74vw, 320px); }
.center { display: flex; justify-content: center; }
.projector { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px; text-align: center; }
.projector h1 { font-size: clamp(28px, 4vw, 56px); margin: 0; }
.projector .count { font-size: clamp(18px, 2.2vw, 30px); color: var(--body); margin: 0; }
.projector .code { font: 600 clamp(36px, 7vw, 96px)/1.1 var(--mono); letter-spacing: .08em; }
.projector .brandline { position: fixed; bottom: 16px; left: 0; right: 0; font-size: 14px; color: var(--muted); }
.meter { height: 6px; background: var(--sunken); border-radius: 6px; overflow: hidden; width: min(72vmin, 520px); }
.meter > div { height: 100%; background: var(--text); width: 100%; transition: width 1s linear; }

/* ------------------------------------------------------------- entry page (/) */
.entry h1 { font-size: clamp(34px, 6vw, 48px); margin: 8px 0 6px; letter-spacing: -.02em; }
.entry .lede { font-size: 19px; color: var(--body); margin: 0 0 24px; max-width: 40ch; }
.entry .doors { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.entry .door { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); padding: 18px; min-height: 0; }
.entry .door strong { font-size: 18px; }
.entry .door strong::after { content: " →"; color: var(--accent); }
.entry .door span { color: var(--body); font-size: 15px; }
.entry .door:hover { border-color: var(--accent); }
.entry .ways { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.entry .ways h3 { font-size: 17px; margin-bottom: 4px; }
.entry .ways p { margin: 0; color: var(--body); }
@media (max-width: 760px) { .entry .doors, .entry .ways { grid-template-columns: 1fr; } }
footer.foot { color: var(--muted); font-size: 13px; padding: 28px 16px; text-align: center; }
footer.foot .lockup { display: block; margin: 0 auto 8px; height: 22px; width: auto; }
footer.foot .lockup.on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) footer.foot .lockup.on-light { display: none; }
  :root:not([data-theme="light"]) footer.foot .lockup.on-dark { display: block; }
}
:root[data-theme="dark"] footer.foot .lockup.on-light { display: none; }
:root[data-theme="dark"] footer.foot .lockup.on-dark { display: block; }

/* ------------------------------------------------------------- account menu and personal settings */
details.account { position: relative; }
details.account > summary { list-style: none; min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 550; font-size: 14px; }
details.account > summary::-webkit-details-marker { display: none; }
details.account > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
details.account > summary:hover { background: var(--accent-wash); }
details.account .who { color: var(--text); }
details.account .who-short { display: none; }
@media (max-width: 560px) { details.account .who { display: none; } details.account .who-short { display: inline; } } /* after the base rule */
.account-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 200px; display: grid; padding: 6px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgb(0 0 0 / 18%); }
.account-menu button { justify-content: flex-start; width: 100%; text-decoration: none; color: var(--text); }
.settings fieldset { border: 0; padding: 0; margin: 0; }
.settings legend { padding: 0; margin-bottom: 8px; }
.choice input[type="radio"] { width: 22px; height: 22px; min-height: 0; flex: none; margin: 2px 0 0; accent-color: var(--action); }
label.choice { cursor: pointer; margin: 0; color: var(--text); }
label.choice:has(input:checked) { border-color: var(--selected); box-shadow: inset 0 0 0 1px var(--selected); }
label.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ------------------------------------------------------------- dialog (replaces prompt / confirm / alert) */
dialog.dialog { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 20px;
  width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 12px 40px rgb(0 0 0 / 25%); }
dialog.dialog::backdrop { background: var(--scrim); }
dialog.dialog h2 { margin: 0 0 6px; }
dialog.dialog .actions { flex-direction: row-reverse; flex-wrap: wrap; justify-content: flex-start; }
dialog.dialog .actions > * { flex: 1 1 auto; }
textarea { min-height: 88px; resize: vertical; }
fieldset.days { border: 0; padding: 0; margin: 0 0 12px; }
fieldset.days legend { font-size: 14px; font-weight: 550; color: var(--body); padding: 0; margin-bottom: 4px; }
.entry .mark { width: 64px; height: 64px; border-radius: 15px; display: block; }

@media (prefers-reduced-motion: reduce) {
  .meter { display: none; } /* the pass and projector say the refresh interval in words */
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .meter > div { transition: none !important; }
}
@media (forced-colors: active) {
  .pill, .notice, .result, .card, dialog.dialog { border: 1px solid CanvasText; }
  .pill::before, .notice > strong:first-child::before { background: CanvasText; }
}
