/* SideSeat site kit.
 * Colours come from the desktop app's themes (light = theme B, dark = theme A) and the logo; see brand.md.
 * Flat colour only: no gradients, no drop shadows, no backplate behind the logo. The recurring shape is the
 * logo's diamond facet, used as the marker on badges, notices, steps and selected options.
 * Class names: block, block__part, block--variant. Kit reference with markup: web/dev/UI-KIT.md. */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;
  --bg: #F2F3F5;            /* SsBg (B) */
  --surface: #FFFFFF;       /* SsPanel */
  --surface-2: #F6F7F9;     /* SsPanel2 */
  --border: #E1E4EA;        /* SsBorder */
  --border-strong: #5A616C; /* SsMuted: hover border on fields, as in the app */
  --text: #15171C;          /* SsText */
  --muted: #5A616C;         /* SsMuted */
  --input-bg: #FFFFFF;      /* SsInputBg */
  --primary: #2458D6;       /* SsMe (B): links, selection, focus, primary buttons */
  --on-primary: #FFFFFF;
  --primary-soft: #EAF0FF;  /* SsMeSoft */
  --accent: #F47FA6;        /* logo right facet: shapes only, never small text on light */
  --accent-strong: #A83A62; /* rose Dark: rose as text */
  --accent-soft: #FFE0EA;   /* logo lower centre facet */
  --danger: #B42318;        /* SsDangerText */
  --danger-soft: #FEECEB;   /* SsDangerBg */
  --danger-solid: #B42318;  /* SsDangerSolid, white text */
  --warn: #9A5B00;          /* SsWarn */
  --ok: #1F9D55;            /* SsOn: dots and shapes only (3.49:1 on white) */
  --off: #9AA1AD;           /* SsOff */
  --topbar: #FFFFFF;        /* SsTop */
  --topbar-border: #E4E7EC; /* SsTopBorder */
  --backdrop: rgb(14 16 20 / 0.55); /* SsBg (A) behind dialogs */

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --font: "Noto Sans TC", "Microsoft JhengHei UI", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", "Menlo", ui-monospace, monospace;
  --page-max: 1040px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1014;
    --surface: #171A21;
    --surface-2: #1E222B;
    --border: #2A2F3A;
    --border-strong: #A3A9B5;
    --text: #ECEEF2;
    --muted: #A3A9B5;
    --input-bg: #11141A;
    --primary: #6EA8FF;
    --on-primary: #0A1426;
    --primary-soft: #1A2740;
    --accent: #F47FA6;
    --accent-strong: #FFC1D6;
    --accent-soft: #1E222B;
    --danger: #FF9A8F;
    --danger-soft: #3A1E1E;
    --danger-solid: #C93A2E;
    --warn: #FFC266;
    --ok: #3DDC84;
    --off: #6B7280;
    --topbar: #0E1014;
    --topbar-border: #22262F;
    --backdrop: rgb(0 0 0 / 0.6);
  }
}

/* Same set as the block above, for an explicit choice (nothing sets it yet). Keep the two identical. */
:root[data-theme="dark"] {
  --bg: #0E1014;
  --surface: #171A21;
  --surface-2: #1E222B;
  --border: #2A2F3A;
  --border-strong: #A3A9B5;
  --text: #ECEEF2;
  --muted: #A3A9B5;
  --input-bg: #11141A;
  --primary: #6EA8FF;
  --on-primary: #0A1426;
  --primary-soft: #1A2740;
  --accent: #F47FA6;
  --accent-strong: #FFC1D6;
  --accent-soft: #1E222B;
  --danger: #FF9A8F;
  --danger-soft: #3A1E1E;
  --danger-solid: #C93A2E;
  --warn: #FFC266;
  --ok: #3DDC84;
  --off: #6B7280;
  --topbar: #0E1014;
  --topbar-border: #22262F;
  --backdrop: rgb(0 0 0 / 0.6);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.35; }
h1 { font-size: 30px; letter-spacing: -0.01em; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
ul, ol { padding-left: 1.4em; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.94em; }

a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--primary-soft); color: var(--text); }

noscript { display: block; }

/* ---------- Helpers ---------- */

.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* Vertical rhythm: children of a stack are spaced evenly; nest stacks for tighter groups. */
.stack > * + * { margin-top: 24px; }
.stack--tight > * + * { margin-top: 12px; }
.stack--loose > * + * { margin-top: 48px; }

/* ---------- Page chrome ---------- */

.site-header {
  background: var(--topbar);
  border-bottom: 1px solid var(--topbar-border);
}

.site-header__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.brand:hover { text-decoration: none; }
.brand__logo { width: 32px; height: 32px; }
.brand__name { font-size: 18px; font-weight: 700; letter-spacing: 0.01em; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-width: 0;
}
.site-nav__link { font-size: 15px; font-weight: 500; color: var(--text); text-decoration: none; }
.site-nav__link:hover { color: var(--primary); }
.site-nav__email {
  font-size: 14px;
  color: var(--muted);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}
.site-footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px var(--gutter) 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; }
.site-footer__links a { color: var(--muted); }
.site-footer__links a:hover { color: var(--primary); }

.noscript {
  max-width: var(--page-max);
  margin: 16px auto 0;
  padding: 0 var(--gutter);
  color: var(--warn);
  font-size: 14px;
}

/* ---------- Page container ---------- */

.page {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 40px var(--gutter) 64px;
}
.page--narrow { max-width: 760px; }

.page-head > * + * { margin-top: 8px; }
.page-title { font-size: 30px; }
.lede { font-size: 18px; color: var(--muted); max-width: 40em; }

.section > * + * { margin-top: 16px; }
.section__title { font-size: 22px; }

/* ---------- Card ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card > * + * { margin-top: 16px; }
.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.card__title { font-size: 20px; }
.card__note { color: var(--muted); font-size: 14px; }
.card__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.card--quiet { background: var(--surface-2); }

/* A card whose top edge carries the logo's two colours as flat facets: use once per page at most. */
.card--marked { position: relative; overflow: hidden; }
.card--marked::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--primary);
  clip-path: polygon(0 0, 62% 0, 60% 100%, 0 100%);
}
.card--marked::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent);
  clip-path: polygon(62% 0, 100% 0, 100% 100%, 60% 100%);
}

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; box-shadow: inset 0 0 0 100vmax color-mix(in srgb, var(--btn-fg) 8%, transparent); }
.btn:active { box-shadow: inset 0 0 0 100vmax color-mix(in srgb, var(--btn-fg) 16%, transparent); }
.btn:focus-visible { border-radius: var(--radius-sm); }

.btn--primary { --btn-bg: var(--primary); --btn-fg: var(--on-primary); --btn-border: var(--primary); }
.btn--secondary { --btn-bg: var(--surface); --btn-fg: var(--text); --btn-border: var(--border); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--primary); --btn-border: transparent; }
.btn--danger { --btn-bg: var(--surface); --btn-fg: var(--danger); --btn-border: var(--border); }
.btn--danger-solid { --btn-bg: var(--danger-solid); --btn-fg: #FFFFFF; --btn-border: var(--danger-solid); }
.btn--small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--ghost.btn--small { padding: 0 8px; }
.btn--block { display: flex; width: 100%; }

.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* Busy: the label stays, a ring turns beside it. The script also sets disabled. */
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::before {
  content: "";
  width: 1em;
  height: 1em;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ss-spin 0.8s linear infinite;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

@keyframes ss-spin { to { transform: rotate(360deg); } }

/* ---------- Diamond marker (shared by badges, notices, errors) ---------- */

.badge::before,
.notice::before,
.field__error::before,
.attention__title::before,
.legend__item::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--mark, var(--muted));
  transform: rotate(45deg);
}

/* ---------- Status badge ---------- */

.badge {
  --mark: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 12px 2px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: middle;
}
.badge::before { width: 7px; height: 7px; }
.badge--ok { --mark: var(--ok); }
.badge--info { --mark: var(--primary); color: var(--primary); }
.badge--warn { --mark: var(--warn); color: var(--warn); }
.badge--danger { --mark: var(--danger); color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge--muted { --mark: var(--off); color: var(--muted); }

/* ---------- Notice box ---------- */

.notice {
  --mark: var(--primary);
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--text);
}
.notice::before { position: relative; top: -1px; }
.notice__body { min-width: 0; flex: 1; }
.notice__body > * + * { margin-top: 6px; }
.notice__title { font-weight: 700; }
.notice--info { --mark: var(--primary); background: var(--primary-soft); }
.notice--ok { --mark: var(--ok); background: var(--surface-2); border: 1px solid var(--border); }
.notice--warn { --mark: var(--warn); background: var(--surface-2); border: 1px solid var(--border); }
.notice--warn .notice__title { color: var(--warn); }
.notice--danger { --mark: var(--danger); background: var(--danger-soft); }
.notice--danger .notice__title { color: var(--danger); }

/* ---------- Forms ---------- */

.field { display: grid; gap: 6px; max-width: 460px; }
.field__label { font-weight: 500; }
.field__hint { font-size: 14px; color: var(--muted); }
.field__error {
  --mark: var(--danger);
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  color: var(--danger);
}
.field__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.field__row > .input { flex: 1 1 220px; width: auto; }

.input,
.select {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 16px; /* 16px stops phones from zooming in on focus */
  line-height: 1.4;
}
.input:hover,
.select:hover { border-color: var(--border-strong); }
.input:focus,
.select:focus { border-color: var(--primary); }
.input:focus-visible,
.select:focus-visible { outline-offset: 2px; border-radius: var(--radius-sm); }
.input[aria-invalid="true"],
.select[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled,
.select:disabled { opacity: 0.5; cursor: not-allowed; }
.input::placeholder { color: var(--muted); opacity: 1; }
.input--mono { font-family: var(--font-mono); letter-spacing: 0.06em; }
.select { cursor: pointer; }

/* ---------- Option cards (radio) ---------- */

.choices { border: 0; margin: 0; padding: 0; min-width: 0; }
.choices__legend { padding: 0; margin-bottom: 10px; font-weight: 700; font-size: 16px; }
.choices__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 12px;
}
.choices--wide .choices__grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.choice { position: relative; display: block; cursor: pointer; }
.choice__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.choice__body {
  position: relative;
  display: grid;
  gap: 2px;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.choice:hover .choice__body { border-color: var(--border-strong); }
.choice__title { font-size: 17px; font-weight: 700; }
.choice__meta { font-size: 14px; color: var(--muted); }
.choice__price { font-weight: 500; font-variant-numeric: tabular-nums; }

/* Selected: a second ring inside the border (no layout shift) and the logo's corner facet. */
.choice__input:checked + .choice__body {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: var(--primary-soft);
}
.choice__input:checked + .choice__body::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: var(--primary);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.choice__input:focus-visible + .choice__body { outline: 2px solid var(--primary); outline-offset: 3px; }
.choice__input:disabled { cursor: not-allowed; }
.choice__input:disabled + .choice__body { opacity: 0.5; }
.choice:has(.choice__input:disabled) { cursor: not-allowed; }
.choice:has(.choice__input:disabled):hover .choice__body { border-color: var(--border); }

/* ---------- Key-value list ---------- */

.kv {
  display: grid;
  grid-template-columns: minmax(8em, max-content) 1fr;
  gap: 10px 24px;
}
.kv__key { color: var(--muted); }
.kv__value { min-width: 0; font-variant-numeric: tabular-nums; }

/* ---------- Data table ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th,
.table td { padding: 12px 16px; text-align: left; vertical-align: top; border-top: 1px solid var(--border); }
.table thead th {
  border-top: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.table tbody tr:hover { background: var(--surface-2); }
.table .num,
.table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table__actions { white-space: nowrap; text-align: right; }
.table__caption { caption-side: top; text-align: left; padding: 0 0 8px; font-weight: 700; }

/* ---------- Link code display ---------- */

.code-display {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 20px 24px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
}
.code-display__label { font-size: 14px; color: var(--muted); }
.code-display__value {
  font-family: var(--font-mono);
  font-size: clamp(32px, 9vw, 46px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.12em;
  color: var(--text);
  user-select: all;
  font-variant-numeric: tabular-nums;
}
.code-display__countdown { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.code-display--expired { border-color: var(--border); background: var(--surface-2); }
.code-display--expired .code-display__value { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }

/* ---------- Copyable value ---------- */

.copy-value { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.copy-value__text {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
  user-select: all;
}

/* ---------- Order list ---------- */

.order-list { list-style: none; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.order { padding: 16px 20px; }
.order + .order { border-top: 1px solid var(--border); }
.order__main {
  display: grid;
  grid-template-columns: 9.5em 1fr auto auto;
  align-items: baseline;
  gap: 4px 20px;
}
.order__date { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.order__what { font-weight: 500; min-width: 0; }
.order__amount { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.order__state { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.order__extra { margin-top: 10px; display: grid; gap: 10px; }
.order__note { font-size: 14px; color: var(--muted); }
.order__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Payment instructions for ATM and convenience store: a native disclosure. */
.pay-info { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.pay-info__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.pay-info__summary::-webkit-details-marker { display: none; }
.pay-info__summary::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.pay-info[open] > .pay-info__summary::before { transform: rotate(45deg); }
.pay-info__summary:focus-visible { border-radius: var(--radius-sm); }
.pay-info__body { padding: 4px 14px 14px; display: grid; gap: 12px; }
.pay-info__body .kv { gap: 8px 20px; }

/* ---------- Tabs (back office) ---------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
}
.tabs__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.tabs__tab:hover { color: var(--text); }
.tabs__tab[aria-selected="true"] { color: var(--text); font-weight: 700; }
.tabs__tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}
.tabs__tab:focus-visible { outline-offset: -2px; }
.tabs__count {
  min-width: 22px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tabs__count--alert { background: var(--danger-solid); border-color: var(--danger-solid); color: #FFFFFF; }
.tabs__panel { padding-top: 24px; }

/* ---------- Needs attention ---------- */

.attention-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.attention {
  --mark: var(--warn);
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: grid;
  gap: 8px;
}
.attention--danger { --mark: var(--danger); border-color: var(--danger); }
.attention--info { --mark: var(--primary); }
.attention__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.attention__title { display: flex; align-items: baseline; gap: 10px; font-size: 17px; font-weight: 700; }
.attention__title::before { position: relative; top: -2px; }
.attention__time { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.attention__body { color: var(--text); }
.attention__details {
  list-style: none;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 14px;
  color: var(--muted);
  display: grid;
  gap: 2px;
  overflow-wrap: anywhere;
}
.attention__details code { color: var(--text); }
.attention__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* ---------- Dialog ---------- */

.dialog {
  width: calc(100% - 32px);
  max-width: 460px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
/* Open dialogs with showModal(); a dialog that is open without it (the styleguide) sits in the flow. */
.dialog:not(:modal) { position: static; margin: 0; }
.dialog::backdrop { background: var(--backdrop); }
.dialog > * + * { margin-top: 12px; }
.dialog__title { font-size: 20px; }
.dialog__body { color: var(--text); }
.dialog__actions { display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* ---------- Loading and empty ---------- */

.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 32px 0;
  color: var(--muted);
}
.loading::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  background: var(--primary);
  transform: rotate(45deg);
  animation: ss-facet 1.4s ease-in-out infinite;
}
@keyframes ss-facet {
  0%, 100% { background: var(--primary); transform: rotate(45deg) scale(1); }
  50% { background: var(--accent); transform: rotate(225deg) scale(0.8); }
}

.empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
}
.empty__title { color: var(--text); font-weight: 500; }

/* ---------- Static pages: home ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: 40px 56px;
  padding: 24px 0 16px;
}
.hero__text > * + * { margin-top: 20px; }
.hero__title {
  font-size: clamp(32px, 5.2vw, 50px);
  line-height: 1.22;
  letter-spacing: -0.015em;
}
.hero__lede { font-size: 19px; max-width: 30em; }
.hero__invite { color: var(--muted); max-width: 32em; }
.hero__cta { display: grid; justify-items: start; gap: 10px; padding-top: 8px; }

/* The logo's own geometry, large: left is you, right is the second seat, the overlap is the one computer. */
.mark-figure { display: grid; gap: 20px; justify-items: center; }
.mark-figure__art { width: 100%; max-width: 340px; height: auto; }
.legend { list-style: none; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.legend__item { display: flex; align-items: baseline; gap: 10px; }
.legend__item::before { width: 10px; height: 10px; position: relative; top: 0; }
.legend__item--me { --mark: #3F77D5; }
.legend__item--other { --mark: #CE5C83; }
.legend__item--shared { --mark: #CDE4FF; outline: 0; }
.legend__item--shared::before { box-shadow: 0 0 0 1px var(--border); }

.band { padding-top: 56px; }
.band > * + * { margin-top: 20px; }
.band__title { font-size: 24px; }

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  counter-reset: step;
}
.step {
  counter-increment: step;
  padding: 22px 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.step > * + * { margin-top: 8px; }
.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.step:last-child::before { background: var(--accent-soft); color: var(--accent-strong); }
.step__title { font-size: 18px; }
.step__text { color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.faq { border-top: 1px solid var(--border); }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__q {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 4px;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::before {
  content: "";
  flex: none;
  position: relative;
  top: -2px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--primary);
  transform: rotate(45deg);
}
.faq__item[open] > .faq__q::before { background: var(--primary); }
.faq__q:focus-visible { border-radius: 6px; }
.faq__a { padding: 0 4px 18px 27px; color: var(--muted); max-width: 44em; }

/* ---------- Static pages: terms, privacy ---------- */

.prose { max-width: 44em; }
.prose > * + * { margin-top: 16px; }
.prose h2 { margin-top: 40px; font-size: 20px; }
.prose h2 + * { margin-top: 10px; }

.toc { padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.toc__list { margin: 0; padding-left: 1.6em; display: grid; gap: 2px; font-size: 15px; }

.placeholder {
  padding: 10px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Static pages: short status (404, sign-in in progress) ---------- */

.status { max-width: 560px; padding: 48px 0 24px; }
.status > * + * { margin-top: 16px; }
.status__mark { width: 72px; height: 72px; }
.status__title { font-size: 28px; }

/* ---------- Narrow screens ---------- */

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .page { padding-top: 28px; padding-bottom: 48px; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 8px; }
  .mark-figure { justify-items: start; gap: 16px; }
  .mark-figure__art { max-width: 200px; }
  .steps { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .band { padding-top: 44px; }
  .card { padding: 20px; }
  .order__main { grid-template-columns: 1fr auto; }
  .order__date { grid-column: 1 / -1; order: -1; }
  .order__state { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 640px) {
  h1, .page-title { font-size: 26px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv__value + .kv__key { margin-top: 10px; }

  /* Tables become one block per row; each cell shows its column name from data-label. */
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .table,
  .table tbody,
  .table tr,
  .table td { display: block; width: 100%; }
  .table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 6px 14px;
  }
  .table tr + tr { margin-top: 10px; }
  .table tbody tr:hover { background: var(--surface); }
  .table td {
    display: grid;
    grid-template-columns: minmax(5em, 38%) minmax(0, 1fr);
    align-items: baseline;
    gap: 16px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .table td:first-child { border-top: 0; }
  .table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 14px;
    text-align: left;
  }
  .table td > * { justify-self: end; }
  .table td:not([data-label]) { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
  .table td:not([data-label])::before { content: none; }

  .site-nav__email { max-width: 100%; order: 3; flex-basis: 100%; }
  .dialog__actions .btn { flex: 1 1 auto; }
}

@media (max-width: 400px) {
  .brand__name { font-size: 17px; }
  .code-display { padding: 16px; }
  .order { padding: 14px 16px; }
}

/* ---------- Motion ---------- */

@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;
  }
  .loading::before { animation: none; }
  .btn[aria-busy="true"]::before { animation: none; border-right-color: currentColor; border-style: dotted; }
}

/* ---------- Print ---------- */

@media print {
  .site-header, .site-footer, .btn, .tabs { display: none !important; }
  body { background: #FFFFFF; color: #000000; }
}

/* Without JavaScript nothing will ever replace the loading line: hide it, so only the
   <noscript> line shows. */
@media (scripting: none) {
  .loading {
    display: none;
  }
}
