/* SOS · the Sales Dashboard's own rules (job 107). Loaded after FOS's tokens.css, components.css and preview.css, so
   every page already has FOS's type, cards, panels, tables, board, dock and dialog. This file adds only what a sales
   page needs and FOS has no rule for. Every color is a FOS token (docs/fos-design-system.md), except the one chart
   hue, which passed the dataviz palette validator in both themes. Scoped under body.sos. */

body.sos {
  --sos-chart: #2f6fde;
  --sos-chip-bg: var(--fill);
  --sos-good-bg: rgba(31, 107, 54, .1);
  --sos-blue-bg: rgba(47, 111, 222, .1);
}
html[data-theme="dark"] body.sos {
  --sos-chart: #5b8ff5;
  --sos-good-bg: rgba(197, 229, 175, .12);
  --sos-blue-bg: rgba(110, 161, 255, .14);
}
body.sos .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0;
}
body.sos .muted { color: var(--muted); }
body.sos a { color: var(--fos-link); }
body.sos a.primary { color: var(--green-ink); }
body.sos a.primary:hover { color: var(--detail-142111); }
body.sos .fos-cell-head a, body.sos .sos-li-name, body.sos .sos-feed a { color: var(--text); text-decoration: none; }
body.sos .fos-cell-head a:hover, body.sos .sos-li-name:hover, body.sos .sos-feed a:hover { text-decoration: underline; text-underline-offset: 3px; }
body.sos .icon { width: 16px; height: 16px; flex-shrink: 0; }
body.sos button .icon, body.sos a.primary .icon { margin-right: 6px; }
body.sos button.icon-btn .icon { margin: 0; width: 18px; height: 18px; }

/* ── header: logo, the Sample pill (preview), theme, the avatar and its menu ── */
body.sos .topbar { gap: 12px; }
body.sos .sos-sample-pill { padding: 3px 10px; border-radius: 999px; background: var(--amber-bg); color: var(--warn-text); font-size: 12px; font-weight: 600; }
body.sos .sos-account { position: relative; }
body.sos .sos-avatar-btn { border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; min-width: 36px; min-height: 36px; }
body.sos .sos-avatar-btn:focus-visible { outline: 2px solid var(--fos-link); outline-offset: 2px; }
body.sos .sos-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 240px; padding: 8px; display: grid; gap: 2px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-2); }
body.sos .sos-menu[hidden] { display: none; }
body.sos .sos-menu-who { display: grid; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--hairline); margin-bottom: 4px; }
body.sos .sos-menu-who b { font-weight: 600; font-size: 14px; }
body.sos .sos-menu-who span { font-size: 12px; color: var(--muted); }
body.sos .sos-menu-as { display: grid; gap: 4px; padding: 4px 10px 8px; font-size: 12px; color: var(--muted); }
body.sos .sos-menu-as select { min-height: 36px; padding: 0 28px 0 10px; font-size: 13px; border-radius: 9px; border: 1px solid var(--hairline); background-color: var(--card); color: var(--text); }
body.sos .sos-menu-item { display: flex; align-items: center; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
body.sos .sos-menu-item[hidden] { display: none; }
body.sos .sos-menu-item:hover, body.sos .sos-menu-item:focus-visible { background: var(--fill); }
body.sos .sos-menu-item .icon { margin-right: 10px; color: var(--muted); }
body.sos .sos-signout { margin: 0; }
/* the one status line for a failed read: at the top of the page, with Retry */
body.sos .sos-status { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 14px; border-radius: 12px; background: var(--late-bg); color: var(--late-text); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-2); }
body.sos .sos-status[hidden] { display: none; }
body.sos .sos-status button { min-height: 36px; border-radius: 9px; }
/* the dock: only the viewer's pages; held back until app.js knows who is looking */
body.sos .dock[data-pending] a { visibility: hidden; }
body.sos .sos-dock-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* the sign-in page: FOS's door, in SOS's look */
body.sos.sos-login-page { padding-bottom: 0; }
body.sos.sos-login-page .sos-login { display: grid; place-items: center; min-height: 100vh; box-sizing: border-box; padding-top: 24px; padding-bottom: 24px; }
body.sos.sos-login-page .sos-login-card { margin: 0; }
body.sos .sos-login-card { width: min(380px, 100%); padding: 28px; display: grid; gap: 10px; }
body.sos .sos-login-card h1 { margin: 6px 0 0; font-size: 22px; }
body.sos .sos-login-card form { display: grid; gap: 8px; }
body.sos .sos-login-card input { min-height: 40px; padding: 0 10px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--card); color: inherit; font-size: 15px; }
body.sos .sos-login-card button, body.sos .sos-login-go { display: block; text-align: center; min-height: 42px; line-height: 42px; margin-top: 8px; border-radius: 10px; text-decoration: none; }
body.sos .sos-login-err { margin: 0; color: var(--danger, #b42318); font-size: 14px; }
body.sos .sos-login-help { font-size: 12px; margin: 6px 0 0; }
body.sos .dock a.is-off { opacity: .4; }
body.sos .sos-loading { padding: 40px 0; color: var(--muted); }

/* ── the page head: title on the left, the page's filters on the right, wrapping ── */
body.sos .sos-head { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
body.sos .sos-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
body.sos .sos-head-actions button { display: inline-flex; align-items: center; min-height: 36px; }
body.sos .sos-select select {
  min-height: 36px; padding: 0 30px 0 12px; font-size: 13px; border-radius: 9px; border: 1px solid var(--hairline);
  background-color: var(--card); color: var(--text);
}
body.sos .sos-seg { background: var(--fill); border: 0; border-radius: 9px; }
body.sos .sos-seg button { min-height: 30px; font-size: 13px; border-radius: 7px; color: var(--muted); }
body.sos .sos-seg button.active { color: var(--text); }

body.sos .sos-tabs { margin: 0 0 12px; flex-wrap: wrap; }

/* ── KPI rows ── */
body.sos .sos-kpis { margin-bottom: 0; }
body.sos .sos-kpis + .sos-kpis { margin-top: var(--fos-gutter); }
body.sos .kpis.kpis-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--fos-gutter); border: 0; background: transparent; }
body.sos .sos-delta { font-variant-numeric: tabular-nums; color: var(--text); }
body.sos .sos-more { margin-top: 12px; background: none; border: 0; padding: 0; min-height: 0; }

/* ── sections and grids ── */
body.sos .sos-panel { margin-bottom: var(--fos-section-gap); }
body.sos .ov-grid.sos-grid { gap: var(--fos-gutter); margin-bottom: 0; }
body.sos .ov-grid.sos-grid > .sos-panel { margin-bottom: var(--fos-section-gap); min-width: 0; }
body.sos .sos-panel .fos-bar { align-items: center; }
body.sos .sos-why.sos-after { margin: 12px 0 0; }
body.sos .sos-why { margin: -4px 0 12px; font-size: var(--fos-type-label); color: var(--muted); line-height: 1.5; }
body.sos .sos-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); font-weight: 400; }
body.sos span.sos-sub { display: inline; }
body.sos td .sos-sub, body.sos .sos-bar-label .sos-sub { display: block; }
body.sos .sos-h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); font-family: var(--font-body); letter-spacing: 0; }
body.sos .sos-table tbody tr[data-href], body.sos .sos-table tbody tr[data-id] { cursor: pointer; }
body.sos .sos-table tbody tr[data-href]:hover td, body.sos .sos-table tbody tr[data-id]:hover td { background: var(--fill); }
body.sos .sos-table tbody tr:focus-visible { outline: 2px solid var(--fos-link); outline-offset: -2px; }
body.sos .sos-time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
body.sos .sos-small { min-height: 30px; padding: 4px 12px; font-size: 13px; }
body.sos code { font-size: 12px; color: var(--muted); }

/* ── chips, pills, ages, avatars ── */
body.sos .sos-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; min-height: 22px; border-radius: 999px;
  background: var(--sos-chip-bg); color: var(--text); font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap;
  border: 0;
}
body.sos .sos-chip .icon { width: 12px; height: 12px; margin: 0; }
body.sos .sos-chip.is-late { background: var(--late-bg); color: var(--late-text); }
body.sos .sos-chip.is-warn { background: var(--amber-bg); color: var(--warn-text); }
body.sos .sos-chip.is-today { background: var(--sos-blue-bg); color: var(--fos-link); }
body.sos .sos-chip.is-ok { background: var(--sos-good-bg); color: var(--good-text); }
body.sos .sos-chip-btn { cursor: pointer; }
body.sos .sos-chip-btn:hover { filter: brightness(.97); text-decoration: underline; text-underline-offset: 2px; }
body.sos .sos-stage {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.5;
  background: var(--fill); color: var(--text); white-space: nowrap;
}
body.sos .sos-stage.is-active { background: var(--sos-blue-bg); color: var(--text); }
body.sos .sos-stage.is-won { background: var(--sos-good-bg); color: var(--good-text); }
body.sos .sos-stage.is-lost, body.sos .sos-stage.is-dead { background: var(--fill); color: var(--muted); }
body.sos .sos-age { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
body.sos .sos-age.is-warn { color: var(--warn-text); font-weight: 500; }
body.sos .sos-age.is-late { color: var(--late-text); font-weight: 500; }
body.sos .sos-ava {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--fill-strong); color: var(--text); font-size: 10px; font-weight: 600; letter-spacing: .02em;
}

/* ── Overview: pacing, attention, bars ── */
body.sos .sos-meter, body.sos .sos-mini-meter { position: relative; display: block; height: 8px; margin: 10px 0 8px; border-radius: 999px; background: var(--fill-strong); }
body.sos .sos-mini-meter { width: 120px; height: 6px; margin: 4px 0; }
body.sos .sos-meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--warn-text); }
body.sos .sos-meter-fill.is-ahead { background: var(--good-text); }
body.sos .sos-meter-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }
body.sos .sos-pace-cell { min-width: 140px; }
body.sos .sos-bars, body.sos .sos-list, body.sos .sos-feed, body.sos .sos-plain, body.sos .sos-pick-list, body.sos .sos-timeline { list-style: none; margin: 0; padding: 0; }
body.sos .sos-bar-row, body.sos .sos-funnel-row {
  display: grid; grid-template-columns: minmax(120px, 38%) 1fr 44px; gap: 12px; align-items: center; padding: 7px 0;
  color: var(--text); text-decoration: none; font-size: 13px;
}
body.sos a.sos-bar-row:hover .sos-bar { filter: brightness(1.08); }
body.sos .sos-funnel-row { grid-template-columns: 120px 1fr 52px; grid-template-areas: "l t n" ". p p"; row-gap: 2px; }
body.sos .sos-funnel-row .sos-bar-label { grid-area: l; } body.sos .sos-funnel-row .sos-bar-track { grid-area: t; }
body.sos .sos-funnel-row .sos-bar-n { grid-area: n; } body.sos .sos-funnel-pct { grid-area: p; font-size: 12px; color: var(--muted); }
body.sos .sos-bar-track { display: block; height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; }
body.sos .sos-funnel .sos-bar-track { height: 16px; border-radius: 6px; }
body.sos .sos-bar { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--sos-chart); }
body.sos .sos-bar.is-muted { background: var(--muted); opacity: .55; }
body.sos .sos-bar-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ── the board (FOS BOARD lanes and cards) ── */
body.sos .sos-board { max-height: none; min-height: 320px; height: calc(100vh - 300px); padding-bottom: 8px; }
body.sos.sos-workspace { overflow: hidden; }
body.sos.sos-workspace .pv-main { padding-top: 14px; padding-bottom: 0; }
body.sos .sos-board > .cm-column { max-height: 100%; }
/* Keep off-screen accessible labels inside the lane scroller, not the page body. */
body.sos .sos-board .sos-select { position: relative; min-width: 0; max-width: 100%; }
body.sos .sos-card { position: relative; cursor: pointer; outline-offset: 2px; }
body.sos .sos-card:focus-visible { outline: 2px solid var(--fos-link); }
body.sos .sos-card .name { font-family: var(--fos-font-head); font-size: 14px; font-weight: 600; letter-spacing: -.01em; padding-right: 44px; }
body.sos .sos-card-meta { display: flex; align-items: center; gap: 8px; }
body.sos .sos-card-next { margin-top: 6px; }
body.sos .sos-card-next .sos-chip { max-width: 100%; overflow: hidden; text-overflow: clip; }
body.sos .sos-card.is-dragging { opacity: .4; }
body.sos .sos-lane-empty { padding: 10px 4px 8px; font-size: 12px; color: var(--muted); }

/* ── dialogs ── */
body.sos .sos-dialog { width: 520px; padding: 22px 24px; background: var(--card); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--shadow-2); }
body.sos .sos-dialog.is-wide { width: 640px; }
body.sos .sos-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
body.sos .sos-dialog-head h2 { font-family: var(--fos-font-head); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
body.sos .sos-dialog-sub { margin-top: 4px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
body.sos .sos-dialog-head .icon-btn { min-height: 36px; width: 36px; border: 0; }
body.sos .sos-field { margin: 0 0 14px; }
body.sos .sos-field label, body.sos .sos-label { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
body.sos .sos-opt { font-weight: 400; }
body.sos .sos-hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
body.sos .sos-dialog input:not([type=radio]):not([type=checkbox]), body.sos .sos-dialog select, body.sos .sos-dialog textarea {
  width: 100%; min-height: 40px; font: inherit; font-size: 14px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: 9px;
}
body.sos .sos-dialog input:disabled { opacity: .6; }
body.sos .sos-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
body.sos .sos-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
body.sos .sos-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
body.sos .sos-radios, body.sos .sos-checks, body.sos .sos-picks, body.sos .sos-chips { display: flex; flex-wrap: wrap; gap: 6px; }
body.sos .sos-radio { position: relative; margin: 0 !important; }
body.sos .sos-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
body.sos .sos-radio span {
  display: flex; flex-direction: column; justify-content: center; min-height: 36px; padding: 6px 12px; border-radius: 9px;
  background: var(--fill); color: var(--text); font-size: 13px; font-weight: 500; border: 1px solid transparent;
}
body.sos .sos-radio small { font-size: 11px; font-weight: 400; color: var(--muted); }
body.sos .sos-radio input:checked + span { background: var(--sos-blue-bg); border-color: var(--fos-link); }
body.sos .sos-radio input:focus-visible + span { outline: 2px solid var(--fos-link); outline-offset: 2px; }
body.sos .sos-pick { min-height: 30px; padding: 4px 11px; border-radius: 999px; border: 0; background: var(--fill); font-size: 13px; color: var(--text); }
body.sos .sos-pick.active { background: var(--text); color: var(--card); }
body.sos .sos-dialog .form-error { min-height: 0; margin: 4px 0 0; color: var(--late-text); font-size: 13px; }
body.sos .sos-dialog .form-error:empty { display: none; }
body.sos .sos-pick-row {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; margin: 2px 0;
  border: 0; border-radius: 10px; background: transparent; text-align: left; min-height: 0;
}
body.sos .sos-pick-row:hover, body.sos .sos-pick-row:focus-visible { background: var(--fill); }
body.sos .sos-pick-main { display: flex; flex-direction: column; gap: 2px; }
body.sos .sos-pick-main .muted { font-size: 12px; }
body.sos .sos-pick-none { padding: 10px 12px; font-size: 13px; }
body.sos .sos-keys { display: grid; gap: 8px; margin: 0; }
body.sos .sos-keys > div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: center; font-size: 14px; }
body.sos .sos-keys dd { margin: 0; }
body.sos .sos-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
body.sos .sos-actions button { display: inline-flex; align-items: center; min-height: 36px; }

/* ── facts, timeline ── */
body.sos .sos-facts { display: grid; gap: 10px; margin: 0; }
body.sos .sos-facts > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; font-size: 14px; align-items: baseline; }
body.sos .sos-facts dt { color: var(--muted); font-size: 13px; }
body.sos .sos-facts dd { margin: 0; overflow-wrap: anywhere; }
body.sos .sos-timeline li { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; }
body.sos .sos-timeline li:last-child { border-bottom: 0; }
body.sos .sos-timeline.is-short li { grid-template-columns: 84px 1fr; padding: 8px 0; font-size: 13px; }
body.sos .sos-tl-when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
body.sos .sos-tl-when small { display: block; }
body.sos .sos-tl-body b { font-weight: 500; }
body.sos .sos-tl-who { display: block; font-size: 12px; color: var(--muted); }
/* a note's text; not .sos-tl-note, which every note row carries as its event type (sos-tl-<type>) */
body.sos .sos-note-text { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--fill); font-size: 13px; white-space: pre-wrap; }

/* ── My day ── */
body.sos .sos-li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
body.sos .sos-li:last-child { border-bottom: 0; }
body.sos .sos-li-time { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
body.sos .sos-li-time.is-late { color: var(--late-text); }
body.sos .sos-li-time small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
body.sos .sos-li-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.sos .sos-li-name { font-weight: 600; font-family: var(--fos-font-head); font-size: 15px; letter-spacing: -.01em; }
body.sos .sos-li-what { font-size: 14px; }
body.sos .sos-li-sub { font-size: 12px; color: var(--muted); }
body.sos .sos-li-acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
body.sos .sos-li-acts button { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; font-size: 13px; }

/* ── one deal ── */
body.sos .sos-path { display: flex; gap: 4px; margin: 6px 0 4px; padding: 0 0 6px; list-style: none; overflow-x: auto; }
body.sos .sos-path li {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; padding: 8px 18px 8px 14px; background: var(--card);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); font-size: 12px;
}
body.sos .sos-path li:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
body.sos .sos-path li.is-current { background: var(--sos-blue-bg); }
body.sos .sos-path li.is-current.is-warn { background: var(--amber-bg); }
body.sos .sos-path li.is-current.is-warn .sos-path-days { color: var(--warn-text); font-weight: 500; }
body.sos .sos-path li.is-current.is-late { background: var(--late-bg); }
body.sos .sos-path li.is-current.is-late .sos-path-days { color: var(--late-text); font-weight: 500; }
body.sos tr.is-next td { background: var(--fill); }
body.sos .sos-path-label { font-weight: 500; white-space: nowrap; }
body.sos .sos-path-days { color: var(--muted); font-variant-numeric: tabular-nums; }
body.sos .sos-next-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
body.sos .sos-next-row.is-warn { padding: 12px 14px; border-radius: 10px; background: var(--amber-bg); }
body.sos .sos-next-row.is-warn .sos-next-what span { color: var(--warn-text); }
body.sos .sos-next-what { display: flex; flex-direction: column; gap: 3px; }
body.sos .sos-next-what b { font-size: 15px; font-weight: 600; }
body.sos .sos-next-what .is-late { color: var(--late-text); }
body.sos .sos-chips .sos-pick { min-height: 28px; font-size: 12px; }

/* ── Activity ── */
body.sos .sos-chips-bar { margin: 0 0 var(--fos-gutter); }
body.sos .sos-feed-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; }
body.sos .sos-feed-item:last-child { border-bottom: 0; }
body.sos .sos-feed-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--fill); color: var(--muted); }
body.sos .sos-feed-ic .icon { margin: 0; width: 15px; height: 15px; }
body.sos .sos-tl-won .sos-feed-ic { background: var(--sos-good-bg); color: var(--good-text); }
body.sos .sos-feed-body b { font-weight: 500; }
body.sos .sos-feed-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 2px; }

/* ── Leaderboard ── */
body.sos .sos-rank { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fill); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
body.sos .sos-rank.is-top { background: var(--sos-blue-bg); color: var(--fos-link); }
body.sos .sos-lb tr.is-you td { background: var(--fill); }
body.sos .sos-you { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 5px; background: var(--sos-blue-bg); color: var(--fos-link); font-size: 11px; font-weight: 600; }
body.sos .sos-lb-name { font-weight: 600; }

/* ── charts ── */
body.sos .sos-multiples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--fos-gutter) 24px; }
body.sos .sos-chart { margin: 0; }
body.sos .sos-chart svg { display: block; overflow: visible; }
body.sos .sos-chart .sos-grid { stroke: var(--hairline); stroke-width: 1; }
body.sos .sos-chart .sos-base { stroke: var(--muted); stroke-opacity: .5; stroke-width: 1; }
body.sos .sos-chart .sos-axis { fill: var(--muted); font-size: 11px; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
body.sos .sos-chart .sos-mark { fill: var(--sos-chart); }
body.sos .sos-chart .sos-mark.is-partial { fill-opacity: .45; }
body.sos .sos-chart .sos-line { fill: none; stroke: var(--sos-chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
body.sos .sos-chart .sos-dot { fill: var(--sos-chart); stroke: var(--card); stroke-width: 2; }
body.sos .sos-chart .sos-dot.is-partial { fill: var(--card); stroke: var(--sos-chart); }
body.sos .sos-chart .sos-hit { fill: transparent; outline: none; cursor: default; }
body.sos .sos-chart .sos-hit.is-on { fill: var(--fill); }
body.sos .sos-chart-table { margin-top: 6px; font-size: 12px; color: var(--muted); }
body.sos .sos-chart-table summary { cursor: pointer; width: max-content; }
body.sos .sos-chart-table table { margin-top: 6px; font-size: 13px; }
body.sos .sos-chart-table td { padding: 6px 10px; }
.sos-tip {
  position: absolute; z-index: 40; display: none; padding: 6px 10px; border-radius: 8px; pointer-events: none;
  background: var(--text); color: var(--card); font: 500 12px/1.4 "Inter", -apple-system, sans-serif; box-shadow: var(--shadow-2); white-space: nowrap;
}

/* ── Settings ── */
body.sos .sos-prefs { display: grid; gap: 4px; }
body.sos .sos-pref { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--hairline); flex-wrap: wrap; }
body.sos .sos-pref:last-child { border-bottom: 0; }
body.sos .sos-pref > span:first-child { display: flex; flex-direction: column; }
body.sos .sos-pref b { font-weight: 500; }
body.sos .sos-panel-tools { margin: 0 0 12px; }
body.sos .sos-plain li { padding: 4px 0; font-size: 14px; }
body.sos .sos-plain + .sos-h3 { margin-top: 12px; }

/* ── tablet ── */
@media (max-width: 1100px) {
  body.sos .sos-find { min-width: 0; }
  body.sos .sos-find span, body.sos .sos-find .key { display: none; }
  body.sos .sos-multiples { grid-template-columns: 1fr; }
}
/* ── phone ── */
@media (max-width: 700px) {
  body.sos .topbar { gap: 8px; }
  body.sos .pv-brand { display: none; }
  body.sos .sos-head-actions { justify-content: flex-start; width: 100%; }
  body.sos .ov-grid.sos-grid { grid-template-columns: 1fr; }
  body.sos .sos-board { height: calc(100vh - 300px); scroll-snap-type: x mandatory; }
  body.sos .sos-board > .cm-column { flex-basis: 82vw; width: 82vw; scroll-snap-align: start; }
  body.sos .sos-li { grid-template-columns: 1fr; gap: 6px; }
  body.sos .sos-li-acts { justify-content: flex-start; }
  body.sos .sos-grid2, body.sos .sos-grid3 { grid-template-columns: 1fr; }
  body.sos .sos-dialog { padding: 18px 16px; }
  /* a stacked table names every field, as FOS's own stack does for numbers */
  body.sos .sos-table td[data-label]:not(.num) { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; text-align: right; }
  body.sos .sos-table td[data-label]:not(.num)::before { content: attr(data-label); color: var(--muted); font-size: var(--fos-type-label); text-align: left; flex-shrink: 0; }
  body.sos .sos-table td[data-label]:not(.num) .sos-sub { text-align: right; }
  body.sos .sos-facts > div { grid-template-columns: 96px 1fr; }
  body.sos .dock { gap: 2px; padding: 5px; }
  body.sos .dock a { width: 38px; height: 38px; }
  body.sos .sos-bar-row { grid-template-columns: minmax(90px, 40%) 1fr 36px; }
  body.sos .sos-keys > div { grid-template-columns: 1fr; gap: 2px; }
  body.sos .sos-tabs { overflow-x: auto; flex-wrap: nowrap; }
}

/* ── round 7: three pages, the drawer, chips, tabs and the month strip ── */
body.sos .sos-drawer-overlay { justify-content: flex-end; align-items: stretch; padding: 8px; }
body.sos .sos-drawer { width: min(640px, 100%); height: 100%; overflow: auto; padding: 0 22px 22px; background: var(--bg);
  border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-2); outline: none; }
body.sos .sos-drawer-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin: 0 -22px 12px; padding: 18px 22px 12px; background: var(--bg); border-bottom: 1px solid var(--hairline); }
body.sos .sos-drawer-head h2 { font-family: var(--fos-font-head); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
body.sos .sos-drawer-head .icon-btn { min-height: 36px; width: 36px; border: 0; }
body.sos .sos-drawer-loading { padding: 20px 0; }
body.sos .sos-drawer .panel { margin-top: 12px; }
body.sos .sos-drawer .sos-tabs { margin-bottom: 4px; }
body.sos .sos-drawer-actions { margin: 0 0 12px; }

body.sos .sos-row-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px;
  font-size: var(--fos-type-context); }
body.sos .sos-row-foot .sos-more { margin: 0; }
body.sos .sos-kpis-more { margin-top: var(--fos-gutter); }
body.sos .sos-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; margin-top: 16px; padding: 14px 18px;
  border-radius: 12px; background: var(--card); border: 1px solid var(--hairline); }
body.sos .sos-strip-goal { display: grid; grid-template-columns: auto minmax(120px, 260px) auto; align-items: center; gap: 14px; flex: 1 1 520px; }
body.sos .sos-strip-goal .sos-meter { margin: 0; }
body.sos .sos-strip-label { font-size: var(--fos-type-label); color: var(--muted); white-space: nowrap; }
body.sos .sos-strip-text, body.sos .sos-strip-rank { font-size: 13px; color: var(--muted); }
body.sos .sos-strip-n { font-family: var(--fos-font-head); font-size: 18px; font-weight: 600; color: var(--text); }
body.sos .sos-strip-rank { display: flex; align-items: center; gap: 8px; }
body.sos .sos-strip-rank .icon { margin: 0; color: var(--fos-link); }

body.sos .sos-chip-n { margin-left: 2px; font-variant-numeric: tabular-nums; opacity: .7; }
body.sos .sos-todo .sos-chips { margin: 0 0 12px; }
body.sos .sos-all, body.sos .sos-feed-toggle { margin-top: 10px; }
body.sos .sos-feed-day { margin: 14px 0 2px; }
body.sos .sos-feed-day:first-child { margin-top: 0; }
body.sos .sos-panel-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }

body.sos .sos-tabs .tab { color: var(--muted); padding: 7px 12px; border-radius: 9px; font-size: 14px; white-space: nowrap; border: 0;
  background: none; min-height: 0; }
body.sos .sos-tabs .tab.active { color: var(--text); background: var(--fill-strong); }
body.sos .sos-tabs .tab:hover { color: var(--text); }
body.sos .kpis.kpis-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--fos-gutter); border: 0; background: transparent; }
body.sos .sos-total td { border-top: 1px solid var(--hairline); font-weight: 600; }

body.sos .cm-column.is-folded { flex: 0 0 132px; min-width: 132px; opacity: .8; }
body.sos .cm-column.is-folded .column-head .grow { white-space: normal; }

@media (max-width: 700px) {
  body.sos .sos-drawer-overlay { padding: 0; }
  body.sos .sos-drawer { width: 100vw; border-radius: 0; border: 0; padding: 0 16px 16px; }
  body.sos .sos-drawer-head { margin: 0 -16px 12px; padding: 14px 16px 10px; }
  body.sos .sos-strip-goal { grid-template-columns: 1fr; gap: 6px; }
  body.sos .kpis.kpis-3 { grid-template-columns: 1fr; }
  body.sos .sos-drawer .sos-tabs, body.sos .sos-chips { overflow-x: auto; flex-wrap: nowrap; }
  body.sos .sos-chips .sos-pick { flex: 0 0 auto; }
}

/* ── round 8: confidence marks, data health, the lost-reason editor, grouped numbers ── */
body.sos .sos-more-group { margin-top: var(--fos-gutter); }
body.sos .sos-more-group .sos-h3 { margin: 0 0 8px; }
body.sos .sos-more-group .sos-kpis-more { margin-top: 0; }
body.sos .sos-strip-goal.is-missing { grid-template-columns: auto 1fr; }
body.sos .sos-gap { color: var(--warn-text); }
body.sos .sos-gap .sos-conf { margin: 0 6px 1px 0; }
body.sos .sos-bar-row.is-gap .sos-bar-label { font-style: italic; }
body.sos .sos-lr-count { display: inline; margin-left: 6px; font-weight: 400; }
body.sos .sos-lr-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
body.sos .sos-lr-add input, body.sos .sos-lr-form input { flex: 1 1 220px; min-height: 36px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--hairline); background: var(--card); color: var(--text); font: inherit; }
body.sos .sos-lr-add select, body.sos .sos-lr-form select { min-height: 36px; border-radius: 9px; }
body.sos .sos-lr-add .form-error, body.sos .sos-lr-form .form-error { flex-basis: 100%; margin: 0; color: var(--late-text); font-size: 13px; }
body.sos .sos-lr-add .form-error:empty, body.sos .sos-lr-form .form-error:empty { display: none; }
body.sos .sos-lr-list { list-style: none; margin: 0 0 6px; padding: 0; }
body.sos .sos-lr { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
body.sos .sos-lr:last-child { border-bottom: 0; }
body.sos .sos-lr-name { display: flex; flex-direction: column; gap: 2px; }
body.sos .sos-lr-acts { display: flex; gap: 4px; flex: none; }
body.sos .sos-lr-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
body.sos .sos-lr.is-retired .sos-lr-name { color: var(--muted); }
body.sos .sos-lr-retired { margin-top: 12px; }
body.sos .sos-lr-retired summary { cursor: pointer; color: var(--muted); }
body.sos .kpi.is-verdict.is-ahead .kpi-value { color: var(--good-text); }
body.sos .kpi.is-verdict.is-behind .kpi-value { color: var(--late-text); }
body.sos .kpi.is-verdict.is-no-goal .kpi-value { color: var(--muted); }
body.sos .sos-kpis-today { margin-bottom: 0; }
/* Team clarity: one next task/client, with explicit folds for secondary records. */
body.sos .sos-reading { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 12px; color: var(--muted); font-size: 12px; }
body.sos .kpi .sos-reading { display: grid; gap: 2px; margin: 10px 0 0; }
body.sos .sos-fold > summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-size: 14px; font-weight: 500; }
body.sos .sos-fold[open] > summary { margin-bottom: 10px; }
body.sos .sos-today-secondary { margin-bottom: 24px; }
body.sos .sos-todo > .sos-select { display: block; margin-bottom: 12px; }
body.sos .sos-todo > .sos-select select { width: 100%; max-width: 360px; min-height: 44px; }
body.sos .sos-phone-controls, body.sos .sos-phone-results { display: none; }
body.sos .sos-deals-desktop-controls { display: contents; }
@media (max-width: 767px) {
  body.sos[data-page="deals"] .sos-head-actions > .sos-find,
  body.sos .sos-deals-desktop-controls,
  body.sos[data-page="deals"] .sos-chips-bar,
  body.sos .sos-desktop-results { display: none; }
  body.sos .sos-phone-controls { display: flex; flex-wrap: wrap; gap: 8px; }
  body.sos .sos-phone-controls select, body.sos .sos-phone-controls button { min-height: 44px; }
  body.sos .sos-phone-controls select { max-width: 180px; }
  body.sos .sos-phone-results { display: block; }
  body.sos .main { padding-bottom: 112px; }
}

/* ── round 10: one page padding everywhere (Reeze: the Deals page's, plus a little). Every page, tab, drawer and
   dialog uses --sos-page-x for its sides; pages run full width, as the board does ── */
body.sos { --sos-page-x: 24px; }
body.sos .topbar { padding-left: var(--sos-page-x); padding-right: var(--sos-page-x); }
body.sos .pv-main, body.sos .main { max-width: none; padding-left: var(--sos-page-x); padding-right: var(--sos-page-x); }
body.sos .sos-drawer { padding: 0 var(--sos-page-x) var(--sos-page-x); }
body.sos .sos-drawer-head { margin: 0 calc(-1 * var(--sos-page-x)) 12px; padding: 18px var(--sos-page-x) 12px; }
body.sos .sos-dialog { padding: 22px var(--sos-page-x); }
@media (max-width: 700px) {
  body.sos { --sos-page-x: 16px; }
  body.sos .sos-drawer { padding: 0 var(--sos-page-x) var(--sos-page-x); }
  body.sos .sos-drawer-head { margin: 0 calc(-1 * var(--sos-page-x)) 12px; padding: 14px var(--sos-page-x) 10px; }
  body.sos .sos-dialog { padding: 18px var(--sos-page-x); }
}

/* round 10: the Log call form. The call's number, and where the recording came from */
body.sos .sos-when-held[hidden], body.sos .sos-when-noshow[hidden], body.sos .sos-when-moved[hidden] { display: none; }

/* round 10: the Setters page. Where leads leak, conversations with their tags, what works, coaching */
body.sos .sos-leaks { list-style: none; margin: 0; padding: 0; }
body.sos .sos-leak { border-bottom: 1px solid var(--hairline); }
body.sos .sos-leak-head { display: grid; grid-template-columns: minmax(150px, 1.2fr) 70px minmax(150px, 1.2fr) minmax(0, 2fr); gap: 14px;
  align-items: baseline; width: 100%; padding: 12px 0; background: none; border: 0; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
body.sos .sos-leak-head:hover .sos-leak-name { text-decoration: underline; text-underline-offset: 3px; }
body.sos .sos-leak-name { font-weight: 600; }
body.sos .sos-leak-n { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
body.sos .sos-leak-of { color: var(--muted); font-size: 13px; }
body.sos .sos-leak.is-worst .sos-leak-n { color: var(--late-text); }
body.sos .sos-leak.is-open { padding-bottom: 12px; }
body.sos .sos-filters { display: grid; gap: 8px; margin: 4px 0 10px; }
body.sos .sos-filter { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; align-items: center; }
body.sos .sos-convs, body.sos .sos-works, body.sos .sos-lines, body.sos .sos-gaps { list-style: none; margin: 0; padding: 0; }
body.sos .sos-conv { padding: 14px 0; border-bottom: 1px solid var(--hairline); display: grid; gap: 8px; }
body.sos .sos-conv-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
body.sos .sos-conv-head .sos-outcome { margin-left: auto; }
body.sos .sos-outcome.is-booked, body.sos .sos-outcome.is-confirmed, body.sos .sos-outcome.is-rebooked { background: var(--sos-good-bg); color: var(--good-text); }
body.sos .sos-outcome.is-not_booked, body.sos .sos-outcome.is-no_reply, body.sos .sos-outcome.is-opted_out { background: var(--amber-bg); color: var(--warn-text); }
body.sos .sos-tags { display: flex; flex-wrap: wrap; gap: 6px; }
body.sos .sos-tag { font-size: 12px; padding: 3px 8px; border-radius: 7px; background: var(--fill); }
body.sos .sos-tag b { font-weight: 600; margin-right: 3px; }
body.sos .sos-phrase { margin: 0; padding: 6px 12px; border-left: 3px solid var(--sos-blue-bg); color: var(--text); font-size: 14px; }
body.sos .sos-thread summary { cursor: pointer; color: var(--fos-link); font-size: 13px; }
body.sos .sos-lines { display: grid; gap: 6px; margin-top: 8px; }
body.sos .sos-line { max-width: 85%; padding: 8px 12px; border-radius: 12px; background: var(--fill); font-size: 14px; }
body.sos .sos-line.is-setter { justify-self: end; background: var(--sos-blue-bg); }
body.sos .sos-line-who { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
body.sos .sos-works { display: grid; gap: 10px; }
body.sos .sos-work { padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 12px; display: grid; gap: 4px; }
body.sos .sos-work.is-up { border-left: 4px solid var(--good-text); }
body.sos .sos-work.is-down { border-left: 4px solid var(--late-text); }
body.sos .sos-work-label { font-weight: 600; }
body.sos .sos-work-rate { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
body.sos .sos-work-rate .muted { font-size: 13px; font-weight: 400; }
body.sos .sos-work-n { font-size: 12px; color: var(--muted); }
body.sos .sos-gaps { display: grid; gap: 10px; margin-bottom: 12px; }
body.sos .sos-drill { margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: var(--sos-blue-bg); font-size: 14px; }
body.sos .sos-drill .sos-label { display: inline; margin-right: 6px; }
body.sos .sos-setters td.num, body.sos .sos-setters th.num { white-space: nowrap; }
@media (max-width: 700px) {
  body.sos .sos-leak-head { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  body.sos .sos-leak-of { grid-column: 1 / -1; }
  body.sos .sos-filter { grid-template-columns: 1fr; gap: 4px; }
  body.sos .sos-line { max-width: 100%; }
}
/* ── round 12: Settings, setter phone lines ── */
body.sos .sos-line-num { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .02em; }
body.sos .sos-line-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.sos .sos-quo-lines .sos-seg button { min-height: 32px; }
body.sos #line-error:empty { display: none; }
body.sos #line-error { margin: 8px 0 0; color: var(--late-text); font-size: 13px; }

/* ── R3 (UI overhaul): one row of page controls, compact numbers, the board card, call lines, the Log call form ── */
body.sos .sos-head { align-items: center; margin-bottom: 18px; }
body.sos .sos-head-actions { flex-wrap: nowrap; }
body.sos .sos-find {
  display: inline-flex; align-items: center; gap: 8px; min-width: 200px; min-height: 36px; padding: 0 10px 0 12px;
  border: 1px solid var(--hairline); background: var(--card); color: var(--muted); font-size: 13px; border-radius: 9px; cursor: pointer;
}
body.sos .sos-find span { flex: 1; text-align: left; }
body.sos .sos-find .key { border-color: var(--hairline); }
body.sos .sos-head-actions .sos-filters-btn { display: none; }
body.sos .sos-filters-inline { display: contents; }
body.sos .sos-sheet { display: grid; gap: 10px; }
body.sos .sos-sheet .sos-select select { width: 100%; min-height: 44px; }
body.sos .sos-head-actions .sos-seg button { min-height: 36px; height: 36px; }
body.sos .sos-today-kpis .kpi { padding: 12px 14px; }
body.sos .sos-today-kpis .kpi-value { font-size: 24px; }
body.sos .sos-today-kpis { margin-bottom: var(--fos-section-gap); }
body.sos .kpi-foot { font-size: 12px; }
body.sos .sos-conf { display: inline-block; width: auto; height: auto; margin: 0 0 0 8px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
  line-height: 1.5; vertical-align: middle; background: var(--amber-bg); color: var(--warn-text); }
body.sos .sos-conf.is-low, body.sos .sos-conf.is-none { background: var(--late-bg); color: var(--late-text); }
body.sos .sos-chips-bar { position: relative; }
body.sos .sos-chips .sos-pick { min-height: 36px; padding: 6px 13px; font-size: 13px; }
body.sos .sos-pick { min-height: 36px; }
body.sos .sos-li-acts button { min-height: 36px; }
body.sos .sos-li { grid-template-columns: 96px minmax(0, 1fr) auto; }
body.sos .sos-li-name, body.sos .fos-cell-head a, body.sos .sos-feed a { display: inline-block; padding: 9px 0; margin: -9px 0; }
body.sos .sos-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
body.sos .sos-deals td { vertical-align: middle; }
body.sos .sos-late { color: var(--late-text); font-weight: 500; }
body.sos .sos-warn { color: var(--warn-text); font-weight: 500; }
body.sos .sos-card { min-height: 0; }
body.sos .sos-card .name { font-size: 13px; padding-right: 0; }
body.sos .sos-card-meta { justify-content: space-between; margin-top: 6px; }
body.sos .sos-card .sos-age { font-size: 12px; }
body.sos .sos-ava { font-size: 11px; width: 24px; height: 24px; }
body.sos .sos-lane-warn { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; margin-right: 6px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--amber-bg); color: var(--warn-text); }
body.sos .sos-lane-warn .icon { width: 12px; height: 12px; }
body.sos .sos-drawer-meta { margin-top: 4px; font-size: 13px; color: var(--muted); }
body.sos .sos-drawer-actions { align-items: center; }
body.sos .sos-stage-select select { min-height: 36px; max-width: 240px; }
body.sos .sos-calls { list-style: none; margin: 0; padding: 0; }
body.sos .sos-call { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; }
body.sos .sos-call:last-child { border-bottom: 0; }
body.sos .sos-call.is-next .sos-call-line { font-weight: 500; }
body.sos .sos-call-line { flex: 1 1 260px; }
body.sos .sos-rec-cell { display: inline-flex; align-items: center; gap: 10px; }
body.sos .sos-rec-link { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--fill); color: var(--text); }
body.sos .sos-rec-link .icon { margin: 0; }
body.sos .sos-sum summary { cursor: pointer; color: var(--fos-link); font-size: 13px; min-height: 36px; display: flex; align-items: center; }
body.sos .sos-sum p { margin: 6px 0 0; font-size: 13px; }
body.sos .sos-bar-meta { font-size: 13px; color: var(--muted); }
body.sos .sos-bar-link { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; font-size: 13px; text-decoration: none; }
body.sos .sos-bar-link .icon { margin: 0; width: 14px; height: 14px; }
body.sos .sos-bar-group { margin: 12px 0 2px; }
body.sos .sos-bar-group:first-child { margin-top: 0; }
body.sos .sos-strength { margin: 0 0 10px; font-size: 14px; }
body.sos .sos-work-vs { font-size: 13px; font-weight: 400; color: var(--muted); }
body.sos .sos-lr-count { margin-left: 6px; font-weight: 400; color: var(--muted); }
body.sos .sos-lr-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
body.sos .sos-tabs .tab { min-height: 36px; }
body.sos .sos-leak-head { grid-template-columns: minmax(150px, 1.2fr) 70px minmax(0, 2fr); min-height: 44px; }
body.sos .sos-thread summary, body.sos .sos-lr-retired summary, body.sos .sos-more summary { min-height: 36px; display: flex; align-items: center; }
body.sos .fos-toggle { min-height: 36px; }
/* the dialog: Save stays in view (a sticky footer); the Log call form's choices are chips */
body.sos .sos-dialog { max-height: calc(100vh - 32px); overflow: auto; }
body.sos .sos-dialog-foot { position: sticky; bottom: -22px; margin: 8px calc(-1 * var(--sos-page-x)) -22px; padding: 12px var(--sos-page-x) 16px;
  background: var(--card); border-top: 1px solid var(--hairline); }
body.sos .sos-dialog-foot .dialog-actions { margin: 0; }
@media (max-width: 767px) { body.sos .sos-dialog-foot .dialog-actions button { min-height: 44px; } }
body.sos .sos-dialog-head h2 .sos-stage { margin-left: 8px; vertical-align: middle; font-family: var(--font-body); }
body.sos .sos-pick-meta { font-size: 13px; color: var(--muted); }
body.sos .sos-pick-row { min-height: 44px; }
body.sos .sos-more { margin: 4px 0 12px; }
body.sos .sos-more summary { cursor: pointer; color: var(--fos-link); font-size: 14px; width: fit-content; }
body.sos .sos-more[open] summary { margin-bottom: 10px; }
body.sos .sos-when-held[hidden], body.sos .sos-when-held-more[hidden], body.sos .sos-if-offer[hidden], body.sos .sos-if-lost[hidden],
body.sos .sos-next[hidden], body.sos .sos-if-ref[hidden], body.sos .sos-if-booked[hidden], body.sos .sos-if-first[hidden] { display: none; }
body.sos .sos-toggle span { flex-direction: row; }
@media (max-width: 1100px) {
  body.sos .sos-find { min-width: 0; }
  body.sos .sos-find span, body.sos .sos-find .key { display: none; }
}
@media (max-width: 767px) {
  body.sos .sos-filters-inline { display: none; }
  body.sos .sos-head-actions .sos-filters-btn { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 700px) {
  body.sos .avatar.sos-avatar-btn { display: grid; }
  body.sos .sos-head { gap: 10px; }
  body.sos .sos-head .cm-title h1 { font-size: 26px; }
  body.sos .sos-head-actions { width: 100%; overflow-x: auto; justify-content: flex-start; padding-bottom: 2px; }
  body.sos .sos-head-actions > * { flex: 0 0 auto; }
  body.sos .sos-head-actions .sos-select select { max-width: 150px; }
  body.sos .sos-today-kpis .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.sos .sos-chips-bar::after, body.sos .sos-todo .sos-chips-wrap::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 28px;
    background: linear-gradient(to right, transparent, var(--bg)); pointer-events: none; }
  body.sos .sos-li { grid-template-columns: 72px minmax(0, 1fr); gap: 6px 12px; }
  body.sos .sos-li-acts { grid-column: 2; justify-content: flex-start; }
  body.sos .sos-li-acts:empty { display: none; }
  body.sos .sos-li-acts button.primary { min-height: 44px; }
  body.sos .sos-menu { position: fixed; right: 8px; left: 8px; top: 64px; }
  body.sos .sos-status { top: 66px; width: max-content; max-width: calc(100vw - 24px); }
  body.sos .sos-leak-head { grid-template-columns: minmax(0, 1fr) auto; }
  body.sos .sos-dialog-foot { bottom: -18px; margin-bottom: -18px; }
}

/* R3 amendments: the TeamOS fallback, errors beside the action, the phone deal row, phone targets, dock labels */
body.sos .sos-teamos { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; font-size: 13px; text-decoration: none; }
body.sos .sos-teamos .icon { margin: 0; width: 14px; height: 14px; }
body.sos .sos-inline-err { flex-basis: 100%; color: var(--late-text); font-size: 13px; }
body.sos button[aria-busy="true"] { opacity: .7; cursor: progress; }
body.sos .sos-deal-rows { display: none; list-style: none; margin: 0; padding: 0; }
body.sos .sos-deal-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--hairline); cursor: pointer; }
body.sos .sos-deal-row:last-child { border-bottom: 0; }
body.sos .sos-deal-next { font-size: 13px; }
body.sos .sos-deal-next .sos-sub { display: inline; margin-left: 6px; }
body.sos .sos-li-time small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
@media (max-width: 767px) {
  body.sos .sos-deals-panel .table-wrap { display: none; }
  body.sos .sos-deal-rows { display: block; }
  body.sos .sos-chips .sos-pick, body.sos .sos-head-actions button, body.sos .sos-head-actions select, body.sos .sos-stage-select select,
  body.sos .sos-li-acts button, body.sos .sos-actions button, body.sos .sos-seg button { min-height: 44px; }
  body.sos .sos-stage-select { flex-basis: 100%; }
  body.sos .sos-stage-select select { width: 100%; max-width: none; }
}
@media (max-width: 700px) {
  body.sos .dock a { width: auto; min-width: 60px; height: auto; min-height: 48px; padding: 4px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
  body.sos .sos-dock-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 11px; font-weight: 500; line-height: 1.2; }
  body.sos .sos-dialog { max-height: calc(100dvh - 16px); }
}
body.sos .sos-vs::before { content: " · "; }
body.sos .sos-li { grid-template-columns: 124px minmax(0, 1fr) auto; }
@media (max-width: 700px) {
  body.sos .sos-vs { display: block; }
  body.sos .sos-vs::before { content: ""; }
  body.sos .sos-li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  body.sos .sos-li-acts { grid-column: 1; }
  body.sos .sos-li-time small { display: inline; margin-left: 4px; }
}
body.sos .sos-chart-table summary { min-height: 36px; display: flex; align-items: center; }
body.sos .sos-table th .sos-conf { display: block; width: max-content; margin: 3px 0 0 auto; text-transform: none; letter-spacing: 0; }
body.sos .sos-setters th { white-space: normal; vertical-align: bottom; }
@media (max-width: 767px) {
  body.sos .sos-head-actions .sos-seg button { min-height: 44px; height: 44px; }
}
body.sos .sos-setters th, body.sos .sos-setters td { padding-left: 10px; padding-right: 10px; }
@media (max-width: 767px) {
  body.sos .sos-radio span, body.sos .sos-pick, body.sos .sos-dialog .sos-pick { min-height: 44px; }
}
body.sos .sos-inline { white-space: nowrap; min-height: 36px; padding: 0 6px; }
@media (max-width: 700px) {
  body.sos .sos-head-actions { flex-wrap: wrap; overflow-x: visible; }
}

/* Stage receipts wrap on phone; no payload or raw error belongs here. */
body.sos .sos-delivery-detail { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:12px 16px; font-size:12px; }
body.sos .sos-delivery { max-width:100%; white-space:normal; }

body.sos .sos-delivery-time { display:block; font-weight:400; overflow-wrap:anywhere; }

/* Clarity round2: native record choosers bound vertical density at every viewport. */
body.sos .sos-record-controls { display:flex; flex-wrap:wrap; gap:8px; }
body.sos .sos-record-controls select, body.sos .sos-record-controls button { min-height:44px; }
body.sos .sos-deals-panel > .sos-select, body.sos .sos-today-secondary > .sos-select,
body.sos .sos-todo > .sos-select, body.sos .sos-history > .sos-select { display:block; margin-bottom:12px; }
body.sos .sos-deals-panel > .sos-select select, body.sos .sos-today-secondary > .sos-select select,
body.sos .sos-history > .sos-select select { width:100%; max-width:420px; min-height:44px; }
body.sos .sos-board .column > .sos-select { display:block; margin:8px 0; }
body.sos .sos-board .column > .sos-select select { width:100%; min-height:44px; }
body.sos .sos-today-secondary .kpis { grid-template-columns:minmax(0,1fr); max-width:540px; }
/* This single selected KPI has four children; FOS's shared three-row subgrid cannot hold provenance. */
body.sos .kpis.sos-kpis-today > .kpi { display:flex; flex-direction:column; grid-row:auto; gap:6px; }
body.sos .kpis.sos-kpis-today > .kpi > * { min-width:0; white-space:normal; overflow-wrap:anywhere; }
body.sos .kpis.sos-kpis-today > .kpi > .kpi-foot { margin:0; }
body.sos .kpis.sos-kpis-today > .kpi > .sos-reading { margin:0; }
body.sos .sos-history { padding:0 16px; }
body.sos [data-when-preset] { width:100%; min-height:44px; margin-bottom:10px; }

body.sos .sos-next-reason { display:block; font-weight:600; }
body.sos .sos-text-part { display:block; overflow-wrap:anywhere; }
body.sos .sos-next-reason > .sos-select, body.sos .sos-note-text > .sos-select { display:block; margin-bottom:8px; }
body.sos .sos-next-reason select, body.sos .sos-note-text select { width:100%; min-height:44px; }

/* Compact analytics retain full live records through native pickers and optional detail. */
body.sos .sos-read-more { margin:12px 0; }
body.sos .sos-read-more > summary { min-height:44px; cursor:pointer; color:var(--fos-link); }
body.sos .sos-read-detail { padding-top:8px; }
body.sos .sos-panel > .sos-select, body.sos .sos-read-detail > .sos-select { display:block; margin:8px 0; }
body.sos .sos-panel > .sos-select select, body.sos .sos-read-detail > .sos-select select { max-width:100%; min-height:44px; }
body.sos .sos-read-values { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 16px; margin:12px 0; }
body.sos .sos-read-values dd { margin:0; font-weight:600; }
body.sos .sos-read-detail .sos-tags { display:flex; flex-direction:column; gap:6px; }
body.sos .sos-panel > .sos-reading { margin:0 0 12px; overflow-wrap:anywhere; }
body.sos .sos-panel .kpis.sos-kpis-today { grid-template-columns:minmax(0,1fr); max-width:540px; }
body.sos .sos-read-detail .sos-text-part { max-width:65ch; }

/* Setter source gaps are named plain text, never a pill beside a real result. */
body.sos .sos-coverage { font-size: 12px; font-weight: 400; color: var(--warn-text); }
body.sos .sos-coverage.is-low, body.sos .sos-coverage.is-none { color: var(--late-text); }
