:root {
  --bg: #0f172a;
  --panel: #111c34;
  --panel-2: #0c1628;
  --line: #1f2a44;
  --text: #e6edf7;
  --muted: #9aa7bd;
  --accent: #38bdf8;
  --accent-2: #6366f1;
  --now: #38bdf8;
  --lane-0: #1b2744;
  --lane-1: #31688e;
  --lane-2: #21918c;
  --lane-3: #5ec962;
  --lane-4: #fde725;
}

body.theme-blues {
  --lane-1: #1e3a5f;
  --lane-2: #1e6091;
  --lane-3: #2e8cc7;
  --lane-4: #93c5fd;
}
body.theme-traffic {
  --lane-1: #ef4444;
  --lane-2: #f59e0b;
  --lane-3: #a3e635;
  --lane-4: #22c55e;
}
body.theme-diverging {
  --lane-1: #dc2626;
  --lane-2: #64748b;
  --lane-3: #14b8a6;
  --lane-4: #22c55e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
header .title h1 { margin: 0; font-size: 22px; font-weight: 600; }
header .meta { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 4px; }

.header-right { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.lang-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.lang-pick select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  font: inherit;
  font-size: 12px;
}

.links { display: flex; gap: 8px; flex-wrap: wrap; }
.links a {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  background: var(--panel-2);
}
.links a:hover { border-color: var(--accent); }

.links-bottom {
  display: none;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px 4px;
  border-top: 1px solid var(--line);
}
@media (max-width: 760px) {
  header .links { display: none; }
  .links-bottom { display: flex; }
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--line);
  color: var(--muted);
}
.pill.open { background: #10b981; color: #052e14; }
.pill.closed { background: #475569; color: #e2e8f0; }

.muted { color: var(--muted); }

.views {
  display: flex;
  gap: 4px;
  padding: 10px 24px 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.view-tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-bottom: 0;
  padding: 10px 18px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  top: 1px;
}
.view-tab:hover { color: var(--text); }
.view-tab.active {
  background: var(--panel);
  color: var(--accent);
  border-color: var(--line);
  box-shadow: 0 -2px 0 0 var(--accent) inset;
}

.pools {
  display: flex;
  gap: 6px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.pool-tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.pool-tab:hover { color: var(--text); }
.pool-tab.active {
  background: var(--panel);
  color: var(--accent);
  border-color: var(--accent);
}

.view[hidden] { display: none; }

main { padding: 16px 24px 32px; max-width: 1200px; margin: 0 auto; }

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 2fr;
  gap: 16px;
  margin-bottom: 22px;
}
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
}

.now-card {
  position: relative;
  background:
    radial-gradient(1200px 200px at -10% -40%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(900px 160px at 120% 140%, rgba(244, 63, 94, 0.18), transparent 55%),
    var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 30px -12px rgba(56,189,248,0.25);
  overflow: hidden;
}
.now-card.live::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px var(--now);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 0.85; }
}
.now-card h3 { color: var(--accent); letter-spacing: .14em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.band-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 600;
}
.band-chip.peak { background: rgba(244, 63, 94, 0.15); color: #fda4af; border-color: rgba(244, 63, 94, 0.45); }
.band-chip.offpeak { background: rgba(34, 197, 94, 0.12); color: #86efac; border-color: rgba(34, 197, 94, 0.4); }
.band-chip.outside { background: #1a2336; color: var(--muted); }

.unusual-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.unusual-chip[hidden] { display: none; }
.unusual-chip.quiet { background: rgba(34, 197, 94, 0.12); color: #86efac; border-color: rgba(34, 197, 94, 0.4); }
.unusual-chip.busy { background: rgba(244, 63, 94, 0.15); color: #fda4af; border-color: rgba(244, 63, 94, 0.45); }

.holiday-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.14);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.45);
  font-weight: 600;
}
.holiday-chip[hidden] { display: none; }

.today-spark {
  display: block;
  width: 100%;
  height: 34px;
  margin: 6px 0 10px;
  color: var(--accent);
}
.today-spark .spark-line {
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.today-spark .spark-now {
  stroke: #fbbf24;
  stroke-width: 2;
  opacity: 0.8;
}

.now-prices {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.now-prices .np {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 78px;
}
.now-prices .np .np-lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.now-prices .np .np-val { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.now-prices .np .np-old { color: #64748b; text-decoration: line-through; font-size: 11px; font-weight: 400; margin-right: 4px; }
.now-prices .np.muted .np-val { color: var(--muted); font-weight: 500; font-size: 13px; }
.now-prices .np-note { font-size: 11px; color: var(--muted); align-self: center; }
.now-prices .np.stale { border-color: rgba(245, 158, 11, 0.55); background: rgba(245, 158, 11, 0.08); }
.now-prices .np.stale .np-val { color: #fcd34d; }
.now-prices .np-stale { color: #fbbf24; margin-left: 4px; cursor: help; }
.now-card .now-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 4px 0 6px;
}
.now-card .big {
  font-size: 64px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin: 0;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}
.now-card .big.lane-0 { color: var(--muted); }
.now-card .big.lane-1 { color: var(--lane-1); }
.now-card .big.lane-2 { color: var(--lane-2); }
.now-card .big.lane-3 { color: var(--lane-3); }
.now-card .big.lane-4 { color: var(--lane-4); }
.now-card .big .of { color: var(--muted); font-weight: 500; font-size: 32px; }
.now-card .now-dots {
  font-size: 26px;
  letter-spacing: 4px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.now-card .now-dots:empty { display: none; }
.now-card .now-dots .on { color: var(--lane-4); }
.now-card .now-dots.lane-1 .on { color: var(--lane-1); }
.now-card .now-dots.lane-2 .on { color: var(--lane-2); }
.now-card .now-dots.lane-3 .on { color: var(--lane-3); }
.now-card .now-dots.lane-4 .on { color: var(--lane-4); }
.now-card .now-dots .off { color: var(--line); }
@media (max-width: 560px) {
  .now-card .now-row { gap: 4px 10px; }
  .now-card .now-dots { font-size: 18px; letter-spacing: 2px; }
}
.now-card .sub { color: var(--muted); font-size: 14px; }
.now-card .next {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--text);
}

.blocks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.blocks li {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.blocks li.live { border-color: var(--now); background: #0a1c2e; }
.blocks li.past { opacity: .55; }
.blocks .time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 120px; }
.blocks .lanes { font-weight: 600; min-width: 72px; }
.blocks .lanes.lane-1 { color: var(--lane-1); }
.blocks .lanes.lane-2 { color: var(--lane-2); }
.blocks .lanes.lane-3 { color: var(--lane-3); }
.blocks .lanes.lane-4 { color: var(--lane-4); }
.blocks .dots {
  font-size: 12px;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}
.blocks .dots .on { color: var(--lane-4); }
.blocks .dots.lane-1 .on { color: var(--lane-1); }
.blocks .dots.lane-2 .on { color: var(--lane-2); }
.blocks .dots.lane-3 .on { color: var(--lane-3); }
.blocks .dots.lane-4 .on { color: var(--lane-4); }
.blocks .dots .off { color: var(--line); }
.blocks .tag { margin-left: auto; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--now); color: #02223a; text-transform: uppercase; letter-spacing: .08em; }
.blocks .tag.past { background: #475569; color: #e2e8f0; }
.blocks .fav-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease;
}
.blocks .fav-btn:hover { color: #fbbf24; transform: scale(1.15); }
.blocks .fav-btn.on { color: #fbbf24; }
.blocks .fav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 560px) {
  .blocks .dots { display: none; }

  .blocks li { flex-wrap: wrap; gap: 6px 10px; }
  .blocks .time,
  .blocks .lanes { min-width: 0; }

  .finder-results .hit { flex-wrap: wrap; gap: 6px 10px; }
  .finder-results .hit .d,
  .finder-results .hit .t,
  .finder-results .hit .len { min-width: 0; }
}

.blocks-toggle {
  display: none;
  margin-top: 8px;
  background: none;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.blocks-toggle:hover { border-color: var(--accent); }
@media (max-width: 760px) {
  .blocks li.mobile-hidden { display: none; }
  .blocks.expanded li.mobile-hidden { display: flex; }
  .blocks-toggle { display: inline-block; }
}

.section-title {
  margin: 18px 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-weight: 700;
}

.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.grid-header .section-title { margin: 18px 0 10px; }
.theme-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.theme-pick select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  color-scheme: dark;
}

.finder {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 8px;
  overflow: hidden;
}
.finder > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  position: relative;
}
.finder > summary::-webkit-details-marker { display: none; }
.finder > summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.15s ease;
  display: inline-block;
  width: 12px;
}
.finder[open] > summary::before { transform: rotate(90deg); }
.finder > summary .section-title { margin: 0; }
.finder > summary:hover .section-title { color: var(--text); }
.finder .finder-hint {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-left: auto;
}
.finder[open] .finder-hint { display: none; }
.finder[open] > .finder-row { padding: 4px 16px 0; }
.finder[open] > .finder-results { padding: 0 16px 16px; }
.finder[open] > summary { padding-bottom: 4px; border-bottom: 1px dashed var(--line); }
.finder-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.finder-row label {
  display: flex; flex-direction: column;
  font-size: 12px; color: var(--muted); gap: 4px;
}
.finder-row label.checkbox {
  flex-direction: row; align-items: center; gap: 8px; padding-bottom: 6px;
  color: var(--text);
}
.finder-row input[type="time"], .finder-row select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: 6px;
  font: inherit;
  min-width: 110px;
  color-scheme: dark;
}
.finder-row button {
  background: var(--accent);
  color: #02223a;
  border: 0;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  height: 34px;
}
.finder-row button:hover { filter: brightness(1.1); }
.finder-row button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.finder-row button.secondary:hover { background: var(--panel-2); filter: none; }
.finder-row button.secondary.copied { color: var(--accent); border-color: var(--accent); }
.finder-row input[type="date"] { color-scheme: dark; }

.finder-results { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.finder-results .group { font-size: 12px; color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .06em; }
.finder-results .hit {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel-2);
}
.finder-results .hit .d { min-width: 110px; color: var(--muted); font-variant-numeric: tabular-nums; }
.finder-results .hit .t { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 120px; }
.finder-results .hit .l { color: var(--lane-4); font-weight: 600; }
.finder-results .hit .len { font-size: 12px; min-width: 90px; }
.finder-results .hit .price-chip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.finder-results .hit .price-chip .pc-band { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.finder-results .hit .price-chip .pc-price { color: var(--accent); font-weight: 700; }
.finder-results .hit .price-chip .pc-old { color: #64748b; text-decoration: line-through; font-size: 11px; margin-right: 2px; }
.finder-results .hit .price-chip.muted .pc-price { color: var(--muted); font-weight: 500; }
.finder-results .hit .price-chip.stale { border-color: rgba(245, 158, 11, 0.55); background: rgba(245, 158, 11, 0.08); }
.finder-results .hit .price-chip.stale .pc-price { color: #fcd34d; }
.finder-results .hit .price-chip .pc-stale { color: #fbbf24; margin-right: 3px; }
.finder-results .empty { color: var(--muted); font-size: 13px; padding: 8px 2px; }

.ics-btn,
.slot-link-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.ics-btn:hover,
.slot-link-btn:hover { color: var(--accent); border-color: var(--accent); }
.ics-btn:focus-visible,
.slot-link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.finder-results .hit .ics-btn { margin-left: 4px; }
#today-blocks .blocks .ics-btn { margin-left: auto; }
#today-blocks .blocks .slot-link-btn { margin-left: 4px; }

.watcher {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 12px;
  overflow: hidden;
}
.watcher > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  position: relative;
}
.watcher > summary::-webkit-details-marker { display: none; }
.watcher > summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.15s ease;
  display: inline-block;
}
.watcher[open] > summary::before { transform: rotate(90deg); }
.watcher > summary .section-title { margin: 0; }
.watcher > summary:hover .section-title { color: var(--text); }
.watcher-hint {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}
.watcher[open] .watcher-hint { display: none; }
.watcher[open] > summary { padding-bottom: 4px; border-bottom: 1px dashed var(--line); }
.watcher-body { padding: 10px 16px 16px; }
.watcher-note {
  margin: 4px 0 10px;
  font-size: 12px;
  color: var(--muted);
}
.watcher-note.ok { color: var(--accent); }
.watcher-note.warn { color: #fcd34d; }
.watcher-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.watcher-row label {
  display: flex; flex-direction: column;
  font-size: 12px; color: var(--muted); gap: 4px;
}
.watcher-row input[type="time"], .watcher-row select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: 6px;
  font: inherit;
  min-width: 110px;
  color-scheme: dark;
}
.watcher-row button {
  background: var(--accent);
  color: #02223a;
  border: 0;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  height: 34px;
}
.watcher-row button:hover { filter: brightness(1.1); }

.watch-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.watch-list:empty { margin: 0; }
.watch-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}
.watch-list .watch-crit { flex: 1; min-width: 220px; font-variant-numeric: tabular-nums; }
.watch-list .watch-status { color: var(--muted); font-size: 12px; }
.watch-list .watch-status.match {
  color: var(--accent);
  font-weight: 600;
}
.watch-list .watch-remove {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.watch-list .watch-remove:hover { color: #f87171; border-color: #f87171; }

.grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); position: relative; }

.grid-popup {
  position: absolute;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text);
  background: #0a1c2e;
  border: 1px solid var(--accent);
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}
.grid-popup[hidden] { display: none; }
.grid-popup .grid-popup-text { font-variant-numeric: tabular-nums; }
.grid-popup .grid-popup-link {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.grid-popup .grid-popup-link:hover { border-color: var(--accent); filter: brightness(1.15); }
.grid-popup .grid-popup-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cell.selected {
  position: relative;
  z-index: 4;
  outline: 2px solid #ffffff;
  outline-offset: -2px;
}

.grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  min-width: 880px;
  position: relative;
}
.cell {
  background: var(--panel);
  min-height: 26px;
  font-size: 11px;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.cell[role='gridcell'] { cursor: pointer; }
.cell.header { font-weight: 600; color: var(--text); background: var(--panel-2); min-height: 22px; }
.cell.tick { color: var(--muted); font-size: 10px; }
.cell.tick.hour { color: var(--text); border-left: 1px solid var(--line); }
.cell.rowhead {
  justify-content: flex-start; padding: 0 10px; gap: 6px;
  background: var(--panel-2); color: var(--text);
}
.cell.rowhead .dow { font-weight: 700; color: var(--accent); min-width: 22px; display: inline-block; }
.cell.rowhead .date { color: var(--muted); font-variant-numeric: tabular-nums; }
.cell.rowhead.today { background: #132a4a; }
.cell.rowhead.today .date { color: var(--text); }
.cell.rowhead.holiday { background: rgba(167, 139, 250, 0.1); }
.cell.rowhead.today.holiday { background: linear-gradient(90deg, #132a4a 0%, #132a4a 60%, rgba(167, 139, 250, 0.18) 100%); }
.cell.rowhead .fav-mark { color: #fbbf24; font-size: 11px; margin-left: auto; padding-right: 2px; }
.cell.rowhead .hol-mark { color: #c4b5fd; font-size: 11px; margin-left: auto; padding-right: 2px; }
.cell.rowhead .hol-mark + .fav-mark { margin-left: 2px; }

.cell.fav {
  position: relative;
}
.cell.fav::after {
  content: "";
  position: absolute;
  top: 1px; right: 1px;
  width: 6px; height: 6px;
  background: #fbbf24;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
  pointer-events: none;
  z-index: 2;
}

.cell.lane-0 { background: repeating-linear-gradient(45deg, #13203b, #13203b 6px, #1a2a48 6px, #1a2a48 12px); }
.cell.lane-1 { background: var(--lane-1); }
.cell.lane-2 { background: var(--lane-2); }
.cell.lane-3 { background: var(--lane-3); }
.cell.lane-4 { background: var(--lane-4); }
.cell.now {
  position: relative;
  z-index: 3;
  box-shadow: inset 0 2px 0 0 var(--now), inset 0 -2px 0 0 var(--now);
}
.cell.now.now-start { box-shadow: inset 2px 0 0 0 var(--now), inset 0 2px 0 0 var(--now), inset 0 -2px 0 0 var(--now); }
.cell.now.now-end   { box-shadow: inset -2px 0 0 0 var(--now), inset 0 2px 0 0 var(--now), inset 0 -2px 0 0 var(--now); }
.cell.now.now-start.now-end { box-shadow: inset 0 0 0 2px var(--now); }
.cell.now-col { background: rgba(56, 189, 248, 0.08); }
.cell.now-col.header { background: #0f2236; color: #bae6fd; }
.cell.now-col.now-col-start { box-shadow: inset 2px 0 0 0 rgba(56,189,248,0.55); }
.cell.now-col.now-col-end { box-shadow: inset -2px 0 0 0 rgba(56,189,248,0.55); }
.cell.match { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 2; }
.cell[role="gridcell"]:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
  z-index: 3;
}

.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); align-items: center; }
.legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.legend .sw.lane-0 { background: repeating-linear-gradient(45deg, #13203b, #13203b 4px, #1a2a48 4px, #1a2a48 8px); }
.legend .sw.lane-1 { background: var(--lane-1); }
.legend .sw.lane-2 { background: var(--lane-2); }
.legend .sw.lane-3 { background: var(--lane-3); }
.legend .sw.lane-4 { background: var(--lane-4); }
.legend .sw.now { background: var(--now); }

.pricing {
  margin-top: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 16px;
}
.pricing .section-title { margin: 0 0 10px; }
.pricing-banner {
  background: linear-gradient(90deg, rgba(56,189,248,0.18), rgba(99,102,241,0.18));
  border: 1px solid var(--accent);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 10px;
}
.pricing-stale {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fcd34d;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pricing-stale[hidden] { display: none; }
.schedule-stale {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
}
.schedule-stale strong { color: #fee2e2; }
.schedule-stale a { color: #fecaca; }
.schedule-stale a:hover { color: #fff1f2; }
.pricing-stale strong { color: #fde68a; }
.pricing-stale a { color: #fcd34d; text-decoration: underline; }
.pricing-stale a:hover { color: #fff7ed; }
.pricing-note { font-size: 12px; margin: 0 0 10px; }
.pricing-body { display: flex; flex-direction: column; gap: 14px; }
.pricing-section {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px 12px;
}
.pricing-section h4 { margin: 0 0 8px; font-size: 13px; color: var(--accent); font-weight: 700; }

.price-table-wrap { overflow-x: auto; }
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}
.price-table th, .price-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}
.price-table thead th {
  background: #0a1326;
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--line);
}
.price-table td.code { font-weight: 700; color: var(--muted); white-space: nowrap; width: 40px; }
.price-table td.desc { color: var(--text); }
.price-table td.unit { color: var(--muted); white-space: nowrap; }
.price-table td { font-variant-numeric: tabular-nums; }
.price-table th.active,
.price-table td.active {
  background: rgba(56, 189, 248, 0.08);
  color: var(--text);
  font-weight: 600;
}
.price-table .empty { color: #64748b; font-style: italic; font-weight: 400; font-size: 12px; }
.price-table .old {
  color: #64748b;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  font-size: 12px;
  margin-right: 6px;
  font-weight: 400;
}
.price-table .new { color: var(--text); font-weight: 700; }
.price-table td.active .new { color: var(--accent); }
.price-table .cell-stale { color: #fbbf24; margin-left: 4px; cursor: help; font-size: 12px; }

.pricing-section .section-note { margin: 8px 0 0; font-size: 12px; }
.pricing-foot { margin: 12px 0 0; font-size: 12px; }

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
}

footer { padding: 16px 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }

.trend { display: flex; flex-direction: column; gap: 12px; }
.trend-meta { font-size: 12px; margin: 0; }
.trend-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  position: relative;
}
.trend-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  min-width: 760px;
}
.trend-grid .cell {
  background: var(--panel);
  min-height: 26px;
  font-size: 11px;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.trend-grid .cell.header { font-weight: 600; color: var(--text); background: var(--panel-2); min-height: 22px; }
.trend-grid .cell.tick { color: var(--muted); font-size: 10px; }
.trend-grid .cell.tick.hour { color: var(--text); border-left: 1px solid var(--line); }
.trend-grid .cell.rowhead {
  justify-content: flex-start; padding: 0 10px; gap: 6px;
  background: var(--panel-2); color: var(--text);
}
.trend-grid .cell.rowhead .dow { font-weight: 700; color: var(--accent); min-width: 22px; display: inline-block; }
.trend-grid .cell.rowhead .date { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.trend-grid .cell.lane-0 { background: repeating-linear-gradient(45deg, #13203b, #13203b 6px, #1a2a48 6px, #1a2a48 12px); }
.trend-grid .cell.lane-1 { background: var(--lane-1); }
.trend-grid .cell.lane-2 { background: var(--lane-2); }
.trend-grid .cell.lane-3 { background: var(--lane-3); }
.trend-grid .cell.lane-4 { background: var(--lane-4); }
.trend-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
  padding: 6px 2px;
}
.trend-legend .sw {
  display: inline-block; width: 14px; height: 10px; border-radius: 2px;
  vertical-align: middle; margin-right: 4px;
}
.trend-legend .sw.lane-0 { background: repeating-linear-gradient(45deg, #13203b, #13203b 4px, #1a2a48 4px, #1a2a48 8px); }
.trend-legend .sw.lane-1 { background: var(--lane-1); }
.trend-legend .sw.lane-2 { background: var(--lane-2); }
.trend-legend .sw.lane-3 { background: var(--lane-3); }
.trend-legend .sw.lane-4 { background: var(--lane-4); }
.trend-foot { font-size: 12px; margin: 0; }

#today-blocks h3 .share-trigger {
  margin-left: auto;
  background: var(--panel-2);
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  font-weight: 600;
}
#today-blocks h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
#today-blocks h3 .share-trigger:hover { border-color: var(--accent); }
#today-blocks h3 .share-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.share-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.share-modal[hidden] { display: none; }
.share-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 10, 22, 0.78);
  backdrop-filter: blur(3px);
}
.share-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.share-card {
  background:
    radial-gradient(900px 140px at 0% 0%, rgba(56,189,248,0.18), transparent 60%),
    radial-gradient(800px 140px at 100% 100%, rgba(99,102,241,0.18), transparent 55%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px 18px;
  color: var(--text);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}
.share-card .sc-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.share-card .sc-brand { font-size: 18px; font-weight: 800; letter-spacing: .02em; }
.share-card .sc-pool {
  font-size: 12px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--panel-2); color: var(--accent);
  border: 1px solid var(--line);
}
.share-card .sc-date {
  margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 600;
  text-transform: capitalize;
}
.share-card .sc-blocks {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.share-card .sc-blocks li {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.share-card .sc-blocks li.live { border-color: var(--now); background: #0a1c2e; }
.share-card .sc-blocks li.past { opacity: .5; }
.share-card .sc-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 112px;
}
.share-card .sc-dur {
  font-size: 12px;
  color: var(--muted);
  min-width: 64px;
}
.share-card .sc-lanes { font-weight: 700; min-width: 74px; }
.share-card .sc-lanes.lane-1 { color: var(--lane-1); }
.share-card .sc-lanes.lane-2 { color: var(--lane-2); }
.share-card .sc-lanes.lane-3 { color: var(--lane-3); }
.share-card .sc-lanes.lane-4 { color: var(--lane-4); }
.share-card .sc-dots { margin-left: auto; font-size: 13px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.share-card .sc-dots .on { color: var(--lane-4); }
.share-card .sc-dots.lane-1 .on { color: var(--lane-1); }
.share-card .sc-dots.lane-2 .on { color: var(--lane-2); }
.share-card .sc-dots.lane-3 .on { color: var(--lane-3); }
.share-card .sc-dots.lane-4 .on { color: var(--lane-4); }
.share-card .sc-dots .off { color: var(--line); }
.share-card .sc-tag {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 999px;
  background: var(--now); color: #02223a; font-weight: 700;
}
.share-card .sc-tag.past { background: #475569; color: #e2e8f0; }
.share-card .sc-legend { margin-top: 10px; font-size: 11px; color: var(--muted); text-align: right; }
.share-card .sc-empty {
  padding: 20px; text-align: center;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.share-card .sc-foot {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 11px; color: var(--muted);
}
.share-card .sc-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.share-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.share-actions button {
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
.share-btn-primary { background: var(--accent); color: #02223a; border: 0; }
.share-btn-primary:hover { filter: brightness(1.1); }
.share-btn-primary.copied { filter: brightness(1.2); }
.share-btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.share-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.share-hint {
  text-align: center; font-size: 11px; color: var(--muted);
}

.slot-card {
  background:
    radial-gradient(800px 140px at 0% 0%, rgba(56,189,248,0.18), transparent 60%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px 18px;
  color: var(--text);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}
.slot-card .slot-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.slot-card .slot-title {
  font-size: 18px; font-weight: 700; letter-spacing: .02em;
  text-transform: capitalize;
}
.slot-card .slot-pool {
  font-size: 12px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--panel-2); color: var(--accent);
  border: 1px solid var(--line);
  margin-left: auto;
}
.slot-card .slot-lanes {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 8px 0 12px;
}
.slot-card .slot-lanes-big {
  font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.slot-card .slot-lanes.lane-1 .slot-lanes-big { color: var(--lane-1); }
.slot-card .slot-lanes.lane-2 .slot-lanes-big { color: var(--lane-2); }
.slot-card .slot-lanes.lane-3 .slot-lanes-big { color: var(--lane-3); }
.slot-card .slot-lanes.lane-4 .slot-lanes-big { color: var(--lane-4); }
.slot-card .slot-dots { font-size: 18px; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.slot-card .slot-dots .on { color: var(--lane-4); }
.slot-card .slot-dots.lane-1 .on { color: var(--lane-1); }
.slot-card .slot-dots.lane-2 .on { color: var(--lane-2); }
.slot-card .slot-dots.lane-3 .on { color: var(--lane-3); }
.slot-card .slot-dots.lane-4 .on { color: var(--lane-4); }
.slot-card .slot-dots .off { color: var(--line); }
.slot-card .slot-lanes-word { color: var(--muted); font-size: 14px; }
.slot-card .slot-trend {
  font-size: 13px; color: var(--text);
  padding: 10px 12px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.slot-card .slot-trend.muted { color: var(--muted); }
.slot-card .slot-trend.quiet { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.35); color: #86efac; }
.slot-card .slot-trend.busy { background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.4); color: #fda4af; }
.slot-card .slot-body { padding: 16px 12px; }

@media (max-width: 560px) {
  .share-card { padding: 18px 14px 14px; }
  .share-card .sc-blocks li { flex-wrap: wrap; gap: 6px 10px; }
  .share-card .sc-date { margin-left: 0; }
  .share-card .sc-dots { display: none; }
}

@media print {
  body.share-open > :not(#share-modal) { display: none !important; }
  body.share-open { background: #fff; color: #000; }
  body.share-open .share-modal { position: static; padding: 0; }
  body.share-open .share-backdrop { display: none; }
  body.share-open .share-dialog { width: 100%; max-height: none; overflow: visible; }
  body.share-open .share-actions,
  body.share-open .share-hint { display: none; }
  body.share-open .share-card {
    background: #fff; color: #000;
    border-color: #ccc; box-shadow: none;
  }
  body.share-open .share-card .sc-pool { background: #f3f4f6; color: #0369a1; border-color: #cbd5e1; }
  body.share-open .share-card .sc-date,
  body.share-open .share-card .sc-dur,
  body.share-open .share-card .sc-legend,
  body.share-open .share-card .sc-foot { color: #475569; }
  body.share-open .share-card .sc-blocks li {
    background: #fff; border-color: #cbd5e1; color: #0f172a;
  }
  body.share-open .share-card .sc-dots .off { color: #e2e8f0; }
  body.share-open .share-card .sc-head { border-bottom-color: #cbd5e1; }
  body.share-open .share-card .sc-foot { border-top-color: #cbd5e1; }
}
