:root {
  --ink: #171717;
  --muted: #5a6068;
  --line: #d8dde2;
  --paper: #fbfaf5;
  --panel: #ffffff;
  --bjp: #ff671f;
  --rss: #8f3200;
  --danger: #b3261e;
  --press: #215c5c;
  --education: #3455a4;
  --security: #46306f;
  --shadow: 0 16px 38px rgba(24, 31, 38, 0.08);
  --header-height: 52px;
}

.shell-loader-status {
  max-width: 720px;
  margin: 15vh auto;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}

.shell-loader-status.is-error {
  color: var(--danger);
}

.no-script-message {
  margin: 0;
  padding: 12px 18px;
  color: #5a2b00;
  background: #fff4d6;
  border-bottom: 1px solid #e5c57c;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--header-height);
  height: var(--header-height);
  padding: 3px 14px;
  background: rgba(251, 250, 245, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  width: 24px;
  height: 17px;
  display: block;
  flex: 0 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, #ff671f 0 33.33%, #ffffff 33.33% 66.66%, #046a38 66.66% 100%);
  border: 1px solid var(--ink);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75);
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #06038d 0 1px, transparent 1.5px);
  border: 1px solid #06038d;
  border-radius: 999px;
}

.brand-short { display: none; }

.topnav {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 99px;
}

.topnav a svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.topnav a:hover svg {
  transform: scale(1.1);
}

.topnav a:hover,
.topnav a:focus-visible {
  background: rgba(23, 23, 23, 0.05);
  color: var(--ink);
}

.topnav a.active-route {
  background: rgba(255, 103, 31, 0.09) !important;
  color: var(--bjp) !important;
}

.nav-sound-button,
.side-sound-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 42px;
  min-width: 42px;
  padding: 8px 11px;
  border: 1px solid #c9d1d8;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.nav-sound-button::before,
.side-sound-button::before {
  content: "\266A";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.nav-sound-button:hover,
.nav-sound-button:focus-visible,
.side-sound-button:hover,
.side-sound-button:focus-visible {
  border-color: var(--bjp);
  background: #fff8ef;
  color: var(--ink);
  transform: translateY(-1px);
}

.nav-sound-button.is-on,
.side-sound-button.is-on {
  background: #0f5132;
  border-color: #0f5132;
  color: #fff;
}

.nav-sound-button.is-on::before,
.side-sound-button.is-on::before {
  background: #fff;
  color: #0f5132;
  animation: sound-pulse 1.1s ease-in-out infinite;
}

.record-menu {
  position: relative;
  display: none;
}

.record-menu summary {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  background: #ffffff;
  border: 1px solid #c9d1d8;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.filter-summary-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 103, 31, .28);
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.record-menu summary::-webkit-details-marker {
  display: none;
}

.record-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  display: grid;
  width: min(220px, calc(100vw - 20px));
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.record-menu:not([open]) .record-menu-panel {
  display: none;
}

.record-menu-panel a {
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.record-menu-panel a:hover,
.record-menu-panel a:focus-visible {
  background: rgba(255, 103, 31, 0.1);
  color: var(--rss);
}

.route-page:not(.is-active) {
  display: none !important;
}

.route-page.is-active {
  display: block;
}

#timeline {
  scroll-margin-top: 72px;
}

.hero.route-page.is-active {
  display: grid;
}

.hero {
  display: grid;
  gap: 0;
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 103, 31, 0.12), rgba(19, 136, 8, 0.07)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.16)),
    repeating-linear-gradient(90deg, rgba(23, 23, 23, 0.035) 0 1px, transparent 1px 20px);
}

.hero-copy {
  max-width: 960px;
}

.eyebrow,
.label {
  display: block;
  margin: 0 0 5px;
  color: var(--rss);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: Newsreader, Georgia, serif;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 8px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 0.96;
}

h2 {
  margin-bottom: 8px;
  font-size: 34px;
  line-height: 1;
}

.lede {
  max-width: 920px;
  margin-bottom: 0;
  color: #313131;
  font-size: 15.5px;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-actions a,
.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.hero-actions a:last-child,
.text-button {
  background: transparent;
  color: var(--ink);
}

.quick-panel {
  display: grid;
  gap: 12px;
}

.tenure,
.mini-grid > div,
.indicator,
.event-card,
.source-item,
.support-grid article,
.submission-form,
.draft-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tenure {
  padding: 14px 16px;
}

.tenure strong {
  display: block;
  font-size: 26px;
  line-height: 1.05;
}

.tenure #tenureSubtitle,
.tenure #bjpTotalSubtitle,
.mini-grid span:last-child {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.tenure-left {
  display: block;
  margin-top: 8px;
  color: #2f6b42;
  font-size: 13px;
  font-weight: 800;
}

.tenure-source {
  display: inline-block;
  margin-top: 8px;
  color: var(--press);
  font-size: 12px;
  font-weight: 800;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mini-grid > div {
  min-height: 96px;
  padding: 12px 14px;
}

.mini-grid strong {
  display: block;
  margin-bottom: 6px;
  font-size: 20px;
  line-height: 1.1;
}

.toolbar-band {
  padding: 10px 16px;
  background: #f2efe8;
  border-bottom: 1px solid var(--line);
  overflow: visible;
}

.toolbar {
  display: grid;
  gap: 10px;
}

.advanced-filters {
  border: 1px solid #c9d1d8;
  background: #ffffff;
  border-radius: 8px;
}

.advanced-filters summary {
  min-height: 42px;
  padding: 9px 11px;
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  list-style-position: inside;
  user-select: none;
}

.advanced-filters summary:hover {
  background: #f8f7f5;
}

.advanced-filter-grid {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #c9d1d8;
  border-radius: 6px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--bjp);
  box-shadow: 0 0 0 3px rgba(255, 103, 31, 0.16);
}

.year-rail {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
}

.year-rail::-webkit-scrollbar {
  display: none;
}

.year-pill {
  flex: 0 0 auto;
  min-width: 52px;
  min-height: 44px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid #b7c0c8;
  border-radius: 999px;
  color: #36302b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.category-quick-filters {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  overflow-x: auto;
  padding: 1px 0 3px;
  scrollbar-width: none;
}

.category-quick-filters::-webkit-scrollbar { display: none; }

.category-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  min-height: 44px;
  padding: 5px 12px;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.category-chip:hover,
.category-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.year-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fffdf8;
}

.section,
.submit-band {
  padding: 32px 16px;
}

.home-recent {
  padding: 28px 16px;
}

.home-recent-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.recent-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.recent-row span {
  color: var(--rss);
  font-weight: 900;
}

.recent-row strong {
  font-size: 15px;
  line-height: 1.25;
}

.recent-row em {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.section-head {
  max-width: 720px;
  margin-bottom: 18px;
}

.section-head p:not(.eyebrow) {
  color: var(--muted);
}

.indicator-grid {
  display: grid;
  gap: 14px;
}

.about-section {
  background: #fff8ed;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.support-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.support-grid article {
  flex: 1 1 260px;
  padding: 16px;
}

.support-grid span {
  color: var(--rss);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.support-grid h3 {
  margin: 8px 0 6px;
  font-size: 19px;
}

.support-grid p {
  margin: 0 0 12px;
  color: #343940;
}

.about-quote {
  max-width: 780px;
  margin: 22px auto 0;
  padding: 20px 22px;
  border-left: 4px solid var(--saffron);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.about-quote p {
  margin: 0;
  font-family: Newsreader, Georgia, serif;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.1;
}

.about-quote cite {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.about-support-note {
  margin-top: 22px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--bjp);
  background: var(--panel);
  border-radius: 8px;
}
.about-support-note h3 { margin: 5px 0 8px; }
.about-support-note p:last-child { max-width: 760px; margin-bottom: 0; }

.indicator {
  padding: 16px;
}

.indicator-head span,
.direction-pill {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 8px;
  background: #eef2f4;
  color: var(--rss);
  border: 1px solid #d4dce3;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.direction-pill.tone-worse {
  background: rgba(179, 38, 30, 0.08);
  border-color: rgba(179, 38, 30, 0.28);
  color: var(--danger);
}

.direction-pill.tone-better {
  background: rgba(19, 136, 8, 0.08);
  border-color: rgba(19, 136, 8, 0.28);
  color: #0d6a04;
}

.direction-pill.tone-flat {
  background: #eef2f4;
  border-color: #d4dce3;
  color: var(--muted);
}

.indicator.tone-worse {
  border-top: 3px solid rgba(179, 38, 30, 0.55);
}

.indicator.tone-better {
  border-top: 3px solid rgba(19, 136, 8, 0.5);
}

.indicator.tone-flat {
  border-top: 3px solid rgba(143, 50, 0, 0.28);
}

.indicator-legend { display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:10px; color:var(--muted); font-size:11px; font-weight:800; }
.indicator-legend span { display:inline-flex; align-items:center; gap:5px; }
.indicator-legend .legend-dot { width:8px; height:8px; border-radius:50%; }
.indicator-legend .legend-better { background:#138808; }
.indicator-legend .legend-worse { background:var(--danger); }
.indicator-legend .legend-flat { background:#9da8b1; }
.stats-toolbar { display:grid; grid-template-columns:minmax(220px,1fr) 180px auto auto; align-items:end; gap:10px; margin-top:16px; margin-bottom:24px; }
.stats-toolbar label { display:grid; gap:5px; color:var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.stats-toolbar input, .stats-toolbar select { min-height:40px; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--ink); padding:0 11px; font:inherit; text-transform:none; letter-spacing:normal; }
.stats-result { color:var(--muted); font-size:12px; font-weight:800; padding-bottom:11px; white-space:nowrap; }
.stats-toolbar .clear-filters-button { margin-bottom:5px; }
.indicator-signal { display:inline-flex; margin-bottom:6px; padding:4px 7px; border-radius:4px; font-size:10px; font-weight:900; letter-spacing:.04em; text-transform:uppercase; }
.indicator-signal.tone-better { color:#0d6a04; background:rgba(19,136,8,.1); }
.indicator-signal.tone-worse { color:var(--danger); background:rgba(179,38,30,.09); }
.indicator-signal.tone-flat { color:var(--muted); background:#eef2f4; }

.indicator h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.indicator strong {
  display: block;
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1;
}

.indicator p {
  color: var(--muted);
  font-size: 14px;
}

.bars {
  display: grid;
  gap: 9px;
  margin: 14px 0;
}

.bar-row {
  display: grid;
  grid-template-columns: 48px 1fr minmax(52px, auto);
  align-items: center;
  gap: 9px;
  font-size: 12px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  background: #e9eef2;
  border: 1px solid #d4dce3;
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bjp), #138808);
}
