:root {
  --bg: #f5f0e8;
  --panel: #fffdf8;
  --ink: #1f1b16;
  --muted: #6b6257;
  --accent: #a03b22;
  --accent-dark: #7a2713;
  --line: #dccfbd;
  --shadow: 0 18px 40px rgba(54, 40, 24, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(160, 59, 34, 0.15), transparent 28%),
    linear-gradient(180deg, #f7f1e7 0%, #efe5d6 100%);
}

a {
  color: var(--accent-dark);
}

.shell-header {
  border-bottom: 1px solid rgba(122, 39, 19, 0.14);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  background: rgba(245, 240, 232, 0.92);
  z-index: 30;
}

.shell-header__inner,
.shell-main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.shell-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  gap: 1rem;
}

.brand {
  font-size: 1.4rem;
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shell-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.version {
  color: var(--muted);
}

.shell-main {
  padding: 2rem 0 3rem;
}

.hero,
.panel-grid {
  display: grid;
  gap: 1.2rem;
}

.hero {
  grid-template-columns: 1.6fr 1fr;
  margin-bottom: 1.2rem;
}

.panel,
.hero__copy,
.hero__stats {
  background: var(--panel);
  border: 1px solid rgba(122, 39, 19, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero__copy,
.hero__stats,
.panel {
  padding: 1.4rem;
}

.hero__stats {
  display: grid;
  gap: 1rem;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

.lede,
.meta,
.citation {
  color: var(--muted);
}

.hero h1,
.panel h1,
.panel h2 {
  margin-top: 0;
}

.hero__actions,
.filter-grid,
.pagination,
.panel__header,
.document-list__item,
.metadata-grid,
.simple-list li {
  display: flex;
  gap: 1rem;
}

.hero__actions {
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.button--ghost {
  background: transparent;
  color: var(--accent-dark);
}

.stat-card {
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffaf2 0%, #f6eddf 100%);
}

.stat-card__label {
  display: block;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.panel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.2rem;
}

.panel__header {
  justify-content: space-between;
  align-items: baseline;
}

.simple-list,
.document-list,
.chunk-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.simple-list li {
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.simple-list li:last-child,
.document-list__item:last-child {
  border-bottom: 0;
}

.filter-grid {
  flex-wrap: wrap;
}

.filter-grid input,
.filter-grid select {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.document-list__item {
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.document-list__cta {
  white-space: nowrap;
}

.document-list--compact li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.detail-head {
  margin-bottom: 1.2rem;
}

.metadata-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  flex-wrap: wrap;
}

.metadata-grid li {
  min-width: 180px;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf3;
}

.metadata-grid span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.detail-section + .detail-section {
  margin-top: 1.4rem;
}

.legal-text {
  white-space: pre-wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  overflow-x: auto;
}

.chunk-list li {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: #fff;
}

.chunk-list li + li {
  margin-top: 0.8rem;
}

.pagination {
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .hero,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .document-list__item,
  .panel__header,
  .pagination {
    flex-direction: column;
  }
}
