/* brief.css — "the civic ledger", ported from src/render.ts.
   Serif = explanation voice, mono = official-record voice.
   Evergreen pine is the accent; ledger gold is reserved for money;
   brick red is reserved for split votes and failures. */

:root {
  --paper: #f5f3ec;
  --card: #fcfbf6;
  --ink: #242b26;
  --faded: #6b7268;
  --rule: #dad6c8;
  --pine: #1e5b45;
  --pine-mid: #6e8b7a;
  --pine-pale: #edf1ea;
  --moss: #b9c2b4;
  --gold: #9a7b2d;
  --gold-pale: #f1e9d2;
  --gold-line: #d9c98f;
  --brick: #a63a2b;
  --brick-pale: #f6e9e5;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
}
.wrap { max-width: 44rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
a { color: var(--pine); }
a:focus-visible, .card:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- the two voices: mono = official record, serif = explanation --- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pine);
}
.cite {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--faded);
  white-space: nowrap;
}

/* --- masthead / page header --- */
.crumb {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--faded);
  margin-bottom: 1.75rem;
}
.crumb:hover { color: var(--pine); }
.masthead { text-align: center; padding: 1.25rem 0 1.5rem; }
.masthead h1 {
  font-size: clamp(2.1rem, 7vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0.35rem 0 0.6rem;
}
.masthead .dek { color: var(--faded); font-style: italic; max-width: 32rem; margin: 0 auto; }
.nameplate-rule { border: none; border-top: 3px solid var(--ink); margin: 1.4rem 0 0; }
.nameplate-rule + .nameplate-rule { border-top: 1px solid var(--ink); margin-top: 3px; }

.brief-head h1 {
  font-size: clamp(1.7rem, 5.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.2;
  margin: 0.3rem 0 0.9rem;
}
.lede { font-size: 1.12rem; line-height: 1.65; color: #3d453f; }

/* --- section headers --- */
.section { margin-top: 2.75rem; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.45rem;
  margin-bottom: 1.25rem;
}
.section-head .eyebrow { font-size: 0.76rem; white-space: nowrap; }
.section-head .sub {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--faded);
  margin-left: auto;
  text-align: right;
}

/* --- notices (honest degradation) --- */
.notices {
  margin-top: 1.75rem;
  border: 1px solid var(--gold-line);
  border-left: 4px solid var(--gold);
  background: var(--card);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
}
.notices .eyebrow { color: var(--gold); }
.notices ul { list-style: none; margin-top: 0.5rem; }
.notices li {
  font-size: 0.92rem;
  line-height: 1.5;
  padding-left: 1.1rem;
  position: relative;
  margin-top: 0.35rem;
}
.notices li::before { content: "\2014"; position: absolute; left: 0; color: var(--gold); }
.notices li.refusal::before { color: var(--brick); }
.notices li.refusal strong { color: var(--brick); }

/* --- docket controls (sort + filter; server pages only) --- */
.docket-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  margin: -0.35rem 0 1.15rem;
}
.ctl-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.ctl-label {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faded);
  margin-right: 0.3rem;
}
.ctl-pill { position: relative; cursor: pointer; }
.ctl-pill input { position: absolute; opacity: 0; pointer-events: none; }
.ctl-pill span {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faded);
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0.14rem 0.5rem;
}
.ctl-pill:hover span { color: var(--pine); }
.ctl-pill input:checked + span {
  color: var(--pine);
  font-weight: 700;
  border-color: var(--rule);
  background: var(--card);
}
.ctl-pill input:focus-visible + span { outline: 2px solid var(--pine); outline-offset: 2px; }
.ctl-apply {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pine);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.14rem 0.55rem;
  cursor: pointer;
}
.ctl-apply:hover { border-color: var(--pine); }
html.js .ctl-apply { display: none; }

/* --- docket items --- */
.docket { list-style: none; }
.item {
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.1rem 1.2rem 1.05rem 1rem;
  margin-bottom: 0.9rem;
}

/* signature element: the impact gauge */
.gauge { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding-top: 0.15rem; }
.gauge-num {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--tint, var(--faded));
}
.gauge-track {
  width: 4px;
  height: 46px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.gauge-fill { display: block; width: 100%; background: var(--tint, var(--faded)); border-radius: 2px; }
.tier-high { --tint: var(--pine); }
.tier-mid  { --tint: var(--pine-mid); }
.tier-low  { --tint: var(--moss); }
.tier-low .gauge-num { color: var(--faded); }

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--faded);
  text-transform: uppercase;
}
.tag {
  margin-left: auto;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
  background: var(--paper);
  color: var(--faded);
  letter-spacing: 0.08em;
}
.item h3 { font-size: 1.22rem; font-weight: 600; line-height: 1.3; margin: 0.3rem 0 0.5rem; }
.prose { margin-top: 0.4rem; }

.money { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.7rem; }
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  background: var(--gold-pale);
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  padding: 0.18rem 0.55rem;
  font-size: 0.85rem;
  line-height: 1.4;
}
.chip .amt { font-family: var(--mono); font-weight: 700; font-size: 0.8rem; color: #6d5717; white-space: nowrap; }
.chip .for { color: #57503c; }

.why { margin-top: 0.7rem; font-size: 0.92rem; color: #3d453f; }
.why strong {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pine);
  margin-right: 0.4rem;
}

/* --- outcome stamps --- */
.outcome { margin-top: 0.85rem; padding-top: 0.7rem; border-top: 1px dashed var(--rule); }
.stamp {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  padding: 0.14rem 0.55rem;
  margin-right: 0.5rem;
}
.stamp-pass { color: var(--pine); }
.stamp-fail { color: var(--brick); }
.stamp-neutral { color: var(--faded); }
.stamp-missing { color: var(--faded); border-style: dashed; font-weight: 400; }
.stamp-split { color: #fdfbf6; background: var(--brick); border-color: var(--brick); }
.split-note {
  margin-top: 0.5rem;
  font-size: 0.92rem;
  color: var(--brick);
  background: var(--brick-pale);
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
}
.split-note strong {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 0.35rem;
}
.outcome-note { margin-top: 0.5rem; font-size: 0.9rem; color: #3d453f; font-style: italic; }
.outcome .cite, .item-cites { display: block; margin-top: 0.5rem; }
.item-cites { white-space: normal; }

.dive-link {
  display: inline-block;
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--pine);
}

.docket-note { font-size: 0.92rem; color: var(--faded); font-style: italic; margin-top: 0.25rem; }

/* --- deep dive --- */
.deep {
  margin-top: 2.75rem;
  background: var(--pine-pale);
  border: 1px solid #d4ddd2;
  border-top: 4px solid var(--pine);
  border-radius: 8px;
  padding: 1.4rem 1.5rem 1.5rem;
}
.deep h2 { font-size: 1.45rem; font-weight: 600; line-height: 1.25; margin: 0.4rem 0 0.9rem; }
.deep h3 {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pine);
  margin: 1.4rem 0 0.55rem;
}
.deep .prose + .prose { margin-top: 0.7rem; }
.cost-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.7rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #d4ddd2;
  font-size: 0.95rem;
}
.cost-row:last-child { border-bottom: none; }
.cost-row .amt {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: #6d5717;
  background: var(--gold-pale);
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  padding: 0.05rem 0.45rem;
  white-space: nowrap;
}
.buried { list-style: none; }
.buried li {
  position: relative;
  padding-left: 1.15rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}
.buried li::before { content: "\25AA"; position: absolute; left: 0; top: 0.05rem; color: var(--pine); }
.bottom-line {
  margin-top: 1.5rem;
  background: var(--pine);
  color: #f4f6f1;
  border-radius: 6px;
  padding: 0.85rem 1.1rem;
  font-size: 1.05rem;
  line-height: 1.55;
}
.bottom-line strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #cfe0d6;
  margin-bottom: 0.25rem;
}
.deep .refusal-panel { margin-top: 0.6rem; }

/* --- deep-dive teaser (collapsed state; server pages only) --- */
.deep-teaser h2 { margin-bottom: 0.45rem; }
.teaser-note { font-size: 0.95rem; color: #3d453f; }
.teaser-open {
  display: inline-block;
  margin-top: 0.95rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--pine);
  border: 1.5px solid currentColor;
  border-radius: 3px;
  padding: 0.3rem 0.7rem;
}
.teaser-open:hover { background: var(--pine); border-color: var(--pine); color: #f4f6f1; }

.refusal-panel {
  border: 1px solid #e3c4bb;
  border-left: 4px solid var(--brick);
  background: var(--card);
  border-radius: 6px;
  padding: 0.85rem 1.05rem;
  font-size: 0.95rem;
}
.refusal-panel strong { color: var(--brick); }
.refusal-panel .expl { margin-top: 0.3rem; color: #3d453f; font-style: italic; }

/* --- footer / audit line --- */
.foot {
  margin-top: 3rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  line-height: 1.8;
  color: var(--faded);
}

/* --- index cards --- */
.cards { list-style: none; margin-top: 1.9rem; }
.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.15rem 1.3rem;
  margin-bottom: 0.9rem;
  transition: border-color 120ms ease, transform 120ms ease;
}
.card:hover { border-color: var(--pine); transform: translateY(-1px); }
.card-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.8rem; }
.card h2, .card-error h2 { font-size: 1.3rem; font-weight: 600; line-height: 1.3; }
.flag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-line);
  background: var(--gold-pale);
  border-radius: 3px;
  padding: 0.12rem 0.45rem;
}
.card-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faded);
  margin-top: 0.3rem;
}
.card-teaser { margin-top: 0.65rem; font-size: 0.98rem; line-height: 1.5; }
.card-teaser .teaser-label {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pine);
  margin-right: 0.45rem;
}
.card-teaser .mini-score {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pine);
  white-space: nowrap;
  margin-left: 0.4rem;
}
.empty { text-align: center; color: var(--faded); font-style: italic; margin-top: 2.5rem; }

/* --- index data-error card (a file failed the load-time output checks) --- */
.card-error {
  background: var(--card);
  border: 1px solid #e3c4bb;
  border-left: 4px solid var(--brick);
  border-radius: 8px;
  padding: 1.15rem 1.3rem;
  margin-bottom: 0.9rem;
}
.flag-error { color: var(--brick); border-color: #e3c4bb; background: var(--brick-pale); }
.error-copy { margin-top: 0.65rem; font-size: 0.95rem; line-height: 1.5; }
.error-detail {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--brick);
  margin-top: 0.55rem;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .wrap { padding: 1.4rem 1rem 2.5rem; }
  .item { grid-template-columns: 2.6rem 1fr; gap: 0.75rem; padding: 0.95rem 0.95rem 0.9rem 0.8rem; }
  .gauge-num { font-size: 1.1rem; }
  .gauge-track { height: 38px; }
  .tag { margin-left: 0; }
  .flag { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  #docket.htmx-swapping { opacity: 0.5; transition: opacity 100ms ease; }
}
