/* The Pillory: shared styles for the app screens
   (/join, /feed, /issue, /report, /constitution).
   The original Home, How it works and Principles pages keep their own inline styles. */

:root {
  --page: #F5F2EA;
  --card: #FFFFFF;
  --border: #DDD7CA;
  --text: #1A1D21;
  --text-2: #4A4F57;
  --navy: #1E3A5F;
  --navy-light: #E3EAF3;
  --parch: #F3E8D3;
  --parch-border: #D9C39B;
  --parch-text: #6B4410;
  --tension: #8A3B12;
  --neutral: #6B7078;

  --radius: 12px;
  --tap: 44px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); }

h1, h2, h3, .serif {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }

p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

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

/* ---------- Layout ---------- */

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.page-head { display: flex; flex-direction: column; gap: 6px; }
.subtitle { color: var(--text-2); }
.secondary { color: var(--text-2); }
.small { font-size: 0.875rem; }
.xsmall { font-size: 0.8125rem; }
.center { text-align: center; }

/* Small, uppercase, letter-spaced section label */
.label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0;
}

.back-link {
  display: block;
  max-width: 100%;
  line-height: var(--tap);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  align-self: flex-start;
  font-weight: 500;
  text-decoration: none;
}

/* ---------- Surfaces ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.card--highlight { border: 2px solid var(--navy); padding: 15px; }

a.card {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.card:hover { border-color: var(--navy); }

.panel-navy {
  background: var(--navy-light);
  border-radius: var(--radius);
  padding: 16px;
}

.banner {
  background: var(--navy-light);
  color: var(--navy);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
}

/* Anything constitutional */
.parchment {
  background: var(--parch);
  border: 1px solid var(--parch-border);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--parch-text);
}
.parchment .label { color: var(--parch-text); }

.quote {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--text);
}

.inset {
  background: var(--page);
  border-radius: 10px;
  padding: 12px 14px;
}

/* Reset list / fieldset chrome when used purely for semantics */
.plain-list { list-style: none; margin: 0; padding: 0; }
.bare { border: 0; margin: 0; padding: 0; min-width: 0; }

.divider { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* ---------- Chips & toggles (pill-shaped) ---------- */

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

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip--parch { background: var(--parch); border-color: var(--parch-border); color: var(--parch-text); }
.chip--navy { background: var(--navy); color: #fff; }
.chip--outline { border-color: var(--navy); color: var(--navy); background: var(--card); }
.chip--light { background: var(--navy-light); color: var(--navy); }

/* Toggle: <label class="toggle"><input type="radio|checkbox" …><span>Text</span></label> */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.toggle:has(input:checked) {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.toggle:has(input:focus-visible) {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* Constitutional toggle chips */
.toggle--parch { border-color: var(--parch-border); color: var(--parch-text); background: #fff; }
.toggle--parch:has(input:checked) { background: var(--parch-text); border-color: var(--parch-text); color: #fff; }

/* Segmented control: equal-width toggles in one pill track */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.segmented .toggle { border: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--navy);
  background: var(--card);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--block { width: 100%; }

.btn-dashed {
  min-height: 56px;
  padding: 8px 12px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}
.btn-dashed:hover { border-color: var(--navy); }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 0.9375rem; font-weight: 600; }
.hint { font-size: 0.8125rem; color: var(--text-2); }

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
}
.textarea { min-height: 112px; resize: vertical; }
.input::placeholder,
.textarea::placeholder { color: #8A8F97; }
.input:focus,
.select:focus,
.textarea:focus { outline: 2px solid var(--navy); outline-offset: -1px; border-color: var(--navy); }

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: var(--tap);
  padding: 10px 0;
  cursor: pointer;
}
.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--navy);
}

/* ---------- Join steps ---------- */

.step { display: flex; gap: 12px; align-items: flex-start; }
.step-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.step-num,
.step-done {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  font-weight: 600;
}
.step-done { background: var(--navy); color: #fff; }
.step-num { border: 2px solid var(--navy); color: var(--navy); }
.status-done { font-size: 0.8125rem; font-weight: 600; color: var(--navy); }

.kv { display: flex; flex-direction: column; margin: 0; }
.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
}
.kv-row:first-child { border-top: 0; }
.kv-row dt { color: var(--text-2); }
.kv-row dd { margin: 0; font-weight: 500; text-align: right; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ---------- Issue cards ---------- */

.card.issue-card { display: flex; flex-direction: column; gap: 8px; }
.issue-card .chips { margin-top: 4px; }
.issue-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-2);
}
.issue-foot strong { color: var(--text); font-weight: 600; }

/* ---------- Issue detail ---------- */

.stat {
  background: var(--page);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}
.stat-num { font-family: var(--serif); font-weight: 600; font-size: 1.375rem; }
.stat-label { font-size: 0.75rem; color: var(--text-2); }

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.list-row:first-of-type { border-top: 0; padding-top: 0; }
.list-row:last-child { padding-bottom: 0; }
.list-title { font-weight: 500; }
.list-meta { font-size: 0.8125rem; color: var(--text-2); }
.list-status { flex: none; font-size: 0.8125rem; font-weight: 600; color: var(--navy); text-align: right; }

.perspective {
  background: var(--card);
  border-radius: 10px;
  padding: 14px;
  border-left: 4px solid var(--neutral);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.perspective h3 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; }
.perspective--aligns { border-left-color: var(--navy); }
.perspective--aligns h3 { color: var(--navy); }
.perspective--tension { border-left-color: var(--tension); }
.perspective--tension h3 { color: var(--tension); }
.perspective--neutral h3 { color: var(--neutral); }
.source { font-size: 0.8125rem; color: var(--text-2); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  padding: 10px 0 10px 20px;
  position: relative;
  border-top: 1px solid var(--border);
}
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy);
}
.timeline li:first-child::before { top: 8px; }

/* ---------- Report ---------- */

.attachment {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 0.9375rem;
}
.attachment-name { font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Constitution ---------- */

.browse-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.browse-row:first-child { border-top: 0; padding-top: 0; }
.browse-row:last-child { padding-bottom: 0; }

.numbered { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.numbered li { display: flex; gap: 12px; }
.numbered .step-num { border-color: var(--parch-text); color: var(--parch-text); }

/* ---------- App header ---------- */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}
/* The seal mark sits before "The Pillory" wherever the wordmark appears */
.wordmark::before {
  content: "";
  flex: none;
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.3em;
  transform: translateY(-0.14em); /* center on the capitals, not the line box */
  background: var(--navy);
  -webkit-mask: url("/assets/logo/mark.svg?v=2") center / contain no-repeat;
  mask: url("/assets/logo/mark.svg?v=2") center / contain no-repeat;
}

.header-meta { text-align: right; font-size: 0.875rem; line-height: 1.3; }
.header-meta strong { display: block; font-weight: 600; }
.header-meta span { color: var(--text-2); font-size: 0.8125rem; }

/* ---------- Fixed bottom bars ---------- */

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
}
.bottom-bar-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bottom-bar-inner > * { flex: 1; }
.bottom-bar .btn { padding: 0 8px; font-size: 0.9375rem; }


[hidden] { display: none !important; }

/* ---------- Site pages (Home, How it works, Principles) ---------- */

/* Wider reading column than the 480px app screens */
.site {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.site-nav .wordmark { margin-right: auto; font-size: 1.375rem; }
.site-nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.site-nav-join { margin-left: 8px; }
.site-nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 10px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav-links a:hover { color: var(--navy); }
.site-nav-links a[aria-current="page"] { color: var(--navy); background: var(--navy-light); }

.site h1 { font-size: 2.5rem; }
.lede { font-size: 1.125rem; color: var(--text-2); }
.prose { font-size: 1.0625rem; line-height: 1.65; }


.numbered-lg li { gap: 14px; }
.numbered-lg .step-num { width: 32px; height: 32px; }

@media (min-width: 600px) {
  .site { padding-top: 24px; gap: 32px; }
  .site h1 { font-size: 3rem; }
}

.stack-lg { display: flex; flex-direction: column; gap: 28px; }

/* Home page */
.hero { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
/* Home: the nav logo is the largest thing on the page; the tagline heading supports it */
.site-nav .wordmark--lg { font-size: 2rem; letter-spacing: -0.015em; }
.hero .hero-tagline {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.3;
  color: var(--text);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.pillars { display: grid; gap: 12px; }
.pillar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pillar h2 { font-size: 1.125rem; }

/* On wider screens the nav spans wider than the 680px reading column */
@media (min-width: 760px) {
  .site-nav { width: min(960px, calc(100vw - 32px)); align-self: center; }
}

@media (min-width: 600px) {
  .site-nav .wordmark--lg { font-size: 2.5rem; }
  .hero .hero-tagline { font-size: 1.75rem; }
  .pillars { grid-template-columns: repeat(3, 1fr); }
}
.card.numbered { padding: 20px; }
.numbered-lg h2 { font-size: 1.1875rem; }

/* Home's larger logo needs the two-row nav up to 900px wide */
@media (max-width: 899px) {
  .site-nav--home { row-gap: 8px; }
  .site-nav--home .site-nav-join { order: 2; }
  .site-nav--home .site-nav-links { order: 3; flex-basis: 100%; justify-content: flex-start; gap: 8px; }
}

@media (max-width: 479px) {
  /* Row 1: wordmark + Join. Row 2: the page links, with room between them. */
  .site-nav { row-gap: 8px; }
  .site-nav-join { order: 2; }
  .site-nav-links { order: 3; flex-basis: 100%; justify-content: space-between; gap: 4px; }
  .site-nav-links a { padding: 0 10px; font-size: 0.875rem; }
  .site-nav--home .site-nav-links { justify-content: space-between; gap: 4px; }
}

@media (max-width: 359px) {
  .site-nav-links a { padding: 0 6px; }
}

/* =========================================================================
   App shell (generated pages): tab bar, search, and shared pieces
   ========================================================================= */

:root { --tabbar-h: 61px; --gray-chip: #E4E1DA; --gray-text: #3F444B; }

/* Five tabs: fixed to the bottom on phones, a top nav on desktop */
.has-tabbar .app { padding-bottom: calc(var(--tabbar-h) + 32px); }
.has-tabbar.has-action-bar .app { padding-bottom: calc(var(--tabbar-h) + 96px); }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.tabbar-row { max-width: 480px; margin: 0 auto; }
.tabbar-brand { display: none; }
.tabbar-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  align-items: center;
}
.tabbar .tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 4px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.tabbar .tab.is-current { color: var(--navy); font-weight: 600; background: var(--navy-light); }
.tabbar .tab--report,
.tabbar .tab--report.is-current { background: var(--navy); color: #fff; font-weight: 600; }
.tabbar .tab--report.is-current { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--navy); }

/* Issue page actions sit just above the tab bar on phones */
.action-bar { bottom: var(--tabbar-h); z-index: 15; }

@media (min-width: 768px) {
  .has-tabbar { padding-top: var(--tabbar-h); }
  .has-tabbar .app { padding-bottom: 40px; }
  .has-tabbar.has-action-bar .app { padding-bottom: 104px; }
  .tabbar {
    top: 0;
    bottom: auto;
    border-top: 0;
    border-bottom: 1px solid var(--border);
    padding: 8px 24px;
  }
  .tabbar-row {
    max-width: 960px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .tabbar-brand { display: inline-flex; }
  .tabbar-inner { display: flex; gap: 6px; }
  .tabbar .tab { padding: 0 16px; font-size: 0.9375rem; }
  .action-bar { bottom: 0; }
  /* The wordmark lives in the top nav here; show the residency line on its own, left-aligned */
  .app-header .wordmark { display: none; }
  .app-header .header-meta { display: flex; align-items: baseline; gap: 6px; text-align: left; }
  .app-header .header-meta strong { display: inline; }
  .app-header .header-meta span::before { content: "· "; }
}

/* Global search */
.search { position: relative; }
.search-input {
  border-radius: 999px;
  padding-left: 42px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A4F57' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center / 18px;
}
.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(26, 29, 33, 0.14);
}
.search-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--tap);
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.search-result:hover,
.search-result:focus { background: var(--navy-light); outline: none; }
.search-result-type {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.search-result-title { font-weight: 500; }
.search-result-sub { font-size: 0.8125rem; color: var(--text-2); }
.search-empty { padding: 10px; font-size: 0.875rem; color: var(--text-2); }
.search-all {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 10px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

/* Links that are rows in a list */
.link-row { color: inherit; text-decoration: none; }
.link-row:hover .list-title { color: var(--navy); text-decoration: underline; }
.row-end { flex: none; display: inline-flex; align-items: center; gap: 8px; }
.chev { color: var(--text-2); font-size: 1.25rem; line-height: 1; }

/* Inline links still get a 44px tap height */
.inline-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 500;
}

/* Linked chips are tap targets too */
a.chip { min-height: var(--tap); padding: 0 14px; text-decoration: none; }
a.chip:hover { border-color: var(--parch-text); }
.chip--gray { background: var(--gray-chip); color: var(--gray-text); }

/* Promise statuses: Kept navy, Broken red-brown, In progress / No action gray */
.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}
.status--kept { background: var(--navy); color: #fff; }
.status--broken { background: var(--tension); color: #fff; }
.status--gray { background: var(--gray-chip); color: var(--gray-text); }

/* Rep profile tabs */
.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}
.tabs [role="tab"] {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 12px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }
.tabs .count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--navy-light);
  color: var(--navy);
  font-size: 0.75rem;
  text-align: center;
}

/* Upcoming meetings strip */
.strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}
.strip > * { flex: 0 0 min(260px, 82%); scroll-snap-align: start; }
.meeting-card { display: flex; flex-direction: column; gap: 6px; }
.meeting-card h3 { font-size: 1.0625rem; }
.meeting-date { font-size: 0.875rem; font-weight: 600; color: var(--navy); }

.agenda { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* Evidence viewer */
.evidence-preview {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 16px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-2);
  text-align: center;
}

/* Constitution */
.constitution-text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text);
}
a.constitution-link { color: inherit; text-decoration: none; }
a.constitution-link:hover { border-color: var(--parch-text); }

/* Report flow progress */
.progress {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  counter-reset: step;
}
.progress li {
  counter-increment: step;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.8125rem;
}
.progress li::before { content: counter(step) ". "; }
.progress li.is-done { background: var(--navy-light); border-color: var(--navy-light); color: var(--navy); }
.progress li.is-current { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

@media (max-width: 359px) {
  .tabbar .tab { font-size: 0.75rem; padding: 0 2px; }
}

/* ---------- Real officials and voting records (Pages Functions) ---------- */

.rep-head { flex-direction: row; align-items: flex-start; gap: 14px; }
.rep-photo {
  flex: none;
  width: 72px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
}

/* Link toggles (no JS): same look as the radio toggles */
.segmented a.toggle { text-decoration: none; text-align: center; }
.toggle[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.vote-list { padding: 4px 16px; }
.vote-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.vote-row:first-child { border-top: 0; }
.vote-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vote-bill { font-weight: 600; align-self: flex-start; }
.vote-bill-text { font-weight: 600; }
.vote-question { font-weight: 500; }
.vote-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

/* A position is a plain fact: one neutral style for Yes, No, Present, and Not voting */
.position {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--text-2);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}
.type-tag {
  display: inline-flex;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--gray-chip);
  color: var(--gray-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
}
.source-link { font-size: 0.875rem; }

.positions { display: flex; flex-direction: column; }
.position-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 4px 0;
  border-top: 1px solid var(--border);
}
.position-row:first-child { border-top: 0; }
.position-row .position { margin-left: auto; }

/* ---------- Constitutional analysis (bill pages, /admin/review) ---------- */

.baseline-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.parchment h3 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--parch-text); }
.parchment h4 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.parchment a { color: var(--parch-text); }

/* The review state is always spelled out in words; color only reinforces it. */
.review-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--parch-border);
  background: #fff;
  color: var(--parch-text);
}
.review-badge--draft { border-style: dashed; border-color: var(--parch-text); }
.review-badge--reviewed { background: var(--navy); border-color: var(--navy); color: #fff; }

.limited-note {
  border-left: 3px solid var(--parch-text);
  padding: 4px 0 4px 10px;
  font-size: 0.875rem;
  font-weight: 600;
}

.provision-cite { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--parch-border); }
.provision-cite:first-of-type { border-top: 0; padding-top: 0; }
.provision-cite a.label { text-decoration: none; }
.provision-cite .quote { font-size: 1.0625rem; margin: 0; }

.baseline-panels { display: grid; gap: 10px; }
.panel { background: #fff; border: 1px solid var(--parch-border); border-radius: 10px; padding: 12px 14px; color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.panel--tension { border-left: 3px solid var(--tension); }
.panel--tension .label { color: var(--tension); }
.panel-list { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 6px; }

.reading { padding-top: 6px; }
.readings { display: grid; gap: 8px; }
.reading-col { background: #fff; border: 1px solid var(--parch-border); border-radius: 10px; padding: 10px 12px; color: var(--text); }
.reading-col .label { margin-bottom: 4px; }

.baseline-foot { border-top: 1px solid var(--parch-border); padding-top: 10px; }

/* On wide screens the baseline widens past the app column so the three panels
   and the readings can sit side by side. */
@media (min-width: 900px) {
  .baseline-wide { width: min(800px, calc(100vw - 64px)); position: relative; left: 50%; transform: translateX(-50%); }
  .baseline-panels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .readings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.provision-cite a.label, .baseline-foot .inline-link { display: inline-flex; align-items: center; min-height: var(--tap); }
.panel-list a { display: inline-block; padding: 12px 0; }

/* Full Constitution text on /laws/constitution/ */
.provision { display: flex; flex-direction: column; gap: 2px; scroll-margin-top: 80px; }
.provision + .provision, .provision-group + .provision-group { margin-top: 8px; }
.provision-group { display: flex; flex-direction: column; gap: 6px; scroll-margin-top: 80px; }
.provision:target .constitution-text, .provision-group:target { background: #fff; border-radius: 8px; outline: 2px solid var(--parch-border); outline-offset: 4px; }

/* /admin/review */
.chip-tab { min-height: var(--tap); padding: 0 16px; text-decoration: none; }
.textarea--code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; }
.banner--error { background: #F6E3DA; color: var(--tension); }

/* ---------- Home briefing, meetings, agenda watch ---------- */

/* Home briefing (design/Home.dc.html) */
.brief-head { display: flex; flex-direction: column; gap: 14px; }
.pill-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-filter .toggle { font-size: 0.875rem; text-decoration: none; }
.pill-filter .toggle:not([aria-current="true"]) { border-color: #C9C1B1; }
.brief-section { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.brief-section--issues { gap: 12px; }
.brief-section--issues .issue-card { padding: 16px; gap: 10px; }
.brief-section--issues .issue-card h3 { font-size: 1.25rem; line-height: 1.25; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-link { font-size: 0.8125rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; min-height: var(--tap); }
.empty-note { padding: 4px 0; }

.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-top-note { flex: none; font-size: 0.75rem; font-weight: 600; color: var(--text-2); text-align: right; white-space: nowrap; }
.card-top-note--due { color: var(--tension); }
.example-tag {
  flex: none;
  padding: 2px 8px;
  border: 1px dashed var(--text-2);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  background: var(--card);
}
.page-head .chips .example-tag { align-self: center; }

.meeting-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; text-decoration: none; color: inherit; }
.meeting-card h3 { font-size: 1.1875rem; line-height: 1.25; }
.meeting-card--hearing h3 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.meeting-card:hover { border-color: var(--navy); }
.meeting-when { font-size: 1rem; }
.deadline { font-size: 0.875rem; font-weight: 600; color: var(--navy); }
.chips--tight { gap: 6px; }
.chip--sm { padding: 4px 10px; font-size: 0.75rem; }
.chip--light.chip--sm { font-weight: 600; }
.chip--quiet { background: var(--page); color: var(--text); }

.brief-votes { padding: 0; }
.brief-vote { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid #EEE9DE; }
.brief-vote:first-child { border-top: 0; }
.brief-vote-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.brief-vote-name { font-size: 0.875rem; font-weight: 600; color: var(--text); text-decoration: none; }
.brief-vote-name:hover { text-decoration: underline; }
.brief-vote-position { flex: none; font-size: 0.8125rem; font-weight: 600; }

.caught-up { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 16px; border-top: 1px solid var(--border); }
.caught-up-icon { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--navy-light); color: var(--navy); display: flex; align-items: center; justify-content: center; }
.stack-xs { display: flex; flex-direction: column; gap: 2px; }
.caught-up strong { font-size: 0.9375rem; }

/* Meeting page (design/Meeting_dc.pdf) */
.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-pair .btn { padding: 0 12px; border-radius: 10px; font-size: 0.9375rem; text-align: center; }
.btn--sm { font-size: 0.875rem; }
.weigh-panel { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; }
.label--navy { color: var(--navy); }
.weigh-row { display: flex; flex-direction: column; gap: 2px; }
.weigh-row h3 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; }
.weigh-row p { overflow-wrap: anywhere; }
.weigh-details summary { cursor: pointer; font-size: 0.875rem; font-weight: 500; color: var(--navy); min-height: var(--tap); display: flex; align-items: center; }
.weigh-details summary::after { content: " ▾"; font-size: 0.75em; margin-left: 4px; }
.weigh-details[open] summary::after { content: " ▴"; }
.weigh-details[open] summary { margin-bottom: 6px; }
.watch-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 20px; }
.watch-card.card--highlight { padding: 15px 19px 19px; }
.watch-card h3 { font-family: var(--sans); font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.related-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; min-height: var(--tap); font-size: 0.875rem; font-weight: 600; color: var(--parch-text); text-decoration: none; }
.related-link:hover { text-decoration: underline; }
.list-card { padding: 0; overflow: hidden; }
.list-card-head { padding: 20px 20px 12px; }
.list-card-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 60px; padding: 10px 20px; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.list-card-row--link { color: inherit; text-decoration: none; }
.list-card-row--link:hover { background: var(--page); }
.list-card-row .link-text { color: var(--navy); font-weight: 600; }
.list-card-row > span:last-child { flex: none; white-space: nowrap; }
.list-card-group > summary { cursor: pointer; list-style: none; }
.list-card-group > summary::-webkit-details-marker { display: none; }
.list-card-group > summary > span:last-child::after { content: " ▾"; font-size: 0.75em; }
.list-card-group[open] > summary > span:last-child::after { content: " ▴"; }
.list-card-group .agenda-items { padding: 4px 20px 16px; }
.card--dashed { border-style: dashed; border-color: #BDB5A5; background: transparent; padding: 20px; }

.chip--flag { background: var(--navy-light); color: var(--navy); }
.chip--agenda { background: var(--navy); color: #fff; align-self: flex-start; white-space: normal; }

.weigh-list { display: flex; flex-direction: column; gap: 6px; font-size: 0.9375rem; }
.agenda-quote {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--border);
  background: var(--page);
  border-radius: 0 8px 8px 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
}


.agenda-items { display: flex; flex-direction: column; gap: 12px; }
.agenda-item { display: flex; flex-direction: column; gap: 4px; font-size: 0.9375rem; overflow-wrap: anywhere; }
.item-docs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.ai-label { font-weight: 600; }

.pager { display: flex; gap: 8px; justify-content: center; }
