/* Shell layout. Colors come only from the tokens in /assets/base.css (rule 66). */
.skip { position:absolute; left:-999px; } .skip:focus { left:16px; top:8px; background:var(--card); padding:4px 8px; z-index:10; }
.top { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; padding:8px 16px; background:var(--card); border-bottom:1px solid var(--line); }
.brand { font-weight:700; color:var(--fg); text-decoration:none; }
.top { position:sticky; top:0; z-index:12; } .top-gap { flex:1 1 auto; }
.side-toggle { font-size:18px; line-height:1; padding:4px 10px; }
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--card); color:var(--fg); cursor:pointer; }
.theme-toggle:hover { border-color:var(--accent); }
.theme-toggle .ti { display:none; }
.theme-toggle[data-state="light"] .ti-light, .theme-toggle[data-state="dark"] .ti-dark, .theme-toggle[data-state="system"] .ti-system { display:block; }
.btn { font:inherit; padding:4px 10px; border:0; background:var(--card); color:var(--fg); cursor:pointer; }
.btn { border:1px solid var(--line); border-radius:6px; }
.btn.primary { background:var(--accent); color:var(--accent-fg); border-color:var(--accent); }

/* Rule 69: empty and failed must look different, in shape, color, wording and role. */
.state { border-radius:8px; padding:24px 16px; text-align:center; margin-bottom:16px; }
.state-empty { border:2px dashed var(--line); background:var(--card); color:var(--fg); }
.state-error { border:2px solid var(--bad); background:var(--bad-bg); color:var(--fg); text-align:left; }
.state-error .state-title { color:var(--bad); }
.state-loading { color:var(--muted); }
.state-title { margin:0 0 4px; font-size:18px; }
.state code { font-size:14px; }

.toasts { position:fixed; right:16px; bottom:16px; display:grid; gap:8px; max-width:calc(100vw - 32px); }
.toast { background:var(--card); border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:6px; padding:8px 12px; box-shadow:0 2px 8px rgb(0 0 0 / .15); }
.toast.bad { border-left-color:var(--bad); }
.unbuilt { color:var(--muted); }
@media (max-width: 600px) { .top { padding:8px 16px; } .theme-toggle { order:3; } }
.narrow { max-width:420px; }
input[type=email], input[type=password], input[type=text], select { width:100%; box-sizing:border-box; font:inherit; padding:8px;
  border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.btn[disabled] { opacity:.6; cursor:progress; }
.who { display:flex; align-items:center; gap:8px; }

/* Phase 2: records */
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; }
.toolbar { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:8px 0 12px; }
.toolbar input[type=search] { flex:1 1 220px; font:inherit; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--search); color:var(--fg); }
.count { margin:0 0 8px; } .count strong { font-size:20px; }
.table-wrap { padding:0; } .table-wrap table td, .table-wrap table th { padding:8px 12px; }
button.sort { font:inherit; font-weight:600; color:var(--muted); background:none; border:0; padding:0; cursor:pointer; }
.pager { display:flex; gap:12px; align-items:center; justify-content:center; }
.grid { display:grid; gap:12px 16px; } .grid.cols-2 { grid-template-columns:repeat(2, minmax(0,1fr)); } .grid.cols-3 { grid-template-columns:repeat(3, minmax(0,1fr)); }
@media (max-width:640px) { .grid.cols-2, .grid.cols-3 { grid-template-columns:minmax(0,1fr); } }
.field label, .field > .label { display:block; font-weight:600; font-size:14px; margin-bottom:2px; }
.field .help { display:block; color:var(--muted); font-size:13px; margin-bottom:2px; }
.field .err { color:var(--bad); font-size:14px; } .field.invalid input { border-color:var(--bad); }
.field.wide { grid-column:1 / -1; } .field.check label { font-weight:400; }
.field input, .field textarea { width:100%; box-sizing:border-box; font:inherit; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.layout-section h2 { font-size:16px; margin:0 0 12px; }
.savebar { position:sticky; bottom:0; background:var(--bg); padding:8px 0; display:flex; gap:12px; align-items:center; }
.state-warn { border:2px solid var(--warn); background:var(--card); text-align:left; }
/* A combobox looks like a native select (Stephen, 2026-10-12): one border round the box, its × and its arrow; one focus ring round all of it */
.cb { position:relative; }
.cb-row { display:flex; align-items:stretch; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.cb-row:focus-within { outline:2px solid var(--focus); outline-offset:2px; }
.cb .cb-row input, .field .cb-row input { flex:1 1 auto; min-width:0; border:0; border-radius:6px 0 0 6px; background:transparent; }
.cb-row input:focus-visible { outline:none; }
.cb-clear, .cb-arrow { flex:none; display:inline-flex; align-items:center; justify-content:center; font:inherit; border:0; background:none; color:var(--fg); cursor:pointer; }
.cb-clear { padding:0 4px; color:var(--muted); font-size:18px; line-height:1; } .cb-clear:hover { color:var(--fg); }
.cb-clear[hidden] { display:none; }
.cb-arrow { padding:0 10px 0 6px; border-radius:0 6px 6px 0; }
.cb-clear:focus-visible, .cb-arrow:focus-visible { outline:none; box-shadow:inset 0 0 0 2px var(--focus); border-radius:4px; }
.field.invalid .cb-row { border-color:var(--bad); }
.cb-row:has(input:disabled) { opacity:.7; } .cb-row:has(input:disabled) .cb-arrow, .cb-row:has(input:disabled) .cb-clear { pointer-events:none; }
.cb-list { position:absolute; z-index:5; left:0; right:0; max-height:240px; overflow-y:auto; margin:2px 0 0; padding:4px 0; list-style:none; background:var(--card); border:1px solid var(--line); border-radius:6px; box-shadow:0 4px 12px rgb(0 0 0 / .15); }
.cb-list li { padding:6px 10px; cursor:pointer; } .cb-list li.active { background:var(--subtle); } .cb-list li.add { color:var(--accent); } .cb-list li.none { color:var(--muted); cursor:default; }
.leave { position:fixed; inset:0; background:rgb(0 0 0 / .4); display:grid; place-items:center; z-index:20; padding:16px; }
.leave .card { max-width:420px; }
/* Side panels (rule 70): the page behind stays visible and usable. */
.panel { position:fixed; top:var(--top-h, 50px); right:0; bottom:0; width:var(--panel-w, min(400px, 100vw)); max-width:100vw; box-sizing:border-box; background:var(--card); color:var(--fg); border-left:1px solid var(--line); box-shadow:-4px 0 16px rgb(0 0 0 / .15); z-index:15; display:flex; flex-direction:column; }
.panel.is-wide { width:var(--panel-w, min(720px, 100vw)); }
/* the drag handle on the panel's left edge (Stephen, 2026-10-07) */
.panel-resize { position:absolute; left:-4px; top:0; bottom:0; width:8px; cursor:col-resize; z-index:2; touch-action:none; }
.panel-resize:hover, .panel-resize:focus-visible { background:linear-gradient(to right, transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px); outline:none; }
body.panel-resizing { cursor:col-resize; user-select:none; }
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:12px 16px; border-bottom:1px solid var(--line); }
.panel-head h2 { margin:0; font-size:18px; }
.panel-body { padding:12px 16px; overflow-y:auto; flex:1; display:grid; gap:12px; align-content:start; }
.panel-body .savebar { background:var(--card); margin:0; }
.btn.small { padding:2px 8px; font-size:14px; }
.btn:disabled { opacity:.55; cursor:default; }
.frow { display:flex; gap:8px; align-items:flex-end; } .frow .field { flex:1; min-width:0; }
.sortlist { list-style:none; margin:0; padding:0; display:grid; gap:4px; }
.sortlist > li { display:flex; align-items:center; gap:8px; padding:4px 8px; border:1px solid var(--line); border-radius:6px; background:var(--card); cursor:grab; }
.sortlist li label { flex:1; } .sortlist li.dragging { opacity:.5; } .sortlist .move { display:flex; gap:4px; }
.chips { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:0 0 8px; } .chips:empty { display:none; }
.chip { display:inline-flex; align-items:center; gap:4px; padding:2px 4px 2px 10px; border:1px solid var(--line); border-radius:999px; background:var(--subtle); font-size:14px; }
.chip button { font:inherit; border:0; background:none; color:var(--fg); cursor:pointer; padding:0 6px; }
.views { min-width:min(260px, 100%); } .viewbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:0 0 8px; }
.merge { border:1px solid var(--line); border-radius:6px; padding:8px 12px; margin:0; } .merge legend { font-weight:600; padding:0 4px; }
.mrow { display:grid; gap:2px; padding:6px 0; border-bottom:1px solid var(--line); } .mrow:last-child { border-bottom:0; }
.mlabel { font-weight:600; font-size:14px; } .mrow label { overflow-wrap:anywhere; }
/* Arrange mode (FLD-03) and "+ Add a field here" (FLD-04). */
.arrange { display:grid; gap:12px; } .arrange-help { margin:0; }
.arr-sec { display:grid; gap:8px; }
.arr-sec-head { display:flex; flex-wrap:wrap; gap:8px; align-items:center; cursor:grab; }
.arr-title { font:inherit; font-weight:600; flex:1 1 160px; min-width:0; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--fg); }
.seg { display:inline-flex; gap:0; } .seg .btn { border-radius:0; } .seg .btn:first-child { border-radius:6px 0 0 6px; } .seg .btn:last-child { border-radius:0 6px 6px 0; }
.seg .btn[aria-pressed="true"] { background:var(--accent); color:var(--accent-fg); border-color:var(--accent); }
.arr-fields { list-style:none; margin:0; padding:0; display:grid; gap:0; min-height:24px; }
.arr-field { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--card); cursor:grab; }
.arr-field.dragging { opacity:.5; } .arr-field .arr-label { min-width:0; overflow-wrap:anywhere; }
.arr-field.ghost { border-style:dashed; border-color:var(--accent); cursor:default; }
.arr-field:focus { outline:2px solid var(--accent); outline-offset:1px; }
/* The insertion line between fields: a thin gap that becomes a button on hover or keyboard focus. */
.arr-ins { height:8px; position:relative; }
.add-between { position:absolute; inset:-4px 0; width:100%; font:inherit; font-size:13px; color:var(--accent); background:var(--card); border:1px dashed var(--accent); border-radius:6px; opacity:0; cursor:pointer; z-index:1; }
.arr-ins:hover .add-between, .add-between:focus { opacity:1; inset:-10px 0; }
.add-here { justify-self:start; color:var(--accent); border-style:dashed; }
.arr-tray h2 { font-size:16px; margin:0 0 8px; }
.field .sub { font-weight:400; margin-top:6px; }
.preview .plabel { display:block; font-weight:600; font-size:14px; margin-bottom:4px; } .preview .card { padding:12px; }
.multi { display:grid; gap:6px; } .multi .chips { list-style:none; margin:0; padding:0; } .multi .chips:empty { display:none; }
.field.check input[type=checkbox], .sortlist input[type=checkbox] { width:auto; margin:0 6px 0 0; vertical-align:middle; }
.panel-body form { display:grid; gap:12px; }
.tabs { display:flex; flex-wrap:wrap; gap:4px; margin:8px 0 12px; border-bottom:1px solid var(--line); }
.tabs a { padding:6px 12px; color:var(--fg); text-decoration:none; border-radius:6px 6px 0 0; } .tabs a[aria-current="page"] { background:var(--subtle); font-weight:600; }
.requests h2 { font-size:16px; margin:0 0 8px; } .reqlist { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.reqlist li { border-top:1px solid var(--line); padding-top:8px; } .reqlist p { margin:0 0 4px; } .reqlist input { flex:1; min-width:0; font:inherit; padding:4px 8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
/* Timeline (REC-15) and tasks (REC-17). */
.timeline { display:grid; grid-template-columns:minmax(0, 1fr); gap:12px; } .timeline .head { flex-wrap:wrap; gap:8px; } .timeline h2 { font-size:18px; margin:0; } .tl-add { display:flex; flex-wrap:wrap; gap:6px; }
.tl-filter { flex-wrap:wrap; }
.tl-list { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.tl { border-left:3px solid var(--line); padding:6px 0 6px 12px; display:grid; gap:4px; }
.tl-note { border-left-color:var(--accent); } .tl-call, .tl-meeting { border-left-color:var(--ok); } .tl-task { border-left-color:var(--warn); }
.tl-head { display:flex; flex-wrap:wrap; gap:4px 8px; align-items:baseline; }
.tl-kind { font-size:13px; font-weight:600; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); }
.tl-meta { margin-left:auto; } .tl-body { margin:0; overflow-wrap:anywhere; }
.tl-task { display:flex; flex-wrap:wrap; gap:8px; align-items:center; } .tl.is-done .tl-subject { text-decoration:line-through; color:var(--muted); }
.tl .done input { width:auto; margin-right:4px; } .tl-actions { display:flex; gap:6px; }
.tl-form { display:grid; gap:8px; } .tl-form h3 { margin:0; font-size:16px; }
.bucket h2 { font-size:18px; margin:0 0 8px; } .bucket-overdue h2 { color:var(--bad); }
.tags { display:flex; flex-wrap:wrap; gap:6px 8px; align-items:center; margin:0 0 12px; } .tags .plabel { font-weight:600; font-size:14px; }
.tags .chips { list-style:none; margin:0; padding:0; } .tags .chip a { color:var(--fg); } .tags .cb { min-width:min(220px, 100%); }
/* CSV import (REC-12). */
.steps { display:flex; flex-wrap:wrap; gap:4px 20px; padding-left:20px; color:var(--muted); font-size:14px; }
.policy { border:0; padding:0; margin:0; display:grid; gap:8px; } .policy legend h2 { font-size:16px; margin:0 0 4px; }
.policy label { display:block; } .policy input { width:auto; margin-right:6px; }
.row-bad td { background:var(--bad-bg); } progress { width:min(400px, 100%); }
.tally { list-style:none; padding:0; display:flex; flex-wrap:wrap; gap:8px 24px; } .tally strong { font-size:20px; }
/* ---- p5 BEGIN: email (TODO 5.14-5.16, 5.19): templates, outbox, bulk send, send from a contact ---- */
.badge { display:inline-block; font-size:12px; font-weight:600; padding:1px 8px; border-radius:999px; border:1px solid var(--line); background:var(--subtle); color:var(--muted); vertical-align:middle; }
textarea.code { font:13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; width:100%; box-sizing:border-box; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.etools { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:8px 12px; margin:12px 0; padding:8px; border:1px dashed var(--line); border-radius:6px; }
.etools input[type=file] { width:100%; font-size:14px; }
.email-frame { display:block; width:100%; min-height:200px; border:1px solid var(--line); border-radius:6px; background:var(--card); }
.email-text { white-space:pre-wrap; overflow-wrap:anywhere; font-size:13px; margin:8px 0 0; }
.ob-filters { align-items:flex-end; } .ob-filters .field { min-width:160px; } .ob-filters input[type=date] { font:inherit; padding:6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.st { font-weight:600; } .st-failed, .st-suppressed { color:var(--bad); } .st-held, .st-queued, .st-sending { color:var(--warn); } .st-sent { color:var(--ok); } .st-cancelled { color:var(--muted); }
.dl { display:grid; grid-template-columns:max-content 1fr; gap:4px 12px; margin:0; } .dl dt { font-weight:600; font-size:14px; color:var(--muted); } .dl dd { margin:0; overflow-wrap:anywhere; }
.send-email .policy label { display:inline-block; margin-right:12px; }
.track { display:flex; gap:8px; align-items:flex-start; } .track input { width:auto; margin-top:4px; }
@media (max-width:640px) { .etools { grid-template-columns:minmax(0,1fr); } }
/* ---- p5 END ---- */
/* ---- Surveys (TODO 6.02-6.10, p6): builder, preview frame, results; the respondent page itself is /assets/survey.css. */
.sv-tabs { margin:0 0 12px; flex-wrap:wrap; }
/* SRV-38 (Stephen, 2026-10-12): the survey header is tight, sticks under the top bar, and its title sits level with the sidebar's MENU */
main#view:has(.sv-head) { padding-top:0; }
.sv-head { position:sticky; top:var(--top-h, 50px); z-index:10; background:var(--bg); padding:6px 0 8px; margin-bottom:12px; border-bottom:1px solid var(--line); }
.sv-head .head { gap:4px 12px; }
.sv-head h1 { margin:0; font-size:24px; line-height:1.25; }
.sv-head #sv-ver { margin:2px 0 8px; font-size:13px; color:var(--muted); }
.sv-head .sv-tabs { margin:0; }
#view:has(.sv-head) .fp-layout > .fp { top:calc(var(--top-h, 50px) + var(--svh, 112px) + 12px); max-height:calc(100vh - var(--top-h, 50px) - var(--svh, 112px) - 24px); }
.sv-qlist > li { align-items:flex-start; cursor:default; padding:8px; }
.sv-qlist > li.sv-pbrow { background:var(--subtle); }
.sv-qedit { flex:1; min-width:0; } .sv-qedit p { margin:8px 0 0; }
.sv-qlist textarea, #sv-form textarea { width:100%; box-sizing:border-box; font:inherit; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.sv-insert { display:flex; gap:8px; align-items:center; min-width:min(320px, 100%); } .sv-insert .cb { flex:1; }
.sv-sample { display:flex; gap:8px; align-items:center; min-width:min(320px, 100%); } .sv-sample .cb { flex:1; }
.sv-frame { border:1px solid var(--line); border-radius:8px; padding:16px; background:var(--bg); }
.sv-frame.phone { box-sizing:border-box; max-width:375px; margin:0 auto; border-width:8px; border-radius:24px; padding:12px; }
.sv-frame .sv { max-width:none; padding:0; }
.sv-tiles { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:12px; }
.sv-tile { display:grid; gap:4px; margin:0; } .sv-tile strong { font-size:28px; }
.sv-res h2 { font-size:18px; margin:0 0 4px; }
.sv-score strong { font-size:28px; }
.sv-bars th { font-weight:400; color:var(--fg); width:30%; } .sv-barcell { width:50%; }
.sv-bar { display:block; height:12px; width:0; background:var(--accent); border-radius:3px; }
.sv-answers { margin:0; padding-left:20px; display:grid; gap:4px; }
.tl-answers summary { cursor:pointer; color:var(--accent); }
.tl-script-list { margin:4px 0 0; } .tl-script-list dt { font-weight:600; font-size:13px; margin-top:6px; } .tl-script-list dd { margin:0 0 0 12px; }   /* MTG-49c */
/* SRV-13 (Stephen, 2026-10-11): the answers as two columns, Question and Answer */
.tl-qa { margin:8px 0 0; width:100%; table-layout:fixed; } .tl-qa th[scope="col"]:first-child { width:45%; } .tl-qa th[scope="row"] { font-weight:600; text-align:left; vertical-align:top; } .tl-qa td { vertical-align:top; white-space:pre-wrap; overflow-wrap:anywhere; } .tl-qa th[scope="row"] { overflow-wrap:anywhere; }
/* ---- end surveys */
/* ---- Phase 9 (p9): settings, users, audit log, two-step sign-in ---- */
.checks label { display:block; padding:2px 0; } .checks input { width:auto; margin-right:6px; } .policy h3 { font-size:15px; margin:8px 0 4px; }
.codes { list-style:none; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(12ch, 1fr)); gap:4px 16px; }
.secret { font-size:16px; letter-spacing:.05em; overflow-wrap:anywhere; }
.audit td { vertical-align:top; } .kv { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; font-size:13px; max-width:28ch; }
/* ---- end Phase 9 (p9) ---- */
/* ---- Phase 7: journeys (crm [aec528/p7]). The vertical flow (JRN-02), the condition builder (JRN-13), the
   enrollment panel (JRN-20). Tokens only (rule 66). */
.jstatus { font-size:14px; font-weight:600; padding:1px 8px; border-radius:999px; border:1px solid var(--line); background:var(--subtle); color:var(--fg); }
.jstatus-active { border-color:var(--ok); } .jstatus-paused { border-color:var(--warn); } .jstatus-archived { color:var(--muted); }
.linkish { font:inherit; background:none; border:0; padding:0; color:var(--accent); text-decoration:underline; cursor:pointer; }
.flow { overflow-x:auto; padding:8px 0 16px; }
.fl-seq { display:flex; flex-direction:column; align-items:center; min-width:0; }
.fl-step { display:flex; align-items:flex-start; gap:4px; max-width:340px; width:100%; }
.fl-open { flex:1; min-width:0; text-align:left; font:inherit; color:var(--fg); background:var(--card); border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:8px; padding:8px 10px; cursor:pointer; display:grid; gap:2px; }
.fl-start .fl-open, .fl-end .fl-open { border-left-color:var(--muted); } .fl-decision .fl-open { border-left-color:var(--warn); } .fl-task .fl-open { border-left-color:var(--ok); }
.fl-step.is-open .fl-open { outline:2px solid var(--accent); outline-offset:1px; } .fl-step.has-problem .fl-open { border-color:var(--bad); }
.fl-step.fl-ref .fl-open { border-style:dashed; }
.fl-kind { font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); }
.fl-detail, .fl-timing { font-size:13px; color:var(--muted); overflow-wrap:anywhere; } .fl-problem { font-size:13px; color:var(--bad); font-weight:600; }
.fl-conn { display:flex; flex-direction:column; align-items:center; gap:4px; padding:6px 0; position:relative; }
.fl-conn::before { content:""; position:absolute; top:0; bottom:0; left:50%; border-left:2px solid var(--line); z-index:0; }
.fl-conn > * { position:relative; z-index:1; max-width:220px; } .fl-conn .fl-branch-label { text-align:center; font-size:13px; background:var(--bg); padding:0 4px; }
.fl-plus { border-radius:999px; background:var(--card); } .fl-plus.is-target { border-style:dashed; border-color:var(--accent); color:var(--accent); }
/* The step menu sits in the flow under its "+" (Stephen, 2026-10-07: hung below it, it overflowed a short flow, and the flow's
   sideways scrolling then showed a vertical scrollbar); the steps below move down while it's open. */
.fl-menu { position:relative; z-index:4; display:flex; flex-wrap:wrap; justify-content:center; gap:4px; width:min(320px, 90vw); max-width:none; }
.fl-branches { display:flex; gap:16px; align-items:flex-start; border-top:2px solid var(--line); padding-top:4px; }
.fl-branch { display:flex; flex-direction:column; align-items:center; min-width:180px; }
/* The condition builder, version 2 (JRN-30): numbered rules, the group's connector between every pair, nested groups
   indented 20px with a left border colored by depth (--depth-1 … --depth-4, contrast-checked in both themes). */
.cond-group { border:1px solid var(--line); border-radius:6px; padding:8px; display:grid; gap:6px; background:var(--card); }
.cond-group.nested { margin-left:20px; border-left-width:4px; padding:6px 6px 6px 8px; }
.cond-group.depth-1 { border-left-color:var(--depth-1); background:var(--subtle); }
.cond-group.depth-2 { border-left-color:var(--depth-2); background:var(--card); }
.cond-group.depth-3 { border-left-color:var(--depth-3); background:var(--subtle); }
.cond-group.depth-4 { border-left-color:var(--depth-4); background:var(--card); }
.cond-group.depth-1 > .cond-head .cond-num { color:var(--depth-1); } .cond-group.depth-2 > .cond-head .cond-num { color:var(--depth-2); }
.cond-group.depth-3 > .cond-head .cond-num { color:var(--depth-3); } .cond-group.depth-4 > .cond-head .cond-num { color:var(--depth-4); }
.cond-head { display:flex; flex-wrap:wrap; gap:4px 8px; align-items:center; justify-content:space-between; }
.cond-title { font-weight:600; font-size:14px; flex:1 1 140px; min-width:0; }
.cond-tools { display:inline-flex; flex-wrap:wrap; gap:4px; align-items:center; }
.cond-rules { list-style:none; margin:0; padding:0; display:grid; gap:4px; }
.cond-item { display:grid; gap:4px; }
.cond-item.dragging { opacity:.5; }
.cond-item.drop-before { box-shadow:0 -3px 0 var(--accent); } .cond-item.drop-after { box-shadow:0 3px 0 var(--accent); }
.cond-join { display:flex; align-items:center; gap:6px; }
.cond-join::before, .cond-join::after { content:''; flex:1 1 0; border-top:1px dashed var(--line); }
.cond-join .cond-op { font-size:12px; font-weight:700; letter-spacing:.04em; padding:0 8px; border-radius:999px; }
.cond-rule { display:flex; flex-wrap:wrap; gap:4px; align-items:center; padding:2px 0; }
.cond-num { font-weight:700; font-size:13px; min-width:1.6em; color:var(--muted); font-variant-numeric:tabular-nums; }
.cond-drag { cursor:grab; color:var(--muted); padding:0 2px; user-select:none; }
.cond-rule .cond-subject { flex:1 1 200px; min-width:0; }
.cond-opslot { display:flex; flex:0 1 160px; min-width:140px; } .cond-opslot .cb { width:100%; }   /* MTG-50: room for "contains any of" */
.cond-rule .cond-tools { margin-left:auto; }
.cond-rule .cb { min-width:0; }
.cond-value { display:flex; flex-wrap:wrap; gap:4px; align-items:center; flex:1 1 160px; min-width:0; }
.cond-value .cb { flex:1 1 120px; }
.cond-between { display:flex; flex-wrap:wrap; gap:4px; align-items:center; }
.cond-input { font:inherit; padding:6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); max-width:100%; min-width:0; }
.cond-multi { display:flex; flex-wrap:wrap; gap:4px 12px; } .cond-multi input { width:auto; margin-right:4px; } .cond-add { margin:0; display:flex; flex-wrap:wrap; gap:4px; }
.cond-hint { margin:4px 0 0; }

/* The subject button and the wide field picker (JRN-28): fixed to the viewport, placed by field-picker.js. */
.pkb { font:inherit; display:inline-flex; align-items:center; justify-content:space-between; gap:6px; max-width:100%; box-sizing:border-box; padding:6px 8px;
  border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--fg); cursor:pointer; text-align:left; }
.pkb:hover { border-color:var(--accent); }
.pkb-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.pkb.is-empty .pkb-label { color:var(--muted); }
.pkb-caret { color:var(--muted); flex:none; }
.fpk { position:fixed; z-index:40; box-sizing:border-box; width:min(720px, 92vw); max-height:70vh; display:flex; flex-direction:column; gap:6px; padding:8px 10px 10px;
  background:var(--card); color:var(--fg); border:1px solid var(--line); border-radius:8px; box-shadow:0 8px 28px rgb(0 0 0 / .25); }
.fpk-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.fpk-title { margin:0; font-size:15px; }
.fpk input.fpk-filter { width:100%; box-sizing:border-box; font:inherit; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--search); color:var(--fg); }
.fpk-list { overflow-y:auto; min-height:0; flex:1 1 auto; overscroll-behavior:contain; }
.fpk-group-h { position:sticky; top:0; z-index:1; background:var(--card); margin:6px 0 0; padding:4px 4px 2px; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); border-bottom:1px solid var(--line); }
.fpk-section-h { margin:4px 0 0; padding:0 8px; font-size:13px; font-style:italic; color:var(--muted); }
.fpk-opt { display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:4px 8px; border-radius:4px; cursor:pointer; overflow-wrap:anywhere; }
.fpk-opt.is-active { background:var(--subtle); outline:2px solid var(--focus); outline-offset:-2px; }
.fpk-opt.is-current .fpk-label::before { content:'✓ '; color:var(--ok); }
.fpk-hint { flex:none; font-size:12px; color:var(--muted); }
.fpk-none { margin:0; color:var(--muted); }

/* A value typed or a field (JRN-29, JRN-39): value-input.js */
.vi { display:inline-flex; flex-wrap:nowrap; gap:4px; align-items:center; max-width:100%; min-width:0; flex:1 1 160px; }
.vi-slot { display:inline-flex; flex-wrap:wrap; gap:4px; align-items:center; flex:1 1 auto; min-width:0; }
.vi-slot > .cb, .vi-slot > .vi-input { flex:1 1 100px; min-width:0; width:100%; }
.vi-multi .vi-slot > textarea { width:100%; min-height:4em; }
.vi-field { flex:none; font-size:15px; line-height:1.2; }
.vi-chip { max-width:100%; } .vi-chip-text { overflow-wrap:anywhere; }
.vi-today { display:inline-flex; align-items:center; gap:4px; font-size:14px; } .vi-today input { width:auto; }

/* Confirm before removing (JRN-38): confirm-dialog.js */
dialog.confirm { border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--fg); padding:16px 20px; width:min(480px, calc(100vw - 32px)); max-height:calc(100vh - 48px); overflow-y:auto; }
dialog.confirm.is-danger { border-top:4px solid var(--bad); }
dialog.confirm::backdrop { background:rgb(0 0 0 / .4); }
.confirm-title { margin:0 0 8px; font-size:18px; }
.confirm-body p { margin:0 0 8px; } .confirm-list { margin:0 0 8px; padding-left:20px; max-height:40vh; overflow-y:auto; }
.confirm-actions { display:flex; justify-content:flex-end; gap:8px; margin:12px 0 0; }
.btn.danger { color:var(--bad); border-color:var(--bad); font-weight:600; }
.branch { border:1px solid var(--line); border-radius:6px; padding:8px; display:grid; gap:6px; margin:0; } .branch legend { font-weight:600; padding:0 4px; } .branch-tools { margin:0; }
.timing { border:1px solid var(--line); border-radius:6px; padding:8px; margin:0; } .timing legend { font-weight:600; padding:0 4px; } .timing .words { margin:0 0 6px; font-style:italic; }
.timing input[type=checkbox], .days input { width:auto; margin-right:4px; } .days { border:0; padding:0; } .hol { padding-left:20px; }
.panel-body input[type=time], .panel-body input[type=date], .panel-body input[type=number], .panel-body input[type=datetime-local] { font:inherit; padding:6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
/* ---- Journeys v2 editor (track U2; JRN-31 to JRN-48a). Classes only: strict CSP. */
fieldset.branch { background:var(--card); border-left:4px solid var(--accent); } fieldset.branch.is-otherwise { border-left-color:var(--muted); } fieldset.branch.is-timeout { border-left-color:var(--warn); }
.branch .cond-host:empty { display:none; } .branch-add { margin:0; display:flex; gap:8px; flex-wrap:wrap; }
.sp-problems { padding:8px 12px; } .sp-problems ul { margin:0; padding-left:20px; }
label.check { display:inline-flex; align-items:center; gap:6px; font-weight:400; } label.check input { width:auto; margin:0; }
.nj-entity { border:0; padding:0; margin:0; display:flex; flex-wrap:wrap; gap:4px 16px; } .nj-entity legend { font-weight:600; font-size:14px; padding:0; margin-bottom:2px; } .nj-entity small { flex-basis:100%; color:var(--muted); }
.panel-body .frow input[type=number] { width:6em; }
.estimate { margin:4px 0 8px; color:var(--muted); font-size:14px; } .estimate:empty { display:none; }
.undo-tools { display:inline-flex; gap:4px; }
.jparams { margin:0 0 12px; } .jparams summary { cursor:pointer; } .jparams p { margin:6px 0; }
.jparam-table { width:100%; border-collapse:collapse; } .jparam-table th { text-align:left; font-size:13px; color:var(--muted); font-weight:600; padding:2px 4px; }
.jparam-table td { padding:2px 4px; vertical-align:top; } .jparam-table input { width:100%; box-sizing:border-box; font:inherit; padding:6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.jparam-table .err { display:block; color:var(--bad); }
.fl-every-note { margin:4px 0 0; font-size:13px; font-weight:600; color:var(--fg); text-align:center; }
.fl-branches.fl-every { border-top-style:double; border-top-width:4px; }
.fl-branches.fl-every > .fl-branch > .fl-conn::before { border-left-style:double; border-left-width:4px; }
.fl-open [hidden] { display:none; }
.journeys-panel h2 { font-size:18px; margin:0; } .journeys-panel .frow .cb { min-width:min(220px, 100%); }
.enr { border-top:1px solid var(--line); padding-top:8px; margin-top:8px; } .enr h3 { font-size:16px; margin:0 0 4px; } .enr-exited, .enr-completed { color:var(--muted); }
.mini { list-style:none; margin:0; padding:0; display:grid; gap:4px; }
.run { display:flex; flex-wrap:wrap; gap:4px 8px; align-items:baseline; padding:2px 6px; border-radius:6px; }
.run.is-current { background:var(--subtle); font-weight:600; } .run-mark { width:1.2em; text-align:center; }
.run-done .run-mark { color:var(--ok); } .run-error .run-mark, .run-error .run-name { color:var(--bad); } .run-cancelled, .run-skipped { color:var(--muted); }
.untaken { color:var(--muted); text-decoration:line-through; } .run-actions { display:inline-flex; flex-wrap:wrap; gap:4px; }
.redate input { font:inherit; padding:2px 4px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.enr-actions { display:flex; gap:6px; margin:6px 0 0; } .enr-exit { display:flex; flex-wrap:wrap; gap:6px; align-items:center; } .enr-exit input { font:inherit; padding:4px 8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.choices { display:inline-flex; flex-wrap:wrap; gap:4px; }
/* ---- END Phase 7 */
/* ---- BEGIN Phase 8: dashboard and reports (crm [aec528/p8]; TODO 8.01-8.06). Tokens only (rule 66). ---- */
.dash { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap:16px; align-items:start; }
.dash .card h2 { font-size:18px; margin:0 0 8px; } .dash .card h3 { font-size:15px; margin:12px 0 4px; } .dash-wide { grid-column:1 / -1; }
/* RPT-01b: My meetings, first on Home: a countdown, what and with whom, Join and Meeting Manager */
.mtg-list { list-style:none; margin:8px 0 0; padding:0; }
.mtg { display:grid; grid-template-columns:175px minmax(0, 1fr) auto; gap:12px; align-items:center; padding:8px 0; border-top:1px solid var(--line); }
.mtg-count { display:flex; flex-direction:column; align-items:center; padding:4px 8px; border:1px solid var(--line); border-radius:8px; background:var(--subtle); font-variant-numeric:tabular-nums; }
.mtg-count b { font-size:17px; white-space:nowrap; } .mtg-count small { color:var(--muted); font-size:12px; }
.mtg.is-soon .mtg-count { border-color:var(--warn); border-width:2px; } .mtg.is-soon .mtg-count b { color:var(--warn); }
.mtg.is-live .mtg-count { border-color:var(--ok); border-width:2px; } .mtg.is-live .mtg-count b { color:var(--ok); }
.mtg.is-over { opacity:.6; }
.mtg-acts { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
@media (max-width: 600px) { .mtg { grid-template-columns:minmax(0, 1fr); } .mtg-count { flex-direction:row; gap:8px; justify-content:center; } .mtg-acts { justify-content:flex-start; } }
.stats { display:flex; flex-wrap:wrap; gap:8px 24px; }
.stat { display:grid; gap:2px; margin:0 0 8px; max-width:28ch; } .stat strong { font-size:28px; line-height:1.1; } .stat.is-bad strong { color:var(--bad); }
.hb { margin:0 0 16px; } .hb-ok { color:var(--muted); }
.nothing-due { color:var(--muted); margin:4px 0 8px; }
.dash-list { margin:0; padding-left:20px; display:grid; gap:4px; } .dash-list li { overflow-wrap:anywhere; }
.bars { width:100%; border-collapse:collapse; } .bars caption { text-align:left; color:var(--muted); font-size:13px; padding-bottom:4px; }
.bars th { font-weight:400; text-align:left; padding:2px 8px 2px 0; width:40%; } .bars .num { text-align:right; padding:2px 8px; width:4em; }
.bars .barcell { width:50%; } .bar { display:block; height:12px; width:0; background:var(--accent); border-radius:3px; }
.server { margin-top:16px; }
/* The reports screen (8.02-8.06). */
.report-filters { align-items:flex-end; } .report-filters .field { min-width:150px; } .report-filters .cb { min-width:min(200px, 100%); }
.report-filters input[type=date] { font:inherit; padding:6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.report-cards { margin:8px 0 16px; } .report-table { margin-bottom:16px; } .report-table h2 { font-size:18px; margin:0 0 4px; }
.table-scroll { overflow-x:auto; } .rtable { border-collapse:collapse; width:100%; } .rtable th, .rtable td { padding:6px 10px; border-bottom:1px solid var(--line); text-align:left; }
.rtable td.num { text-align:right; font-variant-numeric:tabular-nums; } .rtable tbody th { font-weight:400; min-width:10em; } .muted { color:var(--muted); }
.legend { margin-top:8px; } .legend summary { cursor:pointer; color:var(--accent); }
.trend .half { width:30%; } .trend .half.neg { direction:rtl; } .bar.is-neg { background:var(--bad); }
.report-chart { margin-bottom:16px; } .report-chart h2 { font-size:18px; margin:0 0 8px; } .report-chart h3 { font-size:15px; margin:12px 0 4px; }
/* ---- END Phase 8 ---- */

/* ---- UI pass U.01: the shell. Top bar, then a collapsible sidebar (an accordion: one area open at a time) beside
   the page. A contact or company opens as two panels: the record (its parts) and the part picked. */
.shell { display:flex; align-items:flex-start; min-height:calc(100vh - var(--top-h, 50px)); }
/* The sidebar is exactly one screen tall: the middle (Dashboard and the areas) scrolls, Help and Settings stay pinned
   at the bottom (the redesign, Stephen 2026-10-08). It sits a little above the page: a soft shadow on its edge. */
.side { flex:0 0 260px; width:260px; box-sizing:border-box; position:sticky; top:var(--top-h, 50px); height:calc(100vh - var(--top-h, 50px));
  background:var(--card); color:var(--fg); border-right:1px solid var(--line); box-shadow:2px 0 12px -6px rgb(0 0 0 / .18);
  padding:6px 0 0; display:flex; flex-direction:column; overflow:hidden; z-index:2;
  transition:flex-basis .25s ease, width .25s ease; }
.side-main { flex:1 1 auto; min-height:0; overflow-y:auto; overflow-x:hidden; display:flex; flex-direction:column; gap:2px; padding:2px 10px 10px; scrollbar-width:thin; }
.side-foot { flex:none; display:flex; flex-direction:column; gap:2px; padding:8px 10px 10px; border-top:1px solid var(--line);
  max-height:55%; overflow-y:auto; overflow-x:hidden; }
.sx { flex:none; } .sx.is-open { display:flex; flex-direction:column; }
.side-main > .sx.is-open { flex:1 1 auto; min-height:220px; }
.side-collapsed .side { display:none; }
/* Each column (the sidebar, a record's panel) collapses and expands as a whole from the button at its top
   (Stephen, 2026-10-04). Collapsed, the sidebar is a rail of icons; a record's panel, a slim strip with its name. */
.col-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:4px 8px 4px 16px; flex:none; }
.col-title { font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.col-fold { flex:none; }
.side .col-head { padding:2px 10px 6px 20px; }
.side .col-fold { display:inline-grid; place-items:center; width:32px; height:32px; padding:0; border-radius:8px; color:var(--muted); }
.side .col-fold .side-ico { width:18px; height:18px; transition:transform .25s ease; }
.side-collapsed .side .col-fold .side-ico { transform:rotate(180deg); }
/* The items: an icon, the name, a count, and for an area a chevron that turns as its list opens */
.sx-h { margin:0; font-size:inherit; }
.side-item { position:relative; display:flex; width:100%; box-sizing:border-box; align-items:center; gap:12px; min-height:40px; padding:8px 12px;
  font:inherit; font-weight:500; color:var(--fg); background:none; border:0; border-radius:10px; cursor:pointer; text-align:left; text-decoration:none;
  transition:background-color .15s ease, color .2s ease, transform .15s ease; isolation:isolate; }
.side-item > :not(.side-pill) { position:relative; z-index:1; }
.side-item .side-ico { flex:none; color:var(--muted); transition:color .2s ease, transform .2s ease; }
.side-label { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.side-item:hover { background:var(--subtle); }
.side-item:hover .side-ico { color:var(--fg); transform:translateX(1px); }
.side-item:active { transform:scale(.98); }
.side-item:focus-visible { outline:2px solid var(--focus); outline-offset:1px; }
/* The chevron: its own button on the item's right (Stephen, 2026-10-08), folding and unfolding the list only; the name
   beside it is a link to the area's page. It sits over the item (and its pill), so the item leaves room for it. */
.sx-h { position:relative; }
.sx-h .sx-head { padding-right:44px; }
.sx-toggle { position:absolute; right:4px; top:50%; transform:translateY(-50%); z-index:2; width:32px; height:32px; padding:0; display:grid; place-items:center;
  background:none; border:0; border-radius:8px; cursor:pointer; color:var(--muted); }
.sx-toggle:hover { background:color-mix(in srgb, var(--fg) 10%, transparent); }
.sx-toggle:focus-visible { outline:2px solid var(--focus); outline-offset:-2px; }
.sx-chev { flex:none; width:7px; height:7px; border:solid var(--muted); border-width:0 1.6px 1.6px 0; transform:rotate(-45deg); transition:transform .2s ease; }
.sx-toggle[aria-expanded="true"] .sx-chev { transform:rotate(45deg) translate(-1px, -1px); }
.sx-h:has(.sx-head.is-lit) .sx-chev { border-color:var(--accent-fg); }
.sx-h:has(.sx-head.is-lit) .sx-toggle:hover { background:color-mix(in srgb, var(--accent-fg) 18%, transparent); }
.side-count { flex:none; min-width:20px; padding:0 6px; box-sizing:border-box; border-radius:999px; font-size:12px; font-weight:700; line-height:20px; text-align:center;
  background:var(--bad); color:var(--card); }
/* The current item: a raised pill in the accent color. It slides from the last one (sidebar.js); the text turns light as it lands. */
.side-pill { position:absolute; inset:0; z-index:0; border-radius:10px; background:var(--accent); transform-origin:0 0; pointer-events:none;
  box-shadow:inset 0 1px 0 color-mix(in srgb, var(--accent-fg) 28%, transparent), inset 0 -2px 0 rgb(0 0 0 / .18),
    0 1px 2px rgb(0 0 0 / .22), 0 6px 14px -4px color-mix(in srgb, var(--accent) 65%, transparent); }
.side-item.is-current { font-weight:650; }
.side-item.is-current:hover { background:none; }
.side-item.is-lit, .side-item.is-lit .side-ico, .side-item.is-lit:hover .side-ico { color:var(--accent-fg); }
.side-item.is-lit .side-count { background:var(--accent-fg); color:var(--accent); }
.side-item.is-lit .side-ico { animation:side-pop .35s ease-out; }
@keyframes side-pop { 40% { transform:scale(1.18) rotate(-4deg); } 100% { transform:none; } }
/* An open area's list hangs under its item on a guide line, so it reads as part of it */
.sx-body { margin:4px 0 6px 21px; padding:2px 0 2px 12px; border-left:2px solid var(--line); display:flex; flex-direction:column; gap:6px; flex:1 1 auto; min-height:0; }
.sx-body[hidden] { display:none; }   /* display:flex would otherwise beat the hidden attribute */
.sx.is-open .sx-body { animation:side-open .22s ease-out; }
@keyframes side-open { from { opacity:0; transform:translateY(-6px); } }
.sx-list { flex:1 1 auto; min-height:0; overflow-y:auto; align-content:start; }
.sx-q { width:100%; box-sizing:border-box; font:inherit; font-size:14px; padding:6px 10px; border:1px solid var(--line); border-radius:8px; background:var(--search); color:var(--fg); }
.sx-list, .sx-links { list-style:none; margin:0; padding:0; display:grid; gap:1px; }
.sx-list a, .sx-links a { display:grid; padding:4px 8px; border-radius:6px; color:var(--fg); text-decoration:none; font-size:14px; transition:background-color .15s ease; }
.sx-list a:hover, .sx-links a:hover { background:var(--subtle); }
.sx-list a[aria-current="page"], .sx-links a[aria-current="page"] { background:var(--subtle); font-weight:600; box-shadow:inset 3px 0 0 var(--accent); }
.sx-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sx-list small { color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sx-links { border-top:1px solid var(--line); padding-top:6px; } .sx-links a { color:var(--accent); }
.sx-note { color:var(--muted); font-size:14px; padding:4px 8px; } .sx-bad { color:var(--bad); }
.side-foot .sx.is-open .sx-list { max-height:180px; }
/* The rail: icons only, each still opening its area; the name shows in a tip (and is each item's aria-label) */
.side-tip { position:fixed; z-index:40; transform:translateY(-50%); padding:4px 10px; border-radius:6px; font-size:13px; font-weight:600; white-space:nowrap;
  background:var(--fg); color:var(--bg); box-shadow:0 4px 12px rgb(0 0 0 / .25); pointer-events:none; }
.side-tip[hidden] { display:none; }
@media (min-width:801px) {
  .side-collapsed .side { display:flex; flex:0 0 64px; width:64px; }
  .side-collapsed .side .col-head { justify-content:center; padding:2px 0 6px; }
  .side-collapsed .side .col-title, .side-collapsed .side .side-label, .side-collapsed .side .sx-toggle, .side-collapsed .side .sx-body { display:none; }
  .side-collapsed .sx-h .sx-head { padding-right:10px; }
  .side-collapsed .side .sx.is-open { flex:none; min-height:0; }   /* its list is hidden: no room kept for it (Stephen, 2026-10-08) */
  .side-collapsed .side-main, .side-collapsed .side-foot { padding-left:10px; padding-right:10px; }
  .side-collapsed .side-item { justify-content:center; padding:10px; gap:0; }
  .side-collapsed .side-count { position:absolute; top:3px; right:3px; min-width:16px; padding:0 4px; font-size:10px; line-height:16px; }
  /* Collapsed, a record's strip shows its photo, logo or initials at icon size, then its name in capitals, written
     downwards (Stephen, 2026-10-08), under the expand button */
  .rec-collapsed .rec-nav .col-head { flex-direction:column; align-items:center; justify-content:flex-start; gap:10px; padding:0 4px; min-height:0; }
  .rec-collapsed .rec-nav .col-fold { order:0; } .rec-collapsed .rec-nav .col-title { display:none; }
  .rec-collapsed .rec-nav .rec-mini { order:1; display:flex; flex-direction:column; align-items:center; gap:10px; min-height:0; }
}
@media (prefers-reduced-motion: reduce) {
  .side, .side-item, .side-item .side-ico, .sx-chev, .side .col-fold .side-ico { transition:none; }
  .side-item.is-lit .side-ico, .sx.is-open .sx-body { animation:none; }
}
.shell > main { flex:1 1 auto; min-width:0; max-width:1100px; }
/* Help (pinned at the bottom of the sidebar) */
.help-areas { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.help-areas li { display:grid; grid-template-columns:minmax(10em, 14em) 1fr; gap:4px 16px; align-items:baseline; }
.help-areas a { display:inline-flex; align-items:center; gap:8px; } .help-areas .side-ico { align-self:center; }
.help-keys { margin:0; display:grid; gap:8px; } .help-keys div { display:grid; grid-template-columns:minmax(10em, 14em) 1fr; gap:16px; } .help-keys dd { margin:0; }
kbd { display:inline-block; padding:1px 6px; border:1px solid var(--line); border-bottom-width:2px; border-radius:4px; background:var(--subtle); font:13px/1.4 ui-monospace, monospace; }
@media (max-width:600px) { .help-areas li, .help-keys div { grid-template-columns:1fr; } }
/* A record: its panel, and the part picked, side by side. The panel is a full-height column like the sidebar, flush
   against it (the negative margins undo main's padding), not a floating card. */
.rec { display:flex; gap:24px; align-items:flex-start; margin:-24px 0 0 -16px; }
.rec-nav { flex:0 0 240px; box-sizing:border-box; position:sticky; top:var(--top-h, 50px); height:calc(100vh - var(--top-h, 50px)); overflow-y:auto;
  padding:8px 0; margin:0; background:var(--card); border-right:1px solid var(--line); display:flex; flex-direction:column; }
.rec-nav-body { padding:4px 12px 12px 16px; }
.rec-part { padding-top:24px; padding-right:8px; max-width:1100px; }
.shell > main:has(.rec) { margin-left:0; max-width:none; }   /* a record sits flush against the sidebar, collapsed or not */
.rec-collapsed .rec-nav { flex:0 0 44px; width:44px; overflow:hidden; } .rec-collapsed .rec-nav-body { display:none; }
.rec-nav h1 { font-size:20px; margin:0 0 4px; overflow-wrap:anywhere; }
.rec-company { font-weight:600; } .rec-company a { color:var(--accent); }
.rec-sub { margin:0; color:var(--muted); font-size:14px; overflow-wrap:anywhere; } .rec-sub.bad { color:var(--bad); font-weight:600; }
.rec-parts { list-style:none; margin:12px 0; padding:0; display:grid; gap:2px; }
.rec-parts a { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:6px 10px; border-radius:6px; color:var(--fg); text-decoration:none; }
.rec-parts a:hover { background:var(--subtle); }
.rec-parts a[aria-current="page"] { background:var(--subtle); font-weight:600; box-shadow:inset 3px 0 0 var(--accent); }
.rec-part { flex:1 1 auto; min-width:0; } .rec-part h2 { font-size:20px; } .rec-part > .head h2 { margin:0; }
.rec-list { margin:0; padding-left:20px; display:grid; gap:4px; } .rec-list small { color:var(--muted); }
@media (max-width:800px) {
  /* Phones: the sidebar overlays the page instead of squeezing it; the record panel sits on top as a row of parts. */
  .side { position:fixed; top:var(--top-h, 50px); left:0; bottom:0; height:auto; z-index:14; box-shadow:4px 0 16px rgb(0 0 0 / .2); width:min(300px, 85vw); }
  .rec { flex-direction:column; align-items:stretch; margin:0; gap:16px; } .rec-nav { position:static; flex:none; width:100%; height:auto; border:1px solid var(--line); border-radius:8px; }
  .rec-collapsed .rec-nav { width:100%; flex:none; } .rec-part { padding-top:0; }
  .rec-parts { display:flex; flex-wrap:wrap; }
}
/* ---- end U.01 */
.rec-part .card > h2:first-child { margin-top:0; }
/* ---- Docked side panel (Stephen, 2026-10-04; built in p5's 7eab0dd, moved onto the U.01 shell): on a wide screen a
   side panel is a column beside the page instead of floating over it, and the page and the panel each collapse. */
.dock-bar { display:none; }
.panel-fold { display:none; }
@media (min-width: 900px) {
  body.docked { display:grid; grid-template-columns:minmax(0,1fr) var(--panel-w, min(440px, 42vw)); grid-template-rows:auto auto 1fr; min-height:100vh; }
  body.docked > .top { grid-column:1 / -1; grid-row:1; }   /* Stephen, 2026-10-07: the panel starts below the top bar */
  body.docked > .dock-bar { display:flex; grid-column:1; grid-row:2; padding:8px 16px 0; }
  body.docked > .shell { grid-column:1; grid-row:3; min-width:0; }
  body.docked.panel-wide { grid-template-columns:minmax(0,1fr) var(--panel-w, min(720px, 60vw)); }
  body.docked.panel-wide:not(.panel-collapsed) > .toasts { right:calc(var(--panel-w, min(720px, 60vw)) + 16px); }
  body.docked > .panel { position:sticky; top:var(--top-h, 50px); grid-column:2; grid-row:2 / span 2; height:calc(100vh - var(--top-h, 50px)); width:auto; box-shadow:none; z-index:1; }
  body.docked.page-collapsed > .panel { top:0; grid-row:1 / span 3; height:100vh; }
  body.docked:not(.panel-collapsed) > .toasts { right:calc(var(--panel-w, min(440px, 42vw)) + 16px); }
  body.docked.panel-collapsed > .toasts { right:64px; max-width:calc(100vw - 96px); }
  body.docked .panel-fold { display:inline-block; }
  body.docked.page-collapsed { grid-template-columns:auto minmax(0,1fr); }
  body.docked.page-collapsed > .shell, body.docked.page-collapsed > .top { display:none; }
  body.docked.page-collapsed > .dock-bar { grid-row:1 / span 3; align-items:flex-start; padding:8px; border-right:1px solid var(--line); }
  body.docked.panel-collapsed { grid-template-columns:minmax(0,1fr) auto; }
  body.docked.panel-collapsed > .panel .panel-body, body.docked.panel-collapsed > .panel .panel-x { display:none; }
  body.docked.panel-collapsed > .panel .panel-head { flex-direction:column; align-items:center; border-bottom:0; padding:8px; }
  body.docked.panel-collapsed > .panel #panel-t { writing-mode:vertical-rl; font-size:15px; }
}
/* ---- end docked side panel */
/* ---- p5 BEGIN: a contact's Tasks, Emails and Surveys parts (Stephen, 2026-10-04) ---- */
.part-list { list-style:none; margin:0; padding:0; display:grid; gap:0; }
.part-list > li { border-top:1px solid var(--line); padding:8px 0; } .part-list > li:first-child { border-top:0; }
.part-list summary, .part-row { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 12px; align-items:baseline; cursor:pointer; }
.part-row { cursor:default; }
.part-main { min-width:0; overflow-wrap:anywhere; } .part-meta { display:flex; flex-wrap:wrap; gap:4px 8px; align-items:baseline; }
.part-email { margin-top:8px; }
.sv-state { font-weight:600; } .sv-answered { color:var(--ok); } .sv-started, .sv-opened { color:var(--warn); } .sv-sent { color:var(--muted); }
/* ---- p5 END ---- */
/* ---- e1 BEGIN: the email block editor (TODO 5.02, 5.03; D-9). Tokens only (rule 66). The email "paper" takes the
   design's own colors through the CSSOM (block-editor.js), so anything of the editor's drawn on it (hints, chips,
   tools, the drop marker) carries its own token background, and reads in both themes (rule 63). */
.shell > main:has(.be) { max-width:none; }
.be { position:relative; margin:8px 0; }
.be-bar { position:sticky; top:0; z-index:4; display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; padding:6px 0; background:var(--card); border-bottom:1px solid var(--line); }
.be-bar .btn[aria-pressed="true"] { background:var(--accent); color:var(--accent-fg); border-color:var(--accent); }
.be-bar .btn:disabled { opacity:.55; cursor:default; }
.be:not([data-text]) .be-rt .btn { opacity:.55; }
.be-color { display:inline-flex; align-items:center; gap:4px; }
.be-color input { width:28px; height:20px; padding:0; border:1px solid var(--line); background:var(--card); cursor:pointer; }
.be-link, .be-code { margin:8px 0; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--card); }
.be-link { display:flex; flex-wrap:wrap; gap:6px; align-items:center; } .be-link input { flex:1 1 220px; font:inherit; padding:4px 8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.be-link .err { color:var(--bad); flex-basis:100%; }
.be-main { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:12px; align-items:start; margin-top:8px; }   /* editor v2: canvas, then the right panel */
.be-ro .be-main { grid-template-columns:minmax(0,1fr); }
.be-palette h3, .be-settings h3 { font-size:15px; margin:0 0 4px; }
.be-palette ul { list-style:none; margin:0; padding:0; display:grid; gap:4px; }
.be-pal { width:100%; text-align:left; font:inherit; font-size:14px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--fg); cursor:grab; }
.be-pal:hover { border-color:var(--accent); color:var(--accent); }
.be-stage { overflow-x:auto; border:1px solid var(--line); border-radius:8px; background:var(--subtle); }
.be-canvas { margin:0 auto; padding:16px 8px; box-sizing:border-box; min-height:200px; }   /* EDT-12: centered, as the preview is (Stephen, 2026-10-06) */
.be-paper { max-width:600px; margin:0 auto; min-height:120px; }
.be-paper a { color:LinkText; }
.be-section, .be-block { position:relative; }
.be-block { min-height:12px; }
.be-cols { display:flex; }
.be-col { flex:1 1 0; min-width:0; min-height:24px; }
.be-canvas.is-narrow .be-cols { flex-direction:column; }
.be-canvas.is-narrow .be-col { flex:none; padding:0 !important; }   /* the email's own media query does the same under 620px */
.be:not(.be-ro) .be-section:hover, .be:not(.be-ro) .be-block:hover { outline:1px dashed var(--line); }
.be-section.is-selected, .be-block.is-selected, .be-section:focus-visible, .be-block:focus-visible { outline:2px solid var(--focus); outline-offset:2px; box-shadow:0 0 0 2px var(--card); }
.be-tools { position:absolute; top:auto; bottom:calc(100% + 1px); right:4px; z-index:3; display:none; gap:2px; align-items:center; font-size:12px; line-height:1.4; background:var(--card); color:var(--fg); border:1px solid var(--line); border-radius:6px; padding:1px 4px; }
.be-section > .be-tools { right:auto; left:4px; }
.be-block.is-selected > .be-tools, .be-block:focus-within > .be-tools,
.be-section.is-selected > .be-tools, .be-section:focus-within > .be-tools { display:flex; }   /* EDT-37: the selected one only, above its outline */
.be-grip { cursor:grab; padding:0 4px; user-select:none; }
.be-tlabel { color:var(--muted); padding:0 4px; }
.be-tbtn { font:inherit; font-size:12px; border:0; background:none; color:var(--accent); cursor:pointer; padding:0 4px; }
.be-tbtn:hover { text-decoration:underline; }
.is-dragging { opacity:.5; }
.be-drop { height:4px; margin:2px 0; border-radius:2px; background:var(--accent); box-shadow:0 0 0 1px var(--card); }
.be-empty, .be-ph { margin:4px 0; padding:10px; border:1px dashed var(--line); border-radius:6px; background:var(--card); color:var(--muted); font:13px/1.4 system-ui, sans-serif; text-align:center; }
.be-ro .be-empty:empty { display:none; }
.be-text { outline:none; min-height:1.5em; overflow-wrap:anywhere; }
.be-text p, .be-text h1, .be-text h2, .be-text h3 { margin:0 0 12px; }
.be-text ul, .be-text ol { margin:0 0 12px; padding-left:24px; }
.be-text > :last-child { margin-bottom:0; }
.be-spacer { background:repeating-linear-gradient(45deg, transparent 0 6px, var(--subtle) 6px 8px); }
.be-ro .be-spacer { background:none; }
.be-html-frame { display:block; width:100%; min-height:24px; border:0; pointer-events:none; }
/* Stephen, 2026-10-06: an Admin types in an HTML block in place; social icons drag to new places */
.be-html-frame.is-editable { pointer-events:auto; cursor:text; }
.be-html-frame.is-editable:focus { outline:2px solid var(--accent); outline-offset:1px; }
.be-social [data-link] { cursor:grab; } .be-social [data-link]:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.be-social [data-link].is-dragging { opacity:.4; }
.be-link-drop { display:inline-block; width:3px; height:28px; margin:0 3px; vertical-align:middle; border-radius:2px; background:var(--accent); }
.be-links li.is-current { outline:2px solid var(--accent); outline-offset:2px; border-radius:6px; }
.be-link-mv { display:inline-flex; gap:2px; }
.mchip { display:inline-block; padding:0 4px; margin:0 1px; border:1px solid var(--line); border-radius:4px; background:var(--subtle); color:var(--fg); font-size:.9em; line-height:1.4; white-space:nowrap; cursor:pointer; user-select:all; }
.mchip:focus-visible { outline:2px solid var(--focus); outline-offset:1px; }
.mchip-bad { border-color:var(--bad); background:var(--bad-bg); color:var(--bad); text-decoration:underline wavy var(--bad); }
.be-settings { padding:0 0 0 12px; border-left:1px solid var(--line); }
.be-settings .field { margin-bottom:8px; } .be-settings input[type=color] { width:48px; height:28px; padding:0; }
.be-settings select, .be-settings input[type=number] { font:inherit; padding:6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.be-links { list-style:none; margin:0; padding:0; display:grid; gap:6px; } .be-links li { display:flex; flex-wrap:wrap; gap:4px; } .be-links input { flex:1 1 120px; min-width:0; font:inherit; padding:4px 6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.be-pop, .be-picker { position:absolute; z-index:20; width:min(300px, calc(100vw - 32px)); box-sizing:border-box; padding:8px 10px; background:var(--card); color:var(--fg); border:1px solid var(--line); border-radius:8px; box-shadow:0 4px 16px rgb(0 0 0 / .2); }
.be-pop p, .be-picker p { margin:4px 0; }
.be-hint { margin:6px 0 0; }
.be-warn { margin:6px 0; padding:6px 10px; border:2px solid var(--warn); border-radius:6px; background:var(--card); color:var(--fg); }
.be-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media (max-width:900px) {
  .be-main { grid-template-columns:minmax(0,1fr); }
  .be-side { border-left:0; border-top:1px solid var(--line); padding:8px 0 0; position:static; max-height:none; }
}
/* ---- e1 END */
.be [hidden] { display:none !important; }   /* .be-link etc. set display, which would otherwise beat the hidden attribute */
/* #1 (2026-10-04): a URL field's input with its Open link */
.with-open { display:flex; gap:6px; align-items:center; }
.with-open input { flex:1 1 auto; min-width:0; }
.with-open .field-open { white-space:nowrap; border:1px solid var(--line); border-radius:6px; text-decoration:none; }
/* #13 (2026-10-04): Enroll in journey sits at the top right of the Journeys part, like Add task */
.journeys-panel #jp-add .frow { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.journeys-panel #jp-add label { font-weight:600; font-size:14px; }
.journeys-panel .jp-none { margin:0; font-size:14px; }
/* #11 (2026-10-04): the Edit user dialog */
dialog.user-edit { border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--fg); padding:16px 20px; width:min(440px, calc(100vw - 32px)); }
dialog.user-edit::backdrop { background:rgb(0 0 0 / .4); }
dialog.user-edit select { width:100%; font:inherit; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
dialog.user-edit .field { margin-bottom:12px; }
/* #15 (2026-10-04): a contact's Dashboard */
.cd { display:flex; flex-direction:column; gap:16px; }
.cd-tiles { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:12px; width:100%; }
.cd-tile { display:flex; flex-direction:column; gap:2px; padding:14px 16px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--fg); text-decoration:none; }
.cd-tile:hover, .cd-tile:focus-visible { border-color:var(--accent); }
.cd-tile strong { font-size:28px; line-height:1.1; font-variant-numeric:tabular-nums; }
.cd-tile small { color:var(--muted); }
.cd-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; align-items:start; }
.cd-grid .card { margin:0; }
.cd-grid .cd-wide { grid-column:1 / -1; }
.cd-list { list-style:none; margin:0; padding:0; }
.cd-list li { display:flex; flex-direction:column; gap:2px; padding:7px 0; border-top:1px solid var(--line); overflow-wrap:anywhere; }
.cd-list li:first-child { border-top:0; }
.cd-facts { display:grid; grid-template-columns:auto 1fr; gap:6px 16px; margin:0; }
.cd-facts div { display:contents; }
.cd-facts dt { color:var(--muted); font-size:14px; }
.cd-facts dd { margin:0; min-width:0; overflow-wrap:anywhere; }
@media (max-width: 900px) { .cd-tiles { grid-template-columns:repeat(2, minmax(0, 1fr)); } .cd-grid { grid-template-columns:1fr; } }
/* #12 global search */
.top-search { flex:0 1 360px; min-width:0; margin:0; }
.top-search input { width:100%; box-sizing:border-box; font:inherit; padding:6px 10px; border:1px solid var(--line); border-radius:6px; background:var(--search); color:var(--fg); }
.top-search input::placeholder { color:var(--muted); }
.top-search input:focus-visible { outline:2px solid var(--focus); outline-offset:1px; }
@media (max-width:600px) { .top-search { order:5; flex:1 1 100%; } }   /* a phone: the box takes its own row under the bar */
.search-group h2 { margin:0; font-size:18px; }
.search-total { margin:2px 0 8px; color:var(--muted); }
.search-rows { list-style:none; margin:0; padding:0; }
.search-rows li { padding:6px 0; border-top:1px solid var(--line); overflow-wrap:anywhere; }
.search-rows li:first-child { border-top:0; }
.search-sub { color:var(--muted); margin-left:6px; }
.search-none { color:var(--muted); }
/* #6/#7 (2026-10-04): sections share a row by width (full, 2/3, 1/2, 1/3), up to three across; they stack on narrower screens */
.layout-grid, .arr-board { display:grid; grid-template-columns:repeat(6, minmax(0, 1fr)); gap:16px; align-items:start; }
.layout-grid > .card, .arr-board > .card { margin:0; min-width:0; container-type:inline-size; }
.w-full { grid-column:span 6; } .w-2-3 { grid-column:span 4; } .w-1-2 { grid-column:span 3; } .w-1-3 { grid-column:span 2; }
@media (max-width: 1100px) { .w-1-3, .w-2-3 { grid-column:span 3; } }
@media (max-width: 760px) { .w-2-3, .w-1-2, .w-1-3 { grid-column:span 6; } }
/* a narrow section drops its inner field columns rather than squeezing them */
@container (max-width: 460px) { .layout-section .grid.cols-2, .layout-section .grid.cols-3 { grid-template-columns:minmax(0, 1fr); } }
/* #5 (2026-10-04): arrange mode is dragged, never nudged (rule 58): a visible handle, a drop line, and ↑/↓ only for the keyboard */
.drag-handle { color:var(--muted); font-size:18px; line-height:1; cursor:grab; user-select:none; padding:0 2px; }
.arr-sec-head:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:6px; }
.arr-sec-tools { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.arr-field { justify-content:flex-start; } .arr-field .arr-label { flex:1 1 auto; }
.kbd-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.kbd-only:focus-visible { position:static; width:auto; height:auto; padding:2px 8px; overflow:visible; clip-path:none; border:1px solid var(--line); }
.arr-sec.dragging { opacity:.5; }
.arr-field.drop-before { box-shadow:0 -3px 0 0 var(--accent); }
.arr-field.drop-after { box-shadow:0 3px 0 0 var(--accent); }
.arr-sec.drop-before { box-shadow:-4px 0 0 0 var(--accent); }
.arr-sec.drop-into, .arr-tray.drop-into { outline:2px dashed var(--accent); outline-offset:2px; }
.arr-end.drop-end { outline:2px dashed var(--accent); outline-offset:4px; border-radius:6px; }
/* #6/#7: stack by the space the record part actually has (the menu and record panel take some), not just the window */
.rec-part { container:recpart / inline-size; }
@container recpart (max-width: 900px) { .w-1-3, .w-2-3 { grid-column:span 3; } }
@container recpart (max-width: 620px) { .w-2-3, .w-1-2, .w-1-3 { grid-column:span 6; } }
.arr-title { flex:1 1 0; min-width:6em; max-width:100%; box-sizing:border-box; }
.arr-sec { min-width:0; overflow:hidden; }
/* #2/#3 (2026-10-04): a contact's photo or a company's logo, in the record panel */
.rec-mini { display:none; }
/* A photo or logo (photo.js; the editor, Stephen 2026-10-08): a square crop of the picture in a shaped frame, the
   whole picture placed by --ph-w/--ph-l/--ph-t (set through the CSSOM from the validated crop), a border drawn inside */
.ph { position:relative; display:inline-block; overflow:hidden; flex:none; background:var(--card); border-radius:50%; vertical-align:middle; }
.ph img { position:absolute; max-width:none; width:var(--ph-w, 100%); height:auto; left:var(--ph-l, 0); top:var(--ph-t, 0); }
.ph::after { content:""; position:absolute; inset:0; border-radius:inherit; box-shadow:inset 0 0 0 var(--ph-bw, 1px) var(--ph-bc, var(--line)); pointer-events:none; }
.ph-big { width:72px; height:72px; } .ph-mini { width:32px; height:32px; } .ph-pop { width:268px; height:268px; }
.ph-s-circle { border-radius:50%; } .ph-s-rounded { border-radius:22%; } .ph-s-square { border-radius:0; }
.ph-b-none { --ph-bw:0; }   /* None is none: no hairline either (Stephen, 2026-10-08) */ .ph-b-thin { --ph-bw:2px; } .ph-b-thick { --ph-bw:4px; }
.ph-mini.ph-b-thin { --ph-bw:1px; } .ph-mini.ph-b-thick { --ph-bw:2px; } .ph-pop.ph-b-thin { --ph-bw:4px; } .ph-pop.ph-b-thick { --ph-bw:8px; }
.ph-b-thin.ph-c-line, .ph-b-thick.ph-c-line { --ph-bc:var(--muted); } .ph-c-accent:not(.ph-b-none) { --ph-bc:var(--accent); } .ph-c-fg:not(.ph-b-none) { --ph-bc:var(--fg); }
/* The pencil: a small round button on the picture's bottom right (instead of Change / Remove) */
.ph-holder { position:relative; display:inline-block; line-height:0; }
/* 13 px (Stephen, 2026-10-08: half the size, a quarter of it over the picture): its center sits where a quarter of the
   circle overlaps the picture's own shape: on a square's corner, 0.4 of its radius outside a circle's edge (at 45°), and
   between for a rounded square. A 25 px invisible hit area keeps it easy to click or tap (WCAG 2.5.8). */
.ph-edit { position:absolute; left:56.8px; top:56.8px; width:13px; height:13px; padding:0; border-radius:50%; display:grid; place-items:center; cursor:pointer;
  background:var(--card); color:var(--fg); border:1px solid var(--line); box-shadow:0 1px 2px rgb(0 0 0 / .25); transition:transform .15s ease, background-color .15s ease; box-sizing:border-box; }
.ph-edit::before { content:""; position:absolute; inset:-6px; border-radius:50%; }
.ph-edit svg { width:8px; height:8px; }
.ph-holder:has(.ph-s-rounded) .ph-edit { left:62.7px; top:62.7px; }
.ph-holder:has(.ph-s-square) .ph-edit { left:65.5px; top:65.5px; }
.ph-edit:hover { background:var(--subtle); transform:scale(1.15); }
@media (prefers-reduced-motion: reduce) { .ph-edit { transition:none; } }
/* The editor */
.ph-dialog { max-width:min(720px, calc(100vw - 32px)); box-sizing:border-box; }
.ph-dialog h2 small { color:var(--muted); font-weight:400; }
.ph-ed { display:flex; flex-wrap:wrap; gap:20px; align-items:flex-start; }
.ph-stage { position:relative; width:300px; height:300px; overflow:hidden; border-radius:8px; background:var(--subtle); flex:none; touch-action:none; }
.ph-stage canvas { display:block; }
.ph-crop { position:absolute; box-sizing:border-box; cursor:move; outline:2px solid var(--accent-fg); outline-offset:-2px;
  box-shadow:0 0 0 2px var(--accent), 0 0 0 9999px rgb(0 0 0 / .5); }
.ph-crop:focus-visible { outline:3px solid var(--focus); outline-offset:2px; }
.ph-opts { display:grid; gap:12px; min-width:240px; flex:1 1 240px; }
.ph-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:0; } .ph-row > span:first-child { min-width:6.5em; color:var(--muted); font-size:14px; }
.ph-row input[type=range] { flex:1 1 140px; }
.ph-previews { gap:16px; align-items:flex-end; }
.ph-pv { display:block; background:var(--card); }
.ph-pv-big { width:72px; height:72px; } .ph-pv-mini { width:32px; height:32px; }
.ph-pv.ph-b-thin { box-shadow:0 0 0 2px var(--ph-bc); } .ph-pv.ph-b-thick { box-shadow:0 0 0 4px var(--ph-bc); } .ph-pv-mini.ph-b-thick { box-shadow:0 0 0 2px var(--ph-bc); }
.ph-pv { --ph-bc:var(--muted); } .ph-pv.ph-c-accent { --ph-bc:var(--accent); } .ph-pv.ph-c-fg { --ph-bc:var(--fg); }
@media (max-width:600px) { .ph-stage { transform:scale(.9); transform-origin:0 0; } }
/* Shown larger after resting on it (photo.js) */
.photo-pop { position:fixed; z-index:45; width:280px; height:280px; padding:6px; box-sizing:border-box; border-radius:14px; background:var(--card);
  border:1px solid var(--line); box-shadow:0 12px 32px rgb(0 0 0 / .28); pointer-events:none; animation:photo-pop-in .15s ease-out; display:grid; place-items:center; }
.photo-pop[hidden] { display:none; }
@keyframes photo-pop-in { from { opacity:0; transform:scale(.96); } }
@media (prefers-reduced-motion: reduce) { .photo-pop { animation:none; } }
.rec-mini-pic { width:32px; height:32px; border-radius:50%; object-fit:cover; border:1px solid var(--line); background:var(--card); flex:none; box-sizing:border-box; }
.rec-mini-pic.rec-initials { font-size:12px; }
.rec-mini-name { writing-mode:vertical-rl; text-transform:uppercase; letter-spacing:.06em; font-size:12px; font-weight:700; color:var(--fg);
  max-height:calc(100vh - var(--top-h, 50px) - 120px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rec-photo-wrap { display:flex; align-items:center; gap:12px; margin:4px 0 8px; }
.rec-photo { width:72px; height:72px; border-radius:50%; object-fit:cover; border:1px solid var(--line); background:var(--card); flex:0 0 auto; }
.rec-initials { display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:24px; color:var(--muted); }
/* #8 field picker (2026-10-04): the Fields palette beside the email editor, the survey builder and a journey task step */
.fp { border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--fg); padding:8px; box-sizing:border-box; min-width:0; }
.fp [hidden] { display:none !important; }
.be-palette .fp { margin-top:12px; padding:6px; }

/* the blocks and the fields stay in view beside a long email: the column sticks under the top bar and scrolls itself */
.be-has-fields .be-palette { position:sticky; top:64px; max-height:calc(100vh - 80px); overflow-y:auto; }
.be-palette .fp-groups { max-height:none; overflow:visible; }
.fp-head { margin:0; font-size:15px; }
.fp-toggle { width:100%; display:flex; justify-content:space-between; align-items:center; gap:6px; text-align:left; font-weight:600; }
.fp-toggle::after { content:'▾'; color:var(--muted); }
.fp-toggle[aria-expanded="false"]::after { content:'▸'; }
.fp-hint { margin:6px 0; color:var(--muted); }
.fp input.fp-filter { width:100%; box-sizing:border-box; font:inherit; font-size:14px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--search); color:var(--fg); }
.fp-groups { max-height:min(60vh, 520px); overflow-y:auto; margin-top:6px; }
.fp-compact .fp-groups { max-height:240px; }
.fp-group h4 { margin:8px 0 4px; font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.fp ul, .be-palette .fp ul { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:minmax(0, 1fr); gap:3px; }
.fp-field { width:100%; box-sizing:border-box; text-align:left; font:inherit; font-size:13px; line-height:1.35; padding:4px 6px; border:1px solid var(--line); border-radius:4px; background:var(--subtle); color:var(--fg); cursor:grab; overflow-wrap:anywhere; }
.fp-field:hover { border-color:var(--accent); }
.fp-field:focus-visible { outline:2px solid var(--focus); outline-offset:1px; }
.fp-field.is-dragging { opacity:.5; }
.fp-none { margin:6px 0 0; color:var(--muted); }
.fp-sr { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.be-text.fp-over, .be-block.fp-over { outline:2px dashed var(--accent); outline-offset:2px; }
.fp-layout { display:grid; grid-template-columns:minmax(0, 1fr) 240px; gap:16px; align-items:start; }
.fp-layout > .fp { position:sticky; top:64px; max-height:calc(100vh - 80px); overflow-y:auto; }
@media (max-width:900px) {
  .be-has-fields .be-main { grid-template-columns:minmax(0, 1fr); }
  .be-has-fields .be-palette { position:static; max-height:none; overflow:visible; }
  .be-palette .fp-groups { max-height:50vh; overflow-y:auto; }
  .fp-layout { grid-template-columns:minmax(0, 1fr); }
  .fp-layout > .fp { position:static; order:-1; }
}
/* a phone: folded behind its Fields button until opened */
@media (max-width:640px) { .fp.is-folded { padding:0; border:0; background:none; } .fp.is-folded .fp-toggle { width:auto; } }
/* SPEC §5.5 (TLV): the Timeline's views, and the swimlane view */
.tl-title { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.tl-focus { outline:2px solid var(--accent); outline-offset:2px; border-radius:6px; background:var(--subtle); }
.swim { position:relative; }
.swim-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:4px 0 10px; }
.swim-chips { display:flex; flex-wrap:wrap; gap:4px; }
.chip-toggle { font:inherit; font-size:13px; padding:3px 10px; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--muted); cursor:pointer; }
.chip-toggle[aria-pressed="true"] { color:var(--fg); border-color:var(--fg); background:var(--subtle); }
.chip-toggle span { color:var(--lc, var(--muted)); }
.swim-zoom { display:inline-flex; align-items:center; gap:4px; }
.swim-zoom select { font:inherit; font-size:13px; padding:3px 6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.swim-cal { font-size:14px; display:inline-flex; align-items:center; gap:4px; }
.swim-focus-chip { display:inline-flex; align-items:center; gap:8px; padding:2px 4px 2px 10px; border:1px solid var(--lane-journeys); border-radius:999px; font-size:13px; }
.swim-body { display:grid; grid-template-columns:158px minmax(0, 1fr); border:1px solid var(--line); border-radius:8px; overflow:hidden; background:var(--card); }
.swim-side { border-right:1px solid var(--line); background:var(--card); }
.swim-side-axis { border-bottom:1px solid var(--line); box-sizing:border-box; }
.swim-side-lane { display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; align-content:center; justify-content:flex-start; gap:2px 6px; padding:0 10px; border-bottom:1px solid var(--line); box-sizing:border-box; overflow:hidden; }
.swim-side-lane:has(+ .swim-side-foot) { border-bottom:0; }
.swim-side-icon { color:var(--lc); font-size:14px; line-height:1; flex:0 0 16px; text-align:center; }
.swim-side-name { font-weight:600; font-size:14px; }
.swim-side-lane small { font-size:12px; line-height:1.2; }
.swim-side-lane small:not(.swim-none) { flex-basis:100%; padding-left:22px; }   /* "shown for this journey" goes under the name */
.swim-scroll { overflow-x:auto; overflow-y:hidden; }
.swim-svg { display:block; font-family:inherit; }
.swim-note { margin:6px 0 0; }
.lane-notes { --lc:var(--lane-notes); } .lane-calls { --lc:var(--lane-calls); } .lane-meetings { --lc:var(--lane-meetings); } .lane-tasks { --lc:var(--lane-tasks); }
.lane-stages { --lc:var(--lane-stages); } .lane-emails { --lc:var(--lane-emails); } .lane-surveys { --lc:var(--lane-surveys); } .lane-changes { --lc:var(--lane-changes); } .lane-journeys { --lc:var(--lane-journeys); }
/* the canvas */
.swim-band { fill:transparent; stroke:var(--line); stroke-width:.6; }
.swim-base { stroke:var(--line); stroke-width:1; }
.swim-wkend { fill:var(--subtle); }
.swim-hol { fill:var(--swim-holiday); }
.swim-day { stroke:var(--line); stroke-width:.5; opacity:.55; }
.swim-day.swim-week { opacity:1; }
.swim-axis-bg { fill:var(--card); }
.swim-tick { stroke:var(--line); }
.swim-month { fill:var(--fg); font-size:12px; font-weight:600; }
.swim-dayno { fill:var(--muted); font-size:11px; }
.swim-dayno.is-hol { fill:var(--warn); font-weight:600; }
.swim-today { stroke:var(--accent); stroke-width:1.5; }
.swim-today-label { fill:var(--accent); font-size:11px; font-weight:600; }
/* items */
.swim-item, .swim-step { cursor:pointer; }
.swim-item:focus, .swim-step:focus { outline:none; }   /* an SVG group's box would be a stray rectangle: the keyboard ring is drawn on the item's own shapes (below), in --focus, 3:1 on page and card (rule 63) */
.swim-bubble { fill:var(--card); stroke:var(--lc); stroke-width:2; }
.swim-bubble.is-end { fill:var(--card); }
.swim-bubble.is-hollow { stroke-dasharray:3 3; }
.swim-bubble.is-crossed { stroke:var(--muted); }
.swim-icon { fill:var(--lc); font-size:12px; font-weight:700; pointer-events:none; }
.swim-wedge { fill:var(--lc); }
.swim-wedge.is-due { fill:var(--bad); }
.swim-span { stroke:var(--lc); stroke-width:3; stroke-linecap:round; }
.swim-span.is-expected { stroke-dasharray:5 4; stroke-width:2; }
.swim-span.is-overdue { stroke:var(--bad); stroke-width:4; }
.swim-arrow { fill:var(--lc); }
.swim-days-bg { fill:var(--card); stroke:var(--lc); stroke-width:1; }
.swim-days-bg.is-overdue { stroke:var(--bad); }
.swim-days { fill:var(--fg); font-size:11px; pointer-events:none; }
.swim-label { fill:var(--fg); font-size:12px; pointer-events:none; }
.swim-mark { fill:var(--bad); }
.swim-item:hover .swim-bubble, .swim-item:focus-visible .swim-bubble { stroke-width:3; }
.swim-item:focus-visible .swim-bubble, .swim-step:focus-visible .swim-step-dot, .swim-item:focus-visible .swim-mark { stroke:var(--focus); stroke-width:3; }
.swim-item:focus-visible .swim-span { stroke:var(--focus); }
.swim-item.dim { opacity:.2; }
.swim-item.is-focused .swim-span { stroke-width:5; }
.swim-cluster-pill { fill:var(--subtle); stroke:var(--line); }
.swim-cluster-text { fill:var(--fg); font-size:12px; font-weight:700; pointer-events:none; }
/* journey focus (TLV-10) */
.swim-link { fill:none; stroke:var(--lane-journeys); stroke-width:1.5; }
.swim-link.is-planned { stroke-dasharray:4 3; }
.swim-step-dot { fill:var(--lane-journeys); stroke:var(--card); stroke-width:2; }
.swim-step.is-planned .swim-step-dot { fill:var(--card); stroke:var(--lane-journeys); stroke-dasharray:2 2; }
.swim-x { stroke:var(--card); stroke-width:2; }
/* the hover card (TLV-07) */
.swim-tip { position:fixed; z-index:60; max-width:300px; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--fg); box-shadow:0 4px 14px rgb(0 0 0 / .18); font-size:13px; pointer-events:none; }
.swim-tip dl { display:grid; grid-template-columns:auto 1fr; gap:2px 10px; margin:6px 0; }
.swim-tip dt { color:var(--muted); } .swim-tip dd { margin:0; overflow-wrap:anywhere; }
@media (max-width: 640px) {
  .swim-body { grid-template-columns:40px minmax(0, 1fr); }
  .swim-side-name, .swim-side-lane small { display:none; }
  .swim-side-lane { align-items:center; justify-content:center; padding:0; }
}
.swim-side-lane:has(.swim-none) .swim-side-name { font-weight:400; color:var(--muted); }
/* Stephen, 2026-10-05: a contact's Timeline uses all the width the record part has (the swimlane wants it) */
.rec-part:has(> section.timeline-full) { max-width:none; }
/* q1 (TODO 6.13-6.15): survey data. A shared question in the builder carries an accent edge; the trend line is SVG
   colored by the theme tokens (no style attributes: strict CSP). */
.sv-shared .sv-qedit { border-left:3px solid var(--accent); padding-left:10px; }
.sv-lib .chip { padding:0 8px; font-size:12px; margin-left:4px; }
.runs-survey + .runs-survey { margin-top:16px; } .runs-survey h3 { margin:12px 0 4px; }
.runs-table th, .runs-table td { min-width:7em; } .runs-table td { max-width:24em; overflow-wrap:break-word; }
.mh { margin:12px 0; } .mh h4 { margin:0 0 4px; } .mh-list { margin:4px 0; padding-left:20px; } .mh-list li { margin:2px 0; }
.trend-line { display:block; max-width:100%; height:auto; margin:4px 0; }
.trend-path { fill:none; stroke:var(--accent); stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.trend-dot { fill:var(--accent); stroke:var(--card); stroke-width:1; }
.trend-axis { stroke:var(--line); stroke-width:1; }
.cd-trend { margin:8px 0 0; }
/* 6.16 (SRV-21): a survey metric's definition, and its computed value on a record (shown, not editable) */
.metric-form { border:1px solid var(--line); border-radius:6px; padding:8px 12px; margin:0 0 12px; display:grid; gap:8px; } .metric-form legend { font-weight:600; padding:0 4px; }
.metric-form .metric-words { margin:0; }
.field .computed { display:block; padding:8px; border:1px dashed var(--line); border-radius:6px; min-height:1.2em; }
/* SRV-24..26 (2026-10-05): send a survey from a contact in one panel */
.ssp-list { list-style:none; margin:0 0 12px; padding:0; display:grid; gap:8px; }
.ssp-row { display:grid; gap:6px; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:var(--card); }
.ssp-main { display:flex; flex-direction:column; gap:2px; }
.ssp-actions { display:flex; flex-wrap:wrap; gap:6px; }
.ssp-later-form { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.ssp-notice:empty { display:none; }
.ssp-warn { margin:0; padding:8px 12px; border:2px solid var(--warn); border-radius:6px; background:var(--card); color:var(--fg); }   /* Stephen, 2026-10-06: the repeat-send warning */
.ssp-warn p { margin:0 0 4px; } .ssp-warn p:last-child { margin-bottom:0; }
.ssp-later-form input { font:inherit; padding:6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.ssp-sched li, .ssp-sched-part li { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:6px; }
.ssp-sched h3 { font-size:15px; margin:0 0 6px; }
.sv-scheduled { color:var(--accent); font-weight:600; }
dialog.ssp-preview { width:min(760px, calc(100vw - 32px)); max-height:calc(100vh - 48px); border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--fg); padding:16px 20px; }
dialog.ssp-preview::backdrop { background:rgb(0 0 0 / .4); }
.ssp-pv-body { max-height:60vh; overflow:auto; border:1px solid var(--line); border-radius:6px; padding:12px; background:var(--bg); }
.ssp-later-form { display:flex !important; flex-wrap:wrap; align-items:center; gap:6px; }
.ssp-later-form label { flex-basis:100%; font-weight:600; font-size:14px; }
.ssp-later-form .btn { width:auto; flex:0 0 auto; }
.ssp-later-form input { flex:1 1 200px; width:auto; }
.ssp-later-form .err { flex-basis:100%; }
.title-label { color:var(--muted); font-weight:400; }

/* ---- editor v2 (TODO 5.24-5.36; docs/editor-v2.md) */
.be-row1 { border-bottom:0; padding-bottom:2px; }
.be-row2 { position:sticky; top:40px; z-index:3; padding-top:2px; }
.be-bar .seg { display:inline-flex; align-items:center; gap:2px; padding-right:8px; border-right:1px solid var(--line); }
.be-bar .seg:last-of-type { border-right:0; }
.be-grow { flex:1 1 auto; }
.be-ib { display:inline-flex; align-items:center; gap:4px; min-width:32px; height:32px; padding:0 6px; box-sizing:border-box; justify-content:center; font:inherit; font-size:14px;
  border:1px solid transparent; border-radius:6px; background:none; color:var(--fg); cursor:pointer; }
.be-ib:hover:not(:disabled) { border-color:var(--line); background:var(--subtle); }
.be-ib[aria-pressed="true"], .be-ib[aria-expanded="true"] { background:var(--accent); color:var(--accent-fg); border-color:var(--accent); }
.be-ib:disabled { opacity:.45; cursor:default; }
.be-ib:focus-visible, .be-switch:focus-visible, .be-swatch:focus-within { outline:2px solid var(--focus); outline-offset:1px; }
.be-pal { cursor:grab; }
.be-ico { display:block; flex:none; }
.be-ibl { font-size:13px; white-space:nowrap; }
.be-g { font:600 16px/1 Georgia, serif; } .be-mark { font:600 13px/1 system-ui, sans-serif; }
.be-bar select { font:inherit; font-size:13px; height:32px; padding:0 4px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); max-width:130px; }
.be-swatch { position:relative; display:inline-flex; flex-direction:column; align-items:center; justify-content:center; width:32px; height:32px; border-radius:6px; cursor:pointer; }
.be-swatch:hover { background:var(--subtle); }
.be-swatch input[type=color] { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; border:0; padding:0; }
.be-chip { display:block; width:18px; height:4px; margin-top:2px; border-radius:1px; border:1px solid var(--line); }
.be-chip.is-none { background:repeating-linear-gradient(45deg, var(--card) 0 3px, var(--line) 3px 4px) !important; }
.be-popwrap { position:relative; display:inline-flex; }
.be-mini { position:absolute; top:36px; left:0; z-index:15; display:grid; gap:6px; padding:8px; min-width:180px; background:var(--card); border:1px solid var(--line); border-radius:8px; box-shadow:0 4px 16px rgb(0 0 0 / .2); }
.be-mini label { display:flex; justify-content:space-between; gap:8px; align-items:center; font-size:13px; }
/* EDT-13: the Preview switch, its knob sliding with a small overshoot (the bounce) */
.be-switch { display:inline-flex; align-items:center; gap:6px; font:inherit; background:none; border:0; padding:0 4px; color:var(--fg); cursor:pointer; }
.be-switch-track { position:relative; display:inline-block; width:58px; height:28px; border-radius:999px; background:#b42318; transition:background-color .3s ease; }
.be-switch[aria-checked="true"] .be-switch-track { background:#1b7f3a; }
.be-switch-knob { position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:50%; background:#f4f4f4; box-shadow:0 1px 3px rgb(0 0 0 / .35);
  transition:transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.be-switch[aria-checked="true"] .be-switch-knob { transform:translateX(30px); }
.be-switch-on, .be-switch-off { position:absolute; top:0; font:700 10px/28px system-ui, sans-serif; color:#ffffff; letter-spacing:.04em; }
.be-switch-on { left:8px; opacity:0; } .be-switch-off { right:6px; }
.be-switch[aria-checked="true"] .be-switch-on { opacity:1; } .be-switch[aria-checked="true"] .be-switch-off { opacity:0; }
.be-switch:disabled { opacity:.5; }
@media (prefers-reduced-motion: reduce) { .be-switch-knob, .be-switch-track { transition:none; } }
/* row 2: the social tray (EDT-29) and the Fields tree (EDT-11) */
.be-tray { position:absolute; top:36px; left:0; z-index:15; display:grid; grid-template-columns:repeat(3, auto); gap:4px; padding:6px; min-width:max-content;
  background:var(--card); border:1px solid var(--line); border-radius:8px; box-shadow:0 4px 16px rgb(0 0 0 / .2); animation:be-tray .2s ease-out; }
.be-tray small { grid-column:1 / -1; max-width:240px; white-space:normal; }
@keyframes be-tray { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { .be-tray { animation:none; } }
.be-trayi { padding:2px; border:1px solid transparent; border-radius:6px; background:none; cursor:grab; }
.be-trayi:hover, .be-trayi:focus-visible { border-color:var(--accent); }
.be-badge { display:inline-block; margin:0 4px; text-align:center; vertical-align:middle; font-family:Arial, Helvetica, sans-serif; font-weight:bold; overflow:hidden; }
.be-badge img { display:block; }
.be-fields { margin-left:0; }   /* Stephen, 2026-10-06: right after Saved blocks, not pushed right */
.be-menu { position:absolute; left:0; top:36px; z-index:16; min-width:200px; padding:4px; background:var(--card); border:1px solid var(--line); border-radius:8px; box-shadow:0 4px 16px rgb(0 0 0 / .2); }
.be-menu ul { list-style:none; margin:0; padding:0; }
.be-mi { display:flex; justify-content:space-between; gap:12px; width:100%; text-align:left; font:inherit; font-size:14px; padding:6px 10px; border:0; border-radius:4px; background:none; color:var(--fg); cursor:pointer; white-space:nowrap; }
.be-mi:hover, .be-mi:focus-visible, .be-has-sub.is-open > .be-mi { background:var(--subtle); outline:none; }
.be-mi[data-token] { cursor:grab; }
.be-has-sub { position:relative; }
.be-sub { display:none; position:absolute; right:100%; top:-4px; min-width:200px; max-height:60vh; overflow-y:auto; padding:4px !important; background:var(--card); border:1px solid var(--line); border-radius:8px; box-shadow:0 4px 16px rgb(0 0 0 / .2); }
.be-has-sub.is-open > .be-sub { display:block; }
/* the right panel (EDT-23) */
.be-side { position:sticky; top:96px; max-height:calc(100vh - 110px); overflow-y:auto; padding:0 0 0 12px; border-left:1px solid var(--line); }
.be-side-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.be-side-head h3 { font-size:15px; margin:0; }
.be-side .field { margin-bottom:8px; } .be-side input[type=color] { width:48px; height:28px; padding:0; }
.be-side select, .be-side input[type=number], .be-side input[type=text], .be-side input[type=search], .be-side input:not([type]) { font:inherit; padding:6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); max-width:100%; box-sizing:border-box; }
.be-side input[type=text], .be-side input[type=search], .be-side input:not([type]) { width:100%; }
/* Every search box takes the Search boxes color (Stephen, 2026-10-08; SPEC ADM-09), its placeholder the secondary text */
.be-side input[type=search] { background:var(--search); }
input[type=search]::placeholder { color:var(--muted); opacity:1; }
.be-what { font-weight:600; margin:8px 0 4px; }
.be-row { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.be-fs { border:1px solid var(--line); border-radius:6px; padding:6px 8px; margin:0 0 8px; } .be-fs legend { font-size:13px; padding:0 4px; }
.be-boxp { margin:8px 0; } .be-boxp summary { cursor:pointer; font-weight:600; font-size:14px; margin-bottom:6px; }
.be-side.is-drop, .be-side-body.is-drop { outline:2px dashed var(--accent); outline-offset:-4px; }
.be-thumbs { display:grid; grid-template-columns:repeat(auto-fill, minmax(84px, 1fr)); gap:6px; margin-top:6px; }
.be-thumb { display:flex; flex-direction:column; gap:2px; padding:4px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--fg); cursor:grab; font:inherit; font-size:11px; min-width:0; }
.be-thumb:hover, .be-thumb:focus-visible { border-color:var(--accent); }
.be-thumb img { width:100%; height:64px; object-fit:contain; background:repeating-conic-gradient(var(--subtle) 0 25%, var(--card) 0 50%) 0 0 / 12px 12px; }
.be-thumb span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.be-upload { position:relative; cursor:pointer; }
.be-saved { list-style:none; margin:6px 0 12px; padding:0; display:grid; gap:4px; } .be-saved li { display:flex; gap:4px; }
.be-savedi { flex:1 1 auto; text-align:left; font:inherit; font-size:14px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--fg); cursor:grab; }
.be-savedi:hover { border-color:var(--accent); }
.be-saveas h4 { margin:8px 0 4px; font-size:14px; }
.be-crop { position:relative; display:inline-block; max-width:100%; cursor:crosshair; touch-action:none; user-select:none; }
.be-crop img { display:block; max-width:100%; }
.be-crop-box { position:absolute; border:2px dashed #ffffff; box-shadow:0 0 0 9999px rgb(0 0 0 / .45); pointer-events:none; }
/* the canvas: handles, tables, the preview */
.be-handle { position:absolute; z-index:4; display:none; background:var(--accent); border:2px solid var(--card); border-radius:3px; touch-action:none; }
.be-block.is-selected > .be-handle { display:block; }
.be-handle-e { top:50%; right:-6px; width:8px; height:28px; margin-top:-14px; cursor:ew-resize; }
.be-handle-s { left:50%; bottom:-6px; width:28px; height:8px; margin-left:-14px; cursor:ns-resize; }
.be-sizetip { position:absolute; right:4px; bottom:4px; z-index:5; padding:1px 6px; font:12px/1.4 system-ui, sans-serif; background:var(--fg); color:var(--bg); border-radius:4px; pointer-events:none; }
.be.is-resizing { user-select:none; }
.be-block[draggable="true"] { cursor:grab; } .be-block[draggable="true"] .be-text, .be-button[contenteditable] { cursor:text; }
.be-drop-on { outline:2px dashed var(--accent) !important; outline-offset:2px; }
.be-table { width:100%; border-collapse:collapse; margin:4px 0; }
.be-table td { vertical-align:top; text-align:left; border-bottom:0; }
.be-button[contenteditable="true"] { outline:none; min-width:2em; }
.be-button[contenteditable="true"]:focus { box-shadow:0 0 0 2px var(--focus); }
.be-preview { padding:12px; } .be-preview iframe { display:block; width:100%; border:0; background:#ffffff; }
.be-pv-subject { margin:0 0 8px; }
.badge-draft { border-color:var(--warn); color:var(--warn); }
.be-code textarea { white-space:pre; overflow:auto; font:13px/1.5 ui-monospace, Menlo, Consolas, monospace; tab-size:2; }
.sl-preview { display:flex; flex-wrap:wrap; gap:4px; align-items:center; min-height:40px; padding:8px; border:1px dashed var(--line); border-radius:6px; background:#ffffff; color:#222222; }
.be-table .be-text { min-height:1.5em; }
.be-fields > .btn { display:inline-flex; align-items:center; gap:4px; }
.be-bar .seg { padding-right:6px; }
/* drag a block off the email to delete it (Stephen, 2026-10-06) */
.be-stage { position:relative; }
.be-trash { display:none; position:absolute; top:8px; left:50%; transform:translateX(-50%); z-index:6; padding:4px 12px; border-radius:999px; background:var(--bad); color:var(--card); font:600 13px/1.4 system-ui, sans-serif; pointer-events:none; }
.be.is-trashing .be-trash { display:block; }
.be.is-trashing .be-block.is-dragging, .be.is-trashing .be-section.is-dragging { opacity:.35; outline:2px dashed var(--bad); }
.be.is-trashing .be-stage { outline:2px dashed var(--bad); outline-offset:-2px; }
.ob-actions { white-space:nowrap; }
.tl-chips { margin:4px 0 12px; }

/* Journeys v2, track U3: the run view (JRN-44 to JRN-48), the enroll notice (JRN-54), Settings → Journeys (JRN-25),
   the step-by-step forms (JRN-50). Tokens only (rule 66); --tl-done and --tl-planned are contrast-checked in both themes. */
.rv-meta { display:flex; flex-wrap:wrap; gap:4px 8px; align-items:center; margin:0 0 8px; }
.rv-status-active { border-color:var(--ok); } .rv-status-paused, .rv-status-queued { border-color:var(--warn); } .rv-status-completed, .rv-status-exited { color:var(--muted); }
.rv-estimate { font-weight:600; margin:4px 0 8px; } .rv-tz { margin:-8px 0 16px; }
.rv-body { position:relative; display:grid; grid-template-columns:minmax(150px, 13rem) minmax(0, 1fr); gap:0 48px; align-items:start; margin:8px 0 16px; }
.rv-tl { position:relative; list-style:none; margin:0; padding:0; z-index:1; }
.rv-tl::after { content:""; position:absolute; top:0; bottom:0; right:0; border-right:2px solid var(--line); z-index:-1; }   /* the axis */
.rv-body.is-narrow .rv-tl::after { display:none; }
.rv-tl-row { position:absolute; left:0; right:0; display:grid; padding:2px 8px 2px 4px; border-right:3px dashed var(--tl-planned); background:var(--bg); font-size:14px; line-height:1.3; }
.rv-tl-row.is-done { border-right:3px dotted var(--tl-done); }
.rv-tl-row.is-undated .rv-tl-date { color:var(--muted); font-weight:400; }
.rv-tl-date { font-weight:600; }
.rv-lines { position:absolute; left:0; top:0; pointer-events:none; overflow:visible; z-index:0; }
.tl-line { fill:none; stroke-width:1.5; }
.tl-line.is-done { stroke:var(--tl-done); stroke-width:2; stroke-dasharray:1 5; stroke-linecap:round; }
.tl-line.is-planned { stroke:var(--tl-planned); stroke-dasharray:6 4; }
.tl-dot.is-done { fill:var(--tl-done); } .tl-dot.is-planned { fill:var(--bg); stroke:var(--tl-planned); stroke-width:1.5; }
.rv-body.is-narrow { grid-template-columns:minmax(0, 1fr); }
.rv-body.is-narrow .rv-tl { display:grid; gap:4px; margin-bottom:12px; }
.rv-body.is-narrow .rv-tl-row { position:static; }
.rv-flow { position:relative; z-index:1; }
.rv-step { flex-direction:column; align-items:stretch; }
.rv-box { display:flex; gap:8px; align-items:flex-start; background:var(--card); border:1px solid var(--line); border-left:4px solid var(--line); border-radius:8px; padding:8px 10px; }
.rv-main { flex:1; min-width:0; display:grid; gap:2px; }
.rv-words, .rv-branch { font-size:13px; color:var(--muted); overflow-wrap:anywhere; } .rv-branch { color:var(--fg); }
.rv-mark { flex:0 0 auto; width:1.4em; height:1.4em; display:inline-grid; place-items:center; font-weight:700; font-size:18px; line-height:1; }
.rv-mark.mark-done { color:var(--ok); } .rv-mark.mark-error { color:var(--bad); } .rv-mark.mark-spin { color:var(--accent); }
.rv-mark.mark-skipped, .rv-mark.mark-untaken, .rv-mark.mark-planned, .rv-mark.mark-after { color:var(--muted); }
.rv-mark.mark-spin .rv-sym { display:inline-block; animation:rv-spin 1.2s linear infinite; }
@keyframes rv-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rv-mark.mark-spin .rv-sym { animation:none; } }
.rv-step.mark-done .rv-box { border-left-color:var(--ok); } .rv-step.mark-error .rv-box { border-color:var(--bad); border-left-color:var(--bad); }
.rv-step.mark-spin .rv-box { border-left-color:var(--accent); } .rv-step.mark-planned .rv-box, .rv-step.mark-after .rv-box { border-style:dashed; border-left-style:solid; }
.rv-step.is-current .rv-box { outline:2px solid var(--accent); outline-offset:1px; }
.rv-step.is-untaken .rv-box { background:var(--subtle); border-style:dashed; } .rv-step.is-untaken .rv-box strong, .rv-step.is-untaken .rv-box .fl-kind { color:var(--muted); }
.fl-branch.is-taken > .fl-conn .fl-branch-label strong { color:var(--ok); }
.fl-branch.is-untaken > .fl-conn .fl-branch-label { color:var(--muted); } .fl-branch.is-untaken > .fl-conn .fl-branch-label strong { text-decoration:line-through; }
.rv-stop { font-size:13px; font-weight:600; color:var(--warn); margin:4px 0; text-align:center; }
.rv-eye { display:inline-grid; place-items:center; padding:2px 6px; flex:0 0 auto; }
.rv-acts { display:flex; flex-wrap:wrap; gap:4px; margin:4px 0 0; }
.rv-params code { font-size:13px; }
dialog.dlg { width:min(760px, calc(100vw - 32px)); max-height:calc(100vh - 48px); border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--fg); padding:0; }
dialog.dlg::backdrop { background:rgb(0 0 0 / .4); }
.dlg-head { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:12px 16px; border-bottom:1px solid var(--line); }
.dlg-head h2 { margin:0; font-size:18px; } .dlg-body { padding:12px 16px; overflow:auto; }
.eye-frame { width:100%; border:1px solid var(--line); border-radius:6px; }
.eye-dl { display:grid; grid-template-columns:max-content minmax(0, 1fr); gap:4px 12px; margin:0 0 12px; } .eye-dl dt { color:var(--muted); font-weight:600; } .eye-dl dd { margin:0; overflow-wrap:anywhere; }
.eye-text { white-space:pre-wrap; }
.dlg-form textarea, .nf textarea { width:100%; box-sizing:border-box; font:inherit; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.dlg-form input[type=datetime-local], .nf input[type=date], .nf input[type=number], .jp-when input, #en-start { font:inherit; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
fieldset.nf-q { border:1px solid var(--line); border-radius:6px; padding:8px 12px; margin:0 0 8px; } fieldset.nf-q legend { font-weight:600; padding:0 4px; }
.nf-opts { display:flex; flex-wrap:wrap; gap:4px 16px; } .nf-lead { margin-top:0; } .nf-actions { display:flex; gap:8px; } .nf-save { margin:4px 0 8px; }
.enroll-notice { margin:4px 0; } .enroll-notice.notice-at, .enroll-notice.notice-after { color:var(--warn); } .enroll-ahead { margin:0 0 4px; padding-left:20px; }
.jp-enroll .frow { flex-wrap:wrap; } .jp-enroll .jp-when { flex:0 1 170px; }
.enr h3 .enr-open { margin-left:8px; font-size:13px; } .enr-when { color:var(--warn); margin:2px 0; }
.js-warn { margin:4px 0 0; padding:8px 12px; border-left:4px solid var(--line); font-size:14px; } .js-warn.is-on { border-left-color:var(--warn); background:var(--subtle); }
.tabs-sub { margin-top:0; font-size:14px; } .jl-moved { margin:0 0 4px; }
.stat.is-warn strong { color:var(--warn); }
.t-label { display:block; font-weight:600; font-size:14px; } .t-rec { margin:0; } .t-mode label.check { display:block; margin:0 0 6px; } .t-mode small { display:block; margin-left:24px; }
#js-form ~ #win .days label, #win .days label { display:inline-flex; align-items:center; gap:4px; font-weight:400; margin-right:12px; }
.import-journey label.check { font-weight:600; }
/* ---- Settings → Color palettes (ADM-09). A scene draws in the palette's own colors: its custom properties are set
   on it through the CSSOM, and everything inside uses the usual tokens. ---- */
.pal-list { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:12px; }
.pal-item { border:1px solid var(--line); border-radius:8px; padding:8px; display:flex; flex-direction:column; gap:8px; }
.pal-item.is-active { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
.pal-inuse { border-color:var(--ok); color:var(--ok); }
.pal-bad-note { color:var(--bad); }
.pal-sideinv { display:flex; align-items:flex-start; gap:8px; margin:0 0 12px; font-size:14px; } .pal-sideinv input { margin-top:3px; }
.pal-actions { display:flex; flex-wrap:wrap; gap:6px; }
.pal-scene { background:var(--bg); color:var(--fg); border:1px solid var(--line); border-radius:6px; padding:10px; font-size:14px; }
.pal-scene .pal-card { background:var(--card); border:1px solid var(--line); border-radius:6px; padding:8px 10px; }
.pal-scene .pal-line { margin:6px 0 0; display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.pal-scene a { color:var(--accent); }
.pal-scene .btn { background:var(--card); color:var(--fg); border-color:var(--line); }
.pal-scene .btn.primary { background:var(--accent); color:var(--accent-fg); border-color:var(--accent); }
.pal-muted { color:var(--muted); }
.pal-ok { color:var(--ok); } .pal-warn { color:var(--warn); }
.pal-bad { color:var(--bad); background:var(--bad-bg); padding:0 6px; border-radius:4px; }
.pal-subtle { background:var(--subtle); padding:4px 6px; border-radius:4px; }
.pal-focus { outline:2px solid var(--focus); outline-offset:2px; border-radius:3px; padding:0 4px; }
.pal-lanes .chip-toggle { cursor:default; padding:1px 7px; }
.pal-scene.is-big { font-size:15px; }
.pal-edit-grid { display:grid; grid-template-columns:minmax(0, 1.2fr) minmax(0, 1fr); gap:16px; align-items:start; }
.pal-side { position:sticky; top:8px; }
/* Which palette colors the sidebar (Stephen, 2026-10-08): a note in the list and the editor, and a little sidebar in its colors */
.pal-sidenote { margin:-6px 0 12px; font-size:13px; color:var(--muted); } .pal-side .pal-sidenote { margin:6px 0 0; }
.pal-sidenote .btn { margin-left:4px; }
.pal-sideuse { color:var(--muted); }
.pal-sidebar { display:flex; flex-direction:column; gap:2px; width:200px; max-width:100%; padding:8px; box-sizing:border-box; background:var(--card); color:var(--fg);
  border:1px solid var(--line); border-radius:6px; font-size:14px; }
.pal-sb-item { position:relative; display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:10px; }
.pal-sb-label, .pal-sb-count { position:relative; z-index:1; } .pal-sb-label { flex:1; }
.pal-sb-pill { position:absolute; inset:0; z-index:0; border-radius:10px; background:var(--accent); }
.pal-sb-item.is-lit { color:var(--accent-fg); font-weight:650; }
.pal-sb-count { min-width:20px; padding:0 6px; border-radius:999px; font-size:12px; font-weight:700; line-height:20px; text-align:center; background:var(--bad); color:var(--card); }
.pal-side h3 { margin:12px 0 6px; font-size:16px; }
.pal-group { border:1px solid var(--line); border-radius:8px; margin:0 0 12px; padding:8px 12px; }
.pal-group legend { font-weight:600; padding:0 4px; }
/* The value box is as wide as its format needs (hex is 7 characters), and the CSS variable's name sits to its right */
.pal-row { display:grid; grid-template-columns:40px minmax(0, 1fr) minmax(0, 12em) auto; align-items:center; gap:4px 8px; padding:3px 0; }
.pal-tokens[data-fmt=hex] .pal-row { grid-template-columns:40px minmax(0, 1fr) 6em auto; }
/* Every row is its own grid, so the name gets one fixed width (the longest base.css name is 16 characters) and the
   columns line up down the whole editor */
.pal-row .pal-var { width:17ch; overflow:hidden; text-overflow:ellipsis; font-family:ui-monospace, monospace; font-size:13px; color:var(--muted); white-space:nowrap; user-select:all; }
.pal-row input[type=color] { width:36px; height:30px; padding:0; border:1px solid var(--line); border-radius:4px; background:var(--card); cursor:pointer; }
.pal-row .pal-value { font-family:ui-monospace, monospace; font-size:14px; }
.pal-row .err { grid-column:2 / -1; }
.pal-row .err:empty { display:none; }
.pal-contrast { list-style:none; margin:0; padding:0; max-height:360px; overflow:auto; font-size:13px; }
.pal-contrast li { display:flex; align-items:center; gap:6px; padding:2px 0; }
.pal-contrast li.is-bad { color:var(--bad); }
/* Fix errors (2026-10-08): what it changed, and a mark on each changed row until the next look */
.pal-fixed { margin:0 0 6px; font-size:13px; }
.pal-fixed:empty { display:none; }
.pal-row.is-fixed label::after { content:" · fixed"; color:var(--muted); font-size:12px; }
.pal-sw { display:inline-block; width:14px; height:14px; border:1px solid var(--line); border-radius:3px; flex:none; }
@media (max-width: 760px) {
  .pal-edit-grid { grid-template-columns:1fr; }
  .pal-side { position:static; }
  .pal-row, .pal-tokens[data-fmt=hex] .pal-row { grid-template-columns:40px minmax(0, 1fr); }
  .pal-row .pal-value, .pal-row .pal-var { grid-column:2; }
}
/* Journeys v2 (U3, against S2): the dashboard card's counts, the eyeball's hidden body, a refused start */
.jfm-counts { list-style:none; margin:0 0 8px; padding:0; display:grid; gap:2px; } .jfm-counts strong { margin-right:4px; }
.eye-hidden { color:var(--muted); font-style:italic; } pre.eye-text { white-space:pre-wrap; font:inherit; }
.enroll-notice.notice-refused { color:var(--bad); } .rv-trash { margin:0 0 8px; }

/* The builder's preview of a page built in the editor (TODO 5.20): the same rules as /assets/survey.css's .sv-design,
   and the phone frame stacks columns as a phone does. Its generated classes come with the preview (adopted sheet). */
.sv-design table { border-collapse:collapse; }
/* base.css gives every table cell a line and padding; an editor-built page has its own (the generated classes, which
   outrank this zero-specificity reset) */
:where(.sv-design) td, :where(.sv-design) th { border-bottom:0; padding:0; }
.sv-design .be-text p { margin:0 0 12px; }
.sv-design .be-text h1, .sv-design .be-text h2, .sv-design .be-text h3 { margin:0 0 12px; }
.sv-design .be-text ul, .sv-design .be-text ol { margin:0 0 12px; padding-left:24px; }
.sv-design .be-wrap { max-width:100% !important; }
.sv-frame.phone .sv-design .be-wrap { width:100% !important; }
.sv-frame.phone .sv-design .be-col { display:block !important; width:100% !important; box-sizing:border-box; }

/* ---- The journey step panel (Stephen, 2026-10-07): General, Entry, Action and Exit fold; Exit's branches are tabs. */
.sp-sec { border:1px solid var(--line); border-radius:8px; background:var(--card); }
.sp-sec > summary { cursor:pointer; padding:8px 12px; font-weight:600; list-style:none; display:flex; align-items:baseline; gap:8px; }
.sp-sec > summary::-webkit-details-marker { display:none; }
.sp-sec > summary::before { content:'▸'; color:var(--muted); width:1em; }
.sp-sec[open] > summary::before { content:'▾'; }
.sp-sec[open] > summary { border-bottom:1px solid var(--line); }
.sp-sec-sub { color:var(--muted); font-weight:400; }
.sp-sec-body { padding:8px 12px 12px; display:grid; gap:12px; }
.sp-typeword { color:var(--muted); }
.linkish { font:inherit; background:none; border:0; padding:0; color:var(--accent); text-decoration:underline; cursor:pointer; }
.sp-tablist { display:flex; flex-wrap:wrap; gap:4px; border-bottom:1px solid var(--line); }
.sp-tab { font:inherit; font-size:14px; padding:6px 10px; border:1px solid var(--line); border-bottom:0; border-radius:6px 6px 0 0; background:var(--subtle); color:var(--fg); cursor:pointer; margin-bottom:-1px; }
.sp-tab[aria-selected="true"] { background:var(--card); border-color:var(--accent); border-bottom:1px solid var(--card); font-weight:600; }
.sp-tab-n { color:var(--muted); font-size:12px; }
.sp-tab.is-timeout .sp-tab-n { color:var(--warn); }
.sp-tab-plus { font-weight:700; min-width:2.2em; }
.sp-tab-plus:disabled { cursor:not-allowed; opacity:.6; }
.sp-tabpanel { padding-top:8px; }
.sp-tabpanel > fieldset.branch { margin:0; }
.sp-next { margin:8px 0 0; }
.sp-plus-menu { display:grid; gap:4px 8px; grid-template-columns:auto 1fr; align-items:center; padding:8px; border:1px solid var(--line); border-radius:6px; margin-top:8px; }
.sp-plus-menu > p { grid-column:1 / -1; margin:0; }
.sp-plus-help { color:var(--muted); }

/* ---- Stage maps (SPEC §18; STG-20, STG-34): the strip, the map screen, the stage's configuration. Tokens only
   (rule 66): --stage-* are defined in base.css in light and both dark blocks and contrast-checked (tools/contrast.php).
   A status is a mark and a word in the box as well as its fill and border, never color alone. */
.stage-strip { position:relative; min-height:20px; }
.stage-svg { display:block; overflow:visible; font-family:inherit; max-width:100%; }
.stage-box { cursor:pointer; }
.stage-box:focus { outline:none; } .stage-box:focus-visible, .stage-arrow-g:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }   /* keyboard.mjs: a visible ring on the focused element itself */
.stage-rect { fill:var(--card); stroke:var(--stage-ahead); stroke-width:1.5; stroke-dasharray:5 4; }
.stage-box.is-plain .stage-rect { stroke-dasharray:none; }
.stage-box.is-completed .stage-rect { fill:var(--stage-done-bg); stroke:var(--ok); stroke-dasharray:none; }
.stage-box.is-curtailed .stage-rect { fill:var(--stage-cut-bg); stroke:var(--muted); stroke-dasharray:2 3; }
.stage-box.is-started .stage-rect { fill:var(--stage-now-bg); stroke:var(--accent); stroke-dasharray:none; }
.stage-box.is-current .stage-rect { stroke-width:3; }
.stage-box.is-stalled .stage-rect { fill:var(--stage-stall-bg); stroke:var(--warn); stroke-width:3; stroke-dasharray:none; }
.stage-box.is-selected .stage-rect { stroke:var(--accent); stroke-width:3; stroke-dasharray:none; }
.stage-box.is-archived .stage-rect { stroke-dasharray:2 3; }
.stage-box:hover .stage-rect { stroke-width:3; }
.stage-box:focus-visible .stage-rect { stroke:var(--focus); stroke-width:3.5; }
.stage-box.is-dragging { opacity:.75; cursor:grabbing; }
.stage-name { fill:var(--fg); font-size:13px; font-weight:600; pointer-events:none; }
.stage-sub { fill:var(--muted); font-size:12px; pointer-events:none; }
.stage-box.is-stalled .stage-sub { fill:var(--fg); }
.stage-arrow { fill:none; stroke:var(--stage-arrow); stroke-width:1.5; }
.stage-arrow-g.is-ahead .stage-arrow { stroke-dasharray:4 3; }
.stage-arrow-head { fill:var(--stage-arrow); }
.stage-arrow-hit { fill:none; stroke:var(--card); stroke-opacity:0; stroke-width:14; }
.stage-arrow-g[tabindex] { cursor:pointer; }

.stage-arrow-g:focus-visible .stage-arrow, .stage-arrow-g:hover .stage-arrow { stroke:var(--focus); stroke-width:3; }
.stage-drop { stroke:var(--accent); stroke-width:3; stroke-linecap:round; }
.stage-tip { position:fixed; z-index:60; max-width:320px; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--fg); box-shadow:0 4px 14px rgb(0 0 0 / .18); font-size:13px; pointer-events:none; }
.stage-tip dl { display:grid; grid-template-columns:auto 1fr; gap:2px 10px; margin:6px 0; }
.stage-tip dt { color:var(--muted); } .stage-tip dd { margin:0; overflow-wrap:anywhere; } .stage-tip p { margin:4px 0 0; }
/* the contact's Dashboard: the strip card on top */
.cd-stage { margin-bottom:12px; }
.cd-stage .head h2 small { font-weight:400; }
.stage-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:8px; }
.stage-form { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:flex-end; margin-top:10px; padding:10px; border:1px solid var(--line); border-radius:8px; background:var(--subtle); }
.stage-form .field { margin:0; min-width:200px; flex:1 1 200px; }
.stage-form .state { flex-basis:100%; margin:0; }
/* the map screen */
.sm-meta { display:grid; grid-template-columns:minmax(0, 1fr); gap:8px; }
.sm-status { margin:0; }
.sm-strip-card .head { flex-wrap:wrap; }
.sm-add { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end; margin-top:10px; }
.sm-add .field { margin:0; min-width:220px; }
.sm-problems { margin:8px 0 0; padding-left:20px; }
.sm-cfg { margin-top:12px; }
.sm-cfg h3 { margin:16px 0 6px; font-size:16px; }
.sm-items { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.sm-item { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:flex-end; padding:8px; border:1px solid var(--line); border-radius:8px; background:var(--card); }
.sm-item .field { margin:0; flex:1 1 160px; min-width:140px; }
.sm-item .field.narrow { flex:0 1 110px; min-width:90px; }
.sm-item .field.wide { flex-basis:100%; }
.sm-item .sm-kind { font-weight:600; flex-basis:100%; }
.sm-item label.check { display:flex; gap:6px; align-items:center; }
.sm-used { margin:4px 0 8px; }
.sm-ro .sm-item { background:var(--subtle); }
/* future (inactive) tasks: hollow and dimmed, with "Not yet: <stage>" in words (STG-21, TLV-20) */
.tl.is-inactive { opacity:.72; border-style:dashed; }
.tl .not-yet { font-weight:600; }
.swim-item.is-inactive { opacity:.55; }
.swim-item.is-inactive .swim-bubble { stroke-dasharray:3 3; fill:var(--card); }
.swim-item.is-inactive .swim-span { stroke-dasharray:5 4; stroke-width:2; }
.show-pref small { font-size:12px; }
@media (max-width: 640px) {
  .stage-form .field, .sm-add .field { min-width:0; flex-basis:100%; }
}
/* STG-38: a part with Show closed items off hides its finished rows (they mark themselves data-closed) */
.hide-closed [data-closed] { display:none; }
.part-show { margin:4px 0 8px; }
.planned-list .not-yet { margin-right:6px; }
/* The page area takes focus on every route so screen readers start there; it is not a control, so no ring (Stephen, 2026-10-08) */
#view:focus { outline:none; }
#view :is(h1, h2)[tabindex="-1"]:focus { outline:none; }   /* a page's heading takes focus on arrival (UI-10): not a control, no ring */
/* A record's stage card: no heading and no buttons (Stephen, 2026-10-08), so no empty head row; the strip leads */
.cd-stage > .head:has(.stage-actions:empty) { display:none; }
/* The stage strip's menu and the move's consequences (Stephen, 2026-10-08; contact-stage.js) */
.stage-menu { position:fixed; z-index:46; min-width:200px; padding:4px; border-radius:8px; background:var(--card); border:1px solid var(--line); box-shadow:0 8px 24px rgb(0 0 0 / .22); }
.stage-menu-item { display:block; width:100%; text-align:left; font:inherit; font-size:14px; padding:8px 12px; border:0; border-radius:6px; background:none; color:var(--fg); cursor:pointer; }
.stage-menu-item:hover, .stage-menu-item:focus-visible { background:var(--subtle); }
.stage-menu-item[aria-disabled="true"] { color:var(--muted); cursor:default; }
.stage-move-dlg { max-width:min(560px, calc(100vw - 32px)); box-sizing:border-box; }
.stage-move-dlg h3 { font-size:15px; margin:14px 0 4px; }
.stage-move-dlg .confirm-body > h3:first-child { margin-top:0; }
.stage-move-dlg .confirm-list { margin:4px 0 8px; }
.stage-move-dlg .field { margin-top:12px; }
/* Task lists as a table (Stephen, 2026-10-08; SPEC REC-17a; task-table.js): sortable headers, a filter row, the
   actions right-aligned in a fixed-width last column so they line up from row to row */
.tk-card { padding:0; overflow:hidden; }
.tk-wrap { overflow-x:auto; }
.tk-table { width:100%; border-collapse:collapse; font-size:14px; }
.tk-table th, .tk-table td { padding:6px 10px; border-bottom:1px solid var(--line); text-align:left; vertical-align:middle; }
.tk-table thead th { position:sticky; top:0; background:var(--card); z-index:1; padding-top:10px; padding-bottom:8px; }
/* The header: sort by its name, filter from its icon (a pop-over; Stephen, 2026-10-08), the icon in the accent with a count when on */
.tk-th { display:inline-flex; align-items:center; gap:2px; }
.tk-filter { position:relative; display:inline-grid; place-items:center; width:24px; height:24px; padding:0; border:0; border-radius:6px; background:none; color:var(--muted); cursor:pointer; }
.tk-filter:hover { background:var(--subtle); color:var(--fg); }
.tk-filter.is-on { color:var(--accent); background:color-mix(in srgb, var(--accent) 12%, transparent); }
.tk-fn { position:absolute; top:-4px; right:-5px; font-size:10px; font-weight:700; line-height:14px; min-width:14px; border-radius:999px; background:var(--accent); color:var(--accent-fg); }
.tk-fn:empty { display:none; }
.tk-pop { position:fixed; z-index:46; width:240px; max-height:min(420px, 70vh); display:flex; flex-direction:column; padding:10px; box-sizing:border-box;
  background:var(--card); color:var(--fg); border:1px solid var(--line); border-radius:10px; box-shadow:0 8px 24px rgb(0 0 0 / .22); font-size:14px; font-weight:400; }
.tk-pop-body { overflow-y:auto; min-height:0; display:grid; gap:6px; }
.tk-pop-q { width:100%; box-sizing:border-box; font:inherit; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--search); color:var(--fg); }
.tk-checks { display:grid; gap:2px; }
.tk-check { display:flex; align-items:center; gap:8px; padding:4px 6px; border-radius:6px; cursor:pointer; }
.tk-check:hover { background:var(--subtle); }
.tk-check[hidden] { display:none; }
.tk-check input { margin:0; }
.tk-custom { display:grid; gap:6px; padding:4px 6px 0; }
.tk-custom[hidden] { display:none; }
.tk-custom label { display:grid; gap:2px; font-size:13px; color:var(--muted); }
.tk-custom input { font:inherit; padding:4px 6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.tk-pop-foot { display:flex; justify-content:flex-end; gap:6px; margin:10px 0 0; }
.tk-sort { font:inherit; font-weight:700; font-size:13px; color:var(--fg); background:none; border:0; padding:2px 0; cursor:pointer; white-space:nowrap; }
.tk-sort:hover { color:var(--accent); }
.tk-status { width:9em; } .tk-opened, .tk-due { width:8.5em; white-space:nowrap; } .tk-owner { width:10em; } .tk-priority { width:6.5em; }
.tk-actions { width:7em; text-align:right !important; }
.tk-acts { display:inline-flex; align-items:center; gap:4px; justify-content:flex-end; }
.tk-done { width:18px; height:18px; margin:0 6px 0 0; cursor:pointer; }
.tk-icon { display:inline-grid; place-items:center; width:30px; height:30px; padding:0; border:1px solid transparent; border-radius:6px; background:none; color:var(--muted); cursor:pointer; }
.tk-icon:hover { color:var(--fg); background:var(--subtle); border-color:var(--line); }
.tk-del:hover { color:var(--bad); }
.tk-icon-gap { display:inline-block; width:30px; }
.tk-st { display:inline-block; font-size:12px; font-weight:700; padding:1px 8px; border-radius:999px; border:1px solid var(--line); white-space:nowrap; }
.tk-st.bad { color:var(--bad); border-color:var(--bad); } .tk-st.warn { color:var(--warn); border-color:var(--warn); }
.tk-st.ok { color:var(--ok); border-color:var(--ok); } .tk-st.muted { color:var(--muted); }
.tk-title { min-width:14em; } .tk-title .tk-subject { font-weight:600; } .tk-title .tk-for { display:block; } .tk-title .choices { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
.tk-due.bad { color:var(--bad); font-weight:600; }
.tk-row.is-done .tk-subject, .tk-row.is-canceled .tk-subject { text-decoration:line-through; color:var(--muted); }
.tk-row.is-notyet { color:var(--muted); }
.tk-row:hover > td { background:color-mix(in srgb, var(--subtle) 60%, transparent); }
.tk-row.tl-focus > td { background:var(--subtle); box-shadow:inset 0 0 0 9999px color-mix(in srgb, var(--accent) 8%, transparent); }
.tk-edit-row > td { background:var(--bg); }
.tk-count { margin:6px 12px 10px; color:var(--muted); font-size:13px; }
.tk-table tbody tr:last-child > td { border-bottom:0; }
@media (max-width:800px) { .tk-table { min-width:760px; } }
/* A palette's link style (SPEC ADM-09b), chosen in its editor under the preview, whose link shows it */
.pal-linkset { border:1px solid var(--line); border-radius:8px; padding:8px 10px 10px; margin:12px 0; display:grid; gap:4px; }
.pal-linkset legend { font-weight:600; padding:0 4px; } .pal-linkset legend small { font-weight:400; color:var(--muted); }
.pal-link-opt { display:flex; align-items:flex-start; gap:8px; padding:4px 2px; cursor:pointer; font-size:14px; }
.pal-link-opt input { margin-top:3px; } .pal-link-opt small { display:block; color:var(--muted); }
.pal-link-note { color:var(--muted); }
/* A planned email opens like a sent one (part-toggles.js); its heading reads as one line of words */
.planned-list details > summary { display:block; cursor:pointer; }
/* A company's Contacts as cards (Stephen, 2026-10-08; SPEC REC-11d; company-contacts.js) */
.cc .head { display:flex; justify-content:space-between; align-items:center; gap:8px; } .cc h2 small { color:var(--muted); font-weight:400; }
.cc-cards { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:12px; }
.cc-card { min-width:0; }
.cc-flip { position:relative; display:grid; min-width:0; }
/* The flip: one face at a time (the other is hidden, out of the accessibility tree too), the one appearing turns in */
.cc-face.cc-turn { animation:cc-turn .35s ease-out; }
@keyframes cc-turn { from { transform:perspective(900px) rotateY(-90deg); opacity:.4; } to { transform:none; opacity:1; } }
.cc-face { grid-area:1 / 1; display:flex; flex-direction:column; gap:10px; padding:14px; border:1px solid var(--line); border-radius:12px; background:var(--card);
  box-shadow:0 1px 3px rgb(0 0 0 / .08); min-height:220px; box-sizing:border-box; min-width:0; overflow:hidden; }
.cc-face[hidden] { display:none; }
.cc-top { display:flex; gap:12px; align-items:center; }
.ph-card { width:64px; height:64px; }
.cc-initials { width:64px; height:64px; font-size:22px; }
.cc-id { display:grid; gap:2px; min-width:0; } .cc-id small { color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cc-name { font-weight:700; font-size:16px; }
.cc-foot { margin:auto 0 0; display:flex; justify-content:flex-end; }
.cc-note { margin:0; color:var(--muted); font-size:13px; }
.cc-back-h { margin:0; font-size:15px; }
.cc-count-list { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
/* The stage strip: the shown stage in the middle, its neighbors fading out to either side, ‹ › to slide */
.cc-strip { display:flex; align-items:center; gap:4px; min-width:0; }
.cc-arrow { position:relative; z-index:1; flex:none; width:26px; height:26px; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--card); color:var(--fg); cursor:pointer; font-size:16px; line-height:1; }
.cc-arrow:disabled { opacity:.35; cursor:default; }
.cc-view { flex:1 1 auto; min-width:0; overflow:hidden; clip-path:inset(0 round 8px); position:relative; border-radius:8px; outline-offset:2px;
  -webkit-mask-image:linear-gradient(to right, transparent, currentColor 28%, currentColor 72%, transparent);
  mask-image:linear-gradient(to right, transparent, currentColor 28%, currentColor 72%, transparent); }
.cc-track { list-style:none; margin:0; padding:4px 0; display:flex; gap:8px; width:max-content; transition:transform .3s ease; }
/* The same look as the record's stage strip (.stage-box above): dashed ahead, filled and solid when done, the current
   one thicker, stalled in the warning color (Stephen, 2026-10-08: "maintain the same style") */
.cc-st { flex:none; width:112px; box-sizing:border-box; padding:6px 8px; border:1.5px dashed var(--stage-ahead); border-radius:10px; background:var(--card); display:grid; gap:2px; cursor:default; }
.cc-st-name { font-size:13px; font-weight:600; color:var(--fg); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cc-st-word { font-size:11px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cc-st.is-completed { background:var(--stage-done-bg); border:1.5px solid var(--ok); }
.cc-st.is-curtailed { background:var(--stage-cut-bg); border:1.5px dotted var(--muted); }
.cc-st.is-started { background:var(--stage-now-bg); border:1.5px solid var(--accent); }
.cc-st.is-current { border-width:3px; }
.cc-st.is-stalled { background:var(--stage-stall-bg); border:3px solid var(--warn); } .cc-st.is-stalled .cc-st-word { color:var(--fg); }
.cc-st:hover { border-width:3px; }
@media (prefers-reduced-motion: reduce) { .cc-track { transition:none; } .cc-face.cc-turn { animation:none; } }
/* The Dashboard's Stage card (STG-20a): the stage, a pick-list of the others, % done; its items in a table */
.cd-stagecard { margin-bottom:0; min-width:0; } #d-stg-host { min-width:0; }   /* a grid item: the table scrolls inside, the page never does */
.cd-stagecard .table-wrap { overflow-x:auto; max-width:100%; }
@media (max-width:600px) { .sc-done .sc-bar, .sc-pct .sc-bar { display:none; } .sc-table th, .sc-table td { padding:6px 4px; } }
.sc-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:8px 12px; }
.sc-head h2 { margin:0; } .sc-name { font-size:16px; }
.sc-pick { width:auto; max-width:100%; font:inherit; font-size:14px; padding:4px 8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.sc-pct { margin-left:auto; display:inline-flex; align-items:center; gap:6px; }
.sc-bar { display:inline-block; width:80px; height:8px; border-radius:999px; background:var(--subtle); box-shadow:inset 0 0 0 1px var(--line); overflow:hidden; vertical-align:middle; }
.sc-fill { display:block; height:100%; background:var(--ok); }
.sc-table { width:100%; border-collapse:collapse; font-size:14px; } .sc-table th, .sc-table td { padding:6px 8px; border-bottom:1px solid var(--line); text-align:left; }
.sc-done { white-space:nowrap; } .sc-done .sc-bar { width:60px; }
.sc-st { font-size:12px; font-weight:700; } .sc-st.ok { color:var(--ok); } .sc-st.bad { color:var(--bad); } .sc-st.warn { color:var(--warn); } .sc-st.muted { color:var(--muted); }

/* The Timeline's Calendar view (TLV-21): a month grid of lane-colored pills, and a Months panel sliding out at the right */
.cal-nav { display:inline-flex; align-items:center; gap:6px; } .cal-title { min-width:9.5em; text-align:center; }
.cal-wrap { position:relative; display:flex; gap:12px; align-items:flex-start; min-width:0; }
.cal-main { flex:1; min-width:0; }
.cal-grid { width:100%; table-layout:fixed; border-collapse:collapse; font-size:13px; }
.cal-grid th { padding:4px; font-size:12px; font-weight:600; color:var(--muted); text-align:left; } .cal-grid th abbr { text-decoration:none; }
.cal-day { height:96px; vertical-align:top; padding:4px; border:1px solid var(--line); background:var(--card); overflow:hidden; }
.cal-day.is-weekend, .cal-day.is-holiday { background:var(--subtle); }
.cal-day.is-out { opacity:.5; }
.cal-day.is-today { box-shadow:inset 0 0 0 2px var(--accent); }
.cal-day.is-today .cal-num { color:var(--accent); font-weight:800; }
.cal-day:focus { outline:none; } .cal-day:focus-visible { box-shadow:inset 0 0 0 3px var(--fg); }
.cal-day.is-flash { animation:cal-flash 1.6s ease-out; }
@keyframes cal-flash { 0%, 30% { box-shadow:inset 0 0 0 3px var(--accent); background:var(--subtle); } }
@media (prefers-reduced-motion: reduce) { .cal-day.is-flash { animation:none; box-shadow:inset 0 0 0 3px var(--accent); } }
.cal-num { font-weight:600; } .cal-hol { display:block; color:var(--muted); font-size:11px; line-height:1.2; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cal-pills { list-style:none; margin:4px 0 0; padding:0; display:grid; gap:2px; } .cal-pills > li { min-width:0; }
.cal-pill button { display:flex; align-items:center; gap:4px; width:100%; min-width:0; padding:1px 6px; border:1px solid var(--lc, var(--line)); border-left-width:4px; border-radius:6px;
  background:var(--card); color:var(--fg); font:inherit; font-size:12px; text-align:left; cursor:pointer; overflow:hidden; }
.cal-pill button:hover { background:var(--subtle); }
.cal-pill .cal-ic { color:var(--lc, var(--muted)); flex:none; } .cal-pt { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cal-pill.is-closed button { opacity:.7; } .cal-pill.is-future button { border-style:dashed; }
.cal-more { margin-top:2px; padding:0 4px; border:0; background:none; color:var(--accent); font:inherit; font-size:12px; cursor:pointer; text-decoration:underline; }
.cal-panel { flex:none; width:260px; max-height:640px; display:flex; flex-direction:column; border:1px solid var(--line); border-radius:10px; background:var(--card);
  transform:translateX(24px); opacity:0; transition:transform .25s ease, opacity .25s ease; }
.cal-panel.is-open { transform:none; opacity:1; }
@media (prefers-reduced-motion: reduce) { .cal-panel { transition:none; } }
.cal-panel-head { display:flex; justify-content:space-between; align-items:center; padding:8px 10px; border-bottom:1px solid var(--line); }
.cal-panel-scroll { overflow-y:auto; padding:6px 10px 10px; overscroll-behavior:contain; }
.cal-mini { padding:6px 4px 10px; border-radius:8px; } .cal-mini.is-shown { background:var(--subtle); }
.cal-mini h3 { margin:0 0 4px; font-size:13px; }
.cal-mini-h { border:0; background:none; padding:0; font:inherit; font-weight:700; color:var(--fg); cursor:pointer; } .cal-mini-h:hover { text-decoration:underline; }
.cal-mini-grid { display:grid; grid-template-columns:repeat(7, 1fr); gap:2px; }
.cal-mini-wd { font-size:10px; color:var(--muted); text-align:center; }
.cal-mini-day { position:relative; height:28px; padding:1px 0 0; border:1px solid transparent; border-radius:4px; background:none; color:var(--fg); font:inherit; font-size:11px; cursor:pointer; }
.cal-mini-day:hover { border-color:var(--line); } .cal-mini-day.is-today { border-color:var(--accent); font-weight:800; }
.cal-blocks { position:absolute; left:3px; right:3px; bottom:3px; display:flex; gap:1px; height:5px; }
.cal-blocks i { flex:1; border-radius:2px; background:var(--lc); }
@media (max-width:700px) {
  .cal-day { height:64px; padding:2px; } .cal-pt, .cal-hol { display:none; }
  .cal-pill button { justify-content:center; padding:1px 2px; border-left-width:1px; }
  .cal-panel { position:absolute; right:0; top:0; z-index:5; width:min(280px, 100%); box-shadow:0 6px 20px rgb(0 0 0 / .2); }
}

/* The Timeline's list as a table (TLV-01a): the task table's look, plus a Type column in its lane's color */
.tt-kind { display:inline-flex; align-items:center; gap:3px; padding:1px 6px; border:1px solid var(--lc, var(--line)); border-radius:999px; font-size:12px; font-weight:600; white-space:nowrap; }
.tt-ic { color:var(--lc, var(--muted)); }
.tt-subject { min-width:10em; width:40%; } .tt-status .tk-st { white-space:normal; } .tt-table th, .tt-table td { padding-left:7px; padding-right:7px; } .tt-subject > small { display:block; }
.tt-body { margin:2px 0 0; color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.tt-body.is-long:not(.is-open) { display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.tt-more { padding:0; border:0; background:none; color:var(--accent); font:inherit; font-size:12px; text-decoration:underline; cursor:pointer; }
.tt-date { white-space:nowrap; } .tt-date small { display:block; color:var(--muted); }
.tt-row.is-done .tl-subject { text-decoration:line-through; color:var(--muted); }
.tt-row.is-inactive { opacity:.72; } .tt-row .not-yet { font-weight:600; }
.tt-subject .choices { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
/* AUTH-20: the list's check column, for delete permanently while testing */
th.pick, td.pick { width:2.5em; } th.pick input, td.pick input { width:auto; margin:0; }
.bulkbar { margin:8px 0; }
/* ADM-15: Settings → Zoom, what Zoom sent */
.zm-json { white-space:pre-wrap; overflow-wrap:anywhere; font:12px/1.45 ui-monospace, Menlo, Consolas, monospace; max-height:480px; overflow:auto; background:var(--subtle); color:var(--fg); padding:8px; border-radius:6px; margin:8px 0; max-width:min(70ch, 60vw); }
/* REC-01b: the ownership pool's ordered list */
.op-list { padding-left:1.5em; } .op-list li { padding:4px 0; cursor:grab; } .op-list li:focus-visible { outline:2px solid var(--focus); outline-offset:2px; } .op-grip { color:var(--muted); }
.zm-steps { margin:4px 0; padding-left:1.2em; font-size:13px; } .zm-steps li.err { color:var(--bad); }
.zt-map { width:100%; table-layout:fixed; } .zt-map th:first-child { width:55%; } .zt-map td { vertical-align:top; } .zt-map td:first-child code, .zt-map td:first-child small { overflow-wrap:anywhere; } .zt-map select { width:100%; max-width:100%; }
.zt-action { margin:8px 0; } .zt-action h4 { margin:0 0 8px; } .zt-conds { padding-left:1.2em; } .zt-conds li { margin:4px 0; } .zt-conds select { max-width:28ch; }
.zt-hours { width:7ch; }
/* ADM-16: a Settings tab with sections opens a dropdown of them (settings.js tabMenu); the section shows full width below */
.tab-dd { position:relative; display:inline-flex; }
.tab-dd-btn { padding:6px 12px; border:0; background:none; font:inherit; color:var(--fg); border-radius:6px 6px 0 0; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.tab-dd-btn[aria-current="page"] { background:var(--subtle); font-weight:600; }
.tab-dd-btn:hover, .tab-dd-btn[aria-expanded="true"] { background:var(--subtle); }
.tab-dd-caret { width:0; height:0; border-left:5px solid transparent; border-right:5px solid transparent; border-top:6px solid currentColor; transition:transform .15s; }
.tab-dd-btn[aria-expanded="true"] .tab-dd-caret { transform:rotate(180deg); }
.tab-dd-menu { position:absolute; top:100%; left:0; z-index:30; min-width:240px; margin:0; padding:6px; list-style:none; background:var(--card); border:1px solid var(--line);
  border-radius:0 8px 8px 8px; box-shadow:0 6px 18px rgba(0,0,0,.14); }
.tab-dd-menu[hidden] { display:none; }
.tab-dd-menu a { display:block; padding:8px 10px; border-radius:6px; color:var(--fg); text-decoration:none; white-space:nowrap; }
.tab-dd-menu a:hover, .tab-dd-menu a:focus-visible { background:var(--subtle); }
.tab-dd-menu a[aria-current="true"] { font-weight:600; box-shadow:inset 3px 0 0 var(--accent); }
@media (prefers-reduced-motion: reduce) { .tab-dd-caret { transition:none; } }
/* ADM-16: an event's Steps, JSON and Try it open in a full-width row under it (settings-zoom.js fullWidthDetails) */
.zm-detail > td { background:var(--subtle); padding:8px 12px 12px; }
.zm-detail .zm-json { max-width:none; background:var(--card); }
/* Stephen, 2026-10-11: Zoom template sections collapse and expand (collapsed by default) */
details.zt-sec { border:1px solid var(--line); border-radius:6px; margin:10px 0; padding:0 12px; background:var(--card); }
details.zt-sec > summary { cursor:pointer; padding:10px 0; list-style:revert; } details.zt-sec > summary h3 { display:inline; margin:0; font-size:1.05em; }
details.zt-sec > summary:focus-visible { outline:2px solid var(--focus); outline-offset:2px; } details.zt-sec[open] > summary { border-bottom:1px solid var(--line); margin-bottom:8px; }
.zt-sec-body { padding-bottom:10px; }
/* Stephen, 2026-10-11: mapped Zoom elements are shaded, and a toggle shows only them */
.zt-map tr.zt-mapped > td { background:var(--subtle); }
.zt-show .btn[aria-pressed="true"] { background:var(--subtle); font-weight:600; }
/* Stephen, 2026-10-11: the Settings tab bar stays put under the top bar while the page scrolls */
nav.tabs[aria-label="Settings"] { position:sticky; top:var(--top-h, 50px); z-index:11; background:var(--bg); margin-top:0; padding-top:6px; }
.tl-answers-row > td { background:var(--subtle); padding:8px 16px 12px; } .tl-answers-row .tl-qa { background:var(--card); }
/* STG-42: a stage map test run */
.st-strip { display:flex; flex-wrap:wrap; gap:4px; list-style:none; padding:0; margin:12px 0; }
.st-strip li { padding:6px 12px; border:1px solid var(--line); border-radius:999px; background:var(--card); }
.st-strip li.is-done { background:var(--stage-done-bg); } .st-strip li.is-now { background:var(--stage-now-bg); font-weight:700; border-color:var(--accent); }
.st-visit.is-now { border-color:var(--accent); } .st-visit h3 { margin:0 0 4px; } .st-controls .btn { margin:0 6px 6px 0; }
/* SRV-35: a survey's Flow view (survey-flow.js): the main path down, branches side by side, each ending where it continues */
.sf { margin-top:8px; }
  border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:8px; background:var(--card); color:var(--fg); font:inherit; cursor:pointer; }
.sf-branch { border:1px solid var(--line); border-radius:8px; padding:8px 12px; margin:0 0 10px; }
.sf-branch legend { font-weight:600; padding:0 4px; }
/* SRV-37: the question box's suggestions, the type icons, and what already saves to a field */
.sq-list li { display:flex; gap:10px; align-items:flex-start; }
.sq-list li mark { background:var(--subtle); color:inherit; font-weight:700; padding:0; }
.sq-ico { flex:none; color:var(--muted); display:inline-flex; }
.sq-ico svg { width:18px; height:18px; }
.sq-q { display:block; overflow-wrap:anywhere; }
.sq-d { display:block; color:var(--muted); }
.sq-types { display:flex; flex-wrap:wrap; gap:6px; }
.sq-type { display:flex; flex-direction:column; align-items:center; gap:4px; width:84px; padding:8px 4px 6px; border:1px solid var(--line); border-radius:8px;
  background:var(--card); color:var(--fg); font:inherit; font-size:12px; line-height:1.2; text-align:center; cursor:pointer; }
.sq-type:hover:not(:disabled) { border-color:var(--accent); }
.sq-type:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.sq-type[aria-checked="true"] { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); background:var(--subtle); color:var(--accent); font-weight:600; }
.sq-type:disabled { cursor:default; opacity:.55; } .sq-type[aria-checked="true"]:disabled { opacity:1; }
.sq-prior ul { list-style:none; margin:4px 0 0; padding:0; display:flex; flex-direction:column; gap:6px; }
.sq-prior li { display:flex; gap:10px; align-items:center; padding:6px 8px; border:1px solid var(--line); border-radius:6px; }
.sq-prior-t { flex:1; min-width:0; }
.sq-prior-h { margin:8px 0 0; }
aside.panel .sq-type { width:74px; }

/* EDT-37 (Stephen, 2026-10-12): a block's and a section's labels sit above their outline, never over the text */
.be-canvas { padding-top:26px; }
.be-tools { box-shadow:0 1px 3px rgb(0 0 0 / .12); }
/* the tool for what's selected is lit */
.be-bar .be-ib.is-lit, .be-bar .be-pal.is-lit { background:var(--subtle); color:var(--accent); box-shadow:inset 0 0 0 2px var(--accent); border-radius:6px; }
/* Docked: the canvas alone where the page is; the tool rows and the right panel in the host's column */
.be-docked .be-main { grid-template-columns:minmax(0,1fr); margin-top:0; }
.be-docked .be-hint { display:none; }
.be-dock { display:flex; flex-direction:column; gap:6px; min-width:0; }
.be-dock .be-bar { position:static; padding:4px 0; gap:4px 6px; border-bottom:0; background:none; }
.be-dock .be-row2 { border-bottom:1px solid var(--line); padding-bottom:8px; }
.be-dock .be-bar .seg { padding-right:4px; }
.be-docked .be-tools { display:none !important; }
.be-selacts { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:0 0 8px; }
.be-dock .be-bar select { max-width:110px; }
.be-dock .be-side { position:static; max-height:none; overflow:visible; padding:0; border-left:0; }
.be-dock .be-link { display:flex; flex-wrap:wrap; gap:6px; align-items:center; padding:8px; border:1px solid var(--line); border-radius:8px; background:var(--card); }
.be-dock .be-link[hidden] { display:none; }
.be-dock .be-link input { flex:1 1 160px; min-width:0; }
.be-dock .be-code textarea { width:100%; box-sizing:border-box; }
/* A survey page (page 'survey'): at the survey's own width, with no email background around it */
.be-survey .be-stage { background:none; border:0; border-radius:0; overflow:visible; }
.be-survey .be-canvas { padding:26px 0 0; background:none !important; }
.be-survey .be-paper { max-width:none; min-height:0; }
.be-survey .be-canvas { min-height:0; }
.be-survey .be-empty { padding:8px; }
.be-dock .seg[aria-label="Width"] { display:none; }

/* ---- SRV-41..46 (Stephen, 2026-10-12): the survey builder: the survey as it will look, edited in place, with Properties */
.sv-pubbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.sv-status { font-size:13px; color:var(--muted); }
.sv-status .bad { color:var(--bad); }
.linkbtn { font:inherit; font-size:inherit; background:none; border:0; padding:0; color:var(--accent); text-decoration:underline; cursor:pointer; }
.svb-top { display:flex; flex-wrap:wrap; gap:8px 16px; align-items:center; margin:0 0 10px; }
.svb-top [hidden] { display:none; }
.svb-main { display:grid; grid-template-columns:minmax(0, 1fr) var(--svb-pw, 460px); gap:16px; align-items:start; }
@media (max-width:1000px) { .svb-main { grid-template-columns:minmax(0, 1fr); } }
.svb-stage { min-width:0; background:var(--subtle); border:1px solid var(--line); border-radius:10px; padding:16px 64px; overflow-x:auto; }
@media (max-width:700px) { .svb-stage { padding:12px 8px; } .svb-bar-blk { left:auto; right:4px; top:-34px; flex-direction:row; } .svb-bar-sec { right:auto; left:4px; top:-34px; flex-direction:row; } }
.svb-frame { margin:0 auto; background:var(--bg); border-radius:8px; padding:20px 20px 28px; box-shadow:0 1px 4px rgb(0 0 0 / .08); box-sizing:border-box; }
.svb-frame[hidden] { display:none; }
.svb-desktop { max-width:720px; } .svb-tablet { width:min(100%, 768px); } .svb-phone { width:min(100%, 390px); padding:16px 12px 24px; }
.svb-phone .sv-scale.sv-n-11, .svb-phone .sv-scale.sv-n-10, .svb-phone .sv-scale.sv-n-9 { grid-template-columns:repeat(6, minmax(0, 1fr)); }
.svb-canvas.sv { max-width:none; margin:0; padding:0; }
.svb-canvas .svb-items { display:grid; gap:0; }
.svb-canvas .sv-sec { gap:0; }
.svb-title { position:relative; border-radius:6px; }
.svb-ed { outline:none; border-radius:3px; min-width:1ch; display:inline-block; cursor:text; }
.svb-ed:hover { box-shadow:0 0 0 1px var(--line); }
.svb-ed:focus { box-shadow:0 0 0 2px var(--focus); background:var(--entry); }
.svb-ed:empty::before { content:attr(data-ph); color:var(--muted); font-weight:400; font-style:italic; }
div.svb-ed { display:block; white-space:pre-wrap; }
.svb-qlabel { font-weight:600; margin-bottom:8px; }
.svb-block { position:relative; border-radius:10px; outline:2px solid transparent; outline-offset:3px; }
.svb-block:hover { outline-color:var(--line); }
.svb-block.is-sel, .svb-block:focus-visible { outline-color:var(--accent); }
.svb-block.svb-bad { outline-color:var(--bad); }
.svb-block.is-dragging, .svb-sec.is-dragging { opacity:.45; }
.svb-err { color:var(--bad); font-weight:600; font-size:14px; margin:6px 0 0; }
/* Stephen, 2026-10-12: the tools sit BESIDE the survey, never on it, so the canvas is exactly what the respondent sees:
   a block's column of icons to its right, a section's to its left; shown on hover, focus or selection */
.svb-block, .svb-sec { position:relative; }
.svb-bar { position:absolute; top:0; z-index:4; display:flex; flex-direction:column; align-items:center; gap:2px; padding:3px; color:var(--muted);
  background:var(--card); border:1px solid var(--line); border-radius:8px; box-shadow:0 1px 4px rgb(0 0 0 / .1); opacity:0; pointer-events:none; transition:opacity .1s; }
.svb-bar-blk { left:calc(100% + 30px); }
.svb-bar-sec { right:calc(100% + 30px); }
.svb-block:hover > .svb-bar, .svb-block.is-sel > .svb-bar, .svb-block:focus-within > .svb-bar,
.svb-sec:hover:not(:has(.svb-block:hover)) > .svb-bar, .svb-sec.is-sel > .svb-bar, .svb-sec:focus-visible > .svb-bar { opacity:1; pointer-events:auto; }
.svb-kind { display:inline-flex; align-items:center; justify-content:center; padding:3px; color:var(--accent); }
.svb-kind svg { width:16px; height:16px; }
.svb-grip, .svb-tb { display:inline-flex; align-items:center; justify-content:center; gap:1px; border:0; background:none; color:inherit; font:inherit; font-size:11px; padding:4px; border-radius:5px; cursor:pointer; }
.svb-grip { cursor:grab; }
.svb-grip:hover, .svb-tb:hover { background:var(--subtle); color:var(--fg); }
.svb-grip:focus-visible, .svb-tb:focus-visible { outline:2px solid var(--focus); outline-offset:0; }
.svb-tb.is-on { color:var(--accent); font-weight:700; }
.svb-count { font-size:10px; }
.svb-danger:hover { color:var(--bad); }
/* the + between blocks is the survey's own 16px gap, its circle shown on hover */
.svb-add { display:flex; justify-content:center; align-items:center; height:16px; position:relative; }
.svb-plus { position:absolute; top:50%; left:50%; transform:translate(-50%, -50%); z-index:3; width:22px; height:22px; border-radius:50%; border:1px solid var(--accent); background:var(--card);
  color:var(--accent); font:inherit; font-size:15px; line-height:1; cursor:pointer; opacity:0; padding:0; }
.svb-add:hover .svb-plus, .svb-plus:focus-visible, .svb-block.is-sel + .svb-add .svb-plus, .svb-sec-empty .svb-plus { opacity:1; }
.svb-drop { height:0; border-top:3px solid var(--accent); margin:2px 0; border-radius:2px; }
.svb-sec { position:relative; border-radius:10px; outline:2px solid transparent; outline-offset:4px; padding-top:2px; }
.svb-sec.is-sel { outline-color:var(--accent); }
.svb-sec-ghost { outline:1px dashed transparent; outline-offset:6px; }
.svb-sec-ghost:hover { outline-color:var(--line); }
.svb-sec > .sv-sec-desc, .svb-sec > .sv-sec-count { margin:0 0 10px; }
.svb-pagebreak { display:flex; align-items:center; gap:8px; margin:14px 0; color:var(--muted); font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
.svb-pagebreak::before, .svb-pagebreak::after { content:""; flex:1; border-top:2px dashed var(--line); }
.svb-submit { margin-top:12px; }
.svb-after { display:flex; align-items:center; gap:8px; margin:20px 0 8px; color:var(--muted); font-size:13px; }
.svb-after::before, .svb-after::after { content:""; flex:1; border-top:1px dashed var(--line); }
.svb-page { position:relative; border-radius:8px; outline:2px solid transparent; outline-offset:3px; margin:0 0 12px; }
.svb-page.is-sel { outline-color:var(--accent); }
.svb-pageph { padding:6px 0; }
.svb-pageph h2 { font-size:20px; margin:0 0 6px; }
.svb-pagewrap .be-canvas { padding-top:0; }
.sv-choice .svb-ed { flex:1; }
.svb-optx { margin-left:auto; border:0; background:none; color:var(--muted); font-size:16px; line-height:1; padding:0 4px; cursor:pointer; visibility:hidden; }
.svb-block.is-sel .svb-optx, .sv-choice:hover .svb-optx { visibility:visible; }
.svb-optx:hover { color:var(--bad); }
.svb-addopt { margin-top:6px; border:1px dashed var(--line); background:none; color:var(--accent); font:inherit; font-size:14px; padding:4px 10px; border-radius:6px; cursor:pointer; display:none; }
.svb-block.is-sel .svb-addopt, .svb-block:focus-within .svb-addopt { display:inline-block; }
.svb-optlist { margin-top:8px; display:none; } .svb-block.is-sel .svb-optlist { display:block; }
.svb-optrow { cursor:default; }
.svb-actstrip { display:flex; gap:8px; align-items:center; margin:0; padding:8px 12px; border:1px dashed var(--line); border-radius:8px; color:var(--muted); font-size:14px; }
.svb-actstrip svg { flex:none; }
.svb-msgbtns { flex-direction:row; }
.svb-msgbtns .btn { padding:8px 16px; border:1px solid var(--line); border-radius:6px; }
.svb-msgbtns .btn.primary { background:var(--accent); color:var(--accent-fg); border-color:var(--accent); }
.svb-canvas input:disabled, .svb-canvas select:disabled, .svb-canvas textarea:disabled { opacity:1; cursor:default; }
/* Properties: a column of its own, sticky under the header */
.svb-props { position:sticky; top:calc(var(--top-h, 50px) + var(--svh, 112px) + 8px); background:var(--card); border:1px solid var(--line); border-radius:10px; box-sizing:border-box; min-width:0; }
.svb-pscroll { max-height:calc(100vh - var(--top-h, 50px) - var(--svh, 112px) - 20px); overflow-y:auto; padding:12px 16px; box-sizing:border-box; }
@media (max-width:1000px) { .svb-props { position:static; } .svb-pscroll { max-height:none; } .svb-wgrip { display:none; } }
.svb-dock[hidden] { display:none; }
.sp-what { font-weight:700; margin:0 0 8px; }
.sp-fs { border:1px solid var(--line); border-radius:8px; padding:8px 12px; margin:0 0 10px; }
.sp-fs legend { font-weight:600; padding:0 4px; font-size:14px; }
.sp-check, .sp-radio { display:flex; align-items:center; gap:8px; margin:4px 0; font-size:14px; }
.sp-seg { display:inline-flex; flex-wrap:wrap; gap:0; }
.sp-seg .btn[aria-checked="true"] { background:var(--accent); color:var(--accent-fg); border-color:var(--accent); }
.sp-pair { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.sp-num input { max-width:120px; }
.sp-foot { display:flex; flex-wrap:wrap; gap:6px; margin:14px 0 0; padding-top:10px; border-top:1px solid var(--line); }
.sp-tabs { display:flex; gap:4px; margin:0 0 10px; border-bottom:1px solid var(--line); }
.sp-tabs [role=tab] { font:inherit; font-weight:600; border:0; background:none; color:var(--muted); padding:6px 12px; border-bottom:3px solid transparent; margin-bottom:-1px; cursor:pointer; }
.sp-tabs [role=tab][aria-selected="true"] { color:var(--accent); border-bottom-color:var(--accent); }
.sp-tabs [role=tab]:focus-visible { outline:2px solid var(--focus); }
.svb-props .sq-types .sq-type { width:68px; font-size:11px; }
.svb-props .field { margin-bottom:10px; }
/* the + menu */
.svb-menu { position:absolute; z-index:30; width:min(420px, calc(100vw - 16px)); background:var(--card); border:1px solid var(--line); border-radius:10px; box-shadow:0 8px 24px rgb(0 0 0 / .18); padding:10px 12px; }
.svb-menu-h { margin:4px 0 6px; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
.svb-menu-types { display:flex; flex-wrap:wrap; gap:6px; }
.svb-menu-types .sq-type { width:72px; font-size:11px; }
.svb-menu-more { display:flex; flex-wrap:wrap; gap:6px; }

/* ---- SRV-46: the map, as lanes: the road in the first column, each branch in a column of its own; lines go down, square-cornered */
.svb-map[hidden] { display:none; }
.sm { position:relative; overflow:auto; padding:8px 8px 32px; }
.sm-help { margin:0 0 12px; }
.sm-grid { position:relative; z-index:1; display:grid; gap:44px 56px; align-items:start; justify-items:center; min-width:max-content; padding:0 32px; }
.sm-edges { position:absolute; left:0; top:0; z-index:0; pointer-events:none; overflow:visible; }
.sm-labels { position:absolute; left:0; top:0; z-index:2; pointer-events:none; }
/* SRV-46b: a line's badge (a branch: ? and its rule in short; a plain next: a dot), its arrowhead handle, and the hover card */
.sm-lab { position:absolute; transform:translate(-50%, -50%); display:inline-flex; align-items:center; gap:4px; font:inherit; font-size:11px; font-weight:600; padding:1px 8px 1px 2px; border-radius:10px;
  background:var(--card); border:1px solid var(--accent); pointer-events:auto; color:var(--fg); white-space:nowrap; max-width:220px; cursor:pointer; }
.sm-labt { overflow:hidden; text-overflow:ellipsis; }
.sm-q { flex:none; display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; border-radius:50%; background:var(--accent); color:var(--accent-fg); font-size:11px; font-weight:700; }
.sm-lab-next { width:14px; height:14px; padding:0; justify-content:center; border-color:var(--line); color:var(--muted); opacity:.0; }
.sm:hover .sm-lab-next, .sm-lab-next:focus-visible { opacity:1; }
.sm-lab:hover, .sm-lab:focus-visible { border-color:var(--accent); box-shadow:0 0 0 2px var(--subtle); outline:none; }
.sm-head { position:absolute; transform:translate(-50%, -50%); width:16px; height:16px; border-radius:50%; border:0; background:transparent; padding:0; pointer-events:auto; cursor:grab; z-index:3; }
.sm-head:hover, .sm-head:focus-visible { background:var(--accent); opacity:.35; outline:none; }
.sm-tip { position:absolute; z-index:33; max-width:360px; background:var(--card); color:var(--fg); border:1px solid var(--line); border-radius:8px; box-shadow:0 6px 20px rgb(0 0 0 / .18); padding:8px 12px; font-size:13px; line-height:1.45; }
.sm-tip-first { font-weight:600; }
.sm-tip-to { margin-top:4px; color:var(--muted); font-size:12px; }
.sm-edge.is-over { stroke:var(--accent); stroke-width:4; }
.sm-pick { max-height:60vh; overflow-y:auto; }
.sm-edge { fill:none; stroke:var(--muted); stroke-width:1.6; }
.sm-ghost { stroke:var(--accent); stroke-dasharray:5 4; }
.sm-arrowhead { fill:var(--muted); }
.sm-dot { fill:var(--card); stroke:var(--line); stroke-width:1.5; opacity:0; pointer-events:none; }
.sm.is-moving .sm-dot { opacity:1; pointer-events:all; }
.sm-dot.is-over { fill:var(--accent); stroke:var(--accent); }
.sm-start, .sm-term { font-size:13px; font-weight:600; padding:5px 14px; border-radius:16px; background:var(--card); border:1px solid var(--line); }
.sm-exit { color:var(--bad); border-color:var(--bad); }
.sm-card { position:relative; display:flex; flex-direction:column; gap:2px; width:100%; max-width:280px; box-sizing:border-box; padding:12px 12px 16px; border:1px solid var(--line);
  border-left:4px solid var(--accent); border-radius:8px; background:var(--card); color:var(--fg); cursor:pointer; text-align:left; }
.sm-card:hover, .sm-card:focus-visible { box-shadow:0 0 0 3px var(--subtle); outline:none; }
.sm-card.is-sel { box-shadow:0 0 0 3px var(--accent); }
.sm-card.is-target { box-shadow:0 0 0 3px var(--ok); }
.sm-message { border-left-color:var(--warn); }
.sm-actions { border-left-color:var(--muted); border-style:dashed; border-left-style:solid; }
.sm-bad { border-color:var(--bad); }
.sm-kind { display:flex; align-items:center; gap:4px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
.sm-kind svg { width:14px; height:14px; }
.sm-name { font-weight:600; overflow-wrap:anywhere; }
.sm-sub { font-size:13px; color:var(--muted); }
.sm-err { font-size:13px; color:var(--bad); font-weight:600; }
.sm-port { position:absolute; width:14px; height:14px; border-radius:50%; border:2px solid var(--muted); background:var(--card); padding:0; box-sizing:border-box; z-index:2; }
.sm-in { top:-7px; left:50%; transform:translateX(-50%); pointer-events:none; }
.sm-out { bottom:-7px; transform:translateX(-50%); cursor:crosshair; }
.sm-out:hover, .sm-out:focus-visible { border-color:var(--accent); background:var(--accent); outline:none; }
.sm-out:disabled { cursor:default; }
.sm-plus { bottom:-10px; transform:translateX(-50%); width:20px; height:20px; border-color:var(--accent); color:var(--accent); font:inherit; font-size:14px; line-height:14px; font-weight:700; cursor:pointer; }
.sm-plus:hover, .sm-plus:focus-visible { background:var(--accent); color:var(--accent-fg); outline:none; }
.svb-fieldpick { position:absolute; z-index:31; width:300px; background:var(--card); border:1px solid var(--line); border-radius:8px; box-shadow:0 8px 24px rgb(0 0 0 / .18); padding:8px 10px; }
.svb-fieldpick label { display:block; font-weight:600; font-size:14px; margin-bottom:4px; } .svb-fieldpick p { margin:4px 0 0; }
.svb-help-empty { display:none; } .svb-block.is-sel .svb-help-empty, .svb-block:focus-within .svb-help-empty { display:block; }

/* the Properties column's width: its left edge drags (Stephen, 2026-10-12) */
.svb-wgrip { position:absolute; left:-9px; top:0; bottom:0; width:10px; cursor:col-resize; z-index:5; border-radius:4px; }
.svb-wgrip::after { content:""; position:absolute; left:3px; top:50%; height:40px; margin-top:-20px; width:4px; border-radius:2px; background:var(--line); }
.svb-wgrip:hover::after, .svb-wgrip:focus-visible::after { background:var(--accent); }
.svb-wgrip:focus-visible { outline:none; }
/* the header's second row: the tabs, then the survey view's own tools */
.sv-tabrow { display:flex; flex-wrap:wrap; gap:8px 16px; align-items:center; }
.sv-tools { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; }
.sv-tools [hidden] { display:none; }
.svb-add-empty { height:44px; border:1px dashed var(--line); border-radius:8px; } .svb-add-empty .svb-plus { opacity:1; }
.svb-stage:has(> .svb-map:not([hidden])) { padding:12px; }
.shell > main:has(.svb) { max-width:none; }   /* the survey builder uses the whole width (Stephen, 2026-10-12: the editor was too narrow) */
/* the canvas's right-click menu, and Test it */
.svb-ctx { position:absolute; z-index:32; min-width:220px; background:var(--card); border:1px solid var(--line); border-radius:8px; box-shadow:0 8px 24px rgb(0 0 0 / .18); padding:4px; display:flex; flex-direction:column; }
.svb-ctx button { font:inherit; font-size:14px; text-align:left; background:none; border:0; border-radius:5px; padding:6px 10px; color:var(--fg); cursor:pointer; }
.svb-ctx button:hover, .svb-ctx button:focus-visible { background:var(--subtle); outline:none; }
.svb-ctx hr { border:0; border-top:1px solid var(--line); margin:4px 0; }
.svb-testwrap[hidden] { display:none; }
.svb-testbar { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; margin:0 auto 12px; max-width:720px; }
.svb-tnote { max-width:720px; margin:10px auto 0; color:var(--muted); font-size:14px; }
.svb-tnote ul { margin:4px 0 0; padding-left:20px; }
/* the selected block's typable words show where they are (Stephen, 2026-10-12: a message's text had no edit border) */
.svb-block.is-sel .svb-ed, .svb-sec.is-sel > .sv-sec-title .svb-ed, .svb-sec.is-sel > .sv-sec-desc .svb-ed { outline:1px dashed var(--muted); outline-offset:2px; }
.svb-block.is-sel .svb-ed:focus { outline:2px solid var(--focus); }
div.svb-ed:empty { min-height:1.5em; }
.sp-color { display:inline-flex; gap:6px; align-items:center; } .sp-color input[type=color] { width:48px; height:30px; padding:0; border:1px solid var(--line); border-radius:6px; }
/* SRV-50 in the builder: a question's inline branches drawn under it; their rule beside the survey, on the left */
.svb-bgroup { position:relative; display:grid; }
.svb-bgroup::before { content:""; position:absolute; left:-12px; top:4px; bottom:4px; border-left:2px solid var(--accent); opacity:.35; border-radius:2px; }
.svb-bwhen { position:absolute; right:calc(100% + 18px); top:0; display:flex; gap:4px; align-items:center; max-width:180px; font-size:11px; font-weight:600; color:var(--accent);
  background:var(--card); border:1px solid var(--line); border-radius:10px; padding:2px 8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.svb-bwhen svg { flex:none; width:12px; height:12px; }
.svb-bempty { margin:0 0 8px; color:var(--muted); }
.svb-textblock { margin:0; }
@media (max-width:700px) { .svb-bwhen { position:static; margin:0 0 4px; } .svb-bgroup::before { left:-6px; } }
.svb-mapedit { margin:10px 0 12px; padding:10px; border:1px dashed var(--line); border-radius:8px; background:var(--bg); } .svb-mapedit > p { margin:0 0 6px; }
.sm-text { border-left-color:var(--muted); }
.svb-bthen { margin:0 0 10px; color:var(--muted); }
.sp-h { font-size:15px; margin:14px 0 6px; }

/* SRV-52: the ? alone on a branch's line; a circle for each extra way into a block; an end as a drop target; tracing */
.sm-lab.sm-lab-q { padding:0; width:20px; height:20px; justify-content:center; border-radius:50%; border-color:var(--accent); }
.sm-lab.sm-lab-q .sm-q { width:16px; height:16px; }
.sm-inx { position:absolute; transform:translate(-50%, -50%); pointer-events:none; z-index:1; }
.sm-term.is-target { box-shadow:0 0 0 3px var(--ok); }
.sm-card.is-trace, .sm-term.is-trace, .sm-start.is-trace { box-shadow:0 0 0 3px var(--ok); }
.svb-canvas .svb-block.is-trace { outline:3px solid var(--ok); outline-offset:4px; border-radius:6px; }
/* Properties: Comes from / Goes to as small map cards */
.sp-h-first { margin-top:0; }
.sp-blks { display:grid; gap:6px; margin:0 0 10px; }
.sp-to { margin:6px 0 0; }
.sp-blk { display:flex; align-items:stretch; gap:6px; border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:8px; background:var(--card); }
.sp-blk.sm-message { border-left-color:var(--warn); } .sp-blk.sm-actions { border-left-color:var(--muted); }
.sp-blk-term { border-left-width:1px; border-radius:16px; }
.sp-blk.sm-exit { border-color:var(--bad); }
.sp-go { flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; padding:6px 10px; border:0; background:transparent; color:var(--fg); font:inherit; text-align:left; cursor:pointer; border-radius:8px; }
span.sp-go { cursor:default; }
.sp-go:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.sp-go .sm-name { font-size:14px; }
.sp-blk.is-trace { box-shadow:0 0 0 3px var(--ok); }
.sp-blk-rm { align-self:center; margin-right:6px; }
/* SRV-52: a block's Properties as three folds: Comes from, the block, Goes to */
.sp-folds { display:grid; gap:10px; }
.sp-fold { border:1px solid var(--line); border-radius:8px; background:var(--card); }
.sp-fold-h { list-style:none; display:flex; align-items:center; gap:8px; padding:8px 12px; font-weight:700; font-size:15px; cursor:pointer; border-radius:8px; }
.sp-fold-h::-webkit-details-marker { display:none; }
.sp-fold-h::before { content:""; width:7px; height:7px; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); transform:rotate(-45deg); transition:transform .15s; flex:none; }
.sp-fold[open] > .sp-fold-h::before { transform:rotate(45deg); }
.sp-fold-h:hover { background:var(--subtle); }
.sp-fold-h:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.sp-fold[open] > .sp-fold-h { border-bottom:1px solid var(--line); border-radius:8px 8px 0 0; }
.sp-fold-b { padding:10px 12px; }
.sp-fold-b > :first-child { margin-top:0; }
.sp-fold-b > .svb-dock { margin:10px -12px 0; padding:10px 12px 0; border-top:1px solid var(--line); }
.sp-fold-b > .sp-foot { margin-bottom:0; }
/* Stephen, 2026-10-13: the traced block also gets a faint wash of the same green, for visibility */
.sm-card.is-trace, .sm-term.is-trace, .sm-start.is-trace, .svb-canvas .svb-block.is-trace, .sp-blk.is-trace { background:color-mix(in srgb, var(--ok) 9%, var(--card)); }

/* ==== MTG (crm [0f5b59]; SPEC §19): the Meeting Manager, #/meetings/:id/manage. Full width: the side menu steps aside. ==== */
.shell:has(.mm-grid) > .side { display:none; }
.shell > main:has(.mm-grid) { max-width:none; margin:0; padding:0; }
.mm-sel { font:inherit; padding:4px 8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.mm-saved { min-width:4.5em; }
.mm-rv { border:1px solid var(--line); border-radius:6px; margin:0 0 12px; padding:8px 12px; }
.mm-rv .field input, .mm-rv .field textarea { width:100%; box-sizing:border-box; }
/* Settings → Meetings: the template editor */
.mt-row { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; border-bottom:1px solid var(--line); padding-bottom:8px; margin-bottom:8px; }
.mt-row > .field { flex:1 1 180px; margin:0; }
.mt-item h4 { display:flex; align-items:center; gap:8px; margin:0 0 8px; }
.mt-rowbtns { margin-left:auto; display:inline-flex; gap:4px; }
.mt-choices { list-style:none; padding:0; margin:0; } .mt-choices li { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin-bottom:4px; }
.mt-checks { display:flex; flex-wrap:wrap; gap:4px 16px; }
/* the meeting screen */
.mm-grid { display:grid; grid-template-columns:var(--mm-sidebar-w, 260px) 9px minmax(0, 1fr); grid-template-areas:"top top top" "result result result" "side split board"; align-items:start; }
.mm-result { grid-area:result; margin:12px 12px 0; }
.mm-result ul { margin:0; padding-left:18px; }
.mm-top { grid-area:top; display:flex; align-items:center; gap:16px; flex-wrap:wrap; padding:12px 16px; background:var(--card); border-bottom:1px solid var(--line); position:sticky; top:var(--top-h, 50px); z-index:50; }   /* MTG-36: stays in view; above the board's shelf, docks and peeks, so Panels opens over them */
.mm-photo { width:64px; height:64px; border-radius:8px; object-fit:cover; flex:none; }
.mm-initials { display:inline-flex; align-items:center; justify-content:center; background:var(--subtle); color:var(--muted); font-weight:700; font-size:22px; }
.mm-who h1 { margin:0; font-size:22px; }
.mm-who p { margin:2px 0 0; }
.mm-meet { padding-left:16px; border-left:1px solid var(--line); }
.mm-clock { display:flex; flex-direction:column; align-items:center; padding:4px 12px; border:1px solid var(--line); border-radius:8px; background:var(--subtle); min-width:150px; }
.mm-cl-l { font-size:12px; color:var(--muted); }
.mm-cl-v { font-size:20px; font-weight:700; font-variant-numeric:tabular-nums; }
.mm-cl-v.is-soon { color:var(--warn); }
.mm-cl-v.is-live { color:var(--ok); }
.mm-acts { margin-left:auto; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.mm-pop { position:absolute; right:16px; top:100%; z-index:10; width:min(340px, calc(100vw - 32px)); max-height:70vh; overflow-y:auto; box-shadow:0 4px 16px rgb(0 0 0 / .15); }
.mm-pop fieldset { border:1px solid var(--line); border-radius:6px; margin:0 0 12px; }
.mm-pop .check, .mm-checks .check { display:block; }

.mm-side { grid-area:side; background:var(--card); padding:12px; overflow-y:auto; max-height:calc(100vh - var(--top-h, 50px) - var(--mm-top-h, 0px)); position:sticky; top:calc(var(--top-h, 50px) + var(--mm-top-h, 0px)); align-self:start; }
.mm-side-head { display:flex; align-items:center; gap:6px; margin:0 0 4px; } .mm-side-head > a { margin-left:auto; font-size:14px; white-space:nowrap; }
.mm-side-help { margin:0 0 8px; }
.mm-sec { border-bottom:1px solid var(--line); }
.mm-sec summary { display:flex; align-items:center; gap:6px; padding:8px 4px; cursor:pointer; }
.mm-sec summary > span:first-child { flex:1; }
.mm-sec[open] summary { font-weight:600; }
.mm-sec-body { padding:0 4px 10px; font-size:14px; }
.mm-pin { border:1px solid transparent; background:none; border-radius:6px; cursor:pointer; opacity:.45; padding:0 4px; font:inherit; }
.mm-pin:hover, .mm-pin.is-on { opacity:1; }
.mm-pin.is-on { border-color:var(--accent); background:var(--subtle); }

.mm-area { grid-area:board; min-width:0; display:flex; flex-direction:column; gap:6px; padding:8px 12px 12px; }   /* tight rows: banner, shelf, docks, board (Stephen, 2026-10-26) */
/* MTG-35, MTG-40: the board and the top and bottom docks are packed as columns (meeting-manager.js sets each panel's
   place and width): a panel sits right under what is in its column, whatever the other columns hold */
.mm-board, .mm-dock-top, .mm-dock-bottom { position:relative; }
.mm-board > .mm-panel, .mm-dock-top > .mm-panel, .mm-dock-bottom > .mm-panel { position:absolute; box-sizing:border-box; }
.mm-board { flex:1; min-width:0; max-width:none; margin:0; padding:0; min-height:120px; }
.mm-dropline { position:absolute; height:4px; border-radius:2px; background:var(--accent); pointer-events:none; z-index:5; }
.mm-mid { display:flex; align-items:flex-start; gap:12px; min-width:0; }
.mm-dock-top { position:sticky; top:calc(var(--top-h, 50px) + var(--mm-top-h, 0px) + var(--mm-banner-h, 0px) + var(--mm-shelf-h, 0px)); z-index:6; background:var(--bg); box-shadow:0 4px 0 var(--bg), 0 -4px 0 var(--bg); }
.mm-dock-bottom { position:sticky; bottom:0; z-index:6; background:var(--bg); box-shadow:0 4px 0 var(--bg), 0 -4px 0 var(--bg); }
.mm-dock-left, .mm-dock-right { flex:0 0 var(--mm-side-w, 340px); display:flex; flex-direction:column; gap:12px; position:sticky; top:calc(var(--top-h, 50px) + var(--mm-top-h, 0px) + var(--mm-banner-h, 0px) + 8px);
  max-height:calc(100vh - var(--top-h, 50px) - var(--mm-top-h, 0px) - var(--mm-banner-h, 0px) - 16px); overflow-y:auto;
  min-height:calc(100vh - var(--top-h, 50px) - var(--mm-top-h, 0px) - var(--mm-banner-h, 0px) - 16px); }   /* the whole height: the space under its panels takes a drop too */
.mm-dock.is-empty { display:none; }
/* while a panel is dragged, each empty edge shows as a thin strip over the board, where it can be docked; laid over,
   not added, so nothing under the pointer moves during the drag */
.mm-area { position:relative; }
.mm-area.is-dragging .mm-dock.is-empty { display:flex; align-items:center; justify-content:center; position:absolute; z-index:9; height:auto;
  border:2px dashed var(--accent); border-radius:8px; background:var(--card); opacity:.85; color:var(--muted); font-size:12px; }
.mm-area.is-dragging .mm-dock.is-empty::after { content:attr(aria-label); }
.mm-area.is-dragging .mm-dock-top.is-empty { top:calc(var(--mm-shelf-h, 0px) + 10px); left:12px; right:12px; height:28px; }   /* under the shelf, not behind it */
.mm-area.is-dragging .mm-dock-bottom.is-empty { bottom:0; left:12px; right:12px; height:28px; position:fixed; }
.mm-area.is-dragging .mm-dock-left.is-empty, .mm-area.is-dragging .mm-dock-right.is-empty { top:40px; width:28px; height:240px; writing-mode:vertical-rl; }
.mm-area.is-dragging .mm-dock-left.is-empty { left:0; } .mm-area.is-dragging .mm-dock-right.is-empty { right:0; }
.mm-area.is-dragging .mm-dock.is-empty.is-over-end { background:var(--stage-now-bg); opacity:1; }
.mm-area .is-over-end { outline:2px dashed var(--accent); outline-offset:2px; }
.mm-panel.is-docked { box-shadow:0 2px 8px rgb(0 0 0 / .12); }
.mm-panel { background:var(--card); border:1px solid var(--line); border-radius:8px; }
.mm-panel.is-pin { border-top:3px solid var(--accent); }
.mm-panel.is-dragging { opacity:.5; }
.mm-panel.is-over { box-shadow:0 -4px 0 var(--accent); }
.mm-ph { display:flex; align-items:center; gap:6px; padding:6px 8px; border-bottom:1px solid var(--line); background:var(--subtle); border-radius:8px 8px 0 0; cursor:grab; }
.mm-panel.is-collapsed .mm-ph { border-bottom:0; border-radius:8px; }
.mm-panel.is-collapsed .mm-pb { display:none; }
.mm-panel.is-collapsed [data-fold] { transform:rotate(-90deg); }
.mm-grip { color:var(--muted); }
.mm-h { margin:0; font-size:15px; flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mm-h3 { margin:12px 0 4px; font-size:14px; }
.mm-pbtns { display:flex; gap:2px; }
/* the width, dock and move controls sit on the title row while the pointer or keyboard focus is on it (Stephen,
   2026-10-14: "the hover controls should be moved onto the title row"); the title shortens with … meanwhile, keeping its
   first letters. Hidden visually otherwise, not from the keyboard: Tab reaches them and focusing one shows them */
.mm-xtra { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.mm-ph:is(:hover, :focus-within) .mm-xtra { position:static; width:auto; height:auto; overflow:visible; clip:auto; display:flex; align-items:center; gap:1px; }
@media (hover: none) { .mm-xtra { position:static; width:auto; height:auto; overflow:visible; clip:auto; display:flex; } }
.mm-ph .mm-h { min-width:3.5em; }
.mm-grip { flex:none; }   /* stays in view on hover (Stephen, 2026-10-24: the title mustn't shift) */
.mm-xtra .mm-ib { padding:2px 4px; font-size:12px; }
.mm-spans { display:inline-flex; gap:0; border:1px solid var(--line); border-radius:5px; padding:0 1px; margin-right:2px; }
.mm-span { padding:1px 4px; } .mm-span[aria-pressed="true"] { background:var(--accent); color:var(--accent-fg); }
.mm-span[disabled] { opacity:.35; cursor:default; }
select.mm-ib { appearance:auto; padding:1px 0; width:4.2em; }
.mm-xtra > *, .mm-pbtns > * { flex:none; }
/* a panel too narrow for both (one column of four): the controls take the title row while the pointer is on it */
.mm-panel { container-type:inline-size; }
@container (max-width: 340px) { .mm-ph:is(:hover, :focus-within) .mm-h { display:none; } .mm-ph:is(:hover, :focus-within) .mm-pbtns { margin-left:auto; } }
.mm-ib { font:inherit; font-size:13px; line-height:1; padding:3px 5px; border:1px solid transparent; border-radius:4px; background:none; color:var(--muted); cursor:pointer; }
.mm-ib:hover { border-color:var(--line); color:var(--fg); background:var(--card); }
.mm-pb { padding:10px 12px; max-height:60vh; overflow-y:auto; font-size:15px; }
.mm-pb.is-sized { max-height:none; }   /* a height dragged by the user wins */
.mm-resize { height:8px; cursor:ns-resize; border-top:1px solid var(--line); border-radius:0 0 8px 8px; background:var(--subtle); }
.mm-resize::after { content:''; display:block; width:36px; height:2px; margin:3px auto 0; border-top:1px solid var(--muted); border-bottom:1px solid var(--muted); opacity:.6; }
.mm-resize:hover, .mm-resize:focus-visible { background:var(--stage-now-bg); }
.mm-panel.is-collapsed .mm-resize { display:none; }
/* the contact panel collapses to a strip (MTG-35) */
.mm-grid.side-closed { grid-template-columns:60px 0 minmax(0, 1fr); }   /* room for the icons' count pills (Stephen, 2026-10-28: "This should just be a fixed width when collapsed and never need a scroll bar") */
.mm-grid.side-closed .mm-side { overflow-x:hidden; }
.mm-grid.side-closed .mm-side { border-right:1px solid var(--line); }
/* Stephen, 2026-10-25: the border between the contact panel and the board, dragged to resize it */
.mm-vsplit { grid-area:split; align-self:stretch;   /* the row's height: it never makes the page taller than the board */
  cursor:col-resize; touch-action:none; background:linear-gradient(to right, transparent 4px, var(--line) 4px, var(--line) 5px, transparent 5px); }
.mm-vsplit:is(:hover, :focus-visible, .is-dragging) { background:linear-gradient(to right, transparent 2px, var(--accent) 2px, var(--accent) 7px, transparent 7px); outline:none; }
.mm-grid.side-closed .mm-vsplit { display:none; }
.mm-grid.side-closed .mm-side { padding:8px 6px; }
.mm-grid.side-closed .mm-side-head > :not(.mm-side-fold) { display:none; }


.mm-path { display:flex; flex-wrap:wrap; gap:4px; list-style:none; padding:0; margin:0 0 8px; font-size:12px; }
.mm-path li { padding:1px 8px; border-radius:999px; background:var(--subtle); color:var(--muted); }
.mm-path li[aria-current] { background:var(--stage-now-bg); color:var(--fg); font-weight:600; }
.mm-say { border-left:4px solid var(--accent); background:var(--subtle); padding:8px 12px; border-radius:0 6px 6px 0; font-size:17px; }
/* MTG-47: the formatted-text box (the call script's "What to say") and collapsible script blocks */
.hbox { border:1px solid var(--line); border-radius:6px; background:var(--entry); }
.hbox-bar { display:flex; flex-wrap:wrap; gap:4px; padding:4px; border-bottom:1px solid var(--line); background:var(--subtle); border-radius:6px 6px 0 0; position:sticky; top:var(--top-h, 50px); z-index:2; }
.hbox-area { min-height:12em; max-height:none; overflow:auto; resize:vertical; padding:8px 10px; color:var(--fg); line-height:1.5; outline:none; }
.hbox-mark { position:fixed; width:1px; pointer-events:none; }
.hbox-area .mchip { cursor:default; }
.hbox-area:focus-visible { box-shadow:inset 0 0 0 2px var(--accent); }
.hbox-area :is(p, ul, ol, h1, h2, h3) { margin:0 0 .6em; }
.mt-block > summary { cursor:pointer; list-style:none; }
.mt-block > summary::-webkit-details-marker { display:none; }
.mt-block > summary h4 { display:flex; align-items:center; gap:8px; margin:0; }
.mt-block > summary h4::before { content:'▸'; color:var(--muted); transition:transform .15s; }
.mt-block[open] > summary h4::before { transform:rotate(90deg); }
.mt-block[open] > summary { margin-bottom:8px; }
.mm-say :is(p, ul, ol, h1, h2, h3) { margin:0 0 .5em; }
.mm-say > :last-child { margin-bottom:0; }
/* MTG-48: the call script as a map */
.mt-view { margin:0 0 8px; }   /* .seg gives the look */
.sm-wrap { overflow:auto; max-height:75vh; border:1px solid var(--line); border-radius:8px; background:var(--subtle); }
.sm-canvas { position:relative; }
.sm-svg { position:absolute; left:0; top:0; }
.sm-edge { fill:none; stroke:var(--muted); stroke-width:1.6; }
.sm-loop { stroke-dasharray:5 4; }
.sm-edge.sm-dyn { stroke:var(--accent); stroke-dasharray:2 4; stroke-width:2; }
.sm-arrowhead { fill:var(--muted); }
.sm-label rect { fill:var(--card); stroke:var(--line); }
.sm-label text { fill:var(--fg); font-size:11px; }
.sm-node { position:absolute; box-sizing:border-box; display:flex; flex-direction:column; gap:2px; padding:8px 10px; text-align:left; overflow:hidden;
  background:var(--card); color:var(--fg); border:1px solid var(--line); border-radius:8px; font:inherit; cursor:pointer; box-shadow:0 1px 3px rgb(0 0 0 / .08); }
.sm-node:is(:hover, :focus-visible) { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent); outline:none; }
.sm-node strong { font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sm-node small { color:var(--muted); font-size:12px; line-height:1.3; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.sm-node.is-start { border:2px solid var(--accent); }
.sm-node.is-unreached { border-style:dashed; }
.sm-node.is-dynamic { border-left:4px solid var(--accent); }
.sm-svtag { background:var(--subtle); color:var(--fg); border:1px solid var(--accent); }
.sm-tag { display:inline-block; padding:0 6px; border-radius:999px; background:var(--accent); color:var(--accent-fg); font-size:11px; font-weight:600; }
.sm-endtag { position:absolute; right:6px; bottom:6px; background:var(--subtle); color:var(--fg); border:1px solid var(--line); }
.sm-unreached { position:absolute; margin:0; font-size:12px; font-weight:600; color:var(--muted); }
/* MTG-49: the call script's You / Contact parts; Back on the left, the choices on the right */
.mm-part { margin:8px 0 4px; font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.mm-choices { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:12px; }
.mm-next { margin-left:auto; display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.mm-ask { border-left:4px solid var(--line); padding:4px 0 4px 12px; }
.mm-ask-row { margin:0 0 8px; }
.mm-ask-row :is(input, select, textarea) { width:100%; box-sizing:border-box; }
.mm-ans-multi { display:flex; flex-wrap:wrap; gap:4px 12px; }
.mt-asks { list-style:none; padding:0; margin:4px 0 8px; display:flex; flex-direction:column; gap:6px; }
.mt-asks li { display:flex; align-items:center; gap:8px; }
.mt-asks li input { flex:1; }
.mt-asks li { flex-wrap:wrap; }
.mchip-btn { font:inherit; font-size:.9em; padding:2px 6px; }   /* MTG-49c: opens the field's editor */
.mt-fedit { flex:1 1 100%; }
.mt-fedit .fe-opt, .mt-fedit .fe-new { display:block; width:100%; box-sizing:border-box; margin:0 0 6px; }
.mt-ask-add { width:100%; box-sizing:border-box; }
.mt-newfield .card { margin-top:8px; }
/* MTG-50: the survey blocks that matched, at the top of the Call script panel; and the editor's survey panel */
.mm-fromsv { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:0 0 8px; padding:6px 8px; border-radius:6px; background:var(--subtle); }
.mm-fromsv-h { font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); margin-right:4px; }
.mm-fromsv-b[aria-pressed="true"] { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.mm-next .btn.mm-dyn { border-style:dashed; border-color:var(--accent); }   /* MTG-50b: a choice a dynamic block brought in */
.mt-place { border:1px solid var(--line); border-radius:6px; padding:8px 10px; }
.mt-timer { border:1px solid var(--line); border-radius:6px; padding:8px 10px; }
.mt-timer.is-off .grid { opacity:.55; }
.mt-survey { margin-top:16px; border-top:3px solid var(--accent); }
.mt-sblock { border-left:3px solid var(--accent); }
/* The Call script's top row (Stephen, 2026-10-23): Back, the title and the next buttons left; the block timer (MTG-53)
   in the middle; All blocks and Path right */
.mm-scriptrow { display:flex; flex-wrap:wrap; align-items:flex-end; gap:8px 12px; margin:0 0 8px; }
.mm-scriptrow .mm-choices { flex:1 1 260px; display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:0; }
.mm-scriptrow .mm-next { margin-left:0; display:inline-flex; flex-wrap:wrap; gap:6px; }
.mm-btitle { font-size:15px; }
.mm-sr-mid { flex:1 1 220px; display:flex; justify-content:center; }
.mm-sr-mid:empty { display:none; }
.mm-scripttools { flex:1 1 auto; display:flex; flex-wrap:wrap; gap:6px; align-items:center; justify-content:flex-end; margin:0; }
.mm-btimer { width:220px; padding-top:30px; }
.mm-btimer .mm-prog-bar { position:relative; }
.mm-bt-min { position:absolute; top:-2px; bottom:-2px; width:2px; margin-left:-1px; background:var(--fg); opacity:.55; }
.mm-bt-min[hidden] { display:none; }
.mm-btimer.is-under .mm-prog-fill { background:var(--muted); }
.mm-btimer.is-under .mm-prog-bub { background:var(--subtle); color:var(--fg); }
.mm-btimer.is-frozen .mm-prog-bub { font-weight:600; font-style:italic; }
.mm-scripttools .mm-fly { margin:0; }
.mm-path-btn[aria-pressed="true"] { background:var(--accent); color:var(--accent-fg); border-color:var(--accent); }
.mm-ans-st { color:var(--muted); }
/* MTG-51: Captured in meeting */
.mm-cap-h { margin:10px 0 4px; font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.mm-cap-h:first-child { margin-top:0; }
.mm-cap { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px; }
.mm-cap li { padding:4px 8px; border-radius:6px; background:var(--subtle); }
.mm-cap .badge { margin-right:4px; }
/* MTG-46: the call script's flyout of every block (hover or focus opens it; leaving closes it) */
.mm-fly { display:inline-block; margin:0 0 6px; }
.mm-fly-list { position:fixed; z-index:30; box-sizing:border-box; padding:6px; overflow-y:auto; background:var(--card); color:var(--fg);
  border:1px solid var(--line); border-radius:8px; box-shadow:0 6px 18px rgb(0 0 0 / .18); }
.mm-fly-item { display:block; width:100%; text-align:left; padding:6px 8px; border:0; border-radius:6px; background:none; color:var(--fg); font:inherit; font-size:14px; cursor:pointer; }
.mm-fly-item:is(:hover, :focus-visible) { background:var(--subtle); }
.mm-fly-item:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.mm-fly-item[aria-current] { font-weight:600; box-shadow:inset 3px 0 0 var(--accent); }
.mm-fly-item small { display:block; color:var(--muted); font-weight:400; font-size:12px; margin-top:2px; }
.mm-say p { margin:0; }
.mm-choices { display:flex; gap:6px; flex-wrap:wrap; }

.mm-checks { list-style:none; padding:0; margin:0; }
.mm-checks > li { padding:3px 0; }
.mm-subs { list-style:none; margin:2px 0 6px 24px; padding:0 0 0 8px; border-left:2px solid var(--line); }
.mm-offer { margin:0 0 6px 24px; color:var(--muted); }
.mm-notes { width:100%; box-sizing:border-box; font:inherit; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); resize:vertical; }

.mm-zm { border:1px solid var(--line); border-radius:6px; margin:0 0 8px; }
.mm-zm .check { display:block; }
.mm-lt { width:100%; font-size:14px; }

.mm-sbar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:6px; }
.mm-sbar .check { white-space:nowrap; }
.mm-sbar input[type="search"] { flex:1 1 140px; min-width:0; font:inherit; padding:4px 8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.mm-lines { list-style:none; padding:0; margin:0; max-height:260px; overflow-y:auto; border:1px solid var(--line); border-radius:6px; }
.mm-line { display:block; width:100%; text-align:left; font:inherit; font-size:14px; padding:4px 8px; border:0; background:none; color:var(--fg); cursor:pointer; }
.mm-line:hover { background:var(--subtle); }
.mm-lines li.is-marked .mm-line { background:var(--mark); }
.mm-t { font-variant-numeric:tabular-nums; color:var(--muted); font-size:12px; }
.mm-marks { padding-left:18px; margin:0; font-size:14px; }

/* Stephen, 2026-10-25: objects with their common actions (object-actions.js): tick, title (opens it in the CRM), edit */
.mm-obj-add { margin:0 0 6px; }
.mm-objs { list-style:none; margin:0; padding:0; }
.mm-obj { display:grid; grid-template-columns:auto minmax(0, 1fr) auto; align-items:start; gap:6px; padding:5px 0; border-bottom:1px solid var(--line); }
.mm-obj:last-child { border-bottom:0; }
.mm-obj-tick { margin:4px 0 0; width:16px; height:16px; }
.mm-obj-main { display:flex; flex-direction:column; gap:1px; min-width:0; }
.mm-obj-t { font-weight:600; overflow-wrap:anywhere; }
.mm-task.is-done .mm-obj-t { text-decoration:line-through; color:var(--muted); font-weight:400; }
.mm-obj .choices { margin-top:4px; display:flex; flex-wrap:wrap; gap:4px; }
.mm-obj-edit { width:26px; height:26px; }
.mm-list { list-style:none; padding:0; margin:0; }
.mm-list li { padding:4px 0; border-bottom:1px solid var(--line); }
.mm-dl { display:grid; grid-template-columns:auto minmax(0, 1fr); gap:2px 10px; margin:0; }
.mm-dl dt { color:var(--muted); }
.mm-dl dd { margin:0; overflow-wrap:anywhere; }

.mm-dlg { width:min(640px, calc(100vw - 32px)); max-height:calc(100vh - 48px); overflow-y:auto; color:var(--fg); }
.mm-dlg::backdrop { background:rgb(0 0 0 / .4); }
.mm-email { white-space:pre-wrap; font:inherit; background:var(--subtle); padding:10px; border-radius:6px; }
.mm-log { font-size:13px; }

@media (max-width: 900px) {
  .mm-grid { grid-template-columns:minmax(0, 1fr); grid-template-areas:"top" "result" "side" "board"; }
  .mm-side { position:static; max-height:none; border-right:0; border-bottom:1px solid var(--line); }
  .mm-vsplit { display:none; }
  .mm-mid { flex-direction:column; } .mm-dock-left, .mm-dock-right { position:static; flex-basis:auto; max-height:none; min-height:0; width:100%; }
  .mm-grid.side-closed { grid-template-columns:minmax(0, 1fr); }
  .mm-grid.side-closed .mm-side { border-right:0; }
  .mm-acts { margin-left:0; }
}
.tk-launch { text-decoration:none; color:var(--accent); } .tk-launch span { font-size:13px; }
.cd-meet { margin-bottom:12px; padding:12px 16px; } .cd-meet .cd-meet-h { font-size:17px; margin:0; }
/* SEC-09: the standing "no health details" line on the Notes and Calls editors and the Meeting Manager's Call notes */
.phi-line { display:block; color:var(--warn); font-size:13px; margin:0 0 4px; }
/* MTG-32: the meeting in the top bar */
.top-meet { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border:1px solid var(--line); border-radius:999px; background:var(--subtle); color:var(--fg); text-decoration:none; font-size:14px; white-space:nowrap; max-width:42vw; overflow:hidden; }
.top-meet[hidden] { display:none; }
.top-meet .tm-w { overflow:hidden; text-overflow:ellipsis; }
.top-meet .tm-t { font-weight:700; font-variant-numeric:tabular-nums; }
.top-meet .tm-dot { width:8px; height:8px; border-radius:50%; background:var(--warn); flex:none; }
.top-meet.is-live { border-color:var(--ok); } .top-meet.is-live .tm-dot { background:var(--ok); } .top-meet.is-live .tm-t { color:var(--ok); }
.top-meet:hover { border-color:var(--accent); }
@media (max-width:600px) { .top-meet { max-width:none; order:4; } }
/* MTG-34: the contact's notes as an accordion */
.mm-notes-list { list-style:none; margin:0; padding:0; }
.mm-note { border-bottom:1px solid var(--line); }
.mm-note-h { display:grid; grid-template-columns:auto minmax(0, 1fr); column-gap:6px; width:100%; text-align:left; font:inherit; padding:6px 4px; border:0; background:none; color:var(--fg); cursor:pointer; }
.mm-note-h small { grid-column:2; }
.mm-note-h:hover, .mm-note.is-open .mm-note-h { background:var(--subtle); }
.mm-note-h .mm-note-t { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mm-note-h::before { content:'▸'; color:var(--muted); } .mm-note.is-open .mm-note-h::before { content:'▾'; }
.mm-note-b { padding:4px 4px 10px 18px; } .mm-note-b .mm-body-txt { white-space:pre-wrap; overflow-wrap:anywhere; color:var(--fg); font-size:14px; margin-bottom:8px; }
/* MTG-37: "Not started": a red border on a red background that pulses (steady when the system asks for less motion) */
@keyframes mtg-pulse { 0%, 100% { background:var(--bad-bg); } 50% { background:var(--card); } }
.mtg-count { text-decoration:none; color:inherit; }
a.mtg-count:hover { border-color:var(--accent); }
.mtg.is-late .mtg-count, .mtg-st.is-late, .top-meet.is-late, .mm-clock.is-late { border:2px solid var(--bad); background:var(--bad-bg); color:var(--bad); animation:mtg-pulse 1.6s ease-in-out infinite; }
.mtg.is-late .mtg-count b, .mtg.is-late .mtg-count small, .mm-clock.is-late .mm-cl-l, .mm-clock.is-late .mm-cl-v, .top-meet.is-late .tm-t { color:var(--bad); }
.top-meet.is-late .tm-dot { background:var(--bad); }
.mtg-st { text-decoration:none; } .mtg-st.is-live { border:1px solid var(--ok); color:var(--ok); }
@media (prefers-reduced-motion: reduce) { .mtg.is-late .mtg-count, .mtg-st.is-late, .top-meet.is-late, .mm-clock.is-late { animation:none; } }
/* MTG-38: the call's progress, start to end, with a bubble over where it is: yellow from 10 minutes left, red from 5 */
.mm-prog { --p:0%; display:flex; flex-direction:column; justify-content:flex-end; width:220px; max-width:100%; padding-top:30px; position:relative; }
.mm-prog[hidden] { display:none; }
.mm-prog-bar { display:block; height:8px; border-radius:4px; background:var(--subtle); border:1px solid var(--line); overflow:hidden; }
.mm-prog-fill { display:block; height:100%; width:var(--p); background:var(--ok); }
.mm-prog-ends { display:flex; justify-content:space-between; color:var(--muted); font-size:12px; margin-top:2px; }
.mm-prog-bub { position:absolute; top:0; left:var(--bx, var(--p)); transform:translateX(-50%); white-space:nowrap; font-size:12px; font-weight:700;
  padding:2px 8px; border-radius:6px; border:1px solid var(--line); background:var(--card); color:var(--fg); }
/* the arrow is its own mark at the exact point; the bubble stays within the bar's width (Stephen: at the start they parted) */
.mm-prog-tip { position:absolute; top:21px; left:var(--p); transform:translateX(-50%); width:0; height:0; border:6px solid transparent; border-bottom:0; border-top-color:var(--line); }
.mm-prog.is-warn .mm-prog-bub { background:var(--mark); border-color:var(--warn); color:var(--fg); }
.mm-prog.is-warn .mm-prog-tip { border-top-color:var(--warn); }
.mm-prog.is-warn .mm-prog-fill { background:var(--warn); }
.mm-prog.is-bad .mm-prog-bub { background:var(--bad-bg); border-color:var(--bad); color:var(--bad); }
.mm-prog.is-bad .mm-prog-tip { border-top-color:var(--bad); }
.mm-prog.is-bad .mm-prog-fill { background:var(--bad); }
/* MTG-41: a template's site in a panel */
.mm-pb.mm-site { display:flex; flex-direction:column; gap:6px; height:480px; padding:6px 8px; }
.mm-pb.mm-site.is-sized { height:auto; }
.mm-site-bar { display:flex; align-items:center; gap:6px; margin:0; } .mm-site-bar small { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mm-site-frame { flex:1; width:100%; box-sizing:border-box; min-height:120px; border:1px solid var(--line); border-radius:6px; background:var(--card); }
.mm-site-note { margin:0; display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
/* MTG-42, MTG-43: a pill per call under way, then the next; the ones after the first a little quieter */
.top-meets { display:inline-flex; align-items:center; gap:6px; min-width:0; overflow:hidden; }
.top-meet-n { font-size:13px; max-width:26vw; }
.top-meet-n:not(.is-late):not(.is-live) { background:var(--card); }
@media (max-width:900px) { .top-meet-n { display:none; } }
/* ==== MTG END ==== */
/* UI-13: the [[ field list, for any text box */
.fs-pop { position:fixed; z-index:60; list-style:none; margin:0; padding:4px; width:320px; max-height:280px; overflow-y:auto;
  background:var(--card); border:1px solid var(--line); border-radius:8px; box-shadow:0 6px 18px rgb(0 0 0 / .18); font-size:14px; }
.fs-pop li { display:flex; justify-content:space-between; gap:8px; padding:4px 8px; border-radius:5px; cursor:pointer; }
.fs-pop li small { color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fs-pop li.is-on, .fs-pop li:hover { background:var(--stage-now-bg); }
.fs-pop .fs-none { color:var(--muted); cursor:default; }

/* Settings → Zoom → Events (Stephen, 2026-10-21): filters, sortable headers, a pager above and below */
.zm-ev-filters { flex-wrap:wrap; align-items:flex-end; gap:12px; }
.zm-ev-filters .field { min-width:180px; margin:0; }
.th-sort { font:inherit; font-weight:700; color:var(--fg); background:none; border:0; padding:2px 0; cursor:pointer; white-space:nowrap; }
.th-sort:hover, .th-sort:focus-visible { color:var(--accent); }
.zm-ev-pager { flex-wrap:wrap; margin:8px 0; }
.zm-ev-pager label { display:inline-flex; gap:6px; align-items:center; }

/* Settings → Stripe (STR, Stephen 2026-10-21): a live-mode event is flagged (NON-PHI until Gate B, rule 38) */
.st-live-note { border:2px solid var(--bad); background:var(--bad-bg); color:var(--fg); padding:8px 12px; border-radius:6px; }
.st-live { color:var(--bad); }

/* Stage card (Stephen, 2026-10-21): a Done box before each open task of the current stage */
.sc-tick { margin:0 6px 0 0; vertical-align:middle; width:16px; height:16px; }

/* Home → My meetings: Mine | Everyone's (Stephen, 2026-10-21) */
.mtg-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
/* Stephen, 2026-10-23: an open script block, its contents indented, Title on one line, then sections that fold */
.mt-bbody { padding-left:5ch; }
@media (max-width: 600px) { .mt-bbody { padding-left:2ch; } }
.mt-titlerow { display:flex; align-items:center; gap:12px; margin:8px 0 10px; }
.mt-titlerow label { font-weight:600; flex:none; }
.mt-titlerow input { flex:1; min-width:0; }
.mt-bsec { border:1px solid var(--line); border-radius:6px; margin:0 0 8px; background:var(--card); }
.mt-bsec > summary { padding:8px 10px; cursor:pointer; display:flex; align-items:baseline; gap:8px; min-width:0; }
.mt-bsec > summary::before { content:'▸'; color:var(--muted); flex:none; }
.mt-bsec[open] > summary::before { content:'▾'; }
.mt-bsec > summary::-webkit-details-marker { display:none; }
.mt-bsec-h { font-weight:600; flex:none; }
.mt-bsec-hint { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.mt-bsec[open] .mt-bsec-hint { display:none; }
.mt-bsec-body { padding:0 12px 10px; }
.mt-bsec .mt-timer, .mt-bsec .mt-place { border:0; padding:0; }
/* the call script's text box wears the email editor's toolbar (be-bar, be-ib) */
.hbox-bar.be-bar { gap:4px 8px; padding:4px 6px; }
.hbox-code { display:block; width:100%; box-sizing:border-box; min-height:12em; border:0; padding:8px 10px; resize:vertical; font:13px/1.5 ui-monospace, Menlo, Consolas, monospace; background:var(--entry); color:var(--fg); }
.mt-bsec-body > .help, .mt-bsec-body .mt-timer > .help, .mt-bsec-body .mt-place > .help { display:block; color:var(--muted); font-size:13px; margin:0 0 6px; }
.mt-titlerow.field { margin:8px 0 10px; }
/* MTG-55: the script tested in the template editor, in a Call script panel like the Meeting Manager's */
.st-wrap { display:grid; gap:10px; }
.st-head p { margin:0 0 6px; }
.st-dyn { border:1px solid var(--line); border-radius:6px; padding:6px 10px; display:flex; flex-wrap:wrap; gap:4px 16px; }
.st-panel { max-width:960px; }
.st-panel .mm-ph { cursor:default; }
.st-panel .mm-ph h3 { margin:0; font-size:15px; }
.st-panel .mm-pb { padding:10px 12px; }
.st-jump select { font:inherit; font-size:13px; line-height:1.3; height:auto; min-height:30px; padding:4px 8px; box-sizing:border-box; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }   /* sized to its words (Stephen, 2026-10-26: "cutting off 'all blocks'") */
.mt-name { margin:0 0 12px; max-width:40em; } .mt-name label { font-weight:600; }   /* the template name, above its sections */
/* MTG-55: Test opens in a panel on the right of the template editor, which makes room for it */
.st-drawer { position:fixed; z-index:30; right:0; top:var(--top-h, 50px); bottom:0; width:var(--st-w, min(620px, 46vw)); box-sizing:border-box; overflow-y:auto;
  background:var(--bg); border-left:3px solid var(--accent); box-shadow:-6px 0 18px rgb(0 0 0 / .14); }
.st-dhead { position:sticky; top:0; z-index:1; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 14px; background:var(--card); border-bottom:1px solid var(--line); }
.st-dhead h2 { margin:0; font-size:17px; }
.st-dbody { padding:12px 14px; display:grid; gap:12px; }
.st-top { display:grid; gap:4px; }
.st-top > label { font-weight:600; }
.st-top .help { color:var(--muted); font-size:13px; }
.st-who { margin:0; font-size:13px; color:var(--muted); }
body.mt-testing #view { margin-right:var(--st-w, min(620px, 46vw)); }
@media (max-width: 900px) { .st-drawer { width:100%; } body.mt-testing #view { margin-right:0; } .st-resize { display:none; } }
/* MTG-57: the script box's second toolbar row and its images, dividers and tables (in the editor and on the call) */
.hbox-tools { position:sticky; top:var(--top-h, 50px); z-index:2; background:var(--subtle); border-bottom:1px solid var(--line); border-radius:6px 6px 0 0; }
.hbox-tools .hbox-bar { position:static; border-bottom:0; border-radius:0; }
.hbox-bar2.be-bar { position:static; gap:4px 8px; padding:2px 6px 4px; background:none; border-bottom:0; }
.hbox-img { border-bottom:1px solid var(--line); padding:8px 10px; background:var(--card); }
.hbox-img-h { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 8px; }
.hbox-img-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(88px, 1fr)); gap:6px; max-height:240px; overflow-y:auto; }
.hbox-img-it { padding:2px; border:1px solid var(--line); border-radius:6px; background:var(--subtle); cursor:pointer; height:80px; display:flex; align-items:center; justify-content:center; }
.hbox-img-it:is(:hover, :focus-visible) { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent); }
.hbox-img-it img { max-width:100%; max-height:100%; }
:is(.hbox-area, .mm-say) img { max-width:100%; height:auto; }
:is(.hbox-area, .mm-say) hr { border:0; border-top:1px solid var(--line); margin:12px 0; }
:is(.hbox-area, .mm-say) table { border-collapse:collapse; margin:0 0 .6em; }
:is(.hbox-area, .mm-say) :is(td, th) { border:1px solid var(--line); padding:4px 8px; min-width:4em; vertical-align:top; }
/* Stephen, 2026-10-24: a docked top or bottom row shows its edge while it stays on screen (the board scrolls under it), and
   one taller than 40% of the window scrolls with the page instead (meeting-manager.js fitDocks) */
.mm-dock-top:not(.is-empty):not(.is-tall) { border-bottom:2px solid var(--line); padding-bottom:8px; }
.mm-dock-bottom:not(.is-empty):not(.is-tall) { border-top:2px solid var(--line); padding-top:8px; }
.mm-dock-top.is-tall, .mm-dock-bottom.is-tall { position:relative; top:auto; bottom:auto; box-shadow:none; }

/* Stephen, 2026-10-24: a collapsed panel opens while hovered or focused, laid OVER what's below it (nothing moves) */
.mm-dock-left > .mm-panel, .mm-dock-right > .mm-panel, .mm-shelf > .mm-panel { position:relative; }
.mm-panel.is-collapsed.is-peek { z-index:40; }
.mm-panel.is-collapsed.is-peek > .mm-pb { display:block; position:absolute; left:-1px; right:-1px; top:100%; z-index:40; box-sizing:border-box;
  max-height:var(--peek-max, 60vh); overflow-y:auto; background:var(--card); border:1px solid var(--accent); border-top:0; border-radius:0 0 8px 8px;
  box-shadow:0 10px 28px rgb(0 0 0 / .22); }
.mm-panel.is-collapsed.is-peek > .mm-ph { border-color:var(--accent); }
.mm-panel.is-collapsed.is-peek > .mm-resize { display:none; }
/* the shelf: a bar at the top of the board; a panel dropped on it is kept collapsed there, as a chip that opens on hover */
.mm-shelf { position:sticky; top:calc(var(--top-h, 50px) + var(--mm-top-h, 0px) + var(--mm-banner-h, 0px)); z-index:8; display:flex; flex-wrap:wrap; align-items:center; gap:6px;
  min-height:30px; padding:3px 6px; margin:0; background:var(--subtle); border:1px dashed var(--line); border-radius:8px; }
.mm-dock.mm-shelf.is-empty { display:flex; }
.mm-shelf.is-empty::before { content:'Shelf: drag a panel here to keep it collapsed up here; hover it to read it'; color:var(--muted); font-size:13px; }
.mm-area.is-dragging .mm-shelf { border-color:var(--accent); background:var(--stage-now-bg); }
.mm-shelf.is-over-end { box-shadow:inset 0 0 0 2px var(--accent); }
.mm-shelf > .mm-panel { container-type:normal; width:auto; max-width:280px; border-radius:6px; }   /* a chip sizes to its title (a size container would be 0 wide) */
.mm-shelf > .mm-panel > .mm-ph { border-bottom:0; border-radius:6px; padding:3px 6px; }
.mm-shelf > .mm-panel .mm-xtra, .mm-shelf > .mm-panel > .mm-resize { display:none; }
.mm-shelf > .mm-panel .mm-h { flex:0 1 auto; min-width:4em; max-width:200px; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* Stephen, 2026-10-24: the folded contact panel: an icon per section; one opens its section in a fly-out to the right */
.mm-side-rail { display:none; }
.mm-grid.side-closed .mm-side-rail { display:flex; flex-direction:column; align-items:center; gap:4px; margin-top:8px; }
.mm-rail-btn { position:relative; display:flex; align-items:center; justify-content:center; width:34px; height:34px; padding:0; border:1px solid transparent; border-radius:8px;
  background:none; color:var(--fg); cursor:pointer; }
.mm-rail-btn:is(:hover, :focus-visible) { background:var(--subtle); border-color:var(--line); outline:none; }
.mm-rail-btn:focus-visible { box-shadow:0 0 0 2px var(--focus); }
.mm-rail-btn[aria-expanded="true"] { background:var(--accent); color:var(--accent-fg); }
.mm-rail-btn .badge { position:absolute; top:-4px; right:-6px; min-width:16px; padding:0 4px; font-size:10px; line-height:16px; border-radius:8px; }
.mm-flyout { position:fixed; z-index:60; overflow-y:auto; padding:0; box-shadow:0 10px 28px rgb(0 0 0 / .22); border:1px solid var(--accent); }
.mm-flyout[hidden] { display:none; }
.mm-fly-h { position:sticky; top:0; display:flex; align-items:center; gap:6px; padding:8px 10px; background:var(--subtle); border-bottom:1px solid var(--line); }
.mm-fly-h strong { flex:1; }
.mm-fly-b { padding:10px 12px; outline:none; }
/* Stephen, 2026-10-24: the call script panel. The block's name and timer in the title bar; Back and Next as coloured bars
   down each side; Your Script and Contact Collected Information each scroll on their own; the map docked beside it */
:root { --bar-back:#e0b43c; --bar-back-fg:#3a2a00; --bar-next:#1e7a70; --bar-next-fg:#ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bar-back:#b8902a; --bar-back-fg:#1b1300; --bar-next:#2fa396; --bar-next-fg:#06201d; } }
:root[data-theme="dark"] { --bar-back:#b8902a; --bar-back-fg:#1b1300; --bar-next:#2fa396; --bar-next-fg:#06201d; }
.mm-htimer-slot { display:inline-flex; align-items:center; flex:0 0 auto; margin-left:6px; }
.mm-htimer.mm-btimer { display:inline-block; width:120px; padding:0; cursor:help; }
.mm-htimer .mm-prog-bar { position:relative; display:block; }
.mm-maptog { color:var(--muted); }
.mm-maptog[aria-pressed="true"] { color:var(--accent-fg); background:var(--accent); border-color:var(--accent); }
.mm-mapdock { font-size:12px; width:auto; padding:0 6px; }
.mm-pb.mm-scriptbody { display:flex; flex-direction:column; overflow:hidden; }
.mm-pb.mm-scriptbody.has-map { flex-direction:row; gap:10px; }
.mm-sp-main { flex:1 1 60%; min-width:0; min-height:0; display:flex; flex-direction:column; }
.mm-sp-flow { display:flex; align-items:stretch; gap:8px; flex:1 1 auto; min-height:0; }
.mm-sp-center { flex:1; min-width:0; min-height:0; display:flex; flex-direction:column; }
.mm-sp-center > .mm-say { flex:1 1 auto; min-height:4em; overflow-y:auto; }
.mm-sp-center > .mm-ask { flex:0 1 auto; min-height:3em; max-height:45%; overflow-y:auto; }
.mm-bar { flex:0 0 2.2ch; display:flex; align-items:center; justify-content:center; padding:0; border:0; border-radius:6px; cursor:pointer; font:inherit; font-size:22px; font-weight:700; line-height:1; }
.mm-bar-back { background:var(--bar-back); color:var(--bar-back-fg); }
.mm-bar-next { background:var(--bar-next); color:var(--bar-next-fg); }
.mm-bar:hover:not([disabled]) { filter:brightness(1.08); outline:none; }   /* no border on hover (Stephen, 2026-10-24) */
.mm-bar:focus { outline:none; }
.mm-bar:focus-visible:not([disabled]) { box-shadow:inset 0 0 0 2px var(--focus); }   /* the keyboard still sees where it is */
.mm-bar[disabled] { opacity:.3; cursor:default; }
.mm-ask-row label .mm-ans-st { font-weight:400; color:var(--muted); }
/* the map pane: docked it takes the call script's height (it doesn't set it); its own panel, 420 px unless sized */
.mm-sp-map { flex:1 1 40%; min-width:200px; position:relative; border-left:1px solid var(--line); padding-left:10px; }
.has-map .mm-sp-map > .mm-map-in { position:absolute; inset:0 0 0 10px; }
.mm-map-in { display:flex; flex-direction:column; gap:6px; height:100%; min-height:0; }
.mm-panel[data-id="scriptmap"] > .mm-pb:not(.is-sized) { height:420px; }
.mm-panel[data-id="scriptmap"] > .mm-pb { overflow:hidden; }
.mm-map-tools { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.mm-map { flex:1 1 auto; min-height:0; }
.mm-map .sm-wrap { max-height:none; height:100%; }
/* in step with the call: the current block lit, lifted off the page; the others flat and grey */
.sm-canvas.is-live .sm-node { opacity:.45; filter:grayscale(1); box-shadow:none; transition:opacity .2s, transform .2s, box-shadow .2s; }
.sm-canvas.is-live .sm-node.is-current { opacity:1; filter:none; z-index:2; transform:scale(1.05); border:2px solid var(--accent); box-shadow:0 12px 28px rgb(0 0 0 / .32); }
.sm-canvas.is-live .sm-node:is(:hover, :focus-visible) { opacity:.85; filter:none; }
/* Stephen, 2026-10-24: the meeting's edit pencil, inside the countdown's border at the top right */
.mm-clockwrap { position:relative; display:inline-flex; }
.mm-clockwrap > .mm-clock { padding-right:30px; padding-left:30px; }
.mm-medit { position:absolute; top:4px; right:5px; width:24px; height:24px; padding:0; display:flex; align-items:center; justify-content:center;
  border:1px solid transparent; border-radius:6px; background:none; color:var(--muted); font-size:15px; line-height:1; cursor:pointer; }
.mm-medit:is(:hover, :focus-visible) { color:var(--accent); border-color:var(--line); background:var(--card); outline:none; box-shadow:0 0 0 2px var(--focus); }
.mm-medit-dlg { width:min(560px, 94vw); padding:0; }
.mm-medit-dlg .tl-form { margin:0; border:0; box-shadow:none; }

/* Stephen, 2026-10-24 (MTG-64): the bars start level with the Your Script box and fade from solid beside the script to
   nearly clear at the panel's edge, which they reach; the script's title takes at most 30 characters, so the timer sits at
   the same place; the map's tools on one line; the divider between the script and its map */
.mm-sp-center > .mm-part:first-child { margin-top:0; height:20px; line-height:20px; margin-bottom:4px; }
.mm-sp-flow > .mm-bar { margin-top:24px; }
.mm-bar-back { margin-left:-12px; flex-basis:calc(2.2ch + 12px); border-radius:0 6px 6px 0; justify-content:flex-end; padding-right:4px;
  background:linear-gradient(to left, var(--bar-back) 0%, var(--bar-back) 35%, color-mix(in srgb, var(--bar-back) 8%, transparent) 100%); }
.mm-bar-next { margin-right:-12px; flex-basis:calc(2.2ch + 12px); border-radius:6px 0 0 6px; justify-content:flex-start; padding-left:4px;
  background:linear-gradient(to right, var(--bar-next) 0%, var(--bar-next) 35%, color-mix(in srgb, var(--bar-next) 8%, transparent) 100%); }
.has-map .mm-bar-next { margin-right:0; }   /* beside the map, not the panel's edge */
.mm-panel[data-id="script"] > .mm-ph > .mm-h { flex:0 1 31ch; min-width:6ch; white-space:nowrap; overflow:hidden; text-overflow:clip; }
.mm-map-tools { flex-wrap:nowrap; gap:4px; min-width:0; }
.mm-map-tools .btn { font-size:12px; padding:2px 7px; white-space:nowrap; flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.mm-map-tools > .mm-fly { margin:0; display:inline-flex; }
.mm-map-tools .btn { margin:0; }
.mm-sp-split { flex:0 0 8px; align-self:stretch; cursor:col-resize; border-radius:4px; background:linear-gradient(to right, transparent 3px, var(--line) 3px, var(--line) 5px, transparent 5px); }
.mm-sp-split:is(:hover, :focus-visible) { background:linear-gradient(to right, transparent 2px, var(--accent) 2px, var(--accent) 6px, transparent 6px); outline:none; }
.mm-pb.mm-scriptbody.has-map { gap:4px; }
.has-map .mm-sp-map { flex:0 0 auto; border-left:0; padding-left:0; }
.has-map .mm-sp-map > .mm-map-in { inset:0; }

/* Stephen, 2026-10-24: a panel on the shelf opens as tall as its contents, up to half the page, then scrolls (its height
   from the board, if it was sized there, doesn't apply up here) */
.mm-shelf > .mm-panel.is-peek > .mm-pb { height:auto !important; max-height:min(50vh, var(--peek-max, 50vh)); }
.mm-svpick { margin:0 0 8px; } .mm-svpick select { max-width:100%; }   /* the Surveys section: which response (2026-10-24) */
/* MTG-66: frequent-topic groups (the editor) and their headings (the Meeting Manager) */
.mt-tgpick .mt-checks { display:flex; flex-wrap:wrap; gap:4px 16px; }
.mt-tg-h { margin:14px 0 6px; }
.mt-tgroup .mt-titlerow button { flex:none; }
/* Stephen, 2026-10-25: a group folds to its name and how many topics it has (folded when the editor opens) */
.mt-tgroup > summary { cursor:pointer; list-style:none; }
.mt-tgroup > summary::-webkit-details-marker { display:none; }
.mt-tgroup > summary h4 { display:flex; align-items:center; gap:8px; margin:0; }
.mt-tgroup > summary h4::before { content:'▸'; color:var(--muted); transition:transform .15s; }
.mt-tgroup[open] > summary h4::before { transform:rotate(90deg); }
.mt-tgroup[open] > summary { margin-bottom:8px; }
@media (prefers-reduced-motion: reduce) { .mt-tgroup > summary h4::before { transition:none; } }
.mm-tgh { margin:10px 0 4px; font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.mm-tgh:first-child { margin-top:0; }
/* Stephen, 2026-10-24: Go to active pulses (a soft ramp to the buttons' blue, its text to white, and back) while the
   active block is out of the map's view, and fades back to normal once it's in view again */
.mm-map-tools [data-mapactive] { transition:background-color .6s ease, color .6s ease, border-color .6s ease; }
@keyframes mm-pulse { from { background-color:var(--card); color:var(--fg); border-color:var(--line); } to { background-color:var(--accent); color:var(--accent-fg); border-color:var(--accent); } }
.mm-map-tools [data-mapactive].is-away { animation:mm-pulse 1.1s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) { .mm-map-tools [data-mapactive].is-away { animation:none; background-color:var(--accent); color:var(--accent-fg); border-color:var(--accent); } }
/* MTG-70: a V2 call script: the alert bar, the call buttons and references, the prep view, a block's parts */
.sv2-alerts { display:grid; gap:4px; margin:0 0 8px; }
.sv2-alerts[hidden] { display:none; }
.sv2-alert { padding:6px 10px; border-radius:6px; border-left:5px solid; font-size:14px; }
.sv2-alert > :last-child { margin-bottom:0; }
.sv2-alert.is-red { background:var(--bad-bg); border-color:var(--bad); color:var(--fg); font-weight:600; }
.sv2-alert.is-amber { background:var(--stage-stall-bg); border-color:var(--warn); color:var(--fg); }
.sv2-alert.is-blue { background:var(--stage-now-bg); border-color:var(--accent); color:var(--fg); }
.sp-say { margin:0 0 .6em; }
.sp-say > :last-child { margin-bottom:0; }
.sp-instr { margin:.2em 0 .7em; padding:4px 8px; border-left:4px solid var(--warn); background:var(--stage-stall-bg); font-size:.92em; font-weight:600; }
.sp-gtitle { margin:.8em 0 .3em; font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.sp-qhead { margin:.9em 0 .3em; padding-top:6px; border-top:1px solid var(--line); font-weight:700; }
.sp-bullets ul { margin:0 0 .6em; padding-left:22px; }
.sv2-prep { display:grid; gap:12px; margin:0 0 12px; }
.sv2-prep h4 { margin:0 0 6px; display:flex; align-items:center; gap:8px; }
.sv2-anstable td, .sv2-anstable th { font-size:13px; vertical-align:top; }
.sv2-sec { border:1px solid var(--line); border-radius:6px; margin:0 0 8px; padding:6px 10px; }
.sv2-item { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; padding:3px 4px; border-radius:4px; }
.sv2-item.is-sugg { background:var(--mark); }
.sv2-item.is-auto { color:var(--fg); }
.sv2-item textarea { flex:1 1 100%; font:inherit; }
.sv2-sugg { font-size:11px; font-weight:700; text-transform:uppercase; color:var(--warn); }
.sv2-hint { flex:1 1 100%; }
/* MTG-70: the template editor's V2 parts: rules data, parts (nested), rule boxes */
.v2-mono { font-family:ui-monospace, Menlo, Consolas, monospace; font-size:13px; }
.v2-sec { border:1px solid var(--line); border-radius:6px; margin:0 0 8px; background:var(--card); }
.v2-sec > summary { padding:8px 10px; cursor:pointer; }
.v2-sec-b { padding:0 12px 10px; }
.v2-row { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:flex-end; }
.v2-row > .field { margin:0; min-width:10em; flex:1 1 12em; }
.v2-f.is-wide { flex-basis:100%; }
.v2-f.is-check { flex:0 0 auto; display:flex; flex-wrap:wrap; align-items:center; gap:2px 6px; }   /* the box, its label, its help under them (Stephen, 2026-10-28) */
.v2-f.is-check > .help { flex-basis:100%; }
.v2-f input, .v2-f select, .v2-f textarea { width:100%; box-sizing:border-box; font:inherit; padding:5px 7px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.v2-f.is-check input { width:auto; }
.v2-f .v2-mono { font-size:13px; }
.v2-err:empty { display:none; }
.v2-part { border:1px solid var(--line); border-left:3px solid var(--accent); border-radius:6px; padding:6px 10px; margin:0 0 8px; background:var(--card); }
.v2-part.is-instruction { border-left-color:var(--warn); }
.v2-part.is-group, .v2-part.is-queue { border-left-color:var(--lane-notes); }
.v2-part.is-field { border-left-color:var(--lane-emails); }
.v2-part-h { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 4px; }
.v2-rowtools { display:inline-flex; gap:4px; }
.v2-nest { margin:4px 0 6px 2ch; padding-left:8px; border-left:2px dashed var(--line); }
.v2-sub { margin:6px 0 4px; font-size:12px; font-weight:700; color:var(--muted); }
.v2-add { display:flex; gap:6px; align-items:center; margin:4px 0; }
.v2-rule > .field { flex:2 1 18em; }
.v2-codes code { font-size:12px; }
.mt-cwhen { flex:1 1 100%; margin-top:6px; }   /* its rule builder, on a line of its own under the field or choice */
.mt-cwhen > .v2-rulef { margin:0; }
/* MTG-71: the format document, served from public/app/docs/ (tools/doc-html.mjs) */
.doc-page { max-width:60rem; margin:0 auto; padding:16px 16px 48px; line-height:1.55; }
.doc-page h2 { margin-top:2em; border-top:1px solid var(--line); padding-top:1em; }
.doc-page h3 { margin-top:1.5em; }
.doc-page code { font-size:.9em; background:var(--subtle); padding:1px 4px; border-radius:4px; overflow-wrap:anywhere; }
.doc-page .doc-code { overflow:auto; padding:12px; background:var(--subtle); border:1px solid var(--line); border-radius:8px; font-size:13px; line-height:1.4; }
.doc-page .doc-code code { background:none; padding:0; overflow-wrap:normal; }
.doc-page td { vertical-align:top; }
.doc-get { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
/* many call buttons fold behind a summary naming what's set; long alert stacks scroll so the script keeps its room */
.sv2-anstable { width:100%; table-layout:fixed; }
.sv2-anstable th:first-child { width:3.5em; }
.sv2-anstable td, .sv2-anstable th { overflow-wrap:anywhere; vertical-align:top; }
/* Frequent topics (Stephen, 2026-10-24): a group is its name and what's ticked in it; hovered, its topics open over the
   board below it; a topic hovered shows its details */
.mm-tg { margin:0 0 6px; }
.mm-tg-h { display:flex; align-items:center; gap:8px; width:100%; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--subtle); color:var(--fg); font:inherit; font-size:14px; font-weight:600; text-align:left; cursor:default; }
.mm-tg-h:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.mm-tg.is-open > .mm-tg-h { border-color:var(--accent); }
.mm-tg-name { flex:1; min-width:0; }
.mm-tg-n { min-width:1.5em; padding:0 6px; border-radius:999px; background:var(--accent); color:var(--card); font-size:12px; text-align:center; }
.mm-tg-n[hidden], .mm-tg-sum[hidden] { display:none; }
.mm-tg-caret { color:var(--muted); font-size:12px; transition:transform .15s; }
.mm-tg.is-open .mm-tg-caret { transform:rotate(90deg); }
.mm-tg-sum { margin:2px 0 0 10px; font-size:13px; color:var(--muted); }
.mm-tg-list { position:fixed; z-index:30; box-sizing:border-box; padding:6px 8px; overflow-y:auto; background:var(--card); color:var(--fg);
  border:1px solid var(--line); border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.18); }
.mm-tg-list[hidden] { display:none; }
.mm-ti-row { display:flex; align-items:center; gap:6px; }
.mm-ti-row > .check { flex:1; min-width:0; }
.mm-ti-more { padding:0 6px; border:0; border-radius:4px; background:none; color:var(--muted); font:inherit; font-size:12px; cursor:default; }
.mm-ti-more:focus-visible { outline:2px solid var(--accent); }
.mm-ti.is-open > .mm-ti-row .mm-ti-more span { display:inline-block; transform:rotate(90deg); }
.mm-ti.has-subs:hover > .mm-ti-row, .mm-ti.is-open > .mm-ti-row { background:var(--subtle); border-radius:4px; }
@media (prefers-reduced-motion: reduce) { .mm-tg-caret { transition:none; } }
/* MTG-74: a block that comes in by its rule (a red condition's own block): tagged on the map; Next, red, leads to it */
.sm-urgtag { background:var(--bad-bg); color:var(--fg); border:1px solid var(--bad); }
.mm-bar.mm-bar-next.is-urgent { background:var(--bad); color:var(--bad-bg); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; }
.mm-bar-now { writing-mode:vertical-rl; transform:rotate(180deg); font-size:12px; font-weight:700; letter-spacing:.02em; max-height:70%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sv2-callrow.is-prefilled input, .sv2-callrow.is-prefilled textarea { border-style:dashed; }
.mm-ask-h { margin:8px 0 2px; font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.mm-ask-h:first-child { margin-top:0; }
.sv2-sec > summary { cursor:pointer; padding:4px 0; }
.sv2-more { margin:4px 0 6px 8px; }
.sv2-more > summary { cursor:pointer; color:var(--muted); }
.btn.is-urgent { background:var(--bad); color:var(--bad-bg); border-color:var(--bad); font-weight:700; }
.v2-asks { margin:6px 0 0; }
.v2-asks > summary { cursor:pointer; color:var(--muted); }
.mt-urgent { margin:0 0 8px; }
/* MTG-74: the review's answers on the call, by block; a folded group in Your Script; room for Contact Collected
   Information under long words; the prep view's number boxes like the rest */
.mm-rv-h { margin:8px 0 2px; font-size:13px; }
.sp-fold { margin:.3em 0 .6em; border:1px solid var(--line); border-radius:6px; padding:2px 8px; }
.sp-fold > summary { cursor:pointer; font-weight:600; padding:4px 0; }
.sp-fold[open] > summary { margin-bottom:4px; }
/* MTG-74: Your Script and Contact Collected Information each take the room their content needs, shrinking together when
   both can't fit (no fixed share: the boxes no longer scroll while the words above stand half empty) */
.mm-sp-center > .mm-say { flex:0 1 auto; min-height:4em; }
.mm-sp-center > .mm-ask { flex:1 1 auto; min-height:6em; max-height:none; }   /* room to spare: Contact Collected Information takes it, to the panel's end (Stephen, 2026-10-28) */
.mm-say :is(.sp-say, .sp-fold) p + p { margin-top:.5em; }
.sv2-item input[type=number], .sv2-item input[type=text], .sv2-item select { font:inherit; padding:4px 6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
/* MTG-74: a block's only way on written on the Next bar; a red condition's own block looks red while the call is on it */
.mm-bar.mm-bar-next.has-label { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; }
.mm-sp-flow.is-red-block .mm-say { border-left-color:var(--bad); background:var(--bad-bg); }
.mm-sp-flow.is-red-block .mm-sp-center > .mm-part:first-child::after { content:' · a red condition'; color:var(--bad); }
.mm-ask-sep { border:0; border-top:1px solid var(--line); margin:8px 0; }
.mm-ask :is(input, select, textarea) { scroll-margin-top:calc(var(--top-h, 50px) + var(--mm-top-h, 0px) + var(--mm-banner-h, 0px) + var(--mm-shelf-h, 0px) + 24px); }
.st-panel .mm-say.is-red { border-left-color:var(--bad); background:var(--bad-bg); }
.st-red { color:var(--bad); }
/* Stephen, 2026-10-25: the border between Your Script and Contact Collected Information, dragged to share the panel */
.mm-hsplit { flex:0 0 10px; margin:2px 0 0; cursor:row-resize; touch-action:none; border-radius:4px; background:linear-gradient(to bottom, transparent 4px, var(--line) 4px, var(--line) 6px, transparent 6px); }
.mm-hsplit:is(:hover, :focus-visible, .is-dragging) { background:linear-gradient(to bottom, transparent 3px, var(--accent) 3px, var(--accent) 7px, transparent 7px); outline:none; }
.mm-sp-center > :is(.mm-say, .mm-ask) { box-sizing:border-box; }   /* the heights the border shares are their whole heights */

/* MTG-76: parts written in the Your Script box: coloured (CSS Custom Highlight API), what can't be read underlined */
::highlight(sx-kw) { color:var(--accent); }
::highlight(sx-name) { color:var(--ok); }
::highlight(sx-fn) { color:var(--accent); }
::highlight(sx-rule) { color:var(--warn); background-color:var(--subtle); }
::highlight(sx-arg) { color:var(--warn); }
::highlight(sx-brace) { color:var(--accent); background-color:var(--subtle); }
::highlight(sx-comment) { color:var(--muted); text-decoration:line-through; text-decoration-color:color-mix(in srgb, var(--muted) 45%, transparent); }   /* a // comment: not read (Stephen, 2026-10-26) */
::highlight(sx-err) { text-decoration:underline wavy var(--bad); text-decoration-thickness:2px; background-color:var(--bad-bg); }   /* not like a spelling mark */
.is-behind { opacity:.55; }
:is([data-parts], [data-askcalls]).is-behind::before { content:'Mend Your Script first: this list follows it.'; display:block; color:var(--bad); font-size:.85em; margin:4px 0; }
.mt-partasks { margin:6px 0 0; }
.mt-sayerr:empty { display:none; }
.mt-sayerr ul { margin:4px 0 0 1.2em; padding:0; }
.mt-sxhelp { margin:8px 0 0; }
.mt-sxhelp > summary { cursor:pointer; color:var(--accent); font-size:.9em; }
.mt-sxtable { border-collapse:collapse; margin:6px 0; font-size:.9em; width:100%; }
.mt-sxtable :is(th, td) { border:1px solid var(--line); padding:4px 6px; text-align:left; vertical-align:top; }
.mt-sxtable code, .mt-sxhelp p code { overflow-wrap:anywhere; }
.mt-sxtable td:first-child code { white-space:nowrap; overflow-wrap:normal; }   /* a type's name whole (the re-review: "SpokenT ext") */
.mt-saynote { margin:4px 0 0 1.2em; padding:0; color:var(--fg); font-size:.9em; }   /* a key asked twice: said, not an error */
.mt-sxex { background:var(--subtle); border:1px solid var(--line); border-radius:6px; padding:8px; overflow:auto; font-size:.85em; white-space:pre; }

/* Stephen, 2026-10-25: hover help in a Your Script box (script-hover.js): above the item (or below), never over it */
.sx-tip { position:fixed; z-index:60; pointer-events:none; max-width:min(440px, calc(100vw - 16px)); padding:8px 10px; background:var(--card); color:var(--fg); border:1px solid var(--line); border-radius:8px; box-shadow:0 6px 20px rgb(0 0 0 / .18); font-size:.88em; line-height:1.4; }
.sx-tip ul { margin:4px 0 0 1.1em; padding:0; }
.sx-tip code { font-size:.95em; }
.sx-tip-act { margin:6px 0 0; }
.v2-part.is-flash, tr.is-flash { outline:2px solid var(--accent); outline-offset:2px; transition:outline-color 1.2s; }
.sx-tip-who { margin:6px 0 0; padding-top:6px; border-top:1px solid var(--line); }

/* Stephen, 2026-10-25: Script Rules' lists as tables (script-v2-editor.js tableSec): search, + and expand/collapse in the
   title bar; sortable columns; each row opens to its editor */
.v2-tsum { display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; }
.v2-tsum > strong { margin-right:2px; }
.v2-count { color:var(--muted); margin-right:auto; }
.v2-tsum-tools { display:inline-flex; flex-wrap:wrap; align-items:center; gap:6px; }
.v2-search { width:min(220px, 50vw); padding:3px 8px; font:inherit; font-size:.9em; }
.v2-table { width:100%; border-collapse:collapse; margin:6px 0; }
.v2-table th, .v2-table td { padding:5px 8px; vertical-align:top; text-align:left; }
.v2-table td { overflow-wrap:anywhere; }
.v2-sort { all:unset; cursor:pointer; display:inline-flex; gap:4px; align-items:center; font-weight:600; }
.v2-sort:focus-visible { outline:2px solid var(--focus); outline-offset:2px; border-radius:3px; }
.v2-arrow { color:var(--muted); font-size:.85em; }
th[aria-sort="ascending"] .v2-arrow, th[aria-sort="descending"] .v2-arrow { color:var(--accent); }
.v2-tx { width:28px; }
.v2-tog { all:unset; cursor:pointer; width:22px; text-align:center; border-radius:4px; color:var(--muted); }
.v2-tog:is(:hover, :focus-visible) { color:var(--fg); background:var(--subtle); outline:none; }
.v2-trow { cursor:pointer; }
.v2-trow:hover > td { background:var(--subtle); }
.v2-tact { width:1%; white-space:nowrap; text-align:right; cursor:default; }
.v2-tdetail > td { background:var(--bg, transparent); border-left:3px solid var(--accent); padding:8px 12px 12px; }
.v2-table .field.v2-f { margin:0; }
.v2-table tr.is-flash > td { outline:2px solid var(--accent); }
/* the open/closed triangle a flex summary loses (Stephen, 2026-10-25), as the other sections show it */
.v2-tsum { list-style:none; cursor:pointer; }
.v2-tsum::-webkit-details-marker { display:none; }
.v2-tsum::before { content:'\25B6'; font-size:.75em; width:1em; display:inline-block; }
details[open] > .v2-tsum::before { content:'\25BC'; }
/* Stephen, 2026-10-25: a value as a pill in its status's color (status-colors.js; the colors are the theme's .st-<key>) */
.st-pill { display:inline-block; padding:1px 9px; border-radius:999px; font-weight:600; font-size:.92em; line-height:1.5; }
.st-col-table td { vertical-align:middle; }
.st-col-table input[type="color"] { width:44px; height:28px; padding:0; border:1px solid var(--line); border-radius:4px; background:none; }
.st-col-table input[data-f="words"] { width:100%; min-width:12em; }
/* Stephen, 2026-10-25: a part that shows for the test contact: a green check pill at the end of its line (the editor only) */
.sx-checks { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.sx-check { pointer-events:auto; cursor:help; position:absolute; width:18px; height:18px; border-radius:50%; background:#4ade80; color:#000; font-weight:900; font-size:12px; line-height:18px; text-align:center; box-shadow:0 0 0 1px rgb(0 0 0 / .15); }
/* Stephen, 2026-10-25: a block's Test button, right on its Your Script title row */
.mt-say-test { order:9; margin-left:auto; flex:none; align-self:center; }   /* last in its flex title row, pushed right */

/* [[ completion in a Your Script box (script-complete.js): a list under the caret, the focus staying in the box */
.sx-ac { position:fixed; z-index:1300; overscroll-behavior:contain; margin:0; padding:4px 0; list-style:none; min-width:220px; max-width:420px; max-height:260px; overflow:auto;
  background:var(--card, var(--entry)); color:var(--fg); border:1px solid var(--line); border-radius:6px; box-shadow:0 6px 18px rgba(0,0,0,.18); font-size:13px; }
.sx-ac li { padding:3px 10px; cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sx-ac li code { font:13px/1.4 ui-monospace, Menlo, Consolas, monospace; }
.sx-ac li small { color:var(--muted, #6b7280); margin-left:6px; }
.sx-ac li.is-at { background:var(--accent); color:#fff; }
.sx-ac li.is-at small { color:inherit; opacity:.85; }
/* A long script (Stephen, 2026-10-25): the box scrolls in itself (80vh at most) and its tools stay in view as the page scrolls.
   A .card scrolls sideways (base.css), which would make it the toolbar's sticky container; clip doesn't. */
.card:has(.hbox-tools) { overflow-x:clip; }
/* A contact's tasks over the Meeting Manager (object-actions.js taskPanel; Stephen, 2026-10-25: "just do it right there") */
.mm-tasks-dlg { width:min(1100px, calc(100vw - 32px)); }
.mm-tasks-dlg > .head { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.mm-tasks-dlg > .head h2 { margin:0; margin-right:auto; }
/* the Meeting banner in the template editor: block 0 (Stephen, 2026-10-26) */
.mt-banner { border-left:4px solid var(--accent); }
.mt-banner-help { margin:0 0 8px; }

/* The Meeting banner (Stephen, 2026-10-26): the template's block 0, over the board's columns the whole call; it folds */
.mm-banner-slot { position:sticky; top:calc(var(--top-h, 50px) + var(--mm-top-h, 0px)); z-index:9; background:var(--bg); padding:0 0 6px; margin-bottom:-6px; }   /* its padding covers the gap under it while stuck */
.mm-banner { background:var(--card); border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:8px; }
.mm-bn-h { margin:0; font-size:15px; }
.mm-bn-fold { display:flex; align-items:center; gap:6px; width:100%; padding:4px 10px; background:none; border:0; color:var(--fg); font:inherit; font-weight:600; text-align:left; cursor:pointer; }
.mm-bn-fold:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.mm-bn-arrow { width:1em; color:var(--muted); }
.mm-bn-body { display:grid; grid-template-columns:minmax(0, 1fr); gap:8px 16px; padding:0 12px 10px; max-height:40vh; overflow:auto; }
.mm-bn-body:has(> .mm-bn-ask) { grid-template-columns:minmax(0, 1.6fr) minmax(220px, 1fr); }
@media (max-width:800px) { .mm-bn-body:has(> .mm-bn-ask) { grid-template-columns:minmax(0, 1fr); } }
/* a collected field's name beside its question, by ShowField (Stephen, 2026-10-26) */
.mm-ftag { font-weight:400; color:var(--muted); font-size:.9em; }
.mm-ftag strong { font-weight:700; color:var(--fg); }
.mm-ftag-under { margin:-2px 0 4px; }
/* a question's box in the script, where it's written (DisplayPanel Script or Both; Stephen, 2026-10-26) */
.sp-inask:empty { display:none; }
.sp-inask { margin:6px 0 10px; padding:6px 10px; border-left:3px solid var(--accent); background:var(--subtle); border-radius:0 6px 6px 0; }
.sp-inask .mm-ask-row { margin:0; }
.sp-inask.is-words { background:none; padding:2px 10px; }
.sp-inask-q { font-weight:600; }
.sp-inask-q { display:flex; align-items:center; gap:6px; }
.sp-goask { display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--card); color:var(--accent); cursor:pointer; flex:none; }
.sp-goask:hover, .sp-goask:focus-visible { background:var(--accent); color:#fff; }
.sp-inask { transition:background-color .15s, box-shadow .15s; }
/* its box has the focus (in Contact Collected Information): the whole question lit (Stephen, 2026-10-26: "I would rather see the whole of the question highlighted") */
.sp-inask.is-asking { background:color-mix(in srgb, var(--accent) 22%, var(--card)); box-shadow:0 0 0 2px var(--accent); border-radius:6px; }
.sp-inask.is-asking .sp-inask-q > span { color:var(--fg); }
/* the alerts in the Meeting banner (Stephen, 2026-10-26): pulsing pills, red first; folded, the banner pulses in the highest */
.mm-bn-top { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding-right:8px; }
.mm-bn-top .mm-bn-h { flex:0 0 auto; }
.mm-bn-top .mm-bn-fold { width:auto; }
.mm-bn-alerts { display:flex; gap:6px; flex-wrap:nowrap; min-width:0; flex:1; margin:0; padding:2px 0; list-style:none; overflow:hidden; }
.mm-bn-alerts.is-all { flex-wrap:wrap; }
.mm-bn-alerts > li { min-width:0; flex:0 1 auto; }
.mm-bn-alert { display:block; max-width:340px; padding:2px 10px; border-radius:999px; border:2px solid; font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mm-bn-alerts.is-all .mm-bn-alert { max-width:none; white-space:normal; }
.mm-bn-alert.is-red { border-color:var(--bad); color:var(--fg); background:color-mix(in srgb, var(--bad) 38%, var(--card)); animation:bn-pulse-red 1.6s ease-in-out infinite; }
.mm-bn-alert.is-amber { border-color:var(--warn); color:var(--fg); background:var(--stage-stall-bg); animation:bn-pulse-amber 1.6s ease-in-out infinite; }
.mm-bn-alert.is-blue { border-color:var(--accent); color:var(--fg); background:var(--subtle); animation:bn-pulse-blue 2.4s ease-in-out infinite; }
.mm-bn-alert.is-more { border-color:var(--line); background:var(--card); color:var(--fg); font:inherit; font-size:13px; cursor:pointer; }
/* red: a clear red at its height, not a full one (Stephen, 2026-10-26: "more red … not a fully bright saturated red") */
@keyframes bn-pulse-red { 0%, 100% { background:color-mix(in srgb, var(--bad) 38%, var(--card)); } 50% { background:color-mix(in srgb, var(--bad) 8%, var(--card)); } }
@keyframes bn-pulse-amber { 0%, 100% { background:color-mix(in srgb, var(--warn) 38%, var(--card)); } 50% { background:color-mix(in srgb, var(--warn) 8%, var(--card)); } }
@keyframes bn-pulse-blue { 0%, 100% { background:var(--subtle); } 50% { background:var(--card); } }
.mm-banner.is-pulse-red { border-color:var(--bad); animation:bn-pulse-red 1.6s ease-in-out infinite; }
.mm-banner.is-pulse-amber { border-color:var(--warn); animation:bn-pulse-amber 1.6s ease-in-out infinite; }
.mm-banner.is-pulse-blue { animation:bn-pulse-blue 2.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .mm-bn-alert, .mm-banner[class*="is-pulse-"] { animation:none; } }
/* a banner alert's pill is a button: its popover (Stephen, 2026-10-26) */
button.mm-bn-alert { font:inherit; font-size:13px; font-weight:600; cursor:pointer; text-align:left; }
button.mm-bn-alert:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.mm-bn-alert.is-confirmed { animation:none; border-style:solid; }
.mm-bn-alert.is-cleared { opacity:.6; animation:none; text-decoration:line-through; }
.mm-bn-alert.is-cleared-n { color:var(--muted); font-weight:400; }
.mm-alert-pop { position:fixed; z-index:1200; overflow:auto; padding:12px 14px; margin:0; box-shadow:0 8px 28px rgb(0 0 0 / .22); }
.mm-alert-x { position:absolute; top:6px; right:8px; width:28px; height:28px; border:0; background:none; color:var(--muted); font-size:20px; cursor:pointer; border-radius:6px; }
.mm-alert-x:hover, .mm-alert-x:focus-visible { background:var(--subtle); color:var(--fg); }
.mm-alert-body { display:grid; gap:8px; }
.mm-alert-body .sv2-alert { margin-right:28px; }
.ad-level { font-size:12px; text-transform:uppercase; letter-spacing:.04em; opacity:.8; display:block; }
.ad-src, .ad-acts { margin:0; }
.ad-h { margin:4px 0 0; font-size:14px; }
.ad-why { margin:0; font-size:13px; }
.ad-why th[scope="row"] { white-space:nowrap; color:var(--muted); font-weight:600; }
.ad-pick { margin:0; }
.ad-acts { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding-top:6px; border-top:1px solid var(--line); }
.ad-said { font-weight:600; }

/* the Test panel's left edge drags (Stephen, 2026-10-26) */
.st-resize { position:fixed; z-index:31; top:var(--top-h, 50px); bottom:0; right:var(--st-w, min(620px, 46vw)); width:10px; margin-right:-5px; cursor:col-resize; touch-action:none; }
.st-resize::after { content:''; position:absolute; top:50%; left:3px; width:4px; height:40px; margin-top:-20px; border-radius:2px; background:var(--line); }
.st-resize:hover::after, .st-resize:focus-visible::after, body.st-resizing .st-resize::after { background:var(--accent); }
.st-resize:focus-visible { outline:none; }
body.st-resizing { cursor:col-resize; user-select:none; }
.st-banner { margin:0; }
.ad-rule { text-transform:none; letter-spacing:0; font-size:12px; font-weight:600; background:none; padding:0; }
/* MTG-87: the call script editor's views (Settings › Organization), and the switch above a template's blocks */
#sv-views .checks { display:grid; gap:6px; }
.mt-editview { margin-right:12px; }
/* MTG-87: a words box in the Outline view: its toolbar shows only while it has the focus; no frame until then */
.hbox.hbox-float { border-color:transparent; background:transparent; }
.hbox.hbox-float:focus-within { border-color:var(--accent); background:var(--entry); }
.hbox.hbox-float > .hbox-tools { display:none; }
/* Outline's words: their toolbar is docked under the Add bar, always shown, for the words being typed in (Stephen,
   2026-10-27: "my edit tools are not in the 'outline' view"); the words it's for are framed */
.ol-dock { flex:1 0 100%; }
.ol-dock:empty { display:none; }
.ol-dock > .hbox-tools { display:block !important; position:static; border:1px solid var(--line); border-radius:6px; background:var(--subtle); }
.hbox.hbox-float.is-active { border-color:var(--line); }
.hbox.hbox-float .hbox-area { min-height:1.6em; padding:4px 8px; resize:none; }

/* ---- MTG-87 build 2: the Outline view of Your Script (script-outline.js): cards with color caps (fixed per kind) ---- */
:root { --cap-say:#0f766e; --cap-note:#475569; --cap-ask:#1d4ed8; --cap-collect:#7e22ce; --cap-snippet:#be185d; --cap-group:#1f2937;
  --cap-queue:#0e7490; --cap-item:#155e75; --cap-prep:#64748b; --cap-comment:#94a3b8; --cap-when:#b45309; --cap-old:#a8a29e; --cap-fg:#ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cap-say:#2dd4bf; --cap-note:#94a3b8; --cap-ask:#60a5fa; --cap-collect:#c084fc; --cap-snippet:#f472b6;
  --cap-group:#cbd5e1; --cap-queue:#22d3ee; --cap-item:#67e8f9; --cap-prep:#94a3b8; --cap-comment:#64748b; --cap-when:#f59e0b; --cap-old:#78716c; --cap-fg:#0b1220; } }
:root[data-theme="dark"] { --cap-say:#2dd4bf; --cap-note:#94a3b8; --cap-ask:#60a5fa; --cap-collect:#c084fc; --cap-snippet:#f472b6;
  --cap-group:#cbd5e1; --cap-queue:#22d3ee; --cap-item:#67e8f9; --cap-prep:#94a3b8; --cap-comment:#64748b; --cap-when:#f59e0b; --cap-old:#78716c; --cap-fg:#0b1220; }
.ol { display:grid; gap:8px; }
.ol-bar { display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:6px 8px; border:1px solid var(--line); border-radius:8px; background:var(--subtle); position:sticky; top:var(--top-h, 50px); z-index:3; }
.ol-bar-h { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.ol-bar-sp { flex:1; }
.ol-pal { --c:var(--cap-say); display:inline-block; user-select:none; font:inherit; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; padding:3px 8px; border-radius:6px;
  border:2px solid var(--c); color:var(--c); background:var(--card); cursor:grab; }
.ol-pal:hover, .ol-pal:focus-visible { background:var(--c); color:var(--cap-fg); }
.ol-doc { display:grid; gap:2px; padding:4px 0; }
.ol-list { display:grid; gap:0; }
.ol-gap { position:relative; height:10px; margin:0 0 0 4px; }
.ol-gap .ol-add { position:absolute; left:-4px; top:-5px; width:20px; height:20px; padding:0; border-radius:50%; border:1px solid var(--line); background:var(--card); color:var(--muted);
  font-size:14px; line-height:1; opacity:0; cursor:pointer; }
.ol-gap:hover .ol-add, .ol-gap .ol-add:focus-visible { opacity:1; }
.ol-host.is-dragging .ol-gap::after { content:''; position:absolute; left:20px; right:0; top:50%; border-top:2px dashed var(--line); }
.ol-gap.is-over::after { border-top:3px solid var(--accent) !important; }
/* a card: cap | summary | badges | meta | ✎ ⋯, and what it holds under it */
.ol-card { --c:var(--cap-say); border:2px solid var(--c); border-radius:8px; background:var(--card); outline:none; }
.ol-row > .ol-cap { border-radius:5px 0 0 5px; }
.ol-card:has(> .ol-body) > .ol-row > .ol-cap { border-radius:5px 0 0 0; }
.ol-card:focus-visible, .ol-card.is-sel { box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.ol-card.is-dragging { opacity:.45; }
.ol-row { display:flex; align-items:stretch; gap:8px; min-height:30px; }
.ol-cap { flex:none; display:flex; align-items:center; padding:0 10px; background:var(--c); color:var(--cap-fg); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; cursor:grab; user-select:none; }
.ol-main { flex:1; min-width:0; display:flex; align-items:center; gap:6px; padding:4px 0; overflow-wrap:anywhere; }
.ol-meta { display:flex; align-items:center; padding:0 6px; font-size:12px; color:var(--c); white-space:nowrap; }
.ol-badge { align-self:center; font-size:11px; padding:1px 7px; border-radius:999px; border:1px solid var(--c); color:var(--fg); white-space:nowrap; }
.ol-ib { align-self:center; width:26px; height:26px; padding:0; border:0; border-radius:6px; background:none; color:var(--muted); cursor:pointer; flex:none; }
.ol-ib:hover, .ol-ib:focus-visible { background:var(--subtle); color:var(--fg); }
.ol-body { padding:4px 8px 8px 8px; border-top:1px solid color-mix(in srgb, var(--c) 30%, transparent); display:grid; gap:2px; }
.ol-sub { margin-top:6px; padding:4px 0 0 8px; border-left:3px solid var(--c); }
.ol-sub-h { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); }
.ol-k-say { --c:var(--cap-say); } .ol-k-note { --c:var(--cap-note); } .ol-k-ask { --c:var(--cap-ask); } .ol-k-collect { --c:var(--cap-collect); }
.ol-k-snippet { --c:var(--cap-snippet); } .ol-k-group, .ol-k-fold { --c:var(--cap-group); } .ol-k-queue { --c:var(--cap-queue); } .ol-k-item { --c:var(--cap-item); }
.ol-k-prep, .ol-k-alerts, .ol-k-answers, .ol-k-picklist { --c:var(--cap-prep); } .ol-k-comment { --c:var(--cap-comment); } .ol-k-old { --c:var(--cap-old); }
.ol-k-words { --c:var(--cap-say); }
.ol-card.ol-k-note .ol-body .hbox-area { font-style:italic; }
.ol-card.ol-k-comment { border-style:dashed; }
.ol-cmt { font-size:12px; color:var(--muted); background:none; }
.ol-chip { display:inline-block; padding:0 8px; border-radius:999px; border:1px solid var(--cap-collect); color:var(--fg); font-size:13px; }
.ol-bad { color:var(--bad); font-weight:600; }
/* a rule: an orange frame round what it governs, its header in plain English */
.ol-when { border:2px solid var(--cap-when); border-radius:10px; padding:0 6px 6px; background:color-mix(in srgb, var(--cap-when) 6%, var(--card)); }
.ol-when-h { display:block; width:calc(100% + 12px); margin:0 -6px 6px; padding:3px 10px; border:0; border-radius:7px 7px 0 0; background:var(--cap-when); color:var(--cap-fg);
  font:inherit; font-size:12px; font-weight:700; text-align:left; cursor:pointer; }
.ol-when-k { text-transform:uppercase; letter-spacing:.04em; }
.ol-when-h:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.ol-check { display:inline-block; margin-left:6px; width:16px; height:16px; border-radius:50%; background:#22c55e; color:#000; font-size:11px; font-weight:900; text-align:center; line-height:16px; }
/* words: as written, in place */
.ol-words-top, .ol-words { min-height:1.6em; }
.ol-wordsrow { display:grid; gap:2px; }
.ol-host .hbox-area:empty::before { content:attr(data-placeholder); color:var(--muted); font-style:italic; }
.ol-asks-top:empty { display:none; }
.ol-errs:empty { display:none; }
.ol-errs { border:1px solid var(--bad); background:var(--bad-bg); border-radius:8px; padding:6px 12px; font-size:14px; }
.ol-errs ul { margin:4px 0 0; padding-left:18px; }
/* its menus and its properties window */
.ol-menu { position:fixed; z-index:1250; display:grid; min-width:220px; padding:4px; margin:0; box-shadow:0 8px 24px rgb(0 0 0 / .2); }
.ol-menu button { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:6px 10px; border:0; border-radius:6px; background:none; color:var(--fg); font:inherit; text-align:left; cursor:pointer; }
.ol-menu button:hover, .ol-menu button:focus-visible { background:var(--subtle); outline:none; }
.ol-menu button small { color:var(--muted); }
.ol-dot { --c:var(--cap-say); display:inline-block; width:10px; height:10px; border-radius:3px; background:var(--c); margin-right:8px; }
.ol-menu button:has(.ol-dot) { justify-content:flex-start; }
.ol-dlg { width:min(560px, calc(100vw - 32px)); max-height:calc(100vh - 48px); overflow:auto; }
.ol-dlg.is-wide { width:min(820px, calc(100vw - 32px)); }
.ol-dlg h3 { margin:0 0 8px; }
.ol-dlg-body { display:grid; gap:10px; }
.ol-radios { display:grid; gap:2px; }
.ol-maxn { display:inline-flex; align-items:center; gap:6px; margin-left:24px; }
.ol-maxn input { width:5em; }
.ol-opt { display:flex; gap:6px; align-items:center; margin-bottom:4px; }
.ol-opt [data-ov] { width:9em; }
.ol-code { width:100%; font:13px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.ol-rule-said { display:block; margin-top:2px; }
.ol-card.has-words .ol-main { display:block; padding:0; }
.ol-card.has-words .ol-main .hbox { margin:2px 0; }
.ol-card.has-words .ol-row { align-items:flex-start; }
.ol-card.has-words .ol-cap { align-self:stretch; }
.ol-card.has-words .ol-ib { margin-top:2px; }

/* ---- MTG-87 build 2: the rule builder (script-rule-builder.js): a rule point-and-click, or as text with <> ---- */
/* The rule builder (public/app/js/script-rule-builder.js, MTG-87): nested groups of conditions, picked, not typed.
   Colours only from the app's tokens, so light and dark both follow the theme. */
.rb { display:grid; gap:8px; font-size:14px; color:var(--fg); }
.rb-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.rb-top { display:flex; align-items:flex-start; gap:8px; }
.rb-label { font-weight:600; flex:none; }
.rb-summary { flex:1 1 auto; margin:0; padding:4px 8px; border:1px solid var(--line); border-radius:6px; background:var(--subtle); min-width:0; overflow-wrap:anywhere; }
.rb-sum-lead { color:var(--muted); font-weight:600; }
.rb-sum-note { color:var(--warn); }
.rb-codebtn { flex:none; font:600 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--fg); cursor:pointer; }
.rb-codebtn[aria-pressed="true"] { background:var(--accent); color:var(--accent-fg); border-color:var(--accent); }

/* controls: compact, overriding the app's full-width inputs */
.rb select.rb-select, .rb input.rb-input { width:auto; max-width:100%; box-sizing:border-box; font:inherit; font-size:14px; padding:3px 6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); }
.rb input.rb-input { min-width:8em; }
.rb input.rb-num { width:6.5em; min-width:0; }
.rb select.rb-mode { font-weight:600; }
.rb-btn { font:inherit; font-size:13px; padding:2px 8px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--fg); cursor:pointer; }
.rb-btn:hover, .rb-x:hover, .rb-adv:hover, .rb-not:hover, .rb-codebtn:hover { border-color:var(--accent); }
.rb-add { color:var(--accent); border-style:dashed; }
.rb-x { flex:none; font:inherit; font-size:16px; line-height:1; width:24px; height:24px; padding:0; border:1px solid transparent; border-radius:6px; background:none; color:var(--muted); cursor:pointer; }
.rb-x:hover { color:var(--bad); }
.rb-adv { flex:none; font:inherit; font-size:14px; line-height:1; height:24px; padding:0 6px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--muted); cursor:pointer; }
.rb-adv[aria-pressed="true"] { color:var(--fg); background:var(--subtle); }
.rb-not { font:inherit; font-size:13px; font-weight:600; padding:2px 8px; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--muted); cursor:pointer; text-decoration:line-through; }
.rb-not[aria-pressed="true"] { color:var(--bad); border-color:var(--bad); background:var(--bad-bg); text-decoration:none; }
.rb button:focus-visible, .rb select:focus-visible, .rb input:focus-visible, .rb textarea:focus-visible { outline:2px solid var(--focus); outline-offset:1px; }

/* groups */
.rb-group { display:grid; gap:6px; padding:6px 8px 8px; border:1px solid var(--line); border-left:3px solid var(--accent); border-radius:6px; background:var(--card); }
.rb-depth-1, .rb-depth-3 { background:var(--subtle); }
.rb-depth-2, .rb-depth-4 { background:var(--card); }
.rb-ghead, .rb-gfoot { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.rb-ghead .rb-x { margin-left:auto; }
.rb-items { list-style:none; margin:0; padding:0; display:grid; gap:4px; }
.rb-empty { color:var(--muted); font-style:italic; padding:2px 0; }

/* a condition */
.rb-cond { display:flex; flex-wrap:nowrap; align-items:center; gap:4px 6px; padding:4px 6px; border:1px solid var(--line); border-radius:6px; background:var(--card); }
.rb-parts { display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px; flex:1 1 0; min-width:0; }
.rb-tools { display:flex; align-items:center; gap:2px; margin-left:auto; flex:none; padding-top:2px; }
.rb-note { display:none; color:var(--warn); font-size:12px; font-weight:600; align-self:center; }
.rb-cond.rb-incomplete { border-style:dashed; border-color:var(--warn); }
.rb-cond.rb-incomplete > .rb-note { display:inline; }
.rb-subject { position:relative; display:inline-block; flex:0 1 22em; min-width:12em; max-width:100%; }
.rb-subject .cb-row input { padding:3px 6px; font-size:14px; }

/* value editors */
.rb-checks { display:flex; flex-wrap:wrap; gap:2px 10px; margin:0; padding:2px 6px; border:1px dashed var(--line); border-radius:6px; min-width:0; }
.rb-check { display:inline-flex; align-items:center; gap:4px; white-space:nowrap; cursor:pointer; }
.rb-check input { margin:0; }
.rb-words { display:inline-flex; flex-wrap:wrap; align-items:center; gap:4px; }
.rb-chip { display:inline-flex; align-items:center; gap:2px; padding:0 0 0 8px; border:1px solid var(--line); border-radius:999px; background:var(--subtle); }
.rb-chip .rb-x { width:20px; height:20px; font-size:14px; }
.rb-word { color:var(--muted); }

/* an expression's sides */
.rb-operand { display:inline-flex; flex-wrap:wrap; align-items:center; gap:4px; padding:2px; border-radius:6px; max-width:100%; }
.rb-operand.rb-k-ref, .rb-operand.rb-k-str, .rb-operand.rb-k-num, .rb-operand.rb-k-bool { flex-wrap:nowrap; }
.rb-operand > .rb-operand, .rb-litem > .rb-operand { border:1px dotted var(--line); padding:2px 4px; }
.rb-operand .rb-subject { flex:0 1 16em; min-width:10em; }
.rb-kind { color:var(--muted); }
.rb-list { display:inline-flex; flex-wrap:wrap; align-items:center; gap:4px; }
.rb-list::before { content:"["; color:var(--muted); font-weight:700; }
.rb-list::after { content:"]"; color:var(--muted); font-weight:700; }
.rb-litems { list-style:none; margin:0; padding:0; display:inline-flex; flex-wrap:wrap; gap:4px; }
.rb-litem { display:inline-flex; align-items:center; gap:2px; }
.rb-except { display:inline-flex; flex-wrap:wrap; align-items:center; gap:4px; }
.rb-brackets { display:block; flex:1 1 100%; }
.rb-k-expr { flex:1 1 100%; }
.rb-ro { display:inline-flex; align-items:center; gap:6px; padding:2px 4px 2px 8px; border:1px solid var(--warn); border-radius:6px; background:var(--subtle); }
.rb-ro code { font-size:13px; }

/* the text view */
.rb-codeview { display:grid; gap:4px; }
.rb-codelabel { font-weight:600; font-size:13px; }
.rb-code { width:100%; box-sizing:border-box; font:13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); resize:vertical; }
.rb-code[aria-invalid="true"] { border-color:var(--bad); }
.rb-err { margin:0; color:var(--bad); font-size:13px; min-height:1em; }
.rb-err:empty { display:none; }
.rb-hint { margin:0; color:var(--muted); font-size:12px; }

@media (max-width:600px) { .rb-subject { flex-basis:100%; } .rb-top { flex-wrap:wrap; } }
/* where a dragged part will land: a line before or after a card (Stephen, 2026-10-27) */
.ol-drop-before { box-shadow:0 -4px 0 0 var(--accent) !important; }
.ol-drop-after { box-shadow:0 4px 0 0 var(--accent) !important; }
.ol-drop-into { box-shadow:inset 0 0 0 3px var(--accent) !important; }
/* the rule builder's subject: its group, then a search of it (Stephen, 2026-10-27) */
.rb-lookin { font:inherit; font-size:13px; padding:3px 6px; border:1px solid var(--line); border-radius:6px; background:var(--entry); color:var(--fg); max-width:14em; }
/* first inside a rule's frame (Stephen, 2026-10-27): a line just under its header */
.ol-drop-first { box-shadow:inset 0 30px 0 -26px var(--accent) !important; }
/* RULES 119: what a rule reads (each opens where it's set), an alert's "Set by" chain, the survey codes edited in place */
.v2-reads { display:flex; flex-wrap:wrap; align-items:center; gap:4px; margin-top:3px; font-size:12px; }
.v2-reads:empty { display:none; }
.v2-reads-h { color:var(--muted); }
.v2-ref { font:12px/1.4 ui-monospace, Menlo, Consolas, monospace; padding:0 6px; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--accent); cursor:pointer; }
.v2-ref:hover, .v2-ref:focus-visible { border-color:var(--accent); background:var(--subtle); }
.v2-setby { margin-top:6px; padding:6px 10px; border-left:3px solid var(--line); background:var(--subtle); border-radius:0 6px 6px 0; }
.v2-setby .v2-sub { margin:0 0 4px; }
/* the Set by chain in plain words (Stephen, 2026-10-28: "is this an OR … or an AND … and why are items 2 and 3 indented?"):
   each variable says how its rules make its value; its rules numbered, OR (or PLUS) between them; what a rule reads, under
   "Rule n reads:" */
.v2-chain { margin:4px 0 0; padding-left:0; list-style:none; font-size:13px; }
.v2-chain-name { margin:4px 0; }
.v2-chain-how { margin:2px 0 4px; font-style:italic; }
.v2-chain-rules { list-style:none; margin:0; padding:0 0 0 12px; border-left:2px solid var(--line); }
.v2-chain-rule { padding:3px 0; }
.v2-chain-n { display:inline-block; padding:0 6px; border-radius:4px; background:var(--card); border:1px solid var(--line); font-size:12px; font-weight:700; }
.v2-chain-when { color:var(--fg); }
.v2-chain-or { margin:2px 0; font-size:11px; font-weight:700; letter-spacing:.06em; color:var(--muted); }
.v2-chain-sub { margin:4px 0 2px 14px; }
.v2-chain-subh { font-size:12px; color:var(--muted); }
.v2-chain-sub > .v2-chain { margin-top:0; }
.v2-chain-intro { margin:0 0 4px; font-size:12px; }
.v2-holds { color:var(--ok); font-weight:700; margin-left:6px; }
.v2-nothold { color:var(--muted); margin-left:6px; }
.v2-codes input[type="text"] { width:auto; }
.v2-codeopt { display:flex; align-items:center; gap:4px; margin-bottom:3px; }
.v2-codeopts select { max-width:22em; }
/* a yes / no tick box (Stephen, 2026-10-28): the box in its own column, two characters before the question; a wrapped
   line starts under the question's first character; a thin line between questions */
.mm-ask-row label.mm-check-row { display:grid; grid-template-columns:auto minmax(0, 1fr); column-gap:2ch; align-items:start; font-weight:600; cursor:pointer; margin:0; font-size:inherit; }
.mm-check-row > input[type="checkbox"] { width:18px; height:18px; margin:2px 0 0; }
.mm-ask-row.is-check { margin:0; padding:2px 0; }
.mm-ask-row.is-check.is-prefilled .mm-check-row { background:var(--stage-now-bg, var(--subtle)); border-radius:4px; }
.mm-ask > .mm-ask-row + .mm-ask-row, .mm-ask > .mm-ask-row + .mm-ask-h, .mm-ask > .mm-ask-h + .mm-ask-row ~ .mm-ask-row { border-top:1px solid var(--line); padding-top:8px; margin-top:8px; }
/* "Fix these first" (Stephen, 2026-10-28): each problem a link to its place; the place outlined in red, with a ! whose card
   says what's wrong and how to fix it; a folded section holding one shows a ! on its title */
.mt-fixlist { list-style:none; margin:4px 0 0; padding:0; }
.mt-fixlist li { display:flex; gap:8px; align-items:flex-start; margin:4px 0; }
.mt-fixlist li.is-done { color:var(--muted); }
.mt-fixlist li.is-done .mt-fixmsg { text-decoration:line-through; }
.mt-fixlist li.is-done .mt-erricon { background:var(--muted); }
.mt-fixlist a { font-weight:600; color:inherit; text-decoration:underline; }
.mt-erricon { flex:0 0 auto; display:inline-block; width:20px; height:20px; border-radius:50%; border:0; padding:0; background:var(--bad); color:#fff; font:700 13px/20px system-ui, sans-serif; text-align:center; cursor:pointer; }
.mt-fixlist .mt-erricon { cursor:default; margin-top:1px; }
.is-errat { outline:2px solid var(--bad); outline-offset:2px; border-radius:4px; }
input.is-errat, select.is-errat, textarea.is-errat { border-color:var(--bad); }
.mt-errmark { position:relative; display:inline-block; vertical-align:middle; margin:0 6px; line-height:1; z-index:5; }
.mt-errpop { display:none; position:absolute; top:100%; left:0; z-index:60; width:max-content; max-width:min(360px, 80vw); margin-top:0; padding:8px 10px;
  background:var(--card); color:var(--fg); border:1px solid var(--bad); border-radius:6px; box-shadow:0 4px 14px rgba(0,0,0,.18);
  font-size:13px; font-weight:400; line-height:1.4; text-align:left; white-space:normal; cursor:auto; }
.mt-errmark:hover .mt-errpop, .mt-errmark:focus-within .mt-errpop, .mt-errmark.is-open .mt-errpop { display:block; }
.mt-errpop strong { display:block; margin-bottom:2px; }
.mt-errpop > span { display:block; }
.mt-errpop .mt-errfix { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
details.has-errin:not([open]) > summary::after { content:'!'; display:inline-block; width:18px; height:18px; margin-left:8px; border-radius:50%; background:var(--bad); color:#fff; font:700 12px/18px system-ui, sans-serif; text-align:center; vertical-align:middle; }
tr.is-errat { outline:none; }   /* a table row: one red edge round the row (an outline would ring each cell) */
tr.is-errat > td { box-shadow:inset 0 2px 0 var(--bad), inset 0 -2px 0 var(--bad); }
tr.is-errat > td:first-child { box-shadow:inset 2px 2px 0 var(--bad), inset 0 -2px 0 var(--bad); }
tr.is-errat > td:last-child { box-shadow:inset -2px 2px 0 var(--bad), inset 0 -2px 0 var(--bad); }
/* The template editor's header (Stephen, 2026-10-28): sticky, the title and the name on one line, under them where you are
   (↑ up a level, ← back a step, then the trail, each step a link back to it) */
#mt-edit { overflow-x:clip; }   /* (a card scrolls sideways, which would make it the header's sticky container) */
.mt-head { position:sticky; top:var(--top-h, 50px); z-index:9; background:var(--stage-cut-bg, #efefeb); padding:8px 0 8px 10px; border-radius:5px 5px 0 0; margin-bottom:12px; border-bottom:1px solid var(--line); }   /* Stephen, 2026-10-28 */
.mt-head-row { display:flex; align-items:center; gap:8px 16px; flex-wrap:wrap; }
.mt-head-row h2 { margin:0; white-space:nowrap; }
.mt-head .mt-name { flex:1 1 18em; margin:0; }
.mt-crumbs { display:flex; align-items:center; gap:6px; margin-top:6px; min-width:0; }
.mt-crumbs [data-crumb="up"], .mt-crumbs [data-crumb="back"] { flex:0 0 auto; min-width:32px; font-weight:700; }
.mt-crumbs ol { display:flex; flex-wrap:wrap; align-items:center; list-style:none; margin:0 0 0 4px; padding:0; min-width:0; }
.mt-crumbs li { display:inline-flex; align-items:center; min-width:0; }
.mt-crumbs li + li::before { content:'›'; margin:0 4px; color:var(--muted); }
.mt-crumb { border:0; background:none; padding:2px 4px; font:inherit; font-size:14px; color:var(--accent); cursor:pointer; text-decoration:underline; text-underline-offset:2px;
  max-width:26em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border-radius:4px; }
.mt-crumb[aria-current] { color:var(--fg); font-weight:600; text-decoration:none; }
#mt-edit .hbox-bar, #mt-edit .hbox-tools, #mt-edit .ol-bar { top:calc(var(--top-h, 50px) + var(--mt-head-h, 0px)); }
/* what's scrolled to (a link, the keyboard's focus) clears the sticky header and footer */
#mt-edit :is(details, tr, input, select, textarea, button, [contenteditable="true"]) { scroll-margin-top:calc(var(--top-h, 50px) + var(--mt-head-h, 0px) + 8px); scroll-margin-bottom:72px; }
#mt-edit :is(.mt-head, .mt-foot) :is(input, button) { scroll-margin:0; }
/* Save, Cancel, Export, Import and the problems: a sticky footer (Stephen, 2026-10-28) */
.mt-foot { position:sticky; bottom:0; z-index:9; background:var(--stage-cut-bg, #efefeb); padding:8px 10px; border-radius:0 0 5px 5px; margin-top:12px; border-top:1px solid var(--line); }   /* Stephen, 2026-10-28 */
.mt-foot-btns { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:0; }
.mt-foot-btns .mt-io { display:inline-flex; gap:6px; margin-left:auto; }
.mt-foot-err { max-height:30vh; overflow-y:auto; }   /* a long "Fix these first" scrolls in the footer */
.mt-foot-err:not(:empty) { margin-bottom:6px; padding-bottom:6px; border-bottom:1px solid var(--line); }
/* A drop-down that picks several (multi-pick.js): Any first, then the choices under their headings */
.mpk { position:relative; }
.mpk-btn { display:flex; align-items:center; gap:8px; width:100%; box-sizing:border-box; min-height:36px; padding:6px 10px; font:inherit; text-align:left; color:var(--fg);
  background:var(--bg); border:1px solid var(--line); border-radius:6px; cursor:pointer; }
.mpk-shown { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mpk-caret { color:var(--muted); }
.mpk-pop { position:absolute; z-index:30; top:calc(100% + 2px); left:0; right:0; max-height:min(360px, 60vh); overflow-y:auto; padding:6px 0; background:var(--card);
  border:1px solid var(--line); border-radius:6px; box-shadow:0 6px 18px rgb(0 0 0 / .18); }
.mpk-opt { display:flex; align-items:baseline; gap:6px; padding:4px 12px; font-weight:400; cursor:pointer; }
.mpk-opt:hover { background:var(--subtle); }
.mpk-opt input { width:auto; margin:0; }
.mpk-opt.is-any { font-weight:600; border-bottom:1px solid var(--line); padding-bottom:6px; margin-bottom:2px; }
.mpk-opt.is-in { padding-left:24px; }
.mpk-h { padding:6px 12px 2px; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.mpk-none { margin:4px 12px; }
.mt-stagepick { display:grid; grid-template-columns:repeat(auto-fit, minmax(16em, 1fr)); gap:0 16px; }
/* a question's words and a fold's title with their formatting (Stephen, 2026-10-28): on their line */
.mm-qwords > p, .sp-fold-t > p { display:inline; margin:0; }
.sp-fold-t { display:inline; }
.ol-setby .v2-setby { margin-top:8px; }   /* an Outline rule's Set by chain, under its builder (Stephen, 2026-10-28) */

/* a variable's rules (Stephen, 2026-10-28): how they combine said once; each a card (its number and tools, the rule picked,
   what it gives); OR between them */
.v2-rules-how { margin:0 0 6px; font-style:italic; font-size:13px; }
.v2-rulecard { border:1px solid var(--line); border-radius:6px; padding:8px 10px; background:var(--card); }
.v2-rulecard-h { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.v2-rulecard .v2-rulef { margin:0; }
.v2-rulecard-gives { display:flex; align-items:flex-end; gap:8px; margin-top:6px; }
.v2-rulecard-gives .v2-f { flex:0 1 20em; margin:0; }
.v2-nest > .v2-chain-or { margin:4px 0 4px 12px; }
.v2-rulef { flex:1 1 100%; }

/* what a condition tests: one drop-down, its types then their things (Stephen, 2026-10-28); the condition on one row: what,
   how, the value */
.rb-pick { display:flex; align-items:center; gap:6px; width:100%; box-sizing:border-box; min-height:32px; padding:4px 8px; font:inherit; font-size:14px; text-align:left;
  color:var(--fg); background:var(--entry, var(--bg)); border:1px solid var(--line); border-radius:6px; cursor:pointer; }
.rb-pick.is-empty { color:var(--muted); }
.rb-pick-text { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rb-pick-caret { color:var(--muted); font-size:12px; }
.rb-pick-pop { position:absolute; z-index:40; top:calc(100% + 2px); left:0; width:max(100%, 24em); max-width:min(34em, 90vw); padding:6px; box-sizing:border-box;
  background:var(--card); border:1px solid var(--line); border-radius:8px; box-shadow:0 6px 18px rgb(0 0 0 / .18); }
.rb-pick-head { display:flex; align-items:center; gap:8px; padding:2px 4px 6px; font-size:13px; }
.rb-pick-back { border:0; background:none; padding:2px 4px; font:inherit; color:var(--accent); cursor:pointer; border-radius:4px; }
.rb-pick-q { width:100%; box-sizing:border-box; font:inherit; font-size:14px; padding:5px 8px; border:1px solid var(--line); border-radius:6px; background:var(--entry, var(--bg)); color:var(--fg); }
.rb-pick-list { max-height:min(320px, 50vh); overflow-y:auto; margin-top:4px; }
.rb-pick-item { display:flex; align-items:baseline; gap:8px; width:100%; padding:6px 8px; border:0; border-radius:4px; background:none; font:inherit; font-size:14px; text-align:left; color:var(--fg); cursor:pointer; }
.rb-pick-item:is(:hover, :focus-visible) { background:var(--subtle); outline:none; }
.rb-pick-item.is-on { font-weight:600; }
.rb-pick-l { flex:1; min-width:0; }
.rb-pick-n, .rb-pick-g { color:var(--muted); font-size:12px; white-space:nowrap; }
.rb-pick-none { margin:6px 8px; color:var(--muted); font-size:13px; }
.rb-cond > .rb-parts { flex-wrap:wrap; align-items:center; }
.rb-cond .rb-tools { padding-top:0; }
/* the Set by chain as the rule is built (Stephen, 2026-10-28: "it's not clear (hard to see) where the AND/OR/ETC logic ties
   everything together … each level of the structure be able to expand/collapse"): a group's ALL / ANY ONE heading and the
   AND / OR between its parts in one colour each; a variable folds open to its rules, each named for the variable */
.sb-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.sb-tools { display:flex; gap:4px; }
.v2-setby { font-size:13px; }
.sb-group { margin:4px 0; padding:4px 0 4px 10px; border-left:3px solid var(--sb-c, var(--line)); }
.sb-group.is-all { --sb-c:#3b6fb6; }
.sb-group.is-any { --sb-c:#c2711a; }
.sb-group-h { display:flex; align-items:center; gap:8px; margin-bottom:2px; }
.sb-chip { display:inline-block; padding:1px 8px; border-radius:10px; font-size:11px; font-weight:700; letter-spacing:.04em; color:#fff; background:var(--sb-c); }
.sb-join { display:inline-block; margin:2px 0 2px 6px; padding:0 8px; border-radius:10px; font-size:11px; font-weight:700; letter-spacing:.06em; }
.sb-join.is-and { color:#3b6fb6; border:1px solid #3b6fb6; }
.sb-join.is-or { color:#c2711a; border:1px solid #c2711a; }
.sb-join.is-rules { color:var(--muted); border:1px solid var(--line); margin-left:0; }
.sb-cond { margin:2px 0; }
.sb-cond-l { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; }
.sb-cond-t { font-weight:500; }
.sb-var { margin:4px 0 4px 14px; padding:4px 8px; border:1px solid var(--line); border-radius:6px; background:var(--card); }
.sb-var > summary { cursor:pointer; display:flex; flex-wrap:wrap; align-items:baseline; gap:4px; }
.sb-var-l { font-weight:600; }
.sb-now { color:var(--muted); }
.sb-how { margin:4px 0; font-style:italic; }
.sb-rule { margin:4px 0; padding:4px 8px; border-radius:6px; background:var(--subtle); }
.sb-rule-h { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; }
.sb-rule-n { font-weight:700; font-size:12px; }
.sb-when { display:flex; align-items:baseline; gap:6px; margin-top:2px; }
.sb-when > .sb-if { color:var(--muted); font-size:12px; flex:none; }
.sb-when > :last-child { flex:1; min-width:0; }
:root[data-theme="dark"] .sb-group.is-all, :root[data-theme="dark"] .sb-join.is-and { --sb-c:#7fa8e6; }
.sb-var > summary { list-style:none; }
.sb-var > summary::-webkit-details-marker { display:none; }
.sb-var > summary::before { content:'▸'; display:inline-block; width:1em; color:var(--muted); }
.sb-var[open] > summary::before { content:'▾'; }
