:root {
  color-scheme: dark;
  --page: #151519;
  --surface: #1d1e24;
  --inset: #24252d;
  --hover: #2c2e36;
  --line: #31323b;
  --text: #efeff2;
  --soft: #c5c5d0;
  --muted: #a0a0af;
  --mint: #00dfaa;
  --mint-hover: #30edbd;
  --mint-wash: #17332d;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  font: 15px/1.55 var(--sans);
  color: var(--text);
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; padding: 0; background: none; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
::selection { background: #235e4f; color: #fff; }
.icon { display: inline-block; flex: none; width: 17px; height: 17px; vertical-align: middle; }
main:focus { outline: none; }
.skip-link { position: fixed; z-index: 40; left: 12px; top: -90px; background: var(--inset); color: var(--text); padding: 10px 15px; }
.skip-link:focus { top: 12px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.head-main { min-width: 0; }
.head-title, .head-tools, .spotlight-actions, .btn, .date-chip, .status-badge, .mute-action { display: flex; align-items: center; }
.head-title { gap: 12px; flex-wrap: wrap; }
h1 { font-size: clamp(23px, 1.5vw, 28px); font-weight: 670; line-height: 1.35; letter-spacing: -.04em; }
.head-meta { margin-top: 5px; color: var(--muted); font-size: 14px; }
.status-badge { gap: 6px; padding: 2px 9px; color: #b9b9c6; background: #202127; border: 1px solid #30313a; border-radius: 20px; font-size: 11px; font-weight: 550; line-height: 1.5; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; background: #9799ac; border-radius: 50%; }
.status-badge.is-stale::before { background: #e4b778; }
.head-tools { flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.date-chip, .mute-action, .head-tools > a, .head-tools > button {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 32px; padding: 5px 10px; border: 1px solid #2d2e37; border-radius: 6px;
  color: var(--muted); background: #1c1d23; text-decoration: none; font-size: 12px; white-space: nowrap;
}
.date-chip { font-variant-numeric: tabular-nums; }
.head-tools .icon { width: 14px; height: 14px; }
.head-tools > :is(a,button):hover { color: var(--text); background: var(--hover); }

.brief-stage { display: grid; place-items: center; }
.guest-stage { min-height: calc(100vh - 104px); min-height: calc(100svh - 104px); padding: 48px 0; }
.member-stage { padding: clamp(32px, 6vh, 68px) 0 28px; }
.spotlight {
  width: min(760px, 100%); min-width: 0; padding: 22px;
  background: var(--surface); border: 1px dashed #40414d; border-radius: 9px; text-align: center;
}
.spotlight-source { display: inline-flex; gap: 7px; align-items: center; justify-content: center; color: #aaabba; font: 600 11px/1.5 var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.spotlight-source .icon { width: 14px; height: 14px; }
.spotlight h2 { display: flex; gap: 8px; align-items: baseline; justify-content: center; font-size: clamp(20px, 1.55vw, 25px); font-weight: 660; line-height: 1.4; letter-spacing: -.036em; overflow-wrap: anywhere; text-wrap: balance; margin: 8px 0 0; }
.spotlight h2 .icon { align-self: center; color: var(--muted); width: 18px; height: 18px; }
.spotlight-summary { max-width: 46ch; color: var(--muted); font-size: 14px; line-height: 1.65; margin: 9px auto 17px; text-wrap: balance; overflow-wrap: anywhere; }
.spotlight-facts { display: grid; grid-template-columns: 1fr 1.15fr 1fr; text-align: left; background: var(--inset); border: 1px solid #2c2d35; border-radius: 7px; overflow: hidden; }
.spotlight-facts > div { min-width: 0; padding: 12px 14px; }
.spotlight-facts > div + div { border-inline-start: 1px solid #30313a; }
.spotlight-facts dt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 550; }
.spotlight-facts dt .icon { width: 13px; height: 13px; }
.spotlight-facts dd { display: flex; gap: 6px; align-items: center; margin-top: 5px; color: var(--text); font-size: 14px; font-weight: 590; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fact-verified .icon { color: #75d7b9; width: 15px; height: 15px; }
.spotlight-actions { justify-content: center; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.brief-analysis { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); text-align: left; }
.brief-analysis h3 { margin-bottom: 4px; color: var(--mint); font-size: 13px; font-weight: 600; }
.brief-analysis p { color: var(--soft); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.brief-analysis .brief-analysis-source { margin: 2px 0 6px; color: var(--muted); font-size: 12px; }
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px;
  min-height: 37px; padding: 8px 15px; border: 1px solid #363741; border-radius: 6px;
  background: #23242b; color: var(--text); font-size: 13px; line-height: 1.4; font-weight: 610; text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--hover); border-color: #484a57; }
.btn.primary { background: var(--mint); border-color: var(--mint); color: #08231c; }
.btn.primary:hover:not(:disabled) { background: var(--mint-hover); border-color: var(--mint-hover); }
.btn .icon { width: 15px; height: 15px; }
.btn.standalone { margin-top: 13px; }
.text-btn, .anchor { font-size: 13px; font-weight: 560; color: var(--soft); }
.text-btn:hover, .anchor:hover, .story-link:hover { color: var(--mint-hover); }

.body-grid, .settings-grid { display: grid; align-items: start; gap: clamp(18px, 2.2vw, 34px); }
.body-grid { grid-template-columns: minmax(0, 1fr) minmax(210px, 28%); max-width: 1260px; margin: 28px auto 0; }
.body-grid > section, .panel, .settings-section, .timeline-main {
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; min-width: 0;
}
.body-grid > section, .timeline-main { padding: clamp(16px, 2vw, 26px); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-heading h2, .panel h2, .settings-section h2 { font-size: 17px; font-weight: 650; letter-spacing: -.025em; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.filter { padding: 5px 10px; border: 1px solid transparent; border-radius: 5px; font-size: 13px; color: var(--muted); }
.filter:hover { color: var(--text); background: var(--inset); }
.filter[aria-pressed=true] { color: #72efd1; background: var(--mint-wash); border-color: #285045; }
.day-header { display: flex; align-items: center; gap: 11px; margin: 17px 0 4px; color: #a9aab8; font-size: 12px; font-weight: 570; font-variant-numeric: tabular-nums; }
.day-header::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.event { display: grid; grid-template-columns: 49px minmax(0, 1fr); gap: 12px; padding: 14px 0; }
.event + .event { border-top: 1px solid #2b2c34; }
.event time { color: #a8a9b7; font: 12px/1.8 var(--mono); }
.event-tags { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.symbol { display: inline-block; padding: 2px 5px; border-radius: 3px; background: #2c2e38; color: #d0d1db; font: 550 10px/1.35 var(--mono); letter-spacing: .035em; }
.event h3 { margin: 4px 0 3px; font-size: 16px; line-height: 1.5; font-weight: 620; letter-spacing: -.015em; overflow-wrap: anywhere; }
.story-link { text-decoration: none; }
.story-link:hover { text-decoration: underline; }
.event p { color: var(--soft); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.event .source-line { margin-top: 5px; color: var(--muted); font-size: 12px; }
.rail, .settings-grid > div { display: grid; gap: 14px; }
.panel, .settings-section { padding: 18px; }
.panel h2 { margin-bottom: 10px; }
.panel p, .settings-note { color: var(--muted); font-size: 14px; line-height: 1.65; }
.watch-row, .watch-id, .source-title, .cal-head { display: flex; align-items: center; gap: 9px; }
.watch-row, .source-title, .cal-head { justify-content: space-between; }
.watch-row { padding: 7px 0; }
.watch-id { font-size: 14px; font-weight: 600; }
.entity-mark { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid #3c3e49; border-radius: 6px; background: var(--inset); color: #bfc0cd; font: 600 10px var(--mono); }
.watch-row small, .cal-foot, .cal-amount, .week-name { color: var(--muted); font-size: 12px; }
.calendar { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 18px; }
.panel .calendar { border: 0; padding: 0; }
.cal-head { font-size: 14px; }
.cal-amount em { font: 600 15px var(--mono); color: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; margin: 9px 0; }
.week-name { text-align: center; font-size: 10px; }
.cal-day { height: 7px; border-radius: 2px; background: #32343c; }
.cal-day.l1 { background: #25624f; } .cal-day.l2 { background: #26997b; } .cal-day.l3 { background: var(--mint); } .cal-day.future { background: transparent; }
.cal-foot { font: 11px var(--mono); }
.quiet-block { max-width: 1260px; margin: 14px auto; padding: 13px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.quiet-block summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.quiet-block p { margin: 6px 0; font-size: 13px; color: var(--muted); }
.quiet-block a { display: block; margin: 6px 0; font-size: 14px; }
.timeline-main { max-width: 1040px; margin-top: 32px; }
.edit-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.field-select, .time-fields label { display: inline-flex; align-items: center; gap: 8px; color: var(--soft); font-size: 14px; }
input, select { max-width: 100%; min-width: 0; min-height: 38px; padding: 6px 10px; border: 1px solid #41424d; background: #222329; color: var(--text); border-radius: 6px; }
input::placeholder { color: #a1a1af; }
.settings-grid { grid-template-columns: minmax(0,1.2fr) minmax(220px,.8fr); max-width: 1120px; margin-top: 32px; }
.settings-section h2 { margin-bottom: 6px; }
.settings-section form { margin-top: 12px; }
.settings-checks, .time-fields, .invite-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.settings-checks, .time-fields { margin: 9px 0 14px; }
.check-chip { display: flex; align-items: center; gap: 7px; min-height: 37px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: var(--inset); }
.check-chip:has(:checked) { border-color: #305749; }
input[type=checkbox] { width: 15px; height: 15px; min-height: 0; margin: 0; accent-color: var(--mint); }
.source-status { border-top: 1px solid var(--line); padding: 11px 0; }
.source-status:first-of-type { border-top: 0; }
.source-title { font-size: 14px; font-weight: 600; }
.state-flag { flex: none; color: var(--muted); font-size: 12px; }
.source-status p, .empty, .initial-load { color: var(--muted); }
.source-status p { margin-top: 3px; font-size: 13px; line-height: 1.65; }
.empty, .initial-load { padding: 24px 0; }
dialog { width: min(536px,calc(100% - 28px)); padding: 0; color: var(--text); background: var(--surface); border: 1px solid #41424d; border-radius: 11px; max-height: 87vh; max-height: 87dvh; overflow: auto; box-shadow: 0 18px 62px #0008; }
dialog::backdrop { background: #08090cb5; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 10px 18px; }
.dialog-brand { font-size: 15px; font-weight: 660; letter-spacing: -.035em; }
.close-button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; color: var(--muted); font-size: 24px; }
.close-button:hover { background: var(--hover); color: var(--text); }
#sheet-content { padding: 20px 23px 25px; }
#dialog-title { margin: 7px 0 14px; font-size: clamp(20px,2vw,23px); font-weight: 650; line-height: 1.4; letter-spacing: -.035em; overflow-wrap: anywhere; }
.detail-note { font-size: 13px; color: var(--muted); }
.detail-lede { font-size: 15px; line-height: 1.7; margin-bottom: 12px; }
.detail-text { color: var(--soft); line-height: 1.75; white-space: pre-line; overflow-wrap: anywhere; }
.detail-block { margin: 17px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.detail-block h3 { font-size: 14px; margin-bottom: 5px; }
.quotation { margin: 15px 0; border-left: 2px solid var(--mint); border-radius: 0 5px 5px 0; background: var(--inset); padding: 13px 15px; }
.quotation blockquote { font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.quotation figcaption { margin-top: 6px; color: var(--muted); font-size: 12px; }
.fact-list { font-size: 13px; }
.fact-list div { display: grid; grid-template-columns: 6em minmax(0,1fr); gap: 8px; margin: 6px 0; }
.fact-list dt { color: var(--muted); }
.fact-list dd { overflow-wrap: anywhere; }
.minute-bars { margin: 9px 0; font-size: 13px; }
.minute-bars summary { color: var(--soft); cursor: pointer; }
.minute-bars table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: 8px; }
.minute-bars th, .minute-bars td { padding: 6px 1px; text-align: left; border-bottom: 1px solid var(--line); }
.minute-bars th:last-child, .minute-bars td:last-child { text-align: right; }
.auth-form, .auth-form label { display: grid; }
.auth-form { gap: 12px; } .auth-form label { gap: 5px; color: var(--soft); font-size: 14px; }
.auth-switch { margin-top: 16px; }
.form-error { font-size: 13px; color: #ffb4ab; }
.invite-result { width: 100%; margin-top: 9px; }
.settings-invite-actions { margin-top: 13px; }
.btn.revoke-invites { color: #ffb4ab; border-color: #75504f; }
.toast { position: fixed; z-index: 25; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 26px); border: 1px solid #43454f; border-radius: 7px; background: #2d2e36; color: var(--text); padding: 10px 15px; font-size: 14px; box-shadow: 0 6px 20px #0004; }

@media (max-width: 700px) {
  .guest-stage { min-height: auto; padding: clamp(34px,7svh,65px) 0; }
  .member-stage { padding: 24px 0 15px; }
  .page-head { gap: 8px; flex-wrap: wrap; }
  .head-title { gap: 8px; }
  .head-meta { font-size: 12px; margin-top: 4px; }
  .head-tools { gap: 5px; }
  .date-chip, .head-tools > :is(a,button) { min-height: 32px; font-size: 11px; }
  .spotlight { padding: 19px 14px 16px; }
  .spotlight-summary { font-size: 13px; }
  .spotlight-facts > div { padding: 9px 7px; }
  .spotlight-facts dt { font-size: 10px; }
  .spotlight-facts dd { font-size: 12px; }
  .spotlight-actions .btn { min-height: 42px; }
  .body-grid, .settings-grid { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .body-grid { margin-top: 6px; }
  .settings-grid, .timeline-main { margin-top: 21px; }
  .event { grid-template-columns: 38px minmax(0,1fr); gap: 7px; }
  .event h3 { font-size: 15px; }
  .event p { font-size: 13px; }
  .toast { bottom: calc(75px + env(safe-area-inset-bottom)); }
  .quiet-block { margin-bottom: 15px; }
  #watchlist-panel { scroll-margin-top: calc(64px + env(safe-area-inset-top)); }
  #sheet-content { padding-inline: 17px; }
  input:not([type=checkbox]), select { font-size: 16px; }
}
@media (max-width: 380px) {
  .spotlight-facts { grid-template-columns: .8fr 1.25fr .9fr; }
  .spotlight-facts dt .icon { display: none; }
  .spotlight-actions { gap: 6px; }
  .spotlight-actions .btn { padding-inline: 10px; }
  .edit-filters > input { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  a, button { transition: background-color .13s ease, color .13s ease, border-color .13s ease; }
}
