/* THE RUNDOWN'S LOOK (Insights → The rundown; Chase, 27 Oct: "the whole
   rundown needs to be sexier"; prototypes/insights/rundown.html). One quiet
   line, the strip of report names, and one report card a screen: a dark band
   with an amber hairline, one big number, one chart to scale, four quiet
   tiles, one sentence, the foot. Only .rd-* classes, only on this page; the
   colours are the app's own tokens. No scrolling for the card at 1366x768;
   it stacks at 390 with no sideways scroll. */

.rd-page {
  --rd-main: #c2570c;
  --rd-ref: #ada395;
  --rd-grid: #ece7df;
  --rd-muted: var(--color-muted, #6b6259);
  --rd-ink: var(--color-ink, #1f1a14);
  --rd-gap: #fbeedd;
  --rd-card: #ffffff;
  --rd-land: #f2ede4;
  --rd-head: #1f1a14;
  --rd-head-quiet: #bcb3a8;
  --rd-amber: #f59e0b;
  --rd-tile: #faf8f4;
  --rd-good-ink: var(--color-good-ink, #166534);
  --rd-good-soft: var(--color-good-soft, #e9f7ee);
  --rd-bad-ink: var(--color-bad-ink, #991b1b);
  --rd-bad-soft: var(--color-bad-soft, #fdecec);
  gap: 0;
}

.rd-stack { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }

/* ---- the one quiet line ---- */
.rd-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.625rem; min-width: 0; }
.rd-line .rd-crumb { margin: 0; min-height: 2.75rem; }
.rd-h1 { margin: 0; font-size: 1.25rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; color: var(--rd-ink); }
.rd-dates-pick { min-width: 0; }
.rd-dates-pick [data-report-range-picker] { flex-wrap: nowrap; align-items: center; }
.rd-dates-pick nav { flex-wrap: nowrap; gap: 0.375rem; }
.rd-dates-pick .ui-chip { min-height: 2.75rem; padding: 0 0.625rem; font-size: 0.8125rem; }
.rd-dates-pick details[open] { flex-basis: 100%; }
.rd-place { margin-left: auto; min-width: 0; }
.rd-place [hidden] { display: none; }
.rd-place form { flex-wrap: nowrap; align-items: center; gap: 0.5rem; margin: 0; }
.rd-place form > div { flex-direction: row; align-items: center; }
.rd-place label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rd-place select { min-height: 2.75rem; font-size: 0.875rem; font-weight: 600; padding-top: 0; padding-bottom: 0; }
.rd-place .ui-btn { min-height: 2.25rem; }

/* ---- the strip of report names ---- */
.rd-strip ol { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; margin: 0; padding: 0; list-style: none; }
.rd-st { position: relative; min-width: 0; }
/* The line through the dots: each step draws its own half towards the one before. */
.rd-st::before { content: ""; position: absolute; top: 0.6875rem; left: -50%; right: 50%; height: 2px; background: var(--color-line-strong, #d3ccc0); }
.rd-st:first-child::before { display: none; }
.rd-st.is-done::before, .rd-st.is-now::before { background: var(--color-accent, #b45309); }
.rd-st-link { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-height: 2.75rem; padding: 0 1px 2px; border-radius: 6px; color: #958b80; text-decoration: none; }
.rd-st-link:hover { color: var(--rd-ink); }
.rd-dot { display: flex; align-items: center; justify-content: center; width: 1.375rem; height: 1.375rem; }
.rd-dot::before { content: ""; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--color-page, #f5f4f1); border: 2px solid var(--color-line-strong, #d3ccc0); }
.rd-st.is-done .rd-dot::before { display: none; }
.rd-st.is-done .rd-dot svg { width: 1.125rem; height: 1.125rem; padding: 3px; border-radius: 50%; background: var(--color-accent, #b45309); color: #fff; stroke-width: 2.6; }
.rd-st.is-now .rd-dot::before { width: 0.875rem; height: 0.875rem; border: 0; background: var(--color-accent, #b45309); box-shadow: 0 0 0 4px #f6d9b3; }
.rd-st-lab { font-size: 0.71875rem; line-height: 1.25; font-weight: 600; text-align: center; text-wrap: balance; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rd-st.is-done .rd-st-link { color: var(--rd-muted); }
.rd-st.is-now .rd-st-link { color: var(--rd-ink); }
.rd-st.is-now .rd-st-lab { font-weight: 800; }
.rd-strip-now { display: none; margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--rd-muted); }
.rd-strip-now b { color: var(--rd-ink); }

/* ---- the card ---- */
.rd-card { min-width: 0; overflow: hidden; background: var(--rd-card); border: 1px solid var(--color-line, #e6e1d8); border-radius: 10px; box-shadow: 0 1px 2px rgb(31 26 20 / 0.05), 0 10px 28px -14px rgb(31 26 20 / 0.24); }
.rd-card.is-entering { animation: rd-in 0.5s ease-out; }
.rd-card.is-entering .rd-delta { animation: rd-delta-in 0.1s ease-out 0.4s both; }
@keyframes rd-delta-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes rd-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rd-card.is-entering, .rd-card.is-entering .rd-delta { animation: none; } }

.rd-band { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.125rem; padding: 0.625rem 1.375rem; background: var(--rd-head); border-bottom: 2px solid var(--rd-amber); }
/* Faint pickets fading in from the right. */
.rd-band::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 21px, rgb(255 255 255 / 0.055) 21px 25px); -webkit-mask-image: linear-gradient(to left, #000, transparent 58%); mask-image: linear-gradient(to left, #000, transparent 58%); }
.rd-band-words { position: relative; z-index: 1; flex: 1; min-width: 12rem; }
.rd-title { margin: 0; font-size: 1.1875rem; line-height: 1.3; font-weight: 750; letter-spacing: -0.01em; color: #fff; outline: none; }
.rd-meaning { margin: 0.0625rem 0 0; font-size: 0.84375rem; color: var(--rd-head-quiet); }
.rd-dates { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 0.4375rem; margin: 0; font-size: 0.8125rem; font-weight: 600; color: var(--rd-head-quiet); white-space: nowrap; }
.rd-dates svg { width: 1rem; height: 1rem; color: var(--rd-amber); flex: none; }

.rd-body { display: flex; flex-direction: column; gap: 0.625rem; padding: 0.75rem 1.375rem; min-width: 0; }
.rd-hl { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.5rem 1.5rem; }
.rd-hl-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin: 0; min-width: 0; }
.rd-big { font-size: clamp(2.3rem, 4vw, 2.75rem); line-height: 1; font-weight: 800; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; color: var(--rd-ink); }
.rd-unit { font-size: clamp(1.05rem, 1.6vw, 1.25rem); font-weight: 650; color: var(--rd-muted); }
.rd-delta { align-self: center; display: inline-flex; align-items: center; min-height: 1.75rem; padding: 0 0.6875rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 650; font-variant-numeric: tabular-nums; background: var(--color-page, #f5f4f1); color: var(--rd-muted); }
.rd-delta.is-good { background: var(--rd-good-soft); color: var(--rd-good-ink); }
.rd-delta.is-bad { background: var(--rd-bad-soft); color: var(--rd-bad-ink); }
.rd-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; padding-bottom: 0.25rem; font-size: 0.78125rem; color: var(--rd-muted); }
.rd-key { display: inline-flex; align-items: center; gap: 0.4375rem; }
.rd-key i { display: inline-block; width: 1.125rem; height: 0; border-radius: 2px; }
.rd-key-now { border-top: 3px solid var(--rd-main); }
.rd-key-ref { border-top: 2px dashed var(--rd-ref); }

/* ---- the chart ---- */
.rd-chart { position: relative; min-width: 0; }
.rd-canvas { display: block; width: 100%; height: 9.5rem; touch-action: pan-y; border-radius: 4px; }
.rd-chart-funnel .rd-canvas { height: 12.25rem; }
.rd-chart-bubbles .rd-canvas { height: 12.5rem; }
.rd-tip { position: absolute; z-index: 5; display: flex; flex-direction: column; gap: 0.125rem; min-width: 8rem; padding: 0.5rem 0.6875rem; border-radius: 8px; background: var(--rd-head); color: #f5f4f1; font-size: 0.78125rem; pointer-events: none; box-shadow: 0 6px 20px -6px rgb(31 26 20 / 0.4); font-variant-numeric: tabular-nums; }
.rd-tip b { font-size: 0.75rem; color: var(--rd-head-quiet); }
.rd-tip[hidden] { display: none; }

/* ---- the heat map step ---- */
.rd-hm { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.rd-map { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--color-line, #e6e1d8); border-radius: 8px; background: var(--rd-land); }
.rd-map-frame { display: block; width: 100%; height: 12.5rem; border: 0; }
.rd-map-note { margin: 0.375rem 0 0; padding: 0 0.5rem 0.375rem; font-size: 0.78125rem; color: var(--rd-muted); }
.rd-ztable-wrap { min-width: 0; overflow-x: auto; }
.rd-ztable { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.rd-ztable th, .rd-ztable td { height: 2rem; padding: 0 0.5rem; text-align: right; border-bottom: 1px solid var(--color-line, #e6e1d8); white-space: nowrap; }
.rd-ztable thead th { height: auto; padding-bottom: 0.5rem; font-size: 0.75rem; font-weight: 700; color: var(--rd-muted); border-bottom-color: var(--color-line-strong, #d3ccc0); }
.rd-ztable .rd-zl { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; text-align: left; font-weight: 400; }
.rd-ztable th, .rd-ztable td { padding: 0 0.375rem; }
.rd-ztable .rd-zl span { margin-left: 0.375rem; font-size: 0.78125rem; color: var(--rd-muted); }
.rd-ztable .rd-rk { width: 1.375rem; padding-left: 0.25rem; text-align: left; font-size: 0.75rem; color: #958b80; }

/* ---- tiles, sentence ---- */
.rd-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.625rem; }
.rd-tiles[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rd-tiles[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rd-tiles[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.rd-tile { display: flex; flex-direction: column; gap: 0; min-width: 0; padding: 0.4375rem 0.875rem 0.5rem; background: var(--rd-tile); border: 1px solid var(--color-line, #e6e1d8); border-radius: 8px; }
.rd-tile-l { font-size: 0.78125rem; font-weight: 600; color: var(--rd-muted); overflow-wrap: anywhere; }
.rd-tile-v { font-size: 1.25rem; line-height: 1.3; font-weight: 750; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--rd-ink); overflow-wrap: anywhere; }
.rd-tile-c { font-size: 0.78125rem; color: var(--rd-muted); font-variant-numeric: tabular-nums; }
.rd-tile-c b { font-weight: 700; }
.rd-tile-c b.is-good { color: var(--rd-good-ink); }
.rd-tile-c b.is-bad { color: var(--rd-bad-ink); }
.rd-means { margin: 0; font-size: 1rem; line-height: 1.5; max-width: 74ch; text-wrap: pretty; color: var(--rd-ink); }
.rd-stand { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; padding: 0 0 0 1.25rem; font-size: 1.0625rem; line-height: 1.5; color: var(--rd-ink); }
.rd-note { margin: 0; font-size: 0.8125rem; color: var(--rd-muted); }

/* ---- the foot ---- */
.rd-foot { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 0.625rem 0.875rem; padding: 0.625rem 1.375rem; border-top: 1px solid var(--color-line, #e6e1d8); }
.rd-back.is-off { opacity: 0.45; cursor: default; pointer-events: none; }
.rd-pos { margin: 0; font-size: 0.8125rem; font-weight: 650; color: var(--rd-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd-quiet { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem 1rem; margin: 0; }
.rd-quiet-link { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--rd-muted); font-size: 0.84375rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--color-line-strong, #d3ccc0); }
.rd-quiet-link:hover { color: var(--rd-ink); }
.rd-next { white-space: nowrap; }
/* From 640 px up the "?" floats bottom right (.kf-tour-help: 44 px, 1rem
   in), and on a card that ran to the foot of a 1366x768 screen it sat on
   Next's arrow. The foot keeps 4.25rem clear on its right, so Next ends left
   of the "?" whatever the screen; under 640 px the "?" is in the page's flow. */
@media (min-width: 640px) {
  .rd-foot { padding-right: 4.25rem; }
}

/* ---- narrower screens ---- */
@media (max-width: 1060px) {
  .rd-hm { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .rd-st-lab { display: none; }
  .rd-st-link { min-height: 2.75rem; justify-content: center; }
  .rd-strip-now { display: block; }
}
@media (max-width: 720px) {
  .rd-line .rd-crumb { flex-basis: 100%; min-height: 2.75rem; }
  .rd-h1 { flex: 1; }
  .rd-dates-pick { order: 5; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
  .rd-place { margin-left: 0; }
}
@media (max-width: 640px) {
  .rd-band { padding: 0.75rem 1rem; }
  .rd-title { font-size: 1.125rem; }
  .rd-band-words { min-width: 0; flex-basis: 100%; }
  .rd-dates { white-space: normal; flex-wrap: wrap; }
  .rd-ztable .rd-zl { max-width: 9rem; }
  .rd-body { padding: 0.875rem 1rem; }
  .rd-tiles, .rd-tiles[data-count="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rd-canvas { height: 10rem; }
  .rd-chart-funnel .rd-canvas { height: 14.5rem; }
  .rd-foot { grid-template-columns: auto 1fr; grid-template-areas: "next next" "back pos" "quiet quiet"; padding: 0.75rem 1rem; }
  .rd-foot .rd-next { grid-area: next; white-space: normal; justify-content: center; }
  .rd-foot .rd-back { grid-area: back; }
  .rd-foot .rd-pos { grid-area: pos; justify-self: end; }
  .rd-foot .rd-quiet { grid-area: quiet; justify-content: flex-start; }
  .rd-ztable .rd-zl span { display: block; margin: 0; }
}

/* A genuine ending: figures are existing report tiles, never new totals. */
.rd-closing { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.rd-closing > li { min-width: 0; }
.rd-closing-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; margin: 0; font-size: 1rem; color: var(--rd-ink); }
.rd-closing-figure { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.1; font-weight: 800; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rd-closing-words { max-width: 70ch; margin: 0.25rem 0 0; font-size: 0.9375rem; line-height: 1.5; color: var(--rd-muted); }
.rd-fresh { margin: 0; max-width: 38ch; font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 700; line-height: 1.4; color: var(--rd-ink); text-wrap: balance; }
