/* ==========================================================================
   Звънец design system — the receipt book (кочан с квитанции)
   Tokens → base → components. One file, no build step.
   ========================================================================== */

@font-face {
  font-family: "Sofia Sans";
  src: url("/assets/fonts/sofia-sans-cyrillic.woff2") format("woff2");
  font-weight: 1 1000; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Sofia Sans";
  src: url("/assets/fonts/sofia-sans-latin.woff2") format("woff2");
  font-weight: 1 1000; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Sofia Sans Condensed";
  src: url("/assets/fonts/sofia-sans-condensed-cyrillic.woff2") format("woff2");
  font-weight: 1 1000; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Sofia Sans Condensed";
  src: url("/assets/fonts/sofia-sans-condensed-latin.woff2") format("woff2");
  font-weight: 1 1000; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Paper */
  --paper: #F4F1E8;          /* receipt-book stock, page ground */
  --paper-deep: #EAE5D6;     /* the stub, pressed areas */
  --slip: #FFFDF7;           /* a single receipt slip */
  --rule: #CFC6AE;           /* hairline rules */
  --rule-soft: #E0D9C6;      /* dashed sub-rules */
  --perf: #B3A98F;           /* perforation dots */

  /* Ink */
  --ink: #1C2440;            /* carbon navy, body text — 13:1 on paper */
  --ink-2: #434A64;          /* secondary text — 7.4:1 on paper */
  --ink-3: #5F6479;          /* tertiary / disabled — 5.1:1 on paper */
  --ink-inverse: #F4F1E8;

  /* Stamp blue — the one confident colour */
  --stamp: #2B3FA0;          /* primary; white on it 9:1 */
  --stamp-hover: #223385;
  --stamp-press: #1B2A6E;
  --stamp-tint: #E4E7F5;
  --stamp-tint-2: #CDD3EE;

  /* States */
  --paid: #17613D;  --paid-mark: #1F7A4D; --paid-tint: #E2EEE5;
  --owed: #8F4307;  --owed-mark: #B4570B; --owed-tint: #F7E8D6;
  --error: #9C2B1C; --error-tint: #F6E1DC;

  /* Shell (manager rail) */
  --shell: #1C2440;
  --shell-2: #262F52;
  --shell-ink: #E9E5D8;
  --shell-ink-2: #AEB2C6;

  /* Type */
  --font: "Sofia Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-cond: "Sofia Sans Condensed", "Sofia Sans", "Arial Narrow", system-ui, sans-serif;

  --t-xs: 0.8125rem;   /* 13 — condensed labels only */
  --t-sm: 0.9375rem;   /* 15 */
  --t-md: 1rem;        /* 16 — manager body */
  --t-lg: 1.125rem;    /* 18 — resident body */
  --t-xl: 1.375rem;    /* 22 */
  --t-2xl: 1.75rem;    /* 28 */
  --t-3xl: 2.25rem;    /* 36 */
  --t-4xl: 3rem;       /* 48 */
  --t-amount: clamp(3rem, 2.2rem + 4vw, 4rem); /* 48–64 */

  /* Space (4-based) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* Shape & depth */
  --r-0: 0;
  --r-1: 3px;          /* controls */
  --r-2: 6px;          /* dialogs, popovers */
  --shadow-lift: 0 1px 1px rgba(28,36,64,.06), 0 8px 24px -6px rgba(28,36,64,.18);
  --shadow-dialog: 0 2px 4px rgba(28,36,64,.08), 0 24px 48px -12px rgba(28,36,64,.32);

  --tap: 48px;
  --tap-lg: 56px;
  --ease-out: cubic-bezier(.16,1,.3,1);
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--stamp);

  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: var(--t-lg); line-height: 1.55;
  font-feature-settings: "locl"; font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.12; text-wrap: balance; font-weight: 800; }
h1, h2 { font-family: var(--font-cond); letter-spacing: -0.005em; }
p { margin: 0; text-wrap: pretty; }
img, svg { display: block; max-width: 100%; }
a { color: var(--stamp); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--stamp-tint-2); color: var(--ink); }
input, textarea, select, button { font: inherit; color: inherit; caret-color: var(--stamp); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-1); }
* { scrollbar-color: var(--rule) transparent; }
.num, .amount, td.num { font-variant-numeric: tabular-nums lining-nums; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: var(--s-4); top: -100px; background: var(--ink); color: var(--paper); padding: var(--s-2) var(--s-4); z-index: 100; }
.skip-link:focus { top: var(--s-2); }
[hidden] { display: none !important; }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 2rem; height: 2rem; }

/* Condensed uppercase label: the printed headings of a receipt form */
.label-caps {
  font-family: var(--font-cond); font-weight: 650; font-size: var(--t-xs);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); line-height: 1.3;
}

/* ---------- Wordmark ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: var(--font-cond); font-weight: 800; font-size: 1.25rem; letter-spacing: 0.02em; }
.wordmark__mark { width: 26px; height: 30px; flex: none; }
.wordmark:hover { text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--stamp); --btn-fg: #fff; --btn-bd: var(--stamp);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-5);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  border-radius: var(--r-1); font-weight: 700; font-size: var(--t-md); line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { --btn-bg: var(--stamp-hover); --btn-bd: var(--stamp-hover); text-decoration: none; }
.btn:active { --btn-bg: var(--stamp-press); transform: translateY(1px); }
.btn--lg { min-height: var(--tap-lg); font-size: var(--t-lg); padding: 0 var(--s-6); }
.btn--block { display: flex; width: 100%; }
.btn--secondary { --btn-bg: transparent; --btn-fg: var(--stamp); --btn-bd: var(--stamp); }
.btn--secondary:hover { --btn-bg: var(--stamp-tint); --btn-bd: var(--stamp-hover); --btn-fg: var(--stamp-hover); }
.btn--quiet { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--rule); }
.btn--quiet:hover { --btn-bg: var(--slip); --btn-bd: var(--ink-3); --btn-fg: var(--ink); }
.btn--danger { --btn-bg: transparent; --btn-fg: var(--error); --btn-bd: var(--error); }
.btn--danger:hover { --btn-bg: var(--error-tint); --btn-bd: var(--error); --btn-fg: var(--error); }
.btn--sm { min-height: 40px; padding: 0 var(--s-4); font-size: var(--t-sm); }
.btn[disabled], .btn[aria-disabled="true"] { --btn-bg: var(--paper-deep); --btn-fg: var(--ink-3); --btn-bd: var(--rule); cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"] .btn__label { opacity: .85; }
.spinner { width: 1.1em; height: 1.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Fields ---------- */
.field { display: grid; gap: var(--s-2); }
.field__label { font-weight: 700; font-size: var(--t-md); }
.field__opt { font-weight: 500; color: var(--ink-2); }
.field__hint { font-size: var(--t-sm); color: var(--ink-2); }
.field__error { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--t-sm); color: var(--error); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  background: var(--slip); border: 1px solid var(--ink-3); border-radius: var(--r-1);
  font-size: var(--t-lg); line-height: 1.4;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-2); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { border-color: var(--stamp); box-shadow: 0 0 0 3px var(--stamp-tint-2); border-radius: var(--r-1); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-tint); }
.input--amount { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%231C2440' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; cursor: pointer; }
.textarea { min-height: 160px; resize: vertical; font-family: var(--font); }
.input-affix { position: relative; }
.input-affix .input { padding-right: 40px; }
.input-affix__suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-weight: 700; pointer-events: none; }

/* Checkbox / radio, native, themed */
input[type="checkbox"], input[type="radio"] { accent-color: var(--stamp); width: 20px; height: 20px; }

/* Toggle switch (a checkbox with role="switch") */
.switch { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; min-height: var(--tap); }
.switch input { appearance: none; width: 52px; height: 30px; margin: 0; border-radius: 15px; background: var(--ink-3); position: relative; cursor: pointer; transition: background-color .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .25s var(--ease-out); }
.switch input:checked { background: var(--paid-mark); }
.switch input:checked::after { transform: translateX(22px); }
.switch input:focus-visible { box-shadow: var(--focus); }
.switch__state { font-weight: 700; }

/* Segmented control (radio group) */
.segmented { display: inline-flex; border: 1px solid var(--ink-3); border-radius: var(--r-1); overflow: hidden; background: var(--slip); flex-wrap: wrap; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.segmented span { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 var(--s-4); font-size: var(--t-sm); font-weight: 600; border-right: 1px solid var(--rule); white-space: nowrap; }
.segmented label:last-child span { border-right: 0; }
.segmented input:checked + span { background: var(--ink); color: var(--paper); }
.segmented input:focus-visible + span { box-shadow: inset 0 0 0 3px var(--stamp-tint-2); }
.segmented .count { font-variant-numeric: tabular-nums; opacity: .7; font-weight: 500; }


/* ---------- Notices (inline alerts) ---------- */
.notice { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4); border: 1px solid var(--rule); background: var(--slip); border-radius: var(--r-1); font-size: var(--t-md); }
.notice > .icon { margin-top: 2px; }
.notice__title { font-weight: 800; display: block; margin-bottom: 2px; }
.notice--info { border-color: var(--stamp-tint-2); background: var(--stamp-tint); }
.notice--info > .icon { color: var(--stamp); }
.notice--success { border-color: #BCD8C4; background: var(--paid-tint); }
.notice--success > .icon { color: var(--paid); }
.notice--warn { border-color: #E9CBA6; background: var(--owed-tint); }
.notice--warn > .icon { color: var(--owed); }
.notice--error { border-color: #E4B7AE; background: var(--error-tint); }
.notice--error > .icon { color: var(--error); }

/* ---------- The slip: a single receipt ---------- */
.slip { position: relative; background: var(--slip); border: 1px solid var(--rule); padding: var(--s-4) var(--s-4) var(--s-5); }
.slip__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.slip__serial { font-family: var(--font-cond); font-weight: 650; font-size: var(--t-xs); letter-spacing: .1em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.slip__lines { margin: var(--s-3) 0 0; padding: 0; list-style: none; }
.slip__line { display: flex; justify-content: space-between; gap: var(--s-4); padding: 10px 0; border-bottom: 1px dashed var(--rule-soft); font-size: var(--t-md); }
.slip__line dt, .slip__line > span:first-child { color: var(--ink-2); }
.slip__line dd { margin: 0; }
.slip__line dt small { display: block; color: var(--ink-3); font-size: var(--t-sm); }
.slip__line .num { font-weight: 700; color: var(--ink); }
.slip__total { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4); margin-top: var(--s-4); }
.amount { font-family: var(--font-cond); font-weight: 800; font-size: var(--t-amount); line-height: .95; letter-spacing: -0.01em; color: var(--ink); }
.amount--md { font-size: var(--t-3xl); }
.amount--sm { font-size: var(--t-2xl); }

/* Perforation: the dotted tear line. The signature, used where proof happens. */
.perf { position: relative; height: 0; border: 0; border-top: 2px dotted var(--perf); margin: 0; }
.perf::before, .perf::after { content: ""; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 1px solid var(--rule); }
.perf::before { left: -9px; clip-path: inset(0 0 0 50%); }
.perf::after { right: -9px; clip-path: inset(0 50% 0 0); }

/* Rubber stamp */
.stamp {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 16px; border: 3px solid currentColor; border-radius: 6px; color: var(--stamp);
  font-family: var(--font-cond); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; line-height: 1.05;
  transform: rotate(-7deg); opacity: .9; mix-blend-mode: multiply;
  box-shadow: inset 0 0 0 2px var(--slip), inset 0 0 0 3px currentColor;
}
.stamp__big { font-size: 1.75rem; }
.stamp__small { font-size: .75rem; letter-spacing: .14em; font-weight: 700; }
.stamp--paid { color: var(--paid-mark); }

/* ---------- Buzzer grid: the apartment picker ---------- */
.buzzer { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); background: var(--slip); }
.buzzer__key {
  position: relative; display: grid; place-items: center; align-content: center; gap: 2px;
  min-height: 64px; padding: 6px 4px; margin: 0;
  background: transparent; border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); border-radius: 0;
  font-family: var(--font-cond); font-weight: 800; font-size: 1.5rem; line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color .12s, color .12s;
}
.buzzer__key small { font-family: var(--font); font-size: .75rem; font-weight: 600; letter-spacing: 0; color: var(--ink-2); }
.buzzer__key:hover { background: var(--stamp-tint); }
.buzzer__key:focus-visible { z-index: 1; box-shadow: inset 0 0 0 3px var(--stamp); border-radius: 0; }
.buzzer__key[aria-pressed="true"] { background: var(--stamp); color: #fff; }
.buzzer__key[aria-pressed="true"] small { color: var(--stamp-tint); }
.buzzer__key--paid::after { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--paid-mark); }
.buzzer__floor { grid-column: 1 / -1; padding: 6px 10px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--paper-deep); }

/* ---------- Ledger table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); background: var(--slip); }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-md); }
.table th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ink-3); background: var(--slip); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.table th .sort { all: unset; display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.table th .sort:focus-visible { box-shadow: var(--focus); }
.table td { padding: 12px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FBF8EF; }
.table .num { text-align: right; white-space: nowrap; }
.table .apt { font-family: var(--font-cond); font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.table .muted { color: var(--ink-2); }
.table tfoot td { border-top: 1px solid var(--ink-3); border-bottom: 0; font-weight: 800; }

/* ---------- Panels (a section of the ledger, not a floating card) ---------- */
.panel { background: var(--slip); border: 1px solid var(--rule); }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.panel__body { padding: var(--s-5); }
.panel__title { font-family: var(--font-cond); font-size: var(--t-xl); font-weight: 800; }

/* ---------- Dialog ---------- */
dialog.dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--slip); color: var(--ink); box-shadow: var(--shadow-dialog); }
dialog.dialog::backdrop { background: rgba(28,36,64,.45); }
.dialog__head { display: flex; justify-content: space-between; align-items: center; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--rule); }
.dialog__body { padding: var(--s-5); display: grid; gap: var(--s-4); }
.dialog__foot { display: flex; justify-content: flex-end; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--rule); background: var(--paper); flex-wrap: wrap; }
.icon-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); background: transparent; border: 0; border-radius: var(--r-1); cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--paper-deep); color: var(--ink); }

/* ---------- Loading, empty ---------- */
.skeleton { display: block; background: linear-gradient(90deg, var(--paper-deep) 0 40%, #F1ECDF 50%, var(--paper-deep) 60% 100%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: 2px; min-height: 1em; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.empty { display: grid; justify-items: center; gap: var(--s-3); text-align: center; padding: var(--s-7) var(--s-5); max-width: 46ch; margin: 0 auto; }
.empty__art { color: var(--ink-3); margin-bottom: var(--s-2); }
.empty__title { font-family: var(--font-cond); font-size: var(--t-xl); font-weight: 800; }
.empty p { color: var(--ink-2); font-size: var(--t-md); }

/* Demo-data marker (local preview only) */
.demo-flag { position: fixed; right: 8px; top: 8px; z-index: 50; padding: 6px 10px; background: var(--ink); color: var(--paper); font: 650 12px/1 var(--font-cond); letter-spacing: .1em; text-transform: uppercase; border-radius: 2px; opacity: .85; pointer-events: none; }

/* ---------- Layout helpers ---------- */
.stack { display: grid; gap: var(--s-4); }
.stack--lg { gap: var(--s-6); }
.row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Programmatic focus targets (headings moved to on load) don't need a ring */
[tabindex="-1"]:focus { box-shadow: none; outline: none; }

/* Status as a rubber-stamp ink mark: square, condensed caps, no tinted fill */
.chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 2px 8px 2px 6px;
  border: 1.5px solid currentColor; border-radius: 0; background: transparent; white-space: nowrap;
  font-family: var(--font-cond); font-size: var(--t-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1;
}
.chip .icon { width: 15px; height: 15px; stroke-width: 2.2; }
.chip--paid, .chip--cash { background: transparent; color: var(--paid); border-color: var(--paid); }
.chip--cash { border-style: double; border-width: 3px; padding: 1px 7px 1px 5px; }
.chip--owed { background: transparent; color: var(--owed); border-color: var(--owed); }
.chip--partial { color: var(--owed); border-style: dashed; background: repeating-linear-gradient(135deg, var(--owed-tint) 0 4px, transparent 4px 8px); }
.chip--neutral { background: transparent; color: var(--ink-2); border-color: var(--ink-3); }
.chip--info { background: transparent; color: var(--stamp); }
.chip--error { background: transparent; color: var(--error); }
dialog.dialog { border-radius: 0; }

/* Public demo bar: always says the data is made up, always offers the way out */
.demo-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper); font-size: var(--t-sm); border-top: 3px solid var(--stamp); }
.demo-bar p { margin: 0; }
.demo-bar nav { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.demo-bar a, .demo-bar button { color: var(--paper); font: inherit; font-weight: 700; background: none; border: 0; padding: 8px 0; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.demo-bar button { text-decoration: none; border: 1px solid rgba(244,241,232,.5); padding: 6px 12px; border-radius: var(--r-1); }
.demo-bar button:hover { background: rgba(244,241,232,.12); }
.demo-bar :focus-visible { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--paper); }
body.has-demo-bar { padding-bottom: 96px; }
@media (min-width: 720px) { body.has-demo-bar { padding-bottom: 64px; } }
@media print { .demo-bar { display: none; } }

/* Choice: radio or checkbox options as separate bordered tiles */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 16px 0 12px; background: var(--slip); border: 1px solid var(--ink-3); border-radius: var(--r-1); cursor: pointer; font-weight: 600; font-size: var(--t-md); transition: border-color .15s, background-color .15s; }
.choice:hover { border-color: var(--ink-2); }
.choice input { margin: 0; flex: none; }
.choice:has(input:checked) { border: 2px solid var(--stamp); padding: 0 15px 0 11px; background: var(--stamp-tint); }
.choice:has(input:focus-visible) { box-shadow: var(--focus); }
.choice input:focus-visible { box-shadow: none; }

/* Password field with show/hide */
.pw { position: relative; }
.pw .input { padding-right: 92px; }
.pw__toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 12px; background: transparent; border: 0; border-radius: var(--r-1); color: var(--stamp); font-weight: 700; font-size: var(--t-sm); cursor: pointer; }
.pw__toggle:hover { background: var(--stamp-tint); }
.pw-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--t-sm); color: var(--ink-2); }
.pw-rules li { display: inline-flex; align-items: center; gap: 6px; }
.pw-rules li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink-3); }
.pw-rules li.ok { color: var(--paid); }
.pw-rules li.ok::before { background: var(--paid-mark); border-color: var(--paid-mark); }
