/* The client page (account record). Semantic tokens only: no hex, no rgba (tests/static.mjs S-a2). No coloured side stripes and no status
   dots: a state is a word. The only marks are the owner mark, Live and Gilt. Sizes follow the kit's tokens, so Compact and Comfortable
   follow. The Monthly Overview deck has its own sheet, css/report.css, because it is paper in a frame. */

/* ── Layout ────────────────────────────────────────────────────────────────────────────── */
.module--account { min-width: 0; }
.ar-tab { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.ar-lede { max-width: var(--measure); }
.ar-breach { display: inline-flex; margin-left: var(--s-3); }
.ar-tabhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); }
.ar-tabhead .ar-block-t { margin: 0; }
.ar-secgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); min-width: 0; }
.ar-seccol { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
@container rp-main (min-width: 860px) { .ar-secgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.ar-secgrid .rs-grid { grid-template-columns: minmax(0, 1fr); }
.ar-ctrs { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.ar-lists { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }
[data-anchor], .ctr[data-ctr], .rs { scroll-margin-top: calc(var(--head-h) + var(--top) + var(--s-3)); }

/* ── Cards, blocks, notes ──────────────────────────────────────────────────────────────── */
.ar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); min-width: 0; overflow: hidden; }
.ar-card.ar-leads { list-style: none; padding: 0; margin: 0; }
.ar-pad { padding: var(--s-3); }
.ar-block { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.ar-block-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-3); }
.ar-block-t { font-size: var(--fs-h3); font-weight: 700; margin: 0; }
.ar-block-t--inline { display: inline; }
.ar-block-n { color: var(--text-3); }
.ar-block-a { margin-left: auto; display: inline-flex; gap: var(--s-2); }
.ar-block-b { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.ar-note { color: var(--text-3); font-size: var(--fs-caption); line-height: 1.5; margin: 0; max-width: var(--measure); }
.ar-note.ar-pad { padding-top: var(--s-2); }
.ar-clear { color: var(--text-3); margin: 0; }
.ar-loading { padding: var(--s-2) 0; }
.ar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.ar-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); }
.ar-push { margin-left: auto; display: inline-flex; gap: var(--s-2); }
.ar-form { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.ar-narrow { max-width: 11rem; }
.ar-inline { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ar-inline-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.ar-tag { margin-left: var(--s-2); padding: 0 var(--s-2); border: 1px solid var(--line-strong); border-radius: var(--r-button); font-size: var(--fs-caption); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.ar-hold { margin-left: var(--s-2); font-size: var(--fs-caption); font-weight: 700; color: var(--accent-text); }
.ar-state-word { font-weight: 700; }
.ar-stale { color: var(--accent-text); font-weight: 600; }
.ar-gate { color: var(--text-3); font-weight: 600; font-size: var(--fs-caption); }
.ar-doc { min-height: 16rem; }
.ar-line { padding: var(--s-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-card); user-select: all; line-height: 1.55; }
.ar-preview-card { padding: var(--s-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: var(--s-3); display: flex; flex-direction: column; gap: 4px; }
.ar-preview-t { font-weight: 700; }
.ar-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ar-md { color: var(--text-2); display: flex; flex-direction: column; gap: var(--s-2); }
.ar-md h2, .ar-md h3, .ar-md h4, .ar-md h5 { color: var(--text); font-weight: 700; margin: var(--s-2) 0 0; }
.ar-md ul { padding-left: var(--s-4); display: flex; flex-direction: column; gap: 4px; }
.ar-em { font-style: normal; font-weight: 600; }
.ar-kv { display: grid; grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr); gap: var(--s-1) var(--s-4); margin: 0; padding: var(--s-3); }
.ar-kv > div { display: contents; }
.ar-kv dt { font-size: var(--fs-caption); font-weight: 600; color: var(--text-3); }
.ar-kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ar-kv .is-bad dd { color: var(--accent-text); }
.ar-swatch-row { display: inline-flex; align-items: center; gap: var(--s-2); }
.ar-swatch { width: 12px; height: 12px; border-radius: 2px; border: 1px solid var(--line-strong); flex: none; }

/* ── Rows (the CC v3 qrow): title and sub, a state word, actions ───────────────────────── */
.ar-rows { display: flex; flex-direction: column; }
.ar-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); min-height: 52px; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); position: relative; }
.ar-rows > .ar-row:last-child, .ar-card > .ar-row:last-child { border-bottom: 0; }
.ar-row-lead { flex: none; display: inline-flex; align-items: center; }
.ar-row-main { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ar-row-t { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.ar-row-s { font-size: var(--fs-caption); color: var(--text-3); overflow-wrap: anywhere; }
.ar-row-state { font-size: var(--fs-caption); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.ar-row-acts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-left: auto; }
.ar-row--click { padding: 0; }
.ar-row--click > .ar-row-link { flex: 1 1 14rem; min-width: 0; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); text-align: left; color: inherit; text-decoration: none; min-height: 52px; }
.ar-row--click > .ar-row-state, .ar-row--click > .ar-row-acts { padding-right: var(--s-3); }
@media (hover: hover) { .ar-row--click:hover { background: var(--hover); } }
.ar-row.is-stale .ar-row-s { color: var(--accent-text); }
.ar-wait { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.ar-wait.is-late { color: var(--accent-text); }
.ar-thumb { width: 36px; height: 36px; flex: none; border-radius: var(--r-button); object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); display: inline-grid; place-items: center; }
.ar-thumb--logo { width: 54px; height: 54px; object-fit: contain; font-size: 11px; }
.ar-thumb--none { color: var(--text-3); text-align: center; line-height: 1.1; }
.ar-logo-row { display: flex; align-items: center; gap: var(--s-3); }
.ar-identity { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3) var(--s-4); }
.ar-identity .ar-inline { flex: 1 1 14rem; }

/* ── Switch ───────────────────────────────────────────────────────────────────────────── */
.ar-switch { position: relative; width: 44px; height: 44px; min-height: 44px; padding: 0; background: none; border: 0; flex: none; display: inline-grid; place-items: center; }
.ar-switch::before { content: ""; width: 40px; height: 24px; border-radius: var(--r-card); border: 1.5px solid var(--text-3); background: transparent; transition: background-color var(--t-feedback) var(--ease-out), border-color var(--t-feedback) var(--ease-out); }
.ar-switch-k { position: absolute; left: 7px; top: 50%; translate: 0 -50%; width: 14px; height: 14px; border-radius: 3px; background: var(--text-3); transition: transform var(--t-feedback) var(--ease-out), background-color var(--t-feedback) var(--ease-out); }
.ar-switch.is-on::before { background: var(--text); border-color: var(--text); }
.ar-switch.is-on .ar-switch-k { transform: translateX(16px); background: var(--bg); }
.ar-switch:disabled { opacity: 0.45; cursor: not-allowed; }
.ar-switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── Their leads, Reviews ─────────────────────────────────────────────────────────────── */
.ar-lead { padding: var(--s-2) var(--s-3) var(--s-3); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--s-2); }
.ar-lead:last-child { border-bottom: 0; }
.ar-lead-main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.ar-lead-main .ar-row-main { flex: 1 1 16rem; }
.ar-lead-note { display: flex; gap: var(--s-2); }
.ar-lead-note .input { flex: 1; min-width: 0; }
.ar-status-sel { width: 9.5rem; }
.ar-review { display: flex; flex-direction: column; }
.ar-quote { color: var(--text-2); margin: 0 0 var(--s-3); }

/* ── View as client ───────────────────────────────────────────────────────────────────── */
.ar-pv { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.ar-pv-ribbon { padding: var(--s-2) var(--s-3); border: 1px solid var(--accent-mark); border-radius: var(--r-button); color: var(--accent-text); font-weight: 700; font-size: var(--fs-caption); letter-spacing: 0.04em; }
.ar-pv-head, .ar-pv-card, .ar-pv-stat { position: relative; padding: var(--s-2) var(--s-4) var(--s-2) var(--s-3); background: var(--surface-2); border-radius: var(--r-button); }
.ar-pv-name { font-weight: 800; font-size: var(--fs-h3); }
.ar-pv-sub, .ar-pv-k, .ar-pv-l { font-size: var(--fs-caption); font-weight: 600; color: var(--text-3); }
.ar-pv-t { color: var(--text-2); }
.ar-pv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--s-2); }
.ar-pv-n { font-size: var(--fs-h2); font-weight: 800; font-variant-numeric: tabular-nums; }
.ar-pv-fix { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; display: inline-grid; place-items: center; color: var(--text-3); border-radius: var(--r-button); }
@media (hover: hover) { .ar-pv-fix:hover { color: var(--text); background: var(--hover); } }
.ar-pv-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }

/* ── Monthly report ───────────────────────────────────────────────────────────────────── */
.ar-report { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-3); }
.ar-report-stage { min-width: 0; }
.ar-deck { display: block; width: 100%; height: 72vh; border: 1px solid var(--line-strong); border-radius: var(--r-card); background: var(--surface-2); }
html.is-present .ar-deck { height: 86vh; }
.ar-report-foot { margin: 0; }

/* ── Deep links: the block a pencil lands on is marked for a moment ───────────────────── */
.anchor-hi { outline: 2px solid var(--accent-mark); outline-offset: 6px; border-radius: var(--r-card); }

@media (max-width: 719px) {
  .ar-row-acts { margin-left: 0; width: 100%; }
  .ar-row-state { white-space: normal; }
  .ar-deck { height: 70vh; }
  .ar-status-sel { width: 100%; }
  .ar-lead-main .ar-row-acts { width: 100%; }
  .ar-block-a { margin-left: 0; width: 100%; }
}

/* An honest state in a container head ("Needs Auri's yes", then the reason) wraps on a phone instead of pushing the page wider. */
.module--account .ctr-line { flex-wrap: wrap; }
.module--account .ctr .state { white-space: normal; }
.ar-tabhead .btn { white-space: normal; text-align: left; max-width: 100%; }

/* ── P6: Share a preview, the Monthly report v2 (Generate step, Send panel), Brand and elements, Suggested follow-up ───────────── */
.ar-field { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.ar-line--pre { white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.ar-logline { margin: 0; padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-button); color: var(--text-2); font-size: var(--fs-caption); }
.ar-note-box { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); }
.ar-sendoff { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-card); }
.ar-sendoff-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); }
.ar-sendoff-row > .btn, .ar-sendoff-row > .ar-switch { flex: none; }
.ar-sendoff-why { flex: 1 1 14rem; min-width: 0; color: var(--text-3); font-size: var(--fs-caption); line-height: 1.5; }
.ar-sendoff-why b { color: var(--text-2); font-weight: 700; }
.ar-path { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ar-thumb--mini { width: 28px; height: 28px; }
.ar-why { display: flex; flex-direction: column; gap: 2px; }
.ar-why-line { display: block; }
.ar-followup { display: flex; flex-direction: column; gap: var(--s-1); }

/* Monthly report: the Generate step */
.ar-gen { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.ar-gen-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-3); }
.ar-gen-bullets { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); min-width: 0; }
@container rp-main (min-width: 760px) { .ar-gen-bullets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ar-bullets { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); }
.ar-bullets > legend { padding: 0; margin-bottom: var(--s-1); }
.ar-bullet-list { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: var(--s-2); }
.ar-bullet-row { display: flex; align-items: center; gap: var(--s-2); }
.ar-bullet-row .ar-bullet-input { flex: 1; min-width: 0; min-height: 44px; resize: none; field-sizing: content; overflow: hidden; }
.ar-bullet-none { margin: 0; }
.ar-bullet-note { max-width: none; }
.ar-ready, .ar-send { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); min-width: 0; }
.ar-ready .ar-block-t, .ar-send .ar-block-t { font-size: var(--fs-body); }
.ar-kv--tight { padding: 0; }
.ar-kv--tight dd { font-weight: 500; }
.ar-msg { font-weight: 500; line-height: 1.5; max-width: var(--measure); }

@media (max-width: 719px) {
  .ar-kv--tight { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ar-kv--tight dt { margin-top: var(--s-2); }
  .ar-kv--tight > div:first-child dt { margin-top: 0; }
  .ar-gen-top { align-items: stretch; }
  .ar-sendoff-row > .btn { width: 100%; }
}

/* ── P7: the guarantee clock in the header (M25), the Systems table's sheet (M1 to M28), locations (M24) ─────────────────────── */
.ar-gchip { display: flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--text-2); font-weight: 600; text-decoration: none; }
.ar-gchip.late { color: var(--text); font-weight: 700; }
@media (hover: hover) { .ar-gchip:hover { text-decoration: underline; text-decoration-color: var(--link-line); text-underline-offset: 0.2em; } }
.ar-sys { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.ar-sys-head { padding: 0; grid-template-columns: minmax(5.5rem, max-content) minmax(0, 1fr); }
.ar-sys-sec { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.ar-sys-sec > .eyebrow { margin: 0; }
.ar-sys-p { margin: 0; max-width: var(--measure); overflow-wrap: anywhere; }
.ar-sys-sum { margin: 0; }
.ar-promise { margin: 0; padding: var(--s-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-card); font-size: var(--fs-h3); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.ar-pieces { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); min-width: 0; }
.ar-piece { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 2px var(--s-3); padding: var(--s-2) var(--s-3); min-width: 0; }
.ar-piece + .ar-piece { border-top: 1px solid var(--line); }
.ar-piece-l { font-weight: 600; overflow-wrap: anywhere; }
.ar-piece-v { overflow-wrap: anywhere; min-width: 0; }
.ar-piece-v .status, .ar-piece-v .late { white-space: normal; }
.ar-piece-s { grid-column: 1 / -1; color: var(--text-3); font-size: var(--fs-caption); line-height: 1.45; letter-spacing: var(--caption-ls); overflow-wrap: anywhere; }
.ar-needs { margin: 0; padding-left: var(--s-4); display: flex; flex-direction: column; gap: var(--s-1); }
.ar-owners { margin: 0; display: grid; grid-template-columns: minmax(3.5rem, max-content) minmax(0, 1fr); gap: var(--s-2) var(--s-4); }
.ar-owners > div { display: contents; }
.ar-owners dt { font-weight: 700; }
.ar-owners dd { margin: 0; overflow-wrap: anywhere; }
.ar-events { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-4); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); padding: var(--s-1) var(--s-3); }
.ar-event { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); min-height: 44px; min-width: 0; }
.ar-event > span { min-width: 0; overflow-wrap: anywhere; }
.ar-sys .ar-sendoff-row > .btn { white-space: normal; text-align: left; }
@media (max-width: 559px) {
  .ar-piece { grid-template-columns: minmax(0, 1fr); }
  .ar-owners { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ar-owners dd { margin-bottom: var(--s-2); }
  .ar-events { grid-template-columns: minmax(0, 1fr); }
}
.ar-pl-list { display: flex; flex-direction: column; gap: var(--s-5); }
@media (max-width: 719px) {
  .ar-kv--stack { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ar-kv--stack dt { margin-top: var(--s-2); }
  .ar-kv--stack > div:first-child dt { margin-top: 0; }
}
