
:root {
  --bg: #0b0d12; --surface: #141821; --surface-2: #1b2130; --border: #2a3245;
  --text: #e8ebf2; --muted: #a3abbd; --ok: #6ee7b7; --warn: #fcd34d; --danger: #fca5a5;
  --warn-bg: #2f2609; --danger-bg: #3b1518; --ok-bg: #0d2a20;
  --brand: #6d4aff; --brand-text: #ffffff;
  --radius: 12px; --tap: 44px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
h1 { font-size: 24px; line-height: 1.25; margin: 4px 0 16px; }
h2 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0; }

.test-banner { background: var(--warn-bg); color: #fde68a; text-align: center; font-size: 13px; padding: 4px 8px; }
.top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: rgba(11, 13, 18, 0.94); border-bottom: 1px solid var(--border); }
.top .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); flex: none; }
.top .org { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .who { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }

main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 880px; margin: 0 auto; }
.stack { display: grid; gap: 12px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.head h1 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.flush { margin: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); min-height: 64px; }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 8px; min-height: var(--tap); min-width: var(--tap);
  padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; touch-action: manipulation; }
.btn-primary { background: var(--brand); color: var(--brand-text); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-block { width: 100%; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

form.stack { gap: 16px; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { font-weight: 600; font-size: 14px; padding: 0; }
input, select, textarea { width: 100%; min-width: 0; min-height: var(--tap); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; }
.field .error { color: var(--danger); font-size: 14px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
textarea { resize: vertical; min-height: 88px; line-height: 1.4; }
.disclosure { padding: 0; }
.disclosure > summary { display: flex; align-items: center; min-height: var(--tap); padding: 10px 16px; font-weight: 600; cursor: pointer; }
.disclosure[open] > summary { border-bottom: 1px solid var(--border); }
.disclosure > .stack { padding: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; justify-content: center; min-height: var(--tap); border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2); font-weight: 600; }
.choice input:checked + span { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.choices-stack { grid-template-columns: 1fr; }
.choices-stack .choice span { justify-content: flex-start; padding: 10px 14px; text-align: left; }
.choice input:disabled { cursor: not-allowed; }
.choice input:disabled + span { opacity: 0.5; }
.choice-link { color: inherit; text-decoration: none; }
.choice-link[aria-current="page"] span { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.choice-link:focus-visible { outline: none; }
.choice-link:focus-visible span { outline: 3px solid var(--brand); outline-offset: 2px; }
.card.offer { border: 2px solid var(--brand); }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: var(--tap); padding: 10px 0; cursor: pointer; }
.check input { width: 24px; height: 24px; min-height: 0; min-width: 24px; margin: 0; padding: 0; flex: none; accent-color: var(--brand); }
.check input:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.chip { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.chip-warn { color: var(--warn); }
.chip-ok { color: var(--ok); }
.chip-danger { color: var(--danger); }

.notice { padding: 10px 12px; border-radius: 10px; font-size: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.notice-warn { background: var(--warn-bg); border-color: #6b5513; color: #fde68a; }
.notice-error { background: var(--danger-bg); border-color: #7f1d1d; color: #fecaca; }
.notice-ok { background: var(--ok-bg); border-color: #14532d; color: #bbf7d0; }

.steps { margin: 0; padding-left: 20px; }
.back { display: inline-flex; align-items: center; min-height: 32px; color: var(--muted); text-decoration: none; font-size: 14px; }
button.back { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; cursor: pointer; justify-self: start; }
.hint { color: var(--muted); font-size: 14px; }
.unit { display: flex; align-items: center; gap: 10px; }
.unit input { max-width: 132px; }
.unit span { color: var(--muted); font-size: 15px; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.person:first-child { padding-top: 0; }
.person:last-child { padding-bottom: 0; border-bottom: 0; }
.person .who { display: grid; gap: 2px; min-width: 0; }
.person .who span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.choices .choice .role-choice { display: grid; gap: 2px; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; justify-content: start; text-align: left; }
.role-choice small { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.35; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h2 { margin: 0; }
.facts dd .chip { margin-left: 6px; }
.discount { display: grid; grid-template-columns: minmax(0, 1fr) 84px 84px; gap: 8px 10px; align-items: center; }
.discount-row { display: contents; }
.discount .col { color: var(--muted); font-size: 13px; font-weight: 600; }
.discount input { text-align: right; }
.discount input[aria-invalid="true"] { border-color: var(--danger); }
.discount .error { grid-column: 1 / -1; color: var(--danger); font-size: 14px; }
.change { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.change:first-child { padding-top: 0; }
.change:last-child { border-bottom: 0; padding-bottom: 0; }
.change .from-to { font-size: 17px; font-weight: 700; }
.change .from-to s { color: var(--muted); font-weight: 400; }
.log { display: grid; gap: 10px; }
.log .entry { display: grid; gap: 2px; }
.timeline { display: grid; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.stat strong { font-size: 30px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; }
.stat-ok strong { color: var(--ok); }
.stat-warn strong { color: var(--warn); }
.drop { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 18px 14px; border: 1px dashed var(--border); border-radius: 12px; }
.drop input[type="file"] { max-width: 100%; color: var(--muted); }
.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th { color: var(--muted); font-weight: 600; font-size: 13px; text-align: left; padding: 6px 4px; }
.compare td { padding: 8px 4px; border-top: 1px solid var(--border); vertical-align: top; }
.compare .differs { color: var(--warn); font-weight: 700; }
.days { display: grid; gap: 8px; padding-left: 0; list-style: none; margin: 0; }
.days li { padding-left: 12px; border-left: 2px solid var(--ok); }
.days li.open { border-left-color: var(--warn); }
.check-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 4px 0; background: none; border: 0; color: var(--text); font: inherit; font-size: 17px; text-align: left; cursor: pointer; }
.check-row .box { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--border); font-weight: 800; color: var(--brand-text); }
.check-row[aria-pressed="true"] .box { background: var(--brand); border-color: var(--brand); }
.timeline .entry { display: grid; gap: 2px; padding-left: 12px; border-left: 2px solid var(--brand); }
.row .why { margin-top: 4px; }
.section-gap { margin: 20px 0 0; }
.steps li { margin: 6px 0; }
.lines { width: 100%; border-collapse: collapse; font-size: 15px; }
.lines td { padding: 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.lines td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.lines .total td { font-weight: 700; font-size: 17px; border-bottom: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: inherit; font-size: 15px; line-height: 1.5; }
.problems { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

.empty { text-align: center; padding: 32px 16px; display: grid; gap: 12px; justify-items: center; }
.auth { max-width: 420px; margin: 6vh auto 0; }
.code-input { letter-spacing: 0.3em; font-size: 22px; text-align: center; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; background: var(--surface);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 60px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; }
.nav .bar { width: 24px; height: 4px; border-radius: 2px; background: var(--border); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] .bar { background: var(--brand); }

@media (min-width: 900px) {
  main { padding: 24px 24px 48px; }
  .nav { position: static; justify-content: center; gap: 8px; border-top: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 0; }
  .nav a { flex: none; flex-direction: row; min-height: 48px; padding: 0 16px; font-size: 14px; }
  .nav .bar { display: none; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--brand); }
  .bookings { grid-template-columns: 1fr 1fr; }
}
:root{--brand:#6d4aff;--brand-text:#ffffff;}
