/* The dashboard shell, shared by every tenant (moved from site/safeharbor/dashboard.css,
   Oct 20 2026, so the Safe Harbor page and the Quail Creek page draw from one file).
   Brand tokens a tenant wants to change go in that tenant's own small stylesheet,
   loaded after this one. Safe Harbor client dashboard, reworked 2026-09-30 (Jeff: less like an AI
   built it, more like a standard professional SaaS dashboard, colorful KPI
   tiles up top). Light ground, white cards, bold sans throughout, no
   display serif, no dark-mode glow. Navy and gold are Safe Harbor's own
   brand colors, sampled directly from their site; the rest of the KPI
   palette is picked to read as an ordinary analytics product, the way the
   Coupler.io reference Jeff sent does. Nothing bounces or spins. */
:root {
  --bg: #F3F5F9;
  --bg-2: #FFFFFF;
  --card: #FFFFFF;
  --card-2: #F6F7FB;
  --text: #16233A;
  --text-2: #5B6B85;
  --text-3: #8B96A8;
  --champagne: #F6AD12;
  --highlight: #D89000;
  --border: rgba(22, 35, 58, 0.09);
  --border-2: rgba(22, 35, 58, 0.16);
  --good-bg: #E4F5EA;
  --good: #1E9A52;
  --navy: #1B3A6B;
  --kpi-c1: #1B3A6B;
  --kpi-c2: #F0A93C;
  --kpi-c3: #12A594;
  --kpi-c4: #7C6FE0;
  --kpi-c5: #E85D75;
  --kpi-c6: #35618C;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --r1: 8px; --r2: 14px; --r3: 16px;
  --shadow: 0 1px 2px rgba(22,35,58,0.04), 0 8px 24px rgba(22,35,58,0.06);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --wrap: 1180px; --gutter: clamp(20px, 5vw, 56px);
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
button { font: inherit; color: inherit; }

/* ---------- Login ---------- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); background: var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r3); padding: 40px 36px; box-shadow: var(--shadow); text-align: center; }
.login-card img { height: 46px; margin: 0 auto 28px; }
.login-card h1 { font-weight: 700; font-size: 1.4rem; margin: 0 0 6px; color: var(--navy); }
.login-card p.sub { color: var(--text-2); font-size: 0.9rem; margin: 0 0 28px; }
.login-card input[type="password"], .login-card input[type="text"] { width: 100%; padding: 14px 16px; background: var(--card-2); border: 1px solid var(--border-2); border-radius: var(--r1); color: var(--text); font-size: 1rem; margin-bottom: 16px; }
.login-card input[type="password"]:focus, .login-card input[type="text"]:focus { outline: 2px solid var(--champagne); outline-offset: 2px; }
.login-card .btn { width: 100%; padding: 14px; background: var(--champagne); color: #2B1B00; border-radius: var(--r1); font-weight: 700; font-size: 0.95rem; cursor: pointer; border: none; }
.login-card .btn:hover { background: var(--highlight); color: #fff; }
.login-card .setup-note { font-size: 0.8rem; color: var(--text-3); margin: 20px 0 0; }
.login-card .err { color: #C0392B; background: #FCEEEC; border-radius: var(--r1); padding: 10px 12px; font-size: 0.86rem; margin: -6px 0 16px; }
.login-card .status { font-size: 0.84rem; color: var(--text-2); margin: 16px 0 0; }

/* ---------- Dashboard shell, reworked Oct 16 2026 ----------
   Jeff: a left rail like the ICarePro reference, white cards on a cool gray
   canvas, and each metric drawn in the form that matches its meaning. Rings
   for a number against a goal, lines for a number over time, bars for
   numbers against each other, a plain figure for a count with neither.
   Color is state only: on pace, at risk, behind, no goal. Navy and gold are
   the chrome and never mean anything. */
:root {
  --on: #1E9A52; --on-bg: #E4F5EA;
  --warn: #D89000; --warn-bg: #FFF3D6;
  --off: #C0392B; --off-bg: #FCEEEC;
  --none: #8B96A8; --none-bg: #EEF1F6;
  --ink: #1B3A6B; --ink-soft: #AFC0DC; --ink-faint: #E3E9F3;
  --rail: 232px;
}
.sh-nav { border-bottom: 1px solid var(--border); background: var(--card); position: sticky; top: 0; z-index: 20; }
.sh-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 28px; }
.sh-brand { display: flex; align-items: center; gap: 14px; }
.sh-brand img { height: 36px; }
.sh-nav-right { display: flex; align-items: center; gap: 14px; }
.sh-asof { font-size: 0.82rem; font-weight: 600; color: var(--text-2); background: var(--card-2); border: 1px solid var(--border); padding: 8px 14px; border-radius: var(--r1); }
.sh-nav button.logout { font-size: 0.86rem; font-weight: 600; color: var(--navy); background: var(--card-2); border: 1px solid var(--border-2); padding: 9px 16px; border-radius: var(--r1); transition: border-color 180ms var(--ease), background 180ms var(--ease); }
.sh-nav button.logout:hover { border-color: var(--champagne); background: #FFF6E4; }

.sh-shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sh-rail { background: var(--card); border-right: 1px solid var(--border); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 68px; align-self: start; height: calc(100vh - 68px); }
.sh-rail-nav.stage-tabs { flex-direction: column; gap: 4px; }
.sh-rail-nav.stage-tabs button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 14px; border: 0; border-radius: 10px; font-size: 0.92rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-2); background: none; }
.sh-rail-nav.stage-tabs button::before { content: ""; width: 20px; height: 20px; flex: 0 0 20px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; opacity: 0.85; }
.sh-rail-nav.stage-tabs button:hover { background: var(--card-2); color: var(--text); }
.sh-rail-nav.stage-tabs button[aria-selected="true"] { background: #EAF0FA; color: var(--navy); border-bottom-color: transparent; }
.sh-rail-nav.stage-tabs button[data-pane="list"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11l3 3L22 4'/%3E%3Cpath d='M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11'/%3E%3C/svg%3E"); }
.sh-rail-nav.stage-tabs button[data-pane="reports"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M16 13H8M16 17H8M10 9H8'/%3E%3C/svg%3E"); }
.sh-rail-nav.stage-tabs button[data-pane="metrics"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E"); }
.sh-rail-nav.stage-tabs button[data-pane="sales"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 15l4-4 3 3 6-7'/%3E%3C/svg%3E"); }
.sh-rail-nav.stage-tabs button[data-pane="marketing"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l18-7-7 18-2-8z'/%3E%3C/svg%3E"); }
.sh-rail-legend { margin-top: auto; display: grid; gap: 6px; padding: 14px 14px 4px; border-top: 1px solid var(--border); font-size: 0.76rem; color: var(--text-3); }
.sh-rail-legend span { display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 9px; }
.dot.on { background: var(--on); } .dot.warn { background: var(--warn); } .dot.off { background: var(--off); } .dot.none { background: var(--none); }

.sh-main { padding: 26px 28px 40px; min-width: 0; }
.sh-kpi-wrap { padding: 0; }
.sh-kpi-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.sh-kpi-head h2 { font-weight: 800; font-size: 1.35rem; margin: 0; color: var(--navy); letter-spacing: -0.01em; }
.sh-kpi-head .note { font-size: 0.82rem; color: var(--text-3); }

/* ---------- Tiles ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-content: start; }
.stage-panes > [data-pane] { align-self: start; }
.kpi:has(> .kpi-viz.ring) .label, .kpi:has(> .kpi-viz.ring) .explain { padding-right: 64px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--r2); padding: 16px 18px 14px; min-height: 124px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); transition: transform 180ms var(--ease), box-shadow 180ms var(--ease); color: var(--text); position: relative; }
.kpi:hover { transform: translateY(-2px); }
.kpi .label { font-size: 0.8rem; font-weight: 600; color: var(--text-2); line-height: 1.3; }
.kpi .value { font-weight: 800; font-size: 1.75rem; margin-top: 6px; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi .tag { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); background: var(--none-bg); align-self: flex-start; margin-top: 10px; padding: 3px 8px; border-radius: 999px; }
.kpi .explain { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; line-height: 1.3; }
.kpi.live { cursor: pointer; outline: none; }
.kpi.live:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--navy); }
.kpi.live[aria-expanded="true"] { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy), var(--shadow); }
.kpi.live[data-state="on"] .tag { background: var(--on-bg); color: var(--on); }
.kpi.live[data-state="warn"] .tag { background: var(--warn-bg); color: #8A5B00; }
.kpi.live[data-state="off"] .tag { background: var(--off-bg); color: var(--off); }
.kpi.live[data-state="none"] .tag { background: var(--none-bg); color: var(--text-2); }
.kpi .kpi-viz { position: absolute; right: 14px; top: 14px; }
.kpi .kpi-viz.spark { position: static; margin-top: 10px; width: 100%; height: 34px; }
@media (max-width: 1300px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .kpi-grid { grid-template-columns: 1fr; } }

/* The rich boards (Sales, Marketing): stat tiles, then charts, then a list. */
.kpi-grid.sh-board { display: block; }
.sh-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.sh-stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sh-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.sh-row.wide { grid-template-columns: 1fr; }
.sh-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r2); box-shadow: var(--shadow); padding: 18px 20px 16px; min-width: 0; }
.sh-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sh-card-head h3 { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--text); }
.sh-card-head .sub { font-size: 0.76rem; color: var(--text-3); }
.sh-foot { margin-top: 14px; font-size: 0.78rem; color: var(--text-3); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sh-foot a { color: var(--navy); font-weight: 600; text-decoration: none; }
.sh-foot a:hover { text-decoration: underline; }
.sh-asterisk { color: var(--text-2); }
@media (max-width: 1100px) { .sh-stats, .sh-stats.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sh-row { grid-template-columns: 1fr; } }

/* Rings: a number against a goal. The arc is progress, the tick is where
   pace says you should be today, the color is the gap between them. */
.ring-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ring-item { text-align: center; padding: 6px 4px; }
.ring-item .ring-name { font-size: 0.8rem; font-weight: 700; color: var(--text); margin-top: 6px; }
.ring-item .ring-sub { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; line-height: 1.35; }
svg.ring { width: 104px; height: 104px; display: block; margin: 0 auto; }
svg.ring .track { fill: none; stroke: var(--ink-faint); stroke-width: 9; }
svg.ring .arc { fill: none; stroke-width: 9; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
svg.ring .over { fill: none; stroke-width: 9; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; opacity: 0.45; }
svg.ring .pace { stroke: var(--text); stroke-width: 2; }
svg.ring text.big { font-size: 20px; font-weight: 800; fill: var(--text); text-anchor: middle; font-family: var(--sans); }
svg.ring text.small { font-size: 9.5px; fill: var(--text-3); text-anchor: middle; font-family: var(--sans); }
.state-on { stroke: var(--on); } .state-warn { stroke: var(--warn); } .state-off { stroke: var(--off); } .state-none { stroke: var(--none); }
.fill-on { fill: var(--on); } .fill-warn { fill: var(--warn); } .fill-off { fill: var(--off); } .fill-none { fill: var(--none); }
@media (max-width: 760px) { .ring-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Sparklines and bar charts. */
svg.spark { width: 100%; height: 34px; display: block; overflow: visible; }
svg.spark .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.spark .area { fill: var(--ink); opacity: 0.08; }
svg.spark .last { fill: var(--ink); }
svg.chart { width: 100%; height: 220px; display: block; overflow: visible; font-family: var(--sans); }
svg.chart text { font-size: 10.5px; fill: var(--text-3); }
svg.chart .grid { stroke: var(--ink-faint); stroke-width: 1; }
svg.chart .goal { stroke: var(--champagne); stroke-width: 2; stroke-dasharray: 5 4; }
svg.chart .goal-label { fill: var(--highlight); font-weight: 700; }
svg.chart rect.bar { fill: var(--ink); rx: 3; }
svg.chart rect.bar.partial { fill: var(--ink-soft); }
svg.chart rect.bar:hover, svg.chart rect.seg:hover { opacity: 0.8; }
svg.chart rect.seg { rx: 2; }
svg.chart .s1 { fill: #1B3A6B; } svg.chart .s2 { fill: #35618C; } svg.chart .s3 { fill: #7FA3CC; } svg.chart .s4 { fill: #C7D6EA; }
svg.chart .line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
svg.chart .pt { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.74rem; color: var(--text-3); margin-top: 8px; }
.chart-legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

/* Horizontal bars: a funnel or a comparison across names. */
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 72px; align-items: center; gap: 10px; font-size: 0.82rem; }
.hbar .nm { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .nm small { display: block; font-weight: 400; color: var(--text-3); font-size: 0.7rem; }
.hbar .trk { height: 12px; background: var(--ink-faint); border-radius: 4px; overflow: hidden; position: relative; }
.hbar .trk i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); border-radius: 4px; }
.hbar .trk i.b { background: var(--champagne); height: 5px; top: auto; bottom: 0; }
.hbar .n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.hbar .n small { display: block; font-weight: 400; color: var(--text-3); font-size: 0.7rem; }
@media (max-width: 560px) { .hbar { grid-template-columns: 100px 1fr 64px; } }

/* Chips and the practice area table. */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--none-bg); color: var(--text-2); white-space: nowrap; }
.chip.on { background: var(--on-bg); color: var(--on); } .chip.warn { background: var(--warn-bg); color: #8A5B00; } .chip.off { background: var(--off-bg); color: var(--off); }
.chip.up { color: var(--on); background: var(--on-bg); } .chip.down { color: var(--off); background: var(--off-bg); }
.pill { display: inline-block; font-size: 0.78rem; font-weight: 600; border-radius: 999px; padding: 4px 11px; margin: 0 6px 6px 0; border: 1px solid var(--border); background: var(--card-2); color: var(--text-2); }
.pill.inc { border-color: #BFE3CD; background: var(--on-bg); color: #1F6B41; }
.pill.red { border-color: #F2CFC8; background: var(--off-bg); color: #9A3A28; }
table.sh-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.sh-table th, .sh-table td { padding: 9px 8px; text-align: right; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sh-table th { color: var(--text-3); font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; border-top: 0; }
.sh-table th:first-child, .sh-table td:first-child { text-align: left; }
.sh-table td.nm { font-weight: 700; }
.sh-table td.muted { color: var(--text-3); }
.sh-table .mini { display: inline-block; height: 7px; background: var(--ink-soft); border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.sh-scroll { overflow-x: auto; }

@media (max-width: 900px) {
  .sh-shell { grid-template-columns: 1fr; }
  .sh-rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px 12px; }
  .sh-rail-nav.stage-tabs { flex-direction: row; overflow-x: auto; }
  .sh-rail-nav.stage-tabs button { width: auto; padding: 9px 12px; }
  .sh-rail-legend { display: none; }
  .sh-main { padding: 18px 16px 32px; }
  .sh-nav-inner { padding: 0 16px; }
  .sh-asof { display: none; }
}

/* ---------- The Chief panel (guide.js mounts inline here) ---------- */
.sh-chief-wrap { padding: 22px 0 0; }
.sh-chief-mount { background: var(--card); border: 1px solid var(--border); border-radius: var(--r3); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.sh-upload-panel { background: var(--card); border: 1px solid var(--border); border-top: none; border-bottom-left-radius: var(--r3); border-bottom-right-radius: var(--r3); padding: 0 26px 22px; }
.guide-panel.inline { position: relative; z-index: 1; display: flex; flex-direction: column; padding: 24px 26px 22px; }
.guide-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.guide-name { font-weight: 700; font-size: 1.1rem; margin: 0; color: var(--navy); }
.guide-head-tools { display: flex; align-items: center; gap: 12px; }
.guide-live { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--good); background: var(--good-bg); padding: 5px 10px; border-radius: 999px; }
.guide-min, .guide-dock { width: 30px; height: 30px; border: 1px solid var(--border-2); border-radius: var(--r1); background: var(--card-2); cursor: pointer; color: var(--text-2); }
.guide-min:hover, .guide-dock:hover { border-color: var(--champagne); color: var(--navy); }
.chat-log { display: flex; flex-direction: column; gap: 12px; max-height: 360px; min-height: 160px; overflow-y: auto; padding: 4px 2px 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.chat-msg { max-width: 78%; padding: 11px 15px; border-radius: 14px; font-size: 0.95rem; line-height: 1.5; }
.chat-msg.staff { align-self: flex-start; background: var(--card-2); color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg.visitor { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.notice { align-self: center; color: var(--text-2); background: none; font-size: 0.85rem; font-style: italic; }
.chat-msg.staff.spoken { box-shadow: inset 0 0 0 1px var(--border-2); }
.chat-msg.visitor.spoken { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35); }
.chat-msg.partial { opacity: 0.6; }


.chat-form { display: flex; gap: 10px; }
.chat-form input { flex: 1; padding: 13px 16px; background: var(--card-2); border: 1px solid var(--border-2); border-radius: var(--r1); color: var(--text); font-size: 0.95rem; }
.chat-form input:focus { outline: 2px solid var(--champagne); outline-offset: 2px; }
.chat-form button { padding: 13px 22px; background: var(--champagne); color: #2B1B00; border-radius: var(--r1); font-weight: 700; cursor: pointer; white-space: nowrap; }
.chat-form button:hover { background: var(--highlight); color: #fff; }
.chat-form button:disabled { opacity: 0.5; cursor: default; }
.chat-form select.guide-mode { flex: 0 0 auto; max-width: 40%; padding: 13px 14px; background: var(--card-2); border: 1px solid var(--border-2); border-radius: var(--r1); color: var(--text); font-size: 0.88rem; }
.chat-form select.guide-mode:focus { outline: 2px solid var(--champagne); outline-offset: 2px; }
@media (max-width: 520px) { .chat-form select.guide-mode { max-width: none; flex-basis: 100%; } }

.guide-voice { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.guide-vrow { display: flex; align-items: center; gap: 12px; }
.guide-talk, .guide-stop { padding: 11px 18px; border-radius: var(--r1); font-size: 0.88rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border-2); background: var(--card-2); color: var(--navy); }
.guide-talk:hover:not(:disabled) { border-color: var(--champagne); background: #FFF6E4; }
.guide-talk:disabled { opacity: 0.4; cursor: default; }
.guide-stop { border-color: rgba(192,57,43,0.35); background: #FCEEEC; color: #C0392B; }
.guide-stop:hover { background: #F9DEDA; }
.guide-vstate { color: var(--navy); font-weight: 500; font-size: 0.84rem; margin: 0; }
.guide-voice > label { display: flex; align-items: flex-start; gap: 8px; font-size: 0.78rem; color: var(--text-3); max-width: 40ch; cursor: pointer; }
.guide-voice > label input { margin-top: 3px; }

.sh-upload { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.sh-upload label.btn { padding: 11px 18px; border: 1px solid var(--border-2); border-radius: var(--r1); background: var(--card-2); font-weight: 600; font-size: 0.88rem; color: var(--text-2); cursor: pointer; }
.sh-upload label.btn.disabled { cursor: not-allowed; opacity: 0.55; pointer-events: none; }
.sh-upload input[type="file"] { display: none; }
.sh-upload .status { font-size: 0.84rem; color: var(--text-2); }


/* Docked/minimized/floating states used by guide.js when it lifts a desk
   into the corner mid-conversation; kept functional, kept out of the way. */
.guide-panel.floating { position: fixed; right: 20px; bottom: 20px; width: min(380px, calc(100vw - 40px)); max-height: 70vh; background: var(--card); border: 1px solid var(--border-2); border-radius: var(--r2); box-shadow: var(--shadow); z-index: 60; overflow-y: auto; }
.guide-panel.floating.min .chat-log, .guide-panel.floating.min .chat-form, .guide-panel.floating.min .guide-voice, .guide-panel.floating.min .sh-upload { display: none; }
.guide-placeholder { padding: 20px; border: 1px dashed var(--border-2); border-radius: var(--r2); text-align: center; color: var(--text-2); font-size: 0.88rem; }
.guide-placeholder button { margin-top: 10px; padding: 8px 14px; border: 1px solid var(--border-2); border-radius: var(--r1); background: var(--card-2); cursor: pointer; }

.sh-footer { padding: 22px 0 36px; color: var(--text-3); font-size: 0.8rem; border-top: 1px solid var(--border); background: var(--card); }

@media (max-width: 700px) {
  .sh-nav-inner { height: 64px; }
  .guide-panel.inline { padding: 20px 18px 18px; }
  .chat-msg { max-width: 88%; }
}

/* ---------- The shared notes (Oct 7 2026) ---------- */
:root { --notes-accent: #1B3A6B; }
.sh-top-notes { background: var(--card); border: 1px solid var(--border); border-radius: var(--r3); box-shadow: var(--shadow); padding: 18px 22px; }

/* A quiet desk (Oct 7 2026): no opening line, the text box right under the
   log, the mode picker in its own small row beneath it. */
.chat-log { min-height: 0; }
.chat-log:empty { display: none; }
.guide-modes { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 0.78rem; color: var(--text-3); }
.guide-modes-label { font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.guide-modes select.guide-mode { padding: 7px 10px; background: var(--card-2); border: 1px solid var(--border-2); border-radius: var(--r1); color: var(--text-2); font-size: 0.82rem; }

/* Under the text box (Oct 7 2026): mode picker left, Talk on the right under Send. */
.guide-under { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.guide-under .guide-modes { margin-top: 0; }
.guide-under .guide-voice { margin-top: 0; justify-content: flex-end; }

/* Talk in the text-box row, right of Send (Oct 7 2026). */
.chat-form .guide-vrow { display: flex; align-items: center; gap: 8px; }
.chat-form .guide-talk, .chat-form .guide-stop { padding: 13px 18px; }
.chat-form .guide-vstate { font-size: 0.8rem; max-width: 22ch; }
.guide-voice:empty { display: none; }
.guide-under:has(.guide-voice:empty) { justify-content: flex-start; }

/* The upload control in the row under the text box, right of the picker. */
.guide-modes .sh-upload { margin: 0 0 0 4px; padding: 0; border: 0; gap: 10px; }
.guide-modes .sh-upload label.btn { padding: 7px 12px; font-size: 0.78rem; border-radius: 999px; }
.guide-modes .sh-upload .status { font-size: 0.78rem; }
.guide-modes .sh-upload .status:empty { display: none; }
.sh-upload-panel { display: none; }

/* Live Metrics tiles (Ninety.io, Oct 9 2026): on track reads calm, off track reads warm. */

/* Metrics drill-down (Oct 11): tiles are buttons, the detail opens under the grid. */
.kpi-detail { grid-column: 1 / -1; background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; margin-top: 2px; }
.kpi-detail[hidden] { display: none; }
.kpi-detail-title { margin: 0 0 4px; font-size: 1rem; font-weight: 700; }
.kpi-detail-lead { margin: 0 0 12px; font-size: 0.85rem; color: #5b6673; line-height: 1.45; }
.kpi-detail-empty { margin: 0; font-size: 0.88rem; color: #5b6673; }
.kpi-detail-list { list-style: none; margin: 0; padding: 0; }
.kpi-detail-list .row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid #edf0f3; font-size: 0.88rem; }
.kpi-detail-list .row:first-child { border-top: none; }
.kpi-detail-list .main { font-weight: 600; }
.kpi-detail-list .meta { color: #5b6673; text-align: right; font-variant-numeric: tabular-nums; }
.kpi-detail-list .row.muted .meta { color: #9aa3ad; }
.kpi-detail-list .row.warn .meta { color: #B5482A; }
@media (max-width: 560px) { .kpi-detail-list .row { flex-direction: column; gap: 2px; } .kpi-detail-list .meta { text-align: left; } }
.kpi-detail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kpi-detail-open { font-size: 0.82rem; font-weight: 600; color: #fff; background: #1d2733; padding: 6px 12px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.kpi-detail-open:hover, .kpi-detail-open:focus-visible { background: #33475b; }

/* ---------- Documents (Oct 16 2026) ---------- */
.sh-rail-nav.stage-tabs button[data-pane="documents"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h10l6 6v10a2 2 0 0 1-2 2H4z'/%3E%3Cpath d='M14 4v6h6'/%3E%3Cpath d='M9 15l2 2 4-4'/%3E%3C/svg%3E"); }
.sh-docs { padding: 0; background: none; border: 0; box-shadow: none; }
.docs-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.docs-count { background: var(--card); border: 1px solid var(--border); border-radius: var(--r2); box-shadow: var(--shadow); padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.docs-count b { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; min-width: 44px; }
.docs-count span { font-size: 0.82rem; color: var(--text-2); font-weight: 600; }
.docs-count .ring { width: 48px; height: 48px; flex: 0 0 48px; }
.docs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.docs-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.docs-cats button { border: 1px solid var(--border); background: var(--card); color: var(--text-2); font: inherit; font-size: 0.82rem; font-weight: 600; padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.docs-cats button[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.docs-cats button .n { opacity: 0.7; margin-left: 6px; }
.docs-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.docs-tools .src { font-size: 0.76rem; color: var(--text-3); }
.docs-btn { border: 1px solid var(--border-2); background: var(--card-2); color: var(--navy); font: inherit; font-size: 0.82rem; font-weight: 600; padding: 7px 13px; border-radius: var(--r1); cursor: pointer; }
.docs-btn.primary { background: var(--champagne); border-color: var(--champagne); color: #2B1B00; }
.docs-btn:hover { border-color: var(--champagne); }
.docs-btn:disabled { opacity: 0.5; cursor: default; }
.docs-table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--r2); box-shadow: var(--shadow); overflow: hidden; }
table.docs-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.docs-table th { text-align: left; padding: 10px 14px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); background: var(--card-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.docs-table td { padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: top; }
.docs-table tr.doc { cursor: pointer; }
.docs-table tr.doc:hover td { background: #F8FAFD; }
.docs-table tr.doc[aria-expanded="true"] td { background: #EEF3FA; }
.docs-table .nm { font-weight: 700; color: var(--text); display: flex; align-items: flex-start; gap: 10px; }
.docs-table .nm .ico { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; background: var(--text-3); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E") center / contain no-repeat; }
.docs-table .nm small { display: block; font-weight: 400; color: var(--text-3); font-size: 0.74rem; margin-top: 2px; }
.docs-table .sum { color: var(--text-2); max-width: 46ch; }
.docs-table .sum.pre { font-style: italic; }
.docs-preview { margin: 0 0 10px; color: var(--text); line-height: 1.5; }
.docs-table .cnt { display: inline-flex; gap: 10px; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.docs-table .cnt i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.docs-table .cnt .on i { background: var(--on); } .docs-table .cnt .warn i { background: var(--warn); } .docs-table .cnt .off i { background: var(--off); }
.docs-table .cnt .zero { color: var(--text-3); font-weight: 500; }
.docs-table .when { color: var(--text-3); white-space: nowrap; font-size: 0.8rem; }
.docs-table tr.detail td { background: #F8FAFD; padding: 16px 18px 18px; border-top: 0; }
.doc-detail { display: grid; grid-template-columns: 1fr; gap: 10px; }
.doc-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.doc-detail-head .meta { font-size: 0.8rem; color: var(--text-3); }
.doc-detail-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.finding { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: start; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.finding .st { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.finding[data-state="on"] .st { background: var(--on); } .finding[data-state="warn"] .st { background: var(--warn); } .finding[data-state="off"] .st { background: var(--off); }
.finding .t { font-weight: 700; font-size: 0.9rem; }
.finding .q { margin: 6px 0 0; padding: 8px 12px; border-left: 3px solid var(--ink-soft); background: var(--card-2); color: var(--text-2); font-size: 0.84rem; line-height: 1.5; border-radius: 0 6px 6px 0; font-style: italic; }
.finding .a { margin-top: 6px; font-size: 0.84rem; color: var(--text); }
.finding .acts { display: flex; flex-direction: column; gap: 6px; }
.finding .acts button { font-size: 0.76rem; padding: 6px 10px; }
.finding .accepted { font-size: 0.74rem; color: var(--on); font-weight: 700; white-space: nowrap; }
.docs-empty { padding: 28px; text-align: center; color: var(--text-3); font-size: 0.9rem; }
.docs-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.76rem; color: var(--text-3); margin-top: 10px; }
@media (max-width: 900px) { .docs-strip { grid-template-columns: 1fr; } .docs-table .sum, .docs-table .when { display: none; } }

/* ---------- The detail drawer (Oct 17 2026) ---------- */
.sh-drawer-back { position: fixed; inset: 0; background: rgba(22, 35, 58, 0.18); z-index: 40; }
.sh-drawer-back[hidden] { display: none; }
.sh-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--card); border-left: 1px solid var(--border); box-shadow: -12px 0 32px rgba(22, 35, 58, 0.12); z-index: 41; display: flex; flex-direction: column; transform: translateX(0); animation: sh-drawer-in 220ms var(--ease); }
.sh-drawer[hidden] { display: none; }
@keyframes sh-drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sh-drawer { animation: none; } }
.sh-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.sh-drawer-title { margin: 0; font-size: 1rem; font-weight: 800; color: var(--navy); }
.sh-drawer-close { width: 34px; height: 34px; border: 1px solid var(--border-2); border-radius: var(--r1); background: var(--card-2); color: var(--text-2); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.sh-drawer-close:hover { border-color: var(--champagne); color: var(--navy); }
.sh-drawer-body { padding: 16px 20px 28px; overflow-y: auto; flex: 1; }
.sh-drawer-body .kpi-detail-head { margin-bottom: 8px; }
.sh-drawer-body .kpi-detail-title { display: none; }
.sh-drawer-body .kpi-detail-open { margin-left: auto; }
.sh-drawer-body svg.chart { height: 180px; margin: 6px 0 10px; }
.sh-drawer-body svg.spark { height: 48px; margin: 6px 0 12px; }
.sh-drawer-body .ring { margin: 4px auto 10px; }
body.sh-drawer-open .kpi.live[aria-expanded="true"] { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy), var(--shadow); }

/* ---------- The SOP table of contents (Oct 19 2026) ---------- */
.docs-body.with-toc { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.docs-toc { background: var(--card); border: 1px solid var(--border); border-radius: var(--r2); box-shadow: var(--shadow); padding: 14px 10px 12px; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; }
.docs-toc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 6px 8px; }
.docs-toc-head h4 { margin: 0; font-size: 0.86rem; font-weight: 700; }
.docs-toc-head .sub { font-size: 0.72rem; color: var(--text-3); }
.docs-search { width: 100%; margin: 0 0 8px; padding: 9px 11px; background: var(--card-2); border: 1px solid var(--border-2); border-radius: var(--r1); color: var(--text); font: inherit; font-size: 0.84rem; }
.docs-search:focus { outline: 2px solid var(--champagne); outline-offset: 1px; }
.docs-toc-list { list-style: none; margin: 0; padding: 0; }
.docs-toc-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 7px 10px 7px 12px; font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--text-2); cursor: pointer; }
.docs-toc-item:hover { background: var(--card-2); color: var(--text); }
.docs-toc-item.on { background: #EAF0FA; color: var(--navy); }
.docs-toc-item .n { font-size: 0.7rem; font-weight: 700; color: var(--text-3); background: var(--none-bg); border-radius: 999px; padding: 1px 7px; }
.docs-toc-item.on .n { background: #fff; color: var(--navy); }
.docs-crumb { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; font-size: 0.8rem; color: var(--text-2); background: var(--card-2); border-bottom: 1px solid var(--border); }
@media (max-width: 900px) { .docs-body.with-toc { grid-template-columns: 1fr; } .docs-toc { position: static; max-height: none; } }
