:root {
  color-scheme: light;
  --ink: #13201b;
  --muted: #6f7d76;
  --paper: #f4f0e8;
  --card: #fffdf8;
  --green: #1e4b3e;
  --green-dark: #102f27;
  --accent: #d9aa56;
  --line: rgba(24, 54, 45, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); padding-bottom: 92px; }
button, input { font: inherit; }
button { cursor: pointer; }
.onboarding-cover { background: radial-gradient(circle at 25% 15%, rgba(217,170,86,.32), transparent 28%), linear-gradient(150deg, #17392f, #0b211b 68%); border-radius: 0 0 24px 24px; box-shadow: 0 20px 45px rgba(8,24,19,.34); color: white; display: flex; flex-direction: column; inset: 0; justify-content: center; min-height: 100dvh; padding: calc(26px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom)); position: fixed; touch-action: none; transform-origin: top center; transition: transform .42s cubic-bezier(.2,.8,.2,1), opacity .3s ease, visibility .3s ease; z-index: 20; }
.onboarding-cover.dragging { transition: none; }
.onboarding-cover.dismissed { opacity: 0; pointer-events: none; transform: translateY(-104%); visibility: hidden; }
.cover-grip { align-self: center; background: rgba(255,255,255,.32); border-radius: 99px; height: 5px; margin-bottom: auto; width: 54px; }
.cover-brand { align-items: center; display: inline-flex; gap: 14px; margin: 28px 0 16px; max-width: 100%; }
.cover-brand img { border-radius: 16px; box-shadow: 0 10px 24px rgba(0,0,0,.18); flex: 0 0 auto; height: 58px; width: 58px; }
.onboarding-cover h2 { display: grid; font-family: Georgia, serif; font-size: 43px; line-height: 1.02; margin: 0; }
.cover-copy { color: #f5ead7; font-family: Georgia, serif; font-size: 22px; line-height: 1.35; max-width: 360px; }
.cover-hint { color: #bfd2ca; font-size: 12px; margin: auto 0 0; }
.topbar { align-items: center; background: var(--green-dark); color: white; display: flex; justify-content: space-between; padding: calc(20px + env(safe-area-inset-top)) 20px 16px; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 1.5px; margin: 0 0 5px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: Georgia, serif; font-size: 30px; margin-bottom: 0; }
.icon-button, .close-button { align-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: 50%; color: white; display: flex; font-size: 25px; height: 44px; justify-content: center; width: 44px; }
.hero { background: var(--green); color: white; padding: 25px 20px 28px; }
.hero-date { color: #c8d8d1; font-size: 12px; letter-spacing: 1px; margin-bottom: 16px; text-transform: uppercase; }
.hero h2 { font-family: Georgia, serif; font-size: 35px; line-height: 1.06; margin-bottom: 20px; }
.hero h2 span { color: #d7e2dd; }
.hero-meta { align-items: center; color: #d6e2de; display: flex; font-size: 12px; gap: 8px; }
.pulse { background: #74d19f; border-radius: 50%; box-shadow: 0 0 0 4px rgba(116,209,159,.14); height: 7px; width: 7px; }
.notify-button { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.18); border-radius: 99px; color: white; font-size: 12px; font-weight: 800; margin-top: 16px; padding: 10px 13px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 18px 20px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { background: transparent; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 9px 13px; }
.chip.active { background: var(--green); color: white; }
.section-heading { align-items: end; display: flex; justify-content: space-between; padding: 22px 20px 9px; }
.section-heading h2 { font-family: Georgia, serif; font-size: 26px; margin: 0; }
#storyCount { color: var(--muted); font-size: 12px; }
.story-list { display: grid; gap: 12px; padding: 0 14px; }
.story-card { background: var(--card); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 4px 14px rgba(23,45,37,.04); padding: 15px; }
.story-topline, .story-card footer { align-items: center; display: flex; justify-content: space-between; }
.topic { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
time { color: var(--muted); font-size: 11px; }
.story-card h3 { font-family: Georgia, serif; font-size: 20px; line-height: 1.18; margin: 12px 0 9px; }
.summary-list { color: #53615b; display: grid; font-size: 13px; gap: 6px; line-height: 1.45; margin: 0 0 13px; padding-left: 18px; }
.source { font-size: 12px; font-weight: 800; }
.source-tier { border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 9px; margin-left: 5px; padding: 3px 5px; text-transform: uppercase; }
a { color: var(--green); font-size: 12px; font-weight: 800; text-decoration: none; }
.story-question { background: transparent; border: 0; border-top: 1px solid var(--line); color: var(--green); font-size: 12px; font-weight: 800; margin-top: 14px; padding: 12px 0 0; text-align: left; width: 100%; }
dialog { background: transparent; border: 0; height: 100%; margin: 0; max-height: none; max-width: none; padding: 0; width: 100%; }
dialog::backdrop { background: rgba(5,18,14,.5); }
.chat-shell { background: var(--paper); display: flex; flex-direction: column; height: 86%; margin-top: 14%; }
.chat-header { align-items: center; background: var(--green-dark); color: white; display: flex; justify-content: space-between; padding: 19px 20px 16px; }
.chat-header h2 { font-family: Georgia, serif; margin: 0; }
.suggestions { background: #eadfce; border-bottom: 1px solid var(--line); display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; scrollbar-width: none; }
.suggestions::-webkit-scrollbar { display: none; }
.suggestion { background: white; border: 1px solid var(--line); border-radius: 99px; color: var(--green); flex: 0 0 auto; font-size: 12px; font-weight: 800; padding: 9px 12px; }
.turnstile-box { background: #fff7e6; border-bottom: 1px solid var(--line); color: #53615b; font-size: 12px; padding: 10px 12px; }
.turnstile-box p { margin-bottom: 8px; }
.chat-messages { display: flex; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; padding: 16px; }
.message { border-radius: 13px; font-size: 13px; line-height: 1.5; max-width: 90%; padding: 12px; white-space: pre-wrap; }
.assistant { background: white; border: 1px solid var(--line); }
.user { align-self: end; background: var(--green); color: white; }
.citations { display: grid; gap: 6px; margin-top: 8px; }
.citations a { display: block; }
.chat-form { background: white; display: flex; gap: 8px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
.chat-form input { border: 1px solid var(--line); border-radius: 99px; flex: 1; min-width: 0; padding: 12px 14px; }
.chat-form button { background: var(--green); border: 0; border-radius: 99px; color: white; font-size: 12px; font-weight: 800; height: 43px; min-width: 48px; padding: 0 12px; }
@media (min-width: 700px) {
  main, .topbar { margin: auto; max-width: 760px; }
  .topbar { border-radius: 0 0 14px 14px; }
  .story-list { grid-template-columns: repeat(2, 1fr); }
  .chat-shell { border-radius: 18px 18px 0 0; margin: 8vh auto 0; max-width: 680px; }
}
