/* Civic tokens mirror lucent_flutter/lib/app/civic_theme.dart. */
:root {
  font-family: 'Libre Baskerville', Georgia, serif;
  color: #1f2a38;
  background: #fcfbf8;
  color-scheme: light;
  scroll-behavior: smooth;
  --background: #fcfbf8;
  --foreground: #1f2a38;
  --card: #fff;
  --primary: #b85c6b;
  --primary-foreground: #fff;
  --secondary: #e4eef7;
  --secondary-foreground: #223e59;
  --muted-surface: #eaf2f8;
  --muted-foreground: #5d6977;
  --destructive: #a84657;
  --border: #d6e0ea;
  --ring: #b85c6b;
  --content-width: 800px;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; background: var(--background); color: var(--foreground); line-height: 1.5; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--primary); }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card); color: var(--foreground);
  font-size: .88rem; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
button:hover, .button:hover { background: var(--muted-surface); border-color: var(--primary); }
button:disabled { opacity: .55; cursor: not-allowed; }
.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button.primary:hover { background: var(--destructive); border-color: var(--destructive); color: #fff; }
button:focus-visible, .button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--ring); outline-offset: 3px;
}
input, select, textarea {
  min-height: 40px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: #fff; color: var(--foreground);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ring); outline-offset: 1px; }

/* Shared public and reader shell. */
.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-header {
  position: relative; z-index: 30; width: 100%; min-height: 70px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0 18px;
  padding: 10px max(24px, calc((100vw - 1120px) / 2)) 4px;
  background: var(--background);
}
.brand { grid-column: 1 / -1; justify-self: center; font-size: clamp(1.55rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.035em; text-decoration: none; white-space: nowrap; }
.header-back { position: absolute; top: 12px; left: max(24px, calc((100vw - 1120px) / 2)); font-size: 1.5rem; line-height: 1; padding: 5px; text-decoration: none; }
.primary-nav { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; justify-content: center; gap: 20px; }
.primary-nav a { padding: 8px 3px; font-size: .88rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.primary-nav a.active, .primary-nav a:hover { color: var(--primary); }
.account-link { font-size: .84rem; font-weight: 700; text-decoration: none; border: 0; background: transparent; }
.header-auth, .account-menu { position: absolute; top: 12px; right: max(76px, calc((100vw - 1120px) / 2 + 52px)); font-size: .84rem; }
.account-menu summary { padding: 8px; cursor: pointer; font-weight: 700; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu-content { position: absolute; z-index: 41; top: 38px; right: 0; display: flex; flex-direction: column; gap: 10px; width: min(300px, 85vw); padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 24px #1f2a3825; }
.account-menu-content span { color: var(--muted-foreground); }
.account-menu-content a { text-decoration: none; }
.account-usage-track { height: 8px; overflow: hidden; border-radius: 99px; background: var(--muted-surface); }
.account-usage-fill { height: 100%; border-radius: inherit; background: var(--primary); }
.header-open-app { position: absolute; top: 12px; right: max(24px, calc((100vw - 1120px) / 2)); }
.nav-drawer { position: absolute; top: 12px; right: max(24px, calc((100vw - 1120px) / 2)); }
.nav-drawer summary { list-style: none; padding: 6px 10px; border-radius: 6px; font-size: 1.2rem; cursor: pointer; }
.nav-drawer summary::-webkit-details-marker { display: none; }
.nav-drawer nav {
  position: absolute; z-index: 40; top: 42px; right: 0; display: flex;
  flex-direction: column; width: 260px; max-height: min(70vh, 620px); overflow-y: auto;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; box-shadow: 0 8px 24px #1f2a3825;
}
.nav-drawer nav a { padding: 9px 12px; font-size: .84rem; text-decoration: none; }
.nav-drawer nav a.active { color: var(--primary); border-left: 3px solid var(--primary); }
.nav-drawer nav a:hover { background: var(--secondary); }
.drawer-heading { display: block; padding: 14px 12px 5px; font-size: .72rem; font-weight: 700; color: var(--muted-foreground); text-transform: uppercase; }
.story-drawer-categories, .story-drawer-search { display: none; }
.header-subnav {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 4px 18px; padding: 5px 24px 12px; font-size: .82rem;
}
.header-subnav a { text-decoration: none; }
.header-subnav a.active, .header-subnav a:hover { color: var(--primary); }
.story-category-links { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 8px; min-width: 0; }
.story-category-links a { flex: 0 0 auto; white-space: nowrap; }
.story-search-link { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; }
.story-header-search { display: none; align-items: center; gap: 10px; width: min(100%, 720px); }
.story-header-search input[type=search] { flex: 1; min-width: 0; }
.story-search-close { font-family: Arial, sans-serif; font-size: 1.5rem; line-height: 1; }
.story-categories:target .story-category-links, .story-categories.search-active .story-category-links { display: none; }
.story-categories:target .story-header-search, .story-categories.search-active .story-header-search { display: flex; }
.main-content { flex: 1; width: min(100%, 1120px); margin: 0 auto; padding: 24px 24px 80px; }
.main-content:has(.landing-home) { width: 100%; max-width: none; padding: 0 24px 72px; }
.site-footer {
  display: flex; align-items: flex-start; gap: 24px; padding: 28px max(24px, calc((100vw - 1120px) / 2));
  border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: .75rem; line-height: 1.5;
}
.site-footer span { max-width: 720px; margin-right: auto; }
.site-footer a { white-space: nowrap; }

/* Editorial lists, stories, sources, and reader controls. */
.feed, .story-article, .editorial { width: min(100%, var(--content-width)); margin: 0 auto; }
.feed h1, .story-article h1, .editorial h1, .private-workspace h1 {
  margin: 18px 0 22px; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.18; letter-spacing: -.04em;
}
.feed form { display: flex; gap: 8px; margin: 20px 0 26px; }
.feed input { flex: 1; min-width: 0; }
.feed .explore-filter-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 12px 16px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.explore-filter-form label { font-size: .82rem; font-weight: 700; color: var(--secondary-foreground); }
.explore-filter-form input, .explore-filter-form select { width: 100%; min-width: 0; }
.explore-filter-form select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23223e59' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.explore-filter-actions { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.explore-filter-actions a { color: var(--secondary-foreground); font-size: .84rem; }
.explore-active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: -8px 0 20px; color: var(--muted-foreground); font-size: .82rem; }
.active-filter { padding: 3px 8px; border: 1px solid var(--border); border-radius: 99px; background: var(--muted-surface); color: var(--secondary-foreground); }
.explore-result { padding: 22px 0 24px; }
.explore-result h2 { margin: 5px 0 12px; }
.result-eyebrow { margin: 0; color: var(--secondary-foreground); font-size: .75rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.result-metadata { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; color: var(--muted-foreground); font-size: .82rem; }
.result-metadata a { color: var(--secondary-foreground); font-weight: 700; }
.stage-badge { padding: 4px 9px; border-radius: 99px; background: var(--secondary); color: var(--secondary-foreground); font-weight: 700; }
.feed-row { border-top: 1px solid #000; padding: 20px 0; }
.story-feed h1 { margin: 2px 0 28px; }
.story-feed .feed-row { padding: 25px 0 27px; }
.story-feed .feed-row h2 { margin-bottom: 12px; }
.story-feed .feed-row p:last-of-type { margin-bottom: 0; }
.feed-row h2 { margin: 0 0 10px; font-size: clamp(1.25rem, 2.4vw, 1.65rem); line-height: 1.3; }
.feed-row a { text-decoration: none; }
.feed-row a:hover { color: var(--primary); }
.feed-row p { margin: 0 0 8px; line-height: 1.55; color: var(--foreground); }
.feed-row small, .byline { color: var(--muted-foreground); }
.story-kicker, .recent { margin: 0 0 10px !important; font-size: .72rem !important; font-weight: 700; letter-spacing: .09em; }
.story-kicker { color: var(--foreground) !important; }
.recent { color: var(--primary) !important; }
.reader-controls { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin: 22px 0 28px; padding: 18px 0; border-block: 1px solid var(--border); }
.reader-level-control { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reader-level-control select { min-width: 155px; }
.reader-controls form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; }
.story-article .reader-controls .reader-controls { margin: 0; padding: 0; border: 0; }
.prose { font-size: 1.05rem; line-height: 1.75; }
.prose p, .editorial p { line-height: 1.8; }
.prose h2, .editorial h2 { margin-top: 34px; font-size: 1.8rem; }
.story-article #story-body { display: flow-root; }
.story-article #story-body > * { margin-block: 0; }
.story-article #story-body > * + * { margin-block-start: 1.75rem; }
.story-article #story-body > :is(h1, h2, h3, h4, hr) { margin-block-start: 2.25rem; }
.story-article #story-body > :is(h1, h2, h3, h4):first-child { margin-block-start: 0; }
.prose blockquote { margin-left: 0; padding-left: 18px; border-left: 3px solid var(--primary); color: var(--muted-foreground); }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--destructive); }
.editorial { padding: 32px 0 80px; }
.source-detail > h2 { padding-top: 22px; border-top: 1px solid #000; }
.source-header { padding-bottom: 14px; border-bottom: 1px solid #000; }
.source-header h1 { margin: 10px 0 12px; overflow-wrap: anywhere; }
.source-back { display: inline-block; margin-bottom: 18px; color: var(--secondary-foreground); font-size: .83rem; font-weight: 700; text-decoration: none; }
.source-detail > h2 { margin: 34px 0 16px; padding-top: 22px; font-size: clamp(1.5rem, 3vw, 1.9rem); }
.source-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; margin: 20px 0 16px; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.source-fact { min-width: 0; overflow-wrap: anywhere; }
.source-fact dt { margin-bottom: 6px; color: var(--muted-foreground); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.source-fact dd { margin: 0; font-size: .9rem; line-height: 1.55; }
.source-fact a, .source-context a { color: var(--secondary-foreground); font-weight: 700; }
.source-actions { margin: 16px 0 22px; }
.source-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 24px 0 0; padding: 0 0 1px; border-bottom: 1px solid #000; scrollbar-width: thin; }
.source-tabs a { flex: 0 0 auto; padding: 11px 15px; color: var(--muted-foreground); font-size: .88rem; font-weight: 700; text-decoration: none; border-bottom: 3px solid transparent; }
.source-tabs a:hover, .source-tabs a:focus-visible { color: var(--foreground); background: var(--muted-surface); }
.source-tabs a.active { color: var(--foreground); border-bottom-color: var(--primary); }
.source-tab-panel { padding: 20px 0 36px; min-height: 190px; }
.source-tab-panel > h2 { margin: 10px 0 20px; font-size: clamp(1.45rem, 3vw, 1.85rem); }
.source-preview-list .feed-row:first-child { border-top: 0; }
.member-preview h3 { margin: 0 0 8px; font-size: 1.25rem; }
.source-context { color: var(--muted-foreground); font-size: .84rem; }
.source-subjects { display: flex; flex-wrap: wrap; gap: 8px; }
.source-subjects .subject-follow { margin: 0; padding: 6px 10px; border-radius: 8px; background: var(--muted-surface); }
.source-link-list { columns: 2; column-gap: 24px; }
.source-link-list p { break-inside: avoid; margin: 0 0 12px; }
.source-timeline { margin: 0 0 20px; padding-left: 22px; }
.source-timeline li { padding: 0 0 18px 8px; line-height: 1.65; }
.source-date { display: block; color: var(--muted-foreground); font-size: .78rem; font-weight: 700; }
.record-entry { scroll-margin-top: 24px; }
.record-entry h2, .record-entry h3 { margin: 4px 0 10px; font-size: 1.2rem; }
.source-detail details { padding: 12px 0; border-top: 1px solid var(--border); }
.source-detail details summary { cursor: pointer; font-weight: 700; }
.source-detail details p { margin: 8px 0; line-height: 1.55; }
.source-detail > p { overflow-wrap: anywhere; }
.source-detail .feed-row { width: 100%; }
.source-detail .feed-row p { line-height: 1.7; }
.grant-note { padding-left: 18px; border-left: 3px solid var(--primary); color: var(--muted-foreground); }
.subject-follow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.subject-picker { position: relative; min-width: 0; }
.subject-picker label { width: 100%; }
.subject-picker input[type=search] { min-width: 0; }
.selected-subject { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 7px 4px 10px; border-radius: 99px; background: var(--secondary); color: var(--secondary-foreground); font-size: .82rem; overflow-wrap: anywhere; }
.selected-subject button { min-height: 28px; padding: 2px 6px; border: 0; background: transparent; }
.subject-suggestions { position: absolute; z-index: 5; top: 100%; left: 0; width: min(100%, 420px); max-height: 280px; overflow: auto; background: #fff; border: 1px solid var(--border); box-shadow: 0 8px 20px #0002; }
.subject-suggestion { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 0; text-align: left; }
.subject-suggestion[aria-selected=true] { background: var(--secondary); }
.citation-control { position: relative; display: inline-block; margin: 0 .12em; }
.citation-control > button { display: inline; min-height: 0; padding: 0; border: 0; border-bottom: 1px solid currentColor; border-radius: 0; background: transparent; color: #245b90; font-weight: 700; text-decoration: none; }
.citation-control > button:hover { background: transparent; color: var(--primary); }
.citation-popover { position: absolute; z-index: 30; top: 1.7em; left: 0; display: flex; flex-direction: column; gap: 9px; width: min(360px, 80vw); padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 24px #1f2a3826; font-size: .85rem; line-height: 1.45; }
.citation-popover a { color: var(--primary); }

/* Private workspaces and chat. */
.private-workspace { display: flex; flex-direction: column; gap: 14px; width: min(100%, var(--content-width)); margin: 0 auto; }
.private-workspace > h1 { margin-bottom: 6px; }
.private-workspace > h2 { margin: 24px 0 0; font-size: 1.35rem; }
.private-workspace > .feed-row { width: 100%; }
.private-workspace input, .private-workspace textarea { width: 100%; }
.private-workspace textarea { min-height: 100px; resize: vertical; }
.private-workspace > button { align-self: flex-start; }
.private-workspace [role=alert] { color: var(--destructive); }
.private-workspace:has(.conversation-list) { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 0 24px; width: min(100%, 1120px); min-height: calc(100vh - 220px); align-content: start; }
.conversation-list { grid-column: 1; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 4px; min-width: 0; max-height: calc(100vh - 200px); padding: 12px 8px 16px 0; overflow: auto; }
.conversation-list h2 { margin: 4px 0 12px; font-size: 1.2rem; }
.conversation-list > button:not(.chat-sidebar-close) { margin-bottom: 10px; }
.conversation-item { display: flex; align-items: center; gap: 4px; min-width: 0; }
.conversation-item button { padding: 7px 8px; border: 0; background: transparent; font-size: .75rem; }
.conversation-item button:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; justify-content: flex-start; }
.conversation-item button:not(:first-child) { font-size: .67rem; }
.chat-main { grid-column: 2; display: flex; flex-direction: column; min-width: 0; min-height: 60vh; max-height: calc(100vh - 200px); }
.chat-transcript { display: flex; flex: 1; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
.chat-user, .chat-assistant { max-width: 100%; padding: 12px 16px; border-radius: var(--radius); line-height: 1.6; }
.chat-user { align-self: flex-end; max-width: 85%; background: var(--secondary); }
.chat-assistant { align-self: stretch; background: transparent; }
.chat-composer { display: flex; align-items: flex-end; gap: 10px; width: 100%; padding: 8px 10px 8px 14px; border: 1px solid var(--border); border-radius: 18px; background: #fff; }
.chat-composer textarea { flex: 1; min-width: 0; min-height: 42px; max-height: 150px; padding: 10px 0; border: 0; outline: none; resize: vertical; background: transparent; }
.chat-composer textarea:focus { outline: none; }
.chat-composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.chat-composer-actions label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chat-composer-actions select { max-width: 150px; border: 0; background: transparent; font-size: .82rem; }
.chat-send { width: 38px; min-width: 38px; height: 38px; min-height: 38px; padding: 0; border: 0; border-radius: 10px; background: var(--primary); color: #fff; font-family: Arial, sans-serif; font-size: 1.35rem; }
.chat-send:hover { background: var(--destructive); color: #fff; }
.chat-guest { margin: auto 0; padding: 60px 14px; text-align: center; }
.chat-guest h1 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
.chat-error { padding: 12px 16px; border: 1px solid var(--destructive); border-radius: var(--radius); background: #fff6f5; color: var(--destructive); }
.chat-sidebar-toggle, .chat-sidebar-scrim, .chat-sidebar-close { display: none; }
.auth-card, .auth-dialog { display: flex; flex-direction: column; gap: 10px; width: min(440px, 100%); padding: 28px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 30px #1f2a3824; }
.auth-card { margin: 24px auto; }
.auth-backdrop { position: fixed; z-index: 80; inset: 0; width: 100vw; height: 100vh; padding: 0; border: 0; border-radius: 0; background: transparent; }
.auth-backdrop:hover, .auth-backdrop:active, .auth-backdrop:focus-visible { background: transparent; border: 0; outline: none; }
.auth-dialog { position: fixed; z-index: 81; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.auth-dialog h2 { margin: 0 0 6px; font-size: 1.45rem; text-align: center; }
.auth-dialog label { font-size: .84rem; font-weight: 700; }
.auth-dialog .auth-submit { background: var(--primary); color: #fff; border-color: var(--primary); }
.auth-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.auth-links button, .auth-text-button { border: 0; background: transparent; color: var(--primary); font-size: .8rem; }

/* Annotations and document readers. */
.story-annotations { margin-top: 32px; }
.annotation-backdrop { position: fixed; z-index: 39; inset: 0; display: block; width: 100vw; height: 100vh; padding: 0; border: 0; border-radius: 0; background: transparent; }
button.annotation-backdrop:is(:hover, :active, :focus-visible) { background: transparent; border: 0; outline: none; }
.annotation-toolbar { position: fixed; z-index: 40; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: min(420px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 28px #0003; }
.annotation-toolbar label, .annotation-toolbar input, .annotation-toolbar textarea { width: 100%; }
.annotation-toolbar button { padding: 7px 10px; }
.annotation-card { padding: 16px 0; border-top: 1px solid var(--border); }
.annotation-card blockquote { margin: 0 0 12px; padding-left: 12px; border-left: 3px solid #e4b850; }
.annotation-card button { margin-right: 8px; }
::highlight(lucent-story-annotations) { background: #ffeb3b61; }
.bill-text-panel { padding: 20px 0 48px; }
.bill-text-panel > label { display: block; margin: 14px 0 6px; }
.bill-text-panel select { max-width: 100%; }
.bill-text-panel > a { display: inline-block; margin: 14px 0; color: var(--primary); }
.bill-structured-text { max-width: 76ch; font-family: Georgia, serif; font-size: 1.04rem; line-height: 1.8; }
.bill-xml-node { margin: 8px 0; line-height: 1.75; }
.bill-xml-content { min-width: 0; }
.bill-xml-inline { display: flex; gap: 12px; align-items: flex-start; }
.bill-enum { min-width: 2.5em; font-weight: 600; }
.bill-section-heading { display: flex; align-items: baseline; gap: 12px; margin: 28px 0 10px; }
.bill-section-heading h3, .bill-section-heading h4 { margin: 0; font-family: Georgia, serif; line-height: 1.4; }
.bill-section-heading h3 { font-size: 1.27rem; }
.bill-section-heading h4 { font-size: 1.12rem; }
.bill-section-heading button { flex: none; padding: 3px 8px; background: transparent; border: 1px solid var(--border); border-radius: 6px; }
.bill-text-line { margin: 4px 0; white-space: pre-wrap; }
.bill-plain-text { max-width: 78ch; padding: 20px; white-space: pre-wrap; line-height: 1.75; overflow-wrap: anywhere; font-family: Georgia, serif; font-size: 1rem; background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.bill-xml-container { margin-left: 0; }
.bill-legis-type { font-size: 1.25rem; font-weight: 700; }
.bill-official-title { font-style: italic; }
.cited-record-item { padding-left: 16px; border-left: 4px solid #d6a12b; background: #fff5d8; scroll-margin-top: 24px; }
.record-sections { padding: 18px 0 44px; }
.record-sections > h2 { margin: 28px 0 12px; }
.record-part { border-bottom: 1px solid var(--border); scroll-margin-top: 24px; }
.record-part-header { display: flex; align-items: center; }
.record-part-header > a { flex: none; padding: 8px; color: var(--primary); }
.record-part-toggle { display: flex; width: 100%; align-items: center; gap: 12px; padding: 15px 4px; background: transparent; color: inherit; text-align: left; border: 0; font-weight: 600; }
.record-part-chevron { width: 18px; font-size: 1.35rem; color: var(--primary); }
.record-part-content, .record-part-selected { padding: 12px 8px 24px 28px; }
.record-page-controls { display: flex; gap: 16px; margin-top: 18px; }

/* Astro content in the Jaspr public host. */
.landing-home { max-width: 1120px; margin: 0 auto; }
.landing-home .hero { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: center; gap: clamp(28px, 5vw, 70px); padding: clamp(56px, 8vw, 110px) 0; }
.hero-copy-block h1 { margin: 0 0 24px; font-size: clamp(2.7rem, 5vw, 5.2rem); line-height: 1.08; letter-spacing: -.055em; }
.landing-home .landing-accent { color: var(--primary); font-style: normal; }
.hero-copy-block p { max-width: 550px; font-size: clamp(1.05rem, 1.7vw, 1.2rem); line-height: 1.7; }
.hero-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 26px; }
.hero-actions .button, .final-cta .button { min-height: 46px; padding: 12px 22px; }
.text-link { font-size: .9rem; font-weight: 700; }
.hero-product, .showcase-step img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 18px 45px #1f2a3824; }
.showcase { display: grid; max-width: 1000px; margin: 0 auto 90px; }
.showcase-step { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); align-items: center; gap: 38px; padding: 48px 0; border-top: 1px solid #000; }
.showcase-step h2 { margin: 0 0 15px; font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.25; }
.showcase-step p { line-height: 1.7; }
.final-cta { margin-bottom: 40px; padding: clamp(40px, 6vw, 75px) 24px; border-radius: 16px; background: var(--secondary); text-align: center; }
.final-cta h2 { max-width: 750px; margin: 0 auto 18px; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.16; }
.final-cta p { max-width: 610px; margin: 0 auto 25px; line-height: 1.7; }
.analytics-consent { position: fixed; z-index: 80; inset: auto 16px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 5px 24px #0002; font-size: .9rem; }
.analytics-consent[hidden] { display: none; }

@media (max-width: 850px) {
  .landing-home .hero, .showcase-step { grid-template-columns: 1fr; }
  .landing-home .hero, .showcase-step { max-width: 680px; margin-inline: auto; }
  .showcase-step { gap: 20px; }
  .explore-destinations { display: none; }
}
@media (max-width: 650px) {
  .site-header { grid-template-columns: minmax(0, 1fr) auto auto; gap: 3px 8px; padding: 10px 7.5% 4px; }
  .brand { font-size: clamp(1.12rem, 5vw, 1.4rem); }
  .header-back { left: 7.5%; top: 10px; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; width: 100%; gap: clamp(18px, 5vw, 36px); }
  .primary-nav a { font-size: .82rem; }
  .header-open-app { top: 10px; right: 7.5%; padding: 7px 9px; font-size: .75rem; }
  .account-link { font-size: .75rem; }
  .header-auth, .account-menu { top: 10px; right: calc(7.5% + 48px); }
  .nav-drawer { top: 10px; right: 7.5%; }
  .chat-composer { flex-wrap: wrap; }
  .chat-composer textarea { flex-basis: 100%; }
  .chat-composer-actions { width: 100%; }
  .chat-composer-actions select { margin-right: auto; }
  .main-content { padding: 24px 7.5% 70px; }
  .main-content:has(.landing-home) { padding: 0 7.5% 56px; }
  .feed form { flex-wrap: wrap; margin: 14px 0 24px; }
  .explore-filter-form { grid-template-columns: 1fr !important; padding: 16px !important; }
  .explore-filter-form label { margin-top: 0; }
  .source-facts { grid-template-columns: 1fr; padding: 16px; }
  .source-link-list { columns: 1; }
  .feed h1, .story-article h1, .editorial h1, .private-workspace h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .reader-controls { align-items: flex-start; }
  .site-footer { gap: 14px; flex-wrap: wrap; padding: 24px 7.5%; }
  .site-footer span { width: 100%; }
  .private-workspace:has(.conversation-list) { display: flex; flex-direction: column; min-height: calc(100vh - 200px); gap: 10px; }
  .chat-main { min-height: 55vh; max-height: none; }
  .chat-transcript { min-height: 25vh; max-height: 55vh; }
  .chat-sidebar-toggle { display: inline-flex; align-self: flex-start; }
  .chat-sidebar-scrim { position: fixed; z-index: 69; inset: 0; display: block; width: 100vw; height: 100vh; padding: 0; border: 0; border-radius: 0; background: #1f2a3870; }
  .conversation-list { position: fixed; z-index: 70; inset: 0 auto 0 0; width: min(310px, 86vw); max-height: none; padding: 22px 16px 35px; overflow: auto; background: var(--background); box-shadow: 10px 0 30px #1f2a3833; transform: translateX(-110%); transition: transform .2s ease; }
  .conversation-list.is-open { transform: translateX(0); }
  .chat-sidebar-close { display: inline-flex; align-self: flex-end; }
  .landing-home .hero { padding: 60px 0; }
  .hero-copy-block h1 { font-size: clamp(2.45rem, 10vw, 3.5rem); }
  .showcase { margin-bottom: 48px; }
  .showcase-step { padding: 32px 0; }
  .final-cta { margin-bottom: 0; }
  .auth-dialog { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Shared civic finish: Shadcn controls within the editorial shell. */
:root {
  --radius: 10px;
  --shadow-soft: 0 4px 20px #1f2a3808;
  --shadow-popover: 0 12px 40px #1f2a381a, 0 2px 8px #1f2a3808;
}
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: #b85c6b30; }
button, .button, input, select, textarea { transition: background .16s, border-color .16s, box-shadow .16s, color .16s; }
button, .button { min-height: 42px; font-weight: 600; }
input, select, textarea { box-shadow: 0 1px 2px #1f2a3805; }
input::placeholder, textarea::placeholder { color: #77818d; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #acbac9; }
button:disabled:hover { border-color: var(--border); background: inherit; }
.civic-icon { flex: none; transition: transform .18s ease; }
.civic-icon.is-expanded { transform: rotate(180deg); }
.civic-icon-button { width: 42px; min-width: 42px; height: 42px; padding: 0; border: 0; background: transparent; }
.site-header { padding-top: 18px; row-gap: 6px; }
.brand { letter-spacing: -.045em; }
.primary-nav a { position: relative; padding: 10px 5px; }
.primary-nav a.active::after { content: ''; position: absolute; bottom: 2px; left: 25%; right: 25%; height: 2px; border-radius: 2px; background: var(--primary); }
.header-subnav { padding-top: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.header-subnav a { padding: 5px 8px; border-radius: 6px; }
.header-subnav a.active { background: var(--secondary); color: var(--secondary-foreground); }
.header-back { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; top: 16px; }
.header-back:hover { background: var(--secondary); }
.header-auth, .account-menu, .nav-drawer, .header-open-app { top: 18px; }
.account-menu-content, .nav-drawer nav, .citation-popover, .subject-suggestions { border-radius: 12px; box-shadow: var(--shadow-popover); }
.nav-drawer nav { padding: 8px; }
.nav-drawer nav a { border-radius: 6px; }
.main-content { padding-top: 36px; }
.feed-row { padding-block: 26px; }
.feed-row h2, .feed-row h3 { letter-spacing: -.025em; }
.feed-row p { color: #43505e; line-height: 1.75; }
.feed-row .result-eyebrow, .result-eyebrow { color: var(--secondary-foreground); }
.result-metadata { row-gap: 10px; line-height: 1.65; }
.stage-badge { font-size: .75rem; border: 1px solid #cadbea; }
.source-detail { padding-top: 12px; }
.source-header { padding-bottom: 24px; }
.source-header h1 { margin-top: 14px; line-height: 1.25; }
.source-facts { padding: 22px 24px; gap: 22px 28px; border-radius: 12px; box-shadow: var(--shadow-soft); }
.source-fact dt { font-size: .68rem; letter-spacing: .08em; }
.source-tabs { gap: 2px; }
.source-tabs a { border-radius: 7px 7px 0 0; padding-inline: 14px; }
.source-tab-panel { padding-top: 26px; }
.source-timeline { list-style: none; border-left: 1px solid var(--border); padding-left: 20px; margin-left: 5px; }
.source-timeline li { position: relative; padding-left: 8px; padding-bottom: 26px; }
.source-timeline li::before { content: ''; position: absolute; width: 7px; height: 7px; left: -24px; top: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--background); }
.source-date { margin-bottom: 6px; }
.feed .explore-filter-form { border-radius: 12px; box-shadow: var(--shadow-soft); margin: 0 0 16px; }
.explore-filter-field, .explore-filter-form .subject-picker { display: flex; flex-direction: column; align-items: stretch; gap: 5px; min-width: 0; }
.explore-filter-form > :not(label):not(.explore-filter-actions):not(.subject-picker) { min-width: 0; }
.explore-filter-form label { line-height: 1.5; }
.explore-filter-actions { padding-top: 10px; margin-top: 0; border-top: 1px solid var(--border); }
.explore-filter-actions button { background: var(--primary); color: white; border-color: var(--primary); }
.explore-filter-actions button:hover { background: var(--destructive); }
.subject-suggestions { right: 0; width: 100%; padding: 4px; }
.subject-suggestion { justify-content: flex-start; font-weight: 400; border-radius: 6px; line-height: 1.5; }
select.civic-select { min-height: 42px; height: auto; width: 100%; padding: 9px 36px 9px 12px; background-color: white; font-size: .86rem; line-height: 1.5; }
[data-slot=native-select] + span { pointer-events: none; }
.explore-filter-form select.civic-select { background-image: none; }
.civic-date-field { display: flex; position: relative; width: 100%; min-width: 0; }
.civic-date-field input { width: 100%; padding-right: 48px; font-variant-numeric: tabular-nums; }
.civic-date-popover { position: absolute; right: 0; top: 0; padding: 0; border: 0; }
.civic-date-popover > summary { list-style: none; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 8px; cursor: pointer; color: var(--secondary-foreground); }
.civic-date-popover > summary::-webkit-details-marker { display: none; }
.civic-date-popover > summary:hover { background: var(--secondary); }
.civic-calendar { position: absolute; z-index: 45; top: 48px; right: 0; width: 294px; max-width: calc(100vw - 40px); padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: var(--shadow-popover); }
.civic-calendar button { min-height: 32px; border: 0; box-shadow: none; }
.civic-calendar [data-slot=calendar] { padding: 0; }
.civic-calendar [data-slot=calendar-heading] { font-weight: 700; }
.civic-calendar [data-slot=calendar-day] { width: 32px; height: 34px; padding: 0; background: transparent; font-weight: 400; }
.civic-calendar [data-slot=calendar-day]:hover { background: var(--secondary); }
.civic-calendar [data-selected] { background: var(--primary); color: white; }
.civic-calendar [data-selected]:hover { background: var(--destructive); }
.civic-calendar .calendar-clear { margin-top: 8px; width: 100%; border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; color: var(--primary); font-size: .8rem; }
.civic-pagination { display: flex; justify-content: center; margin: 32px 0 8px; padding: 20px 0 0; border-top: 1px solid var(--border); }
.civic-pagination ul { display: flex; align-items: center; gap: 12px; list-style: none; margin: 0; padding: 0; }
.pagination-arrow { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--border); border-radius: 9px; text-decoration: none; background: var(--card); }
.pagination-arrow:hover { background: var(--secondary); }
.pagination-arrow:disabled { opacity: .3; }
.pagination-current { display: inline-flex; align-items: center; justify-content: center; min-width: 80px; font-size: .84rem; font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.bill-text-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bill-text-heading h2 { margin: 0; }
.bill-text-controls { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px 12px; align-items: center; margin: 20px 0 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.bill-text-controls > label { grid-row: 1; color: var(--muted-foreground); font-size: .76rem; font-weight: 700; }
.bill-text-controls > label:first-of-type { grid-column: 1; }
.bill-text-controls > label:nth-of-type(2) { grid-column: 2; }
.bill-text-controls > div { grid-row: 2; min-width: 0; }
.bill-text-controls > div:first-of-type { grid-column: 1; }
.bill-text-controls > div:nth-of-type(2) { grid-column: 2; }
.bill-text-controls select { text-overflow: ellipsis; }
.bill-text-panel > [role=status] { display: block; margin: -12px 0 20px; color: var(--secondary-foreground); font-size: .82rem; }
.bill-structured-text { max-width: 72ch; font-size: 1.08rem; line-height: 1.9; overflow-wrap: anywhere; }
.bill-xml-node { margin-block: 12px; }
.bill-xml-inline { gap: 8px; }
.bill-enum { min-width: 2em; font-weight: 400; color: var(--secondary-foreground); }
.bill-section-heading { align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 12px; padding-block: 10px; border-bottom: 1px solid var(--border); }
.bill-section-heading h3 { font-size: 1.2rem; }
.bill-section-heading h4 { font-size: 1.05rem; }
.bill-section-heading button { min-width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 8px; color: var(--muted-foreground); }
.bill-section-heading button:hover { background: var(--secondary); color: var(--foreground); }
.bill-subsection { margin-left: 12px; }
.bill-text-line { margin-block: 10px; }
.bill-plain-text { padding: 0; background: transparent; border: 0; font-size: 1.06rem; line-height: 1.9; }
.civic-disclosure, .source-detail details.civic-disclosure { padding: 0; border-top: 0; border-bottom: 1px solid var(--border); scroll-margin-top: 24px; }
.civic-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; list-style: none; padding: 20px 4px; cursor: pointer; font-size: 1rem; font-weight: 600; line-height: 1.6; }
.civic-disclosure > summary::-webkit-details-marker { display: none; }
.civic-disclosure > summary:hover { color: var(--primary); }
.civic-disclosure[open] > summary > .civic-icon { transform: rotate(180deg); }
.disclosure-label { min-width: 0; }
.disclosure-label small { display: block; margin-top: 5px; font-size: .76rem; font-weight: 400; color: var(--muted-foreground); }
.disclosure-body { padding: 0 4px 24px; }
.record-part-toggle { flex-direction: row-reverse; justify-content: space-between; border-radius: 0; padding: 20px 4px; line-height: 1.6; }
.record-part-toggle span { flex: 1; }
.record-part-toggle:hover { background: transparent; color: var(--primary); }
.record-part-content { padding: 0 4px 24px; }
.record-entry { border: 0; padding: 0; margin: 0 0 18px; }
.record-entry .record-speaker { margin: 22px 0 10px; color: var(--secondary-foreground); font-size: .84rem; font-weight: 700; }
.record-entry .record-prose { margin: 0; white-space: pre-line; font-size: 1.02rem; line-height: 1.9; overflow-wrap: anywhere; }
.record-entry.cited-record-item { padding: 14px 18px; border-left: 3px solid #d6a12b; border-radius: 0 8px 8px 0; }
.speech-source-link { display: inline-block; margin-top: 12px; font-size: .8rem; color: var(--primary); }
.private-workspace { gap: 18px; }
.private-workspace > h1 { margin-bottom: 12px; }
.private-workspace > h2 { padding-top: 20px; border-top: 1px solid var(--border); }
.private-workspace > label { margin-bottom: -10px; font-size: .82rem; font-weight: 700; color: var(--secondary-foreground); }
.private-workspace > p { color: var(--muted-foreground); line-height: 1.75; }
.private-workspace > button { border-radius: 9px; }
.conversation-list { padding-right: 16px; border-right: 1px solid var(--border); }
.conversation-list h2 { font-size: 1rem; color: var(--secondary-foreground); }
.conversation-item { border-radius: 8px; }
.conversation-item:hover { background: var(--secondary); }
.chat-transcript { gap: 20px; padding-block: 12px 24px; scrollbar-width: thin; }
.chat-user { border-radius: 16px 16px 4px 16px; padding: 14px 18px; }
.chat-assistant { padding: 14px 4px; line-height: 1.85; }
.chat-composer { border-radius: 16px; padding: 10px 12px 10px 16px; box-shadow: var(--shadow-soft); }
.chat-composer:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px #b85c6b12; }
.chat-composer textarea { box-shadow: none; }
.chat-composer-actions > div { min-width: 0; }
.chat-composer-actions select.civic-select { background: transparent; border: 0; font-size: .76rem; }
.chat-composer-actions [data-slot=native-select] + span { right: 8px; }
.auth-dialog, .auth-card { border-radius: 16px; gap: 14px; padding: 32px; box-shadow: var(--shadow-popover); }
.auth-dialog h2 { line-height: 1.4; margin-bottom: 12px; }
.auth-dialog p { font-size: .86rem; color: var(--muted-foreground); line-height: 1.7; }
.auth-dialog input { width: 100%; }
.annotation-toolbar { border-radius: 12px; box-shadow: var(--shadow-popover); }
.annotation-card { padding-block: 22px; }
.landing-home .hero { padding-block: clamp(64px, 9vw, 120px); }
.hero-copy-block p { color: #4e5b69; line-height: 1.85; }
.hero-product, .showcase-step img { border-radius: 14px; box-shadow: 0 16px 50px #1f2a3814; }
.hero-actions .button { border-radius: 10px; box-shadow: 0 4px 12px #b85c6b20; }
.showcase-step { padding-block: 60px; gap: 48px; }
.showcase-step p { color: #4e5b69; line-height: 1.85; }
.final-cta { border: 1px solid #cfdeeb; border-radius: 20px; padding-block: clamp(44px, 7vw, 88px); }
.editorial:not(.source-detail) > h1 { padding-bottom: 28px; border-bottom: 1px solid var(--foreground); }
.editorial:not(.source-detail) > p { margin-block: 22px; color: #43505e; }
.editorial:not(.source-detail) > h2 { margin-block: 40px 18px; font-size: clamp(1.35rem, 3vw, 1.8rem); line-height: 1.4; }
.site-footer { padding-block: 32px; background: #f4f3ef; }
@media (max-width: 650px) {
  .site-header { padding-top: 14px; }
  .header-auth, .account-menu, .nav-drawer, .header-open-app { top: 12px; }
  .header-back { top: 8px; left: 12px; width: 36px; height: 36px; }
  .main-content { padding-top: 26px; }
  .source-facts { padding: 18px; gap: 18px; }
  .subject-suggestions { width: 100%; }
  .bill-text-controls { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; }
  .bill-text-controls select.civic-select { padding-left: 8px; padding-right: 28px; font-size: .75rem; }
  .bill-structured-text { font-size: 1.02rem; }
  .bill-subsection { margin-left: 4px; }
  .bill-enum { min-width: 1.6em; }
  .source-tabs a { padding-inline: 12px; font-size: .8rem; }
  .disclosure-body, .record-part-content { padding-inline: 0; }
  .record-entry .record-prose { font-size: .96rem; }
  .conversation-list { border-right: 0; }
  .auth-dialog { padding: 24px; }
  .showcase-step { padding-block: 36px; gap: 24px; }
  .civic-calendar { width: 282px; }
  .site-footer { padding-block: 28px; }
}
.conversation-item.is-active { background: var(--secondary); box-shadow: inset 2px 0 var(--primary); }
.conversation-list .civic-pagination { margin-top: auto; padding-top: 16px; }
.conversation-list .civic-pagination ul { gap: 5px; }
.conversation-list .pagination-arrow { width: 34px; height: 36px; min-height: 36px; }
.conversation-list .pagination-current { min-width: 65px; font-size: .75rem; }
@media (max-width: 650px) {
  .site-header .brand { justify-self: start; max-width: calc(100% - 116px); white-space: normal; font-size: 1.1rem; line-height: 1.45; }
  .site-header:has(.header-back) .brand { margin-left: 34px; max-width: calc(100% - 150px); }
}
.account-section { display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: 12px; box-shadow: var(--shadow-soft); }
.account-section h2 { margin: 0; font-size: 1.2rem; line-height: 1.4; }
.account-section p { margin: 0; color: var(--muted-foreground); line-height: 1.75; font-size: .88rem; }
.account-section label { font-size: .82rem; font-weight: 700; }
.account-section button { align-self: flex-start; }
.account-danger { border-color: #b85c6b50; }
.account-danger h2 { color: var(--destructive); }
.private-workspace > [role=alert], .bill-text-panel > [role=alert] { padding: 12px 16px; border: 1px solid #b85c6b50; border-radius: 10px; background: #fff6f5; color: var(--destructive); font-size: .88rem; }
.private-workspace > [role=status] { color: var(--muted-foreground); font-size: .88rem; }
@media (max-width: 650px) { .account-section { padding: 20px; } }
.civic-calendar [data-slot=calendar-nav-prev], .civic-calendar [data-slot=calendar-nav-next] { width: 32px; min-width: 32px; padding: 0; opacity: .8; }
.civic-calendar button svg { flex-shrink: 0; }
/* Keep Shadcn variants authoritative over the base HTML button reset. */
button[data-slot=button][data-variant=defaultVariant] { background: var(--primary); border-color: var(--primary); color: white; }
button[data-slot=button][data-variant=defaultVariant]:hover { background: var(--destructive); border-color: var(--destructive); }
button[data-slot=button][data-variant=destructive] { background: var(--destructive); border-color: var(--destructive); color: white; }
button[data-slot=button][data-variant=secondary] { background: var(--secondary); border-color: transparent; color: var(--secondary-foreground); }
button[data-slot=button][data-variant=ghost], button[data-slot=button][data-variant=link] { background: transparent; border-color: transparent; }
button[data-slot=button][data-variant=ghost]:hover { background: var(--secondary); }
button[data-slot=button][data-variant=link] { color: var(--primary); }
.conversation-item button:not(:first-child) { flex: none; width: 30px; min-height: 34px; padding: 4px; opacity: .7; }
.conversation-item button:not(:first-child):hover, .conversation-item button:not(:first-child):focus-visible { opacity: 1; color: var(--primary); }
.conversation-item .civic-icon { width: 16px; height: 16px; }
.nav-drawer > summary { display: flex; align-items: center; justify-content: center; min-width: 38px; min-height: 38px; }
.source-detail { padding-bottom: 0; }
@media (max-width: 650px) {
  .bill-text-controls { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
  .source-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
  .source-fact dd { font-size: .84rem; }
  .source-facts > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .site-header:has(.header-back) .brand { max-width: calc(100% - 166px); }
}

/* Stories switch to menu navigation before category links run out of room. */
.header-subnav.story-categories { flex-wrap: nowrap; gap: 8px; }
.story-categories > .story-search-link { flex: 0 0 32px; }
.story-categories:target > .story-search-link, .story-categories.search-active > .story-search-link { display: none; }
.story-drawer-search { padding: 9px 12px; gap: 6px; align-items: center; }
.story-drawer-search input { flex: 1; width: 0; min-width: 0; }
.story-drawer-search button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 42px; padding: 8px; }
.source-header { position: relative; }
.source-header:has(.source-header-action) { padding-right: 52px; }
.source-header-action { position: absolute; right: 0; top: 0; }
.source-share-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 8px; }
.source-header-action [role=status]:not(:empty) { display: block; position: absolute; right: 0; width: 160px; padding: 8px; background: var(--card); border: 1px solid var(--border); font-size: .8rem; }
.feed > .civic-disclosure { margin-bottom: 24px; }
@media (max-width: 1050px) {
  .header-subnav.story-categories { display: none; }
  .story-drawer-categories { display: block; }
  .story-drawer-search { display: flex; }
}

/* Stable account affordance across server rendering and auth restoration. */
.account-link.account-icon, .account-menu > summary.account-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; min-height: 40px; padding: 8px;
  border: 0; border-radius: 8px; background: transparent; color: inherit;
  box-sizing: border-box; cursor: pointer;
}
.account-icon:hover { background: var(--secondary); }
.feed > .civic-disclosure > summary { padding: 10px 4px; font-size: .9rem; }
@media (min-width: 651px) and (max-width: 1050px) {
  .feed .explore-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.explore-primary-field { grid-column: 1 / -1; }

.account-dialog { width: min(540px, calc(100vw - 32px)); }
.account-dialog .private-workspace { width: 100%; padding: 0; }
.nav-drawer nav > button { text-align: left; padding: 9px 12px; border: 0; background: transparent; font-size: .84rem; }

/* Compact reader overlays share civic spacing and viewport-safe bounds. */
[data-floating-panel] { position: fixed; box-sizing: border-box; overflow: auto; overscroll-behavior: contain; }
[data-floating-panel]:not([data-positioned]) { visibility: hidden; }
.citation-popover { background: var(--card); overflow-wrap: anywhere; padding: 16px; }
.annotation-toolbar { gap: 4px; padding: 6px; background: var(--card); }
.annotation-toolbar .civic-icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; padding: 0; color: var(--foreground); border-radius: 8px; }
.annotation-toolbar .civic-icon-button:hover { background: var(--secondary); }
.annotation-panel { display: block; width: 380px; padding: 18px; }
.annotation-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.annotation-panel-heading strong { font-size: 1rem; }
.annotation-selection { margin: 12px 0 18px; padding: 10px 12px; border-left: 3px solid var(--primary); border-radius: 0 6px 6px 0; background: var(--muted-surface); color: var(--muted-foreground); font-size: .8rem; line-height: 1.6; max-height: 5.5em; overflow: auto; overflow-wrap: anywhere; }
.annotation-composer { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.annotation-composer > label, .annotation-response-level label { font-size: .8rem; font-weight: 600; }
.annotation-composer textarea { box-sizing: border-box; min-height: 88px; resize: vertical; margin: 0; }
.annotation-composer-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 16px; }
.annotation-response-level { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.annotation-response-level select { width: 100%; }
.annotation-toolbar .annotation-submit { background: var(--primary); color: var(--primary-foreground); }
.annotation-toolbar .annotation-submit:hover:not(:disabled) { background: var(--primary); filter: brightness(.95); }
.annotation-composer p { margin: 0; font-size: .85rem; overflow-wrap: anywhere; }
.annotation-error { color: var(--destructive); }
.annotation-status { color: var(--muted-foreground); }
.annotation-answer { white-space: pre-wrap; line-height: 1.65; }
.civic-toast:empty { display: none; }
.share-control .civic-toast:not(:empty) { display: block; position: fixed; z-index: 100; inset: auto 16px max(20px, env(safe-area-inset-bottom)) auto; box-sizing: border-box; width: max-content; max-width: min(360px, calc(100vw - 32px)); padding: 12px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--foreground); box-shadow: var(--shadow-popover); font-size: .85rem; font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
/* Long source titles, saved passages, and streamed text must wrap on phones. */
.source-header h1, .annotation-card, .conversation-item, .feed-row { overflow-wrap: anywhere; min-width: 0; }
.annotation-card textarea { box-sizing: border-box; width: 100%; margin-bottom: 12px; }
.annotation-card > button:first-child { display: block; width: 100%; text-align: left; margin: 0 0 14px; padding: 12px; background: var(--muted-surface); font-weight: 400; line-height: 1.6; white-space: normal; }
.annotation-card > button:not(:first-child) { margin-top: 10px; }
@media (max-width: 650px) {
  .annotation-panel { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.chat-sidebar-close.civic-icon-button { margin-left: auto; }
.conversation-item > button:first-child { min-width: 0; white-space: normal; text-align: left; }
.annotation-toolbar .civic-icon-button:disabled:hover { background: transparent; }
.annotation-toolbar .annotation-submit:disabled:hover { background: var(--primary); }

/* Story headings retain the share action without the source-reader divider. */
.story-reader > .source-header { border-bottom: 0; padding-bottom: 0; }

/* Chat history collapses at every width; the narrow layout remains a drawer. */
.chat-sidebar-toggle.civic-icon-button { display: inline-flex; grid-column: 2; justify-self: start; margin-bottom: 8px; }
.private-workspace:has(.conversation-list:not(.is-open)) { grid-template-columns: minmax(0, 1fr); }
.private-workspace:has(.conversation-list:not(.is-open)) .chat-main,
.private-workspace:has(.conversation-list:not(.is-open)) .chat-sidebar-toggle { grid-column: 1; }
.conversation-list:not(.is-open) { display: none; }
.chat-sidebar-close.civic-icon-button { display: inline-flex; align-self: flex-end; }
.conversation-item { flex-shrink: 0; }
.chat-copy.civic-icon-button { width: 32px; height: 32px; min-height: 32px; margin-top: 4px; }
.account-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; }
.account-heading h1 { grid-column: 1; grid-row: 1; margin: 0; }
.account-email { grid-column: 1 / -1; grid-row: 2; margin: 0; color: var(--muted-foreground); overflow-wrap: anywhere; }
.account-heading > div { min-width: 0; }
.account-heading > div:first-child { display: contents; }
.account-section progress { width: 100%; height: 10px; accent-color: var(--primary); }
.account-section .account-quota-count { font-size: 1.5rem; font-weight: 700; color: var(--foreground); }
.account-analytics-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.analytics-consent { justify-content: flex-start; }
.analytics-consent-copy { flex: 1 1 450px; }
.analytics-consent-copy p { margin: 6px 0; line-height: 1.6; }
@media (max-width: 650px) {
  .analytics-consent { max-height: calc(100dvh - 32px); overflow: auto; }
}

/* The arrow follows the sidebar edge and shares its heading row. */
.private-workspace:has(.chat-sidebar-shell) { grid-template-columns: 236px minmax(0, 1fr); }
.chat-sidebar-shell { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; width: 236px; min-height: 0; }
.private-workspace:has(.chat-sidebar-shell:not(.is-open)) { grid-template-columns: 40px minmax(0, 1fr); gap: 0 12px; }
.chat-sidebar-shell:not(.is-open) { width: 40px; }
.chat-sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding-right: 16px; }
.chat-sidebar-heading h2 { margin: 0; font-size: 1rem; color: var(--secondary-foreground); }
.chat-sidebar-shell:not(.is-open) .chat-sidebar-heading { padding-right: 0; }
.chat-sidebar-shell .chat-sidebar-toggle { margin: 0; flex-shrink: 0; }
.chat-sidebar-shell .conversation-list { max-height: calc(100vh - 260px); }
.private-workspace:has(.chat-sidebar-shell) .chat-main,
.private-workspace:has(.chat-sidebar-shell:not(.is-open)) .chat-main { grid-column: 2; grid-row: 1; }

.chat-message { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 100%; }
.chat-message.is-user { align-self: flex-end; max-width: 85%; align-items: flex-end; }
.chat-message.is-assistant { align-self: stretch; align-items: flex-start; }
.chat-message .chat-user { max-width: 100%; }
.chat-message .chat-assistant { width: 100%; padding: 8px 4px; }
.chat-transcript { gap: 24px; padding-inline: 4px; }
.chat-user p { margin: 0; white-space: pre-wrap; line-height: 1.7; overflow-wrap: anywhere; }
.chat-assistant .prose { font-size: 1rem; line-height: 1.75; overflow-wrap: anywhere; }
.chat-assistant .prose > :first-child { margin-top: 0; }
.chat-assistant .prose > :last-child { margin-bottom: 0; }
.chat-assistant .prose p { margin: 0 0 1em; }
.chat-assistant .prose :is(h1, h2, h3, h4) { margin: 1.4em 0 .6em; line-height: 1.35; }
.chat-assistant .prose :is(ul, ol) { margin: .75em 0 1em; padding-left: 1.5em; }
.chat-assistant .prose li { margin-block: .4em; }
.chat-assistant .prose li p { margin-block: .4em; }
.chat-message > .chat-copy { margin: 0; flex-shrink: 0; }
@media (max-width: 650px) {
  .chat-sidebar-shell { width: min(310px, 86vw); }
  .chat-sidebar-shell.is-open { position: fixed; z-index: 70; inset: 0 auto 0 0; padding: 10px 0 20px; background: var(--background); box-shadow: 10px 0 30px #1f2a3833; }
  .chat-sidebar-shell .conversation-list { position: static; transform: none; box-shadow: none; width: 100%; max-height: none; padding-top: 0; }
  .chat-sidebar-shell.is-open .chat-sidebar-heading { padding: 0 16px; }
  .chat-sidebar-shell .chat-sidebar-toggle { margin: 0; }
  .chat-message.is-user { max-width: 90%; }
}

/* Shadcn Select presentation, progressively enhanced from the form control. */
.civic-select-root { position: relative; min-width: 0; width: 100%; }
.civic-select-ui { display: none; }
.civic-select-root.is-enhanced > [data-slot="native-select-wrapper"],
.civic-select-root.is-enhanced > div:has(select.civic-select) { display: none; }
.civic-select-root.is-enhanced .civic-select-ui,
.civic-select-ui > [data-slot="select"] { display: block; width: 100%; }
.civic-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--foreground); font: inherit; font-size: .86rem; line-height: 1.5; text-align: left; box-shadow: 0 1px 2px #1f2a380d; }
.civic-select-trigger > [data-slot="select-value"] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.civic-select-trigger svg { flex-shrink: 0; opacity: .55; }
.civic-select-trigger:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.civic-select-listbox { position: fixed; z-index: 120; overflow: auto; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--foreground); box-shadow: 0 8px 24px #1f2a3826; }
.civic-select-listbox [role="option"] { position: relative; padding: 8px 34px 8px 10px; border-radius: 5px; font-size: .86rem; line-height: 1.4; cursor: pointer; overflow-wrap: anywhere; }
.civic-select-listbox [role="option"]:hover, .civic-select-listbox [role="option"].is-active { background: var(--accent); color: var(--accent-foreground); }
.civic-select-listbox [aria-disabled="true"] { opacity: .5; cursor: default; }
.civic-select-check { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); display: flex; }
.reader-level-control .civic-select-root { width: 170px; }
.chat-composer-actions .civic-select-root { width: 135px; }
.chat-composer-actions .civic-select-trigger { min-height: 38px; border: 0; background: transparent; box-shadow: none; font-size: .76rem; }
.chat-sidebar-shell.is-open { align-self: stretch; border-right: 1px solid var(--border); }
.chat-sidebar-shell .conversation-list { border-right: 0; }
@media (max-width: 650px) {
  .chat-sidebar-shell.is-open { border-right: 0; }
  .chat-composer-actions .civic-select-root { width: 110px; }
}

/* Markdown markers must survive the shared preflight reset. */
.prose ul { list-style: disc outside; padding-left: 1.5em; }
.prose ol { list-style: decimal outside; padding-left: 1.5em; }
.prose ul ul { list-style-type: circle; }
.prose ul ul ul { list-style-type: square; }
.prose li > :is(ul, ol) { margin-block: .5em; }

.workspace-loading { display: grid; place-items: center; min-height: 60vh; }
.loading-indicator { display: flex; width: 100%; min-height: 64px; align-items: center; justify-content: center; padding: 12px; }
.loading-spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: loading-spin .8s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .loading-spinner { animation: none; }
}

.account-heading-actions { grid-column: 2; grid-row: 1; display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-shrink: 0; }
.account-heading-actions > button { white-space: nowrap; }
.story-reader { min-width: 0; }
.story-notes-toggle { display: none; }
.story-notes-content { min-width: 0; overflow-wrap: anywhere; }
.story-notes-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; margin-bottom: 16px; }
.story-notes-heading h2 { min-width: 0; margin: 0; font-size: 1.6rem; line-height: 1.25; }
.story-notes-list { min-width: 0; }
.story-notes-list.is-loading { display: grid; place-items: center; min-height: 160px; }
@media (min-width: 1080px) {
  .story-article { position: relative; width: min(100%, calc(var(--content-width) + 312px)); display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
  .story-article:has(.notes-collapsed) { grid-template-columns: minmax(0, 1fr) auto; }
  .story-annotations { position: sticky; top: 24px; margin-top: 0; min-width: 0; display: flex; flex-direction: column; height: calc(100dvh - 48px); }
  .story-notes-toggle { display: inline-flex; flex-shrink: 0; margin-left: auto; }
  .story-notes-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .story-notes-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 2px 8px 2px 2px; }
  .story-notes-list.is-loading { min-height: 0; padding: 0; scrollbar-gutter: auto; }
  .story-annotations:not(.notes-collapsed) { padding-left: 16px; }
  .story-annotations.notes-collapsed { height: auto; }
  .notes-collapsed .story-notes-heading { justify-content: flex-end; margin-bottom: 0; }
  .notes-collapsed .story-notes-heading h2 { display: none; }
  .notes-collapsed .story-notes-content { display: none; }
}

@media (max-width: 480px) {
  .account-heading { column-gap: 8px; }
  .account-heading h1 { font-size: 1.5rem; }
  .account-heading-actions { gap: 4px; }
  .account-heading-actions > button:first-child { padding-inline: 10px; }
  .account-heading-actions .civic-icon-button { width: 32px; min-width: 32px; height: 40px; padding: 6px; }
}

.annotation-card:focus { outline: 2px solid var(--ring); outline-offset: -2px; }

/* A fixed-height slot follows the lowest visible navigation row. */
#page-loading { height: 3px; overflow: hidden; position: relative; flex-shrink: 0; }
#page-loading > span { display: block; height: 100%; width: 35%; background: var(--primary); opacity: 0; }
#page-loading[data-active="true"] > span { opacity: 1; animation: page-loading-slide 1.2s ease-in-out infinite; }
@keyframes page-loading-slide { from { transform: translateX(-100%); } to { transform: translateX(390%); } }
#page-loading-recovery { text-align: center; padding: 8px 16px; }
#page-loading-recovery[hidden], .citation-popover[hidden] { display: none; }
.story-notes-list.is-loading:has(.annotation-card) { display: block; }
.story-notes-list.is-loading > .loading-indicator { display: flex; width: 100%; }
@media (prefers-reduced-motion: reduce) {
  #page-loading[data-active="true"] > span { animation: none; width: 100%; opacity: .55; }
}

.analytics-manager { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; margin: auto; padding: 28px; color: var(--foreground); background: var(--background); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-popover); }
.analytics-manager::backdrop { background: #1f2a3833; }
.analytics-manager-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.analytics-manager h2 { margin: 0; font-size: 1.4rem; line-height: 1.4; }
.analytics-manager-close { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 8px; }
.analytics-manager-close:hover { background: var(--secondary); }
.analytics-manager p { margin: 0 0 24px; line-height: 1.7; font-size: .92rem; }
.analytics-manager #analytics-manager-status { margin: 0 0 20px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--secondary); font-weight: 700; }
.analytics-manager > a { display: inline-block; font-size: .88rem; text-underline-offset: 4px; }
.analytics-manager-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.analytics-manager-actions button { flex: 1 1 180px; }
.analytics-manager-actions button:disabled { opacity: .45; cursor: default; }
@media (max-width: 650px) { .analytics-manager { padding: 20px; } }
