:root {
  font-family: 'DM Sans', sans-serif;
  color: #202820;
  background: #f4f5f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #202820;
  --green: #315a43;
  --line: #e2e5df;
  --mono: 'DM Mono', monospace;
  --display: 'Manrope', sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background: radial-gradient(ellipse at 15% 5%, rgba(220, 235, 224, .36), transparent 34%), #f4f5f2;
}

.app-shell { max-width: 1220px; margin: 0 auto; padding: 0 46px; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font: 800 21px var(--display); letter-spacing: -1.2px; }
.brand-period { color: #8d9f62; }
.brand-mark { width: 23px; height: 23px; display: flex; align-items: flex-end; gap: 3px; padding: 3px 2px; }
.brand-mark span { width: 4px; border-radius: 5px; background: var(--green); }
.brand-mark span:nth-child(1) { height: 9px; }
.brand-mark span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3) { height: 12px; }
.topbar-right { display: flex; align-items: center; gap: 32px; }
.local-indicator, .source-link, .eyebrow, .aside-label, .aside-index, .status-meta, .footer > span:last-child { font-family: var(--mono); letter-spacing: .09em; }
.local-indicator { display: flex; align-items: center; gap: 8px; color: #6f786f; font-size: 10px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #74a47e; box-shadow: 0 0 0 3px #e1ece2; }
.source-link { color: var(--green); text-decoration: none; font-size: 12px; letter-spacing: 0; }
.source-link span { padding-left: 3px; }

.hero { display: grid; grid-template-columns: 1.12fr .88fr; gap: 80px; align-items: center; padding: 78px 0 73px; border-bottom: 1px solid var(--line); }
.hero-copy { max-width: 510px; }
.eyebrow { display: flex; align-items: center; gap: 11px; color: #74806d; font-size: 10px; }
.eyebrow-line { width: 21px; height: 1px; background: #8c9e72; }
.hero h1 { margin: 23px 0 19px; font: 700 clamp(54px, 7vw, 82px)/.99 var(--display); letter-spacing: -6px; }
.hero h1 span { color: #87946f; }
.hero-description { max-width: 398px; margin: 0 0 27px; color: #727b72; font-size: 15px; line-height: 1.75; }
.capture-button { min-width: 254px; display: inline-flex; align-items: center; justify-content: space-between; gap: 40px; padding: 14px 15px 14px 19px; border: 0; border-radius: 5px; background: var(--green); color: #fff; cursor: pointer; font: 600 13px 'DM Sans', sans-serif; transition: background .18s, transform .18s; }
.capture-button:hover { transform: translateY(-1px); background: #254a36; }
.capture-button:disabled { opacity: .72; cursor: wait; transform: none; }
.capture-button:focus-visible, a:focus-visible { outline: 3px solid #9bad7d; outline-offset: 3px; }
.button-icon { font-size: 18px; line-height: 14px; }
.button-note { margin: 13px 0 0; color: #92998f; font-size: 11px; }
.tiny-lock { margin-right: 5px; font-size: 13px; }

.hero-aside { padding: 23px 25px 17px; border: 1px solid #e1e6dc; border-radius: 6px; background: #e9ede6; }
.aside-top { display: flex; justify-content: space-between; padding-bottom: 13px; border-bottom: 1px solid #d7ded3; }
.aside-label, .aside-index { color: #879083; font-size: 9px; }
.process-step { height: 62px; display: grid; grid-template-columns: 36px 1fr 20px; align-items: center; border-bottom: 1px solid #dce1d8; }
.step-number { color: #929b8d; font: 10px var(--mono); }
.process-step strong, .process-step small { display: block; }
.process-step strong { font-size: 12px; font-weight: 600; }
.process-step small { margin-top: 3px; color: #858e83; font-size: 10px; }
.step-check { color: #77917a; font-size: 12px; }
.aside-foot { padding-top: 15px; color: #858d81; font-size: 10px; }
.sparkle { margin-right: 6px; color: #849660; font-size: 14px; }

.results-section { min-height: 310px; padding: 41px 0 53px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.section-eyebrow { font-size: 9px; }
.section-heading h2 { margin: 8px 0 0; font: 650 26px var(--display); letter-spacing: -1px; }
.toolbar { display: flex; align-items: center; gap: 12px; }
.search-field { display: inline-flex; align-items: center; gap: 8px; min-width: 240px; padding: 9px 12px; border: 1px solid #d6ddd2; border-radius: 4px; background: #f9faf6; }
.search-icon { color: #7d8b76; font-size: 18px; }
.search-field input { width: 100%; border: 0; background: transparent; color: var(--ink); font: 500 13px 'DM Sans', sans-serif; }
.search-field input:focus { outline: none; }
.download-button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #d6ddd2; border-radius: 4px; background: transparent; color: var(--green); text-decoration: none; font-size: 11px; font-weight: 600; }
.download-button:hover { background: #e9ede6; }
.status-panel { display: flex; align-items: center; gap: 13px; padding: 15px 17px; border: 1px solid #e5e9e1; border-radius: 5px; background: #ecefe9; }
.status-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #dde8dc; color: #66805d; font-size: 14px; }
.status-panel[data-state='running'] .status-icon { animation: spin 2s linear infinite; }
.status-panel[data-state='error'] .status-icon { background: #f4e4de; color: #a4513a; }
.status-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.status-copy strong { font-size: 12px; font-weight: 600; }
.status-copy span { color: #808980; font-size: 11px; }
.status-meta { color: #879083; font-size: 9px; white-space: nowrap; }
.story-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 14px; }
.story-card { min-width: 0; padding: 17px 18px; border: 1px solid #e6e9e3; border-radius: 5px; background: #fff; }
.story-card-header { display: flex; align-items: flex-start; gap: 9px; }
.story-number { padding-top: 3px; color: #8a987b; font: 10px var(--mono); }
.story-title { color: #273128; text-decoration: none; font: 600 14px/1.5 var(--display); letter-spacing: -.2px; }
.story-title:hover { color: #56765a; }
.story-section { display: inline-block; margin: 10px 0 0 19px; padding: 3px 6px; border-radius: 3px; background: #edf1e9; color: #6f8068; font: 9px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.related-count { display: inline-block; margin: 11px 0 0 19px; color: #879083; font: 9px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.related-links { margin: 7px 0 0; padding: 0 0 0 19px; list-style: none; }
.related-links li + li { margin-top: 6px; }
.related-links a { color: #748071; text-decoration: none; font-size: 11px; line-height: 1.5; }
.related-links a:hover { color: var(--green); text-decoration: underline; }
.empty-note { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 27px 0; color: #90978c; font-size: 11px; line-height: 1.7; text-align: left; }
.empty-star { color: #9ca784; font-size: 18px; }
.capture-footer { margin-top: 15px; color: #90978c; font: 10px var(--mono); }
.error-message { margin-top: 12px; padding: 12px 14px; border: 1px solid #efd5cd; border-radius: 4px; background: #f8e9e5; color: #8f4939; font-size: 12px; }
.footer { min-height: 68px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: #92998e; font-size: 10px; }
.footer > span:last-child { font-size: 9px; }
.footer-separator { padding: 0 5px; color: #adb2a8; }
.footer-spark { padding-left: 5px; color: #82925e; }

@keyframes spin { to { transform: rotate(360deg); } }
[hidden] { display: none !important; }

@media (max-width: 800px) {
  .app-shell { padding: 0 25px; }
  .hero { gap: 35px; padding: 65px 0; }
  .hero h1 { letter-spacing: -4px; }
  .hero-aside { padding: 19px; }
  .story-list { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .app-shell { padding: 0 19px; }
  .topbar { height: 70px; }
  .topbar-right { gap: 14px; }
  .local-indicator { font-size: 8px; }
  .source-link { font-size: 10px; }
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 52px 0; }
  .hero h1 { font-size: 65px; }
  .hero-description { font-size: 14px; }
  .hero-aside { max-width: none; }
  .results-section { padding-top: 33px; }
  .toolbar { width: 100%; justify-content: space-between; }
  .search-field { flex: 1; min-width: 0; }
  .section-heading h2 { font-size: 23px; }
  .status-meta { display: none; }
  .footer { align-items: flex-start; justify-content: center; flex-direction: column; gap: 12px; padding: 16px 0; }
  .footer > span:last-child { font-size: 8px; }
}

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

.trends { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #f9faf6; }
.trends-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.trends h3 { margin: 0; font: 700 15px var(--display); color: var(--ink); }
.trends-hint { font: 400 11px var(--mono); color: var(--green); letter-spacing: .04em; }
.trend-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.trend-item { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 10px; border: 1px solid #d6ddd2; border-radius: 999px; background: #fff; }
.trend-item[data-active="true"] { background: var(--green); border-color: var(--green); }
.trend-rank, .trend-count { font: 400 11px var(--mono); color: #7b857b; }
.trend-link { font: 600 13px 'DM Sans', sans-serif; color: var(--ink); text-decoration: none; }
.trend-link:hover { text-decoration: underline; }
.trend-item[data-active="true"] .trend-link, .trend-item[data-active="true"] .trend-rank, .trend-item[data-active="true"] .trend-count { color: #fff; }
.trend-remove { cursor: pointer; border: 0; background: transparent; font: 500 13px 'DM Sans', sans-serif; color: var(--ink); }
.trend-remove { width: 20px; height: 20px; border-radius: 50%; line-height: 1; }
.trend-remove:hover { background: #e2e5df; }
.trend-item[data-active="true"] .trend-remove { color: #fff; }
