:root {
  color-scheme: light;
  --bg: #f5f2eb;
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --surface-warm: #fbfaf6;
  --ink: #17202b;
  --muted: #4f5d70;
  --subtle: #667386;
  --line: #d9ded9;
  --line-strong: #bdc9c3;
  --accent: #0f766b;
  --accent-strong: #075f56;
  --accent-soft: #e2f4f1;
  --gold: #8a6500;
  --gold-soft: #fff7e3;
  --error: #b42318;
  --error-soft: #fff2f0;
  --shadow: 0 18px 38px rgba(23, 32, 43, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  border-bottom: 1px solid rgba(217, 222, 217, 0.84);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(10px);
}

.masthead,
.page-shell,
.page-footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}

.senate-mark {
  display: grid;
  color: var(--ink);
  text-decoration: none;
}

.senate-mark strong {
  font-size: 1.05rem;
  line-height: 1.2;
}

.senate-mark small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.utility-nav,
.archive-meta,
.footer-links,
.answer-badges,
.source-actions {
  display: flex;
  align-items: center;
}

.utility-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
}

.utility-nav a,
.footer-links a,
.source-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.utility-nav a:hover,
.footer-links a:hover,
.source-link:hover {
  text-decoration: underline;
}

.page-shell {
  display: grid;
  gap: 28px;
  padding: 44px 0 38px;
}

.hero {
  display: grid;
  justify-items: center;
  text-align: center;
}

.service-disclosure {
  margin: 0 0 14px;
  border: 1px solid rgba(15, 118, 107, 0.24);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 850;
}

.kicker,
.eyebrow,
.mini-label {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.popular-searches h2,
.answer-header h2,
.source-group h3,
.source-card h4 {
  margin: 0;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 820px;
  font-size: 2.05rem;
  line-height: 1.12;
}

.intro {
  max-width: 820px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.search-panel {
  width: min(940px, 100%);
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}

.mode-selector {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 3px;
  background: var(--surface-soft);
}

.mode-selector legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mode-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-selector label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 6px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
  cursor: pointer;
  user-select: none;
}

.mode-selector input:checked + label {
  background: var(--accent);
  color: white;
}

.mode-selector input:focus-visible + label {
  outline: 3px solid rgba(15, 118, 107, 0.24);
  outline-offset: 3px;
}

.query-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.search-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 62px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
}

.search-icon {
  position: relative;
  width: 22px;
  height: 22px;
  margin-left: 18px;
  pointer-events: none;
  user-select: none;
}

.search-icon::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  left: 1px;
  top: 1px;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
  left: 12px;
  top: 15px;
  transform: rotate(45deg);
}

input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 60px;
  border: 0;
  padding: 0 16px;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
}

input[type="search"]::placeholder {
  color: #707d8e;
}

input[type="search"]:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(15, 118, 107, 0.24);
  outline-offset: 3px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--accent);
  color: white;
  font-weight: 850;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.search-row button {
  align-self: stretch;
  min-height: 60px;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 0 26px;
  font-size: 0.96rem;
}

.mode-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.archive-meta {
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  max-width: 980px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.archive-meta span + span::before,
.archive-meta a::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 16px;
  border-radius: 50%;
  background: var(--line-strong);
  vertical-align: middle;
}

.archive-meta a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.popular-searches {
  display: grid;
  grid-template-columns: minmax(240px, 0.62fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  max-width: 940px;
  margin: 0 auto;
}

.popular-searches h2 {
  font-size: 1.28rem;
  line-height: 1.3;
}

.example-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.example-list button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 0.92rem;
  box-shadow: none;
  user-select: none;
}

.example-list button:hover {
  border-color: rgba(15, 118, 107, 0.34);
  background: var(--accent-soft);
}

.answer-panel,
.coverage-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.answer-panel {
  overflow: hidden;
}

.loading-state,
.error-state,
.answer-result {
  padding: 28px;
}

.loading-state {
  display: grid;
  min-height: 190px;
  align-content: center;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.loading-state p,
.error-state p {
  margin: 0;
  color: var(--muted);
}

.loader {
  width: 38px;
  height: 38px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .loader {
    animation: none;
  }
}

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

.error-state {
  min-height: 150px;
  border-left: 4px solid var(--error);
  background: var(--error-soft);
}

.error-state strong {
  color: var(--error);
}

.answer-result {
  display: grid;
  gap: 20px;
}

.answer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin: -28px -28px 0;
  padding: 24px 28px 20px;
}

.answer-header h2 {
  max-width: 760px;
  font-size: 1.45rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.answer-badges {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-badge,
.constraint-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.supported {
  border-color: rgba(15, 118, 107, 0.35);
  color: var(--accent-strong);
}

.status-badge.supported::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.status-badge.partial {
  border-color: rgba(138, 101, 0, 0.36);
  color: var(--gold);
}

.status-badge.insufficient {
  border-color: rgba(180, 35, 24, 0.35);
  color: var(--error);
}

.query-interpretation {
  display: grid;
  gap: 8px;
}

.constraint-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.answer-text {
  max-width: 860px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 16px 18px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 1.03rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.answer-text > * {
  margin: 0;
}

.answer-text > * + * {
  margin-top: 14px;
}

.answer-text h3,
.answer-text h4 {
  font-size: 1.04rem;
  line-height: 1.35;
}

.answer-text ol,
.answer-text ul {
  padding-left: 24px;
}

.answer-text li + li {
  margin-top: 10px;
}

.answer-text a {
  color: var(--accent-strong);
  font-weight: 800;
}

.answer-text code {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
  background: var(--surface);
  font-size: 0.94em;
}

.source-list {
  display: grid;
  gap: 22px;
}

.source-group {
  display: grid;
  gap: 12px;
}

.source-group summary {
  cursor: pointer;
}

.source-group summary::marker {
  color: var(--accent-strong);
}

.source-group-header {
  display: grid;
  gap: 3px;
}

.source-group-summary {
  display: grid;
  gap: 3px;
}

.source-group-summary-title {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
}

.source-group-summary-description {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.source-group h3 {
  font-size: 1.14rem;
}

.source-group-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.related-group,
.closest-group {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.source-card-grid {
  display: grid;
  gap: 12px;
}

.source-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.related-source,
.closest-source {
  background: var(--surface-warm);
}

.source-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 118, 107, 0.22);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 900;
}

.closest-source .source-index {
  border-color: rgba(138, 101, 0, 0.24);
  background: var(--gold-soft);
  color: var(--gold);
}

.source-content {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.source-card h4 {
  overflow-wrap: anywhere;
  font-size: 1.04rem;
  line-height: 1.35;
}

.source-descriptor,
.version-line,
.source-reason,
.archive-path,
.archive-note,
.empty-sources,
.link-gap,
.alternate-link-gap,
.date-conflict-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.version-line {
  color: var(--subtle);
}

.source-reason {
  border-left: 3px solid rgba(15, 118, 107, 0.55);
  padding-left: 10px;
  color: var(--accent-strong);
  font-weight: 750;
}

.source-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.source-link,
.link-gap {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  font-size: 0.9rem;
  font-weight: 850;
}

.link-gap {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 9px;
  background: var(--surface-soft);
}

.source-evidence,
.action-evidence {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.source-evidence strong,
.action-evidence strong {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 850;
}

.source-evidence blockquote {
  margin: 10px 0 0;
  border-left: 3px solid var(--line-strong);
  padding: 8px 0 8px 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.related-evidence blockquote,
.closest-evidence blockquote {
  color: var(--subtle);
}

.source-evidence details {
  margin-top: 8px;
}

.source-evidence summary,
.archive-path-details summary,
.alternate-versions summary,
.date-details summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 800;
}

.archive-path {
  overflow-wrap: anywhere;
}

.archive-path-details,
.alternate-versions,
.date-details {
  color: var(--muted);
  font-size: 0.9rem;
}

.alternate-versions ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.alternate-versions li + li {
  margin-top: 6px;
}

.alternate-versions a {
  color: var(--accent-strong);
  font-weight: 750;
}

.date-details dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  margin: 8px 0 0;
}

.date-details dt {
  color: var(--subtle);
  font-weight: 800;
}

.date-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.date-conflict-copy {
  margin-top: 8px;
  color: var(--gold);
}

.archive-note {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.coverage-panel {
  scroll-margin-top: 24px;
  padding: 16px 18px;
}

.coverage-panel summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.coverage-grid p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(217, 222, 217, 0.9);
  padding: 24px 0 32px;
  color: var(--muted);
}

.page-footer p {
  margin: 0;
}

.footer-links {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 840px) {
  .masthead,
  .page-shell,
  .page-footer {
    width: min(100% - 28px, 1120px);
  }

  .masthead,
  .answer-header,
  .page-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-shell {
    padding-top: 32px;
  }

  .hero {
    justify-items: start;
    text-align: left;
  }

  .hero h1 {
    font-size: 1.88rem;
  }

  .intro {
    font-size: 1rem;
  }

  .search-panel {
    padding: 14px;
  }

  .mode-selector {
    width: 100%;
  }

  .search-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .search-row button {
    grid-column: 1 / -1;
    width: 100%;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .archive-meta {
    justify-content: flex-start;
  }

  .archive-meta span + span::before,
  .archive-meta a::before {
    display: none;
  }

  .popular-searches,
  .coverage-grid {
    grid-template-columns: 1fr;
  }

  .answer-badges {
    justify-content: flex-start;
  }

  .source-card {
    grid-template-columns: 1fr;
  }

  .source-index {
    width: 30px;
    height: 30px;
  }

  .date-details dl {
    grid-template-columns: 1fr;
  }
}
