/* Hallmark · shape: app screen · genre: modern-minimal · theme: el zone auth (by request, the indigo and Fira Mono of auth.el.zone, set flat and tighter) · scope: app
 * nav: one bar, the white wordmark block left, sign in right · footer: none · signature: the pass (the way in: white wordmark field with the route's steps, the form on indigo, two-factor as its second step) and the directory, one list of doors, each card with its address and how you get in (open or free account), closed by the account split card under its white tab · states: full, empty groups drop out, signed in; also auth.el.zone/account, private apps first, and the signed-in auth screens (settings, two-factor setup and check, welcome): sections as borderless wells of value rows, every edit in a split modal card (explanation left under a white tab, fields right), silent success and error toasts · redesign: full (auth app screens, second pass)
 * axes: dark/mono/cool · posture: restrained · surface: solid indigo, the auth gradient dropped (2a) · contrast: pass · v2.0.0 */
/* Hallmark · dismissed F4 · the filled danger button lives only in the delete and remove confirm modals, where it is that dialog's one action and no solid primary sits beside it */
/* Hallmark · pre-emit critique: P3 H4 E4 S4 R5 V3 · weakest: V, a grid of link cards is the category's own answer; the white account panel inverts the wordmark block so the one action reads apart from the doors */
:root {
  color-scheme: dark;
  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px;
  --text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.125rem; --text-xl: 1.5rem; --text-2xl: 1.75rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 120ms; --dur-short: 220ms;
  --page-width: 960px; --gutter: var(--space-md); --ctl-h: 44px; --field-h: 40px; --btn-h-sm: 36px; --narrow-width: 26rem; --app-width: 880px; --label-col: 13rem; --dur-long: 360ms; --ease-in: cubic-bezier(0.5, 0, 0.75, 0);
  --z-sticky-nav: 300; --z-toast: 500;
  --radius-card: 6px; --radius-ctl: 4px;

  --color-paper: #1A2A80;
  --color-paper-2: #213290;
  --color-paper-3: #2A3A9C;
  --color-ink: #F4F3FF;
  --color-ink-2: #B2B0E8;
  --color-muted: #9AA2D6;
  --color-rule: #3A4A9E;
  --color-edge: #7A85C1;
  --color-accent: #A5A0FF;
  --color-accent-ink: #1A2A80;
  --color-focus: #C9C6FF;
  --color-error: #FFAB91;
  --color-error-dim: #3A2F7A;
  --color-accent-hi: #BEBAFF;
  --color-accent-press: #918BF2;
  --color-scrim: rgba(9, 14, 52, 0.72);
  --color-well: #1F2F8A;
  --color-well-hover: #25368F;
  --color-hairline: #2B3B95;
  --color-modal: #1F2F8A;
  --shadow-modal: 0 32px 80px -24px rgba(4, 8, 32, 0.75);
  --shadow-toast: 0 12px 32px -12px rgba(6, 10, 40, 0.7);
  --color-sunk: #16246F;
  --color-modal-edge: #33439D;
  --color-error-wash: #34296E;
  --color-error-ink: #FFD6C9;
  --i-chev-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23B2B0E8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.25 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E");
  --i-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23FFAB91' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M8 4.75v3.75M8 11.1v.15'/%3E%3C/svg%3E");
  --i-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23A5A0FF' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m5.5 8.2 1.75 1.75L10.6 6.4'/%3E%3C/svg%3E");

  --color-sheet: #F7F7FD;
  --color-sheet-ink: #1A2A80;
  --color-sheet-ink-2: #3F4687;
  --color-sheet-rule: #D9D8F2;
  --color-sheet-chip: #ECEBFA;
  --color-sheet-focus: #3B38A0;

  --primary-bg: #3B38A0;
  --primary-bg-hover: #2E2B88;
  --primary-bg-active: #24217A;
  --primary-ink: #FFFFFF;

  --font-body: 'Fira Mono', ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.5;
}
a { color: inherit; }
::selection { background: var(--color-accent); color: var(--color-accent-ink); }
html { scrollbar-color: var(--color-edge) var(--color-paper); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

.page { width: 100%; max-width: var(--page-width); margin: 0 auto; padding: 0 var(--gutter); }

/* the wordmark block, as on auth */
.mark {
  display: inline-block;
  background: var(--color-sheet);
  color: var(--color-sheet-ink);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-sm);
  line-height: 1.1;
  text-decoration: none;
}
.mark b { display: block; font-size: var(--text-xl); letter-spacing: 0.08em; }
.mark--lg { padding: var(--space-lg) calc(var(--space-lg) + var(--space-xs)); font-size: var(--text-2xl); }
.mark--lg b { font-size: 3.5rem; letter-spacing: 0.07em; line-height: 1; }
a.mark { transition: background-color var(--dur-micro) var(--ease-out); }
a.mark:hover { background: var(--color-sheet-chip); }
a.mark:active { background: var(--color-sheet-rule); }

/* landing */
.landing { min-height: 100dvh; display: grid; place-items: center; text-align: center; padding: var(--space-xl) 0; }
.landing-inner { display: grid; justify-items: center; gap: var(--space-lg); }
.landing-line { margin: 0; font-size: var(--text-lg); }
.enter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--ctl-h);
  padding: 0 var(--space-2xs);
  color: var(--color-ink);
  font-size: var(--text-xl);
  text-decoration: none;
}
.enter::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: var(--space-2xs);
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-short) var(--ease-out);
}
.enter:hover::after, .enter:focus-visible::after { transform: scaleX(1); }
.enter:active { color: var(--color-accent); }
.enter-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-short) var(--ease-out); }
.enter:hover .enter-icon { transform: translateX(4px); }
.mail { margin: 0; padding: var(--space-sm) var(--space-lg); background: var(--color-paper-2); font-size: var(--text-sm); }
.mail-at { color: var(--color-accent); margin: 0 var(--space-3xs); }
.mail-domain { color: var(--color-ink); }

/* the directory, shown when #zone is the target */
.zone { display: none; padding: var(--space-lg) 0 var(--space-2xl); }
.zone:target { display: block; animation: zone-in var(--dur-short) var(--ease-out); }
body:has(#zone:target) .landing { display: none; }
.zone--page { display: block; }
@keyframes zone-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }


/* account page: groups of cards, and the flash line */
.group + .group { margin-top: var(--space-2xl); }
.app .group-head h2 { font-size: var(--text-md); }
.group-head { margin-bottom: var(--space-md); }
.group-head h2 { margin: 0 0 var(--space-2xs); color: var(--color-ink); font-size: var(--text-lg); font-weight: 700; line-height: 1.3; }
.group-head p { margin: 0; font-size: var(--text-sm); }
.alert { display: flex; align-items: center; gap: var(--space-sm); margin: 0 0 var(--space-xl); padding: var(--space-sm) var(--space-md); border: 1px solid var(--color-modal-edge); background: var(--color-sunk); color: var(--color-ink); font-size: var(--text-sm); line-height: 1.5; }
.alert::before { content: ""; flex-shrink: 0; width: 10px; height: 10px; background: var(--color-accent); }
.alert p { margin: 0; }
.alert-error::before { background: var(--color-error); }

.zone-head { margin: var(--space-2xl) 0 var(--space-xl); }
.zone-head h1 { margin: 0 0 var(--space-xs); color: var(--color-ink); font-size: var(--text-2xl); font-weight: 700; line-height: 1.2; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
.zone-head p { margin: 0; }


.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); }
.card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-2xs);
  height: 100%;
  padding: var(--space-md);
  background: var(--color-well);
  color: var(--color-ink-2);
  border: 1px solid transparent;
  border-radius: var(--radius-card);
  text-decoration: none;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.card:hover { background: var(--color-well-hover); }
.card:active { background: var(--color-paper-2); }
.card-name { padding-right: var(--space-lg); color: var(--color-ink); font-size: var(--text-lg); font-weight: 700; }
.card-desc { align-self: start; padding-right: var(--space-xs); color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.45; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2xs) var(--space-sm); margin-top: var(--space-xs); font-size: var(--text-xs); }
.card-host { color: var(--color-muted); }
.card-how { margin-left: auto; padding: var(--space-3xs) var(--space-xs); border-radius: var(--radius-ctl); background: var(--color-paper); color: var(--color-muted); white-space: nowrap; }
.card--account .card-how { color: var(--color-ink-2); }
.card--private .card-how { color: var(--color-accent); }
.card-icon {
  position: absolute; top: var(--space-md); right: var(--space-md);
  width: 16px; height: 16px;
  fill: none; stroke: var(--color-muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform var(--dur-micro) var(--ease-out);
}
.card:hover .card-icon { stroke: var(--color-accent); transform: translate(2px, -2px); }

/* the account panel: a split card like the modals, the white wordmark block as its tab */
.split { position: relative; display: grid; grid-template-columns: 15rem minmax(0, 1fr); margin-top: calc(var(--space-2xl) + var(--space-lg)); border: 1px solid var(--color-modal-edge); background: var(--color-paper); }
.split-tab { position: absolute; left: -1px; top: 0; transform: translateY(-100%); padding: var(--space-2xs) var(--space-sm); background: var(--color-sheet); color: var(--color-sheet-ink); font-size: var(--text-sm); font-weight: 700; line-height: 1.4; }
.split-side { padding: var(--space-lg); background: var(--color-well); border-right: 1px solid var(--color-modal-edge); }
.split-side h2 { margin: 0 0 var(--space-xs); color: var(--color-ink); font-size: var(--text-md); font-weight: 700; line-height: 1.3; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
.split-side p { margin: 0; color: var(--color-muted); font-size: var(--text-xs); line-height: 1.6; }
.split-main { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-lg); padding: var(--space-lg); }
.split-main p { margin: 0; max-width: 46ch; font-size: var(--text-sm); line-height: 1.6; }
.split-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-md); }
.split-actions .btn { min-height: var(--btn-h-sm); border-radius: 0; }
.split-actions .btn--ghost { padding: 0 var(--space-2xs); color: var(--color-muted); font-weight: 400; }
.split-actions .btn--ghost:hover { background: transparent; color: var(--color-ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--ctl-h);
  padding: 0 var(--space-lg);
  border: 1px solid transparent;
  border-radius: var(--radius-ctl);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}

@media (max-width: 52rem) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 34rem) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .mark--lg { padding: var(--space-md) var(--space-lg); font-size: var(--text-xl); }
  .mark--lg b { font-size: 2.5rem; }
  .zone-head { margin: var(--space-xl) 0 var(--space-lg); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-side { border-right: 0; border-bottom: 1px solid var(--color-modal-edge); padding: var(--space-md) var(--space-lg); }
  .split-actions .btn--solid { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .zone:target { animation: none; }
  .enter::after, .enter-icon, .card-icon, .card, .btn, a.mark { transition: none; }
  .enter:hover .enter-icon, .card:hover .card-icon { transform: none; }
}

/* ---------- signed-in auth screens ----------
 * Ladder: canvas, then a well (lighter, no border) per section, then a hairline between rows.
 * A row shows the value; changing it happens in a modal. Success is the new value; failures toast. */
.app { width: 100%; max-width: var(--app-width); margin: 0 auto; padding-bottom: var(--space-3xl); }

/* app bar: wordmark, text tabs, log out */
.appbar { display: flex; align-items: center; gap: var(--space-lg); padding: var(--space-lg) 0; }
.appbar .mark { flex-shrink: 0; }
.tabs { display: flex; align-items: center; gap: var(--space-2xs); margin-right: auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex; align-items: center; min-height: var(--btn-h-sm); padding: 0 var(--space-sm);
  border-radius: var(--radius-ctl); color: var(--color-muted); font-size: var(--text-sm); text-decoration: none; white-space: nowrap;
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.tab:hover { color: var(--color-ink); background: var(--color-well); }
.tab:active { background: var(--color-well-hover); }
.tab[aria-current="page"] { color: var(--color-ink); background: var(--color-well); }
.tab--out { margin-left: auto; }

.app-head { margin: var(--space-xl) 0 var(--space-2xl); }
.app-head h1 { margin: 0 0 var(--space-xs); color: var(--color-ink); font-size: var(--text-2xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
.app-head p { margin: 0; max-width: 60ch; }
.app .alert { margin: 0 0 var(--space-xl); }

/* a section: its name on the left, its well on the right */
.section { display: grid; grid-template-columns: var(--label-col) minmax(0, 1fr); gap: var(--space-lg) var(--space-xl); }
.section + .section { margin-top: var(--space-2xl); }
.section-head h2 { margin: calc(var(--space-lg) - var(--space-3xs)) 0 var(--space-2xs); color: var(--color-ink); font-size: var(--text-md); font-weight: 700; line-height: 1.3; }
.section-head p { margin: 0; font-size: var(--text-xs); line-height: 1.55; color: var(--color-muted); }

.well { list-style: none; margin: 0; padding: 0; overflow: hidden; background: var(--color-well); color: var(--color-ink-2); border-radius: var(--radius-card); }
.item { position: relative; display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; align-items: center; gap: var(--space-xs) var(--space-lg); min-height: 64px; padding: var(--space-sm) var(--space-lg); }
.item + .item::before { content: ""; position: absolute; top: 0; left: var(--space-lg); right: var(--space-lg); height: 1px; background: var(--color-hairline); }
.item-label { color: var(--color-ink); font-size: var(--text-sm); font-weight: 700; }
.item-value { min-width: 0; color: var(--color-ink-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.item--wide .item-value { display: grid; gap: var(--space-3xs); }
.item-value small { display: block; margin-top: var(--space-3xs); color: var(--color-muted); font-size: var(--text-xs); }
.item-value--muted { color: var(--color-muted); }
.item-action { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-xs); }
.item--danger .item-label { color: var(--color-error); }
.item--wide { grid-template-columns: auto minmax(0, 1fr) auto; }
.item-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-ctl); background: var(--color-paper); color: var(--color-ink-2); flex-shrink: 0; }
.item-icon svg, .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.item-value:empty::before { content: "Not set"; color: var(--color-muted); }
.tag { display: inline-block; padding: var(--space-3xs) var(--space-xs); background: var(--color-paper); color: var(--color-muted); font-size: var(--text-xs); white-space: nowrap; }
.session-all { display: flex; justify-content: flex-end; margin-top: var(--space-xs); }
.session-all .btn { color: var(--color-muted); font-weight: 400; }
.session-all .btn:hover:not(:disabled) { color: var(--color-ink); background: transparent; }
.well-empty { margin: 0; padding: var(--space-lg); color: var(--color-muted); font-size: var(--text-sm); }

/* a row that is itself the button (add a method) */
.item-link { width: 100%; margin: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.item-link:hover { background: var(--color-well-hover); }
.item-link:active { background: var(--color-paper); }
.item-link .chev { color: var(--color-muted); transition: transform var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.item-link:hover .chev { color: var(--color-ink); transform: translateX(2px); }

.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--color-paper); vertical-align: middle; }

/* buttons: two sizes, every state from the palette */
.btn { position: relative; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn--sm { min-height: var(--btn-h-sm); padding: 0 var(--space-md); font-weight: 400; }
.btn--solid { background: var(--color-accent); color: var(--color-accent-ink); }
.btn--solid:hover:not(:disabled) { background: var(--color-accent-hi); }
.btn--solid:active:not(:disabled) { background: var(--color-accent-press); }
.btn--line { border-color: var(--color-edge); background: transparent; color: var(--color-ink); }
.btn--line:hover:not(:disabled) { border-color: var(--color-ink-2); background: var(--color-well-hover); }
.btn--line:active:not(:disabled) { background: var(--color-paper); }
.btn--ghost { background: transparent; color: var(--color-ink-2); }
.btn--ghost:hover:not(:disabled) { background: var(--color-well-hover); color: var(--color-ink); }
.btn--ghost:active:not(:disabled) { background: var(--color-paper); }
.btn--danger { border-color: var(--color-error); background: transparent; color: var(--color-error); }
.btn--danger:hover:not(:disabled) { background: var(--color-error-dim); }
.btn--danger:active:not(:disabled) { background: var(--color-paper); }
.btn--danger-solid { background: var(--color-error); color: var(--color-accent-ink); }
.btn--danger-solid:hover:not(:disabled) { background: var(--color-ink); }
.btn--danger-solid:active:not(:disabled) { background: var(--color-ink-2); }
/* busy: the label stays in place, a spinner sits over it, the width never jumps */
.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border: 2px solid var(--color-accent-ink); border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
.btn--line[aria-busy="true"]::after, .btn--ghost[aria-busy="true"]::after { border-color: var(--color-ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-ctl); background: transparent; color: var(--color-muted); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.icon-btn::before { content: ""; position: absolute; inset: -6px; }
.icon-btn:hover { background: var(--color-well-hover); color: var(--color-ink); }
.icon-btn:active { background: var(--color-paper); }

/* fields: constant 1px border, the ring an inset outline, one reserved line under each */
.field {
  width: 100%; min-width: 0; min-height: var(--field-h);
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-edge); border-radius: var(--radius-ctl);
  outline: 2px solid transparent; outline-offset: -3px;
  background-color: var(--color-sunk); color: var(--color-ink);
  font: inherit; font-size: var(--text-md);
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.field::placeholder { color: var(--color-muted); opacity: 1; }
.field:hover { border-color: var(--color-ink-2); }
.field:focus-visible { outline-color: var(--color-focus); border-color: var(--color-ink-2); }
.field:disabled { opacity: 0.55; cursor: not-allowed; }
.field[aria-invalid="true"] { border-color: var(--color-error); }
.field[readonly] { color: var(--color-ink-2); }
select.field { padding-right: var(--space-xl); appearance: none; background-image: var(--i-chev-down); background-position: right 10px center; background-size: 16px; background-repeat: no-repeat; cursor: pointer; }
select.field option { background: var(--color-paper); color: var(--color-ink); }
.field--compact { width: auto; min-width: 9.5rem; max-width: 14rem; min-height: var(--btn-h-sm); border-color: transparent; background-color: var(--color-paper); font-size: var(--text-sm); }
.field--compact:hover { background-color: var(--color-well-hover); }
.field--code { letter-spacing: 0.2em; font-size: var(--text-lg); text-align: center; font-variant-numeric: tabular-nums; }
.fields { display: grid; gap: var(--space-sm); }
.f { display: grid; gap: var(--space-2xs); }
.f > label, .f-label { color: var(--color-ink-2); font-size: var(--text-xs); }
.f-help { min-height: 1lh; margin: 0; color: var(--color-muted); font-size: var(--text-xs); line-height: 1.5; }
.f-help.is-error { color: var(--color-error); }
.f-row { display: flex; gap: var(--space-xs); }
.f-row .field { flex: 1 1 auto; }
.form-error { min-height: 1lh; margin: var(--space-xs) 0 0; color: var(--color-error); font-size: var(--text-xs); }

/* switch: a real checkbox, cornered like the buttons */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; inset: -10px; width: calc(100% + 20px); height: calc(100% + 20px); margin: 0; opacity: 0; cursor: pointer; }
.switch-track { display: inline-block; width: 40px; height: 24px; padding: var(--space-2xs); border-radius: var(--radius-card); background: var(--color-paper); box-shadow: inset 0 0 0 1px var(--color-edge); transition: background-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out); }
.switch-track::after { content: ""; display: block; width: 16px; height: 16px; border-radius: var(--radius-ctl); background: var(--color-muted); transition: transform var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
.switch input:checked + .switch-track { background: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: var(--color-accent-ink); }
.switch input:hover + .switch-track { box-shadow: inset 0 0 0 1px var(--color-ink-2); }
.switch input:checked:hover + .switch-track { background: var(--color-accent-hi); box-shadow: inset 0 0 0 1px var(--color-accent-hi); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.switch input:active + .switch-track::after { transform: scale(0.88); }
.switch input:checked:active + .switch-track::after { transform: translateX(16px) scale(0.88); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch-track { opacity: 0.55; cursor: not-allowed; }

/* modal: a split card. The white wordmark block sits on its top edge as a tab;
 * left, the title and one line; right, small rounded fields that carry their own placeholder. */
.modal {
  position: fixed; inset: 0; margin: auto; height: fit-content;
  width: min(36rem, calc(100% - 2 * var(--gutter))); max-height: none;
  padding: 0; border: 1px solid var(--color-modal-edge); border-radius: 0;
  background: var(--color-paper); color: var(--color-ink-2);
  overflow: visible;
}
.modal[open] { display: grid; grid-template-columns: 12.5rem minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
.modal::backdrop { background: var(--color-scrim); }
.modal[open] { animation: modal-in var(--dur-long) var(--ease-out); }
.modal[open]::backdrop { animation: fade-in var(--dur-long) var(--ease-out); }
.modal > form, .modal-part { display: contents; }
.modal-head { grid-column: 1; grid-row: 1 / span 2; padding: var(--space-lg); background: var(--color-well); border-right: 1px solid var(--color-modal-edge); }
.modal-tab { position: absolute; left: -1px; top: 0; transform: translateY(-100%); padding: var(--space-2xs) var(--space-sm); background: var(--color-sheet); color: var(--color-sheet-ink); font-size: var(--text-sm); font-weight: 700; line-height: 1.4; }
.modal-head h2 { margin: 0 0 var(--space-xs); color: var(--color-ink); font-size: var(--text-md); font-weight: 700; line-height: 1.3; }
.modal-head p { margin: 0; color: var(--color-muted); font-size: var(--text-xs); line-height: 1.6; }
.modal-close { position: absolute; top: 0; right: -1px; transform: translateY(-100%); width: 30px; height: 30px; border-radius: 0; color: var(--color-ink-2); }
.modal-close:hover { background: var(--color-paper); color: var(--color-ink); }
.modal-body { grid-column: 2; grid-row: 1; display: grid; align-content: start; gap: var(--space-xs); padding: var(--space-lg) var(--space-lg) var(--space-md); }
.modal-body > p { margin: 0; font-size: var(--text-xs); line-height: 1.6; color: var(--color-muted); }
.modal-body > p strong { color: var(--color-ink); font-weight: 700; }
.modal-foot { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-md); padding: var(--space-xs) var(--space-lg) var(--space-lg); }
.modal-foot .btn { min-height: var(--btn-h-sm); border-radius: 0; text-transform: none; }
.modal-foot .btn--ghost { padding: 0 var(--space-2xs); font-weight: 400; }
.modal .fields, .modal .f { gap: var(--space-xs); }
.modal .field { min-height: var(--btn-h-sm); padding: 0 var(--space-sm); border-color: var(--color-hairline); border-radius: var(--radius-card); background-color: var(--color-sunk); font-size: var(--text-sm); }
.modal .field::placeholder { color: var(--color-muted); }
.modal .field:hover { border-color: var(--color-edge); }
.modal .field:focus-visible { border-color: var(--color-accent); outline-color: transparent; }
.modal .field[aria-invalid="true"] { border-color: var(--color-error); }
.modal .field--code { font-size: var(--text-md); }
.modal .f-help:empty { display: none; }
.modal .f-help { min-height: 0; }
.modal .f-row .btn { min-height: var(--btn-h-sm); border-radius: var(--radius-card); }
.modal .btn--line { border-color: var(--color-hairline); }
.modal .btn--ghost { color: var(--color-muted); }
.modal .btn--ghost:hover:not(:disabled) { color: var(--color-ink); background: transparent; }
.modal .well { background: var(--color-sunk); border-radius: var(--radius-card); }
.modal .item { min-height: 52px; }
.modal .item-link:hover { background: var(--color-well); }
.modal .code { background: var(--color-sunk); border-radius: var(--radius-card); padding: var(--space-xs) var(--space-md); font-size: var(--text-sm); }
.modal .alert { margin: 0; }
.modal-step[hidden], .section[hidden] { display: none; }

/* a pick of a few values, as square steps (security level, how often a code works) */
.pick { display: flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-2xs); }
.pick-label { min-width: 4rem; color: var(--color-muted); font-size: var(--text-xs); }
.steps { display: flex; gap: var(--space-2xs); margin: 0; padding: 0; border: 0; }
.steps label { position: relative; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 var(--space-xs); background: var(--color-sunk); color: var(--color-ink-2); font-size: var(--text-sm); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.steps input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.steps label:hover { background: var(--color-well-hover); color: var(--color-ink); }
.steps label:has(input:checked) { background: var(--color-accent); color: var(--color-accent-ink); font-weight: 700; }
.steps label:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.steps label:active { transform: translateY(1px); }
.pick-note { color: var(--color-muted); font-size: var(--text-xs); white-space: nowrap; }

/* a drawer inside the modal: slides over the fields, e.g. the QR code */
.modal-drawer { grid-column: 2; grid-row: 1 / span 2; z-index: 2; display: grid; align-content: center; justify-items: center; gap: var(--space-md); padding: var(--space-lg); background: var(--color-paper); border-left: 1px solid var(--color-modal-edge); animation: drawer-in var(--dur-short) var(--ease-out); }
.modal-drawer[hidden] { display: none; }
.modal-drawer p { margin: 0; color: var(--color-muted); font-size: var(--text-xs); text-align: center; }
.modal .qr { width: 152px; height: 152px; margin: 0; padding: var(--space-xs); border-radius: var(--radius-card); background: var(--color-sheet); }
.modal .qr img, .modal .qr canvas { width: 136px; height: 136px; }
@keyframes drawer-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* a code to read: a secret, a backup code */
.code { display: block; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-ctl); background: var(--color-sunk); color: var(--color-ink); font-size: var(--text-md); letter-spacing: 0.12em; text-align: center; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.codes { display: grid; gap: var(--space-xs); margin: 0; }
.qr { display: grid; place-items: center; width: 168px; height: 168px; margin: 0 auto var(--space-lg); padding: var(--space-xs); background: var(--color-sheet); border-radius: var(--radius-card); }
.qr:empty { display: none; }
.qr img, .qr canvas { display: block; width: 152px; height: 152px; }

/* toast: failures and effects the page cannot show */
.toasts { position: fixed; right: var(--space-lg); bottom: var(--space-lg); z-index: var(--z-toast); display: grid; gap: var(--space-xs); width: min(22rem, calc(100% - 2 * var(--space-lg))); pointer-events: none; }
.toast { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-md); border-radius: var(--radius-card); background: var(--color-ink); color: var(--color-accent-ink); font-size: var(--text-sm); box-shadow: var(--shadow-toast); pointer-events: auto; animation: toast-in var(--dur-long) var(--ease-out); }
.toast-text { flex: 1 1 auto; min-width: 0; }
.toast .btn { min-height: 30px; padding: 0 var(--space-sm); border-color: var(--color-accent-ink); color: var(--color-accent-ink); font-weight: 700; }
.toast .btn:hover { background: var(--color-sheet-chip); }
.toast--err { border-radius: 0; background: var(--color-sunk); color: var(--color-ink); box-shadow: var(--shadow-toast), inset 0 0 0 1px var(--color-modal-edge); }
.toast--err::before { content: ""; flex-shrink: 0; width: 10px; height: 10px; background: var(--color-error); }
.toast--err .btn { border-color: var(--color-edge); border-radius: 0; color: var(--color-ink); }
.toast--err .btn:hover { background: var(--color-paper); }
.toast.is-leaving { animation: toast-out calc(var(--dur-long) * 0.65) var(--ease-in) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(4px); } }

/* narrow column: the two-factor check and the welcome */
.narrow { width: 100%; max-width: var(--narrow-width); margin: 0 auto; padding: var(--space-2xl) 0; }
.narrow h1 { margin: var(--space-2xl) 0 var(--space-xs); color: var(--color-ink); font-size: var(--text-2xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
.narrow > p { margin: 0 0 var(--space-xl); }
.narrow .alert { margin-bottom: var(--space-lg); }
.card-step { padding: var(--space-lg); background: var(--color-well); color: var(--color-ink-2); border-radius: var(--radius-card); }
.card-step + .card-step { margin-top: var(--space-md); }
.card-step h2 { margin: 0 0 var(--space-2xs); color: var(--color-ink); font-size: var(--text-md); font-weight: 700; }
.card-step p { margin: 0 0 var(--space-lg); font-size: var(--text-sm); }
.card-step .btn { width: 100%; min-height: var(--field-h); }
.card-step .fields { margin-bottom: var(--space-sm); }
.picker { margin-bottom: var(--space-md); }

/* finish review */
.modal .item-link { grid-template-columns: minmax(0, 1fr) auto; }
.modal-body > :last-child { margin-bottom: 0; }
.item-action .btn--line { border-color: transparent; color: var(--color-accent); padding: 0 var(--space-sm); }
.item-action .btn--line:hover:not(:disabled) { border-color: transparent; background: var(--color-well-hover); color: var(--color-accent-hi); }
.item-action .btn--line:active:not(:disabled) { background: var(--color-paper); }
.item-action .btn--line[aria-busy="true"]::after { border-color: var(--color-accent); border-right-color: transparent; }
.avatar--empty { display: inline-grid; place-items: center; background: var(--color-accent); color: var(--color-accent-ink); }
.avatar--empty svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* the pass: sign in, register, reset, the two-factor check and the welcome.
 * One card for the whole way in: the white wordmark field on the left carries the logo
 * and the steps of the route (the current one marked), the form sits on the indigo right. */
.gate > .alert { margin: 0; }
.gate { display: grid; grid-template-columns: min(46rem, 100%); justify-content: center; align-content: center; gap: var(--space-sm); min-height: 100dvh; padding: var(--space-2xl) 0; }
.pass-after { justify-self: end; margin: 0; color: var(--color-muted); font-size: var(--text-xs); }
.pass-after a { color: var(--color-accent); text-decoration: none; }
.pass-after a:hover { color: var(--color-accent-hi); text-decoration: underline; text-underline-offset: 3px; }
.app:has(> .gate) { padding-bottom: 0; }
.pass { display: grid; grid-template-columns: 15rem minmax(0, 1fr); width: 100%; border: 1px solid var(--color-modal-edge); background: var(--color-paper); }
.pass-brand { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-xl); padding: var(--space-lg); background: var(--color-sheet); color: var(--color-sheet-ink-2); }
.pass-logo { display: block; color: var(--color-sheet-ink); font-size: var(--text-2xl); line-height: 1.05; text-decoration: none; }
.pass-logo b { display: block; font-size: 3.5rem; letter-spacing: 0.07em; line-height: 1; }
.pass-logo:hover { color: var(--color-sheet-focus); }
.pass-tagline { margin: var(--space-sm) 0 0; font-size: var(--text-xs); line-height: 1.5; }
.pass-steps { list-style: none; display: grid; gap: var(--space-sm); margin: 0; padding: 0; font-size: var(--text-xs); }
.pass-steps li { display: flex; align-items: center; gap: var(--space-sm); color: var(--color-sheet-ink-2); }
.pass-steps li::before { content: ""; flex-shrink: 0; width: 10px; height: 10px; box-shadow: inset 0 0 0 1.5px currentColor; }
.pass-steps li.is-done::before { background: var(--color-sheet-rule); box-shadow: none; }
.pass-steps li[aria-current="step"] { color: var(--color-sheet-ink); font-weight: 700; }
.pass-steps li[aria-current="step"]::before { background: var(--color-sheet-focus); box-shadow: 0 0 0 2px var(--color-sheet), 0 0 0 3px var(--color-sheet-focus); }
.pass :focus-visible { outline-color: var(--color-focus); }
.pass-brand :focus-visible { outline-color: var(--color-sheet-focus); }
.pass-main { display: flex; flex-direction: column; padding: var(--space-xl) var(--space-xl) var(--space-lg); }
.pass-main h1 { margin: 0 0 var(--space-xs); color: var(--color-ink); font-size: var(--text-xl); font-weight: 700; line-height: 1.2; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
.pass-lead { margin: 0 0 var(--space-lg); color: var(--color-muted); font-size: var(--text-sm); line-height: 1.6; }
.pass-lead strong { color: var(--color-ink); font-weight: 700; overflow-wrap: anywhere; }
.pass-form { display: grid; gap: var(--space-xs); }
.pass-form .split-actions { margin-top: var(--space-xs); }
.pass-foot { margin-top: auto; padding-top: var(--space-lg); color: var(--color-muted); font-size: var(--text-xs); }
.pass-foot a { color: var(--color-accent); text-decoration: none; }
.pass-foot a:hover { color: var(--color-accent-hi); text-decoration: underline; text-underline-offset: 3px; }
.pass .field { min-height: var(--btn-h-sm); padding: 0 var(--space-sm); border-color: var(--color-hairline); border-radius: var(--radius-card); background-color: var(--color-sunk); font-size: var(--text-sm); }
.pass .field:hover { border-color: var(--color-edge); }
.pass .field:focus-visible { border-color: var(--color-accent); outline-color: transparent; }
.pass .field--code { font-size: var(--text-md); }
.pass .split-actions .btn--solid { min-width: 8rem; }
.gate-check { display: flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-2xs); color: var(--color-muted); font-size: var(--text-xs); cursor: pointer; }
.pass-step { margin-bottom: var(--space-sm); }
.pass-step:last-child { margin-bottom: 0; }
.pass-step p { margin: 0; color: var(--color-muted); font-size: var(--text-sm); }
.pass-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm) var(--space-md); padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-md); border: 1px solid var(--color-hairline); border-radius: var(--radius-card); background: var(--color-sunk); }
.pass-row p { color: var(--color-ink-2); }
.pass-row .btn { min-height: var(--btn-h-sm); border-radius: 0; }

@media (max-width: 52rem) {
  .section { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
  .section-head h2 { margin-top: 0; }
}
@media (max-width: 40rem) {
  .appbar { flex-wrap: wrap; gap: var(--space-sm); padding: var(--space-md) 0; }
  .tabs { order: 3; width: 100%; margin: 0 calc(-1 * var(--space-sm)); padding: 0 var(--space-xs); }
  .tab--out { margin-left: auto; }
  .app-head { margin: var(--space-lg) 0 var(--space-xl); }
  .item { padding-left: var(--space-md); padding-right: var(--space-md); }
  .item + .item::before { left: var(--space-md); right: var(--space-md); }
  .item { grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2xs) var(--space-md); }
  .item-label { grid-column: 1; }
  .item-value { grid-column: 1; grid-row: 2; }
  .item-action { grid-column: 2; grid-row: 1 / span 2; }
  .item--wide { grid-template-columns: auto minmax(0, 1fr) auto; }
  .item--wide .item-value { grid-column: 2; grid-row: 1; }
  .item--wide .item-action { grid-row: 1; grid-column: 3; }
  .field--compact { min-width: 0; max-width: 11rem; }
  .modal { margin-top: calc(var(--space-2xl) + var(--space-md)); }
  .modal[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .modal-head { grid-column: 1; grid-row: 1; border-right: 0; border-bottom: 1px solid var(--color-modal-edge); padding: var(--space-md) var(--space-lg); }
  .modal-body { grid-column: 1; grid-row: 2; }
  .modal-foot { grid-column: 1; grid-row: 3; }
  .modal-drawer { grid-column: 1; grid-row: 2 / span 2; border-left: 0; }
  .modal-foot .btn { flex: 1 1 auto; }
  .toasts { right: var(--space-md); left: var(--space-md); bottom: var(--space-md); width: auto; }
  .gate { align-content: start; padding: var(--space-lg) 0; }
  .pass { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .pass-brand { flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-md); padding: var(--space-md) var(--space-lg); }
  .pass-logo { font-size: var(--text-lg); }
  .pass-logo b { font-size: 2.25rem; }
  .pass-tagline { display: none; }
  .pass-steps { grid-auto-flow: column; gap: var(--space-md); }
  .pass-main { padding: var(--space-lg); }
  .split-actions .btn--solid { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .modal[open], .modal[open]::backdrop, .toast, .toast.is-leaving, .modal-drawer { animation: fade-in 150ms linear; }
  .steps label { transition: none; }
  .toast.is-leaving { animation: none; opacity: 0; }
  .btn[aria-busy="true"]::after { animation-duration: 1.6s; }
  .tab, .item-link, .item-link .chev, .btn, .icon-btn, .field, .switch-track, .switch-track::after { transition: none; }
  .item-link:hover .chev { transform: none; }
}
