/* Echo — Argo.tools. Oxblood ink on sailcloth paper. */

@font-face { font-family: "Marcellus"; src: url("assets/fonts/Marcellus-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("assets/fonts/Newsreader-Variable.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("assets/fonts/Newsreader-Italic-Variable.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  --oxblood: #8c363f; --sailcloth: #f0ede6; --oxblood-deep: #5e2329; --night: #2a1416;
  --ground: #f0ede6; --ground-raised: #f7f5f0; --ground-sunk: #e6e0d4; --wash: #ebddd8;
  --ink: #3b1a1e; --ink-soft: #6b4447; --accent: #8c363f;
  --rule: #d8ccbf; --rule-strong: #a0807c; --fill: #8c363f; --on-fill: #f0ede6; --focus: #5e2329;
  --paper: url("assets/paper-sailcloth.png");
  --shadow-paper: 0 1px 0 rgba(59,26,30,.10), 0 6px 18px rgba(59,26,30,.08);
  --font-display: Marcellus, "Trajan Pro", "Times New Roman", serif;
  --font-text: Newsreader, Georgia, "Times New Roman", serif;
  --space-hair: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 36px; --space-2xl: 56px; --space-3xl: 88px;
  --radius-sm: 3px; --radius-md: 6px; --radius-pill: 999px;
  --measure: 760px;
  --footer-h: 132px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #2a1416; --ground-raised: #341b1e; --ground-sunk: #211012; --wash: #43242a;
    --ink: #f0ede6; --ink-soft: #cdb9b4; --accent: #e09a9f;
    --rule: #4a2c30; --rule-strong: #8a6266; --fill: #f0ede6; --on-fill: #5e2329; --focus: #f0ede6;
    --paper: url("assets/paper-night.png");
    --shadow-paper: 0 1px 0 rgba(0,0,0,.30), 0 10px 28px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #2a1416; --ground-raised: #341b1e; --ground-sunk: #211012; --wash: #43242a;
  --ink: #f0ede6; --ink-soft: #cdb9b4; --accent: #e09a9f;
  --rule: #4a2c30; --rule-strong: #8a6266; --fill: #f0ede6; --on-fill: #5e2329; --focus: #f0ede6;
  --paper: url("assets/paper-night.png");
  --shadow-paper: 0 1px 0 rgba(0,0,0,.30), 0 10px 28px rgba(0,0,0,.45);
  color-scheme: dark;
}

/* Canopus: true black for OLED screens. Pure #000 ground, borders instead of lighter fills, no paper grain. */
:root[data-theme="canopus"] {
  --ground: #000000; --ground-raised: #120a0b; --ground-sunk: #000000; --wash: #2a1416;
  --ink: #f0ede6; --ink-soft: #c4b2ae; --accent: #e09a9f;
  --rule: #2b1c1e; --rule-strong: #7a5f63; --fill: #f0ede6; --on-fill: #5e2329; --focus: #f0ede6;
  --paper: none;
  --shadow-paper: 0 0 0 1px rgba(240,237,230,.08);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--ground); }
body {
  color: var(--ink);
  font: 400 17px/27px var(--font-text);
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  overflow-x: hidden;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
/* Lining, tabular figures everywhere, inputs included. */
input, textarea, select, button { font: inherit; color: inherit; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.page { max-width: var(--measure); margin: 0 auto; padding: 0 var(--space-md); }
/* Paper grain behind every screen, fixed so it does not scroll or tile. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--paper) center / cover no-repeat; }
.papered { }
/* Echo's logos, drawn as masks so they take the theme's ink. */
.logo-mask { display: block; flex: none; background: var(--accent); -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.logo-h { --src: url("assets/echo-logo-horizontal.svg"); height: 54px; aspect-ratio: 646.6 / 294; }
.logo-s { --src: url("assets/echo-logo.svg"); width: min(220px, 56vw); aspect-ratio: 636.2 / 684; margin: 0 auto var(--space-lg); }
.emark { --src: url("assets/echo-mark.svg"); aspect-ratio: 1120 / 993.6; width: 64px; }
.emark.lg { width: min(200px, 54vw); margin: 0 auto var(--space-lg); }
.brand { margin: 0; line-height: 0; }

/* Type */
.label { font: 400 12px/16px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0; }
.mark { font: 400 15px/20px var(--font-display); letter-spacing: .34em; text-transform: uppercase; color: var(--accent); margin: 0; padding-left: .34em; }
.title { font: 400 40px/46px var(--font-display); color: var(--accent); margin: 0; text-wrap: balance; }
.heading { font: 400 28px/34px var(--font-display); color: var(--accent); margin: 0; text-wrap: balance; }
.subheading { font: 400 21px/27px var(--font-display); color: var(--accent); margin: 0; }
.lead { font-size: 20px; line-height: 31px; margin: 0; }
.small { font-size: 15px; line-height: 23px; color: var(--ink-soft); }
.caption { font-size: 14px; line-height: 20px; font-style: italic; color: var(--ink-soft); }
.lead em, .caption em { font-style: italic; }

/* Buttons */
.btn { font: 600 17px/1 var(--font-text); min-height: 46px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid var(--rule-strong); background: var(--ground-raised); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn svg.i { width: 18px; height: 18px; color: var(--accent); }
.btn.primary { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
.btn.primary svg.i { color: var(--on-fill); }
.btn.quiet { background: none; border-color: transparent; color: var(--accent); padding: 0 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.wide { width: 100%; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: none; color: var(--accent); border-radius: var(--radius-sm); }

/* Banner */
.banner { display: flex; gap: 10px; align-items: flex-start; background: var(--ground-sunk); color: var(--ink); padding: 12px var(--space-md); font-size: 15px; line-height: 22px; border-bottom: 1px solid var(--rule); }
.banner svg.i { color: var(--accent); margin-top: 1px; }
.banner .inner { max-width: var(--measure); margin: 0 auto; display: flex; gap: 10px; width: 100%; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); min-height: 64px; padding-top: env(safe-area-inset-top); }
.topbar .back { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); background: none; border: 0; padding: 0 6px 0 0; min-height: 44px; font-size: 17px; }
.status { font-size: 15px; color: var(--ink-soft); font-style: italic; }

/* Notes list */
.intro { padding: var(--space-lg) 0 var(--space-md); }
.intro .lead { color: var(--ink); }
.search { position: relative; margin: var(--space-xs) 0 var(--space-sm); }
.search svg.i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--accent); pointer-events: none; }
.search input { width: 100%; height: 50px; border-radius: var(--radius-pill); border: 1px solid var(--rule-strong); background: var(--ground-raised); padding: 0 18px 0 48px; font-size: 17px; outline: none; box-shadow: var(--shadow-paper); -webkit-appearance: none; appearance: none; }
input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--ink-soft); font-style: italic; }
.search input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.count { margin: 0 0 var(--space-xs) 4px; }
.list { list-style: none; margin: 0; padding: 0 0 calc(var(--footer-h) + var(--space-lg)); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-sm); padding: 14px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.row:hover { background: color-mix(in srgb, var(--wash) 55%, transparent); }
.row:first-child { border-top: 1px solid var(--rule); }
.row .t { font-weight: 600; font-size: 17px; line-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { font-size: 15px; line-height: 22px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; margin-top: 2px; }
.row .d { font-size: 14px; line-height: 24px; color: var(--ink-soft); white-space: nowrap; text-align: right; }
mark { background: var(--wash); color: inherit; border-bottom: 1.5px solid var(--accent); }

.empty { text-align: center; padding: var(--space-xl) var(--space-md) calc(var(--footer-h) + var(--space-xl)); }
.empty img { width: min(220px, 60vw); height: auto; display: block; margin: 0 auto var(--space-lg); }
.empty .ink-cream { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .empty .ink-ox { display: none; } :root:not([data-theme="light"]) .empty .ink-cream { display: block; } }
:root[data-theme="dark"] .empty .ink-ox, :root[data-theme="canopus"] .empty .ink-ox { display: none; } :root[data-theme="dark"] .empty .ink-cream, :root[data-theme="canopus"] .empty .ink-cream { display: block; }

/* Record footer and the stamp button */
.footer { position: fixed; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--ground) 80%, transparent); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); border-top: 1px solid var(--rule); padding: 14px var(--space-md) calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 5; }
.stamp { position: relative; width: 84px; height: 84px; border: 0; padding: 0; background: none; color: var(--on-fill); display: grid; place-items: center; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.stamp .blob { position: absolute; inset: 0; width: 100%; height: 100%; }
.stamp .blob path { fill: var(--fill); }
.stamp .grain { position: absolute; inset: 6%; border-radius: 50%; background-image: var(--paper); background-size: 180px; mix-blend-mode: soft-light; opacity: .35; pointer-events: none; }
.stamp svg.i { position: relative; width: 32px; height: 32px; stroke-width: 1.9; }
.stamp:active .blob { transform: scale(.97); }
.stamp.big { width: 104px; height: 104px; }
.stamp.big svg.i { width: 38px; height: 38px; }
.stamp[disabled] { opacity: .45; }
.footer .label { color: var(--ink-soft); }

/* Recording sheet */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background-color: var(--wash); background-image: var(--paper); background-size: cover; background-position: center; background-blend-mode: multiply; overflow-y: auto; overscroll-behavior: contain; }
:root[data-theme="dark"] .sheet { background-blend-mode: normal; }
:root[data-theme="canopus"] .sheet { background: var(--ground); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sheet { background-blend-mode: normal; } }
.sheet .page { width: 100%; flex: 1; display: flex; flex-direction: column; padding-top: calc(var(--space-lg) + env(safe-area-inset-top)); padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom)); }
.rec-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); }
.timer { font: 400 44px/48px var(--font-text); color: var(--ink); margin: var(--space-xs) 0 var(--space-md); letter-spacing: .01em; }
.meter { display: flex; align-items: center; gap: 3px; height: 56px; width: 100%; }
.meter span { flex: 1; min-width: 2px; background: var(--accent); border-radius: 1px; height: 4%; opacity: .9; transition: height 90ms linear; }
.paused .meter span { opacity: .35; }
.sea { display: block; width: 100%; height: 200px; margin: 0 0 var(--space-xs); }
.seg { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.seg-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--ground-raised); color: var(--ink); font-size: 16px; }
.seg-btn[aria-checked="true"] { border-color: var(--accent); background: var(--wash); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); font-weight: 600; }
.sw { width: 18px; height: 18px; border-radius: 2px; border: 1px solid var(--rule-strong); flex: none; }
.sw-light { background: linear-gradient(135deg, #f0ede6 50%, #8c363f 50%); }
.sw-dark { background: linear-gradient(135deg, #2a1416 50%, #f0ede6 50%); }
.sw-system { background: linear-gradient(90deg, #f0ede6 50%, #2a1416 50%); }
.sw-canopus { background: #000; position: relative; }
.sw-canopus::after { content: ""; position: absolute; inset: 4px; background: #e09a9f; -webkit-mask: url("assets/star.svg") center / contain no-repeat; mask: url("assets/star.svg") center / contain no-repeat; }

/* Canopus sky: a few faint stars that twinkle now and then. Only in the Canopus theme. */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; display: none; }
:root[data-theme="canopus"] .sky { display: block; }
.sky i { position: absolute; display: block; background: #f0ede6; opacity: .14; border-radius: 50%; }
.sky i.st { border-radius: 0; background: #e09a9f; -webkit-mask: url("assets/star.svg") center / contain no-repeat; mask: url("assets/star.svg") center / contain no-repeat; opacity: 0; animation: twinkle var(--d, 13s) ease-in-out var(--o, 0s) infinite; }
@keyframes twinkle {
  0%, 82%, 100% { opacity: 0; transform: scale(.5); }
  88% { opacity: .75; transform: scale(1); }
  93% { opacity: .25; transform: scale(.8); }
}
@media (prefers-reduced-motion: reduce) { .sky i.st { animation: none; opacity: .3; transform: none; } }
.live { white-space: pre-wrap; }
.cmd-list { margin: var(--space-xs) 0 0; font-size: 15px; line-height: 22px; }
.cmd-list dt { color: var(--ink); font-style: italic; padding-top: 8px; border-top: 1px solid var(--rule); }
.cmd-list dt:first-child { border-top: 0; padding-top: 0; }
.cmd-list dd { margin: 0 0 8px; color: var(--ink-soft); }
.live { flex: 1; min-height: 120px; margin: var(--space-lg) 0; font-size: 20px; line-height: 31px; overflow-wrap: anywhere; }
.live .interim { color: var(--ink-soft); font-style: italic; }
.live .hint { color: var(--ink-soft); font-style: italic; font-size: 17px; }
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-sm); }
.controls .left { justify-self: start; } .controls .right { justify-self: end; }
.finishing { display: flex; flex-direction: column; gap: var(--space-xs); }
.bar { height: 6px; background: var(--ground-sunk); border-radius: 1px; overflow: hidden; border: 1px solid var(--rule); }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* Note */
.note-title { display: block; width: 100%; border: 0; background: none; font: 600 26px/34px var(--font-text); color: var(--ink); padding: 4px 0; outline: none; border-bottom: 1px solid transparent; resize: none; overflow: hidden; overflow-wrap: anywhere; }
.note-title:focus-visible { outline: none; border-bottom-color: var(--rule-strong); }
.meta { margin: 2px 0 var(--space-md); }
.body { width: 100%; min-height: 40vh; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--ground-raised); padding: var(--space-md); font-size: 17px; line-height: 27px; resize: vertical; outline: none; box-shadow: var(--shadow-paper); overflow-wrap: anywhere; }
.body:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: var(--space-md) 0; }
.wave { display: block; width: 100%; max-width: 488px; height: 28px; margin: var(--space-xl) 0 var(--space-lg); background: var(--accent); -webkit-mask: url("assets/wave-rule.svg") no-repeat left center / contain; mask: url("assets/wave-rule.svg") no-repeat left center / contain; }
details.orig summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; }
details.orig summary::-webkit-details-marker { display: none; }
details.orig summary svg.i { width: 16px; height: 16px; color: var(--accent); transition: transform .15s; }
details.orig[open] summary svg.i { transform: rotate(90deg); }
details.orig .orig-text { margin: var(--space-xs) 0 0; padding: var(--space-md); background: var(--ground-sunk); border-radius: var(--radius-sm); font-size: 15px; line-height: 23px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-foot { padding-bottom: calc(var(--space-2xl) + env(safe-area-inset-bottom)); }

/* Setup */
.setup { text-align: center; padding-top: calc(var(--space-2xl) + env(safe-area-inset-top)); padding-bottom: var(--space-2xl); }
.setup .odi { width: min(200px, 56vw); height: auto; display: block; margin: 0 auto var(--space-lg); }
.setup .odi.cream { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .setup .odi.ox { display: none; } :root:not([data-theme="light"]) .setup .odi.cream { display: block; } }
:root[data-theme="dark"] .setup .odi.ox, :root[data-theme="canopus"] .setup .odi.ox { display: none; } :root[data-theme="dark"] .setup .odi.cream, :root[data-theme="canopus"] .setup .odi.cream { display: block; }
.setup .mark { margin-bottom: var(--space-sm); }
.setup .lead { margin: var(--space-xs) 0 var(--space-lg); }
.setup p.body-copy { text-align: left; margin: 0 0 var(--space-md); }
.choices { display: grid; gap: var(--space-sm); margin: var(--space-md) 0 var(--space-lg); text-align: left; }
.choice { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-sm); align-items: start; padding: var(--space-md); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--ground-raised); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--wash); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input { margin: 5px 0 0; accent-color: var(--oxblood); width: 18px; height: 18px; }
.choice .n { font-weight: 600; }
.choice .z { font-size: 15px; color: var(--ink-soft); white-space: nowrap; }
.progress { text-align: left; margin: var(--space-md) 0; }
.progress .nums { display: flex; justify-content: space-between; gap: var(--space-sm); margin-top: 6px; }

/* Settings */
.section { padding: var(--space-lg) 0; border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: 0; }
.section .label { margin-bottom: var(--space-xs); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--space-md); font-size: 15px; line-height: 23px; margin: var(--space-xs) 0; }
.kv dt { color: var(--ink-soft); } .kv dd { margin: 0; text-align: right; }
.field { display: flex; flex-direction: column; gap: 6px; margin: var(--space-sm) 0; }
select { height: 46px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--ground-raised); padding: 0 12px; font-size: 17px; max-width: 100%; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); min-height: 44px; }
.switch input { width: 20px; height: 20px; accent-color: var(--oxblood); }
.signoff { padding: var(--space-xl) 0 calc(var(--space-2xl) + env(safe-area-inset-bottom)); text-align: center; }
.signoff .wm { width: 132px; height: 51px; display: block; margin: 0 auto var(--space-sm); background: var(--accent); -webkit-mask: url("assets/argo-wordmark.svg") no-repeat center / contain; mask: url("assets/argo-wordmark.svg") no-repeat center / contain; }

/* Dialog and toast */
dialog { border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--ground-raised); color: var(--ink); padding: var(--space-lg); max-width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-paper); }
dialog::backdrop { background: rgba(42, 20, 22, .45); }
dialog h2 { margin: 0 0 var(--space-xs); }
dialog p { margin: 0 0 var(--space-md); }
dialog .row-btns { display: flex; gap: var(--space-xs); justify-content: flex-end; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: calc(var(--footer-h) + 12px); transform: translateX(-50%); max-width: calc(100vw - 32px); background: var(--fill); color: var(--on-fill); padding: 10px 18px; border-radius: var(--radius-sm); font-size: 15px; z-index: 40; box-shadow: var(--shadow-paper); }
.toast.low { bottom: calc(24px + env(safe-area-inset-bottom)); }

.panel { background: var(--ground-raised); border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: var(--space-md); box-shadow: var(--shadow-paper); margin: var(--space-lg) 0; }
.panel ol { padding-left: 1.3em; margin: var(--space-xs) 0 var(--space-md); }
.panel li { margin: 4px 0; }

@media (min-width: 640px) {
  .page { padding: 0 var(--space-lg); }
  .title { font-size: 48px; line-height: 54px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.signoff .emark { margin: 0 auto var(--space-sm); width: 72px; }

/* ---- account: lock screens ---- */
.lock { max-width: 460px; padding-top: calc(var(--space-2xl) + env(safe-area-inset-top)); padding-bottom: var(--space-2xl); display: flex; flex-direction: column; gap: var(--space-sm); }
.lock.wide { max-width: 560px; }
.lock-logo { margin: 0 0 var(--space-sm); }
.lock-logo .logo-s { width: min(150px, 40vw); margin: 0 auto; }
.lock .heading { margin: 0; text-align: left; }
.lock-text { margin: 0; }
.lock-form { display: flex; flex-direction: column; gap: var(--space-sm); margin: var(--space-xs) 0 0; }
.lock-form .field, dialog .field { margin: 0; }
.field input[type="password"], .field input[type="text"], .field input[type="email"] { height: 48px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--ground-raised); padding: 0 14px; font-size: 17px; width: 100%; outline: none; -webkit-appearance: none; appearance: none; }
.field input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lock-error { margin: 0; color: var(--accent); font-weight: 600; font-size: 15px; line-height: 22px; }
.lock-actions { margin: var(--space-xs) 0 0; }
.lock-actions.row { display: flex; gap: var(--space-xs); }
.lock-links { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: 0; }
.lock-links .btn.quiet { padding-left: 0; }
.recovery { margin: var(--space-xs) 0 0; padding: var(--space-md); background: var(--ground-raised); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); font: 600 19px/32px var(--font-text); letter-spacing: .06em; word-spacing: .2em; text-align: center; overflow-wrap: anywhere; user-select: all; }
.switch.tick { justify-content: flex-start; gap: var(--space-sm); }
.switch.tick input { order: -1; }
.pin-field input, .lock .pin-field input[type="password"] { letter-spacing: .5em; text-align: center; font-size: 24px; height: 56px; }
.lock .pin-dots { display: none; }
.pin-dots { display: flex; gap: 16px; justify-content: center; margin: var(--space-md) 0 var(--space-xs); cursor: text; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--accent); }
.pin-dots i.on { background: var(--accent); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .pin-dots.shake { animation: none; } }

/* ---- account: settings and admin ---- */
.kv dd.email, .person .email { overflow-wrap: anywhere; }
.usage { margin: var(--space-xs) 0; }
.usage .bar { height: 8px; }
.usage p { margin: 4px 0 0; }
.devices, .audit { list-style: none; margin: var(--space-xs) 0 0; padding: 0; }
.devices li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); padding: 8px 0; border-bottom: 1px solid var(--rule); }
.audit li { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.audit .when { display: block; color: var(--ink-soft); font-size: 13px; }
.invite { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-sm); align-items: end; margin: 0 0 var(--space-xs); }
.invite .field:first-child { grid-column: 1 / -1; }
.invite .switch { grid-column: 1 / -1; }
.invite button { justify-self: start; }
.people { display: flex; flex-direction: column; gap: var(--space-sm); margin: var(--space-md) 0; }
.person { background: var(--ground-raised); border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: var(--space-md); box-shadow: var(--shadow-paper); min-width: 0; }
.person.paused { opacity: .75; }
.person-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { font: 400 11px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--rule-strong); border-radius: var(--radius-pill); padding: 5px 9px 4px; color: var(--ink-soft); }
.person .actions { margin: var(--space-sm) 0 0; align-items: center; }
.person select { height: 46px; }
#count[data-sync] { }

/* ---- version and changelog ---- */
.version-link { background: none; border: 0; padding: 8px 4px; min-height: 44px; font: italic 400 14px/20px var(--font-text); color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.version-link:hover { color: var(--accent); }
.release { padding: var(--space-lg) 0; border-bottom: 1px solid var(--rule); }
.release:last-child { border-bottom: 0; }
.release-head { display: flex; align-items: baseline; gap: var(--space-sm); flex-wrap: wrap; }
.release .ver { font: 600 17px/24px var(--font-text); color: var(--ink); }
.release.current .ver::after { content: "This version"; margin-left: 10px; font: 400 11px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--accent); color: var(--accent); border-radius: var(--radius-pill); padding: 4px 8px 3px; vertical-align: 2px; }
.release .when { font-size: 14px; color: var(--ink-soft); }
.release .subheading { margin: 4px 0 var(--space-xs); }
.release ul { margin: 0; padding-left: 1.2em; }
.release li { margin: 4px 0; }

/* ---- sign-in and admin dashboard ---- */
.pw { position: relative; display: block; }
.pw input { padding-right: 64px !important; }
.pw-show { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 40px; padding: 0 10px; border: 0; background: none; color: var(--accent); font: 600 14px/1 var(--font-text); }
.field select { width: 100%; }
.mono { font-variant-numeric: lining-nums tabular-nums; letter-spacing: .02em; overflow-wrap: anywhere; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-sm); margin: var(--space-md) 0 var(--space-xs); }
.tile { background: var(--ground-raised); border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: var(--space-md); box-shadow: var(--shadow-paper); min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tile .label { color: var(--ink-soft); }
.tile-n { margin: 0; font: 600 30px/34px var(--font-text); color: var(--ink); }
.tile .bar { height: 6px; }
.tile .small { margin: 0; }
.add-user { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-sm); align-items: end; margin-top: var(--space-sm); }
.add-user .switch, .add-user .lock-error, .add-user > button { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 520px) { .add-user { grid-template-columns: minmax(0, 1fr); } }
.creds { margin: var(--space-md) 0 0; padding: var(--space-md); background: var(--wash); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); }
.creds .kv dd { font-weight: 600; }
.chip.warn { border-color: var(--accent); color: var(--accent); }
.person-head .mono { color: var(--ink-soft); }
.reset-out:empty { display: none; }
