:root {
  --bg: #f4f3ef;
  --bg-elev: #fffcf8;
  --line: rgba(24, 23, 22, 0.08);
  --line-strong: rgba(24, 23, 22, 0.14);
  --ink: #1c1917;
  --muted: #78716c;
  --faint: #a8a29e;
  --brand: #5e6ad2;
  --brand-soft: rgba(94, 106, 210, 0.12);
  --ok: #0f766e;
  --ok-soft: rgba(15, 118, 110, 0.1);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.1);
  --bad: #b42318;
  --bad-soft: rgba(180, 35, 24, 0.08);
  --shadow: 0 1px 0 rgba(24, 23, 22, 0.04), 0 8px 24px rgba(24, 23, 22, 0.04);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  letter-spacing: -0.01em;
}

a { color: inherit; }

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(244, 243, 239, 0.86);
  border-bottom: 1px solid var(--line);
}

.topbar-inner,
.page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.brand-sub {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--line-strong);
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  text-decoration: none;
  font-size: 13px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
}

.nav a:hover { color: var(--ink); background: rgba(24,23,22,.04); }
.nav a.active { color: var(--ink); background: white; box-shadow: var(--shadow); }

.page { padding: 32px 0 80px; }

.kicker {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.h1 {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 6px 0 8px;
}

.lede { color: var(--muted); font-size: 15px; line-height: 1.6; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-pad { padding: 20px 22px; }

.section-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: white;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { border-color: var(--ink); }
.btn-primary {
  background: var(--brand);
  border-color: transparent;
  color: white;
}
.btn-primary:hover { filter: brightness(1.05); border-color: transparent; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(24,23,22,.05);
  color: var(--muted);
  white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }

.grid-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stack { display: grid; gap: 16px; }

.metric {
  padding: 14px 16px;
}
.metric b { display: block; font-size: 22px; letter-spacing: -0.04em; }
.metric span { color: var(--muted); font-size: 12px; }

.source-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.source-link:hover { text-decoration: underline; }

.rank {
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  width: 42px;
  flex: none;
  font-size: 12px;
}

.hot-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.hot-row:first-child { border-top: 0; }
.hot-title { flex: 1; min-width: 0; }

.hot-more {
  margin-top: 2px;
}
.hot-more summary {
  cursor: pointer;
  list-style: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 0 2px;
  user-select: none;
}
.hot-more summary::-webkit-details-marker,
.hot-more summary::marker {
  display: none;
  content: "";
}
.hot-more-open { display: none; }
.hot-more[open] > summary .hot-more-closed { display: none; }
.hot-more[open] > summary .hot-more-open { display: inline; }

.op-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.08em;
}

.spec {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
}
.spec dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
.spec dd { margin: 0; font-size: 14px; line-height: 1.65; color: #44403c; }

.layer {
  padding: 16px;
  border-radius: 12px;
  background: rgba(24,23,22,.03);
}
.layer-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.layer.fact .layer-label { color: var(--ok); }
.layer.infer .layer-label { color: var(--brand); }
.layer.idea .layer-label { color: var(--warn); }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  padding: 10px 16px;
}
.table td {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:hover td { background: rgba(24,23,22,.02); }

.input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: white;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.login-wrap {
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
}

.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.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;
}

.report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.report-head-copy {
  flex: 1;
  min-width: 0;
}

.day-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.day-picker {
  position: relative;
  display: inline-flex;
  width: 148px;
  flex: 0 0 148px;
}

.day-picker input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line-strong);
  background: white;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  height: 38px;
  width: 148px;
  cursor: pointer;
}

.day-picker input[type="date"]:hover { border-color: var(--ink); }
.day-picker input[type="date"]:focus {
  outline: 2px solid var(--brand-soft);
  border-color: var(--brand);
}

@media (max-width: 820px) {
  .report-head { flex-wrap: wrap; }
  .day-nav { margin-left: auto; }
}

.btn.is-disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.day-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: -12px 0 28px;
}

.day-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.day-chip:hover { border-color: var(--ink); color: var(--ink); }
.day-chip.current {
  background: var(--ink);
  border-color: transparent;
  color: white;
}

.op {
  scroll-margin-top: 76px;
  border-left: 3px solid var(--brand);
}

.jump {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.support {
  margin-top: 40px;
}

.drawer {
  overflow: hidden;
}
.drawer + .drawer { margin-top: 10px; }
.drawer > summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 650;
  font-size: 14px;
  user-select: none;
}
.drawer > summary::-webkit-details-marker,
.drawer > summary::marker {
  display: none;
  content: "";
}
.drawer-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.drawer-body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
}
.drawer-body.flush { padding: 0; }

@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-5, .spec { grid-template-columns: 1fr; }
  .h1 { font-size: 26px; }
  .nav a:not(.active):not(.iconish) { display: none; }
}
