/* Office desks (CEO / COO / CTO / CFO / CMO), Home and Archive.
   Product register: one family (DM Sans), fixed scale ~1.2, border-first, no side stripes.

   Type scale (px):  11 eyebrow · 12.5 meta · 14 body · 16 section · 19 lede · 23 stat · 28 lead stat
   Spacing rhythm:   sections 40 desktop / 32 phone · inside a section 14 · inside a panel 16–20 */
:root {
  --ceo: #0e8f92; --coo: #5f7424; --cto: #3d5fa8; --cfo: #9a6410; --cmo: #a3446a;
  --warn: #b4541a;
  --fs-eyebrow: 11px; --fs-meta: 12.5px; --fs-body: 14px; --fs-section: 16px;
  --fs-lede: 19px; --fs-stat: 23px; --fs-stat-lead: 28px;
  --o-radius: 10px;
}

/* ── Page frame ─────────────────────────────────────────────────────────── */
.office-page { display: flex; flex-direction: column; gap: 40px; max-width: 1240px; }
.office-page > .office-page { gap: 40px; }
.office-q { font-size: var(--fs-lede); line-height: 1.35; font-weight: 500; color: var(--text); max-width: 46ch; text-wrap: balance; letter-spacing: -0.005em; }
.office-q.is-prose { font-size: var(--fs-body); font-weight: 400; color: var(--text-muted); max-width: 70ch; line-height: 1.6; }

/* ── Section ────────────────────────────────────────────────────────────── */
.o-section { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.o-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.o-section-head h2 { font-size: var(--fs-section); font-weight: 600; letter-spacing: -0.005em; }
.o-section-head .o-note { font-size: var(--fs-meta); color: var(--text-muted); }
.o-section-head a { font-size: var(--fs-meta); font-weight: 500; }

/* Two sections side by side on wide screens. */
.o-pair { display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 1180px) { .o-pair { grid-template-columns: 1fr 1fr; gap: 32px; } }

/* ── Stat panel: one bordered surface, cells divided by hairlines ───────── */
.o-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--o-radius); overflow: hidden; }
.o-tile { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; color: inherit; position: relative;
  box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); }
a.o-tile { transition: background-color .15s ease-out; }
a.o-tile:hover { background: var(--surface-raised); text-decoration: none; }
a.o-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.o-tile .o-label { font-size: var(--fs-meta); font-weight: 500; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.o-tile .o-value { font-size: var(--fs-stat); font-weight: 500; line-height: 1.15; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--text); }
.o-tile .o-sub { font-size: var(--fs-meta); color: var(--text-muted); line-height: 1.45; max-width: 36ch; }
.o-tile .o-def { font-size: var(--fs-eyebrow); color: var(--text-muted); opacity: .85; line-height: 1.4; margin-top: 2px; }
.o-tile.is-lead .o-value { font-size: var(--fs-stat-lead); }
/* State: a dot before the label and a coloured value. Never a side stripe. */
.o-tile.is-bad .o-label::before, .o-tile.is-warn .o-label::before, .o-tile.is-ok .o-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.o-tile.is-bad .o-label::before { background: var(--red); }
.o-tile.is-warn .o-label::before { background: var(--yellow); }
.o-tile.is-ok .o-label::before { background: var(--green); }
.o-tile.is-bad .o-value { color: var(--red); }
.o-tile.is-warn .o-value { color: var(--yellow); }

/* ── Panel: a single surface for charts and checks ─────────────────────── */
.o-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--o-radius); padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.o-panel-title { font-size: var(--fs-body); font-weight: 600; }
.o-panel-sub { font-size: var(--fs-meta); color: var(--text-muted); line-height: 1.5; max-width: 72ch; }
.o-panel-sub b { color: var(--text); font-weight: 600; }

/* Callout for one sentence that changes how to read the numbers. */
.o-callout { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--o-radius); padding: 12px 16px; font-size: var(--fs-meta); line-height: 1.5; color: var(--text); background: var(--surface); }
.o-callout::before { content: "!"; flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--surface); background: var(--yellow); margin-top: 1px; }
.o-callout b { font-weight: 600; }
.o-callout.warn { background: var(--yellow-dim); border-color: rgba(180,83,9,.25); }

/* ── Horizontal bars (aging, stages) ───────────────────────────────────── */
.o-bars { display: flex; flex-direction: column; gap: 8px; }
.o-bar { display: grid; grid-template-columns: minmax(96px, 150px) 1fr minmax(72px, auto); gap: 12px; align-items: center; font-size: var(--fs-meta); }
.o-bar > span:first-child { color: var(--text-muted); }
.o-bar .track { height: 10px; background: var(--surface-raised); border-radius: 5px; overflow: hidden; }
.o-bar .fill { height: 100%; background: var(--oc, var(--accent)); border-radius: 5px; }
.o-bar .fill.out { background: var(--warn); }
.o-bar .v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Column chart (13-week outlook) ────────────────────────────────────── */
.o-cols { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; padding-top: 18px; }
.o-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; min-width: 0; }
.o-col .amt { font-size: 10.5px; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.o-col .bar { width: 100%; max-width: 34px; background: var(--oc, var(--accent)); border-radius: 4px 4px 0 0; min-height: 2px; }
.o-col .bar.zero { background: var(--surface-raised); }
.o-col-x { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 6px; border-top: 1px solid var(--border); padding-top: 6px; }
.o-col-x span { font-size: 10.5px; color: var(--text-muted); text-align: center; white-space: nowrap; overflow: hidden; }

/* ── Lists ─────────────────────────────────────────────────────────────── */
.o-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--o-radius); overflow: hidden; }
.o-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 11px 18px; border-top: 1px solid var(--border); font-size: var(--fs-body); align-items: baseline; }
.o-row:first-child { border-top: 0; }
.o-row .o-meta { font-size: var(--fs-meta); color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.o-row .o-meta.bad { color: var(--red); font-weight: 500; }
.o-row .o-meta.warn { color: var(--yellow); font-weight: 500; }
.o-empty { padding: 16px 18px; font-size: var(--fs-meta); color: var(--text-muted); }
.o-tag { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; padding: 1px 6px; border-radius: 4px; background: var(--muted-dim); color: var(--text-muted); margin-left: 6px; vertical-align: 1px; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.o-split { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 900px) { .o-split { grid-template-columns: 3fr 2fr; } }
.o-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--o-radius); min-width: 0; }
.o-table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.o-table th { text-align: left; font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.o-table td { padding: 10px 16px; border-top: 1px solid var(--border); vertical-align: top; font-variant-numeric: tabular-nums; }
.o-table tr:nth-child(2) td { border-top: 0; }
.o-table .num { text-align: right; white-space: nowrap; }
.o-table .strong td { font-weight: 600; }
.o-table .o-note { font-size: var(--fs-eyebrow); color: var(--text-muted); font-weight: 400; }
.o-table a { font-weight: 500; }

.o-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.o-pill.on { background: var(--green-dim); color: var(--green); }
.o-pill.off { background: rgba(180,84,26,.12); color: var(--warn); }
.o-pill.na { background: var(--muted-dim); color: var(--text-muted); font-weight: 500; }
.o-who { font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .08em; }

/* ── Checks and the close checklist ────────────────────────────────────── */
.o-checks { display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-body); }
.o-check { display: flex; gap: 10px; align-items: baseline; }
.o-check .mark { width: 16px; flex: none; font-weight: 700; }
.o-check.ok .mark { color: var(--green); }
.o-check.bad .mark { color: var(--red); }
.o-check.na .mark { color: var(--text-muted); }
.o-close { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.o-close div { font-size: 12px; padding: 8px 10px; border-radius: 6px; background: var(--surface-raised); color: var(--text-muted); line-height: 1.35; }
.o-close div.auto { background: var(--accent-dim); color: var(--text); }
.o-close div b { display: block; font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .02em; color: var(--text); margin-bottom: 1px; }

/* ── Document strip ────────────────────────────────────────────────────── */
.o-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.o-strip a, .o-strip span { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: var(--fs-meta); color: var(--text); white-space: nowrap; transition: border-color .15s ease-out; }
.o-strip a:hover { border-color: var(--accent); text-decoration: none; }
.o-strip b { font-weight: 600; margin-right: 5px; font-variant-numeric: tabular-nums; }

/* ── Coming next: quiet, one block ─────────────────────────────────────── */
.o-soon-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; border: 1px dashed var(--border); border-radius: var(--o-radius); padding: 16px 20px; }
.o-soon { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.o-soon h3 { font-size: var(--fs-meta); font-weight: 600; color: var(--text); }
.o-soon ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.o-soon li { font-size: var(--fs-meta); color: var(--text-muted); line-height: 1.4; display: flex; justify-content: space-between; gap: 12px; }
.o-stop { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--muted-dim); color: var(--text-muted); white-space: nowrap; align-self: flex-start; }

/* ── Home: scorecard beside the five desks on wide screens ─────────────── */
.home-grid { display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 1180px) { .home-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 32px; align-items: start; } }
.o-desks { grid-template-columns: 1fr; }
.o-desks .o-tile { flex-direction: row; align-items: center; gap: 14px; padding: 14px 18px; }
.o-desks .o-desk-name { font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .08em; color: var(--oc); width: 34px; flex: none; }
.o-desks .o-desk-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.o-desks .o-tile .o-value { font-size: 20px; text-align: right; flex: none; }

.o-loading { color: var(--text-muted); font-size: var(--fs-meta); padding: 8px 0; }
.o-err { color: var(--red); font-size: var(--fs-meta); }

/* ── Phone ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .office-page, .office-page > .office-page, .o-pair, .home-grid { gap: 32px; }
  .office-q { font-size: 17px; }
  .o-tiles { grid-template-columns: 1fr 1fr; }
  .o-tile { padding: 14px 14px 16px; }
  .o-tile .o-value { font-size: 20px; }
  .o-tile.is-lead .o-value { font-size: 24px; }
  /* An odd last stat takes the full row, so no half-empty cell. */
  .o-tiles:not(.o-desks) > .o-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* Stacked tables: each row becomes a block with labelled cells. */
  .o-stack tr:first-child { display: none; }
  .o-stack tr { display: block; padding: 12px 14px; border-top: 1px solid var(--border); }
  .o-stack tr:nth-child(2) { border-top: 0; }
  .o-stack td { display: block; padding: 2px 0; border: 0; font-size: var(--fs-meta); }
  .o-stack td:first-child { font-size: var(--fs-body); padding-bottom: 4px; }
  .o-stack td[data-label]::before { content: attr(data-label) " · "; color: var(--text-muted); font-weight: 500; }
  .o-tile .o-sub { font-size: 12px; }
  .o-panel { padding: 16px; }
  .o-bar { grid-template-columns: 88px 1fr auto; gap: 10px; }
  .o-row { grid-template-columns: 1fr; padding: 11px 14px; }
  .o-row .o-meta { white-space: normal; }
  .o-table th, .o-table td { padding: 9px 12px; }
  .o-close { grid-template-columns: 1fr 1fr; }
  .o-cols { height: 120px; gap: 3px; }
  .o-col-x { gap: 3px; }
  .o-col .amt { font-size: 9.5px; }
  .o-col-x span { visibility: hidden; overflow: visible; }
  .o-col-x span:nth-child(4n+1) { visibility: visible; }
  .o-soon-wrap { padding: 14px 16px; }
  /* Scorecard becomes stacked rows: name and mark, then this week against the goal. */
  .o-score tr:first-child { display: none; }
  .o-score tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name mark" "now goal"; column-gap: 12px; row-gap: 2px; padding: 11px 14px; border-top: 1px solid var(--border); }
  .o-score tr:nth-child(2) { border-top: 0; }
  .o-score td { padding: 0; border: 0; text-align: left; }
  .o-score td:nth-child(1) { grid-area: name; font-weight: 500; }
  .o-score td:nth-child(2) { display: none; }
  .o-score td:nth-child(3) { grid-area: goal; justify-self: end; font-size: var(--fs-meta); color: var(--text-muted); }
  .o-score td:nth-child(4) { grid-area: now; font-size: var(--fs-meta); color: var(--text-muted); text-align: left; }
  .o-score td:nth-child(5) { grid-area: mark; justify-self: end; }
  .o-score td:nth-child(3)::before { content: "Goal "; }
  .o-score td:nth-child(4)::before { content: "This week "; }
  .o-desks { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .o-tiles:not(.o-desks) { grid-template-columns: 1fr; }
}
.page-content > .office-page { padding-top: 8px; }
