@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #e6ebe7;
  --surface: #f6f7f4;
  --ink: #17211c;
  --muted: #3e4c45;
  --rail: #24352e;
  --rail-ink: #e8f0eb;
  --rail-soft: #c5d4cb;
  --rail-hover: #2e463c;
  --rail-current: #345246;
  --accent: #8a2e10;
  --on-accent: #fff7f2;
  --up: #9f1d1d;
  --up-bg: #f8e8e6;
  --down: #14613a;
  --down-bg: #e5f2ea;
  --line: #d3dbd6;
  --focus: #0f6b56;
  --shadow: 0 10px 28px rgb(28 43 38 / 0.08);
  --radius-control: 6px;
  --radius-surface: 10px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --text-caption: 0.875rem;
  --text-body: 1rem;
  --text-h3: 1.125rem;
  --text-h2: 1.25rem;
  --text-h1: clamp(1.5rem, 1.2rem + 1vw, 1.75rem);
  --text-metric: clamp(2.25rem, 1.6rem + 2vw, 2.75rem);
  --z-sticky: 2;
  --z-skip: 5;
  --motion: 160ms;
}

* { box-sizing: border-box; }

html { font-size: 100%; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  direction: rtl;
  text-align: start;
  background: var(--bg);
  color: var(--ink);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: var(--text-body);
  line-height: 1.55;
  font-weight: 400;
}

h1, h2, .metric {
  text-wrap: balance;
}

p, .lede {
  text-wrap: pretty;
}

a { color: var(--accent); }

button, a, label, summary, .button { cursor: pointer; }

input, textarea { cursor: text; }

.skip {
  position: absolute;
  inset-inline-start: var(--space-2);
  inset-block-start: -100%;
  z-index: var(--z-skip);
  background: var(--accent);
  color: var(--on-accent);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
}

.skip:focus { inset-block-start: var(--space-2); }

.shell {
  display: flex;
  min-height: 100dvh;
  align-items: stretch;
}

.rail {
  width: 232px;
  flex: 0 0 232px;
  background: var(--rail);
  color: var(--rail-ink);
  padding: var(--space-5) var(--space-3);
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  margin-inline: var(--space-2);
  padding: 10px 12px 8px;
  background: #fff;
  border-radius: var(--radius-control);
  text-decoration: none;
}

.brand-lockup img {
  width: 100%;
  height: auto;
  display: block;
}

.brand-app {
  color: #1d66b0;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.top-logo { display: none; }

.home-banner {
  display: block;
  margin: 0 0 var(--space-4);
  background: #f4f5f7;
  border-radius: var(--radius-surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.home-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav a {
  color: var(--rail-ink);
  text-decoration: none;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-control);
  font-weight: 500;
}

.nav a:hover { background: var(--rail-hover); }

.nav a[aria-current="page"] {
  background: var(--rail-current);
  color: #f4faf6;
  font-weight: 700;
}

.ico {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  min-height: 56px;
  padding: var(--space-2) var(--space-5);
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.who {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin: 0;
}

.role { color: var(--muted); font-size: var(--text-caption); }

.who form { margin: 0; }

main {
  padding: var(--space-5) var(--space-5) var(--space-6);
}

h1 {
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 var(--space-3);
}

h2 {
  font-size: var(--text-h2);
  font-weight: 700;
  line-height: 1.3;
  margin: var(--space-6) 0 var(--space-3);
}

p { margin: 0 0 var(--space-3); }

.lede { max-width: 65ch; }

.lead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.metric {
  font-size: var(--text-metric);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  margin: var(--space-2) 0 0;
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-5);
  padding: var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow);
}

.facts div { min-width: 0; }

.facts dt {
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: 500;
}

.facts dd {
  margin: var(--space-1) 0 0;
  font-size: var(--text-h3);
  font-weight: 700;
}

.filters, .stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  align-items: end;
  margin-bottom: var(--space-4);
}

label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-body);
  font-weight: 500;
}

.hint {
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: 400;
}

.check {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  font-weight: 400;
}

input, select, textarea, button {
  font: inherit;
  color: inherit;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="time"],
input[type="date"],
input[type="file"],
select,
textarea {
  background: var(--surface);
  border: 1px solid #8ea097;
  border-radius: var(--radius-control);
  padding: 10px 12px;
  min-height: 44px;
  text-align: start;
  min-width: 0;
}

textarea {
  width: min(36rem, 100%);
  min-height: 7rem;
}

button, .button {
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  border-radius: var(--radius-control);
  min-height: 44px;
  padding: 8px 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1.2;
}

button.secondary, a.secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #8ea097;
}

button.ghost, .ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-weight: 500;
}

button:active, .button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100dvh - 220px);
  background: var(--surface);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th, td {
  text-align: start;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  position: sticky;
  top: 0;
  background: #eef2ef;
  font-weight: 700;
  z-index: 1;
}

tbody tr:hover { background: #e7f0ea; }

.num {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

td.num, th.num {
  text-align: right;
  white-space: nowrap;
}

.miss { color: var(--muted); }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0 8px;
  font-size: var(--text-caption);
  font-weight: 700;
  line-height: 1.7;
  background: var(--up-bg);
  color: var(--up);
}

.dir-up, .dir-down {
  white-space: nowrap;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 8px;
  display: inline-block;
}

.dir-up { color: var(--up); background: var(--up-bg); }
.dir-down { color: var(--down); background: var(--down-bg); }

td a { white-space: nowrap; }

.site-cell { min-width: 12rem; }
.site-cell .diff { display: block; margin-top: 2px; }
.site-title { white-space: normal; display: inline; }
.offer { margin-bottom: 12px; }
.choice { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; margin-top: 6px; }
.choice input { width: 7rem; }

.match-split {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  gap: var(--space-3);
  height: calc(100dvh - 15rem);
  min-height: 22rem;
}

.pick-list,
.pick-detail {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow);
}

.pick {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}

.pick-name {
  display: block;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.pick .meta { display: block; margin: 0; }
.pick .badge { margin-top: 4px; }
.pick .badge + .badge { margin-inline-start: 4px; }

.pick[aria-current="true"],
.pick:hover { background: #e7f0ea; }

.badge.wait {
  background: #e7eeea;
  color: var(--ink);
}

.pick-head { padding: 12px 12px 4px; }
.pick-head h2 { margin: 0 0 4px; font-size: var(--text-h3); }
.pick-head .meta { margin: 0 0 var(--space-2); }
.pick-head .chips { margin-bottom: var(--space-3); }

.chip { color: var(--ink); text-decoration: none; }
.chip[aria-current="true"] {
  background: var(--rail);
  color: var(--rail-ink);
  box-shadow: none;
}

.variety-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: var(--space-3);
  color: var(--muted);
  font-size: var(--text-caption);
}

.site-block {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.site-block h3 { margin: 0 0 8px; font-size: var(--text-h3); }
.pick-detail .site-title { white-space: normal; }

.user-list { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-4); }
.user-row {
  background: var(--surface);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow);
  padding: 12px;
}
.user-row form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 8px; }
.user-row p { margin: 0; }

.alarm-batches { display: flex; flex-direction: column; gap: var(--space-3); }

.alarm-batch {
  background: var(--surface);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow);
  padding: 0 12px 4px;
}

.alarm-batch > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-h3);
  font-weight: 700;
  cursor: pointer;
}

.alarm-batch .empty-batch { margin: 0 0 12px; }

.alarm-list { display: flex; flex-direction: column; }

.alarm-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 700;
}

.why { position: relative; flex: 0 0 auto; }

.why-btn {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px #8ea097;
  font-weight: 700;
  font-size: var(--text-h3);
  line-height: 1;
}

.why-btn:hover { color: #6e240c; }

.why-mark {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.why-pop {
  position: absolute;
  z-index: 6;
  inset-inline-start: 0;
  top: calc(100% + 4px);
  width: min(22rem, calc(100vw - 2rem));
  padding: 12px;
  background: var(--on-accent);
  border: 1px solid var(--rail);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow);
}

.why-pop:not([hidden]) {
  animation: why-in 160ms ease-out;
}

@keyframes why-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .why-pop:not([hidden]) { animation: none; }
}

.why-pop p { margin: 0 0 8px; }
.why-pop strong {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: var(--text-caption);
}
.why-pop .why-close { min-height: 44px; }

.alarm {
  background: transparent;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 10px 0;
}

.alarm-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.alarm-name {
  flex: 1 1 12rem;
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.alarm-site { font-weight: 700; }

.alarm-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.alarm .choice { margin-top: 0; }

.alarm-more { margin-top: 0; }
.alarm-more summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
}
.alarm-more-body {
  margin: 0 0 12px;
  padding: 12px;
  background: #e7f0ea;
  border: 1px solid #8ea097;
  border-radius: var(--radius-control);
}
.alarm-more p { margin: 0 0 var(--space-2); }
.alarm-more-body p:last-child { margin-bottom: 0; }
.keep-lines { white-space: pre-line; }

.ledger { width: min(44rem, 100%); }

.ledger th { position: static; }

.meta { color: var(--muted); font-size: var(--text-caption); margin: 0 0 var(--space-3); }

.flash, .error {
  padding: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-4);
  max-width: 46rem;
  border-radius: var(--radius-control);
}

.flash { background: var(--down-bg); color: var(--down); }

.reference {
  background: var(--rail);
  color: var(--rail-ink);
  border-radius: var(--radius-surface);
  padding: var(--space-4) var(--space-5);
  margin: 0 0 var(--space-5);
  max-width: 40rem;
}

.reference h2 {
  margin: 0 0 var(--space-2);
  color: var(--rail-ink);
}

.reference p { margin: 0 0 var(--space-2); }

.reference .meta { color: var(--rail-soft); }

.error {
  background: var(--up-bg);
  color: var(--up);
}

.error li + li { margin-top: var(--space-1); }

.gate {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(20rem, 1.15fr) minmax(18rem, 0.85fr);
}

.gate-brand {
  background: #fff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100dvh;
}

.brand-logo {
  width: min(13rem, 70%);
  height: auto;
  margin: var(--space-5) auto var(--space-4);
}

.gate-banner {
  display: block;
  background: #f4f5f7;
}

.gate-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.gate-copy {
  padding: var(--space-5) var(--space-5) var(--space-6);
}

.gate-brand h1 {
  color: #1d66b0;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  margin: 0 0 var(--space-2);
}

.gate-brand p {
  color: var(--muted);
  max-width: 32ch;
  margin: 0;
}

.gate-form {
  width: min(26rem, calc(100% - 48px));
  margin: auto;
  padding: var(--space-6) 0;
}

.gate-form h2 {
  margin-top: 0;
}

.gate-form label { margin-bottom: var(--space-4); }

.gate-form input { width: 100%; }

.settings {
  display: grid;
  gap: var(--space-4);
  max-width: 40rem;
}

fieldset {
  border: 0;
  margin: 0;
  padding: var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: var(--space-3);
}

legend {
  font-size: var(--text-h3);
  font-weight: 700;
  padding: 0;
}

.settings > button { justify-self: start; }

.drop {
  gap: var(--space-2);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.pager a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
}

.empty {
  padding: var(--space-5);
  background: var(--surface);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow);
  max-width: 40rem;
}

.empty h2 { margin-top: 0; }

.audit td, .audit th { font-size: var(--text-caption); }

.nav-label {
  margin: var(--space-4) var(--space-2) 0;
  color: var(--rail-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.sync-form { margin: 0 0 var(--space-4); }

td a.name-link { white-space: normal; }

.badge-new {
  background: var(--down-bg);
  color: var(--down);
}

.badge-quiet {
  background: #e7eeea;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}

.tabs a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-control);
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px #8ea097;
  font-weight: 700;
}

.tabs a[aria-current="page"] {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: none;
}

.filter-search { flex: 1 1 16rem; }
.filter-search input { width: 100%; }

.filter-more { margin: 0; }
.filter-more summary {
  list-style: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
}
.filter-more summary::-webkit-details-marker { display: none; }

.filter-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  align-items: end;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px #8ea097;
  font-weight: 700;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip:has(input:checked) {
  background: var(--rail);
  color: var(--rail-ink);
  box-shadow: none;
}

.chip:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.custom-dates { display: none; }

.chart-filters:has(input[name="span"][value="custom"]:checked) .custom-dates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  width: 100%;
}

.tabbar, .more-sheet { display: none; }

.chart-filters fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  flex: 1 1 100%;
}

.chart-filters legend {
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.chart {
  background: var(--surface);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow);
  padding: var(--space-4);
  margin: 0 0 var(--space-4);
}

.chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.swatch {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.swatch.suggested { opacity: 0.45; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  button:active, .button:active { transform: none; }
}

@media (prefers-contrast: more) {
  :root { --line: #17211c; --muted: #17211c; }
  input, select, textarea, button.secondary { border-width: 2px; }
}

@media (max-width: 64rem) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 48.01rem) {
  details.filter-more { display: contents; }
  details.filter-more > summary { display: none; }
  details.filter-more > .filter-fields,
  details.filter-more:not([open]) > .filter-fields { display: contents; }
}

@media (max-width: 48rem) {
  .shell { flex-direction: column; }
  .rail { display: none; }
  .gate { grid-template-columns: 1fr; }
  .gate-brand { min-height: auto; }
  .gate-copy { padding: var(--space-4); }
  .topbar { padding-inline: var(--space-4); }
  .top-logo {
    display: flex;
    align-items: center;
    margin-inline-end: auto;
  }
  .top-logo img { height: 26px; width: auto; display: block; }
  main {
    padding: var(--space-4);
    padding-bottom: calc(var(--space-4) + 72px + env(safe-area-inset-bottom));
  }
  .facts { grid-template-columns: 1fr 1fr; }
  .workspace { min-width: 0; }

  input[type="text"],
  input[type="password"],
  input[type="search"],
  input[type="number"],
  input[type="time"],
  input[type="date"],
  input[type="file"],
  select,
  textarea { font-size: 1rem; width: 100%; max-width: none; }

  .filters, .stack { flex-direction: column; align-items: stretch; }
  .filters > label, .stack > label, .filter-search { width: 100%; }
  .filters > button, .filters > .button { width: 100%; }

  .filter-more {
    width: 100%;
    background: var(--surface);
    border-radius: var(--radius-control);
    box-shadow: inset 0 0 0 1px #8ea097;
    padding: 0 var(--space-3);
  }
  details.filter-more:not([open]) > .filter-fields { display: none; }
  details.filter-more[open] { padding-bottom: var(--space-3); }
  details.filter-more[open] > .filter-fields {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-top: var(--space-2);
  }
  .filter-fields .button, .filter-fields button { width: 100%; }

  .table-wrap.sheet {
    max-height: none;
    overflow-x: auto;
  }
  .table-wrap.sheet table { min-width: 48rem; }

  .cards {
    max-height: none;
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }
  .cards table, .cards tbody { display: block; width: 100%; background: transparent; }
  .cards thead { display: none; }
  .cards tr {
    display: block;
    background: var(--surface);
    border-radius: var(--radius-surface);
    box-shadow: var(--shadow);
    margin: 0 0 var(--space-3);
    padding: var(--space-3);
  }
  .cards tr:hover { background: var(--surface); }
  .cards td {
    display: block;
    width: auto;
    border: 0;
    padding: 6px 0;
    white-space: normal;
  }
  .cards td.num { text-align: start; white-space: normal; }
  .cards td a, .cards .site-title { white-space: normal; }
  .cards .site-cell { min-width: 0; }
  .cards td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: var(--text-caption);
    font-weight: 700;
    margin-bottom: 2px;
  }
  .cards td.card-title {
    font-size: var(--text-h3);
    font-weight: 700;
    padding-top: 0;
  }
  .cards td[colspan] { padding: 0; }
  .cards .choice { width: 100%; }
  .cards .choice button { flex: 1 1 8rem; }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 5;
    background: var(--rail);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.08);
  }
  .tabbar a, .tabbar button {
    appearance: none;
    background: transparent;
    color: var(--rail-ink);
    box-shadow: none;
    border: 0;
    border-radius: 0;
    min-height: 56px;
    padding: 6px 2px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .tabbar a[aria-current="page"],
  .tabbar button[aria-current="page"],
  .tabbar button[aria-expanded="true"] {
    background: var(--rail-current);
    color: #f4faf6;
  }
  .more-sheet:not([hidden]) {
    display: flex;
    flex-direction: column;
    position: fixed;
    z-index: 5;
    inset-inline: var(--space-3);
    bottom: calc(56px + env(safe-area-inset-bottom));
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--radius-surface);
    box-shadow: var(--shadow);
    padding: var(--space-2);
    max-height: min(70dvh, 28rem);
    overflow: auto;
  }
  .more-sheet a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 700;
    border-radius: var(--radius-control);
  }
  .more-sheet a[aria-current="page"] { background: #e7f0ea; }
  .more-sheet .nav-label { color: var(--muted); margin: var(--space-2) 12px 0; }
  .pager { flex-wrap: wrap; }
  .pager a { min-height: 44px; display: inline-flex; align-items: center; }
  .lead { align-items: stretch; }
  .lead .button { width: 100%; }

  .match-split {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
  .pick-list { max-height: 14rem; }
  .pick-detail { overflow: visible; }
  .alarm-line { align-items: stretch; }
  .alarm .choice { width: 100%; }
  .alarm .choice button { flex: 1 1 8rem; }
}
