/* Shared components on top of app.css: badges, dialogs, forms, tables, panels, toasts. */
:root {
  --green: var(--c-success); --green-soft: var(--c-success-soft); --green-line: var(--c-success-line);
  --red: var(--c-danger); --red-soft: var(--c-danger-soft); --red-line: var(--c-danger-line);
  --amber: var(--c-warning); --amber-soft: var(--c-warning-soft); --amber-line: var(--c-warning-line);
  --blue: var(--c-info); --blue-soft: var(--c-info-soft); --blue-line: var(--c-info-line);
  --gray: var(--c-neutral); --gray-soft: var(--c-neutral-soft);
}
a { color: var(--c-accent-text); }
/* Anything with the hidden attribute stays hidden, even when its class sets display (2026-11-19: Login as someone else search showed every name). */
[hidden] { display: none !important; }
main#view { min-height: 100vh; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.small { padding: 6px 11px; font-size: var(--fs-table); }
.btn.danger { background: var(--c-danger); border-color: var(--c-danger); color: var(--c-card); }
.btn.danger-outline { background: var(--c-card); color: var(--c-danger); border-color: var(--c-danger); }
.btn.danger-outline:hover { background: var(--c-danger); color: var(--c-card); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--c-muted); }
.btn.ghost:hover { color: var(--c-ink); background: var(--c-neutral-soft); border-color: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--c-text); font: inherit; font-weight: var(--fw-semibold); cursor: pointer; }
.link:hover { text-decoration: underline; }

/* Unit state palette, the ONE place (Sami 2026-11-04). Every colour of a unit state in the system reads these: dots and bars (accent), washes (soft),
   borders (line), text (ink). Cards, tiles, badges, the Master plan, the floor editor and the brochure all use them: change a state here and it
   changes everywhere. States: available, on_hold, pending_reservation (violet, M4), reserved, sold, blocked (also "Not available" and a closed phase), under_review.
   Colours follow the floor-plan sheets the team already uses (Riyadh 2026-11-03, #277): Available soft green, Reserved yellow, Sold light blue (cyan),
   Blocked pink; On Hold orange and Under Review red were chosen by Riyadh (not in the sheets). */
:root {
  --us-available: #6aa84f; --us-available-soft: #e6f2df; --us-available-line: #b6d7a8; --us-available-ink: #38761d;
  --us-on_hold: #f0912e; --us-on_hold-soft: #fdebd6; --us-on_hold-line: #f8c48a; --us-on_hold-ink: #a3540a;
  --us-pending_reservation: #8e6bd1; --us-pending_reservation-soft: #ece4f9; --us-pending_reservation-line: #c9b6ee; --us-pending_reservation-ink: #5a3a9e;
  --us-reserved: #e8c000; --us-reserved-soft: #fff7bf; --us-reserved-line: #f2dc55; --us-reserved-ink: #7a6300;
  --us-sold: #12b8d0; --us-sold-soft: #d7f6fb; --us-sold-line: #86e2ef; --us-sold-ink: #006f80;
  --us-blocked: #e3a3a3; --us-blocked-soft: #fbeaea; --us-blocked-line: #f4cccc; --us-blocked-ink: #9c4848;
  --us-under_review: #dc3a3a; --us-under_review-soft: #fde2e2; --us-under_review-line: #f2a3a3; --us-under_review-ink: #b01f1f;
}
.c-ust-available { background: var(--us-available-soft); color: var(--us-available-ink); border-color: var(--us-available-line); }
.c-ust-on_hold { background: var(--us-on_hold-soft); color: var(--us-on_hold-ink); border-color: var(--us-on_hold-line); }
.c-ust-pending_reservation { background: var(--us-pending_reservation-soft); color: var(--us-pending_reservation-ink); border-color: var(--us-pending_reservation-line); }
.c-ust-reserved { background: var(--us-reserved-soft); color: var(--us-reserved-ink); border-color: var(--us-reserved-line); }
.c-ust-sold { background: var(--us-sold-soft); color: var(--us-sold-ink); border-color: var(--us-sold-line); }
.c-ust-blocked { background: var(--us-blocked-soft); color: var(--us-blocked-ink); border-color: var(--us-blocked-line); }
.c-ust-under_review { background: var(--us-under_review-soft); color: var(--us-under_review-ink); border-color: var(--us-under_review-line); }

/* Badges: c-<color> */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-hint); font-weight: var(--fw-medium); border-radius: var(--r-pill); padding: 3px 10px; border: 1px solid transparent; white-space: nowrap; }
/* "G Sheet" stamp (Samy 2026-11-20, DECISIONS #425): on every number that comes from a Google Sheet. sheetStampHtml() in syncBox.js */
.sheet-stamp { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1px solid var(--c-info-line); border-radius: var(--r-pill); background: var(--c-info-soft); color: var(--c-info); font-size: var(--fs-hint); font-weight: var(--fw-medium); line-height: 1.5; white-space: nowrap; vertical-align: middle; }
.sheet-stamp .ico { width: 12px; height: 12px; flex: none; }
.c-purple { background: var(--c-select); color: var(--c-ink); border-color: var(--c-select-line); }
.c-blue { background: var(--c-info-soft); color: var(--c-info); border-color: var(--c-info-line); }
.c-amber { background: var(--c-warning-soft); color: var(--c-warning); border-color: var(--c-warning-line); }
.c-pink { background: var(--pink-soft); color: var(--pink); border-color: var(--pink-line); }
.c-teal { background: var(--teal-soft); color: var(--teal); border-color: var(--teal-line); }
.c-green { background: var(--c-success-soft); color: var(--c-success); border-color: var(--c-success-line); }
.c-red { background: var(--c-danger-soft); color: var(--c-danger); border-color: var(--c-danger-line); }
.c-gray { background: var(--c-neutral-soft); color: var(--c-neutral); border-color: var(--c-line); }

/* Loading / empty */
.loading { color: var(--c-faint); padding: 40px; text-align: center; }
.empty-state { text-align: center; color: var(--c-muted); padding: 40px 20px; }
.empty-state b { display: block; color: var(--c-ink); font-size: var(--fs-body); margin-bottom: 6px; }
.empty-state p { margin: 4px 0 12px; }

/* Gate (no account) */
body.no-shell .sidebar, body.no-shell .shellbar, body.no-shell .mobbar { display: none; }
.gate { max-width: 460px; margin: 12vh auto; text-align: center; background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); padding: 36px 28px; box-shadow: var(--card-shadow); }
.gate .mark { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--c-ink); color: var(--c-card); display: inline-grid; place-items: center; font-weight: var(--fw-semibold); font-size: var(--fs-title); }
.gate .gate-logo { display: flex; justify-content: center; color: var(--c-ink); } /* the Valero One sign (DECISIONS #166) */
.gate .gate-logo svg { width: 200px; max-width: 70%; height: auto; }
.gate h1 { font-size: var(--fs-title); margin: 16px 0 8px; }

/* Panels and layouts */
.panel { background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); box-shadow: var(--card-shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--c-line); }
.panel-head h3 { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--c-ink); }
.panel-body { padding: 14px 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; align-content: start; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; font-size: var(--fs-body); }
.kv dt { color: var(--c-muted); font-weight: var(--fw-medium); }
.kv dd { margin: 0; color: var(--c-ink); min-width: 0; overflow-wrap: anywhere; }
.kv dd.kv-name { display: flex; align-items: center; gap: var(--sp-2); } /* a name with its open button */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--c-line); }
.toolbar input, .toolbar select { font: inherit; font-size: var(--fs-body); padding: 8px 12px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: var(--c-card); color: var(--c-ink); }
.toolbar .grow { flex: 1; min-width: 180px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips .btn, .chips button, .chip { border-radius: var(--r-pill); padding: 6px 14px; font-size: var(--fs-body); font-weight: var(--fw-medium); background: var(--c-card); border: 1px solid var(--c-line-strong); color: var(--c-ink); cursor: pointer; }
.chips .btn:not(.on):hover, .chips button:not(.on):hover, .chip:not(.on):hover { background: var(--c-select-line); color: var(--c-ink); border-color: var(--c-line-strong); }
.chips .btn.on, .chips button.on, .chip.on { background: var(--c-btn); border-color: var(--c-btn); color: var(--c-card); }
.muted-small { color: var(--c-faint); font-size: var(--fs-hint); }
.odoo-id { display: flex; align-items: center; gap: var(--sp-2); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: end; }
.nowrap { white-space: nowrap; }

/* Simple tables (outside .card) */
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th, table.tbl td { padding: 13px 16px; text-align: start; border-bottom: 1px solid var(--c-line); white-space: nowrap; }
table.tbl th { font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-text); background: var(--c-card); }
table.tbl tbody tr:hover { background: var(--c-tile); }
/* A number column (.right) lines up under its title on every table; the plain start rule above must not win over it (Sami 2026-11-18) */
table.tbl th.right, table.tbl td.right { text-align: end; }
table.tbl td.wrap { white-space: normal; }
/* An Arabic name (dir="auto") keeps its right-to-left letters but lines up with the column like an English one, never pushed to the far side (Sami 2026-11-16) */
/* (text-align: start would follow the name's own direction, and match-parent does not work in Chrome, so the column's side is named; the [dir="rtl"] line keeps it right for an Arabic screen later) */
table.tbl td:not(.right) [dir="auto"] { text-align: left; }
[dir="rtl"] table.tbl td:not(.right) [dir="auto"] { text-align: right; }
.tbl-wrap { overflow-x: auto; }
tr.clickable { cursor: pointer; /* hover: on tbody tr:hover in app.css */ }
.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--c-line); color: var(--c-muted); font-size: var(--fs-table); }

/* Dialogs: white, radius 12, title top-left, X top-right, right-aligned footer, blue submit */
dialog.modal { border: 0; border-radius: var(--r-lg); padding: 0; width: min(512px, 94vw); max-height: 92vh; color: var(--c-text); box-shadow: var(--shadow-pop); overflow: hidden; }
/* Picked KPI card = Filled (Sami 2026-11-10, DECISIONS #173): it fills with its own colour, white number and label, white icon circle and a
   round tick on its corner, like a pressed button. --acc is the card's colour family, --acc-solid a shade dark enough for white text.
   The "Total / All" card is never shown picked (statCard in core.js): no filter = every card calm. */
.stat:nth-child(5n+1) { --acc: var(--tint-blue); --acc-solid: var(--tint-blue); }
.stat:nth-child(5n+2) { --acc: var(--tint-amber); --acc-solid: #B87205; }
.stat:nth-child(5n+3) { --acc: var(--tint-orange); --acc-solid: #D45A12; }
.stat:nth-child(5n+4) { --acc: var(--tint-green); --acc-solid: var(--tint-green); }
.stat:nth-child(5n+5) { --acc: var(--tint-pink); --acc-solid: var(--tint-pink); }
.stat.tone-total { --acc: var(--c-ink); --acc-solid: var(--c-ink); }
.stat.tone-available { --acc: var(--us-available); --acc-solid: var(--us-available-ink); }
.stat.tone-on_hold { --acc: var(--us-on_hold); --acc-solid: var(--us-on_hold-ink); }
.stat.tone-pending_reservation { --acc: var(--us-pending_reservation); --acc-solid: var(--us-pending_reservation-ink); }
.stat.tone-reserved { --acc: var(--us-reserved); --acc-solid: var(--us-reserved-ink); }
.stat.tone-sold { --acc: var(--us-sold); --acc-solid: var(--us-sold-ink); }
.stat.tone-blocked { --acc: var(--us-blocked); --acc-solid: var(--us-blocked-ink); }
.stat.tone-under_review { --acc: var(--us-under_review); --acc-solid: var(--us-under_review-ink); }
/* A card that stands for a state takes that state's colour, the same as its section box / pill below (tone: "green", "amber"…, Sami 2026-11-10),
   never the colour of its place in the row. */
.stat.tone-blue { background: var(--tint-blue-soft); border-color: var(--tint-blue-line); --acc: var(--tint-blue); --acc-solid: var(--tint-blue); }
.stat.tone-amber { background: var(--tint-amber-soft); border-color: var(--tint-amber-line); --acc: var(--tint-amber); --acc-solid: #B87205; }
.stat.tone-orange { background: var(--tint-orange-soft); border-color: var(--tint-orange-line); --acc: var(--tint-orange); --acc-solid: #D45A12; }
.stat.tone-green { background: var(--tint-green-soft); border-color: var(--tint-green-line); --acc: var(--tint-green); --acc-solid: var(--tint-green); }
.stat.tone-pink { background: var(--tint-pink-soft); border-color: var(--tint-pink-line); --acc: var(--tint-pink); --acc-solid: var(--tint-pink); }
.stat.tone-teal { background: var(--teal-soft); border-color: var(--teal-line); --acc: var(--teal); --acc-solid: var(--teal); }
.stat.tone-red { background: var(--c-danger-soft); border-color: var(--c-danger-line); --acc: var(--c-danger); --acc-solid: var(--c-danger); } /* My day: Priority overdue + Overdue (Sami 2026-11-16, DECISIONS #303) */
.stat.tone-gray { background: var(--c-neutral-soft); border-color: var(--c-line); --acc: var(--c-neutral); --acc-solid: var(--c-neutral); }
/* A card at 0 (statCard dim, Sami 2026-11-16, DECISIONS #332): still there and still a button, but faded and colourless, so the cards with work
   pull the eye. A picked card is never dim. Hover brings it half back, so it still answers the finger / mouse. */
.stat.dim { filter: grayscale(1); opacity: .5; }
.stat.dim.clickable:hover, .stat.dim.clickable:focus-visible { opacity: .8; }
.stat.tone-teal > .stat-ico { background: var(--teal); }
.stat.tone-gray > .stat-ico { background: var(--c-neutral); }
.stat.tone-red > .stat-ico { background: var(--c-danger); }
.stat.tone-blue > .stat-ico { background: var(--tint-blue); }
.stat.tone-amber > .stat-ico { background: var(--tint-amber); }
.stat.tone-orange > .stat-ico { background: var(--tint-orange); }
.stat.tone-green > .stat-ico { background: var(--tint-green); }
.stat.tone-pink > .stat-ico { background: var(--tint-pink); }
.stat.clickable { position: relative; cursor: pointer; transition: transform .16s, box-shadow .16s, background-color .16s, border-color .16s; }
.stat.clickable:hover:not(.on) { border-color: var(--acc, var(--c-ink)); }
.stat.clickable:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 2px; }
.stat.clickable.on { background: var(--acc-solid, var(--c-ink)); border-color: var(--acc-solid, var(--c-ink)); box-shadow: 0 10px 22px -10px var(--acc-solid, var(--c-ink)); transform: translateY(-2px); }
.stat.clickable.on .value, .stat.clickable.on .value em, .stat.clickable.on .label, .stat.clickable.on .hint { color: #fff; }
.stat.clickable.on .label { opacity: .9; }
.stat.clickable.on > .stat-ico { background: #fff; }
.stat.clickable.on > .stat-ico .ico, .stat.clickable.on > .stat-ico svg { color: var(--acc-solid, var(--c-ink)); }
.stat-tick { display: none; position: absolute; top: -9px; inset-inline-end: -9px; width: 24px; height: 24px; border-radius: 50%; place-items: center; background: var(--c-card); color: var(--acc-solid, var(--c-ink)); border: 2px solid var(--acc-solid, var(--c-ink)); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.stat-tick svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.stat.clickable.on > .stat-tick { display: grid; }
@media (prefers-reduced-motion: reduce) { .stat.clickable { transition: none; } .stat.clickable.on { transform: none; } }
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal.wide { width: min(860px, 96vw); }
/* A pop-up that holds a list (it has the list toolbar) keeps ONE size: search, filters and Group by never make it grow or shrink;
   the list scrolls inside (Sami 2026-11-03 and 2026-11-13, DECISIONS #74). */
dialog.modal:has(.fx-host) { height: min(760px, 92vh); }
/* Size guard for every pop-up (lockDialogSize in core.js, DECISIONS #225): the size taken when it opened stays; content scrolls.
   Low specificity on purpose: a screen's own fixed height (dialog.modal.nof-pop, .au:has(.au-grid)...) still wins. */
dialog[data-locked], .fx-dlg.fx-anchor[data-locked] { height: var(--lock-h); }
:where(dialog.modal.size-tall) { height: min(760px, 92vh); }
dialog[data-locked] > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
dialog.modal::backdrop { background: rgba(16, 24, 40,.45); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 24px 8px; }
.modal-head h2 { margin: 0; font-size: var(--fs-section); font-weight: var(--fw-semibold); color: var(--c-ink); }
.modal-body { padding: 8px 24px 16px; flex: 1; min-height: 0; overflow-y: auto; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--c-line); }
.modal-foot .btn.primary { background: var(--c-btn); border-color: var(--c-btn); }
.modal-foot .btn.primary:hover { background: var(--c-btn-hover); border-color: var(--c-btn-hover); }
.modal-foot .btn.danger { background: var(--c-danger); border-color: var(--c-danger); }
.modal-text { margin: 0 0 12px; color: var(--c-text); line-height: 1.5; }

/* Forms */
/* "Missing from the list?": a small link at the end of the field's label line, never a row of its own (DECISIONS #413) */
.opt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-2); }
.opt-head > span:first-child { flex: 1 1 auto; }
.opt-missing { margin-inline-start: auto; align-self: center; background: none; border: 0; padding: 0; font: inherit; font-size: var(--fs-hint); font-weight: var(--fw-medium); color: var(--c-accent); cursor: pointer; white-space: nowrap; }
.opt-missing:hover { text-decoration: underline; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--c-ink); min-width: 0; }
.field.full, .check.full { grid-column: 1 / -1; }
.field small, .check small { font-weight: 400; font-size: var(--fs-hint); color: var(--c-faint); }
.field input, .field select, .field textarea { font: inherit; font-size: var(--fs-body); font-weight: 400; padding: 9px 12px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: var(--c-card); color: var(--c-ink); width: 100%; }
.check { display: flex; gap: 8px; align-items: center; font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-ink); flex-wrap: wrap; }
label.check:has(input) { cursor: pointer; } /* the whole label ticks the box */
label.check:has(input):hover { background: var(--c-select-line); box-shadow: 0 0 0 4px var(--c-select-line); border-radius: var(--r-sm); }
.check small { flex-basis: 100%; margin-inline-start: 24px; }
.req { color: var(--c-danger); font-style: normal; }
/* "What you see, you can open" (DECISIONS #143), recLink() in core.js: names in ink, codes in accent; underline + accent on hover (same look as .mo-name / .mo-num) */
.rec-link { font-weight: var(--fw-semibold, 600); color: var(--c-ink); text-decoration: none; }
.rec-num { color: var(--c-accent-text); text-decoration: none; font-weight: var(--fw-medium, 500); white-space: nowrap; }
.rec-link:hover, .rec-num:hover { text-decoration: underline; color: var(--c-accent-text); }

/* Toasts */
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 1000; }
.toast { background: var(--c-btn); color: var(--c-card); padding: 12px 16px; border-radius: var(--r-md); font-weight: var(--fw-medium); font-size: var(--fs-body); box-shadow: var(--shadow-pop); max-width: 380px; transition: opacity .4s; }
.toast.error { background: var(--c-danger); }
.toast.out { opacity: 0; }
/* a toast with one action (Undo, DECISIONS #419) */
.toast.has-act { display: flex; align-items: center; gap: var(--sp-4); }
.toast-act { border: 0; background: transparent; color: var(--c-card); font: inherit; font-weight: var(--fw-semibold); text-decoration: underline; cursor: pointer; padding: 4px 6px; border-radius: var(--r-sm); margin-inline-start: auto; }
.toast-act:hover { background: rgba(255, 255, 255, .16); }
.toast-act:focus-visible { outline: 2px solid var(--c-card); outline-offset: 1px; }

/* "I'm busy" pill in the My day title row (public/js/busyPill.js, DECISIONS #419) */
.bz-host { display: contents; }
.bz { position: relative; }
.bz-pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 12px; border-radius: var(--r-pill); border: 1px solid var(--c-success-line); background: var(--c-success-soft); color: var(--c-success); font: inherit; font-size: var(--fs-table); font-weight: var(--fw-semibold); cursor: pointer; white-space: nowrap; }
.bz-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tint-green); flex: none; }
.bz-time { font-weight: var(--fw-regular); font-variant-numeric: tabular-nums; }
.bz-pill .ico { width: 14px; height: 14px; opacity: .7; transform: rotate(90deg); }
.bz-pill:hover { background: color-mix(in srgb, var(--c-success-soft) 70%, var(--c-success-line)); }
.bz-pill[aria-expanded="true"], .bz-pill:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.bz.busy .bz-pill { border-color: var(--c-warning-line); background: var(--c-warning-soft); color: var(--c-warning); }
.bz.busy .bz-pill:hover { background: color-mix(in srgb, var(--c-warning-soft) 70%, var(--c-warning-line)); }
.bz.busy .bz-dot { background: var(--tint-amber); }
.bz.grey .bz-pill { border-color: var(--c-line-strong); background: var(--c-neutral-soft); color: var(--c-neutral); }
.bz.grey .bz-pill:hover { background: var(--c-select-line); }
.bz.grey .bz-dot { background: var(--c-faint); }
.bz-card { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 300px; background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: var(--sp-4); display: grid; gap: var(--sp-3); text-align: start; }
.bz-card[hidden] { display: none; }
.bz-head { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-section); font-weight: var(--fw-semibold); color: var(--c-ink); }
.bz-head .bz-dot { width: 10px; height: 10px; }
.bz-head .bz-time { color: var(--c-muted); font-size: var(--fs-table); margin-inline-start: auto; }
.bz-why { margin: -6px 0 0 18px; color: var(--c-muted); font-size: var(--fs-table); }
.bz-kv { display: grid; grid-template-columns: 1fr auto; gap: 6px var(--sp-3); margin: 0; padding-top: var(--sp-3); border-top: 1px solid var(--c-line); font-size: var(--fs-table); }
.bz-kv dt { color: var(--c-muted); }
.bz-kv dd { margin: 0; color: var(--c-ink); font-weight: var(--fw-semibold); text-align: right; }
.bz-card .btn { width: 100%; justify-content: center; height: 40px; }
.bz-busy-btn { background: var(--c-warning-soft); border: 1px solid var(--c-warning-line); color: var(--c-warning); }
.bz-busy-btn:hover { background: color-mix(in srgb, var(--c-warning-soft) 60%, var(--c-warning-line)); }
@media (max-width: 720px) {
  .bz-pill { width: 36px; padding: 0; justify-content: center; }
  .bz-pill .bz-word, .bz-pill .bz-time, .bz-pill .ico { display: none; }
  .bz-card { width: min(300px, calc(100vw - 32px)); }
}

/* Mini bar charts */
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 54px; gap: 10px; align-items: center; font-size: var(--fs-hint); }
.bar-row .bar { height: 9px; background: var(--c-neutral-soft); border-radius: 5px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: var(--c-ink); border-radius: 5px; }
.bar-row .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text); }

@media (max-width: 860px) {
  .grid-2, .grid-3, .split { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  #toasts { right: 12px; left: 12px; }
  .toast { max-width: none; }
}

/* "New version ready · Reload" bar (IDEAS TECH-04): bottom centre, above the page, never moves anything.
   Same look as the Save / Discard bar: a floating white card, blue dot = news, the system's own buttons (Sami 2026-11-14). */
.new-version { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1001; display: flex; align-items: center; gap: var(--sp-3); padding: 8px 8px 8px 14px; background: var(--c-card); border: 1px solid var(--c-card-line); color: var(--c-ink); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); font-size: var(--fs-body); font-weight: var(--fw-medium); white-space: nowrap; animation: nv-in .25s ease-out; }
.new-version .nv-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-btn); box-shadow: 0 0 0 4px var(--c-accent-line); flex: none; }
.new-version .nv-x { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-md); border: 1px solid var(--c-line); background: var(--c-card); color: var(--c-muted); font-size: var(--fs-section); line-height: 1; cursor: pointer; }
.new-version .nv-x:hover { background: var(--c-select); border-color: var(--c-line-strong); color: var(--c-ink); }
.new-version .nv-x:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* Both bars sit at the bottom: while the Save bar is up, this one waits just above it so neither covers the other. */
body:has(.save-bar.on) .new-version { bottom: 86px; }
@media (max-width: 860px) { body:has(.save-bar.on) .new-version { bottom: 136px; } }
@keyframes nv-in { from { opacity: 0; } }
@media (max-width: 560px) { .new-version { bottom: 12px; } }
@media (prefers-reduced-motion: reduce) { .new-version { animation: none; } }

/* Column picker (DECISIONS #28): the sliders button at the right end of every table header */
table.tbl th.col-pick, table.tbl td.col-pick { position: sticky; right: 0; width: 1%; padding: 0 8px; text-align: end; background: var(--c-card); box-shadow: inset 1px 0 0 var(--c-line); }
table.tbl th.col-pick { z-index: 3; }
table.tbl tbody tr:hover td.col-pick { background: inherit; }
th.col-pick .icon-btn { display: inline-grid; place-items: center; padding: 6px; }
th.col-pick .ico { width: 18px; height: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Sortable headers (Sami 2026-10-29): click to sort up, again down, again back to the list's order. */
table.tbl th.th-sortable { padding: 0; }
.th-sort { display: inline-flex; align-items: center; gap: 6px; width: 100%; padding: 13px 16px; font: inherit; font-weight: inherit; color: inherit; text-align: inherit; text-transform: inherit; letter-spacing: inherit; background: none; border: 0; cursor: pointer; white-space: nowrap; }
th.right .th-sort { justify-content: flex-end; }
.th-sort-ico { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; color: var(--c-faint); opacity: 0; transition: opacity .12s, background .12s; }
.th-sort-ico .ico { width: 13px; height: 13px; }
.th-sort:hover { color: var(--c-ink); }
.th-sort:hover .th-sort-ico, .th-sort:focus-visible .th-sort-ico { opacity: 1; background: var(--c-neutral-soft); }
.th-sort:focus-visible { outline: 2px solid var(--c-ink); outline-offset: -2px; border-radius: var(--r-sm); }
th.sorted .th-sort { color: var(--c-text); }
th.sorted .th-sort-ico { opacity: 1; background: var(--c-select); color: var(--c-ink); }
.tbl-progress { display: inline-block; vertical-align: middle; width: 54px; height: 6px; margin-inline-end: 8px; border-radius: var(--r-pill); background: var(--c-neutral-soft); overflow: hidden; }
.tbl-progress i { display: block; height: 100%; background: var(--c-ink); border-radius: inherit; }

/* Columns menu: shown columns in the person's order (drag or arrows), hidden ones below, search, Show all, Reset. */
.col-menu { position: fixed; z-index: 60; width: 320px; max-width: calc(100vw - 16px); max-height: min(560px, 78vh); display: flex; flex-direction: column; background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: 0 18px 44px rgba(20,20,28,.16); overflow: hidden; animation: cm-in .14s ease-out; }
@keyframes cm-in { from { opacity: 0; transform: translateY(-4px); } }
.cm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 14px 16px 10px; }
.cm-head b { font-size: var(--fs-body); color: var(--c-ink); }
.cm-head span { font-size: var(--fs-hint); color: var(--c-faint); }
.cm-search { display: flex; align-items: center; gap: 8px; margin: 0 12px 8px; padding: 0 10px; height: 36px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); color: var(--c-faint); }
.cm-search:focus-within { border-color: var(--c-ink); box-shadow: var(--focus-ring); color: var(--c-ink); }
.cm-search .ico { width: 15px; height: 15px; flex: none; }
.cm-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: var(--fs-table); color: var(--c-ink); }
.cm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; border-top: 1px solid var(--c-line); }
.cm-sec { position: sticky; top: 0; z-index: 1; padding: 10px 8px 6px; background: var(--c-card); font-size: var(--fs-hint); font-weight: var(--fw-semibold); letter-spacing: .5px; text-transform: uppercase; color: var(--c-faint); }
.cm-sec span { text-transform: none; letter-spacing: 0; font-weight: 400; }
.cm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cm-row { position: relative; display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 6px; border-radius: var(--r-md); }
.cm-row:hover, .cm-row:focus-within { background: var(--c-page); }
.cm-row.on { background: var(--c-tile); }
.cm-row.on:hover, .cm-row.on:focus-within { background: var(--c-select); }
.cm-grip { flex: none; display: grid; place-items: center; width: 26px; height: 30px; padding: 0; color: var(--c-faint); background: none; border: 0; border-radius: var(--r-md); }
button.cm-grip { cursor: grab; touch-action: none; }
button.cm-grip:hover, button.cm-grip:focus-visible { color: var(--c-ink); background: var(--c-card); }
button.cm-grip:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 1px; }
[data-shown]:not(.searching) .cm-row:not(.fixed) { cursor: grab; user-select: none; }
[data-shown].searching .cm-grip { opacity: .3; pointer-events: none; }
/* The row being moved floats above the others, which slide out of its way. */
.cm-row.lifting { z-index: 2; background: var(--c-card); box-shadow: 0 10px 24px rgba(20,20,28,.18), 0 0 0 1.5px var(--c-ink); cursor: grabbing; }
.cm-row.lifting .cm-grip { color: var(--c-ink); }
.col-menu.sorting, .col-menu.sorting * { cursor: grabbing !important; }
.col-menu.sorting .cm-row:not(.lifting):hover { background: var(--c-tile); }
.cm-grip .ico { width: 15px; height: 15px; }
.cm-row label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 8px 0; font-size: var(--fs-table); color: var(--c-ink); cursor: pointer; }
.cm-row label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-row input { width: 16px; height: 16px; accent-color: var(--c-ink); flex: none; }
.cm-row:not(.on) label { color: var(--c-text); }
/* Just unticked: stays in its place in Shown, faded, until the menu is opened again (no jumping). */
.cm-row.off label span { color: var(--c-faint); }
.cm-row small { flex: none; font-size: var(--fs-hint); color: var(--c-faint); }
.cm-row.fixed label { cursor: default; }
.cm-empty { padding: 8px 10px; font-size: var(--fs-table); color: var(--c-faint); }
.cm-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--c-line); background: var(--c-page); }
.cm-foot .link { font-size: var(--fs-table); }
.cm-foot .link:disabled { opacity: .4; cursor: default; }
@media (prefers-reduced-motion: reduce) { .col-menu { animation: none; } }

/* Resizable columns (public/js/colResize.js): faint divider, bold on hover, ellipsis once a width is set */
table.tbl thead th:not(.col-pick) { position: sticky; }
table.tbl thead th:not(.col-pick)::after { content: ""; position: absolute; inset-block: 25%; inset-inline-end: 0; width: 1px; background: var(--c-line-strong); transition: background .12s, inset .12s, width .12s; pointer-events: none; }
table.tbl thead th.rz-edge::after { inset-block: 0; width: 3px; background: var(--c-ink); }
table.tbl thead th.rz-edge, table.tbl thead th.rz-edge * { cursor: col-resize; }
table.tbl.rz { table-layout: fixed; min-width: 100%; }
table.tbl.rz th, table.tbl.rz td { overflow: hidden; text-overflow: ellipsis; }
table.tbl.rz tr.grp-row > td { overflow: visible; }
body.rz-dragging, body.rz-dragging * { cursor: col-resize !important; user-select: none; }

/* Every table: the header row stays in view while the rows scroll, and the box scrolls inside itself (like Units) */
/* Up / down scroll passes on to the page at the top or bottom of the list (Sami 2026-11-09), so the screen above the list comes back
   with the same wheel; sideways stays inside (a trackpad swipe at the edge must not go Back). Pop-ups and drawers keep `contain`. */
.tbl-wrap { max-height: var(--wrap-h, calc(100vh - var(--sticky-top, 56px) - 110px)); overflow: auto; overscroll-behavior: contain auto; }
:where(.tbl-wrap table.tbl thead th) { position: sticky; top: 0; z-index: 2; background: var(--c-card); box-shadow: inset 0 -1px 0 var(--c-line); }

/* Tick boxes: purple like the Columns menu, a bigger target, and a ticked row is tinted */
input[type="checkbox"], input[type="radio"] { accent-color: var(--c-ink); cursor: pointer; /* hover: native control */ }
table.tbl input[type="checkbox"] { width: 16px; height: 16px; vertical-align: middle; }
table.tbl th.col-check, table.tbl td.col-check { width: 44px; padding-inline: 14px 0; }
table.tbl tbody tr:has(input[data-sel]:checked) { background: var(--c-tile); }
table.tbl tbody tr:has(input[data-sel]:checked) > td:is(:first-child, .u-col, .t-col, .col-pick) { background: inherit; }


/* A row or chip being dragged to a new place (public/js/dragSort.js) */
tr.dragging, li.dragging, article.ph-card.dragging, .rr2-order .od.dragging { will-change: transform; transition: box-shadow .12s; position: relative; z-index: 3; background: var(--c-card); box-shadow: 0 10px 26px rgba(20,20,28,.2), 0 0 0 1.5px var(--c-ink); cursor: grabbing; }
tr.dragging > td { background: var(--c-card); }
.fx-grip:active { cursor: grabbing; }
.stage-chip .fx-grip { width: 18px; height: 24px; }
small { font-size: var(--fs-hint); }

/* Row action icon buttons (DECISIONS #118, Sami 2026-11-08: look C "white box + border", colour fills in on hover so it clearly reads as a button). 30px square, 16px icon. Made by rowIcon() in js/core.js. */
.ib, .row-actions .ib { --ib-ic: var(--c-text); --ib-hi: var(--c-accent); --ib-soft: var(--c-accent-soft); display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; margin: 0; border: 1px solid var(--c-line-strong); border-radius: var(--r-sm); background: var(--c-card); color: var(--ib-ic); cursor: pointer; font: inherit; text-decoration: none; vertical-align: middle; transition: background .12s, border-color .12s, color .12s; }
.ib svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ib.w { --ib-ic: var(--c-warning); --ib-hi: var(--c-warning); --ib-soft: var(--c-warning-soft); }
.ib.d { --ib-ic: var(--c-danger); --ib-hi: var(--c-danger); --ib-soft: var(--c-danger-soft); }
.ib.g { --ib-ic: var(--c-success); --ib-hi: var(--c-success); --ib-soft: var(--c-success-soft); }
/* Hover: the box fills with its full colour and the icon turns white (grey ones turn blue), so it always shows it can be clicked. */
.ib:hover:not(.is-off):not(:disabled), .row-actions .ib:hover:not(.is-off):not(:disabled) { background: var(--ib-hi); border-color: var(--ib-hi); color: var(--c-card); }
.ib:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 1px; }
.ib.is-off, .ib:disabled { opacity: .4; cursor: not-allowed; }
.ib + .ib { margin-inline-start: 6px; }
.ib-tip { position: fixed; z-index: 1000; display: none; padding: 4px 8px; border-radius: var(--r-sm); background: var(--c-btn); color: var(--c-card); font-size: var(--fs-hint); font-weight: var(--fw-medium); white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-pop); }
:is(.lp-opp-acts, .lf-actions, .ph-foot, .bld-foot, .appr-stack) > .ib + .ib { margin-inline-start: 0; } /* these rows already space their buttons with gap */
td:has(.ib), .row-actions:has(.ib) { white-space: nowrap; } /* icons stay side by side, never stacked */
td:has(.ib) .muted-small { white-space: normal; }

/* Unit KPI cards keep their state colour, the same as the state badge (Sami 2026-11-08; to match Odoo, OPEN-QUESTIONS for Riyadh) */
.stat.tone-total { background: var(--c-card); border-color: var(--c-line); }
.stat.tone-total > .stat-ico { background: var(--c-ink); }
.stat.tone-available { background: var(--us-available-soft); border-color: var(--us-available-line); }
.stat.tone-available > .stat-ico { background: var(--us-available); }
.stat.tone-on_hold { background: var(--us-on_hold-soft); border-color: var(--us-on_hold-line); }
.stat.tone-on_hold > .stat-ico { background: var(--us-on_hold); }
.stat.tone-pending_reservation { background: var(--us-pending_reservation-soft); border-color: var(--us-pending_reservation-line); }
.stat.tone-pending_reservation > .stat-ico { background: var(--us-pending_reservation); }
.stat.tone-reserved { background: var(--us-reserved-soft); border-color: var(--us-reserved-line); }
.stat.tone-reserved > .stat-ico { background: var(--us-reserved); }
.stat.tone-sold { background: var(--us-sold-soft); border-color: var(--us-sold-line); }
.stat.tone-sold > .stat-ico { background: var(--us-sold); }
.stat.tone-blocked { background: var(--us-blocked-soft); border-color: var(--us-blocked-line); }
.stat.tone-blocked > .stat-ico { background: var(--us-blocked); }
.stat.tone-under_review { background: var(--us-under_review-soft); border-color: var(--us-under_review-line); }
.stat.tone-under_review > .stat-ico { background: var(--us-under_review); }

/* Section box (DECISIONS #124, Sami 2026-11-08): the look of the Interests / Offers / Timeline heads on the lead page and the Log activity
   side screen, as ONE shared part. First choice for any screen with a lot of data: everything sits in a box, each box folds open/shut.
   Markup (no JS needed, <details> folds by itself):
     <details class="sbox sbox-blue" open>
       <summary class="sbox-h"><span class="sbox-ic">ICON</span><span class="sbox-t">Interests</span><em class="sbox-n">3</em><span class="sbox-fold">CHEVRON</span></summary>
       <div class="sbox-b">...</div>
     </details>
   Colour by section: sbox-blue / sbox-amber / sbox-orange / sbox-green / sbox-pink. Empty box: add class "empty" (count turns grey, shows 0).
   Head (quiet look B, Sami 2026-11-13, DECISIONS #238): plain white, a small grey icon, the title in dark ink, a grey count. One look for every section box on every screen. */
.sbox { --k: var(--tint-blue); --ks: var(--tint-blue-soft); --kl: var(--tint-blue-line); min-width: 0; overflow: clip; border-radius: var(--r-lg); background: var(--c-card); border: 1px solid var(--c-card-line); box-shadow: var(--card-shadow); }
.sbox-amber { --k: color-mix(in srgb, var(--tint-amber) 88%, #000); --ks: var(--tint-amber-soft); --kl: var(--tint-amber-line); }
.sbox-orange { --k: var(--tint-orange); --ks: var(--tint-orange-soft); --kl: var(--tint-orange-line); }
.sbox-green { --k: var(--tint-green); --ks: var(--tint-green-soft); --kl: var(--tint-green-line); }
.sbox-pink { --k: var(--tint-pink); --ks: var(--tint-pink-soft); --kl: var(--tint-pink-line); }
.sbox + .sbox { margin-top: var(--sp-3); }
.sbox-h { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: var(--sp-3) var(--sp-4); list-style: none; cursor: pointer; color: var(--c-ink); background: var(--c-card); }
.sbox-h::-webkit-details-marker { display: none; }
.sbox[open] > .sbox-h { border-bottom: 1px solid var(--c-line); }
.sbox-h:hover { background: var(--c-select); }
.sbox-h:hover .sbox-fold { border-color: var(--c-accent); color: var(--c-accent); } /* the fold box answers the hover (Sami 2026-11-14) */
.sbox-h:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.sbox-ic { width: 20px; height: 20px; flex: none; display: grid; place-items: center; color: var(--c-muted); }
.sbox-ic svg { width: 18px; height: 18px; }
.sbox-t { font-size: var(--fs-body); font-weight: var(--fw-semibold); }
.sbox-n { padding: 1px 9px; border-radius: var(--r-pill); font-style: normal; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-muted); background: var(--c-page); }
.sbox.empty .sbox-n { color: var(--c-faint); }
.sbox-fold { display: grid; place-items: center; width: 30px; height: 30px; flex: none; margin-inline-start: auto; border: 1px solid var(--c-line-strong); border-radius: 9px; background: var(--c-card); color: var(--c-text); transition: transform .2s, border-color .12s, color .12s; }
.sbox:not([open]) .sbox-fold { transform: rotate(-90deg); }
.sbox-b { padding: var(--sp-4); }

/* The add mark (DECISIONS #135, Sami 2026-11-09): the ONE plus of every button that opens something new ("New …"). A plus in its own
   circle: blue circle + white plus on light buttons, white circle + blue plus on blue buttons. Built only by addMark() in core.js. */
.add-ic { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-inline-start: -4px; border-radius: 50%; background: var(--c-btn); color: var(--c-card); box-shadow: 0 2px 4px -1px color-mix(in srgb, var(--c-btn) 45%, transparent); }
.add-ic svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; }
.btn.primary .add-ic { background: var(--c-card); color: var(--c-btn); box-shadow: none; }
.btn.small .add-ic { width: 18px; height: 18px; margin-inline-start: -3px; }
.btn.small .add-ic svg { width: 11px; height: 11px; }

/* "/" to search (Sami 2026-11-09): a small key chip at the end of the screen's search box; hidden while typing, focused, or on touch screens. */
.kbd-hint { flex: none; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-inline-start: auto; border: 1px solid var(--c-line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--c-card); color: var(--c-muted); font: var(--fw-semibold) 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; cursor: text; user-select: none; }
input:focus + .kbd-hint, input:not(:placeholder-shown) + .kbd-hint { display: none; }
@media (hover: none) { .kbd-hint { display: none; } }
.kbd-hint.over { position: absolute; inset-inline-end: 9px; top: 50%; transform: translateY(-50%); margin: 0; }

/* Fold the summary cards (Look A, DECISIONS #139, public/js/statsFold.js): a quiet Summary line with an arrow above every .stats row */
.sum-line { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 10px; }
.sum-line::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }
.sum-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--c-line-strong); border-radius: var(--r-pill); background: var(--c-card); color: var(--c-text); font: inherit; font-size: var(--fs-hint); font-weight: var(--fw-medium); cursor: pointer; }
.sum-btn:hover { border-color: var(--c-btn); color: var(--c-btn); }
.sum-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sum-btn svg { width: 14px; height: 14px; transition: transform .2s; }
.sum-line.folded .sum-btn svg { transform: rotate(-90deg); }
.sum-btn .cnt { color: var(--c-muted); font-weight: 400; }
.sum-btn .sum-on { margin-inline-start: 2px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--tint-blue-soft); border: 1px solid var(--tint-blue-line); color: var(--c-btn); }
/* The cards icon in the title row, next to the views (look A, docs/prototypes/summary-toggle, Sami 2026-11-16): open = the picked look (#263), folded with a card filter on = the card's name */
.sum-tg { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: var(--c-card); color: var(--c-muted); font: inherit; font-size: var(--fs-table); font-weight: var(--fw-semibold); cursor: pointer; }
.sum-tg:hover { background: var(--c-select-line); color: var(--c-ink); }
.sum-tg:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sum-tg svg { width: 18px; height: 18px; flex: none; }
.sum-tg svg:last-child { width: 14px; height: 14px; transition: transform .2s; }
.sum-tg[aria-expanded="true"] { background: var(--c-accent-soft); color: var(--c-accent-text); border-color: transparent; box-shadow: inset 0 0 0 2px var(--c-accent); }
.sum-tg[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
.sum-tg.has-pick { background: var(--c-accent-soft); color: var(--c-accent-text); border-color: var(--c-accent-line); }
@media (prefers-reduced-motion: reduce) { .sum-tg svg:last-child { transition: none; } }
.stats.stats-folded, .stats.stats-folded + .kpi-note, .stats.stats-folded + details.inv-note, .sum-note.stats-folded { display: none; }
@media (prefers-reduced-motion: reduce) { .sum-btn svg { transition: none; } }
/* Money off a price (DECISIONS #148; Sami 2026-11-08: discounts are red): the amount in red, the % after it in brackets, quiet. offerPanel + Offers list */
.off-amt { color: var(--c-danger); white-space: nowrap; }
.off-pct { margin-inline-start: 6px; color: var(--c-danger); font-weight: 400; font-size: var(--fs-hint); white-space: nowrap; }

/* A discount is always red, every screen (Sami 2026-11-10): .disc = a red tag, .disc-txt = red text inside a line. */
.disc, .pl-tag.disc { border-color: var(--c-danger-line); background: var(--c-danger-soft); color: var(--c-danger); }
.disc-txt { color: var(--c-danger); }

/* ---- A payment plan's name as Tokens (DECISIONS #189): public/js/planTerms.js planTokens() ---- */
.ptk { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.ptk-fire { font-size: 15px; line-height: 1; }
.ptk-len { font-weight: var(--fw-semibold); font-size: 15px; color: var(--c-ink); margin-inline-end: 2px; white-space: nowrap; }
.ptk-t { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--c-neutral-soft); color: var(--c-text); font-size: var(--fs-hint); font-weight: var(--fw-semibold); white-space: nowrap; }
.ptk-t small { font-size: var(--fs-hint); font-weight: var(--fw-medium); color: var(--c-muted); }
.ptk-t.d { background: var(--c-danger-soft); color: var(--c-danger); }
.ptk-t.x { background: var(--tint-amber-soft); color: color-mix(in srgb, var(--tint-amber) 80%, #000); box-shadow: inset 0 0 0 1px var(--tint-amber-line); }

/* ---- A code on its own, tap to copy (plan codes): codeChip() in public/js/core.js ---- */
.code-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 7px; border: 1px solid var(--c-line); border-radius: 7px; background: var(--c-tile); color: var(--c-text); font: var(--fw-semibold) 12px ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .02em; cursor: copy; white-space: nowrap; transition: border-color .15s, background .15s; }
.code-chip .h { color: var(--c-faint); font-weight: var(--fw-medium); }
.code-chip svg { width: 13px; height: 13px; color: var(--c-faint); opacity: 0; transition: opacity .15s; }
.code-chip:hover { border-color: var(--c-accent-line); background: var(--c-accent-soft); }
.code-chip:hover svg, .code-chip:focus-visible svg { opacity: 1; }
/* A phone number that copies on a tap (phoneCopy in core.js, Sami 2026-11-16): reads as the number, a grey ground on hover. */
.ph-copy { display: inline-block; margin-inline: -4px; padding: 1px 4px; border: 0; border-radius: var(--r-sm); background: none; font: inherit; color: inherit; text-align: start; justify-self: start; cursor: copy; }
.ph-copy:hover { background: var(--c-select); }
.ph-copy:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ph-copy:active { background: var(--c-select-line); } /* a finger sees the tap land */
/* Tablet / phone fingers: an unseen 44px tap area around the number; the line and the grey ground stay their size. */
@media (pointer: coarse) {
  .ph-copy { position: relative; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
  .ph-copy::before { content: ""; position: absolute; inset: -11px -4px; }
}
.code-chip.done { border-color: var(--c-success-line); background: var(--c-success-soft); color: var(--c-success); }

/* ---- richSelect (public/js/richSelect.js): our drop-down over a hidden <select>, rows can hold colours (plan Tokens) ---- */
.rsel-native { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rsel { position: relative; min-width: 0; }
.rsel-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 10px 6px 12px; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: var(--c-card); color: var(--c-ink); font: inherit; text-align: start; cursor: pointer; }
.rsel-btn:hover:not(:disabled) { border-color: var(--c-accent-line); }
.rsel-btn:focus-visible, .rsel-btn[aria-expanded="true"] { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.rsel-btn:disabled { cursor: not-allowed; background: var(--c-tile); }
.rsel-val { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rsel-val.ph { color: var(--c-faint); }
.rsel-chev { flex: none; color: var(--c-muted); }
.rsel-menu { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 6px); max-height: min(360px, 50vh); overflow-y: auto; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-card); box-shadow: var(--shadow-pop); }
.rsel-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--c-line); cursor: pointer; }
.rsel-opt:not(.act):hover { background: var(--c-select); }
.rsel-opt:first-child { border-top: 0; }
.rsel-opt.act { background: var(--c-accent-soft); }
.rsel-opt.on { box-shadow: inset 0 0 0 1px var(--c-accent-line); }
.rsel-sep { height: 0; border-top: 1px solid var(--c-line-strong); }
.rsel-sep + .rsel-opt { border-top: 0; }
.rsel-browse { display: inline-flex; align-items: center; gap: 8px; color: var(--c-accent-text); font-weight: var(--fw-semibold); }
.rsel-browse .ico { width: 16px; height: 16px; }

/* A page's guide line under its title shows only as the title's hover text (Sami 2026-11-11, DECISIONS #195; ctxRow.js sets it).
   A greeting (.keep) or a line with a link stays on screen. */
header.topbar > div > h1 + p.muted:not(.keep):not(:has(a, button)) { display: none; }
header.topbar > div > h1[title] { cursor: default; }

/* "48 of 1,240" by a list title (Sami 2026-11-11, DECISIONS #193, every list #195): plain numbers, no box; the shown number in ink. */
.list-count { margin-inline-start: 8px; font-size: var(--fs-table); font-weight: var(--fw-regular); color: var(--c-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-count b { font-weight: var(--fw-semibold); color: var(--c-ink); }

/* Info tip (core.js infoTip): a small round "i" after a label; its card opens on hover, tap or Enter. Admin and settings screens only. */
.info-tip { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; margin-inline-start: 4px; vertical-align: middle; border-radius: var(--r-pill); color: var(--c-faint); cursor: pointer; }
.info-tip .ico { width: 16px; height: 16px; }
.info-tip:hover { background: var(--c-select-line); color: var(--c-ink); }
.info-tip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.info-pop { position: fixed; z-index: 1100; max-width: 280px; padding: var(--sp-3); background: var(--c-card); border: 1px solid var(--c-card-line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); color: var(--c-text); font-size: var(--fs-table); font-weight: var(--fw-regular); line-height: 1.45; text-align: start; text-transform: none; letter-spacing: 0; white-space: normal; pointer-events: none; }
.info-pop[hidden] { display: none; }

/* ---- One title row for a list (Sami 2026-11-16, docs/prototypes/header-row: look B + O3 + thin lines; Units first) ----------------
   Title, then the pager with a clear gap · · · views, cards button │ extra icon buttons, New. */
.tb-tl { display: flex; align-items: center; gap: var(--sp-5); min-width: 0; flex-wrap: wrap; }
.tb-sep { flex: none; width: 1px; height: 24px; margin: 0 var(--sp-1); background: var(--c-line-strong); }
.tb-ic { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--c-line-strong); border-radius: var(--r-md); background: var(--c-card); color: var(--c-muted); cursor: pointer; }
.tb-ic:hover { background: var(--c-select-line); color: var(--c-ink); }
.tb-ic:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.tb-ic svg { width: 18px; height: 18px; }
/* The pager (public/js/listPager.js): the count opens the rows menu; light arrows, a soft grey square on hover */
.pgr { position: relative; display: inline-flex; align-items: center; gap: var(--sp-1); }
.pgr:empty { display: none; }
.pgr-count { height: 34px; padding: 0 10px; border: 0; border-radius: var(--r-md); background: none; font: inherit; font-size: var(--fs-table); font-weight: var(--fw-semibold); color: var(--c-ink); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; }
.pgr-count:hover, .pgr-count[aria-expanded="true"] { background: var(--c-select-line); }
.pgr-count span { color: var(--c-muted); font-weight: var(--fw-regular); }
.pgr-count:focus-visible, .pgr-arr:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.pgr-arr { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r-md); background: none; color: var(--c-ink); cursor: pointer; }
.pgr-arr svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pgr-arr:hover:not(:disabled) { background: var(--c-select-line); }
.pgr-arr:disabled { color: var(--c-faint); cursor: default; }
.pgr-menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 25; display: grid; min-width: 160px; padding: 6px; border: 1px solid var(--c-card-line); border-radius: var(--r-md); background: var(--c-card); box-shadow: var(--shadow-pop); font-size: var(--fs-table); }
.pgr-menu b { padding: 4px 8px; font-size: var(--fs-hint); font-weight: var(--fw-semibold); color: var(--c-muted); }
.pgr-menu button { padding: 7px 8px; border: 0; border-radius: var(--r-sm); background: none; font: inherit; color: var(--c-ink); text-align: start; cursor: pointer; }
.pgr-menu button:hover { background: var(--c-select-line); }
.pgr-menu button.on { background: var(--c-accent-soft); color: var(--c-accent-text); font-weight: var(--fw-semibold); }
.pgr-menu button span { color: var(--c-muted); font-weight: var(--fw-regular); }
.pgr-other { display: flex; padding: 6px 2px 2px; margin-top: 4px; border-top: 1px solid var(--c-line); }
.pgr-other input { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--c-line-strong); border-radius: var(--r-sm); background: var(--c-card); font: inherit; color: var(--c-ink); }
.pgr-other input:focus { outline: none; border-color: var(--c-accent); box-shadow: var(--focus-ring); }
/* Cards in an outline under the title row (statsFold.js): no fill, a thin soft-blue line, a blue edge on hover.
   Sami 2026-11-16: the soft-blue fill was already the lightest that still shows, so the fill went; the notch went too (DECISIONS #307). */
.cards-tray { position: relative; margin: 6px 0 var(--sp-4); padding: var(--sp-3); border: 1px solid var(--c-accent-line); border-radius: var(--r-lg); background: transparent; transition: border-color .15s, box-shadow .15s; }
.cards-tray[hidden] { display: none; }
.cards-tray > .stats { margin: 0; }
.cards-tray.lit { border-color: var(--c-accent); box-shadow: 0 0 0 1px var(--c-accent); }
@media (prefers-reduced-motion: reduce) { .cards-tray { transition: none; } }
.cards-tray:has(> .stats:empty) { display: none; }
.stats.stats-single { display: none; } /* one card is not a summary (Sami 2026-11-16): statsFold.js */
/* Cards in two parts (Build board, Sami 2026-11-18): the totals, a thin line, then the split (people, states). Flex so every row fills
   end to end, never an empty slot (said-once #45); the line hides when the cards stack on a phone. Markup: <span class="stats-sep"></span> */
.stats.stats-split { display: flex; gap: var(--sp-3); }
.stats.stats-split > .stat { flex: 1 1 0; min-width: 0; padding: 14px; column-gap: 10px; }
.stats.stats-split > .stat > .stat-ico { width: 36px; height: 36px; }
.stats-sep { flex: 0 0 1px; align-self: stretch; margin-block: var(--sp-2); background: var(--c-line-strong); }
@media (max-width: 860px) { .stats.stats-split { flex-wrap: wrap; } .stats.stats-split > .stat { flex-basis: 150px; } .stats-sep { display: none; } }
.cards-tray[hidden] + .kpi-note, .cards-tray[hidden] + details.inv-note { display: none; } /* a note under the cards folds with them */
header.topbar p.muted:not(.keep):not(:has(a, button)) { display: none; } /* no guide line under a title, also after .tb-tl (Sami 2026-11-16) */

/* Online now (Sami 2026-11-18): the green dot on a face (.avatar.pres.is-on) and the same dot alone (.pres-dot), one look with the
   faces at the top of the screen (nav.css .presence .dot). Markup: <span class="avatar pres is-on" data-pres="ID">MS</span>. */
.pres-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c-success); box-shadow: 0 0 0 3px var(--c-success-line); flex: none; }
.avatar.pres { position: relative; }
.avatar.pres.is-on::after { content: ""; position: absolute; inset-inline-end: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--c-success); box-shadow: 0 0 0 2px var(--c-card); }
