/* Control Center (/app) live adapter styles. */

/* The prototype's persona switcher and sample-data controls do not apply to a real session. */
.live-mode .proto-bar { display: none !important; }

.live-badge {
  position: fixed; right: 12px; bottom: 12px; z-index: 900;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px;
  font: 600 12px/1.2 'Inter', sans-serif;
  background: var(--surface, #fff); color: var(--text, #0F172A);
  border: 1px solid var(--border, #E2E8F0); box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
}
/* The badge sits bottom right, where the toasts stack. In a live session the toasts start above the badge
   and stack over it, so a confirmation ("Thank you. Your note was recorded.") is never hidden behind
   "Live data" (user, 2026-11-08, PeakAssist Not helpful). */
.live-mode .toasts { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); z-index: 950; }
.live-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #16A34A; }
.live-badge.stale .dot { background: #D97706; }
.live-badge.down .dot { background: #DC2626; }
.live-badge small { font-weight: 500; opacity: .75; }

/* Appliance in monitor-only mode (PEAKLOGIC_CONTROL_ENABLED is not 1): say so once, quietly. */
/* One slim line each (user 2026-10-15: the banners must not take the top of the screen), with a close
   button that hides it for this browser session. */
.live-note {
  display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 16px; min-height: 28px;
  font-size: 12.5px; line-height: 1.3; color: var(--text-muted, #475569);
  background: var(--surface-2, #F1F5F9); border-bottom: 1px solid var(--border, #E2E8F0);
}
.live-note svg { flex: none; width: 14px; height: 14px; }
.live-note > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-note .btn-sm { padding: 2px 8px; min-height: 0; font-size: 12px; }
.live-note .note-close { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; }
.live-note .note-close:hover { background: var(--surface-3, #E2E8F0); }

/* Staff entered into a customer, or with one picked above a build tool: whose modules the menu shows (cloud tier C6). */

/* The Modules panel on an organization's page (cloud tier C6). */
.mod-group-title { margin: 0; padding: 14px 14px 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted, #475569); }
.mod-list { list-style: none; margin: 0; padding: 0; }
.mod-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border, #E2E8F0); }
.mod-row:first-child { border-top: 0; }
.mod-row .mod-name { font-weight: 600; }
.mod-row .mod-desc { color: var(--text-muted, #475569); font-size: 12.5px; }
.mod-live { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; margin-left: 8px; white-space: nowrap; }
.mod-live.on { background: #DCFCE7; color: #166534; }
.mod-live.off { background: var(--surface-3, #E2E8F0); color: var(--text-muted, #475569); }
/* A module that cannot be turned on yet (Sales & marketing tools until the white-label build-out). */
.mod-live.locked { background: var(--p3-soft, #FEF3C7); color: var(--p3-ink, #92400E); }
.mod-locked { color: var(--p3-ink, #92400E); }
.mod-row.mod-partner-only { opacity: 0.55; } /* a partner-only module on a customer: greyed out, never switchable */
/* New customer / New partner: the same switches; the header and buttons stay put while the body scrolls. */
.modal.org-new { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: hidden; }
.modal.org-new .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.org-new-modules { border: 1px solid var(--border, #E2E8F0); border-radius: 8px; }
.org-new-modules > .mod-head { padding: 12px 14px 0; }
.org-new-modules > .mod-head h3 { margin: 0; font-size: 14px; }
@media (max-width: 600px) {
  .modal.org-new { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .modal.org-new .modal-body { padding: 14px 12px; }
  .org-new-modules .mod-row { padding: 10px; gap: 4px 10px; }
  .org-new-modules .mod-live { margin-left: 6px; }
}

/* Map with no placed site (components.js LiveMap). */
.map-empty { position: absolute; inset: auto 12px 12px 12px; z-index: 500; padding: 8px 12px; border-radius: 8px; font-size: 13px; background: var(--surface, #fff); border: 1px solid var(--border, #E2E8F0); }

/* Expanded alarm (live AlarmContext): notes and the point's history. */
.live-ctx { display: grid; gap: 12px; }
.live-ctx .live-notes, .live-ctx .live-history { display: grid; gap: 4px; }
.live-ctx form.row { margin-top: 6px; gap: 8px; flex-wrap: nowrap; }
.live-ctx form.row .input { flex: 1; min-width: 0; }

/* PeakView360 (live/peakview.js): the screen picker is a drop-down in the page header (user 2026-11-01 late night;
   the chip row and then a side list were "not that intuitive"), and the frame fills the rest of the window: a long
   screen scrolls inside it. */
.pv-screen-pick { font-weight: 600; }
.pv-frame { position: relative; width: 100%; height: calc(100vh - var(--top-h, 56px) - 120px); min-height: 420px; border: 1px solid var(--border, #E2E8F0); border-radius: 10px; overflow: hidden; background: #0b1120; margin-bottom: 14px; }
.pv-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Engineering: a real tool framed in the shell (Tag tables, SVG editor, Panel Builder). */
.live-tool-frame { display: block; width: 100%; height: calc(100vh - 230px); min-height: 520px; border: 1px solid var(--border, #E2E8F0); border-radius: 10px; background: var(--surface, #fff); margin-top: 10px; }
@media (max-width: 720px) { .live-tool-frame { height: calc(100vh - 180px); } }
/* Framed tools and HMI View end at the window's bottom edge, measured from where they start
   (live.js fitFramesToWindow sets the height), so the page around them never scrolls and the tool's
   own menus stay in view (user 2026-10-15: Site Designer's menus scrolled away). */
.live-tool-frame[data-fit="window"], .pv-frame[data-fit="window"] { min-height: 420px; margin-bottom: 8px; }

/* Menus anchored (user 2026-10-15, "review all other menus"): every page's tab row stays under the
   top bar while the page scrolls. Not inside dialogs, which scroll on their own. */
.main .tabs { position: sticky; top: var(--top-h, 56px); z-index: 14; background: var(--bg, #F5F5FB); }
.main .dash-tabs { position: sticky; top: var(--top-h, 56px); z-index: 14; background: var(--bg, #F5F5FB); }
.main .dash-tabs .tabs, .modal .tabs, .main .modal .tabs { position: static; z-index: auto; }

/* Estimator (staff pre-sales tool, live/estimator.js). */
.est-head-btn { position: relative; }
.topbar-tools { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.est-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 2px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--p1); color: #fff; }
.est-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; margin-top: 12px; }
.est-main { display: grid; gap: 16px; min-width: 0; }
.est-side { min-width: 0; }
.est-sticky { position: sticky; top: 72px; }
@media (max-width: 1100px) { .est-layout { grid-template-columns: minmax(0, 1fr); } .est-sticky { position: static; } }
.est-num { color: var(--text-muted); font-weight: 600; margin-right: 6px; }
.est-text { width: 100%; resize: vertical; font: inherit; }
.est-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.est-lines .input { height: 28px; min-height: 0; padding: 2px 6px; font-size: 13px; border-radius: 6px; }
.est-n { width: 66px; text-align: right; }
.est-p { width: 120px; text-align: right; }
.est-name { width: 100%; min-width: 190px; }
.est-lines td { padding-top: 3px; padding-bottom: 3px; }
.est-lines td { vertical-align: middle; }
.est-area td { background: var(--surface-2); }
.est-area-name { font-weight: 600; width: auto; min-width: 260px; padding: 4px 6px; margin-right: 10px; }
.est-low td:first-child { box-shadow: inset 3px 0 0 var(--p1); }
.est-bad { color: var(--p1-ink, var(--p1)); font-weight: 600; }
.est-warn { color: var(--p3-ink, var(--p3)); }
.est-good { color: #16A34A; }
.est-row { cursor: pointer; }
.est-row:hover td { background: var(--surface-2); }
.est-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
@media (max-width: 700px) { .est-cols { grid-template-columns: 1fr; } }
.est-issues { margin: 10px 0; padding-left: 18px; font-size: 13px; display: grid; gap: 4px; }
.est-approval { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; display: grid; gap: 8px; }
.est-ap-not_needed, .est-ap-approved { background: rgba(22, 163, 74, .12); color: #15803D; }
.est-ap-required, .est-ap-rejected { background: var(--p1-soft); color: var(--p1-ink, var(--p1)); }
.est-ap-pending { background: var(--p3-soft); color: var(--p3-ink, var(--p3)); }
.est-dirty { background: var(--p3-soft); color: var(--p3-ink, var(--p3)); }
.est-history { margin-top: 12px; font-size: 12px; }
.est-history ul { padding-left: 16px; display: grid; gap: 3px; }
.est-signoff { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.est-req { font-size: 11px; font-weight: 600; color: var(--p1-ink, var(--p1)); margin-left: 4px; }
.est-missing { border-color: var(--p1); }
/* Staff Messages (live/estimator.js). */
/* The list beside the open message; at half a screen (1180 px and below, the rail included) the list sits above the
   message instead of being squeezed (user, 2026-11-01: "all messages is squished"). Every column may shrink: minmax(0).
   The list is just wide enough (470 px) for "All messages" and the two archive buttons on one line (user, 2026-11-02);
   below that the buttons still wrap, at the left. The counts live on the filter tabs, not the list's header. */
.msg-layout { display: grid; grid-template-columns: minmax(320px, 470px) minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-layout > * { min-width: 0; }
@media (max-width: 1180px) { .msg-layout { grid-template-columns: minmax(0, 1fr); } }
.msg-list { list-style: none; margin: 0; padding: 0; }
.msg-item { display: grid; gap: 3px; width: 100%; min-width: 0; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); cursor: pointer; font: inherit; }
.msg-item .msg-subj, .msg-item .hint { overflow-wrap: anywhere; }
.msg-item:hover, .msg-item.on { background: var(--surface-2); }
.msg-item.unread .msg-subj { font-weight: 700; }
.msg-item .chip { justify-self: start; }
.msg-statement { margin: 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--surface); font-size: 13px; line-height: 1.5; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.msg-hint { padding: 10px 12px; margin: 0; border-bottom: 1px solid var(--border); }
.msg-hint .input { width: 100%; }
.msg-tools { flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.msg-guide { display: grid; gap: 6px; }
.msg-guide h3.k-label { margin: 10px 0 0; }
.msg-guide p { margin: 0; }
.msg-steps { margin: 0; padding-left: 22px; display: grid; gap: 4px; line-height: 1.5; }
.msg-command { display: grid; gap: 6px; }
.est-h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 6px 0 4px; }
.est-forecast { margin-top: 14px; }
.est-forecast summary { cursor: pointer; margin-bottom: 8px; }
.est-override { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.est-pdf { width: 100%; height: 72vh; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.est-pay td { vertical-align: top; }
.est-years { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; display: grid; gap: 4px; font-size: 13px; }
.est-years-head { font-weight: 600; margin-bottom: 2px; }
.est-year { display: grid; grid-template-columns: 1fr auto 52px; gap: 8px; }
.est-year span:nth-child(2), .est-year span:nth-child(3) { text-align: right; }
.est-year-total { border-top: 1px solid var(--border); padding-top: 4px; font-weight: 600; }
.est-rowlabel { display: inline-flex; align-items: center; gap: 4px; }
.est-pay td { white-space: nowrap; }
.est-pay td:first-child { white-space: normal; }
/* Estimator money and percent inputs (same width, right-aligned, sign attached, no spinner). */
.est-adorn { display: inline-flex; align-items: center; width: 128px; height: 32px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); }
.est-adorn:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.est-adorn.bad { border-color: var(--p1); }
.est-adorn.disabled { opacity: .55; }
.est-adorn-sign { padding: 0 8px; color: var(--text-muted); font-size: 13px; }
.est-adorn input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); text-align: right; font: inherit; font-variant-numeric: tabular-nums; padding: 0 8px 0 4px; outline: none; }
.est-adorn-sign + input { padding-left: 0; }
.est-adorn input::placeholder { color: var(--text-muted); opacity: 1; }
.est-adorn input::-webkit-outer-spin-button, .est-adorn input::-webkit-inner-spin-button,
.est-lines input::-webkit-outer-spin-button, .est-lines input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.est-adorn input[type=number], .est-lines input[type=number] { -moz-appearance: textfield; }
.est-price td { vertical-align: middle; }
.est-price td:nth-child(5) { width: 64px; }
.est-price-total td { border-top: 1px solid var(--border-strong); }
.est-lines .est-n { width: 80px; font-variant-numeric: tabular-nums; }
.est-adorn input:focus, .est-adorn input:focus-visible { outline: none; box-shadow: none; border: 0; }
.est-pick { width: auto; min-width: 220px; height: 32px; min-height: 0; padding: 0 8px; }
.est-price .est-adorn { width: 118px; }
.est-breakdown { margin-top: 12px; }
.est-breakdown .tbl td { padding-top: 4px; padding-bottom: 4px; }

/* CMMS (live/cmms.js): the SLA clock on work orders; red once the response or resolution time is missed. */
.sla-chip { white-space: nowrap; }
.sla-chip svg { width: 13px; height: 13px; }
.sla-bad { background: var(--p1-soft); color: var(--p1-ink); }

/* CMMS configuration (live/cmmsconfig.js) and Outcomes (live/outcomes.js). A Multi is a group of
   checkboxes drawn as chips: keyboard and screen readers get a plain fieldset of checkboxes. */
.multi-field { border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
.multi-field legend { font-size: 12.5px; font-weight: 600; color: var(--text-muted); padding: 0; margin-bottom: 4px; }
.multi { display: flex; flex-wrap: wrap; gap: 6px; }
.multi label { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; cursor: pointer; background: var(--surface-2); }
.multi label.on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.multi input { margin: 0; }
.outcome-drill { border-top: 1px solid var(--border); padding-top: 10px; }
.outcome-drill ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.kpi.clickable { cursor: pointer; text-align: left; font: inherit; color: inherit; }
.kpi.clickable:hover { border-color: var(--accent-ink); }
.kpi .k-value.bad, .tbl td.bad { color: var(--p1-ink); }

/* CMMS C7: the PM calendar (live/cmms.js Schedule). A 7-column grid; a week view has taller days. */
.pm-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border-top: 1px solid var(--border); }
.pm-wd { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--surface-2); text-transform: uppercase; letter-spacing: .03em; }
.pm-day { min-height: 92px; padding: 6px; background: var(--surface); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pm-cal.week .pm-day { min-height: 220px; }
.pm-day.other { background: var(--surface-2); color: var(--text-muted); }
.pm-day.today .pm-n { background: var(--accent); color: #fff; }
.pm-day.late { box-shadow: inset 3px 0 0 var(--p1); }
.pm-n { align-self: flex-start; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pm-run { display: block; width: 100%; text-align: left; border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; font: inherit; font-size: 12px; line-height: 1.3; color: var(--text); background: var(--surface-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-run:hover { border-color: var(--accent-ink); }
.pm-run.open { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.pm-run.done { text-decoration: line-through; opacity: .7; }
.pm-run.missed { background: var(--p1-soft); color: var(--p1-ink); border-color: transparent; }
@media (max-width: 720px) { .pm-day { min-height: 64px; padding: 4px; } .pm-run { font-size: 11px; padding: 1px 4px; } }

/* CMMS C8: attachments on a work order (photos and PDFs). */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; padding: 12px 14px; }
.att-grid.compact { padding: 0; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.att { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.att img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.att-doc { display: flex; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 4 / 3; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 600; text-decoration: none; }
.att figcaption { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; }
.att figcaption .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* CMMS C9: the cloud Reports page (live/cmmsreports.js): the health score's inputs. */
.health-inputs { display: grid; gap: 6px; }
.health-inputs .bar { flex: 1; }

/* CMMS C8: the technician's phone screens (live/mobilework.js) on top of the Operator view's op-* classes. */
.op-sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #E6E9EF; background: rgba(255, 255, 255, .12); border: 0; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.op-sync .op-dot { width: 8px; height: 8px; border-radius: 50%; background: #16A34A; }
.op-sync.off .op-dot { background: #D97706; }
.op-sync.busy .op-dot { background: #7C3AED; }
.op-banner { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; font-size: 13px; background: var(--p3-soft); color: var(--p3-ink); margin-bottom: 10px; }
.op-banner.bad { background: var(--p1-soft); color: var(--p1-ink); }
.op-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-muted); }
.op-chip.bad { background: var(--p1-soft); color: var(--p1-ink); }
.op-chip.warn { background: var(--p3-soft); color: var(--p3-ink); }
.op-field { display: flex; flex-direction: column; gap: 4px; }
.op-field label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.op-field .input, .op-field .select, .op-field .textarea { min-height: 44px; font-size: 16px; }
.op-task { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.op-task input[type="checkbox"] { width: 24px; height: 24px; flex: none; }
.op-task .input { min-height: 40px; width: 110px; font-size: 16px; }
.op-sheet { max-height: 85vh; overflow-y: auto; }
.op-sheet .op-field + .op-field { margin-top: 8px; }
.op-btn.wide { width: 100%; justify-content: center; }
.op-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* CMMS C10: parts and inventory (live/cmmsparts.js). */
.hint.bad { color: var(--p1-ink); }
.chip.chip-accent { background: var(--accent-soft); color: var(--accent-ink); }

/* CMMS C12: possible causes from the twin and benchmarks (live/cmmstwin.js). */
.rc-cand { padding: 8px 0; border-top: 1px solid var(--border); }
.rc-cand:first-child { border-top: 0; padding-top: 0; }
.rc-rank { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-how summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.rc-formula { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 6px; padding: 6px 8px; margin: 0; }
.bm-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); display: grid; gap: 8px; }
.bm-card.compact { padding: 8px 10px; }
.bm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
@media (max-width: 720px) { .bm-grid { grid-template-columns: 1fr; } }

/* ROI calculator (staff pre-sales value scenarios, live/roi.js); shares the Estimator's layout classes. */
.roi-tier-verified { background: rgba(22, 163, 74, .12); color: #15803D; }
.roi-tier-observed { background: var(--accent-soft); color: var(--accent-ink); }
.roi-tier-scenario { background: var(--p3-soft); color: var(--p3-ink, var(--p3)); }
.roi-tier-estimate { background: var(--p1-soft); color: var(--p1-ink, var(--p1)); }
.roi-grade-A { background: rgba(22, 163, 74, .12); color: #15803D; }
.roi-grade-B { background: var(--accent-soft); color: var(--accent-ink); }
.roi-grade-C { background: var(--p3-soft); color: var(--p3-ink, var(--p3)); }
.roi-grade-D { background: var(--p1-soft); color: var(--p1-ink, var(--p1)); }
.roi-comps { display: grid; gap: 6px; }
.roi-comp { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.roi-comp .num { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 90px; text-align: right; }
.roi-checks { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.roi-inputs td:first-child { min-width: 220px; }
.roi-missing td:first-child { box-shadow: inset 3px 0 0 var(--p3); }
.roi-grade { height: 28px; min-height: 0; padding: 2px 6px; font-size: 12px; }
.roi-date { width: 96px; text-align: left; }
.roi-collapsed .panel-body { display: none; }
.roi-total { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); }
.roi-tot { width: 100%; font-size: 12.5px; }
.roi-tot td, .roi-tot th { padding: 4px 6px; }
.roi-h { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin: 12px 0 6px; }
.roi-seglist { display: grid; gap: 2px; }
.roi-seglist .menu-item { text-align: left; white-space: normal; }
/* A framed tool's instructions use the page's full width (user, 2026-10-15), not the 70ch reading measure. */
.page-head:has(+ .live-tool-frame) .title { flex: 1 1 100%; }
.page-head:has(+ .live-tool-frame) p { max-width: none; }
/* Agents and AI models (live/agents.js, live/aimodels.js; ops-agents §6-§9). */
.ag-code { display: flex; gap: 8px; align-items: flex-start; }
.ag-code pre { flex: 1 1 auto; min-width: 0; margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.ag-err { color: var(--p1-ink); }
.ag-contact { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px 4px; min-width: 0; }
.ag-contact legend { font-weight: 600; padding: 0 4px; }
.chip.sev-critical { background: var(--p1-soft); color: var(--p1-ink); }
.chip.sev-warning { background: var(--p3-soft); color: var(--p3-ink); }
.plain-list { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
/* An incident brief: what happened, why it matters, numbered steps, then check (live/agents.js). */
.brief h4 { margin: 10px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.brief h4:first-child { margin-top: 0; }
.brief p { margin: 0; font-size: 13.5px; }
.brief ol, .brief ul { margin: 2px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; }
.brief-card { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.staff-notice-group { display: grid; gap: 4px; margin: 10px 0; }
.staff-notice-row { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }
.staff-notice-switches { gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.staff-notice-switches .field { max-width: 240px; }
/* Settings ▸ PeakLogic staff (live/staff.js; docs/design/staff-accounts.md). At phone width each row is a card. */
.staff-table td > .hint { display: block; margin-top: 2px; }
.staff-table td > .chip + .hint { margin-top: 4px; }
.staff-table td > .chip { justify-self: start; }
.staff-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.staff-link { display: flex; gap: 8px; flex-wrap: nowrap; margin: 8px 0; }
.staff-link input { flex: 1 1 auto; min-width: 0; }
.staff-foot { padding: 10px 14px; margin: 0; border-top: 1px solid var(--border); }
.staff-roles { display: flex; flex-direction: column; gap: 8px; }
.staff-role { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.staff-role input { margin-top: 3px; flex: none; }
.staff-role > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
@media (max-width: 720px) {
  .staff-table thead { display: none; }
  .staff-table, .staff-table tbody, .staff-table tr { display: block; width: 100%; }
  .staff-table tr { border-top: 1px solid var(--border); padding: 10px 14px; }
  .staff-table tr:first-child { border-top: 0; }
  .staff-table td { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 2px 10px; padding: 4px 0; border: 0; }
  .staff-table td::before { content: attr(data-label); grid-row: 1 / span 3; font-size: 12px; font-weight: 600; color: var(--text-muted); padding-top: 2px; }
  .staff-table td > * { grid-column: 2; min-width: 0; overflow-wrap: anywhere; }
  .staff-table td.staff-who, .staff-table td[data-label=""] { grid-template-columns: minmax(0, 1fr); }
  .staff-table td.staff-who::before, .staff-table td[data-label=""]::before { content: none; }
  .staff-table td.staff-who > *, .staff-table td[data-label=""] > * { grid-column: 1; }
  .staff-actions { justify-content: flex-start; padding-top: 4px; }
  .staff-link { flex-wrap: wrap; }
}

/* Change password form (Profile and settings ▸ Sign-in and security, 2026-10-15) */
.pw-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pw-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted); }

/* Add asset form and commissioning (live/assetwizard.js, docs/design/asset-onboarding.md §2.4, 2026-10-15) */
.chip.chip-warn { background: var(--p2-soft); color: var(--p2-ink); }
.asset-stage { font-size: 11px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }

/* Process simulator fleet view (live/processfleet.js, docs/PROCESS_SIMULATOR.md) */
.pf-chip.pf-ok { background: var(--accent-soft); color: var(--accent-ink); }
.pf-chip.pf-warn { background: var(--p2-soft); color: var(--p2-ink); }
.pf-chip.pf-bad { background: var(--p1-soft); color: var(--p1-ink); }
.pf-bad-text { color: var(--p1-ink); }
.pf-site.pf-has-alarm { border-left: 4px solid var(--p1-ink); }
.pf-site.pf-stale:not(.pf-has-alarm) { border-left: 4px solid var(--p2-ink); }
.pf-row-alarm td:first-child { box-shadow: inset 3px 0 0 var(--p1-ink); }
.pf-vals { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.pf-val { display: inline-flex; gap: 6px; align-items: baseline; white-space: nowrap; }

/* Engineering menu bar: File, Devices, Tags (live.js EngMenuBar, docs/design/engineering-menus.md) */
.eng-menubar { display: flex; align-items: center; gap: 2px; margin: 0 0 10px; padding: 2px 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.eng-menubar-btn { font-weight: 600; }
.eng-menubar-btn[aria-expanded="true"] { background: var(--surface-3); }
.eng-menubar .menu-item { justify-content: space-between; }
.eng-menubar-project { margin-left: auto; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40ch; }
.eng-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 10px; }
.eng-toolbar-sep { width: 1px; align-self: stretch; margin: 2px 4px; background: var(--border); }
.eng-unsaved { color: var(--p2-ink); font-weight: 600; }
tr.is-selected td { background: var(--accent-soft); }

/* Google Places address search on Add site and Site settings (live/maps.js); its own element, in the page's theme. */
.place-search gmp-place-autocomplete { display: block; width: 100%; color-scheme: light; }
[data-theme="dark"] .place-search gmp-place-autocomplete { color-scheme: dark; }
/* Drawing editors near full screen (live.js PL.EditorFrame; user 2026-10-31): HMI drawings, Site Designer,
   Panel Builder fill the window under the top bar, with one thin strip; Full screen uses the whole screen. */
.editor-stage { display: flex; flex-direction: column; }
.editor-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--border, #E2E8F0); border-radius: 8px; background: var(--surface, #fff); margin-top: 8px; }
.editor-strip-title { margin-right: 6px; white-space: nowrap; }
.editor-strip-gap { flex: 1 1 auto; }
/* `.field` (app.css) stacks label over control; in the strip the organization sits beside its drop-down (user, 2026-11-05). */
.editor-strip-field { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.editor-strip-field > .muted { white-space: nowrap; }
.editor-strip-field select { padding: 2px 6px; }
.editor-stage .editor-frame { margin-top: 4px; }
.editor-stage.is-max { position: fixed; top: var(--top-h, 56px); left: 0; right: 0; bottom: 0; z-index: 19; padding: 4px 6px 6px; background: var(--bg, #F5F5FB); }
/* The PeakAssist dock is a column beside the page (app.css .assist, --assist-w) with no layer of its own, so a
   maximised editor covered it (2026-11-14). With the dock open the editor ends where the dock starts. Below 1180 px
   the dock floats over the page on its own layer (app.css), so the editor keeps the whole width there. */
.editor-stage.is-max.beside-assist { right: var(--assist-w, 400px); }
@media (max-width: 1180px) { .editor-stage.is-max.beside-assist { right: 0; } }
.editor-stage.is-max .editor-strip { margin-top: 0; }
.editor-stage.is-max .editor-frame { flex: 1 1 auto; height: auto; min-height: 0; margin: 4px 0 0; }
.editor-stage:fullscreen { position: fixed; inset: 0; padding: 4px 6px 6px; background: var(--bg, #F5F5FB); }
.editor-stage:fullscreen .editor-strip { margin-top: 0; }
.editor-stage:fullscreen .editor-frame { flex: 1 1 auto; height: auto !important; min-height: 0; margin: 4px 0 0; }
body.editor-maximised { overflow: hidden; }

/* Device catalog tree (Add device): groups expand into sub-groups (user 2026-10-31) */
.catalog-tree { display: flex; flex-direction: column; gap: 4px; }
.catalog-group > summary { cursor: pointer; padding: 6px 8px; border-radius: 6px; background: var(--surface-2, rgba(127,127,127,.08)); }
.catalog-sub { margin: 2px 0 2px 18px; }
.catalog-sub > summary { cursor: pointer; padding: 4px 6px; }
.catalog-group > table, .catalog-sub > table { margin: 2px 0 6px 18px; width: calc(100% - 18px); }

/* The staff customer picker (live.js OrgPicker, user 2026-11-05): a search box with a list under it */
.org-picker { position: relative; min-width: 260px; max-width: 420px; flex: 1 1 260px; }
.org-picker > label { display: block; margin-bottom: 4px; }
.org-picker-row { display: flex; gap: 6px; align-items: center; }
.org-picker-list { position: absolute; left: 0; right: 0; z-index: 30; margin: 4px 0 0; padding: 4px; list-style: none; max-height: 300px; overflow: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.org-picker-list li { padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.org-picker-list li.active, .org-picker-list li:hover { background: var(--surface-2); }
.org-picker-list li.muted { cursor: default; }

/* Projects: the open project's name next to the page title (user 2026-10-31) */
.page-head-name { margin-left: 12px; padding: 2px 12px; border-radius: 8px; font-weight: 700; color: var(--accent, #7c3aed); background: color-mix(in srgb, var(--accent, #7c3aed) 14%, transparent); white-space: nowrap; max-width: 48ch; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }

/* CSR wall on real data (live/csrwall.js): a faceplate lists the site's first values, alarmed ones first. */
.csrw-mlist { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }
.csrw-mlist li { display: flex; justify-content: space-between; gap: 8px; font-size: .92em; color: var(--text-muted); }
.csrw-mlist li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csrw-mlist li b { color: var(--text); font-weight: 600; }
.csrw-mlist li b small { margin-left: 2px; color: var(--text-muted); font-weight: 400; }
.csrw-mlist li.on b { color: var(--p2); }
.csrw-hub.stale { color: var(--p2); }

/* Idle sign-out warning on desk PCs (live/deskidle.js, docs/design/service-desk.md SD-9). */
.desk-idle-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 10000; padding: 10px 16px; text-align: center; font-weight: 600; background: var(--p1-soft); color: var(--p1-ink); border-bottom: 2px solid var(--p1); }
