/* Rules added after the fork from reference/long-desk-artifact.html.
   desk.css is that artifact's <style> block, extracted byte-for-byte and never
   edited — everything new lives here so the exactness test can keep proving the
   original stylesheet is untouched. Tokens (--ink, --accent, --buy …) all come
   from desk.css; nothing below invents a colour or a spacing value. */

/* ---------- Freshness / archive banner ---------- */
.banner {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  border: 1px solid var(--line); border-left-width: 3px; border-radius: 7px;
  padding: 10px 14px; margin-bottom: 18px; background: var(--surface);
}
.banner a { color: inherit; }
.banner.info { border-left-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.banner.warn { border-left-color: var(--wait); background: var(--wait-soft); color: var(--ink); }
.banner.stale { border-left-color: var(--avoid); background: var(--avoid-soft); color: var(--ink); }

.masthead .meta a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.masthead .meta a:hover { border-bottom-color: var(--accent); }

/* ---------- Stock detail additions ---------- */
.stock-head .provenance {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint);
  margin-top: 8px; line-height: 1.6;
}
.stock-head .provenance .pending { color: var(--wait); }

/* The second metric row is the same component as the first; the lighter rule
   keeps the ten headline figures visually primary. */
.metric-row.second { border-top-style: dashed; }

.signals { margin-top: 14px; font-family: var(--mono); font-size: 12px; }
.signals summary { cursor: pointer; color: var(--accent); }
.signals ul { margin: 8px 0 0; padding-left: 18px; columns: 2; column-gap: 24px; }
.signals li { margin-bottom: 3px; color: var(--ink-soft); break-inside: avoid; }
.signals li.sig-yes { color: var(--buy); }
.signals li.sig-no { color: var(--avoid); }

/* Data notes are raw.flags verbatim — every approximation, substitution and
   cross-source disagreement the pipeline hit for this name. */
.flags {
  margin-top: 14px; padding: 10px 14px; border-radius: 7px;
  background: var(--wait-soft); border: 1px solid var(--line); border-left: 3px solid var(--wait);
}
.flags .flags-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--wait);
}
.flags ul { margin: 6px 0 0; padding-left: 18px; }
.flags li { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 3px; }

/* ---------- Morning brief / archive ---------- */
.brief-sub {
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint); margin: -8px 0 26px;
}
.brief-block { margin-bottom: 34px; }
.brief-block > h2 {
  font-family: var(--serif); font-size: 21px; margin: 0 0 4px; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.brief-block > .sub { color: var(--ink-soft); font-size: 13px; margin: 0 0 14px; }
.brief-block .lead {
  font-family: var(--serif); font-size: 19px; line-height: 1.45; margin: 10px 0;
  border-left: 3px solid var(--accent); padding-left: 14px; text-wrap: pretty;
}
.brief-block p { font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.muted { color: var(--ink-faint); }
.source, p.source {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); margin-top: 8px;
}
.tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 20px; background: var(--surface-2); color: var(--ink-faint);
  white-space: nowrap;
}
.tag.fresh { background: var(--accent-soft); color: var(--accent); }

/* Change figures always carry sign + arrow + colour, never colour alone. */
.up { color: var(--buy); }
.down { color: var(--avoid); }
.flat { color: var(--ink-faint); }

/* desk.css hides .table-scroll under 640px because the sector ledger has a stacked-card
   fallback to swap in. The brief's tables have no such fallback, so they scroll. */
@media (max-width: 640px) {
  .brief-block .table-scroll { display: block; overflow-x: auto; }
}
.brief-block table.ledger { background: var(--surface); }
/* An arrow + sign + number must not wrap mid-figure — "▼" alone on one line above
   "-0.16%" reads as two separate things. */
.brief-block table.ledger td.num { white-space: nowrap; }
.brief-block table.ledger tbody tr { cursor: default; }
.brief-block table.ledger tbody tr:hover { background: transparent; }
.brief-block table.ledger th { cursor: default; }
.brief-block table.ledger.how td { font-size: 13px; vertical-align: top; }
.brief-block table.ledger.how td.cite { font-size: 10.5px; color: var(--ink-faint); font-style: italic; }

.breadth { margin-top: 16px; }
.breadth-bar {
  display: flex; height: 8px; border-radius: 20px; overflow: hidden; background: var(--surface-2);
}
.breadth-bar .seg-fill { display: block; height: 100%; }
.breadth-legend {
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft);
}

.flows { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-end; margin-top: 18px; }
.flows .flow-note {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint); width: 100%;
}
.flow-label { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.flow-val { font-family: var(--mono); font-size: 20px; font-variant-numeric: tabular-nums; }
.flow-sub { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

.story { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.story h3 {
  font-family: var(--serif); font-size: 16.5px; margin: 0 0 6px;
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
}
.story-foot { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.story-foot .tk { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.sources { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.sources a { color: var(--accent); text-decoration: none; }
.sources a:hover { text-decoration: underline; }

.watch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.watch-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 16px 18px;
}
.watch-card .wc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.watch-card .wc-top .tk { display: block; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.watch-card .wc-why { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); margin: 10px 0; line-height: 1.55; }
.watch-card .wc-metrics {
  display: flex; gap: 14px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
}
.watch-card .wc-metrics b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Masthead nav: the report you are on is stated, not linked to itself. */
.masthead .meta .current { color: var(--ink); font-weight: 600; }

/* Results due — a list, not a table: one fact per company. */
.results { margin: 8px 0 0; padding-left: 18px; }
.results li { font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); }
.results li b { color: var(--ink); }
.results .tk, .results li .tk {
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
}
.results.ahead li { font-family: var(--mono); font-size: 12px; }
.brief-block h3.sub {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 600;
  margin: 18px 0 10px;
}

@media (max-width: 640px) {
  .signals ul { columns: 1; }
  .brief-block .lead { font-size: 17px; }
}

/* ---------- Franchise Risk / Growth Outlook signal aura ----------
   Marks sectors and stocks that were actually targeted for this session's
   qualitative lenses (see hasStockSignal() in desk.html), so the ~10-20
   researched names aren't lost among the ~150+ showing "not researched this
   session". Amber reuses --wait rather than inventing a colour -- it is
   already this page's "worth a second look" signal (QUALITY-WAIT pills, the
   warn banner), not a new meaning. */
.sector-card.has-signal {
  position: relative;
  border-color: var(--wait);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--wait) 45%, transparent),
              0 0 16px color-mix(in srgb, var(--wait) 30%, transparent);
}
.sector-card.has-signal:hover { border-color: var(--wait); }
.signal-badge {
  position: absolute; top: -8px; right: -8px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 20px;
  background: var(--wait); color: var(--surface);
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--surface);
}

tr.has-signal, .mrow.has-signal {
  box-shadow: inset 3px 0 0 var(--wait), inset 0 0 14px color-mix(in srgb, var(--wait) 12%, transparent);
}
tr.has-signal .name b::after, .mrow.has-signal .mr-name b::after {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 7px;
  border-radius: 50%; background: var(--wait); vertical-align: middle;
}

/* Same aura, card-shaped -- the brief's Stocks to Watch cards (pipeline/brief.py
   _watchlist) have no table row to hang tr.has-signal off of. Border + dot only,
   not the sector-card's badge-and-glow treatment: a whole page of these cards would
   turn the glow into visual noise where a sector overview has just eleven. */
.watch-card.has-signal { border-color: var(--wait); }
.watch-card.has-signal .wc-top b::after {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 7px;
  border-radius: 50%; background: var(--wait); vertical-align: middle;
}
