:root {
  --ink: #eaf2f8;
  --muted: #8193a5;
  --muted-2: #607386;
  --bg: #07111b;
  --bg-soft: #0b1723;
  --panel: #0d1b28;
  --panel-2: #102231;
  --panel-3: #132838;
  --line: rgba(151, 177, 196, 0.13);
  --line-strong: rgba(151, 177, 196, 0.24);
  --cyan: #52d5c9;
  --cyan-bright: #71f1e4;
  --cyan-dim: rgba(82, 213, 201, 0.12);
  --amber: #eeb864;
  --amber-dim: rgba(238, 184, 100, 0.12);
  --rose: #f07b85;
  --rose-dim: rgba(240, 123, 133, 0.12);
  --green: #78d69a;
  --blue: #6fa9df;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --content: 1480px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% -10%, rgba(55, 151, 162, 0.17), transparent 27rem),
    radial-gradient(circle at -8% 29%, rgba(33, 78, 109, 0.16), transparent 30rem),
    linear-gradient(180deg, #08131f 0, var(--bg) 40rem, #060f18 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: .7rem 1rem;
  border-radius: 0 0 8px 8px;
  background: var(--cyan);
  color: #04201f;
  font-weight: 700;
}
.skip-link:focus { top: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 27, 0.88);
  backdrop-filter: blur(20px);
}

.header-inner {
  max-width: var(--content);
  height: 58px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 35px;
  height: 35px;
  padding: 7px;
  border: 1px solid rgba(113, 241, 228, .35);
  border-radius: 11px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  background: linear-gradient(145deg, rgba(82, 213, 201, .17), rgba(82, 213, 201, .04));
  box-shadow: inset 0 0 18px rgba(82, 213, 201, .08);
}

.brand-mark i {
  display: block;
  width: 3px;
  border-radius: 3px;
  background: var(--cyan-bright);
}
.brand-mark i:nth-child(1) { height: 7px; opacity: .55; }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 10px; opacity: .75; }
.brand-mark i:nth-child(4) { height: 19px; }

.brand strong { display: block; font-size: 16px; letter-spacing: .1em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; letter-spacing: .16em; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.live-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(255,255,255,.02);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(238, 184, 100, .10);
}
.live-state[data-state="healthy"] .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(120,214,154,.1), 0 0 12px rgba(120,214,154,.5); }
.live-state[data-state="error"] .status-dot { background: var(--rose); box-shadow: 0 0 0 4px rgba(240,123,133,.1); }
.live-state[data-state="loading"] .status-dot { animation: blink 1.3s infinite; }

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.025);
  cursor: pointer;
  transition: .2s ease;
}
.icon-button:hover { border-color: rgba(113,241,228,.45); color: var(--cyan-bright); transform: translateY(-1px); }
.icon-button:disabled { cursor: wait; opacity: .55; }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button.is-spinning svg { animation: spin 1s linear infinite; }

.page-shell { max-width: var(--content); margin: 0 auto; padding: 16px 24px 72px; }

.hero {
  min-height: 0;
}
.eyebrow, .section-kicker {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 8px; }
.eyebrow span { width: 20px; height: 1px; background: var(--cyan); }
.hero h1 { margin: 0; font-size: clamp(20px, 2vw, 27px); line-height: 1.12; letter-spacing: -.035em; font-weight: 720; }
.hero h1 em { color: var(--cyan-bright); font-style: normal; font-weight: 690; }
.hero-copy { display: none; }

.live-console {
  display: grid;
  grid-template-columns: minmax(220px, .62fr) minmax(650px, 2.38fr);
  gap: 12px;
  align-items: stretch;
}
.console-heading {
  min-height: 112px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(15,32,46,.94), rgba(9,22,33,.94));
}
.console-heading .eyebrow { margin-bottom: 9px; }

.update-card {
  min-width: 0;
  margin-top: 12px;
  padding: 10px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}
.update-card strong { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.update-card small { grid-column: 1 / -1; margin-top: 4px; font-size: 9px; }
.update-card b { color: var(--cyan); font-weight: 650; }

.latest-draw-card {
  min-width: 0;
  min-height: 112px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(390px, 1.7fr) minmax(150px, .7fr);
  align-items: center;
  gap: 20px;
  border: 1px solid rgba(82,213,201,.2);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 63% 25%, rgba(82,213,201,.08), transparent 19rem),
    linear-gradient(135deg, rgba(15,34,48,.98), rgba(9,23,34,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.draw-meta { min-width: 0; }
.draw-meta > span { color: var(--cyan); font-size: 9px; font-weight: 750; letter-spacing: .14em; }
.draw-meta > strong { display: block; margin: 7px 0 5px; color: var(--ink); font-size: 15px; font-weight: 650; }
.draw-meta > strong b { font: inherit; font-variant-numeric: tabular-nums; }
.draw-meta > small { display: block; overflow: hidden; color: var(--muted-2); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.draw-equation { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1vw, 15px); }
.draw-equation > i { color: var(--muted-2); font-size: 17px; font-style: normal; font-weight: 500; }
.draw-ball {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(113,241,228,.34);
  border-radius: 50%;
  color: #08201f;
  background: linear-gradient(145deg, var(--cyan-bright), #45bbb7);
  box-shadow: 0 9px 24px rgba(48,176,172,.17), inset 0 1px 0 rgba(255,255,255,.35);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}
.draw-total { min-width: 72px; height: 52px; padding: 7px 13px; display: flex; align-items: center; justify-content: center; gap: 8px; border-left: 1px solid var(--line-strong); }
.draw-total small { color: var(--muted); font-size: 9px; }
.draw-total strong { color: var(--amber); font-size: 34px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.draw-result-side { min-width: 0; padding-left: 17px; border-left: 1px solid var(--line); }
.draw-result-side > small { display: block; margin-top: 8px; color: var(--muted-2); font-size: 8px; }
.draw-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.draw-tags span { padding: 5px 8px; border: 1px solid rgba(82,213,201,.2); border-radius: 999px; color: var(--cyan-bright); background: var(--cyan-dim); font-size: 9px; font-weight: 700; }

.control-deck {
  display: grid;
  grid-template-columns: auto 1px minmax(350px, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(17,35,49,.93), rgba(11,25,37,.93));
  box-shadow: var(--shadow);
}
.filter-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.filter-label { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 650; }
.segmented { display: flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: rgba(2,9,15,.42); }
.segmented button {
  min-width: 56px;
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: .16s ease;
}
.segmented button:hover { color: var(--ink); background: rgba(255,255,255,.035); }
.segmented button[aria-pressed="true"] { color: #08201f; background: var(--cyan); box-shadow: 0 5px 17px rgba(82,213,201,.16); font-weight: 750; }
.deck-divider { align-self: stretch; width: 1px; background: var(--line); }
.active-view { display: flex; flex-direction: column; gap: 4px; text-align: right; }
.active-view span { color: var(--muted-2); font-size: 10px; }
.active-view strong { white-space: nowrap; color: var(--cyan-bright); font-size: 12px; font-weight: 650; }
.active-view small { color: var(--muted-2); font-size: 8px; white-space: nowrap; }

.notice {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 12px 0 0;
  padding: 10px 14px;
  border: 1px solid rgba(238,184,100,.18);
  border-radius: 13px;
  background: var(--amber-dim);
  color: #d9c49f;
}
.notice svg { flex: 0 0 19px; width: 19px; fill: none; stroke: var(--amber); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.notice div { min-width: 0; flex: 1; }
.notice strong { display: inline; margin-right: 9px; color: #efd6ab; font-size: 12px; }
.notice div span { color: #9f927d; font-size: 11px; }
.notice-tag { flex: 0 0 auto; padding: 4px 8px; border: 1px solid rgba(238,184,100,.2); border-radius: 999px; color: var(--amber); font-size: 9px; }
.notice[data-hidden="true"] { display: none; }

.section-block { margin-top: 38px; }
.section-heading { margin-bottom: 21px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading.compact { margin-bottom: 18px; }
.section-heading h2, .record-intro h2 { margin: 0; font-size: clamp(24px, 3vw, 31px); letter-spacing: -.035em; }
.section-heading p:not(.section-kicker), .record-intro > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.section-kicker { margin-bottom: 8px; font-size: 9px; }
.section-meta { color: var(--muted-2); font-size: 11px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 148px;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(16,34,49,.9), rgba(11,24,36,.9));
}
.metric-card::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(82,213,201,.07), transparent 70%); }
.metric-topline { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.metric-icon { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--cyan); font-style: normal; font-size: 12px; }
.pulse-icon::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(120,214,154,.55); }
.calendar-icon::before { content: ""; width: 10px; height: 9px; border: 1px solid currentColor; border-radius: 2px; box-shadow: inset 0 2px 0 rgba(82,213,201,.25); }
.metric-value { position: relative; z-index: 1; display: block; margin-top: 15px; font-size: 29px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-value.text-value { font-size: 23px; }
.metric-value small { margin-left: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.metric-card p { position: relative; z-index: 1; margin: 9px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.5; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.archive-panel {
  display: grid;
  grid-template-columns: .85fr .95fr minmax(330px, 1.35fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(145deg, rgba(14,30,43,.94), rgba(10,23,34,.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.015);
}
.archive-stat, .archive-download-card { min-width: 0; padding: 24px 26px; }
.archive-stat + .archive-stat, .archive-download-card { border-left: 1px solid var(--line); }
.archive-stat > span, .archive-download-card > div:first-child > span { color: var(--muted); font-size: 10px; }
.archive-stat strong { display: block; margin-top: 13px; font-size: 31px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.archive-stat strong b { font: inherit; }
.archive-stat strong small { color: var(--muted); font-size: 11px; font-weight: 500; }
.archive-stat p, .archive-download-card p { margin: 8px 0 0; color: var(--muted-2); font-size: 9px; line-height: 1.55; }
.archive-download-card { background: linear-gradient(120deg, rgba(82,213,201,.045), transparent 72%); }
.archive-presets { display: flex; gap: 7px; margin: 14px 0 9px; }
.archive-presets button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}
.archive-presets button:hover, .archive-presets button[aria-pressed="true"] {
  border-color: rgba(82,213,201,.42);
  color: var(--cyan-bright);
  background: var(--cyan-dim);
}
.archive-download-row { display: grid; grid-template-columns: minmax(120px, .75fr) 1fr; gap: 8px; }
.archive-download-row input {
  width: 100%;
  height: 39px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: var(--panel);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.archive-download-row input:focus { border-color: rgba(82,213,201,.65); box-shadow: 0 0 0 3px rgba(82,213,201,.08); }
.primary-button {
  min-height: 39px;
  border: 1px solid rgba(82,213,201,.46);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), #38aeb2);
  color: #04191a;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(52,171,174,.14);
}
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.archive-download-card > small { display: block; margin-top: 8px; color: var(--muted-2); font-size: 8px; }

.priority-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(350px, .72fr) minmax(650px, 1.55fr);
  gap: 12px;
  align-items: stretch;
}

.record-panel {
  position: relative;
  overflow: hidden;
  margin-top: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #0b1925;
}
.record-panel::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(82,213,201,.05), transparent 45%); pointer-events: none; }
.record-intro { grid-column: 1 / -1; padding: 15px 18px 12px; border-bottom: 1px solid var(--line); }
.record-intro h2 { font-size: 19px; }
.record-intro > p:last-child { margin-top: 4px; font-size: 9px; }
.record-stat { position: relative; min-width: 0; padding: 14px 17px; }
.record-stat + .record-stat { border-left: 1px solid var(--line); }
.record-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.record-symbol { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 6px; font-size: 12px; }
.loss-record .record-symbol { color: var(--rose); background: var(--rose-dim); }
.win-record .record-symbol { color: var(--cyan); background: var(--cyan-dim); }
.record-number { margin: 9px 0 5px; display: flex; align-items: baseline; gap: 5px; }
.record-number strong { font-size: 34px; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.loss-record .record-number strong { color: #f39ba3; }
.win-record .record-number strong { color: var(--cyan-bright); }
.record-number span, .record-stat p { color: var(--muted); font-size: 11px; }
.record-stat p { margin: 0 0 7px; }
.record-stat p b { color: var(--ink); }
.record-stat small { display: block; overflow: hidden; color: var(--muted-2); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.date-control, .watch-control { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 11px; }
.date-control input, .number-input-wrap {
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
}
.date-control input { padding: 0 12px; color-scheme: dark; outline: none; }
.date-control input:focus, .number-input-wrap:focus-within { border-color: rgba(82,213,201,.65); box-shadow: 0 0 0 3px rgba(82,213,201,.08); }

.priority-daily { min-width: 0; margin-top: 0; }
.priority-daily .section-heading { min-height: 49px; margin-bottom: 8px; align-items: center; }
.priority-daily .section-heading h2 { font-size: 19px; }
.priority-daily .section-heading p:not(.section-kicker) { margin-top: 3px; font-size: 9px; }
.priority-daily .section-kicker { display: none; }
.priority-daily .date-control input { height: 34px; }
.daily-layout { display: grid; grid-template-columns: minmax(440px, 1.6fr) minmax(205px, .65fr); gap: 10px; }
.rank-card, .ongoing-card, .calendar-card, .gap-card, .table-card, .algorithm-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(14,30,43,.94), rgba(10,23,34,.94));
}
.rank-card { padding: 13px; border-radius: var(--radius-md); }
.rank-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.rank-card-header > div:first-child { display: flex; align-items: baseline; gap: 12px; }
.rank-card-header span { color: var(--muted); font-size: 10px; }
.rank-card-header strong { font-size: 12px; }
.coverage-pill { padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.035); color: var(--muted); font-size: 9px; }
.coverage-pill[data-state="complete"] { color: var(--green); background: rgba(120,214,154,.09); }
.coverage-pill[data-state="partial"] { color: var(--amber); background: var(--amber-dim); }
.podium-list { display: grid; gap: 5px; }
.podium-row {
  min-height: 50px;
  display: grid;
  grid-template-columns: 34px minmax(95px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
}
.podium-rank { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); font-weight: 800; font-size: 10px; background: rgba(255,255,255,.035); }
.podium-row.rank-1 .podium-rank { color: #2f2614; background: var(--amber); box-shadow: 0 7px 20px rgba(238,184,100,.14); }
.podium-row.rank-2 .podium-rank { color: #18232b; background: #afc2cf; }
.podium-row.rank-3 .podium-rank { color: #2c211c; background: #bd8d71; }
.podium-length span, .podium-count span, .podium-last span { display: block; color: var(--muted-2); font-size: 8px; margin-bottom: 2px; }
.podium-length strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.podium-length strong small { margin-left: 3px; color: var(--muted); font-size: 10px; }
.podium-count { min-width: 84px; }
.podium-count b { color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.podium-last { min-width: 100px; text-align: right; }
.podium-last b { color: var(--muted); font-size: 10px; font-weight: 500; }
.rank-footnote { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 8px; }

.skeleton-row { height: 50px; border-radius: 10px; background: linear-gradient(90deg, rgba(255,255,255,.025) 25%, rgba(255,255,255,.06) 50%, rgba(255,255,255,.025) 75%); background-size: 200% 100%; animation: shimmer 1.6s infinite; }

.ongoing-card { overflow: hidden; }
.ongoing-header { min-height: 55px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.ongoing-header h3 { margin: 4px 0 0; font-size: 12px; }
.ongoing-header > span { color: var(--muted); font-size: 10px; }
.live-badge { color: var(--rose); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.live-badge i { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 8px rgba(240,123,133,.7); animation: blink 1.4s infinite; }
.ongoing-list { max-height: 174px; overflow: auto; padding: 5px 10px 9px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.ongoing-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; padding: 9px 3px; border-bottom: 1px solid var(--line); }
.ongoing-item:last-child { border-bottom: 0; }
.ongoing-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.ongoing-item small { display: block; margin-top: 5px; color: var(--muted-2); font-size: 9px; }
.ongoing-length { align-self: center; color: var(--rose); font-size: 17px; font-weight: 750; }
.ongoing-length small { display: inline; margin-left: 2px; color: var(--muted); font-size: 9px; }

.empty-state { min-height: 132px; display: grid; place-content: center; justify-items: center; color: var(--muted-2); text-align: center; }
.empty-state.compact { min-height: 128px; }
.empty-state span { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 8px; border: 1px dashed var(--line-strong); border-radius: 50%; font-size: 14px; }
.empty-state p { margin: 0; font-size: 10px; }

.history-section { scroll-margin-top: 90px; }
.watch-control { flex-direction: column; align-items: flex-start; gap: 6px; }
.number-input-wrap { display: flex; align-items: center; overflow: hidden; }
.number-input-wrap input { width: 63px; height: 36px; padding: 0 3px 0 12px; border: 0; outline: none; background: transparent; color: var(--ink); font-weight: 700; }
.number-input-wrap b { padding-right: 11px; color: var(--muted); font-size: 10px; }

.history-insights { display: grid; grid-template-columns: minmax(350px, 1.5fr) minmax(250px, .65fr); gap: 14px; margin-bottom: 14px; }
.calendar-card { padding: 19px; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.calendar-header strong { font-size: 13px; }
.calendar-nav { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.02); color: var(--muted); cursor: pointer; }
.calendar-nav:hover { color: var(--cyan); border-color: rgba(82,213,201,.4); }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-weekdays { margin-bottom: 5px; }
.calendar-weekdays span { padding: 5px; color: var(--muted-2); font-size: 8px; text-align: center; }
.calendar-day {
  position: relative;
  min-height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}
.calendar-day:hover:not(:disabled) { background: rgba(255,255,255,.035); color: var(--ink); }
.calendar-day.is-outside { opacity: .18; cursor: default; }
.calendar-day.is-future { opacity: .26; cursor: not-allowed; }
.calendar-day.is-selected { border-color: var(--cyan); color: var(--cyan-bright); background: var(--cyan-dim); font-weight: 750; }
.calendar-day.is-today::after { content: ""; position: absolute; top: 5px; right: 6px; width: 3px; height: 3px; border-radius: 50%; background: var(--blue); }
.calendar-day .day-state { position: absolute; bottom: 5px; width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.calendar-day[data-state="appeared"] .day-state { background: var(--cyan); box-shadow: 0 0 6px rgba(82,213,201,.65); }
.calendar-day[data-state="absent"] .day-state { background: var(--rose); }
.calendar-day[data-state="partial"] .day-state { width: 5px; height: 2px; border-radius: 2px; background: var(--amber); }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 8px; }
.calendar-legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot, .dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; }
.legend-dot.appeared, .dot.complete { background: var(--cyan); }
.legend-dot.absent { background: var(--rose); }
.legend-dot.partial, .dot.partial { background: var(--amber); }

.gap-card { padding: 23px; background: linear-gradient(145deg, rgba(16,35,49,.96), rgba(11,26,38,.96)); }
.gap-card > span { color: var(--muted); font-size: 10px; }
.gap-card > div { display: flex; align-items: baseline; gap: 5px; margin-top: 11px; }
.gap-card > div strong { color: var(--amber); font-size: 46px; line-height: 1; letter-spacing: -.06em; }
.gap-card > div b { color: var(--muted); font-size: 11px; }
.gap-card > p { min-height: 18px; margin: 10px 0 18px; color: var(--muted-2); font-size: 9px; }
.gap-card hr { margin: 0 0 13px; border: 0; border-top: 1px solid var(--line); }
.gap-card dl { margin: 0; }
.gap-card dl div { display: flex; justify-content: space-between; padding: 8px 0; color: var(--muted); font-size: 9px; }
.gap-card dd { margin: 0; color: var(--ink); font-weight: 650; }

.table-card { overflow: hidden; border-radius: var(--radius-md); }
.table-header { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.table-header strong { font-size: 12px; }
.table-header > div:first-child span { margin-left: 8px; color: var(--muted-2); font-size: 9px; }
.table-key { display: flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: 8px; }
.table-key .dot.partial { margin-left: 6px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 835px; }
th, td { height: 53px; padding: 0 18px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 10px; }
th { height: 38px; color: var(--muted-2); font-size: 8px; font-weight: 650; letter-spacing: .03em; background: rgba(2,10,16,.22); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.015); }
.date-cell strong { display: block; font-size: 10px; }
.date-cell span { display: block; margin-top: 4px; color: var(--muted-2); font-size: 8px; }
.coverage-cell { display: flex; align-items: center; gap: 7px; }
.coverage-track { width: 42px; height: 3px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.06); }
.coverage-track i { display: block; height: 100%; border-radius: inherit; background: var(--cyan); }
.coverage-cell.partial .coverage-track i { background: var(--amber); }
.streak-cell b { margin-right: 4px; font-size: 14px; font-variant-numeric: tabular-nums; }
.streak-cell span { color: var(--muted-2); font-size: 8px; }
.appear-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 7px; color: var(--muted); background: rgba(255,255,255,.03); font-size: 8px; }
.appear-badge.yes { color: var(--cyan); background: var(--cyan-dim); }
.appear-badge.no { color: var(--rose); background: var(--rose-dim); }
.appear-badge.unknown { color: var(--amber); background: var(--amber-dim); }
.table-loading { padding: 30px; color: var(--muted-2); text-align: center; }

.algorithm-card { overflow: hidden; border-radius: var(--radius-md); }
.algorithm-table-head, .algorithm-row { display: grid; grid-template-columns: minmax(220px, 1.6fr) .7fr .7fr 1fr .6fr .85fr; align-items: center; column-gap: 16px; }
.algorithm-table-head { min-height: 39px; padding: 0 19px; border-bottom: 1px solid var(--line); background: rgba(2,10,16,.22); color: var(--muted-2); font-size: 8px; }
.algorithm-row { min-height: 69px; padding: 10px 19px; border-bottom: 1px solid var(--line); transition: background .15s; }
.algorithm-row:last-child { border-bottom: 0; }
.algorithm-row:hover { background: rgba(255,255,255,.015); }
.algorithm-identity { min-width: 0; display: flex; align-items: center; gap: 12px; }
.algorithm-rank { flex: 0 0 28px; color: var(--muted-2); font-size: 11px; font-weight: 800; }
.algorithm-row:nth-child(-n+3) .algorithm-rank { color: var(--amber); }
.algorithm-name { min-width: 0; }
.algorithm-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.algorithm-name small { display: block; margin-top: 5px; color: var(--muted-2); font-size: 8px; }
.algorithm-stat strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.algorithm-stat span { margin-left: 3px; color: var(--muted-2); font-size: 8px; }
.hit-rate { display: flex; align-items: center; gap: 9px; }
.hit-track { width: 65px; height: 4px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.055); }
.hit-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #329c97, var(--cyan-bright)); }
.hit-rate b { min-width: 36px; font-size: 10px; font-variant-numeric: tabular-nums; }
.sample-count { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.state-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 8px; }
.state-chip i { width: 5px; height: 5px; border-radius: 50%; }
.state-chip.loss { color: var(--rose); }.state-chip.loss i { background: var(--rose); }
.state-chip.win { color: var(--green); }.state-chip.win i { background: var(--green); }
.state-chip.idle { color: var(--muted); }.state-chip.idle i { background: var(--muted-2); }
.algorithm-loading { min-height: 150px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted-2); font-size: 10px; }
.algorithm-loading i { width: 14px; height: 14px; border: 2px solid var(--line-strong); border-top-color: var(--cyan); border-radius: 50%; animation: spin 1s linear infinite; }

.method-note { display: flex; gap: 13px; margin-top: 35px; padding: 18px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.method-icon { flex: 0 0 23px; width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--cyan); font-family: Georgia, serif; font-size: 12px; }
.method-note strong { font-size: 10px; }
.method-note p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.7; }

.inline-error { margin-top: 10px; padding: 12px 14px; border: 1px solid rgba(240,123,133,.22); border-radius: 10px; color: #e8a2a8; background: var(--rose-dim); font-size: 10px; }
.inline-error button { margin-left: 9px; padding: 3px 8px; border: 1px solid rgba(240,123,133,.3); border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.is-hidden { display: none !important; }

.site-footer { min-height: 90px; padding: 25px max(24px, calc((100vw - var(--content)) / 2 + 24px)); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); background: #050d15; color: var(--muted-2); font-size: 9px; }
.site-footer > div { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.footer-brand { color: var(--ink); font-size: 11px; font-weight: 750; letter-spacing: .1em; }
.site-footer b { color: var(--muted); font-weight: 550; }
.site-footer > strong { color: var(--amber); font-size: 10px; font-weight: 650; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 330px; padding: 11px 15px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(14,30,43,.96); box-shadow: var(--shadow); color: var(--ink); font-size: 10px; opacity: 0; transform: translateY(9px); pointer-events: none; transition: .22s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

noscript { display: block; padding: 15px; background: var(--amber); color: #241b0c; text-align: center; font-weight: 700; }

@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1120px) {
  .priority-grid { grid-template-columns: 1fr; }
  .priority-record { min-height: 150px; }
}

@media (max-width: 1020px) {
  .live-console { grid-template-columns: 1fr; }
  .console-heading { min-height: 78px; flex-direction: row; align-items: center; }
  .update-card { width: 210px; margin-top: 0; }
  .control-deck { grid-template-columns: 1fr 1fr; }
  .deck-divider { display: none; }
  .active-view { grid-column: 1 / -1; padding-top: 13px; border-top: 1px solid var(--line); flex-direction: row; justify-content: space-between; }
  .filter-group { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .archive-panel { grid-template-columns: 1fr 1fr; }
  .archive-download-card { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .record-panel { grid-template-columns: 1fr 1fr; }
  .record-intro { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .record-stat:first-of-type { border-left: 0; }
  .algorithm-table-head, .algorithm-row { grid-template-columns: minmax(190px, 1.5fr) .7fr .7fr .9fr .6fr; }
  .algorithm-table-head span:last-child, .algorithm-row > *:last-child { display: none; }
}

@media (max-width: 760px) {
  .header-inner { height: 54px; padding: 0 14px; }
  .brand small { display: none; }
  .brand-mark { width: 31px; height: 31px; padding: 6px; }
  .live-state { padding: 7px 9px; }
  #header-health-text { display: none; }
  .page-shell { padding: 10px 10px 54px; }
  .hero { min-height: 0; }
  .live-console { display: grid; gap: 8px; }
  .console-heading { min-height: 62px; padding: 11px 13px; flex-direction: row; align-items: center; }
  .console-heading .eyebrow { margin-bottom: 5px; font-size: 8px; }
  .console-heading .eyebrow span { width: 13px; }
  .hero h1 { font-size: 19px; }
  .update-card { width: auto; margin: 0; padding: 0 0 0 12px; display: block; border-top: 0; border-left: 1px solid var(--line); text-align: right; }
  .update-card > span { display: none; }
  .update-card strong { display: block; font-size: 10px; }
  .update-card small { display: block; margin-top: 4px; white-space: nowrap; }
  .latest-draw-card { min-height: 0; padding: 10px 12px; grid-template-columns: 1fr auto; gap: 8px 12px; }
  .draw-meta > span { font-size: 8px; }
  .draw-meta > strong { margin: 4px 0 2px; font-size: 13px; }
  .draw-result-side { padding-left: 10px; }
  .draw-result-side > small { display: none; }
  .draw-tags { max-width: 120px; justify-content: flex-end; }
  .draw-tags span { padding: 4px 6px; font-size: 8px; }
  .draw-equation { grid-column: 1 / -1; gap: 6px; }
  .draw-ball { flex-basis: 39px; width: 39px; height: 39px; font-size: 19px; }
  .draw-equation > i { font-size: 13px; }
  .draw-total { min-width: 58px; height: 42px; padding: 5px 8px; gap: 5px; }
  .draw-total strong { font-size: 27px; }
  .control-deck { grid-template-columns: 1fr; gap: 8px; margin-top: 8px; padding: 9px 10px; border-radius: 13px; }
  .control-deck > .filter-group:first-child, .control-deck > .deck-divider { display: none; }
  .filter-group { width: 100%; align-items: stretch; flex-direction: column; gap: 6px; }
  .filter-label { font-size: 9px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; min-width: 0; min-height: 38px; padding-inline: 3px; font-size: 11px; }
  .active-view { grid-column: auto; padding-top: 7px; flex-direction: row; align-items: center; justify-content: space-between; }
  .active-view small { display: none; }
  .priority-grid { margin-top: 8px; gap: 13px; }
  .priority-record { min-height: 0; }
  .notice { align-items: flex-start; margin: 10px 0 0; }
  .notice strong, .notice div span { display: block; }
  .notice div span { margin-top: 4px; line-height: 1.5; }
  .notice-tag { display: none; }
  .section-block { margin-top: 34px; }
  .section-heading { align-items: flex-start; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 136px; padding: 16px; }
  .metric-value { font-size: 23px; }
  .metric-value.text-value { font-size: 19px; }
  .archive-panel { grid-template-columns: 1fr; }
  .archive-stat + .archive-stat, .archive-download-card { grid-column: auto; border-left: 0; border-top: 1px solid var(--line); }
  .record-panel { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; }
  .record-intro { grid-column: 1 / -1; padding: 10px 13px 8px; }
  .record-intro h2 { font-size: 16px; }
  .record-intro > p:last-child { display: none; }
  .record-stat { padding: 11px 12px; border-top: 0; }
  .record-stat + .record-stat { border-left: 1px solid var(--line); }
  .record-number { margin: 7px 0 4px; }
  .record-number strong { font-size: 29px; }
  .record-stat p { font-size: 9px; }
  .priority-daily { margin-top: 0; }
  .priority-daily .section-heading { min-height: 42px; margin-bottom: 7px; }
  .priority-daily .section-heading h2 { font-size: 17px; }
  .priority-daily .section-heading p:not(.section-kicker) { display: none; }
  .date-control { gap: 5px; }
  .date-control > span { display: none; }
  .date-control input { max-width: 137px; padding: 0 7px; font-size: 10px; }
  .daily-layout, .history-insights { grid-template-columns: 1fr; }
  .rank-card { padding: 10px; }
  .podium-row { grid-template-columns: 39px 1fr auto; gap: 9px; }
  .podium-last { display: none; }
  .ongoing-card { margin-top: 1px; }
  .ongoing-list { max-height: 220px; }
  .algorithm-table-head { display: none; }
  .algorithm-row { grid-template-columns: minmax(160px, 1.4fr) .6fr .6fr; gap: 8px; }
  .algorithm-row > :nth-child(4), .algorithm-row > :nth-child(5), .algorithm-row > :nth-child(6) { display: none; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .console-heading { display: none; }
  .hero h1 { font-size: 18px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 128px; padding: 14px; }
  .metric-icon { display: none; }
  .metric-value { font-size: 20px; }
  .metric-value.text-value { font-size: 17px; }
  .metric-card p { font-size: 9px; }
  .section-heading { display: block; }
  .archive-download-row { grid-template-columns: 1fr; }
  .date-control, .watch-control { margin-top: 16px; }
  .priority-daily .section-heading { display: flex; }
  .priority-daily .date-control { margin-top: 0; }
  .rank-card-header > div:first-child { display: block; }
  .rank-card-header strong { display: block; margin-top: 5px; }
  .calendar-day { min-height: 39px; }
}

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