:root {
  --ink: #1a1410;
  --ink-soft: #4a3f33;
  --paper: #f4ebd6;
  --paper-shade: #ece2c8;
  --rule: #1a1410;
  --serif: "Iowan Old Style", "Palatino", "Cambria", "Times New Roman", Georgia, serif;
  --display: "Bodoni 72", "Didot", "Playfair Display", Georgia, serif;
  --mono: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;
  --gap: 1rem;
  --rule-thin: 1px;
  --rule-thick: 3px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: var(--serif);
  font-size: clamp(0.9rem, 0.82rem + 0.35vw, 1.08rem);
  line-height: 1.4;
  font-feature-settings: "onum" 1, "kern" 1;
  hyphens: auto;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--paper-shade); padding: 0 0.2em; }

/* ---- Mobile-friendly defaults --------------------------------------- */

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { word-wrap: break-word; overflow-wrap: break-word; }

/* Tables in modules can overflow on narrow viewports; let them scroll
   horizontally inside their module without breaking the page layout. */
.module-body { overflow-x: auto; }

/* ---- Masthead --------------------------------------------------------- */

.masthead {
  padding: 0.75rem clamp(0.75rem, 2vw, 2rem) 0.5rem;
}
.masthead-rule {
  border-top: var(--rule-thick) solid var(--rule);
  margin: 0.25rem 0;
}
.masthead-rule--double {
  border-top: var(--rule-thin) solid var(--rule);
  border-bottom: var(--rule-thin) solid var(--rule);
  height: 4px;
}
.masthead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.5rem 0;
}
/* Stacked and centred at every width.
 *
 * This was a three-column row: empty spacer, nameplate, date. The
 * nameplate measured dead centre, but with the left column empty (the
 * volume/issue number was removed) the date sat alone at the far right
 * and the masthead read lopsided — centred by measurement, off-centre
 * to the eye. There is nothing left to balance, so stop pretending it
 * is a three-column layout. */
.masthead-row {
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.masthead-meta {
  flex: 0 0 auto;
  text-align: center;
  font-variant: small-caps;
  letter-spacing: 0.05em;
}
.masthead-meta--left {
  display: none;
}
.masthead-title {
  flex: 0 0 auto;
  width: 100%;
  text-align: center;
}
.nameplate {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.5rem, 4vw + 1.5rem, 5.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
}
.motto {
  font-style: italic;
  margin: 0.25rem 0 0;
  font-size: 0.95em;
  color: var(--ink-soft);
}
.masthead-search {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.25rem 0;
}
.masthead-search input {
  flex: 0 1 14ch;
  min-width: 8ch;
  font-family: var(--mono);
  font-size: inherit;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.1rem 0.25rem;
  color: var(--ink);
}
.masthead-search input:focus { outline: none; background: var(--paper-shade); }
.masthead-search button {
  font-family: var(--serif);
  font-size: inherit;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 0.15rem 0.7rem;
  cursor: pointer;
}

.masthead-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1.5rem;
  padding: 0.2rem 0 0.35rem;
  font-variant: small-caps;
  letter-spacing: 0.07em;
  font-size: 0.85rem;
}
.masthead-nav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}
.masthead-nav a:hover { border-bottom-color: var(--ink); }

/* ---- Page chrome ------------------------------------------------------ */

.page {
  padding: 0.5rem clamp(0.75rem, 2vw, 2rem) 2rem;
}
.page-head {
  text-align: center;
  padding: 0.75rem 0 0.5rem;
  border-bottom: var(--rule-thin) solid var(--rule);
  margin-bottom: 1rem;
}
.kicker {
  font-variant: small-caps;
  letter-spacing: 0.1em;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85em;
}
.headline {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.8rem, 2vw + 1.2rem, 3.2rem);
  line-height: 1.05;
  margin: 0.1rem 0 0.4rem;
}

.dataline {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.9em;
}

/* ---- Page layout: 12-column responsive grid ----------------------- */
/*
 * The canvas is a 12-column CSS Grid. Each module claims a fixed
 * span of those columns by its width class — narrow=3 (1/4), medium=4
 * (1/3), wide=6 (1/2), prose=8 (2/3), full=12. Modules always fill the
 * real page width: no hard-coded 22ch cards leaving slack on the right.
 *
 * ``grid-auto-flow: dense`` lets a narrow module slip into a gap left
 * by a wider one on the row above. ``align-items: start`` prevents
 * row-height stretching — each module is exactly the height of its
 * content.
 *
 * Two breakpoints (the only media queries in the file): below 64rem we
 * drop to a 6-col grid (narrow & medium become half-width); below 36rem
 * everything stacks single-column for phones.
 */

.flex-canvas {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: max-content;
  grid-auto-flow: dense;
  gap: var(--gap);
  align-items: start;
}

.module--narrow { grid-column: span 3; }
.module--medium { grid-column: span 4; }
.module--wide   { grid-column: span 6; }
.module--prose  { grid-column: span 8; }
.module--full   { grid-column: 1 / -1; }

@media (max-width: 64rem) {
  .flex-canvas { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .module--narrow,
  .module--medium { grid-column: span 3; }
  .module--wide,
  .module--prose  { grid-column: 1 / -1; }
}
@media (max-width: 36rem) {
  .flex-canvas { grid-template-columns: 1fr; }
  .module--narrow,
  .module--medium,
  .module--wide,
  .module--prose,
  .module--full { grid-column: 1 / -1; }
}

.module {
  display: block;
  border: var(--rule-thin) solid var(--rule);
  background: var(--paper);
  padding: 0.5rem 0.75rem 0.65rem;
  min-width: 0;
  overflow-wrap: break-word;
}

/* Lede modules: rendered OUTSIDE the canvas at full page width, in
   priority order, above the grid. */
.module--lede {
  margin-bottom: var(--gap);
}
.module--lede.module--prose .module-body {
  column-width: 32ch;
  column-gap: 1.5rem;
  hyphens: auto;
}
.module--lede.module--wide .module-body {
  overflow-x: auto;
}

.module-head {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 1em;
  border-bottom: var(--rule-thin) solid var(--rule);
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}
.module-head-link { display: block; }
.module-body {
  flex: 1 1 auto;
  min-width: 0;
}
.module--prose .module-body {
  /* Two-column newspaper feel at wider basis. 30ch column-width keeps
     each column readable while still using the double basis. */
  column-width: 30ch;
  column-gap: 1.5rem;
  column-rule: var(--rule-thin) solid var(--rule);
  hyphens: auto;
}
.module--prose .module-body > p:first-child::first-letter {
  font-family: var(--display);
  font-weight: 900;
  font-size: 3em;
  line-height: 0.85;
  float: left;
  padding: 0.1em 0.15em 0 0;
}

/* Tables in modules: tabular numerals, hairline rules, no overflow tricks. */
.module-body table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.92em;
}
.module-body th, .module-body td {
  text-align: left;
  padding: 0.15rem 0.3rem;
  border-bottom: var(--rule-thin) dotted var(--ink-soft);
}
.module-body th { font-variant: small-caps; letter-spacing: 0.05em; font-weight: 600; }
.module-body td.num, .module-body th.num { text-align: right; font-family: var(--mono); }

/* ---- Quote ------------------------------------------------------------ */

.quote-price {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.6rem, 0.7rem + 2vw, 2.4rem);
  line-height: 1;
  margin: 0.1rem 0 0.2rem;
  font-variant-numeric: tabular-nums;
}
.quote-change {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.95em;
  margin: 0 0 0.4rem;
}
.quote-change--down { font-style: italic; }
.quote-change--flat { color: var(--ink-soft); }
.quote-change .arrow { font-family: var(--serif); padding-right: 0.15rem; }
.quote-spark { color: var(--ink); margin-bottom: 0.4rem; }
.sparkline { width: 100%; height: 28px; display: block; }
.quote-meta { margin-top: 0.3rem; }

/* ---- Verdict ---------------------------------------------------------- */

.verdict-rating {
  font-family: var(--display);
  font-weight: 900;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: clamp(1.3rem, 0.6rem + 1.5vw, 2rem);
  margin: 0.1rem 0;
  text-align: center;
  border-top: var(--rule-thin) solid var(--rule);
  border-bottom: var(--rule-thin) solid var(--rule);
  padding: 0.2rem 0;
}
.verdict-rating--strong-buy { border-top-width: var(--rule-thick); border-bottom-width: var(--rule-thick); }
.verdict-rating--strong-sell { font-style: italic; border-top-width: var(--rule-thick); border-bottom-width: var(--rule-thick); }
.verdict-rating--sell { font-style: italic; }
.verdict-rating--hold { color: var(--ink-soft); }
.verdict-rating--inline {
  display: inline-block;
  font-size: 0.78em;
  border: none;
  padding: 0;
  margin: 0;
  letter-spacing: 0.04em;
}
.verdict-composite {
  text-align: center;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  margin: 0.3rem 0;
}
.verdict-asof { text-align: center; color: var(--ink-soft); margin: 0.3rem 0 0; }

/* The Verdict section view (home page lede) renders two leaderboards
   side-by-side. Override the inner grid to a 50/50 split so each table
   uses half the width regardless of the outer 12-col grid. */
.verdict-section.flex-canvas {
  grid-template-columns: 1fr 1fr;
}
.verdict-section .module--narrow,
.verdict-section .module--medium {
  grid-column: span 1;
}
@media (max-width: 36rem) {
  .verdict-section.flex-canvas { grid-template-columns: 1fr; }
}

/* ---- Snapshot --------------------------------------------------------- */

.snapshot-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05em;
  margin: 0;
}
.snapshot-classify {
  margin: 0 0 0.4rem;
  color: var(--ink-soft);
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

/* ---- News ------------------------------------------------------------- */

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.news-list--feed { column-width: 22ch; column-gap: 1.5rem; column-rule: var(--rule-thin) solid var(--rule); }
.news-item {
  break-inside: avoid;
  padding: 0.4rem 0;
  border-bottom: var(--rule-thin) dotted var(--ink-soft);
}
.news-item:last-child { border-bottom: none; }
.news-headline {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02em;
  line-height: 1.2;
  margin: 0 0 0.15rem;
}
.news-byline {
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.82em;
  color: var(--ink-soft);
  margin: 0 0 0.2rem;
}
.news-symbol {
  font-family: var(--mono);
  font-variant: normal;
  letter-spacing: 0;
  border-bottom: 1px dotted currentColor;
}
.news-symbol--tag {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  border-bottom: none;
  color: var(--ink-soft);
}
.news-deck { margin: 0; font-size: 0.92em; }

/* ---- Summary ---------------------------------------------------------- */

.summary-meta {
  margin-top: 0.6rem;
  color: var(--ink-soft);
  break-before: column;
}

/* ---- Indices strip ---------------------------------------------------- */

/* The Tape: a Bloomberg-style auto-rolling marquee. We render the
   strip twice in HTML; the animation translates by -100% which slides
   one full copy off-screen while the duplicate is exposed, giving a
   seamless loop. Edges are masked so items emerge / disappear softly. */
.indices-tape {
  display: flex;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(to right,
              transparent 0,
              black 1.5rem,
              black calc(100% - 1.5rem),
              transparent 100%);
  -webkit-mask-image: linear-gradient(to right,
              transparent 0,
              black 1.5rem,
              black calc(100% - 1.5rem),
              transparent 100%);
}
.indices-tape:hover .indices-strip { animation-play-state: paused; }

.indices-strip {
  list-style: none;
  margin: 0;
  padding: 0 1.25rem 0 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0 1.25rem;
  flex-shrink: 0;
  animation: tape-roll 45s linear infinite;
  white-space: nowrap;
}
@keyframes tape-roll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .indices-strip { animation: none; }
  .indices-tape { overflow-x: auto; }
}
.ind-item {
  flex: 0 0 auto;
  border-left: var(--rule-thin) solid var(--ink-soft);
  padding: 0.1rem 0 0.1rem 0.7rem;
  margin: 0.15rem 0;
}
.indices-strip:first-child .ind-item:first-child {
  border-left: none;
  padding-left: 0;
}
.ind-item a { display: flex; align-items: baseline; gap: 0.5rem; }
.ind-label {
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.ind-last {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.ind-chg {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.88em;
}
.ind-chg--down { font-style: italic; }
.ind-chg--flat { color: var(--ink-soft); }

/* ---- Sector ribbon ---------------------------------------------------- */

.sector-ribbon { width: 100%; }
.sector-ribbon .sector-label { font-weight: 600; }
.sector-ribbon .sector-symbol { color: var(--ink-soft); }
.sector-chg--down { font-style: italic; }
.sector-chg--flat { color: var(--ink-soft); }
.sector-spark {
  width: 60px;
  min-width: 60px;
  color: var(--ink);
}
.sector-spark svg { height: 18px; }

/* ---- Earnings --------------------------------------------------------- */

.earnings-next {
  margin: 0 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: var(--rule-thin) solid var(--rule);
}
.earnings-next-label {
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-right: 0.3rem;
}
.earnings-next-date {
  font-family: var(--display);
  font-weight: 700;
}
.earnings-history th, .earnings-history td { white-space: nowrap; }
.earnings-surprise--down { font-style: italic; }
.earnings-surprise--flat { color: var(--ink-soft); }

.cal-list { display: flex; flex-direction: column; gap: 0.6rem; }
.cal-day {
  padding-bottom: 0.4rem;
  border-bottom: var(--rule-thin) dotted var(--ink-soft);
}
.cal-day:last-child { border-bottom: none; }
.cal-date {
  font-family: var(--display);
  font-weight: 700;
  margin: 0;
}
.cal-tickers {
  margin: 0.15rem 0 0;
  font-family: var(--mono);
  font-size: 0.92em;
}

/* ---- Financials / Sessions ------------------------------------------- */

.financials, .sessions { width: 100%; }
.financials th, .financials td, .sessions th, .sessions td { white-space: nowrap; }
.financials th:first-child { text-align: left; }
.financials thead th, .sessions thead th { font-variant: small-caps; letter-spacing: 0.05em; }

/* ---- Layer breakdown -------------------------------------------------- */

.layers { width: 100%; }
.layers th:first-child { text-align: left; }
.layer-bar-cell { width: 70px; min-width: 70px; color: var(--ink); }
.layer-bar { width: 100%; height: 8px; display: block; }
.layer-row--down td.num { font-style: italic; }
.layer-row--flat td, .layer-row--missing td { color: var(--ink-soft); }
.layer-macro { margin: 0.4rem 0 0; color: var(--ink-soft); text-align: right; }

/* ---- XBRL long-run trend --------------------------------------------- */

.xbrl-span {
  margin: 0 0 0.4rem;
  color: var(--ink-soft);
  font-variant: small-caps;
  letter-spacing: 0.06em;
}
.xbrl { width: 100%; }
.xbrl th:first-child { text-align: left; }
.xbrl-spark { width: 90px; min-width: 90px; color: var(--ink); }
.xbrl-spark svg { height: 22px; }

/* ---- DB-backed module shared styles ---------------------------------- */

.people-table,
.holders-table,
.insiders-table,
.filings-table,
.events-table,
.consensus-targets,
.consensus-distribution,
.consensus-actions,
.dividend-summary,
.dividend-annual,
.contracts-table,
.risk-table,
.metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.people-table th,
.holders-table th,
.insiders-table th,
.filings-table th,
.events-table th,
.consensus-targets th,
.consensus-actions th,
.dividend-summary th,
.dividend-annual th,
.contracts-table th,
.risk-table th,
.metrics-table th {
  text-align: left;
  font-weight: 600;
  padding: 0.15rem 0.4rem 0.15rem 0;
}
.people-table td,
.holders-table td,
.insiders-table td,
.filings-table td,
.events-table td,
.consensus-actions td,
.contracts-table td {
  padding: 0.15rem 0.4rem;
  border-top: 1px dotted var(--rule);
  vertical-align: top;
}
.consensus-targets td,
.dividend-summary td,
.dividend-annual td,
.risk-table td,
.metrics-table td {
  padding: 0.15rem 0;
  vertical-align: baseline;
}

.dim { color: var(--ink-soft); }
.bull { color: #006633; font-weight: 600; }
.bear { color: #a13030; font-weight: 600; }

.micro-head {
  margin: 0.6rem 0 0.25rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.insider--buy td { background: rgba(0, 102, 51, 0.05); }
.insider--sell td { background: rgba(161, 48, 48, 0.05); }

.consensus-distribution { margin: 0.4rem 0; }
.consensus-distribution .bar {
  background: var(--rule);
  height: 0.7rem;
  width: 100%;
  position: relative;
  padding: 0;
}
.consensus-distribution .bar span {
  display: block;
  background: var(--ink);
  height: 100%;
}

.index-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  font-variant: small-caps;
  letter-spacing: 0.04em;
}
.index-tag {
  border: 1px solid var(--rule);
  padding: 0 0.3rem;
  font-size: 0.7rem;
  line-height: 1.2rem;
  border-radius: 2px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.relationships p { margin: 0.25rem 0; }
.relationships a { color: var(--ink); }

/* ---- Equity chart ---------------------------------------------------- */
.equity-chart {
  width: 100%;
  /* Explicit aspect-ratio so the SVG actually renders at a usable
     height. CSS ``height: auto`` doesn't compute against viewBox for
     inline SVG in some browsers; ``aspect-ratio`` is the reliable way. */
  aspect-ratio: 1100 / 240;
  display: block;
  background: transparent;
}
.equity-line {
  stroke: var(--ink);
  stroke-width: 1.5;
  fill: none;
  stroke-linejoin: round;
}
.axis-zero { stroke: var(--ink-soft); stroke-width: 0.8; }
.axis-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  fill: var(--ink-soft);
}
.equity-label {
  font-family: var(--mono);
  font-size: 0.95rem;
  fill: var(--ink);
  font-weight: 700;
}

/* ---- Footer ----------------------------------------------------------- */

.colophon {
  padding: 1rem clamp(0.75rem, 2vw, 2rem) 1.5rem;
  text-align: center;
  color: var(--ink-soft);
}

/* ---- Short-term scanner page ---------------------------------------- */

.scanner-controls {
  margin: 1rem 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.pill-row .pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: var(--rule-thin) solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  background: transparent;
  border-radius: 2px;
}
.pill-row .pill:hover { background: rgba(0, 0, 0, 0.04); }
.pill-row .pill.is-on {
  background: var(--ink);
  color: var(--paper, #fff);
}

.feature-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  align-items: center;
  padding: 0.5rem 0;
  border-top: 1px dotted var(--rule);
  border-bottom: 1px dotted var(--rule);
}
.feature-picker .picker-label {
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-right: 0.5rem;
  font-size: 0.85rem;
}
.feature-toggle {
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  user-select: none;
}
.feature-toggle input { margin: 0; }

.scanner-setup {
  margin: 1.25rem 0 1.5rem;
  border-top: var(--rule-thin) solid var(--rule);
  padding-top: 0.75rem;
}
.scanner-setup-head {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.scanner-setup-head .scanner-count {
  font-weight: 400;
  font-size: 0.85em;
}
.scanner-rationale {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 70ch;
}
.scanner-table { font-size: 0.9rem; }
.scanner-table td { padding: 0.25rem 0.7rem 0.25rem 0; }

/* ---- Setup index cards (root /short-term-plays) -------------------- */

.setup-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.setup-card {
  border: var(--rule-thin) solid var(--rule);
  padding: 0.9rem 1rem 1rem;
  background: transparent;
  /* Required so the .stretched ::after can cover the whole card. */
  position: relative;
}
.setup-card:hover { background: rgba(0, 0, 0, 0.025); }
.setup-card-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}
.setup-card-title a { color: var(--ink); text-decoration: none; }
.setup-card-title a:hover { text-decoration: underline; }
/* Stretched-link pattern: a single anchor inside the card whose
 * ::after pseudo-element covers the card's full area, so a click
 * anywhere on the card navigates to the link. Keeps semantic HTML
 * (one link, in the heading) instead of nesting <a> over the card. */
.setup-card a.stretched::after {
  content: "";
  position: absolute;
  inset: 0;
}
.setup-card-blurb {
  font-style: italic;
  color: var(--ink-soft);
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
}

/* ---- Setup detail page (single setup, expandable rows) ------------- */

.breadcrumb {
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
}
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }

.candidate-list {
  margin: 0.8rem 0 1.5rem;
  border-top: var(--rule-thin) solid var(--rule);
}
.candidate-list-head,
.candidate-row {
  display: grid;
  grid-template-columns: 4.5em 5.5em 9em repeat(calc(var(--n-cols) - 3), minmax(6em, 1fr)) 1.5em;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
}
.candidate-list-head {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  color: var(--ink-soft);
  border-bottom: var(--rule-thin) solid var(--rule);
}
.candidate-row .col-num,
.candidate-list-head .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.candidate-row .col-sector { font-size: 0.85rem; }
.candidate-row a { color: var(--ink); text-decoration: none; font-weight: 600; }
.candidate-row a:hover { text-decoration: underline; }

.candidate {
  border-bottom: var(--rule-thin) dotted var(--rule);
}
.candidate > summary {
  cursor: pointer;
  list-style: none;
}
.candidate > summary::-webkit-details-marker { display: none; }
.candidate > summary:hover { background: rgba(0, 0, 0, 0.025); }
.candidate[open] > summary {
  background: rgba(0, 0, 0, 0.04);
  border-bottom: 1px dotted var(--rule);
}
.candidate .col-toggle {
  font-size: 0.7rem;
  color: var(--ink-soft);
  transition: transform 0.15s ease;
  text-align: center;
}
.candidate[open] > summary .col-toggle { transform: rotate(180deg); }

/* Setup chart + payoff chart side by side. The position spec (Structure /
 * TP / SL / Expected / Thesis) is rendered ONCE at the top of the page
 * via the .cohort-position block, not under every candidate. */
.candidate-body {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  padding: 1rem 0.6rem 1.5rem;
  background: rgba(0, 0, 0, 0.015);
}
.candidate-chart, .candidate-position-chart { min-width: 0; }
@media (max-width: 720px) {
  .candidate-body { grid-template-columns: 1fr; }
}

/* Cohort-level position spec, shown once at the top of each detail page. */
.cohort-position {
  border: var(--rule-thin) solid var(--rule);
  padding: 0.8rem 1rem 1rem;
  margin: 0.8rem 0 1.2rem;
  background: rgba(0, 0, 0, 0.02);
}
.cohort-position-head {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0 0 0.4rem;
}
.cohort-position .position-spec { margin-top: 0; }

/* Per-candidate $ trade estimate, rendered under the payoff SVG.
 * 3 equal cells laid out horizontally (Cost / Max win / Max loss). */
.trade-estimate {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin: 0.5rem 0 0;
  text-align: center;
}
.te-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.25rem 0.3rem;
  border-top: var(--rule-thin) solid var(--rule);
}
.te-label {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.1;
  margin-bottom: 0.15rem;
}
.te-value {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.te-value.te-pos { color: var(--ink); }
.te-value.te-neg { color: var(--ink-soft); }

/* ---- Setup chart SVG ----------------------------------------------- */

.setup-chart, .position-chart {
  width: 100%;
  height: auto;
  font-family: var(--display);
}
.price-line {
  stroke: var(--ink);
  stroke-width: 1.4;
  fill: none;
}
.coil-thrust-box {
  fill: rgba(0, 0, 0, 0.03);
  stroke: var(--rule);
  stroke-width: 0.5;
  stroke-dasharray: 1 3;
}
.coil-coil-box {
  fill: rgba(0, 0, 0, 0.07);
  stroke: var(--ink-soft);
  stroke-width: 0.5;
}
.coil-breakout-line {
  stroke: var(--ink);
  stroke-width: 1.0;
  stroke-dasharray: 4 3;
}
.coil-stop-line {
  stroke: var(--ink-soft);
  stroke-width: 0.8;
}
.setup-ref-line {
  stroke: var(--ink-soft);
  stroke-width: 0.8;
}
.pullback-band {
  fill: rgba(0, 0, 0, 0.04);
  stroke: none;
}
.bb-band {
  stroke: var(--ink-soft);
  stroke-width: 0.7;
  fill: none;
  stroke-dasharray: 2 3;
}
.payoff-line {
  stroke: var(--ink);
  stroke-width: 1.5;
  fill: none;
}
.strike-line { stroke: var(--ink-soft); stroke-width: 0.6; }
.chart-axis { stroke: var(--ink-soft); stroke-width: 0.8; }

/* ---- Position spec list -------------------------------------------- */

.position-spec {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 0.8rem;
  margin: 0.7rem 0 0;
  font-size: 0.86rem;
  line-height: 1.4;
}
.position-spec dt {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-size: 0.8rem;
  margin: 0;
}
.position-spec dd {
  margin: 0;
  color: var(--ink);
}
.position-note {
  font-size: 0.86rem;
  line-height: 1.45;
  margin: 0.4rem 0 0;
}

.scanner-empty {
  font-style: italic;
  color: var(--ink-soft);
  padding: 1rem 0;
}

/* ---- Recent-triggers history table --------------------------------- */

.recent-triggers {
  margin: 2rem 0 1.5rem;
  border-top: var(--rule-thin) solid var(--rule);
  padding-top: 0.75rem;
}
.recent-triggers-head {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}
.recent-triggers .dataline {
  margin: 0 0 0.6rem;
  max-width: 70ch;
}
.recent-triggers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.recent-triggers-table thead th {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: left;
  border-bottom: var(--rule-thin) solid var(--rule);
  padding: 0.3rem 0.6rem 0.3rem 0;
}
.recent-triggers-table thead th.num { text-align: right; }
.recent-triggers-table td {
  padding: 0.25rem 0.6rem 0.25rem 0;
  border-bottom: 1px dotted var(--rule);
  font-variant-numeric: tabular-nums;
}
.recent-triggers-table td.num { text-align: right; }
.recent-triggers-table td a { color: var(--ink); text-decoration: none; font-weight: 600; }
.recent-triggers-table td a:hover { text-decoration: underline; }
.recent-triggers-table .trigger-pos { color: #1f6f3d; }
.recent-triggers-table .trigger-neg { color: #a02525; }

/* ---- Out-of-sample window panel ------------------------------------- */

.oos-table tbody tr.oos-row--tuned {
  background: rgba(0, 0, 0, 0.025);
}
.oos-row--tuned td:first-child { font-weight: 700; }
.oos-tag {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.75em;
  color: var(--ink-soft);
  padding: 0 0.3em;
  border: 1px solid var(--rule);
  border-radius: 2px;
  margin-left: 0.4rem;
}

/* ---- Method drift panel ---------------------------------------------- */

.drift-table {
  /* The drift table has six columns vs the 2–3 of a typical risk-table.
     Restore real horizontal padding and put a hair line under the header
     so the table reads as a proper grid, not a wall of text. */
  margin-top: 0.4rem;
}
.drift-table th,
.drift-table td {
  padding: 0.3rem 0.7rem 0.3rem 0;
  vertical-align: baseline;
}
.drift-table th { border-bottom: var(--rule-thin) solid var(--rule); }
.drift-table tbody tr + tr td { border-top: 1px dotted var(--rule); }
.drift-table td:last-child,
.drift-table th:last-child { padding-right: 0; }
.status-in,
.status-out {
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}
.status-out { color: var(--ink-soft); border-bottom-style: dashed; }
.swap-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.3rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.swap-list li {
  padding-left: 1.2em;
  text-indent: -1.2em;
}
.swap-list li::before { content: "→ "; color: var(--ink-soft); }

/* ---- /method pages ---------------------------------------------------- */

.method-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.method-card {
  border: var(--rule-thin) solid var(--rule);
  background: var(--paper-tint, transparent);
}
.method-card a {
  display: block;
  padding: 1rem 1rem 0.75rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
}
.method-card a:hover { background: rgba(0, 0, 0, 0.025); }
.method-card h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  line-height: 1.15;
}
.method-card p {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  line-height: 1.35;
}
.method-card .more {
  color: var(--ink-soft);
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.method-detail-canvas {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}
@media (max-width: 56rem) {
  .method-detail-canvas { grid-template-columns: 1fr; }
}
.method-toc {
  border-right: var(--rule-thin) solid var(--rule);
  padding-right: 1rem;
}
.method-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: stage;
}
.method-toc li {
  counter-increment: stage;
  padding: 0.25rem 0;
  font-size: 0.95rem;
}
.method-toc li::before {
  content: counter(stage) ".";
  display: inline-block;
  width: 1.5em;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.85em;
}
.method-toc li.is-current a {
  font-weight: 700;
  border-bottom: var(--rule-thin) solid var(--ink);
}
.method-toc a {
  text-decoration: none;
  color: inherit;
}
.method-toc a:hover { border-bottom: var(--rule-thin) solid var(--ink); }

.method-body { max-width: 56ch; line-height: 1.55; }
.method-body p { margin: 0.5rem 0 1rem; }
.method-body table { margin: 0.5rem 0 1.25rem; }
.method-teaser {
  font-family: var(--display);
  font-size: 1.15rem;
  font-style: italic;
  border-left: 3px solid var(--ink);
  padding-left: 0.8rem;
  color: var(--ink-soft);
}

/* ---- Print ------------------------------------------------------------ */

@media print {
  body { background: white; color: black; }
  .masthead-search { display: none; }
  .module { break-inside: avoid; }
}

/* ---- Mobile ----------------------------------------------------------
 * Measured in Chrome at 360x800 and 375x667 against the live site, not
 * guessed. The layout grid already collapses (see the 64rem/36rem
 * breakpoints above); what was left were three concrete problems.
 */
@media (max-width: 48rem) {

  /* 1. Over-wide tables were CLIPPED, not scrollable. `html, body` set
   *    overflow-x: hidden, so a table wider than the viewport simply
   *    lost its right-hand columns with no way to reach them — measured
   *    at 479px of table inside a 360px viewport on /congress, and
   *    367px on /turnarounds. Tables inside .module-body were fine
   *    because that scrolls; these sit outside it. Making each table
   *    its own scroll container fixes both cases without needing every
   *    renderer to emit a wrapper div. */
  .page table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 2. Finger-sized targets for navigation and for links inside tables.
   *    Deliberately NOT applied to inline prose links: 827 of them on
   *    the home page sit under 32px, and padding those out would
   *    destroy the column rhythm. The guideline is about primary
   *    targets, not every word that happens to be a link. */
  .masthead-nav a {
    display: inline-block;
    padding: 0.45rem 0;
  }
  .page table th,
  .page table td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  /* 3. Nothing below 12px. These three were 10.3-11.9px, which is
   *    unreadable on a phone and fails accessibility checks. */
  .news-symbol,
  .sector-symbol,
  .verdict-rating {
    font-size: 0.75rem;
  }
}

/* Equity-curve range picker. */
.range-nav {
  display: flex;
  gap: 0.15rem;
  justify-content: flex-end;
  margin: 0 0 0.4rem;
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}
.range-pick {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink-soft);
}
.range-pick:hover { color: var(--ink); }
.range-pick--on {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* The equity SVG is authored at 1100px and scaled to fit. On a phone
   that is roughly a third of the width, so 0.7rem axis text renders at
   about 3.5px — present, but unreadable. The SVG is inline, so scale
   the type up in viewBox units to land back at a legible size. */
@media (max-width: 48rem) {
  .axis-label { font-size: 1.8rem; }
  .equity-label { font-size: 2.1rem; }
  .range-nav { justify-content: center; font-size: 0.85rem; }
  .range-pick { padding: 0.35rem 0.8rem; }
}

/* ---- Scan tables: turnarounds + short-term triggers ------------------ */
/* These classes were emitted by the views but never had rules, so both
   scan pages rendered unstyled tables and the filter chips ran together
   as one string — "All (38)Consensus capitulation (1)" reads as
   "38 consensus capitulation". */

.turn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 1.4rem;
}
.turn-table thead th {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: left;
  border-bottom: var(--rule-thin) solid var(--rule);
  padding: 0.3rem 0.6rem 0.3rem 0;
  white-space: nowrap;
}
.turn-table thead th.num { text-align: right; }
.turn-table td {
  padding: 0.28rem 0.6rem 0.28rem 0;
  border-bottom: 1px dotted var(--rule);
  font-variant-numeric: tabular-nums;
}
.turn-table td.num { text-align: right; }
.turn-table tbody tr:hover { background: rgba(0, 0, 0, 0.025); }
.turn-table td a { color: var(--ink); text-decoration: none; font-weight: 600; }
.turn-table td a:hover { text-decoration: underline; }
.turn-table .trigger-pos, .turn-table .turn-pos { color: #1f6f3d; }
.turn-table .trigger-neg, .turn-table .turn-neg { color: #a02525; }
.turn-table td.good { color: #1f6f3d; }
.turn-table td.bad  { color: var(--ink-soft); }
.turn-table .dim { color: var(--ink-soft); }

/* Tier badge */
.turn-tier {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  white-space: nowrap;
}
.turn-tier-gold   { background: #d9c27a; color: #2b2000; border-color: #8a7530; }
.turn-tier-silver { background: #d8d8d8; color: #23231f; border-color: #8d8d8d; }
.turn-tier-bronze { background: #d9b28c; color: #33210f; border-color: #8d6440; }

/* Filter chips. The row is a flex list with a real gap so adjacent
   labels can never read as one phrase. */
.turn-tier-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  margin: 0.6rem 0 1rem;
  padding-bottom: 0.7rem;
  border-bottom: var(--rule-thin) solid var(--rule);
}
.turn-tier-chip {
  display: inline-block;
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  white-space: nowrap;
}
.turn-tier-chip:hover { background: var(--paper-shade); text-decoration: none; }
.turn-tier-chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  font-weight: 600;
}
