:root {
  --ink: #1f2421;
  --muted: #6b716c;
  --paper: #f4f1e9;
  --paper-deep: #e8e1d2;
  --card: rgba(255, 253, 247, 0.92);
  --red: #9f2929;
  --red-deep: #761b1b;
  --gold: #b08a4a;
  --line: rgba(76, 61, 39, 0.16);
  --shadow: 0 18px 50px rgba(48, 39, 26, 0.09);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  padding-top: 78px;
  background:
    radial-gradient(circle at 8% 5%, rgba(181, 147, 91, 0.12), transparent 25rem),
    radial-gradient(circle at 92% 18%, rgba(143, 41, 41, 0.08), transparent 30rem),
    linear-gradient(180deg, #faf7ef 0, var(--paper) 34rem, #f1ede4 100%);
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  background: rgba(250, 247, 239, .9);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(48, 39, 26, .06);
  backdrop-filter: blur(18px);
}
.header-inner {
  width: min(1420px, calc(100% - 64px));
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff7e8;
  background: var(--red);
  border-radius: 50% 50% 46% 54% / 48% 45% 55% 52%;
  font-size: 24px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.brand strong { display: block; font-size: 20px; letter-spacing: .08em; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .22em; margin-top: 3px; }
nav { display: flex; gap: 8px; }
nav a {
  padding: 9px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  color: #4c4f4c;
}
nav a:hover, nav a:focus-visible { color: var(--red); background: rgba(159, 41, 41, .07); }
nav a:hover { color: var(--red); }

main { width: min(1420px, calc(100% - 64px)); margin: 0 auto; }
.hero {
  padding: 76px 0 54px;
}
.eyebrow {
  margin: 0 0 24px;
  color: var(--red);
  font-family: sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
}
.hero h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(46px, 6.8vw, 104px);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 600;
}
.hero h1 em { color: var(--red); font-style: normal; }
.hero-copy > .hero-intro {
  max-width: 760px;
  margin: 30px 0 0;
  color: #555b56;
  font-family: "Noto Sans SC", "Source Han Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.9;
}
.hero-copy > .hero-note {
  margin-top: 12px;
  color: var(--red-deep);
  font-size: 13px;
  letter-spacing: .04em;
}

.home-dashboard {
  padding: 46px 0 18px;
  scroll-margin-top: 100px;
}
.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.dashboard-heading > div { display: flex; align-items: center; gap: 14px; }
.dashboard-heading h2 { margin: 0; font-size: 27px; font-weight: 600; }
.dashboard-heading p { margin: 0; color: var(--muted); font: 13px sans-serif; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}
.metric-grid article {
  min-height: 140px;
  padding: 24px;
  background: rgba(255, 253, 247, .78);
}
.metric-grid strong {
  display: block;
  color: var(--red-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.5vw, 48px);
  font-weight: 500;
  letter-spacing: -.035em;
}
.metric-grid span { display: block; margin-top: 10px; font-size: 15px; }
.metric-grid small { display: block; margin-top: 6px; color: var(--muted); font: 11px/1.5 sans-serif; }
.overview-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  margin-top: 18px;
}
.overview-card {
  padding: 26px 28px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.44);
}
.overview-card h3 { margin: 8px 0 20px; font-size: 20px; }
.card-kicker { color: var(--red); font: 700 11px sans-serif; letter-spacing: .14em; }
.type-bars { display: grid; gap: 11px; }
.type-bar { display: grid; grid-template-columns: 94px 1fr 54px; align-items: center; gap: 12px; font: 12px sans-serif; }
.type-bar i { display: block; height: 6px; border-radius: 9px; background: linear-gradient(90deg, var(--red), #c99a62); transform-origin: left; }
.type-bar em { color: var(--muted); font-style: normal; text-align: right; }
.overview-note p { color: var(--muted); font: 14px/1.9 sans-serif; margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.legend span { border: 1px solid var(--line); padding: 6px 9px; color: var(--red-deep); font: 11px sans-serif; }

.search-panel {
  padding: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 247, .56);
  box-shadow: var(--shadow);
}
.search-section {
  padding-top: 56px;
  scroll-margin-top: 96px;
}
.search-heading { margin-bottom: 18px; }
.search-box {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid var(--ink);
  padding: 10px 4px 14px;
}
.search-icon {
  position: relative;
  width: 19px;
  height: 19px;
  border: 1.8px solid var(--ink);
  border-radius: 50%;
}
.search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  background: var(--ink);
  transform: rotate(45deg);
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: clamp(20px, 3vw, 34px);
  color: var(--ink);
}
.search-box input::placeholder { color: #96978f; }
kbd {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--muted);
  font-family: monospace;
}
.quick-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-family: sans-serif;
  font-size: 13px;
}
.quick-tags button, .tag {
  border: 0;
  border-bottom: 1px solid rgba(159,41,41,.24);
  background: transparent;
  color: var(--red-deep);
  padding: 4px 2px;
}

.featured-section { padding: 72px 0 42px; }
section[id] { scroll-margin-top: 100px; }
.section-heading, .filter-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.section-heading > div, .filter-title > div { display: flex; align-items: center; gap: 14px; }
.section-no {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 12px;
  letter-spacing: .12em;
}
.section-heading h2, .filter-title h2 {
  margin: 0;
  font-size: 27px;
  font-weight: 600;
}
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.featured-card {
  min-height: 190px;
  padding: 24px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.36);
  text-align: left;
  transition: .2s ease;
}
.featured-card:hover { background: #fffdf7; transform: translateY(-2px); }
.featured-card span { color: var(--red); font-family: sans-serif; font-size: 11px; letter-spacing: .12em; }
.featured-card strong { display: block; margin-top: 30px; font-size: 18px; line-height: 1.6; }
.featured-card small { display: block; margin-top: 18px; color: var(--muted); font-family: sans-serif; }

.explore-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 46px; padding: 36px 0 90px; scroll-margin-top: 100px; }
.filters {
  position: sticky;
  top: 20px;
  align-self: start;
  padding-right: 26px;
  border-right: 1px solid var(--line);
}
#filters { scroll-margin-top: 100px; }
.filter-title { align-items: center; }
.filter-title h2 { font-size: 22px; }
.link-button { border: 0; background: none; color: var(--muted); font-size: 12px; }
.field-label { display: block; margin: 18px 0 8px; color: var(--muted); font-family: sans-serif; font-size: 12px; }
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255,255,255,.66);
  padding: 10px 12px;
  color: var(--ink);
}
.facet-values {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 420px;
  overflow: auto;
  margin-top: 12px;
  padding-right: 4px;
}
.facet-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  padding: 8px 8px;
  color: #4d514d;
  text-align: left;
  font-family: sans-serif;
  font-size: 13px;
}
.facet-option:hover { background: rgba(255,255,255,.58); }
.facet-option.selected { border-left-color: var(--red); background: #fffdf7; color: var(--red-deep); }
.facet-option small { color: #9a9d95; }
.active-filter-head { margin-top: 24px; color: var(--muted); font: 12px sans-serif; }
.active-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.filter-chip {
  border: 1px solid rgba(159,41,41,.28);
  border-radius: 99px;
  background: rgba(159,41,41,.06);
  color: var(--red-deep);
  padding: 6px 10px;
  font: 12px sans-serif;
}
.filter-chip span { margin-left: 5px; }

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.result-toolbar > div { display: flex; align-items: center; gap: 12px; }
.result-toolbar label { color: var(--muted); font: 12px sans-serif; }
.result-toolbar select { width: auto; margin-left: 6px; padding: 7px 28px 7px 9px; }
.status { color: var(--muted); font: 12px sans-serif; }
.status.error { color: var(--red); }
.results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); margin-top: 1px; }
.result-card {
  min-height: 330px;
  padding: 26px;
  background: var(--card);
  display: flex;
  flex-direction: column;
}
.card-top { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font: 11px sans-serif; }
.badge { display: inline-block; border: 1px solid var(--line); padding: 3px 7px; margin-right: 5px; color: #555; }
.badge.type { border-color: rgba(159,41,41,.25); color: var(--red-deep); }
.badge.tier { background: rgba(176,138,74,.08); }
.badge.qa { background: var(--red); color: #fff8e9; border-color: var(--red); }
.result-card h2 { margin: 30px 0 14px; font-size: 21px; line-height: 1.55; }
.title-link { border: 0; background: none; padding: 0; text-align: left; color: inherit; font: inherit; }
.title-link:hover { color: var(--red); }
.excerpt {
  margin: 0;
  color: #646861;
  font-family: "Noto Sans SC", "Source Han Sans SC", sans-serif;
  font-size: 13px;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.excerpt-link {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.excerpt-link:hover .excerpt { color: var(--red-deep); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tag { font: 12px sans-serif; }
.version { color: var(--gold); font: 11px sans-serif; align-self: center; }
.version-link {
  border: 0;
  border-bottom: 1px solid rgba(176,138,74,.34);
  background: transparent;
  color: #8c6935;
  padding: 2px 0;
  font: 11px sans-serif;
}
.latest-badge {
  display: inline-block;
  margin-left: 5px;
  color: var(--red);
  font: 10px sans-serif;
}
.merged-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(176,138,74,.11);
  color: #8c6935;
  font: 10px sans-serif;
}
.card-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--muted);
  font: 11px sans-serif;
}
.source-link {
  max-width: 52%;
  overflow: hidden;
  border: 0;
  border-bottom: 1px dotted rgba(92,74,47,.35);
  background: transparent;
  color: var(--muted);
  padding: 1px 0;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-link:hover { color: var(--red); border-bottom-color: var(--red); }
.text-action { margin-left: auto; border: 0; background: none; color: var(--red); }
.load-more {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.56);
  color: var(--red-deep);
}
.empty-state { grid-column: 1 / -1; padding: 80px 20px; text-align: center; background: var(--card); color: var(--muted); }
.muted { color: var(--muted); font-size: 12px; }

.article-modal {
  width: min(1320px, calc(100% - 40px));
  height: min(900px, calc(100vh - 40px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  background: transparent;
}
.article-modal:not([open]),
.source-modal:not([open]),
.version-modal:not([open]) { display: none; }
.source-modal,
.version-modal {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  background: transparent;
}
.source-modal::backdrop,
.version-modal::backdrop { background: rgba(27, 29, 27, .64); backdrop-filter: blur(5px); }
.source-modal .modal-shell,
.version-modal .modal-shell {
  height: auto;
  max-height: calc(100vh - 40px);
  display: block;
  overflow: auto;
}
.source-list { padding: 12px 24px 28px; }
.source-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 17px 8px;
  border-bottom: 1px solid var(--line);
}
.source-index { color: var(--gold); font: 12px Georgia, serif; }
.source-item strong { display: block; font-size: 16px; }
.source-item small {
  display: block;
  max-width: 470px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font: 10px/1.5 sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-actions { display: flex; align-items: center; gap: 12px; font: 11px sans-serif; }
.source-actions a,
.source-actions button {
  border: 0;
  border-bottom: 1px solid rgba(159,41,41,.24);
  background: transparent;
  color: var(--red);
  padding: 0 0 1px;
  font: inherit;
  white-space: nowrap;
}
.source-unavailable {
  color: var(--muted);
  white-space: nowrap;
}
.version-list { padding: 12px 24px 28px; }
.version-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 18px 8px;
  color: var(--ink);
  text-align: left;
}
.version-item:hover { background: rgba(255,255,255,.64); }
.version-no { color: var(--gold); font: 12px Georgia, serif; }
.version-item strong { display: block; font-size: 17px; line-height: 1.55; }
.version-item small { display: block; margin-top: 5px; color: var(--muted); font: 11px sans-serif; }
.version-item em { color: var(--red); font: normal 11px sans-serif; white-space: nowrap; }
.version-item em.history { color: var(--muted); }
.article-modal::backdrop { background: rgba(27, 29, 27, .64); backdrop-filter: blur(5px); }
.modal-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.62), transparent 170px),
    #fbf8ef;
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: 0 30px 100px rgba(0,0,0,.3);
}
.reader-header {
  flex: 0 0 auto;
  background: rgba(250, 247, 239, .96);
  border-bottom: 1px solid var(--line);
}
.reader-kicker {
  padding: 18px 38px 0;
  color: var(--red);
  font: 700 10px sans-serif;
  letter-spacing: .2em;
}
.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 30px;
  padding: 12px 38px 18px;
}
.modal-head h2 { margin: 0; font-size: clamp(24px, 3vw, 36px); line-height: 1.45; letter-spacing: -.02em; }
.reader-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.reader-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.48);
  padding: 5px 9px;
  color: var(--muted);
  font: 11px sans-serif;
}
.reader-controls { display: flex; align-items: center; gap: 5px; }
.reader-size {
  min-width: 37px;
  height: 34px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.55);
  color: #555;
  font: 12px sans-serif;
}
.close-button { border: 0; background: none; font-size: 30px; line-height: 1; color: #666; }
.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 48px;
  padding: 8px 38px;
  border-top: 1px solid var(--line);
}
.reader-stats { color: var(--muted); font: 11px sans-serif; }
.modal-actions { display: flex; gap: 16px; font: 12px sans-serif; }
.modal-actions a,
.modal-actions button { color: var(--red); }
.modal-actions a[hidden],
.modal-actions button[hidden] { display: none; }
.modal-source-button {
  border: 0;
  border-bottom: 1px solid rgba(159,41,41,.3);
  background: transparent;
  padding: 0;
  font: inherit;
}
.modal-version-button {
  border: 0;
  border-bottom: 1px solid rgba(176,138,74,.35);
  background: transparent;
  color: #8c6935;
  padding: 0;
  font: inherit;
}
.article-body {
  --reader-size: 17px;
  flex: 1 1 auto;
  min-height: 0;
  max-width: 1040px;
  width: calc(100% - 96px);
  margin: 0 auto;
  overflow: auto;
  padding: 40px 0 80px;
  color: #282b28;
  font: var(--reader-size)/2.05 "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
}
.article-body p { margin: 0 0 1.15em; text-align: justify; }
.article-body h3 {
  margin: 2em 0 .9em;
  padding-top: 1em;
  border-top: 1px solid var(--line);
  color: var(--red-deep);
  font-size: 1.22em;
  letter-spacing: .03em;
}
.article-body .clause-number {
  display: inline-block;
  min-width: 1.6em;
  margin-right: .35em;
  color: var(--red);
  font-weight: 700;
}
.qa-block {
  margin: 0 0 1.4em;
  padding: 22px 24px;
  border-left: 3px solid var(--gold);
  background: rgba(255,255,255,.55);
}
.qa-block.answer { border-left-color: var(--red); }
.qa-label {
  display: block;
  margin-bottom: 8px;
  color: var(--red-deep);
  font: 700 12px sans-serif;
  letter-spacing: .12em;
}
.reader-empty { color: var(--muted); text-align: center; padding: 5rem 0; }
.result-scroll::-webkit-scrollbar,
.facet-values::-webkit-scrollbar,
.featured-scroll::-webkit-scrollbar,
.article-body::-webkit-scrollbar {
  width: 6px;
}
.result-scroll::-webkit-scrollbar-thumb,
.facet-values::-webkit-scrollbar-thumb,
.featured-scroll::-webkit-scrollbar-thumb,
.article-body::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(159, 41, 41, .28);
}
.result-scroll::-webkit-scrollbar-track,
.facet-values::-webkit-scrollbar-track,
.featured-scroll::-webkit-scrollbar-track,
.article-body::-webkit-scrollbar-track {
  background: transparent;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1420px, calc(100% - 64px));
  margin: 0 auto;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 12px sans-serif;
}

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explore-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
  .results { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .header-inner, main, footer { width: min(100% - 28px, 1420px); }
  .header-inner { padding: 12px 0; }
  .brand { gap: 9px; }
  .brand-mark { width: 36px; height: 36px; font-size: 20px; }
  .brand strong { font-size: 16px; }
  .brand small { display: none; }
  nav { gap: 0; }
  nav a { padding: 7px 7px; font-size: 12px; }
  .hero { padding: 44px 0 34px; }
  .hero h1 { font-size: clamp(42px, 14vw, 68px); }
  .dashboard-heading { display: block; }
  .dashboard-heading p { margin-top: 8px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid article { min-height: 118px; padding: 18px 14px; }
  .overview-grid { gap: 10px; }
  .overview-card { padding: 20px 16px; }
  .type-bar { grid-template-columns: 74px 1fr 46px; }
  .search-section { padding-top: 42px; }
  .search-panel { padding: 22px 16px; }
  .featured-grid { grid-template-columns: 1fr; }
  .featured-card { min-height: 150px; }
  .explore-layout { display: block; }
  .filters { position: static; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 25px; margin-bottom: 28px; }
  .facet-values { max-height: 230px; }
  .result-toolbar { align-items: start; }
  .result-toolbar > div { align-items: start; flex-wrap: wrap; }
  .result-card { min-height: auto; padding: 22px; }
  .article-modal { width: calc(100% - 16px); height: calc(100vh - 16px); max-height: calc(100vh - 16px); }
  .reader-kicker { padding: 14px 18px 0; }
  .modal-head { padding: 10px 18px 15px; gap: 10px; }
  .reader-controls { gap: 2px; }
  .reader-size { min-width: 31px; height: 30px; }
  .reader-toolbar { padding: 8px 18px; align-items: start; flex-direction: column; gap: 8px; }
  .article-body { width: calc(100% - 36px); padding: 28px 0 60px; }
  footer { display: block; }
  footer span { display: block; margin-top: 8px; }
}

/* Single-screen application layout */
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  padding-top: 76px;
  overscroll-behavior: none;
}
.site-header { height: 76px; }
.header-inner { height: 100%; padding: 0; }
.main-nav { gap: 5px; }
.nav-item {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 11px 16px;
  color: #5e625d;
  font-size: 14px;
}
.nav-item::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 4px;
  height: 2px;
  background: var(--red);
  opacity: 0;
  transform: scaleX(.35);
  transition: .18s ease;
}
.nav-item:hover, .nav-item.active { background: transparent; color: var(--red-deep); }
.nav-item.active::after { opacity: 1; transform: scaleX(1); }

.app-main {
  width: min(1460px, calc(100% - 64px));
  height: calc(100dvh - 76px);
  margin: 0 auto;
  overflow: hidden;
}
.view-panel { display: none; width: 100%; height: 100%; overflow: hidden; }
.view-panel.active { display: block; }

.home-shell {
  display: grid;
  grid-template-columns: minmax(380px, .92fr) minmax(520px, 1.2fr);
  grid-template-rows: minmax(300px, 1.15fr) minmax(250px, .85fr);
  gap: 18px;
  height: 100%;
  padding: 34px 0 28px;
  overflow: hidden;
}
.home-shell .hero-copy {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  padding-right: 34px;
}
.home-shell .hero h1, .home-shell h1 {
  font-size: clamp(42px, 4.2vw, 64px);
}
.home-shell .hero-intro { margin-top: 24px; }
.home-shell .metric-grid {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-self: stretch;
}
.metric-grid article { min-height: 0; padding: clamp(15px, 2vw, 25px); }
.metric-grid strong { font-size: clamp(27px, 3.2vw, 45px); }
.metric-grid small { line-height: 1.45; }
.type-panel { grid-column: 1; grid-row: 2; min-height: 0; }
.scope-panel { grid-column: 2; grid-row: 2; min-height: 0; }
.home-shell .overview-card { overflow: hidden; padding: 22px 25px; }
.home-shell .overview-card h3 { margin-bottom: 14px; }
.home-shell .type-bars { gap: 7px; }

.search-toolbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 16px 0 15px;
  border-bottom: 1px solid var(--line);
}
.search-toolbar .search-box { padding: 4px 4px 9px; }
.search-toolbar .search-box input { font-size: clamp(18px, 2.2vw, 28px); }
.search-toolbar .quick-tags { margin-top: 0; justify-content: end; }
.view-panel[data-panel="search"] { display: none; }
.view-panel[data-panel="search"].active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.view-panel .explore-layout {
  min-height: 0;
  height: 100%;
  padding: 20px 0 22px;
  gap: 28px;
}
.view-panel .filters {
  position: static;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-right: 24px;
  overflow: hidden;
}
.filters.focus-flash { animation: filter-flash .8s ease; }
@keyframes filter-flash {
  0%, 100% { background: transparent; }
  35% { background: rgba(159,41,41,.08); }
}
.view-panel .facet-values { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
.result-area { min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.result-toolbar { flex: 0 0 auto; }
.result-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 8px 24px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(159,41,41,.32) transparent;
}
.results { gap: 12px; background: transparent; margin-top: 0; }
.result-card {
  min-height: 210px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(48,39,26,.035);
}
.result-card h2 { margin: 18px 0 10px; font-size: 18px; line-height: 1.5; }
.excerpt { -webkit-line-clamp: 3; font-size: 12px; line-height: 1.7; }
.tags { margin-top: 12px; }
.card-foot { padding-top: 14px; }

.view-panel[data-panel="featured"].active { display: flex; flex-direction: column; }
.panel-heading {
  flex: 0 0 auto;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 18px;
  border-bottom: 1px solid var(--line);
}
.panel-heading > div { display: flex; align-items: center; gap: 14px; }
.panel-heading h2 { margin: 0; font-size: 28px; }
.panel-heading p { margin: 0; color: var(--muted); font: 12px sans-serif; }
.featured-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 8px 30px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(159,41,41,.32) transparent;
}
.featured-scroll .featured-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border: 0;
}
.featured-card {
  min-height: 188px;
  border: 1px solid var(--line);
  border-radius: 1px;
}
.featured-card strong { margin-top: 22px; font-size: 17px; }
.featured-card small { margin-top: 13px; }

@media (min-width: 1400px) and (max-height: 850px) {
  .home-shell { padding-top: 22px; padding-bottom: 20px; }
  .home-shell h1 { font-size: 58px; }
  .hero-intro { font-size: 14px; line-height: 1.7; }
  .metric-grid strong { font-size: 30px; }
}
@media (max-width: 1050px) {
  .home-shell {
    grid-template-columns: minmax(300px, .8fr) minmax(440px, 1.2fr);
    grid-template-rows: minmax(300px, 1fr) minmax(220px, .7fr);
  }
  .home-shell .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); }
  .search-toolbar { grid-template-columns: 1fr; gap: 8px; }
  .search-toolbar .quick-tags { justify-content: start; }
  .featured-scroll .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { padding-top: 60px; }
  .site-header { height: 60px; }
  .app-main { height: calc(100dvh - 60px); }
  .nav-item { padding: 9px 6px; font-size: 11px; }
  .home-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1.2fr .8fr;
    gap: 10px;
    padding: 20px 0 14px;
    overflow: hidden;
  }
  .home-shell .hero-copy { grid-column: 1; grid-row: 1; padding-right: 0; }
  .home-shell h1 { font-size: clamp(36px, 11vw, 56px); }
  .hero-intro { margin-top: 13px !important; font-size: 12px !important; line-height: 1.6 !important; }
  .hero-note { display: none; }
  .home-shell .metric-grid {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  .metric-grid article { min-height: 0; padding: 9px 7px; }
  .metric-grid strong { font-size: 20px; }
  .metric-grid span { font-size: 11px; margin-top: 5px; }
  .metric-grid small { display: none; }
  .type-panel { grid-column: 1; grid-row: 3; }
  .scope-panel { display: none; }
  .type-bar { grid-template-columns: 62px 1fr 38px; gap: 7px; }
  .view-panel .explore-layout { display: grid; grid-template-rows: 230px minmax(0, 1fr); grid-template-columns: 1fr; gap: 12px; padding-top: 12px; }
  .view-panel .filters { height: 230px; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; }
  .filter-title { margin-bottom: 8px; }
  .field-label { margin-top: 7px; }
  .facet-values { max-height: 105px; }
  .active-filter-head { display: none; }
  .active-filters { margin-top: 5px; }
  .featured-scroll .featured-grid { grid-template-columns: 1fr; }
}

/* Four-view layout and compact dashboard */
.home-shell {
  grid-template-columns: minmax(400px, 1fr) minmax(600px, 1.15fr);
  grid-template-rows: 1fr;
  align-items: stretch;
  gap: clamp(34px, 5vw, 78px);
  padding: clamp(22px, 4vh, 48px) 0;
}
.home-shell .hero-copy {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 0;
}
.home-insights {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  align-self: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.home-insights .metric-grid {
  grid-column: auto;
  grid-row: auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(108px, 1fr));
  border-color: rgba(92, 74, 47, .14);
}
.home-insights .metric-grid article {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 108px;
  background: rgba(255, 253, 247, .7);
}
.insight-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.insight-actions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.42);
  padding: 14px 16px;
  color: var(--ink);
  text-align: left;
}
.insight-actions button:hover { background: #fffdf8; border-color: rgba(159,41,41,.25); }
.insight-actions span { font-size: 14px; }
.insight-actions small { color: var(--muted); font: 11px sans-serif; }

.search-page {
  height: 100%;
  display: block;
  overflow: hidden;
}
.search-only {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(1020px, 88%);
  margin: 0 auto;
  padding: clamp(24px, 4vh, 54px) 0 28px;
}
.search-only .eyebrow { margin-bottom: 16px; }
.search-box-main {
  grid-template-columns: 34px 1fr auto;
  border-bottom-width: 1px;
  padding: 18px 2px 20px;
}
.search-box-main input { font-size: clamp(28px, 4vw, 54px); }
.search-scopes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  font: 12px sans-serif;
}
.search-scopes > span {
  margin-right: 4px;
  color: var(--muted);
  letter-spacing: .08em;
}
.scope-chip,
.scope-all {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.42);
  padding: 7px 13px;
  color: #555;
  font: 12px sans-serif;
}
.scope-chip:hover,
.scope-all:hover { border-color: rgba(159,41,41,.34); color: var(--red); }
.scope-chip.selected {
  border-color: var(--red);
  background: rgba(159,41,41,.07);
  color: var(--red-deep);
}
.scope-all {
  margin-left: 2px;
  border-style: dashed;
}
.scope-all.selected {
  border-style: solid;
  border-color: var(--gold);
  color: #8c6935;
}
.scope-chip:disabled,
.scope-all:disabled,
.region-chip:disabled,
.news-site-tag:disabled,
.party-only-toggle input:disabled {
  cursor: wait;
  opacity: .45;
}
.search-hint {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  color: var(--muted);
  font: 11px sans-serif;
}
.page-results-scroll {
  display: none;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 8px 30px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(159,41,41,.28) transparent;
}
.search-page.has-results {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.search-page.has-results .search-only {
  height: auto;
  padding: 18px 0 16px;
}
.search-page.has-results .page-results-scroll { display: block; }
.view-panel[data-panel="search"].active { display: block; }
.search-results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.filter-page {
  height: 100%;
  display: grid;
  grid-template-columns: 250px minmax(300px, .8fr) minmax(400px, 1.2fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 22px;
  padding: 24px 0 22px;
  overflow: hidden;
}
.view-panel[data-panel="filter"].active { display: block; }
.filter-builder {
  position: static;
  height: 100%;
  min-height: 0;
  padding: 0 22px 0 0;
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.filter-title h2, .filter-title .link-button { white-space: nowrap; }
.filter-rule {
  margin: -8px 0 8px;
  color: var(--muted);
  font: 11px sans-serif;
}
.facet-groups {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 16px;
}
.facet-group-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  padding: 9px 9px;
  color: #555a55;
  text-align: left;
  font: 13px sans-serif;
}
.facet-group-item small { color: var(--muted); font-size: 10px; }
.facet-group-item:hover { background: rgba(255,255,255,.52); }
.facet-group-item.selected { border-left-color: var(--red); background: rgba(255,253,247,.86); color: var(--red-deep); }
.facet-result-area {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.facet-current-head {
  flex: 0 0 auto;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.facet-current-head > div { display: flex; align-items: center; gap: 12px; }
.facet-current-head h2 { margin: 0; font-size: 22px; }
.facet-values-large {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 7px;
  margin-top: 14px;
  padding: 0 6px 20px 0;
  overflow-y: auto;
}
.facet-values-large .facet-option {
  border: 1px solid var(--line);
  border-left: 2px solid transparent;
  background: rgba(255,255,255,.36);
  min-height: 42px;
}
.facet-values-large .facet-option.selected {
  border-color: rgba(159,41,41,.3);
  border-left-color: var(--red);
  background: #fffdf8;
}
.filter-result-area { height: 100%; }
.filter-results { grid-template-columns: 1fr; }

.view-panel[data-panel="regulations"].active { display: block; }
.regulations-page {
  min-height: calc(100vh - 76px);
  padding: 26px 0 44px;
}
.regulations-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.regulations-head > div:first-child { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.regulations-head h2 { margin: 0; font-size: 30px; }
.regulations-head p { margin: 0; color: var(--muted); font: 12px sans-serif; }
.party-only-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(159,41,41,.24);
  background: rgba(255,255,255,.42);
  padding: 5px 9px;
  color: var(--red-deep);
  font: 11px sans-serif;
  cursor: pointer;
}
.party-only-toggle input { accent-color: var(--red); }
.regulations-count { color: var(--red-deep); font: 22px Georgia, serif; }
.regulation-categories {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 0 9px;
}
.index-loading-text {
  width: 100%;
  padding: 18px 2px;
  color: var(--red-deep);
}
.index-loading-text strong {
  display: block;
  font: 20px Georgia, "Noto Serif SC", serif;
}
.index-loading-text small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font: 11px sans-serif;
}
.regulation-category {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.46);
  color: var(--ink);
  white-space: nowrap;
}
.regulation-category:hover {
  border-color: rgba(159,41,41,.35);
  background: #fffdf8;
  transform: translateY(-1px);
}
.regulation-category.selected {
  border-color: rgba(159,41,41,.55);
  box-shadow: inset 3px 0 0 var(--red);
}
.regulation-category span { font-size: 12px; font-weight: 600; }
.regulation-category strong {
  color: var(--red-deep);
  font: 10px Georgia, serif;
}
.regulation-regions,
.geo-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px 0 12px;
}
.regulation-regions[hidden],
.geo-filter-bar[hidden],
.regulation-results-area[hidden] { display: none; }
.regulation-region-label {
  flex: 0 0 auto;
  margin-right: 3px;
  color: var(--muted);
  font: 11px sans-serif;
}
.region-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(92,74,47,.16);
  background: transparent;
  padding: 5px 8px;
  color: #666;
  font: 11px sans-serif;
}
.region-chip small { color: var(--muted); font-size: 9px; }
.region-chip:hover { border-color: rgba(159,41,41,.34); color: var(--red); }
.region-chip.selected {
  border-color: rgba(159,41,41,.5);
  background: rgba(159,41,41,.07);
  color: var(--red-deep);
}
.regulation-results-area {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.regulation-result-title { display: flex; align-items: center; gap: 18px; }
.regulation-result-title > div { display: flex; align-items: baseline; gap: 12px; }
.regulation-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.view-panel[data-panel="experience"].active,
.view-panel[data-panel="theory"].active { display: block; }
.knowledge-page {
  min-height: calc(100vh - 76px);
  padding: 26px 0 46px;
}
.knowledge-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.knowledge-head > div { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.knowledge-head h2 { margin: 0; font-size: 30px; }
.knowledge-head p { margin: 0; color: var(--muted); font: 12px sans-serif; }
.knowledge-head > strong { color: var(--red-deep); font: 20px Georgia, serif; }
.knowledge-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}
.knowledge-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.view-panel[data-panel="news"].active { display: block; }
.news-page {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  padding: 24px 0 20px;
  overflow: hidden;
}
.news-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.news-heading > div { display: flex; align-items: baseline; gap: 14px; }
.news-heading h2 { margin: 0; font-size: 28px; }
.news-heading p { margin: 0; color: var(--muted); font: 12px sans-serif; }
.news-search {
  display: grid;
  grid-template-columns: 20px minmax(220px, 360px);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--ink);
  padding: 8px 3px 10px;
}
.news-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 15px; }
.news-search .search-icon { width: 15px; height: 15px; }
.news-site-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 13px 0 5px;
  border-bottom: 1px solid var(--line);
}
.news-site-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.4);
  padding: 6px 10px;
  color: #555;
  font: 11px sans-serif;
}
.news-site-tag small {
  color: var(--muted);
  font: 9px sans-serif;
}
.news-site-tag:hover { border-color: rgba(159,41,41,.35); color: var(--red); }
.news-site-tag.selected {
  border-color: rgba(159,41,41,.55);
  background: rgba(159,41,41,.07);
  color: var(--red-deep);
}
.news-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 12px 8px 28px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(159,41,41,.28) transparent;
}
.news-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.home-info-modal {
  width: min(820px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  background: transparent;
}
.home-info-modal:not([open]) { display: none; }
.home-info-modal::backdrop { background: rgba(27, 29, 27, .58); backdrop-filter: blur(5px); }
.home-info-modal .modal-shell {
  height: auto;
  max-height: calc(100vh - 40px);
  display: block;
  overflow-y: auto;
}
.home-info-body { padding: 24px 34px 34px; }
.home-info-body p { color: #5e635d; line-height: 1.85; }
.type-bars-large { gap: 10px; }
.type-bars-large .type-bar { grid-template-columns: 134px 1fr 72px; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 22px 0;
  border: 1px solid var(--line);
  background: var(--line);
}
.info-grid div { background: #fffdf8; padding: 16px; }
.info-grid strong { display: block; color: var(--red-deep); font: 24px Georgia, serif; }
.info-grid span { display: block; margin-top: 5px; color: var(--muted); font: 11px sans-serif; }

@media (max-width: 1100px) {
  .home-shell { grid-template-columns: .8fr 1.2fr; gap: 28px; }
  .home-insights .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(84px, 1fr)); }
  .home-insights .metric-grid small { display: none; }
  .search-results { grid-template-columns: 1fr; }
  .filter-page { grid-template-columns: 220px minmax(250px, .75fr) minmax(340px, 1.25fr); gap: 14px; }
  .news-results { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  body { padding-top: 60px; }
  .app-main { height: calc(100dvh - 60px); }
  .home-shell { display: block; padding: 24px 0 12px; overflow-y: auto; }
  .home-shell .hero-copy { padding: 0 0 26px; }
  .home-insights .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(78px, 1fr)); }
  .metric-grid article { padding: 9px 6px; }
  .metric-grid strong { font-size: 21px; }
  .metric-grid span { font-size: 10px; margin-top: 5px; }
  .insight-actions { grid-template-columns: 1fr; }
  .insight-actions button { padding: 10px 12px; }
  .search-page { grid-template-rows: minmax(220px, .7fr) minmax(0, 1.3fr); }
  .search-only { width: calc(100% - 12px); }
  .search-box-main input { font-size: 24px; }
  .search-scopes { margin-top: 11px; gap: 6px; }
  .scope-chip, .scope-all { padding: 6px 9px; }
  .filter-page {
    display: block;
    height: 100%;
    overflow-y: auto;
    padding: 18px 0;
  }
  .filter-builder { height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 16px; overflow: visible; }
  .facet-groups { display: grid; grid-template-columns: repeat(3, 1fr); }
  .facet-result-area { height: auto; margin-top: 16px; overflow: visible; }
  .facet-values-large { max-height: 210px; }
  .filter-result-area { height: auto; min-height: 420px; margin-top: 16px; }
  .reader-kicker { padding: 12px 18px 0; }
  .modal-head { padding: 8px 18px 12px; }
  .reader-toolbar { padding: 8px 18px; }
  .article-body { width: calc(100% - 36px); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .news-page { display: flex; flex-direction: column; padding-top: 18px; }
  .news-heading { display: block; }
  .news-heading p { margin-top: 6px; }
  .news-search { margin-top: 14px; grid-template-columns: 18px 1fr; }
  .news-scroll { flex: 1 1 auto; }
}

/* Home is viewport-locked; all other views scroll naturally at page level. */
html, body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
body {
  min-height: 100vh;
  padding-top: 76px;
}
body.home-view {
  height: 100vh;
  min-height: 100vh;
  overflow-y: hidden;
}
.app-main {
  height: auto;
  min-height: calc(100vh - 76px);
  overflow: visible;
}
body.home-view .app-main {
  height: calc(100vh - 76px);
  min-height: 0;
  overflow: hidden;
}
.view-panel {
  height: auto;
  min-height: calc(100vh - 76px);
  overflow: visible;
}
.view-panel[data-panel="home"] {
  height: calc(100vh - 76px);
  min-height: 0;
  overflow: hidden;
}
.view-panel[data-panel="search"].active,
.view-panel[data-panel="filter"].active,
.view-panel[data-panel="news"].active {
  display: block;
  height: auto;
  min-height: calc(100vh - 76px);
  overflow: visible;
}
body:not(.home-view) .search-page {
  height: auto;
  min-height: calc(100vh - 76px);
  display: block;
  overflow: visible;
}
body:not(.home-view) .search-only {
  min-height: calc(100vh - 76px);
  height: auto;
}
body:not(.home-view) .search-page.has-results .search-only {
  min-height: auto;
  padding-top: 42px;
}
body:not(.home-view) .page-results-scroll {
  overflow: visible;
  min-height: 0;
}
body:not(.home-view) .search-page.has-results .page-results-scroll {
  display: block;
}
body:not(.home-view) .filter-page {
  height: auto;
  min-height: calc(100vh - 76px);
  overflow: visible;
  align-items: start;
}
body:not(.home-view) .filter-builder,
body:not(.home-view) .facet-result-area,
body:not(.home-view) .filter-result-area {
  height: auto;
  min-height: 0;
  overflow: visible;
}
body:not(.home-view) .facet-values-large {
  max-height: none;
  overflow: visible;
}
body:not(.home-view) .result-scroll {
  overflow: visible;
}
body:not(.home-view) .news-page {
  height: auto;
  min-height: calc(100vh - 76px);
  overflow: visible;
}
body:not(.home-view) .news-scroll {
  overflow: visible;
}
body:not(.home-view) .load-more {
  margin-bottom: 48px;
}

@media (max-width: 780px) {
  body { padding-top: 60px; }
  body.home-view { height: 100vh; }
  .app-main { min-height: calc(100vh - 60px); }
  body.home-view .app-main,
  .view-panel[data-panel="home"] { height: calc(100vh - 60px); }
  .view-panel,
  .view-panel[data-panel="search"].active,
  .view-panel[data-panel="filter"].active,
  .view-panel[data-panel="regulations"].active,
  .view-panel[data-panel="experience"].active,
  .view-panel[data-panel="theory"].active,
  .view-panel[data-panel="news"].active,
  body:not(.home-view) .search-page,
  body:not(.home-view) .news-page { min-height: calc(100vh - 60px); }
  body:not(.home-view) .search-only { min-height: calc(100vh - 60px); }
}

@media (max-width: 900px) {
  .regulation-results { grid-template-columns: 1fr; }
  .knowledge-results { grid-template-columns: 1fr; }
  .regulations-head { align-items: start; flex-direction: column; }
  .knowledge-head { align-items: start; flex-direction: column; }
}
