:root {
  color-scheme: light;
  --bg: #f4f5ef;
  --surface: #fffef9;
  --surface-raised: #e9ede4;
  --border: #d6dbcf;
  --text: #293128;
  --muted: #6e776a;
  --accent: #697856;
  --accent-hover: #556445;
  --accent-soft: #e5eadf;
  --accent-ink: #ffffff;
  --clay: #98634d;
  --clay-soft: #f2e6df;
  --water: #52747a;
  --water-soft: #e3ecec;
  --danger: #a1483e;
  --success: #55745a;
  --content: 820px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.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;
}
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
a { color: inherit; }
svg { width: 19px; height: 19px; flex: 0 0 auto; }
:where(a, button, input, select, summary):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.skip-link {
  position: fixed; z-index: 100; top: 10px; left: 10px; padding: 9px 12px;
  color: var(--accent-ink); background: var(--accent); border-radius: 6px;
  font-size: 13px; font-weight: 750; text-decoration: none; transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.app-shell {
  width: min(var(--content), calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 112px;
}

.has-navigation .app-shell { margin: 0 auto; }

.nav-dock {
  position: fixed; z-index: 30; top: 22px; left: 22px;
  width: 44px; height: 62px; pointer-events: auto;
}
.nav-trigger {
  width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 50%;
  display: grid; place-items: center; color: var(--text); background: rgba(255, 254, 249, .94);
  box-shadow: 0 5px 22px rgba(49, 57, 44, .08); cursor: pointer; pointer-events: auto;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.nav-trigger:hover, .nav-trigger[aria-expanded="true"] {
  color: var(--accent); border-color: #bbc5b2; background: var(--surface);
}
.nav-trigger svg { width: 20px; height: 20px; }
.nav-panel {
  position: absolute; top: 52px; left: 0; width: 252px; max-height: calc(100vh - 88px);
  overflow-y: auto; padding: 18px 14px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: rgba(255, 254, 249, .98);
  box-shadow: 0 18px 55px rgba(49, 57, 44, .13);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav-dock:hover .nav-panel,
.nav-dock:focus-within .nav-panel,
.nav-dock.is-open .nav-panel {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
}

.brand, .auth-brand {
  display: flex; align-items: center; gap: 11px; color: var(--text);
  font-size: 18px; font-weight: 750; text-decoration: none;
}
.brand-mark {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif; font-weight: 700;
}
.nav-panel nav { display: grid; gap: 2px; margin-top: 18px; }
.nav-panel nav a, .nav-button {
  width: 100%; border: 0; display: flex; align-items: center; gap: 12px;
  color: var(--muted); background: transparent; padding: 9px 10px;
  border-radius: 6px; text-decoration: none; cursor: pointer; text-align: left;
  font-size: 14px;
}
.nav-panel nav a:hover, .nav-button:hover, .nav-panel nav a.active {
  color: var(--text); background: var(--accent-soft);
}
.nav-panel nav a.active { color: var(--accent-hover); font-weight: 700; }
.nav-panel nav svg, .nav-button svg { width: 18px; height: 18px; }
.nav-divider { height: 1px; margin: 7px 10px; background: var(--border); }
.nav-panel-footer { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.bottom-nav { display: none; }

.brief-header, .page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px;
  padding-bottom: 34px; border-bottom: 1px solid var(--border); margin-bottom: 0;
}
.date, .eyebrow {
  color: var(--clay); text-transform: uppercase; font-size: 11px;
  font-weight: 750; margin: 0 0 11px;
}
h1 {
  font-family: Georgia, "Times New Roman", serif; font-size: 42px;
  font-weight: 500; line-height: 1.12; letter-spacing: 0; margin: 0;
}
.freshness, .page-header p:not(.eyebrow) { color: var(--muted); margin: 10px 0 0; font-size: 14px; }
.page-header-actions { display: flex; align-items: center; gap: 10px; }

.button {
  min-height: 44px; border: 1px solid transparent; border-radius: 6px;
  padding: 0 17px; display: inline-flex; align-items: center; justify-content: center;
  gap: 9px; font-weight: 750; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.button-primary { color: var(--accent-ink); background: var(--accent); }
.button-primary:hover { background: var(--accent-hover); }
.button:disabled { cursor: wait; opacity: .82; }
.button.is-loading svg { animation: spin .8s linear infinite; }
.button-secondary { color: var(--text); background: var(--surface-raised); border-color: var(--border); }

.brief-list { display: grid; gap: 0; }
.news-card {
  background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
  padding: 34px 0; transition: background .15s ease;
}
.news-card:hover { background: rgba(255, 254, 249, .42); }
.lead-card { padding: 40px 0; }
.discovery-card { border-color: var(--border); }
.discovery-card:hover { border-color: var(--border); }
.card-meta { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 12px; }
.discovery-label {
  display: inline-flex; align-items: center; gap: 5px; margin-right: 3px;
  color: var(--water); font-weight: 750;
}
.discovery-label svg { width: 14px; height: 14px; }
.ai-label { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--accent); }
.ai-label svg { width: 13px; height: 13px; }
.cluster-menu { position: relative; margin-left: auto; color: var(--muted); }
.ai-label + .cluster-menu { margin-left: 2px; }
.cluster-menu summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; }
.cluster-menu summary::-webkit-details-marker { display: none; }
.cluster-menu summary svg { width: 13px; height: 13px; }
.cluster-menu > div {
  position: absolute; z-index: 5; top: calc(100% + 9px); right: 0; width: max-content; max-width: 280px;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); background: var(--surface); box-shadow: 0 12px 35px rgba(49, 57, 44, .12);
  font-size: 12px; line-height: 1.45;
}
.news-card h2 {
  max-width: 730px; font-family: Georgia, "Times New Roman", serif;
  font-size: 24px; font-weight: 500; line-height: 1.34; letter-spacing: 0; margin: 13px 0 12px;
}
.lead-card h2 { font-size: 30px; line-height: 1.28; }
.news-card h2 a { text-decoration: none; }
.news-card h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.summary { max-width: 720px; color: #4f594d; line-height: 1.72; margin: 0; font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.tags span {
  display: inline-flex; align-items: center; gap: 5px; color: var(--accent-hover);
  background: var(--accent-soft); border: 1px solid #d4dccb; border-radius: 999px;
  padding: 5px 9px; font-size: 11px; font-weight: 700;
}
.tags svg { width: 13px; height: 13px; }
.relevance-details { margin-top: 14px; border-top: 1px solid var(--border); }
.relevance-details summary {
  min-height: 42px; display: flex; align-items: center; gap: 7px;
  color: var(--muted); font-size: 12px; cursor: pointer; list-style: none;
}
.relevance-details summary::-webkit-details-marker { display: none; }
.relevance-details summary > svg { width: 15px; height: 15px; }
.relevance-details summary > svg:last-child {
  margin-left: auto; transition: transform 140ms ease;
}
.relevance-details[open] summary > svg:last-child { transform: rotate(180deg); }
.relevance-explanation {
  display: grid; gap: 9px; padding: 3px 0 15px; color: var(--muted);
}
.relevance-explanation p {
  display: grid; grid-template-columns: 17px 1fr; gap: 8px; margin: 0;
  font-size: 12px; line-height: 1.5;
}
.relevance-explanation svg { width: 15px; height: 15px; margin-top: 1px; color: var(--water); }
.card-actions {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); margin-top: 20px; padding-top: 14px;
}
.feedback-actions { display: flex; gap: 5px; }
.feedback-actions form { display: contents; }
.icon-button {
  width: 38px; height: 38px; border: 1px solid transparent; border-radius: 6px;
  display: inline-grid; place-items: center; color: var(--muted); background: transparent;
  cursor: pointer; text-decoration: none;
}
.icon-button:hover { color: var(--text); background: var(--surface-raised); }
.icon-button.selected { color: var(--accent-hover); background: var(--accent-soft); border-color: #c4cfba; }
.read-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; text-decoration: none; }
.read-link:hover { color: var(--text); }
.read-link svg { width: 15px; height: 15px; }

.feedback-dialog {
  width: min(480px, calc(100% - 28px)); max-height: min(720px, calc(100vh - 40px));
  border: 1px solid var(--border); border-radius: 8px; padding: 0;
  color: var(--text); background: var(--surface); box-shadow: 0 24px 80px rgba(49, 57, 44, .2);
}
.feedback-dialog::backdrop { background: rgba(41, 49, 40, .34); backdrop-filter: blur(4px); }
.feedback-dialog > form { padding: 24px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.dialog-heading h3 { margin: 0; font-size: 21px; }
.reason-list { display: grid; gap: 6px; margin-bottom: 20px; }
.reason-list label { display: block; }
.reason-list input { position: absolute; opacity: 0; pointer-events: none; }
.reason-list span {
  min-height: 43px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted); background: var(--surface); cursor: pointer; font-size: 14px;
}
.reason-list span svg { width: 16px; height: 16px; opacity: 0; color: var(--accent); }
.reason-list input:checked + span { border-color: #b8c5ad; background: var(--accent-soft); color: var(--text); }
.reason-list input:checked + span svg { opacity: 1; }
.feedback-dialog .button { width: 100%; }

.flash {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 18px;
  border: 1px solid; border-radius: 6px; font-size: 14px;
}
.flash-success { color: #3f6546; border-color: #bfd0c0; background: #edf5ed; }
.flash-warning { color: #7b622d; border-color: #dfd0a9; background: #faf4e4; }
.flash-error { color: var(--danger); border-color: #dfbdb6; background: #faece9; }

@keyframes spin { to { transform: rotate(360deg); } }

.auth-page { display: grid; place-items: center; padding: 36px 20px; }
.auth-page .app-shell { width: min(420px, 100%); padding: 0; margin: 0; }
.auth-shell { width: 100%; }
.auth-brand { margin-bottom: 64px; }
.auth-copy h1 { font-size: 34px; }
.auth-copy > p:not(.eyebrow) { color: var(--muted); line-height: 1.5; margin: 12px 0 28px; }
.form-stack { display: grid; gap: 16px; }
.form-stack label { display: grid; gap: 7px; color: var(--text); font-size: 13px; font-weight: 650; }
.form-stack input {
  width: 100%; height: 48px; border: 1px solid var(--border); border-radius: 6px;
  padding: 0 13px; background: var(--surface); color: var(--text); outline: none;
}
.form-stack input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(105, 120, 86, .12); }
.form-stack small { color: var(--muted); font-weight: 400; }
.form-stack .button { margin-top: 5px; }
.auth-switch { color: var(--muted); text-align: center; font-size: 14px; margin: 22px 0 0; }
.auth-switch a { color: var(--text); font-weight: 700; }
.form-link {
  width: max-content; margin-top: -5px; color: var(--muted);
  font-size: 12px; text-decoration: none;
}
.form-link:hover { color: var(--text); }

.narrow-header { align-items: center; }
.preferences-form { display: grid; gap: 18px; }
.preference-section { padding: 24px 0; border-bottom: 1px solid var(--border); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 19px; }
.section-heading span { color: var(--muted); font-size: 12px; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { color: var(--muted); font-size: 12px; font-weight: 750; margin-bottom: 9px; text-transform: uppercase; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 13px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 6px;
  color: var(--muted); cursor: pointer; font-size: 14px;
}
.choice svg { width: 15px; height: 15px; opacity: .4; }
.choice input:checked + span { color: var(--text); border-color: #b8c5ad; background: var(--accent-soft); }
.choice input:checked + span svg { color: var(--accent); opacity: 1; }
.negative .choice input:checked + span { border-color: #dfbdb6; background: #faece9; }
.negative .choice input:checked + span svg { color: var(--danger); }
.interest-search {
  position: relative; display: block; max-width: 420px; margin: 0 0 26px;
}
.interest-search svg {
  position: absolute; top: 50%; left: 13px; width: 17px; height: 17px;
  color: var(--muted); transform: translateY(-50%); pointer-events: none;
}
.interest-search input {
  width: 100%; height: 44px; padding: 0 13px 0 40px; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); background: var(--surface); outline: none;
}
.interest-search input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(105, 120, 86, .12);
}
.team-composer { max-width: 520px; display: grid; gap: 8px; }
.team-composer > div { display: grid; grid-template-columns: 1fr 44px; gap: 8px; }
.team-composer .icon-button { width: 44px; height: 44px; border-color: var(--border); background: var(--surface); }
.team-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.team-list:empty { margin-top: 0; }
.team-chip {
  min-height: 36px; display: inline-flex; align-items: center; gap: 7px;
  padding: 0 6px 0 11px; border: 1px solid #bdc9b4; border-radius: 999px;
  color: var(--accent-hover); background: var(--accent-soft); font-size: 13px; font-weight: 650;
}
.team-chip button {
  width: 26px; height: 26px; border: 0; border-radius: 50%; display: grid; place-items: center;
  color: var(--muted); background: transparent; cursor: pointer;
}
.team-chip button:hover { color: var(--text); background: rgba(105, 120, 86, .12); }
.team-chip svg { width: 14px; height: 14px; }
.discovery-options {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px;
}
.discovery-options label { min-width: 0; }
.discovery-options input { position: absolute; opacity: 0; pointer-events: none; }
.discovery-options span {
  min-height: 62px; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 7px;
  padding: 10px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted); background: var(--surface); cursor: pointer; font-size: 12px; line-height: 1.3;
}
.discovery-options span svg { width: 15px; height: 15px; opacity: 0; color: var(--water); }
.discovery-options input:checked + span { color: var(--text); border-color: #acc1c2; background: var(--water-soft); }
.discovery-options input:checked + span svg { opacity: 1; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 8px; }
.empty-state { text-align: center; padding: 90px 20px; }
.empty-state > svg { width: 38px; height: 38px; color: var(--muted); }
.empty-state h2 { margin: 16px 0 6px; }
.empty-state p { color: var(--muted); margin: 0 0 22px; }

.settings-form { display: grid; }
.settings-section {
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(300px, 1.35fr); gap: 48px;
  padding: 28px 0; border-bottom: 1px solid var(--border);
}
.settings-copy h2 { margin: 0 0 8px; font-size: 18px; }
.settings-copy p, .model-note { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 0; }
.settings-control { display: grid; align-content: start; gap: 10px; }
.field-label { color: var(--text); font-size: 13px; font-weight: 700; }
.text-input, .select-input {
  width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 6px;
  padding: 0 12px; color: var(--text); background: var(--surface); outline: none;
}
.text-input:focus, .select-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(105, 120, 86, .12); }
.segmented-control {
  display: grid; grid-template-columns: repeat(3, 1fr); min-height: 44px;
  padding: 3px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
}
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span {
  height: 36px; display: grid; place-items: center; border-radius: 5px;
  color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700;
}
.segmented-control input:checked + span {
  color: var(--text); background: var(--surface); box-shadow: 0 1px 4px rgba(49, 57, 44, .12);
}
.model-note { margin-top: 2px; }
.model-note strong { color: var(--text); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-weight: 500; }
.key-status {
  min-height: 44px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 0 12px; margin-bottom: 4px; color: var(--success); border: 1px solid #bfd0c0;
  border-radius: 6px; background: #edf5ed; font-size: 13px;
}
.key-status code { color: var(--muted); }
.text-button { width: max-content; border: 0; padding: 3px 0; background: transparent; font-size: 12px; cursor: pointer; }
.danger-text { color: var(--danger); }
.two-columns { grid-template-columns: repeat(2, 1fr); }
.two-columns label { display: grid; gap: 8px; }
.input-with-suffix { position: relative; }
.input-with-suffix .text-input { padding-right: 42px; }
.input-with-suffix > span {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  color: var(--muted); font-size: 13px;
}
.inline-link {
  width: max-content; display: inline-flex; align-items: center; gap: 5px;
  color: var(--accent-hover); font-size: 12px; text-decoration: none;
}
.inline-link:hover { color: var(--accent); }
.inline-link svg { width: 14px; height: 14px; }
.toggle-row {
  min-height: 58px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px;
  cursor: pointer;
}
.toggle-row > span { display: grid; gap: 4px; }
.toggle-row strong { color: var(--text); font-size: 13px; }
.toggle-row small { color: var(--muted); font-size: 12px; font-weight: 400; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row > i {
  position: relative; width: 42px; height: 24px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface-raised); transition: background .15s ease;
}
.toggle-row > i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--muted); transition: transform .15s ease, background .15s ease;
}
.toggle-row input:checked + i { border-color: var(--accent); background: var(--accent-soft); }
.toggle-row input:checked + i::after { background: var(--accent); transform: translateX(18px); }
.toggle-row input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 3px; }
.mobile-account-action { display: none; }

.source-list-heading { padding: 36px 0 14px; }
.source-list-heading h2 { margin: 0 0 7px; font-size: 18px; }
.source-list-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.source-list { border-top: 1px solid var(--border); }
.source-row {
  min-height: 92px; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, .7fr) minmax(150px, auto);
  align-items: center; gap: 28px; border-bottom: 1px solid var(--border);
}
.source-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.source-icon {
  width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid #bdc7b5; border-radius: 7px; background: var(--accent-soft);
  color: var(--accent); font-size: 14px; font-weight: 800;
}
.source-identity h2 { margin: 0 0 4px; font-size: 15px; }
.source-identity a {
  display: inline-flex; align-items: center; gap: 4px; color: var(--muted);
  font-size: 12px; text-decoration: none;
}
.source-identity a:hover { color: var(--text); }
.source-identity a svg { width: 13px; height: 13px; }
.source-meta { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.source-health { display: flex; align-items: center; gap: 8px; color: var(--success); font-size: 12px; }
.source-health svg { width: 16px; height: 16px; }
.source-health.has-error { color: var(--danger); }
.source-select { min-height: 40px; }
.source-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.source-row-actions .source-select { width: 150px; }
.source-dialog > form { padding: 24px; }
.source-dialog-fields { display: grid; gap: 14px; margin-bottom: 20px; }
.source-dialog-fields > .field-label { display: grid; gap: 8px; }
.compact-toggle { border-block: 1px solid var(--border); padding-block: 5px; }
.dialog-copy { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.account-dialog .dialog-copy + .danger-button { width: 100%; }
.sticky-actions { padding-top: 20px; }

.library-list { display: grid; border-top: 1px solid var(--border); }
.library-item { padding: 24px 0; border-bottom: 1px solid var(--border); }
.library-item h2 { margin: 10px 0 8px; font-size: 20px; line-height: 1.35; }
.library-item h2 a { text-decoration: none; }
.library-item h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.library-item > p {
  max-width: 680px; margin: 0; color: #4f594d; font-size: 15px; line-height: 1.68;
  display: -webkit-box; overflow: hidden; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
}
.library-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 14px; }
.library-footer .tags { margin-top: 0; }
.library-actions { display: flex; flex: 0 0 auto; }
.library-actions form { display: contents; }
.history-status {
  margin-left: auto; padding: 3px 7px; border-radius: 4px;
  color: var(--success); background: #e7f0e7; font-size: 10px; font-weight: 700;
}
.history-status.negative-status { color: var(--danger); background: #faece9; }

.usage-overview {
  display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--border);
}
.usage-overview > div { padding: 24px 0; border-right: 1px solid var(--border); }
.usage-overview > div:not(:first-child) { padding-left: 26px; }
.usage-overview > div:last-child { border-right: 0; }
.usage-overview span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.usage-overview strong { font-size: 24px; letter-spacing: 0; }
.budget-section, .usage-section { padding: 28px 0; border-bottom: 1px solid var(--border); }
.budget-section .section-heading { margin-bottom: 14px; }
.section-heading > div h2 { margin-bottom: 4px; }
.section-heading > div p { margin: 0; color: var(--muted); font-size: 12px; }
.budget-track { height: 7px; overflow: hidden; border-radius: 4px; background: var(--surface-raised); }
.budget-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.usage-warning {
  display: flex; align-items: center; gap: 7px; margin: 13px 0 0;
  color: var(--danger); font-size: 12px;
}
.usage-warning svg { width: 15px; height: 15px; }
.usage-rows { display: grid; }
.usage-row {
  min-height: 56px; display: grid; grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(100px, .7fr));
  align-items: center; gap: 18px; border-top: 1px solid var(--border); font-size: 12px;
}
.usage-row > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.usage-row > div svg { width: 16px; height: 16px; color: var(--accent); }
.usage-row > div strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-row > span { color: var(--muted); }
.usage-row > strong { text-align: right; }
.muted-row { margin: 0; padding: 20px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.cost-disclaimer { color: var(--muted); font-size: 11px; line-height: 1.5; }

.discover-header { align-items: center; }
.level-link {
  max-width: 190px; display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); text-decoration: none; font-size: 12px; line-height: 1.35;
}
.level-link:hover { color: var(--text); }
.level-link svg { color: var(--water); }
.discover-list { display: grid; gap: 12px; }
.discovery-reason {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px;
  margin-top: 19px; padding: 13px 0; border-block: 1px solid var(--border);
  color: var(--muted); font-size: 12px;
}
.discovery-reason svg { width: 16px; height: 16px; color: var(--water); }
.discovery-reason strong { color: var(--water); }
.discovery-actions { display: flex; align-items: center; gap: 8px; padding-top: 14px; }
.discovery-actions form:nth-child(3) { margin-left: auto; }
.discovery-actions .button { min-height: 40px; padding-inline: 13px; font-size: 12px; }
.settings-links-section { padding: 36px 0 0; }
.settings-links { border-top: 1px solid var(--border); }
.settings-links a, .settings-links button {
  width: 100%;
  min-height: 52px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px;
  padding: 0; border: 0; border-bottom: 1px solid var(--border); color: var(--text);
  background: transparent; text-align: left; text-decoration: none; font-size: 13px; cursor: pointer;
}
.settings-links a:hover, .settings-links button:hover { color: var(--text); }
.settings-links :is(a, button) > svg:first-child { width: 17px; height: 17px; color: var(--muted); }
.settings-links :is(a, button) > svg:last-child { width: 15px; height: 15px; color: var(--muted); }
.following-header { align-items: center; }
.following-list { display: grid; }
.following-story { padding: 28px 0; border-bottom: 1px solid var(--border); }
.following-story:first-child { padding-top: 4px; }
.story-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.story-heading h2 { margin: 8px 0 8px; font-size: 21px; line-height: 1.35; }
.story-heading a {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted); text-decoration: none; font-size: 12px;
}
.story-heading a:hover { color: var(--text); }
.story-heading a svg { width: 14px; height: 14px; }
.story-state { display: flex; align-items: center; gap: 7px; color: var(--water); font-size: 11px; }
.story-state svg { width: 15px; height: 15px; }
.awaiting-update {
  display: flex; align-items: center; gap: 9px; margin-top: 20px; padding: 15px 0;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 13px;
}
.awaiting-update svg { width: 16px; height: 16px; }
.story-updates { margin-top: 22px; border-top: 1px solid var(--border); }
.follow-update { padding: 20px 0; border-bottom: 1px solid var(--border); }
.follow-update:last-child { border-bottom: 0; padding-bottom: 0; }
.follow-update h3 { margin: 8px 0 7px; font-size: 17px; line-height: 1.4; }
.follow-update h3 a { color: var(--text); text-decoration: none; }
.follow-update h3 a:hover { text-decoration: underline; text-decoration-color: var(--water); text-underline-offset: 4px; }
.follow-update > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.new-update-label {
  padding: 3px 6px; border-radius: 4px; color: var(--water);
  background: var(--water-soft); font-size: 10px; font-weight: 750;
}
.x-trending { margin-top: 42px; padding-top: 30px; border-top: 1px solid var(--border); }
.x-trending-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px;
}
.x-trending-heading .eyebrow { margin-bottom: 7px; color: var(--water); }
.x-trending-heading h2 { margin: 0; font-size: 23px; }
.x-trending-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.x-trending-empty {
  min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border-block: 1px solid var(--border); color: var(--muted); font-size: 13px;
}
.x-trending-empty a {
  display: inline-flex; align-items: center; gap: 5px; color: var(--water);
  text-decoration: none; white-space: nowrap;
}
.x-trending-empty a svg { width: 14px; height: 14px; }
.x-trend-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px; margin: 0; padding: 0; border-top: 1px solid var(--border); list-style: none;
}
.x-trend-list li {
  min-height: 88px; display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.x-trend-list li > span { color: var(--water); font-size: 11px; }
.x-trend-list li > div { min-width: 0; display: grid; gap: 5px; }
.x-trend-list li > div > a { min-width: 0; text-decoration: none; }
.x-trend-list li strong { overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.x-trend-list li small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.x-trend-list li > svg { width: 14px; height: 14px; color: var(--muted); }
.x-trend-list li:hover strong { color: var(--water); }
.trend-source {
  width: max-content; max-width: 100%; display: inline-flex; align-items: center; gap: 4px;
  overflow: hidden; color: var(--water); font-size: 10px; text-overflow: ellipsis; white-space: nowrap;
}
.trend-source svg { width: 12px; height: 12px; }
.offline-page { display: grid; min-height: 100vh; place-items: center; padding: 28px; }
.offline-shell { width: min(440px, 100%); }
.offline-shell .auth-brand { margin-bottom: 72px; }
.offline-shell h1 { margin-bottom: 12px; }
.offline-shell p:not(.eyebrow) { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.offline-symbol {
  width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 24px;
  border: 1px solid var(--border); border-radius: 50%; color: var(--muted); font-size: 25px;
}
.account-sections { display: grid; }
.account-section {
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(300px, 1.35fr); gap: 48px;
  padding: 30px 0; border-bottom: 1px solid var(--border);
}
.account-action { display: flex; justify-content: flex-end; padding-top: 5px; }
.recovery-code-form { display: grid; gap: 9px; }
.recovery-code-panel {
  margin-bottom: 12px; padding: 14px; border: 1px solid #bfd0c0;
  border-radius: 6px; background: #edf5ed;
}
.recovery-code-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.recovery-code-heading strong { font-size: 13px; }
.recovery-code-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px;
  margin: 12px 0;
}
.recovery-code-grid code { color: var(--text); font-size: 11px; overflow-wrap: anywhere; }
.recovery-code-panel p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.danger-zone .settings-copy h2 { color: var(--danger); }
.danger-button { color: #ffffff; background: var(--danger); border-color: transparent; }
.danger-button:hover { background: #8c3e36; }
.danger-zone .danger-button { width: max-content; justify-self: end; }
.account-dialog > form { padding: 24px; }
.account-dialog .delete-fields { display: grid; gap: 9px; margin-bottom: 20px; }
.account-dialog .danger-button { width: 100%; }

@media (max-width: 980px) {
  .nav-dock { display: none; }
  .has-navigation .app-shell { margin: 0 auto; }
  .bottom-nav {
    position: fixed; z-index: 20; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 7px 16px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border); background: rgba(255, 254, 249, .96);
    backdrop-filter: blur(18px);
  }
  .bottom-nav a, .bottom-nav button {
    min-height: 48px; border: 0; background: transparent; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; text-decoration: none; font-size: 10px; cursor: pointer;
  }
  .bottom-nav a.active { color: var(--accent); }
  .bottom-nav form { display: contents; }
  .bottom-nav svg { width: 20px; height: 20px; }
  .mobile-account-action { display: block; padding: 28px 0 0; }
}

@media (max-width: 620px) {
  .app-shell { width: calc(100% - 36px); padding: 36px 0 104px; }
  .brief-header, .page-header { align-items: flex-start; gap: 22px; }
  .brief-header { display: grid; }
  .brief-header form, .brief-header .button { width: 100%; }
  h1 { font-size: 34px; }
  .news-card, .lead-card { padding: 28px 0; }
  .news-card h2, .lead-card h2 { font-size: 22px; }
  .summary { font-size: 15px; line-height: 1.7; }
  .card-actions { align-items: flex-end; }
  .read-link { width: 38px; height: 38px; font-size: 0; justify-content: center; }
  .read-link svg { width: 19px; height: 19px; }
  .form-actions, .form-actions .button { width: 100%; }
  .auth-brand { margin-bottom: 48px; }
  .settings-section { grid-template-columns: 1fr; gap: 18px; }
  .account-section { grid-template-columns: 1fr; gap: 18px; }
  .account-action, .account-action .button { width: 100%; }
  .danger-zone .danger-button { width: 100%; justify-self: stretch; }
  .two-columns { grid-template-columns: 1fr; }
  .source-row { grid-template-columns: 1fr auto; gap: 12px; padding: 16px 0; }
  .source-health { grid-column: 1 / -1; grid-row: 2; }
  .source-row-actions { grid-column: 2; grid-row: 1; }
  .source-row-actions .source-select { width: 126px; }
  .page-header-actions .button { width: 44px; padding: 0; font-size: 0; }
  .library-item h2 { font-size: 18px; }
  .library-item > p { -webkit-line-clamp: 3; }
  .discovery-options { grid-template-columns: 1fr; }
  .discovery-options span { min-height: 46px; }
  .discover-header { align-items: flex-start; }
  .level-link { padding-top: 3px; }
  .discovery-actions { flex-wrap: wrap; }
  .discovery-actions form:first-child, .discovery-actions form:nth-child(2) { flex: 1 1 calc(50% - 5px); }
  .discovery-actions form:first-child .button, .discovery-actions form:nth-child(2) .button { width: 100%; }
  .usage-overview { grid-template-columns: 1fr; }
  .usage-overview > div, .usage-overview > div:not(:first-child) { padding: 16px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .usage-overview > div:last-child { border-bottom: 0; }
  .usage-row { grid-template-columns: 1fr auto; gap: 6px 16px; padding: 12px 0; }
  .usage-row > span { grid-column: 1; }
  .usage-row > strong { grid-column: 2; grid-row: 1; }
  .usage-row > span + span { display: none; }
  .following-header { align-items: flex-start; }
}

@media (max-width: 420px) {
  .discovery-actions form:first-child, .discovery-actions form:nth-child(2) { flex-basis: 100%; }
  .discovery-actions form:nth-child(3) { margin-left: 0; }
  .discovery-reason { grid-template-columns: auto 1fr; }
  .discovery-reason strong { grid-column: 2; }
  .x-trend-list { grid-template-columns: 1fr; }
  .x-trending-empty { align-items: flex-start; flex-direction: column; padding: 16px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
