/* ==========================================================================
   CLIENT HEALTH (2026-10-23) — admin/client-health.html.

   The Office's own cards, strips, tables, state words and drawers
   (office.css) carry the page; this adds only what client health has that
   nothing else does: the month at the top, a nudge with its email, the
   table's quiet and unknown cells, the rules, the switches and the log. Its
   own prefix (ch-), so it cannot meet another pass's class
   (tools/css-collide-check.mjs).

   Colour only for state (rule 7): the Office's ok, attention and bad inks,
   on the words that are a state. Unknown is a dash in the faint ink, never
   the attention colour (office-health rule 4).
   ========================================================================== */

#office .ch-boot { margin: 0 0 1.25rem; color: var(--o-dim); font-size: var(--o-t-md); font-weight: 550; line-height: 1.5; }
#office .ch-boot .ofc-ghost { margin-left: 0.5rem; }
#office .ch-views { margin: 0 0 1.5rem; }
#office .ch-views .ofc-addr__b { text-decoration: none; }
#office .ch-view[hidden] { display: none; }

/* ── the owner's month ──────────────────────────────────────────────────── */
#office .ch-month { margin: 0 0 1.5rem; }
#office .ch-month.is-reading { visibility: hidden; min-height: 9.5rem; }
#office .ch-month__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 0.75rem; }
#office .ch-month__h { margin: 0; font: 650 1rem/1.3 var(--display); color: var(--o-text); }
#office .ch-month__pick { width: auto; min-width: 12rem; }
#office .ch-month__stats { margin-bottom: 0.75rem; }
#office .ch-month__stats .ofc-stat { max-width: 15rem; }
#office .ch-month__note { margin: 0 0 0.25rem; font-size: var(--o-t-sm); color: var(--o-faint); line-height: 1.45; max-width: 52rem; }

/* ── care, measured (care-2): delivery, small changes, security updates ─── */
#office .ch-care__said { margin: 0 0 0.75rem; font-size: var(--o-t-md); line-height: 1.5; color: var(--o-text); max-width: 52rem; }
#office .ch-care .ofc-tablewrap, #office .ch-costs .ofc-tablewrap { margin: 0 0 1rem; }
#office .ch-care__decide { margin: 0.5rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--o-line); max-width: 52rem; }
#office .ch-care__decide h3 { margin: 0 0 0.5rem; font: 650 var(--o-t-md)/1.3 var(--display); color: var(--o-text); }
#office .ch-care__decide p { margin: 0 0 0.5rem; line-height: 1.5; color: var(--o-text); }
#office .ch-care__choices { margin: 0 0 0.5rem; padding-left: 1.25rem; display: grid; gap: 0.5rem; line-height: 1.5; color: var(--o-dim); }

/* ── who needs a nudge today ─────────────────────────────────────────────── */
#office .ch-today { list-style: none; margin: 0; padding: 0; display: grid; }
#office .ch-nudge { display: grid; gap: 0.75rem; padding: 1rem 0; border-top: 1px solid var(--o-line); min-width: 0; }
#office .ch-nudge:first-child { border-top: 0; padding-top: 0.25rem; }
#office .ch-nudge__top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
#office .ch-nudge__name { font: 650 var(--o-t-md)/1.3 var(--display); color: var(--o-text); text-decoration: none; }
#office .ch-nudge__name:hover { text-decoration: underline; text-underline-offset: 3px; }
#office .ch-nudge__why { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.25rem; }
#office .ch-nudge__why li { font-size: var(--o-t-sm); line-height: 1.45; color: var(--o-dim); }
#office .ch-nudge__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
#office .ch-nudge__see { margin-left: auto; font-size: var(--o-t-sm); }
#office .ch-nudge__done { margin: 0; font-size: var(--o-t-sm); color: var(--o-faint); line-height: 1.45; }
#office .ch-nudge__done.is-sent { color: var(--o-ok); }

/* The email: closed to its subject, opened to read or change it. */
#office .ch-mail { border: 1px solid var(--o-line-2); border-radius: var(--o-r-sm, var(--tk-r-sm)); background: var(--o-sunk, var(--tk-grey-0b)); min-width: 0; }
#office .ch-mail__s { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; min-height: 40px; padding: 0.75rem 0.75rem; cursor: pointer; list-style: none; }
#office .ch-mail__s::-webkit-details-marker { display: none; }
#office .ch-mail__s::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--o-faint); border-bottom: 1.5px solid var(--o-faint); transform: rotate(-45deg); margin-right: 0.25rem; align-self: center; transition: transform var(--tk-dur-fast) ease; }
#office .ch-mail[open] > .ch-mail__s::before { transform: rotate(45deg); }
#office .ch-mail__k { font-size: var(--o-t-label); font-weight: 600; color: var(--o-faint); }
#office .ch-mail__subj { font-size: var(--o-t-sm); color: var(--o-text); overflow-wrap: anywhere; }
#office .ch-mail__to { margin: 0; padding: 0 0.75rem; font-size: var(--o-t-sm); color: var(--o-faint); }
#office .ch-mail__subject, #office .ch-mail__body { display: block; width: calc(100% - 1.5rem); margin: 0.75rem 0.75rem 0; box-sizing: border-box; }
#office .ch-mail__body { margin-bottom: 0.75rem; min-height: 9rem; resize: vertical; font: 400 var(--o-t-sm)/1.55 var(--body); white-space: pre-wrap; }
#office .ch-note { margin: 0; font-size: var(--o-t-sm); line-height: 1.45; color: var(--o-dim); }
#office .ch-note:empty { display: none; }
#office .ch-note[data-tone="bad"] { color: var(--o-bad); }

/* ── every client ──────────────────────────────────────────────────────── */
#office .ch-all { width: 100%; }
#office .ch-all th { white-space: nowrap; }
#office .ch-all td { vertical-align: top; font-size: var(--o-t-sm); }
#office .ch-all__a { font-weight: 600; color: var(--o-text); text-decoration: none; }
#office .ch-all__a:hover { text-decoration: underline; text-underline-offset: 3px; }
#office .ch-all__state { min-width: 11rem; }
#office .ch-all__why { display: block; margin-top: 0.25rem; font-size: var(--o-t-label); line-height: 1.4; color: var(--o-faint); max-width: 18rem; }
#office .ch-all__c [data-tone="bad"] { color: var(--o-bad); }
#office .ch-all__c [data-tone="attn"] { color: var(--o-warn-ink); }
#office .ch-all__c [data-tone="ok"] { color: var(--o-ok); }
#office .ch-quiet { color: var(--o-faint); }
#office .ch-dash { color: var(--o-faint); }
#office .ch-unknown { margin: 0.75rem 0 0; padding: 0 0 0 1rem; font-size: var(--o-t-sm); color: var(--o-dim); line-height: 1.5; }

/* ── the fleet (queue 35): five signals a client, each with when it was read ── */
#office .ch-fl { width: 100%; }
#office .ch-fl th { white-space: nowrap; }
#office .ch-fl td { vertical-align: top; font-size: var(--o-t-sm); }
#office .ch-fl__v { display: block; overflow-wrap: anywhere; }
#office .ch-fl__v[data-tone="bad"] { color: var(--o-bad); }
#office .ch-fl__v[data-tone="attn"] { color: var(--o-warn-ink); }
#office .ch-fl__v[data-tone="ok"] { color: var(--o-ok); }
#office .ch-fl__at { display: block; margin-top: 0.2rem; font-size: var(--o-t-label); line-height: 1.4; color: var(--o-faint); max-width: 16rem; overflow-wrap: anywhere; }
#office .ch-fleet .ofc-state[data-tone="attn"] { color: var(--o-warn-ink); }

/* The rules, closed until asked. */
#office .ch-rules-d { margin-top: 1.25rem; border-top: 1px solid var(--o-line); padding-top: 0.75rem; }
#office .ch-rules-d > summary { display: inline-flex; align-items: center; min-height: 32px; cursor: pointer; font-size: var(--o-t-sm); font-weight: 600; color: var(--o-dim); }
#office .ch-rules-d > summary:hover { color: var(--o-text); }
#office .ch-rules__p { margin: 0.5rem 0; font-size: var(--o-t-sm); color: var(--o-dim); line-height: 1.5; max-width: 52rem; }
#office .ch-rules__l { margin: 0.5rem 0 1rem; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
#office .ch-rules__i { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 0.75rem; align-items: baseline; font-size: var(--o-t-sm); color: var(--o-text); line-height: 1.45; }
#office .ch-rules__t { margin: 0.25rem 0 0; padding-left: 1.25rem; font-size: var(--o-t-sm); color: var(--o-text); line-height: 1.6; }

/* ── monthly reports ──────────────────────────────────────────────────── */
#office .ch-rep__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0.75rem 0; }
#office .ch-rep__bar .ofc-input { width: auto; min-width: 12rem; }
#office .ch-rep__line { margin: 0 0 1rem; font-size: var(--o-t-md); line-height: 1.5; color: var(--o-dim); max-width: 56rem; }
#office .ch-rep__line[data-tone="attn"] { color: var(--o-warn-ink); }
#office .ch-rep__line[data-tone="ok"] { color: var(--o-ok); }
#office .ch-rep__name { font-weight: 600; color: var(--o-text); }
#office .ch-rep__sum { max-width: 30rem; color: var(--o-dim); line-height: 1.45; }
#office .ch-rep__act { white-space: nowrap; }
#office .ch-rep__act > * + * { margin-left: 0.5rem; }

/* One report, in the drawer. */
#office .ch-dlg__sum { margin: 0 0 0.75rem; font: 500 1.0625rem/1.5 var(--display); color: var(--o-text); }
#office .ch-dlg__ul { margin: 0 0 1rem; padding-left: 1.25rem; font-size: var(--o-t-sm); line-height: 1.6; color: var(--o-text); }
#office .ch-dlg__sec { margin: 0 0 1rem; padding-top: 0.75rem; border-top: 1px solid var(--o-line); }
#office .ch-dlg__h { margin: 0 0 0.5rem; font: 650 var(--o-t-md)/1.3 var(--display); color: var(--o-text); }
#office .ch-dlg__dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1rem; margin: 0; font-size: var(--o-t-sm); }
#office .ch-dlg__dl dt { color: var(--o-dim); }
#office .ch-dlg__dl dd { margin: 0; color: var(--o-text); text-align: right; font-variant-numeric: tabular-nums; }
#office .ch-dlg__guard { margin: 0 0 1rem; padding: 0.75rem 0.75rem; border: 1px solid var(--o-line-2); border-left: 2px solid var(--o-warn); border-radius: var(--o-r-sm, var(--tk-r-sm)); font-size: var(--o-t-sm); color: var(--o-dim); }
#office .ch-dlg__guard p { margin: 0 0 0.5rem; }
#office .ch-dlg__guard ul { margin: 0; padding-left: 1.25rem; }

/* ── switches ──────────────────────────────────────────────────────────── */
#office .ch-sw { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1.5rem; align-items: center; padding: 0.75rem 0; border-top: 1px solid var(--o-line); }
#office .ch-sw-card h2 + .ofc-sub { margin-bottom: 0.5rem; max-width: 60rem; }
#office .ch-sw__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 0.75rem; min-width: 0; }
#office .ch-sw__head .ofc-st { flex: none; min-width: 7.5rem; }
#office .ch-sw__l { font-size: var(--o-t-sm); color: var(--o-text); line-height: 1.45; }
/* The select stands in one column on every row; what a change said goes under it, never beside it. */
#office .ch-sw__ctl { display: grid; justify-items: end; gap: 0.25rem; }
#office .ch-sw__v { width: auto; min-width: 13rem; }
#office .ch-sw__said { font-size: var(--o-t-label); color: var(--o-faint); }
#office .ch-sw__said:empty { display: none; }
#office .ch-log { list-style: none; margin: 0; padding: 0; }
#office .ch-log__i { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.75rem 0; border-top: 1px solid var(--o-line); font-size: var(--o-t-sm); }
#office .ch-log__who { font-weight: 600; color: var(--o-text); }
#office .ch-log__s { color: var(--o-dim); overflow-wrap: anywhere; }
#office .ch-log__by { color: var(--o-faint); }

/* ── a phone ───────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  #office .ch-month__head { flex-wrap: wrap; }
  #office .ch-month__pick, #office .ch-rep__bar .ofc-input { min-width: 0; width: 100%; }
  #office .ch-month__stats { gap: 0.75rem 1.5rem; }
  #office .ch-month__stats .ofc-stat { flex: 1 1 9rem; }
  #office .ch-nudge__acts .ofc-primary { flex: 1 1 auto; min-height: 44px; }
  #office .ch-nudge__see { flex-basis: 100%; margin-left: 0; }
  #office .ch-sw { grid-template-columns: minmax(0, 1fr); }
  #office .ch-sw__ctl { justify-items: stretch; }
  #office .ch-sw__v { min-width: 0; width: 100%; }
  #office .ch-rules__i { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  #office .ch-all__state { min-width: 0; }
}

/* THE STATUS PAGES (5 Nov 2026, page-client-health.mjs statusCard): a plain row of 90 days, one bar a day, an outage
   standing taller; the Office's own state marks, a hollow bar for a day not checked (no gradient fill: office-sample). */
#office .ch-st-bar { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 1px; height: 22px; min-width: 0; width: 100%; }
@media (min-width: 62rem) { #office .ch-st-bar { min-width: 270px; } }
#office .ch-st-day { flex: 1 1 0; min-width: 0; height: 16px; border-radius: var(--tk-r-2xs); background: var(--o-ok-mark); }
#office .ch-st-day[data-state="degraded"] { background: var(--o-warn); }
#office .ch-st-day[data-state="down"] { background: var(--o-bad-mark); height: 22px; }
#office .ch-st-day[data-state="unknown"] { background: transparent; box-shadow: inset 0 0 0 1px var(--o-line-4); }
#office .ch-st-day[data-state="before"] { background: var(--o-line-4); height: 3px; }
#office .ch-st-site { display: grid; gap: 0.125rem; }
#office .ch-st-link { font-size: var(--o-t-xs); }
#office .ch-st-now { display: grid; gap: 0.25rem; }
#office .ch-st-h { margin: 1rem 0 0.25rem; font: 650 var(--o-t-md)/1.3 var(--display); color: var(--o-text); }
#office .ch-st-plan { margin: 1rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--o-line); }
#office .ch-st-plan h3 { margin: 0 0 0.25rem; font: 650 var(--o-t-md)/1.3 var(--display); color: var(--o-text); }
#office .ch-st-plan__row { display: grid; grid-template-columns: 1fr; align-items: end; gap: 0.5rem 0.75rem; margin: 0.5rem 0; }
#office .ch-st-plan__row > button { justify-self: start; }
@media (min-width: 62rem) { #office .ch-st-plan__row { grid-template-columns: minmax(10rem, 1.2fr) minmax(8rem, 1fr) minmax(7rem, 0.8fr) minmax(7rem, 0.8fr) minmax(10rem, 1.4fr) auto; } }
#office .ch-st-plan__f { display: grid; gap: 0.25rem; min-width: 0; font-size: var(--o-t-xs); color: var(--o-dim); }
#office .ch-st-plan__f > :is(select, input, button) { min-width: 0; width: 100%; }
#office .ch-st-planned { margin: 0.5rem 0 0; padding-left: 1.25rem; display: grid; gap: 0.5rem; line-height: 1.45; color: var(--o-text); }

/* ── cost and margin (unit-economics, 12 Nov 2026): the month and your hour, beside the title ── */
#office .ch-costs__ctl { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
#office .ch-costs__rate { display: grid; gap: 0.25rem; font-size: var(--o-t-label); color: var(--o-dim); }
#office .ch-costs__rate .ofc-input { width: 9rem; }
@media (max-width: 760px) {
  #office .ch-costs__ctl, #office .ch-costs__rate { width: 100%; }
  #office .ch-costs__rate .ofc-input { width: 100%; }
}
