/* ==========================================================================
   Hamtana (המתנה) — shared stylesheet
   "Waiting room" system: ink on paper, hairline grids, one red accent,
   LED digits as the only glow. See docs/DESIGN.md. RTL-first, logical props.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;

  --font-display: "Karantina", "IBM Plex Sans Hebrew", system-ui, sans-serif;
  --font-sans: "IBM Plex Sans Hebrew", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "IBM Plex Sans Hebrew", monospace;

  --paper: #f2f1ec;
  --paper-2: #e8e6df;
  --card: #faf9f6;
  --ink: #121211;
  --ink-2: #45443f;
  --ink-3: #6a6963;
  --rule: rgba(18, 18, 17, 0.16);
  --rule-2: rgba(18, 18, 17, 0.08);

  --red: #e0241b;
  --red-ink: #b3170f;
  --red-soft: #f6dcd8;

  --panel: #131312;
  --panel-2: #1e1e1c;
  --panel-line: #2c2c29;
  --on-panel: #edece6;
  --on-panel-2: #9a988f;
  --led: #ff3b2f;

  /* legacy aliases used by page scripts and page CSS */
  --bg: var(--paper);
  --bg-tint: var(--paper-2);
  --surface: var(--card);
  --surface-2: var(--paper-2);
  --surface-3: #dddbd3;
  --text: var(--ink);
  --text-2: var(--ink-2);
  --muted: var(--ink-3);
  --line: var(--rule);
  --line-strong: var(--ink);
  --brand: var(--red);
  --brand-hover: var(--red-ink);
  --brand-soft: var(--red-soft);
  --brand-ink: var(--red-ink);
  --on-brand: #ffffff;
  --success: var(--ink);
  --success-soft: var(--paper-2);
  --warn: var(--ink);
  --warn-soft: var(--paper-2);
  --danger: var(--red-ink);
  --danger-soft: var(--red-soft);
  --info: var(--ink-2);
  --info-soft: var(--paper-2);
  --term-bg: var(--panel);
  --term-bar: var(--panel-2);
  --term-text: var(--on-panel);
  --term-dim: var(--on-panel-2);
  --term-accent: var(--led);
  --term-line: var(--panel-line);
  --code-bg: var(--panel);
  --code-text: var(--on-panel);

  --r-xs: 0;
  --r-sm: 0;
  --r-md: 0;
  --r-lg: 0;
  --r-pill: 0;
  --ring: 0 0 0 1px var(--ink);
  --shadow-1: none;
  --shadow-2: 6px 6px 0 var(--ink);
  --focus: 0 0 0 2px var(--red);

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --header-h: 60px;
  --gutter: 16px;
  --wrap: 1200px;
}
@media (min-width: 720px) { :root { --gutter: 28px; } }

/* ---------- Reset + base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(3rem, 7vw, 5rem); line-height: 0.9; letter-spacing: 0; }
h2 { font-size: clamp(1.5rem, 2.4vw + 0.6rem, 2.1rem); }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }

p { margin: 0; text-wrap: pretty; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--red);
  text-underline-offset: 4px;
}
@media (hover: hover) { a:hover { color: var(--red-ink); } }

ul, ol { margin: 0; padding-inline-start: 1.25em; }
hr { border: 0; height: 1px; background: var(--ink); margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
::selection { background: var(--ink); color: var(--paper); }
[hidden] { display: none !important; }

.sr-only {
  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; inset-inline-start: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 16px;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container { width: min(100% - (var(--gutter) * 2), var(--wrap)); margin-inline: auto; }
.container-md { width: min(100% - (var(--gutter) * 2), 880px); margin-inline: auto; }
.container-narrow { width: min(100% - (var(--gutter) * 2), 740px); margin-inline: auto; }
.container-sm { width: min(100% - (var(--gutter) * 2), 480px); margin-inline: auto; }

.page { padding-block: 0 72px; }
.section { padding-block: clamp(56px, 8vw, 112px); }
.section-tint { background: var(--paper-2); }

.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: flex-end;
  justify-content: space-between;
  padding-block: clamp(28px, 5vw, 56px) 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--ink);
}
.page-head h1 { font-size: clamp(2.8rem, 6vw, 4.5rem); }
.page-head p { color: var(--ink-2); margin-top: 8px; max-width: 60ch; }

.section-head { max-width: 680px; margin-bottom: 36px; }
.section-head p { color: var(--ink-2); margin-top: 12px; font-size: 1.06rem; }

/* section label: "[ 01 ] איך זה עובד" */
.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  margin-bottom: 16px;
}
.idx {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--red-ink);
  letter-spacing: 0;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap, 16px); align-content: start; }
.stack-sm { --gap: 8px; }
.stack-lg { --gap: 28px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 12px); }
.row-between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }

.grid { display: grid; gap: var(--gap, 16px); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

/* ruled grid: cells separated by 1px ink lines */
.ruled { display: grid; gap: 1px; padding: 1px; }
.ruled > * { background: var(--paper); min-width: 0; outline: 1px solid var(--ink); }

.muted { color: var(--ink-3); }
.text-2 { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.xsmall { font-size: 0.78rem; }
.bold { font-weight: 700; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: left; }
.success-text { color: var(--ink); }
.danger-text { color: var(--red-ink); }
.warn-text { color: var(--red-ink); }

@media (max-width: 719px) { .hide-mobile { display: none !important; } }
@media (min-width: 720px) { .show-mobile { display: none !important; } }

/* ---------- Header ---------- */
.site-header-slot { min-height: var(--header-h); }
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}
.site-header-inner { height: var(--header-h); display: flex; align-items: center; gap: 8px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  margin-inline-end: 20px;
}
.brand > span:last-child {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  padding-top: 4px;
}
.brand-mark {
  width: 30px;
  height: 30px;
  background: var(--ink);
  color: var(--led);
  display: grid;
  place-items: center;
}
.brand-mark svg { width: 17px; height: 17px; }

.site-nav { display: flex; align-items: stretch; align-self: stretch; gap: 0; flex: 1 1 auto; }
.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-inline: 14px;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s;
}
@media (hover: hover) { .site-nav a:hover { color: var(--ink); } }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 14px;
  bottom: -1px;
  height: 3px;
  background: var(--red);
}

.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink);
  background: transparent;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
}
.nav-toggle svg { width: 20px; height: 20px; }

.user-menu { position: relative; }
.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 3px 3px 3px 12px;
  border: 1px solid var(--ink);
  background: var(--card);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  max-width: 220px;
}
@media (hover: hover) { .user-btn:hover { background: var(--paper-2); } }
.user-btn span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  flex: none;
  width: 32px;
  height: 32px;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.menu-pop {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  min-width: 240px;
  background: var(--card);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-2);
  z-index: 70;
  animation: pop-in 0.14s var(--ease);
}
.menu-pop .who { padding: 12px 14px; border-bottom: 1px solid var(--ink); }
.menu-pop .who strong { display: block; font-size: 0.95rem; }
.menu-pop .who span { display: block; font-size: 0.82rem; color: var(--ink-3); overflow-wrap: anywhere; font-family: var(--font-mono); }
.menu-pop a,
.menu-pop button {
  display: flex;
  width: 100%;
  align-items: center;
  min-height: 44px;
  padding-inline: 14px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  text-align: start;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.95rem;
}
.menu-pop > :last-child { border-bottom: 0; }
@media (hover: hover) { .menu-pop a:hover, .menu-pop button:hover { background: var(--paper-2); } }

@media (max-width: 859px) {
  .nav-toggle { display: inline-grid; }
  .site-nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: var(--header-h);
    flex-direction: column;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
  }
  .site-header.is-open .site-nav { display: flex; }
  .site-nav a { min-height: 52px; padding-inline: var(--gutter); font-size: 1.05rem; border-top: 1px solid var(--rule); }
  .site-nav a[aria-current="page"]::after { inset-inline: auto 0; inset-inline-start: 0; top: 0; bottom: 0; width: 3px; height: auto; }
  .user-btn .name { display: none; }
  .user-btn { padding: 3px; }
}

/* ---------- Footer ---------- */
.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  background: var(--panel);
  color: var(--on-panel-2);
  font-size: 0.92rem;
  overflow: hidden;
}
.site-footer a { color: var(--on-panel); text-decoration-color: var(--panel-line); }
@media (hover: hover) { .site-footer a:hover { color: #fff; text-decoration-color: var(--red); } }
.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr);
  padding-block: 48px 36px;
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.footer-grid h4 {
  color: var(--on-panel-2);
  margin-bottom: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.footer-blurb { color: var(--on-panel); max-width: 38ch; font-size: 1rem; line-height: 1.55; }
.footer-operator { margin-top: 14px; }
.footer-links { list-style: none; padding: 0; display: grid; gap: 2px; }
.footer-links a { display: inline-block; padding-block: 5px; text-decoration: none; }
.footer-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(7rem, 27vw, 24rem);
  line-height: 0.72;
  color: var(--on-panel);
  margin: 0 0 -0.08em;
  letter-spacing: -0.01em;
  user-select: none;
  white-space: nowrap;
}
.footer-wordmark .dot { color: var(--led); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding-block: 16px;
  border-top: 1px solid var(--panel-line);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}
.site-footer .brand { color: var(--on-panel); }
.site-footer .brand-mark { background: var(--on-panel); color: var(--red); }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 0;
  font-weight: 600;
  font-size: 0.97rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition-property: background-color, color, border-color, transform;
  transition-duration: 0.12s;
  transition-timing-function: var(--ease);
}
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary { background: var(--ink); color: var(--paper); }
@media (hover: hover) { .btn-primary:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: #fff; } }

.btn-secondary { background: transparent; color: var(--ink); }
@media (hover: hover) { .btn-secondary:hover:not(:disabled) { background: var(--ink); color: var(--paper); } }

.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
@media (hover: hover) { .btn-ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--rule); } }

.btn-danger { background: transparent; color: var(--red-ink); border-color: var(--red-ink); }
@media (hover: hover) { .btn-danger:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: #fff; } }

.btn-success { background: var(--ink); color: var(--paper); }
@media (hover: hover) { .btn-success:hover:not(:disabled) { background: #000; } }

.btn-lg { min-height: 56px; padding: 0 30px; font-size: 1.05rem; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.88rem; }
.btn-sm::after { content: ""; position: absolute; inset: -5px 0; } /* 44px hit area */
.btn-block { display: flex; width: 100%; }

.btn.is-busy { pointer-events: none; }
.btn.is-busy::before {
  content: "";
  width: 9px;
  height: 9px;
  background: currentColor;
  animation: blink 0.6s steps(2, jump-none) infinite;
}
.link-btn {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 4px;
  cursor: pointer;
}

/* ---------- Forms ---------- */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.form-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: 1 / -1; }
}
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; align-content: start; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.field .req { color: var(--red-ink); margin-inline-start: 2px; }
.hint { font-size: 0.82rem; color: var(--ink-3); }
.field-error { font-size: 0.84rem; color: var(--red-ink); font-weight: 600; }

.input,
.select,
.textarea,
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 0;
  font-size: 1rem;
  line-height: 1.4;
  transition: box-shadow 0.12s, background-color 0.12s;
  appearance: none;
  -webkit-appearance: none;
}
.field textarea, .textarea { min-height: 100px; resize: vertical; }
.field select, .select {
  padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23121211' stroke-width='2.5' stroke-linecap='square'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
}
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: #8d8b84; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--ink), 0 0 0 2px var(--red);
}
.field input:disabled, .field select:disabled, .field textarea:disabled {
  background: var(--paper-2);
  color: var(--ink-3);
  border-color: var(--rule);
  cursor: not-allowed;
}
.is-invalid,
.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid { border-color: var(--red) !important; box-shadow: inset 0 0 0 1px var(--red) !important; }

.input-ltr, .field input.input-ltr { direction: ltr; text-align: left; }
.input-ltr:placeholder-shown, .field input.input-ltr:placeholder-shown { direction: rtl; text-align: right; }
.input-code {
  direction: ltr;
  text-align: center !important;
  font-family: var(--font-mono);
  font-size: 1.7rem !important;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  min-height: 64px !important;
  font-weight: 500;
}

.input-affix {
  display: flex;
  direction: ltr;
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--ink);
}
.input-affix:focus-within { background: #fff; box-shadow: 0 0 0 2px var(--red); }
.input-affix .affix {
  display: grid;
  place-items: center;
  padding-inline: 14px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-weight: 500;
  white-space: nowrap;
  background: var(--paper-2);
  border-inline-end: 1px solid var(--ink);
}
.input-affix .affix-end { border-inline-end: 0; border-inline-start: 1px solid var(--ink); }
.input-affix input, .field .input-affix input {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  text-align: left;
  min-width: 0;
  font-family: var(--font-mono);
}
.input-affix.is-invalid { border-color: var(--red) !important; }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; line-height: 1.5; }
.check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); cursor: pointer; }

.char-count { font-size: 0.8rem; color: var(--ink-3); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.char-count.is-over { color: var(--red-ink); font-weight: 600; }

/* segmented control (also radio groups) */
.seg {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--ink);
  background: var(--card);
}
.seg button, .seg label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-inline-start: 1px solid var(--ink);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s, color 0.12s;
}
.seg > :first-child { border-inline-start: 0; }
@media (hover: hover) { .seg button:hover, .seg label:hover { color: var(--ink); background: var(--paper-2); } }
.seg button[aria-pressed="true"],
.seg button[aria-selected="true"],
.seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
.seg input { position: absolute; opacity: 0; inset: 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--ink);
  padding: 20px;
  min-width: 0;
}
@media (min-width: 640px) { .card { padding: 26px; } }
.card-flat { background: transparent; border-color: var(--rule); }
.card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}
.card-head h2, .card-head h3 { font-size: 1.15rem; }
.card-head p { color: var(--ink-3); font-size: 0.88rem; }

/* stat tiles: ruled grid */
.stat-grid {
  display: grid;
  gap: 1px;
  padding: 1px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}
/* outlines overlap in the 1px gaps, so empty grid cells stay blank instead of turning black */
.stat { background: var(--card); outline: 1px solid var(--ink); padding: 16px 18px 18px; min-width: 0; container-type: inline-size; }
@media (max-width: 639px) { .stat-grid > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.stat-label { font-size: 0.8rem; color: var(--ink-2); font-weight: 600; letter-spacing: 0.02em; }
.stat-value {
  margin-top: 10px;
  font-family: var(--font-mono);
  /* money never breaks mid-number; it shrinks with its card instead */
  font-size: clamp(1.05rem, 12cqi, 2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat-sub { margin-top: 6px; font-size: 0.8rem; color: var(--ink-3); }
.stat-hero { background: var(--panel); color: var(--on-panel); }
.stat-hero .stat-label { color: var(--on-panel-2); }
.stat-hero .stat-value { color: var(--led); }
.stat-hero .stat-sub { color: var(--on-panel-2); }
.stat-money .stat-value { color: var(--ink); }

/* meter: segmented like an LED bar */
.meter {
  height: 12px;
  border: 1px solid var(--ink);
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, var(--paper) 9px 11px),
    var(--paper-2);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  width: calc(var(--value, 0) * 1%);
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, var(--card) 9px 11px),
    var(--ink);
  transition: width 0.5s var(--ease);
}

/* key/value list */
.kv { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; border-top: 1px solid var(--ink); }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 600; text-align: end; font-variant-numeric: tabular-nums; }

/* ---------- Badges + notices ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  background: transparent;
  color: var(--ink);
}
.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; flex: none; }
.badge-plain::before { display: none; }
.badge-success { background: var(--ink); color: var(--paper); }
.badge-success::before { background: var(--led); }
.badge-warn { border-style: dashed; color: var(--ink); }
.badge-warn::before { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.badge-danger { border-color: var(--red-ink); color: var(--red-ink); }
.badge-info { border-color: var(--rule); color: var(--ink-2); }
.badge-brand { background: var(--red); border-color: var(--red); color: #fff; }
.badge-brand::before { display: none; }

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--paper-2);
  border-inline-start: 3px solid var(--ink);
  color: var(--ink);
  font-size: 0.93rem;
  line-height: 1.55;
}
.notice > svg { flex: none; width: 19px; height: 19px; margin-top: 2px; }
.notice strong { color: var(--ink); }
.notice-info { border-inline-start-color: var(--ink-3); }
.notice-warn { border-inline-start-color: var(--ink); background: repeating-linear-gradient(-45deg, var(--paper-2) 0 10px, #e2e0d8 10px 11px); }
.notice-danger { border-inline-start-color: var(--red); background: var(--red-soft); }
.notice-danger > svg { color: var(--red-ink); }
.notice-success { border-inline-start-color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--rule); }

/* ---------- Tables ---------- */
.table-wrap {
  position: relative; /* keeps visually-hidden cells inside the scroll box in RTL */
  overflow-x: auto;
  border: 1px solid var(--ink);
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}
.tbl { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.tbl th {
  text-align: start;
  padding: 10px 14px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: var(--paper-2);
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
.tbl td { padding: 13px 14px; border-top: 1px solid var(--rule); vertical-align: middle; }
.tbl tbody tr:first-child td { border-top: 0; }
@media (hover: hover) { .tbl tbody tr:hover td { background: var(--paper); } }
.tbl .t-num { text-align: end; font-family: var(--font-mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th.t-num { text-align: end; font-family: var(--font-sans); }
.tbl .t-actions { text-align: end; white-space: nowrap; }
.tbl .t-actions > * + * { margin-inline-start: 6px; }
.tbl .t-main { font-weight: 600; }
.tbl .t-sub { display: block; font-size: 0.82rem; color: var(--ink-3); font-weight: 400; }

@media (max-width: 639px) {
  .tbl-stack thead { display: none; }
  .tbl-stack, .tbl-stack tbody, .tbl-stack tr, .tbl-stack td { display: block; width: 100%; }
  .tbl-stack tr { padding: 12px 14px; border-top: 1px solid var(--ink); }
  .tbl-stack tbody tr:first-child { border-top: 0; }
  .tbl-stack td { border: 0 !important; padding: 5px 0; display: flex; justify-content: space-between; gap: 16px; align-items: center; text-align: end; }
  .tbl-stack td::before { content: attr(data-label); color: var(--ink-3); font-family: var(--font-sans); font-size: 0.8rem; font-weight: 500; letter-spacing: 0; text-align: start; flex: none; }
  .tbl-stack td[data-label=""]::before, .tbl-stack td:not([data-label])::before { content: none; }
  .tbl-stack .t-actions { justify-content: flex-end; flex-wrap: wrap; }
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--ink);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  flex: none;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: color 0.12s, background-color 0.12s;
}
@media (hover: hover) { .tab:hover { color: var(--ink); background: var(--paper-2); } }
.tab[aria-selected="true"] { color: var(--paper); background: var(--ink); }
.tab .count {
  min-width: 20px;
  padding: 0 5px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- Dialog / modal ---------- */
dialog.modal {
  width: min(100% - 32px, 500px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--card);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: auto;
}
dialog.modal[open] { animation: modal-in 0.18s var(--ease); }
dialog.modal::backdrop { background: rgba(18, 18, 17, 0.55); }
dialog.modal[open]::backdrop { animation: fade-in 0.18s ease; }
.modal-body { padding: 24px; display: grid; gap: 14px; }
.modal-body h2 { font-family: var(--font-display); font-size: 2.6rem; line-height: 0.95; font-weight: 700; letter-spacing: 0; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--ink); background: var(--paper); }
.modal-wide { width: min(100% - 32px, 760px); }

/* ---------- Toasts ---------- */
.toast-region {
  position: fixed;
  inset-inline: 0;
  bottom: 16px;
  z-index: 300;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-inline: 16px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(100%, 460px);
  padding: 13px 16px;
  background: var(--panel);
  color: var(--on-panel);
  border: 1px solid var(--panel);
  font-size: 0.95rem;
  pointer-events: auto;
  animation: toast-in 0.2s var(--ease);
}
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity 0.18s, transform 0.18s; }
.toast::before { content: ""; flex: none; width: 8px; height: 8px; background: var(--on-panel); }
.toast-error { background: var(--red); border-color: var(--red); color: #fff; }
.toast-error::before { background: #fff; }

/* ---------- Misc components ---------- */
.empty {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-3);
  border: 1px dashed var(--rule);
}
.empty strong { color: var(--ink); font-size: 1.02rem; }
.empty svg { width: 32px; height: 32px; color: var(--ink-3); margin-bottom: 4px; }

.skeleton {
  display: block;
  min-height: 1em;
  background: var(--paper-2);
  animation: dim 1.2s steps(2, jump-none) infinite;
  color: transparent !important;
  user-select: none;
}
.spinner {
  width: 12px;
  height: 12px;
  background: var(--ink);
  animation: blink 0.6s steps(2, jump-none) infinite;
}
.loading-block { display: grid; place-items: center; padding: 48px 0; }

/* code / install commands */
.codebox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
  background: var(--panel);
  color: var(--on-panel);
  padding: 4px 4px 4px 16px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  min-height: 52px;
  border: 1px solid var(--panel);
}
.codebox + .codebox { border-top-color: var(--panel-line); }
.codebox code { flex: 1 1 auto; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; padding-block: 10px; }
.codebox .prompt { color: var(--led); user-select: none; margin-inline-end: 10px; }
.copy-btn {
  flex: none;
  position: relative;
  min-width: 64px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--panel-line);
  background: transparent;
  color: var(--on-panel);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s;
}
@media (hover: hover) { .copy-btn:hover { background: var(--on-panel); color: var(--panel); } }
.copy-btn.is-done { background: var(--led); border-color: var(--led); color: #fff; }

/* steps: ruled list with mono indices */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--ink); }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 16px 0 16px;
  padding-inline-start: 56px;
  border-bottom: 1px solid var(--rule);
}
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  inset-inline-start: 0;
  top: 16px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--red-ink);
  direction: ltr;
}
.steps h3, .steps h4 { margin-bottom: 4px; }
.steps p { color: var(--ink-2); }

/* FAQ: ruled list */
.faq { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--ink); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 16px 0;
  font-weight: 600;
  font-size: 1.08rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 1.1rem;
  transition: background-color 0.12s, color 0.12s;
}
.faq details[open] summary::after { content: "−"; background: var(--ink); color: var(--paper); }
@media (hover: hover) { .faq summary:hover::after { background: var(--ink); color: var(--paper); } }
.faq .answer { padding: 0 0 22px; color: var(--ink-2); max-width: 70ch; }
.faq .answer > * + * { margin-top: 10px; }

/* prose (legal pages) */
.prose { color: var(--ink-2); font-size: 1.02rem; line-height: 1.8; }
.prose h2 { color: var(--ink); font-size: 1.4rem; margin: 48px 0 12px; padding-top: 14px; border-top: 1px solid var(--ink); }
.prose h3 { color: var(--ink); font-size: 1.1rem; margin: 28px 0 8px; }
.prose p + p { margin-top: 12px; }
.prose p, .prose ul, .prose ol { margin-top: 12px; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--red-ink); }
.prose strong { color: var(--ink); }
.prose .toc { background: var(--card); border: 1px solid var(--ink); padding: 18px 22px; margin-top: 24px; }
.prose .toc ol { margin-top: 6px; }
.draft-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  background: repeating-linear-gradient(-45deg, var(--card) 0 12px, var(--paper-2) 12px 13px);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}
.placeholder-mark { background: var(--red-soft); color: var(--red-ink); padding: 0 6px; font-weight: 600; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; direction: ltr; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-mono); font-size: 10.5px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: var(--rule); stroke-width: 1; }
.chart .bar { fill: var(--chart-color, var(--ink)); transition: fill 0.12s, opacity 0.12s; }
.chart .bar.is-zero { opacity: 0.25; }
.chart .bar-hit { fill: transparent; cursor: pointer; }
.chart .bar.is-active { fill: var(--red); }
.chart.is-hovering .bar:not(.is-active) { opacity: 0.5; }
.chart-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  transform: translate(-50%, -100%);
  margin-top: -8px;
  padding: 6px 10px;
  background: var(--panel);
  color: var(--on-panel);
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: nowrap;
  text-align: center;
  direction: rtl;
}
.chart-tooltip b { display: block; font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.chart-empty { display: grid; place-items: center; min-height: 140px; color: var(--ink-3); font-size: 0.92rem; border: 1px dashed var(--rule); }

/* ---------- LED display ---------- */
.led { display: inline-block; height: 1em; width: auto; overflow: visible; color: var(--led); }
.led .on { fill: currentColor; }
.led .off { fill: currentColor; opacity: 0.07; }
.led-panel {
  background: var(--panel);
  color: var(--led);
  padding: 18px 20px;
  border: 1px solid var(--ink);
}
.led-panel .led { filter: drop-shadow(0 0 6px rgba(255, 59, 47, 0.45)); }
.led-label { font-size: 0.75rem; color: var(--on-panel-2); font-weight: 600; letter-spacing: 0.06em; }

/* ---------- Receipt ---------- */
.receipt {
  position: relative;
  background: #fbfaf7;
  border: 1px solid var(--ink);
  padding: 22px 22px 26px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
}
.receipt::after {
  content: "";
  position: absolute;
  inset-inline: -1px;
  bottom: -9px;
  height: 9px;
  background:
    linear-gradient(135deg, var(--ink) 25%, transparent 25%) 0 0 / 12px 9px,
    linear-gradient(225deg, var(--ink) 25%, transparent 25%) 0 0 / 12px 9px;
  opacity: 0.9;
}
.receipt .r-title { font-family: var(--font-sans); font-weight: 700; font-size: 0.95rem; text-align: center; }
.receipt .r-sub { font-family: var(--font-sans); color: var(--ink-3); font-size: 0.78rem; text-align: center; }
.receipt .r-row { display: flex; justify-content: space-between; gap: 16px; padding-block: 4px; }
.receipt .r-row > :first-child { font-family: var(--font-sans); }
.receipt .r-row > :last-child { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; white-space: nowrap; }
.receipt .r-rule { border: 0; border-top: 1px dashed var(--ink); margin: 10px 0; height: 0; background: none; }
.receipt .r-total { font-weight: 600; font-size: 1.05rem; }

/* meta row: hairline-separated facts */
.meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 1px;
  padding: 1px 0;
}
.meta-row > * { background: var(--paper); outline: 1px solid var(--ink); padding: 14px 16px; min-width: 0; }
.meta-row .mv { display: block; font-family: var(--font-mono); font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; direction: ltr; unicode-bidi: isolate; text-align: right; } /* LTR digits, RTL page: align with the labels */
.meta-row .ml { display: block; margin-top: 6px; color: var(--ink-2); font-size: 0.86rem; line-height: 1.4; }

/* ==========================================================================
   Ad previews (always labelled "מודעה")
   ========================================================================== */
.mock-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  margin-bottom: 8px;
}

/* Claude Code terminal */
.mock-term {
  direction: ltr;
  background: var(--panel);
  color: var(--on-panel);
  border: 1px solid var(--ink);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  text-align: left;
}
.mock-term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--panel-line);
}
.mock-dots { display: flex; gap: 6px; }
.mock-dots i { width: 9px; height: 9px; border-radius: 50%; background: #3b3b37; display: block; }
.mock-term-title { flex: 1; text-align: center; color: var(--on-panel-2); font-size: 11.5px; padding-inline-end: 40px; }
.mock-term-body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.mt-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.mt-dim { color: var(--on-panel-2); }
.mt-accent { color: #e8875f; }
.mt-ok { color: #7cc47a; }
.mt-spin::before {
  content: "✻";
  display: inline-block;
  width: 1.4em;
  color: #e8875f;
  animation: glyph 1.6s steps(1) infinite;
}
.mock-ad-band {
  direction: rtl;
  text-align: right;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin-top: 6px;
  padding: 8px 12px;
  background: #1a1a18;
  border: 1px solid #34342f;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  color: #cfcdc5;
}
.mock-ad-band .tag {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  background: var(--red);
  color: #fff;
}
.mock-ad-band .sep { color: #5a5952; }
.mock-ad-band .txt { color: #f4f3ee; font-weight: 500; overflow-wrap: anywhere; }
.mock-ad-band .adv { color: var(--on-panel-2); }
.mock-ad-band .who { white-space: nowrap; }
.mock-ad-band .arrow { color: var(--led); }
.mock-ad-band.is-empty .txt { color: #6b6a63; font-weight: 400; }
.mock-prompt {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid #3b3b37;
  color: var(--on-panel);
}
.mock-prompt .caret { color: #e8875f; font-weight: 700; }
.mock-prompt .ph { color: #6b6a63; }
.mock-hint { color: #6b6a63; font-size: 11.5px; padding-inline: 4px; }

/* Claude Desktop (a depiction of Anthropic's app, kept neutral) */
.mock-desktop {
  --md-bg: #f5f4ef;
  --md-side: #ecebe5;
  --md-card: #ffffff;
  --md-text: #2a2925;
  --md-dim: #85837b;
  --md-line: rgba(42, 41, 37, 0.13);
  direction: rtl;
  display: grid;
  grid-template-columns: 54px 1fr;
  background: var(--md-bg);
  color: var(--md-text);
  border: 1px solid var(--ink);
  overflow: hidden;
  min-height: 300px;
  font-size: 13.5px;
}
.md-side { background: var(--md-side); padding: 14px 0; display: grid; align-content: start; justify-items: center; gap: 12px; border-inline-end: 1px solid var(--md-line); }
.md-side i { display: block; width: 24px; height: 24px; border-radius: 7px; background: var(--md-line); }
.md-side i:first-child { background: #d97757; }
.md-main { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; }
.md-top { padding: 12px 18px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--md-line); display: flex; justify-content: space-between; gap: 8px; }
.md-top span { color: var(--md-dim); font-weight: 500; font-family: var(--font-mono); font-size: 12px; direction: ltr; }
.md-chat { padding: 18px; display: grid; gap: 12px; align-content: start; }
.md-user { justify-self: start; max-width: 85%; padding: 9px 14px; background: var(--md-card); border-radius: 14px; box-shadow: 0 0 0 1px var(--md-line); }
.md-bot { color: var(--md-text); max-width: 92%; }
.md-bot .md-dim { color: var(--md-dim); }
.md-status { display: flex; align-items: center; gap: 8px; color: var(--md-dim); font-size: 12.5px; }
.md-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #d97757; animation: pulse 1.4s ease-in-out infinite; }
.md-foot { padding: 0 14px 14px; display: grid; gap: 8px; }
.md-ad {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 12px;
  background: var(--md-card);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--md-line);
  font-size: 13px;
  line-height: 1.5;
}
.md-ad .tag { flex: none; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; background: var(--red); color: #fff; }
.md-ad .txt { font-weight: 500; overflow-wrap: anywhere; }
.md-ad .adv { color: var(--md-dim); }
.md-ad .arrow { color: var(--red-ink); margin-inline-start: auto; }
.md-ad.is-empty .txt { color: var(--md-dim); font-weight: 400; }
.md-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  background: var(--md-card);
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--md-line);
  color: var(--md-dim);
}
.md-send { width: 30px; height: 30px; border-radius: 10px; background: #d97757; display: grid; place-items: center; color: #fff; flex: none; }
.md-send svg { width: 16px; height: 16px; }
@media (max-width: 480px) {
  .mock-term-body { padding-inline: 12px; }
  .mock-desktop { grid-template-columns: 40px 1fr; }
}

/* ---------- Generic landing helpers (kept for older markup) ---------- */
.hero { position: relative; padding-block: clamp(36px, 7vw, 88px) clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; gap: 40px; align-items: center; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; } }
.hero h1 .accent { color: var(--red); }
.hero-sub { font-size: clamp(1.05rem, 1vw + 0.9rem, 1.25rem); color: var(--ink-2); max-width: 560px; margin-top: 18px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.split { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; } }
.cta-band { background: var(--panel); color: var(--on-panel); padding: clamp(28px, 5vw, 56px); display: grid; gap: 18px; justify-items: start; }
.cta-band p { color: var(--on-panel-2); max-width: 540px; }

/* auth / centered card pages */
.auth-wrap { min-height: calc(100dvh - var(--header-h) - 260px); display: grid; align-content: center; padding-block: 40px; }
.provider-btn { display: flex; width: 100%; gap: 12px; justify-content: center; }
.provider-btn svg { width: 20px; height: 20px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 0.82rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.result-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-inline: auto;
  border: 1px solid var(--ink);
}
.result-icon svg { width: 30px; height: 30px; }
.result-ok { background: var(--ink); color: var(--paper); }
.result-bad { background: var(--red); border-color: var(--red); color: #fff; }
.result-wait { background: var(--paper-2); color: var(--ink); border-style: dashed; }

.auth-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.6rem, 5vw, 3.4rem); line-height: 0.92; letter-spacing: 0; }
.auth-sub { margin-top: 10px; color: var(--ink-2); }
.center-row { justify-content: center; }
.skeleton-block { height: 72px; }

/* linked-device list */
.device-list { list-style: none; padding: 0; display: grid; border-top: 1px solid var(--ink); }
.device { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.device-ico { flex: none; width: 40px; height: 40px; border: 1px solid var(--ink); display: grid; place-items: center; color: var(--ink); background: var(--card); }
.device-ico svg { width: 19px; height: 19px; }

/* demo-mode flag */
.mock-flag {
  position: fixed;
  inset-inline-start: 12px;
  bottom: 12px;
  z-index: 250;
  padding: 6px 12px;
  background: var(--red);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}
.mock-flag a { color: inherit; margin-inline-start: 8px; text-decoration-color: #fff; }

/* ---------- Motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0.2; } }
@keyframes dim { 50% { opacity: 0.55; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes glyph {
  0% { content: "·"; }
  20% { content: "✢"; }
  40% { content: "✳"; }
  60% { content: "✶"; }
  80% { content: "✻"; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.reveal > * { animation: rise 0.4s var(--ease) both; }
.reveal > *:nth-child(2) { animation-delay: 0.05s; }
.reveal > *:nth-child(3) { animation-delay: 0.1s; }
.reveal > *:nth-child(4) { animation-delay: 0.15s; }
.reveal > *:nth-child(5) { animation-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .site-footer, .mock-flag, .toast-region { display: none !important; }
  body { background: #fff; color: #000; }
}

.notfound-code { line-height: 1; }
.next-steps { text-align: start; }
.next-note { text-align: start; }
.receipt-kv { text-align: start; }
