:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f8f9fb; --line: #e3e6eb; --line-2: #eef0f3;
  --ink: #111827; --ink-2: #374151; --muted: #6b7280; --faint: #6b7280;  /* faint carries real info (stock/VIN lines, KPI subtitles): AA 4.8:1 on white, BUG-007 */
  --accent: #0e6b5c; --accent-2: #0b5a4d; --accent-soft: #e4f2ef; --accent-ink: #ffffff;
  --red: #c2352b; --red-soft: #fdecea; --amber: #a15c07; --amber-soft: #fdf3e2; --blue: #2756c5; --blue-soft: #e9effc;
  --side: #0f1720; --side-ink: #c9d1db; --side-muted: #7d8794; --side-on: #ffffff; --side-hover: #18222e;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1116; --surface: #151b22; --surface-2: #19212a; --line: #26303b; --line-2: #1f2832;
    --ink: #e8ecf1; --ink-2: #c6ced8; --muted: #8b95a3; --faint: #677180;
    --accent: #34b39a; --accent-2: #2a9c86; --accent-soft: #14302a; --accent-ink: #071612;
    --red: #f07167; --red-soft: #3a1d1b; --amber: #f0b45a; --amber-soft: #352816; --blue: #7aa2ff; --blue-soft: #1a2541;
    --side: #0a0e13; --side-hover: #121921; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1116; --surface: #151b22; --surface-2: #19212a; --line: #26303b; --line-2: #1f2832;
  --ink: #e8ecf1; --ink-2: #c6ced8; --muted: #8b95a3; --faint: #677180;
  --accent: #34b39a; --accent-2: #2a9c86; --accent-soft: #14302a; --accent-ink: #071612;
  --red: #f07167; --red-soft: #3a1d1b; --amber: #f0b45a; --amber-soft: #352816; --blue: #7aa2ff; --blue-soft: #1a2541;
  --side: #0a0e13; --side-hover: #121921; --shadow: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--side-on); padding: 4px 8px 20px; }
.logo .mark { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #1a8f7a, #0e6b5c); display: grid; place-items: center; font-weight: 700; color: #fff; }
.logo b { display: block; font-size: 15px; letter-spacing: .01em; } .logo small { display: block; font-size: 11px; color: var(--side-muted); letter-spacing: .08em; text-transform: uppercase; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a { display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 8px 10px; border-radius: 7px; font-weight: 500; }
#nav a:hover { background: var(--side-hover); color: var(--side-on); }
#nav a.on { background: var(--side-hover); color: var(--side-on); }
#nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid #1d2733; font-size: 12px; color: var(--side-muted); display: grid; gap: 6px; }
.side-foot .me { color: var(--side-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .link { background: none; border: 0; padding: 0; color: var(--side-muted); cursor: pointer; text-align: left; font-size: 12px; }
.side-foot .link:hover { color: var(--side-on); }
.worker { display: flex; align-items: center; gap: 7px; }
.worker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.worker.on .dot { background: #31c48d; } .worker.off .dot { background: #f59e0b; }
main { padding: 28px 32px 80px; min-width: 0; max-width: 1240px; width: 100%; }

/* ---------- page parts ---------- */
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.head p { margin: 4px 0 0; color: var(--muted); max-width: 720px; }
.head .actions { margin-left: auto; display: flex; gap: 8px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: inline-block; }
.crumb:hover { color: var(--accent); }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 28px 0 10px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel.pad { padding: 16px 18px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .faint { color: var(--faint); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--faint); margin-top: 2px; }
.kpi.click { cursor: pointer; } .kpi.click:hover { border-color: var(--accent); } .kpi.sel { border-color: var(--accent); background: var(--accent-soft); }
.bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 18px; }
.bar-list h3 { font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.bar { display: grid; grid-template-columns: 1fr 34px; gap: 8px; align-items: center; font-size: 12.5px; margin: 6px 0; }
.bar .t { position: relative; padding: 3px 8px; border-radius: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bar .t i { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); z-index: 0; border-radius: 5px; }
.bar .t span { position: relative; z-index: 1; }
.bar .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- controls ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
input, select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=search] { min-width: 220px; }
textarea { width: 100%; resize: vertical; }
.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); } .btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); } .btn.ghost:hover { border-color: var(--faint); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--ink); color: var(--surface); }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); cursor: pointer; user-select: none; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
th { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
th.sort { cursor: pointer; user-select: none; } th.sort:hover { color: var(--ink); }
th .arr { display: inline-block; width: 10px; margin-left: 3px; color: var(--accent); }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
td .sub { display: block; font-size: 12px; color: var(--faint); }
.empty { padding: 36px; text-align: center; color: var(--muted); }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; border-radius: 999px; padding: 1px 9px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.chip.green { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.chip.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.chip.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.score { display: inline-grid; place-items: center; min-width: 30px; height: 24px; border-radius: 6px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.score.lo { background: var(--red-soft); color: var(--red); } .score.mid { background: var(--amber-soft); color: var(--amber); } .score.hi { background: var(--accent-soft); color: var(--accent); }
.score.big { min-width: 56px; height: 44px; font-size: 22px; border-radius: 10px; }
.row-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- deal page ---------- */
.deal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
/* Two columns: the right one runs the full height of the row, so the block holding "Talk through this grade", "Notes from
   managers" and the folded "Earlier grades" stays pinned under the top bar while the conversation scrolls (Daniel 2026-11-11).
   A block taller than the window scrolls inside itself. The side padding leaves room for the panels' shadows. */
@media (min-width: 901px) {
  .deal-grid > .deal-side { align-self: stretch; }
  .deal-pin { position: sticky; top: 64px; max-height: calc(100vh - 76px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin: 0 -8px; padding: 0 8px 10px; }
  .deal-pin > div:first-child > h2 { margin-top: 20px; }
}
.deal-pin .hist { margin-top: 18px; } .deal-pin .hist > summary { padding: 12px 40px 12px 16px; } .deal-pin .hist .wchev { top: 13px; }
.deal-pin .hist .why-in { padding: 4px 16px 12px; } .deal-pin .hist .note:first-child { margin-top: 8px; }
.deal-head { display: flex; gap: 16px; align-items: center; }
.deal-head h1 { font-size: 22px; margin: 0; font-weight: 650; }
.say { font-size: 15px; line-height: 1.55; color: var(--ink); }
.label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; }
.block + .block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.miss { padding: 12px 0; border-bottom: 1px solid var(--line-2); } .miss:last-child { border-bottom: 0; }
.miss .top { display: flex; gap: 8px; align-items: baseline; }
.miss q { display: block; margin: 6px 0; padding: 6px 10px; background: var(--surface-2); border-radius: 6px; color: var(--ink-2); font-style: normal; font-size: 13px; }
.miss q::before, .miss q::after { content: ""; }
.miss .fix { color: var(--accent); font-size: 13px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; text-align: right; }
.note { padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; } .note:last-of-type { border-bottom: 0; }
.note b { font-weight: 600; }
.banner { display: flex; gap: 8px; align-items: center; background: var(--amber-soft); color: var(--amber); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin: 10px 0; }

/* ---------- conversation ---------- */
.convo { padding: 8px 18px 18px; }
.day { text-align: center; margin: 18px 0 8px; font-size: 11.5px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.ev { display: flex; flex-direction: column; margin: 8px 0; max-width: 78%; }
.ev.them { align-items: flex-start; } .ev.us { align-items: flex-end; margin-left: auto; } .ev.sys { max-width: 100%; align-items: stretch; }
.ev .meta { font-size: 11.5px; color: var(--faint); margin: 0 4px 3px; }
.ev .bub { padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.ev.them .bub { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ev.us .bub { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.ev.bot .bub { background: var(--blue-soft); color: var(--ink); border: 1px solid transparent; }
.ev.sys .bub { background: none; border: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; border-radius: 8px; }
.call { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; overflow: hidden; }
.call summary { list-style: none; cursor: pointer; padding: 10px 14px; display: flex; gap: 10px; align-items: center; background: var(--surface-2); font-size: 13px; }
.call summary::-webkit-details-marker { display: none; }
.call .lines { padding: 10px 14px; display: grid; gap: 6px; max-height: 480px; overflow: auto; font-size: 13px; }
.call .ln { display: grid; grid-template-columns: 82px 1fr; gap: 10px; }
.call .who { font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--muted); padding-top: 2px; }
.call .who.c { color: var(--blue); } .call .who.d { color: var(--accent); }

/* ---------- docs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.prose { line-height: 1.65; padding: 22px 28px; font-size: 14px; }
.prose h1 { font-size: 22px; margin: 0 0 10px; } .prose h2 { font-size: 17px; text-transform: none; letter-spacing: -.01em; color: var(--ink); margin: 30px 0 8px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.prose h2:first-of-type { border-top: 0; padding-top: 0; } .prose h3 { font-size: 14.5px; margin: 18px 0 6px; }
.prose p, .prose ul, .prose ol { margin: 8px 0; } .prose ul { padding-left: 22px; } .prose li { margin: 3px 0; }
.prose table { margin: 12px 0; } .prose td, .prose th { border: 1px solid var(--line); position: static; }
.prose th { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--ink); }
.prose blockquote { margin: 12px 0; padding: 10px 14px; background: var(--accent-soft); border-radius: 8px; } .prose blockquote p { margin: 0; }
.prose hr { display: none; } .prose code { font: 12.5px ui-monospace, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.doc { min-height: 60vh; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--bg); }
.login .card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: 0 10px 40px rgba(16, 24, 40, .08); }
.login .logo { color: var(--ink); padding: 0 0 18px; } .login .logo small { color: var(--muted); }
.login h1 { font-size: 19px; margin: 0 0 4px; } .login input { width: 100%; margin: 14px 0 10px; padding: 10px 12px; }
.login .btn { width: 100%; justify-content: center; padding: 10px; }
.login .or { text-align: center; color: var(--faint); font-size: 12px; margin: 12px 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: s .8s linear infinite; vertical-align: -2px; }
@keyframes s { to { transform: rotate(360deg); } }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; z-index: 10; flex-direction: row; align-items: center; padding: 8px 12px; gap: 6px; overflow-x: auto; }
  .logo { padding: 0 6px 0 0; } .logo span:not(.mark) { display: none; }
  #nav { flex-direction: row; } #nav a { padding: 7px 9px; font-size: 13px; white-space: nowrap; } #nav svg { display: none; }
  .side-foot { display: none; }
  main { padding: 18px 14px 60px; }
  .deal-grid { grid-template-columns: 1fr; }
  .ev { max-width: 92%; }
  .hide-sm { display: none; }
  input[type=search] { min-width: 0; width: 100%; }
}

/* feedback on grades */
.fb { margin-top: 8px; }
.fb-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fbv { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; cursor: pointer; }
.fbv:hover { border-color: var(--faint); color: var(--ink-2); }
.fbv.on.green { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.fbv.on.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.fbv.on.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.fb-said { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.fb textarea { font-size: 13px; }
.rec { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.rec .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; display: inline-block; }
#recBtn.live { background: var(--red); color: #fff; } #recBtn.live .dot { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
#recPlay { width: 100%; margin-bottom: 8px; }
.reviewbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
.reviewbar .grow { flex: 1; }
.callwho { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px 0; }
.callwho select { padding: 4px 8px; }
.prop { margin-bottom: 10px; }
.prop .top { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.diff { font-size: 13px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.diff del, .diff ins { display: block; padding: 8px 10px; white-space: pre-wrap; text-decoration: none; }
.diff del { background: var(--red-soft); color: var(--red); text-decoration: line-through; }
.diff ins { background: var(--accent-soft); color: var(--ink); }
.badge { margin-left: auto; background: var(--amber); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.fbc { background: none; border: 0; padding: 2px 4px; color: var(--accent); cursor: pointer; font-size: 12px; }
.fbc:hover { text-decoration: underline; }

/* ---------- coaching: why this grade, calls not heard, house rules, calibration (2026-11-10) ---------- */
.why { margin-top: 14px; }
.why > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 13px 44px 13px 18px; position: relative; }
.why > summary::-webkit-details-marker { display: none; }
.why > summary b { font-weight: 600; }
.wchev { position: absolute; right: 14px; top: 14px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transform: rotate(-90deg); transition: transform .15s; }
.why[open] > summary .wchev { transform: none; }
.why[open] > summary { border-bottom: 1px solid var(--line-2); }
.why-in { padding: 4px 18px 10px; }
.why-sec { padding: 14px 0 4px; } .why-sec + .why-sec { border-top: 1px solid var(--line-2); }
.why-sec[hidden] { display: none; }
.why-sec .label { margin-bottom: 0; }
.unseen-sec .miss { color: var(--muted); } .unseen-sec .miss .fix { color: var(--muted); } .unseen-sec .chip { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.chip.nh { background: none; border: 1px dashed var(--faint); color: var(--muted); }
.nh-note { color: var(--muted); font-size: 13px; }
.pt { display: grid; gap: 5px; justify-items: start; } .pt + .pt { margin-top: 14px; }
.cmp-act { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: -6px 0 14px; }
.rules { padding: 0 18px; }
.rule { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line-2); } .rule:last-child { border-bottom: 0; }
.rule-main { flex: 1; min-width: 0; display: grid; gap: 5px; }
.rule-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rule-text { font-size: 14px; line-height: 1.5; color: var(--ink); }
.rule.off .rule-text { color: var(--ink-2); }
.rule-sw { flex: none; min-width: 58px; display: flex; justify-content: flex-end; padding-top: 2px; }
.rule-sw input { width: 16px; height: 16px; accent-color: var(--accent); }
.cal-form { position: sticky; top: 16px; }
.cal-form h2 { margin-top: 0; }
.cal-score { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cal-score button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 8px; padding: 9px 0; font-weight: 600; font-size: 14px; cursor: pointer; font-variant-numeric: tabular-nums; }
.cal-score button:hover { border-color: var(--faint); }
.cal-score button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 900px) {
  .cal-form { position: static; order: -1; }
  .rule { flex-direction: column; gap: 8px; } .rule-sw { justify-content: flex-start; }
  .why-in { padding: 4px 14px 10px; } .rules { padding: 0 14px; }
}

/* ---------- grading standard v3: six-step strip, score by person, measured numbers, weekly digest ---------- */
.steps-panel { margin-bottom: 14px; }
.steps6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.st { display: grid; gap: 3px; align-content: start; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.st-n { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-r { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: baseline; gap: 6px; line-height: 1.3; }
.st-r .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; transform: translateY(-1px); }
.st-w { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.st.r3 .st-r { color: var(--accent); } .st.r3 .dot { background: var(--accent); }
.st.r2 .dot { background: var(--accent); }
.st.r1 .st-r { color: var(--amber); } .st.r1 .dot { background: var(--amber); }
.st.r0 .st-r { color: var(--red); } .st.r0 .dot { background: var(--red); } .st.r0 { background: var(--red-soft); border-color: transparent; }
.st.rna { background: none; border-style: dashed; } .st.rna .st-r { color: var(--muted); font-weight: 500; } .st.rna .dot { background: none; border: 1px solid var(--faint); }
.st-note { margin: 10px 0 0; }
.prs { display: grid; gap: 8px; }
.pr { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.dots6 { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots6 i { width: 9px; height: 9px; border-radius: 2px; background: var(--accent); display: inline-block; }
.dots6 i.r3 { background: var(--accent); } .dots6 i.r2 { background: var(--bar-2); } .dots6 i.r1 { background: var(--amber); } .dots6 i.r0 { background: var(--red); }
.dots6 i.rna { background: none; border: 1px solid var(--line); }
.measured { margin-top: 14px; }
.measured .facts { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.measured .facts dd.over { color: var(--red); font-weight: 600; }
.pt-q { display: grid; gap: 3px; width: 100%; }
.pt-q q { display: block; padding: 6px 10px; background: var(--surface-2); border-radius: 6px; color: var(--ink-2); font-size: 13px; quotes: none; }
.pt-q q::before, .pt-q q::after { content: ""; }
.dg-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; align-items: start; }
.dg-name { font-size: 16px; font-weight: 650; margin: 0 0 2px; }
.dg-meta { margin: 0 0 10px; }
.dg-pat { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.dg-parts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 14px; margin: 0; font-size: 14px; line-height: 1.5; }
.dg-parts dt { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 3px; }
.dg-parts dd { margin: 0; color: var(--ink); }
.dg-revl { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.dg-rev { display: grid; gap: 2px; }
.dg-rev a { display: flex; gap: 10px; align-items: center; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; color: var(--ink); flex-wrap: wrap; }
.dg-rev a:hover { background: var(--surface-2); }
.dg-car { font-weight: 500; }
@media (max-width: 900px) {
  .steps6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dg-list { grid-template-columns: 1fr; }
  .dg-parts { grid-template-columns: 1fr; gap: 2px 0; } .dg-parts dd { margin-bottom: 10px; }
}

/* A note under a table: what its columns mean (Reps), or how a column is recorded (Access). The table comes first. */
.tnote { margin: 12px 2px 0; max-width: 980px; } .tnote p { margin: 0 0 6px; }
@media (max-width: 900px) { .tnote p:not(.ponly) { display: none; } }
/* Access: what each role can do */
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
.roles .rl { margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.roles ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.roles .full { grid-column: 1 / -1; margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--line-2); }
@media (max-width: 900px) { .roles { grid-template-columns: 1fr; gap: 16px; } }
/* An explanation that starts folded: "How it's measured", "How this works" (deal sidebar) */
.how { margin-top: 10px; } .how.top { margin: 0 0 12px; }
.how > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--muted); user-select: none; }
.how > summary::-webkit-details-marker { display: none; }
.how > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-1px) rotate(-45deg); transition: transform .15s; }
.how[open] > summary::after { transform: translateY(-2px) rotate(45deg); }
.how > summary:hover { color: var(--ink); }
.how > p { margin: 7px 0 0; }
/* What a feedback button does: a speech bubble above the button, its tail pointing at it (app.js bubbleInit).
   Named fbtip, not bub: .bub is the conversation's message bubble. */
.fbtip { position: fixed; z-index: 95; max-width: 304px; padding: 10px 14px 12px; border-radius: 16px; background: var(--tip, #111a24); color: var(--tip-ink, #dfe6ee); font-size: 12.5px; line-height: 1.5;
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .5); pointer-events: none; opacity: 0; transform: translateY(5px); transition: opacity .15s ease, transform .15s ease; }
.fbtip[hidden] { display: none; }
.fbtip.in { opacity: 1; transform: none; }
.fbtip b { display: block; color: #fff; font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.fbtip::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -5px; width: 12px; height: 12px; margin-left: -6px; background: inherit; transform: rotate(45deg); border-radius: 0 0 3px 0; }
.fbtip.below { transform: translateY(-5px); } .fbtip.below.in { transform: none; }
.fbtip.below::after { bottom: auto; top: -5px; border-radius: 3px 0 0 0; }
html.no-motion .fbtip { transition: none; }

/* A table in sections: a heading row between them (Reps: salespeople, then the people who stepped in and are not salespeople) */
tr.grp td { background: var(--surface-2); padding-top: 9px; padding-bottom: 9px; font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); cursor: default; }
tr.grp td span { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 10px; color: var(--faint); font-size: 12px; }
tr.g-others td:first-child b { font-weight: 550; }
.pgrp { margin: 18px 2px 8px; font-size: 12px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pgrp span { display: block; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); margin-top: 2px; }
td.nw .sub { white-space: nowrap; }
/* Deal conversation: play a call's recording (Firebase Storage, fetched on click) */
.callrec { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 12px; }
.callrec .btn svg { width: 12px; height: 12px; fill: currentColor; margin-right: 6px; vertical-align: -1px; }
.callrec audio { height: 36px; width: min(100%, 440px); }
