/* The Status page and the Progress card (plan 32 §5.3; plan 36 restyle). Tokens from app.css only, so light and dark both work. */

#status-root { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
#status-root > * { min-width: 0; }

/* Two snapshot cards side by side (Readiness, Financials); Readiness alone while Financials is not there. */
.st-snap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.st-snap:has(#status-financials-card[hidden]) { grid-template-columns: minmax(0, 1fr); max-width: 780px; }
.st-hero { display: flex; flex-direction: column; gap: 12px; }
.st-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.st-hero-h { font-size: 15px; font-weight: 500; color: var(--ink-2); display: flex; align-items: baseline; gap: 8px; }
.st-big { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--ink); }
.st-counts { color: var(--ink-2); font-size: 13.5px; }
.st-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-hint { color: var(--warn-ink); }
.st-fail { color: var(--bad); }
.st-copybox { width: 100%; min-height: 84px; margin-top: 8px; font: inherit; font-size: 13px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; }

/* The stage pill: Early neutral, Advanced blue, Near RTB green, RTB deep green. */
.st-stage { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--chip); color: var(--ink-2); }
.st-stage-advanced { background: var(--info-soft); color: var(--info); }
.st-stage-near { background: var(--accent-soft); color: var(--accent-ink); }
.st-stage-rtb { background: var(--ok); color: var(--on-accent); }

/* The four stages: a strip on the page, pills on the card. Passed ones in --ok, the current one in --accent. */
.st-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.st-strip .st-step { padding-top: 8px; border-top: 3px solid var(--line-strong); color: var(--muted); font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
.st-strip .st-step.passed { border-color: var(--ok); color: var(--ok); }
.st-strip .st-step.current { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.st-pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.st-pills .st-step { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--chip); color: var(--muted); }
.st-pills .st-step.passed { background: var(--ok-soft); color: var(--ok); }
.st-pills .st-step.current { background: var(--accent); color: var(--on-accent); }
.st-bar { height: 8px; }
.st-bar > span, .st-mini > span { background: var(--accent); }
.st-mini { height: 5px; min-width: 60px; }

/* Status chips: the label is always in the chip, never only a colour. */
.st-chip { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--chip); color: var(--muted); min-width: 64px; justify-content: center; }
.st-chip.st-ok { background: var(--ok-soft); color: var(--ok); }
.st-chip.st-warn { background: var(--warn-soft); color: var(--warn-ink); }
.st-chip.st-info { background: var(--info-soft); color: var(--info); }
.st-chip.st-bad { background: var(--bad-soft); color: var(--bad); }
.st-chip.st-off { background: var(--chip); color: var(--muted); }

/* Parts switch and the List | Tiles switch. */
.st-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.st-parts { margin: 0; }

/* The items. */
.st-items { list-style: none; margin: 0; padding: 0; }
.st-item { padding: 12px 0; border-top: 1px solid var(--line-2); }
.st-items > .st-item:first-child { border-top: none; }
.st-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-rowid { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.st-item-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.st-sec-name { flex-basis: 100%; }
.st-basis { margin-top: 4px; }
.st-docs { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.st-docs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; overflow-wrap: anywhere; }
.st-doc-path { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.st-doc-page { font-size: 12px; color: var(--muted); }
.st-override { margin-top: 6px; color: var(--ink-2); }
.st-item-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.st-edit { margin-top: 8px; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 10px; max-width: 560px; }

/* Checklist, List look: one row per section. */
.st-secs { display: flex; flex-direction: column; }
.st-sec { border-top: 1px solid var(--line-2); }
.st-secs > .st-sec:first-child { border-top: none; }
.st-sec-row { width: 100%; justify-content: flex-start; flex-wrap: wrap; text-align: left; white-space: normal; background: transparent; color: var(--ink); border-radius: var(--r); padding: 8px 6px; gap: 12px; }
.st-sec-row:hover { background: var(--surface-2); }
.st-sec-title { flex: 1 1 220px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.st-sec-row .st-mini { flex: 0 0 90px; }
.st-sec-count { color: var(--muted); font-size: 13px; min-width: 44px; text-align: right; }
.st-sec-body { padding: 0 6px 8px 14px; }

/* Checklist, Tiles look: a grid of sections with the picked one's items in a panel. */
.st-tiles-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.st-tile { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 6px; white-space: normal; text-align: left; min-height: 92px; padding: 12px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.st-tile .bar { align-self: stretch; }
.st-tile .st-chip { background: var(--surface); }
.st-tile-name { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.st-tile-count { font-size: 12px; color: var(--ink-2); }
.st-tile.st-t-done { background: var(--ok-soft); }
.st-tile.st-t-open { background: var(--warn-soft); }
.st-tile.st-t-gap { background: var(--bad-soft); }
.st-tile.st-t-none { background: var(--chip); }
.st-tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.st-panel { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; min-width: 0; }
.st-panel h3 { margin-bottom: 4px; }

/* Plan 51 G1: every status as one segmented bar and a legend (Done, Filed needs review, Incomplete, Pending, Missing). */
.st-seg { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--track); gap: 2px; }
.st-seg > span { min-width: 3px; }
.st-seg-ok { background: var(--ok); }
.st-seg-warn { background: var(--warn-ink); }
.st-seg-info { background: var(--info); }
.st-seg-bad { background: var(--bad); }
.st-seg-off { background: var(--muted); }
.st-legend { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); }
.st-legend li { display: inline-flex; align-items: center; gap: 5px; }
.st-legend .st-zero { opacity: 0.55; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

/* The Progress card. */
.st-card-body { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.st-card-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.st-card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.st-card-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.st-ring { position: relative; width: 60px; height: 60px; flex-shrink: 0; }
.st-ring svg { width: 60px; height: 60px; stroke-width: 6; stroke-linecap: round; }
.st-ring-track { fill: none; stroke: var(--track); }
.st-ring-fill { fill: none; stroke: var(--accent); }
.st-ring-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }

@media (max-width: 900px) {
  .st-snap, .st-snap:has(#status-financials-card[hidden]) { grid-template-columns: minmax(0, 1fr); }
  .st-tiles-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .st-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-card-body { grid-template-columns: auto minmax(0, 1fr); }
  .st-card-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .st-big { font-size: 32px; }
  .st-sec-row .st-mini { flex: 1 1 80px; }
}
