/* Lead Coach: UnionSPACE palette (matches Lead Guide). Layout: one centred column, cards and tables inside. */
:root {
  --bg: #FBF6F2; --surface: #FFFFFF; --sunk: #F4EEE8; --ink: #0D0D0D; --body: #2E2E2E; --muted: #6B6560;
  --line: #ECE4DC; --navy: #01004C; --orange: #FF581A; --orange-d: #B83A0A;
  --ok: #1E7A46; --warn: #A65F00; --bad: #C2341B; --focus: #FF581A;
  --r: 14px; --font: "Poppins", system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121118; --surface: #1C1B23; --sunk: #24232C; --ink: #F4EFEA; --body: #DAD4CE; --muted: #A29B94;
    --line: #2F2D38; --navy: #C9C7FA; --orange: #FF6A30; --orange-d: #FF8A5C; --ok: #5CC98A; --warn: #E3A54A; --bad: #FF7A62;
    color-scheme: dark; }
  .brand img { background: #fff; border-radius: 6px; padding: 2px 6px; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* "hidden" must win over display:grid/flex on forms and panels */
html, body { margin: 0; }
body { background: var(--bg); color: var(--body); font: 15px/1.55 var(--font); }
a { color: var(--navy); }
a:hover { color: var(--orange-d); }
h1, h2 { color: var(--ink); margin: 0; text-wrap: balance; font-weight: 600; }
h1 { font-size: 1.6rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin-bottom: 6px; }
p { margin: 0; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-left)); display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.brand span { border-left: 1px solid var(--line); padding-left: 10px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; color: var(--body); }
nav a.on { background: var(--sunk); color: var(--ink); font-weight: 500; }
.me { margin-left: auto; font-size: .85rem; color: var(--muted); }
.me a { color: var(--muted); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-left)) 64px; display: grid; gap: 28px; }
.head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.head > div { display: grid; gap: 6px; max-width: 80ch; }
.lede { font-size: 1.02rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.late { color: var(--bad); font-weight: 500; }
.lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; }
.empty { padding: 18px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); }

.flash { padding: 10px 14px; border-radius: 10px; background: var(--sunk); border-left: 4px solid var(--ok); }
.flash.bad { border-left-color: var(--bad); }

.seg { display: inline-flex; background: var(--sunk); border-radius: 999px; padding: 3px; }
.seg a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--body); font-size: .88rem; }
.seg a.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 2px; align-content: start; }
.tile .num { font-size: 1.9rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .lbl { text-transform: none; letter-spacing: 0; font-size: .85rem; }
.tile .sub { font-size: .78rem; color: var(--muted); }
.num.bad { color: var(--bad); } .num.warn { color: var(--warn); } .num.ok { color: var(--ok); }

.sec { display: grid; gap: 10px; min-width: 0; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; align-items: start; }
.two > * { min-width: 0; }
.two.wide-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 900px) { .two.wide-left { grid-template-columns: 1fr; } }
.stack-lg { display: grid; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; display: grid; gap: 14px; min-width: 0; align-content: start; }
@media (max-width: 560px) { .panel { padding: 18px 16px; } }
.panel.narrow { max-width: 520px; }

.scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.tbl { border-collapse: collapse; width: 100%; font-size: .9rem; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: .78rem; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.act { min-width: 280px; }
.tbl input, .tbl select { min-width: 120px; }

.bars { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 32px; gap: 10px; align-items: center; font-size: .85rem; }
.bar-track { background: var(--sunk); border-radius: 6px; height: 18px; overflow: hidden; }
.bar { display: block; height: 100%; background: var(--navy); border-radius: 6px; min-width: 2px; }
.bar.ok { background: var(--ok); } .bar.bad { background: var(--orange); }
.bar-n { text-align: right; font-variant-numeric: tabular-nums; }

.play { margin: 0; padding: 0; list-style: none; counter-reset: p; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.play li { counter-increment: p; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 14px 52px; position: relative; }
.play li::before { content: counter(p); position: absolute; left: 16px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 600; font-size: .85rem; display: grid; place-items: center; }
.play b { color: var(--ink); display: block; margin-bottom: 4px; }
.hyg { margin: 0; padding-left: 1.2rem; display: grid; gap: 4px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input[type=search] { flex: 1 1 220px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.card.done { opacity: .7; }
.card-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.who { font-weight: 600; color: var(--ink); text-decoration: none; }
.step { border-left: 3px solid var(--orange); padding-left: 10px; display: grid; gap: 2px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 9px; border-radius: 999px; border: 1.5px solid currentColor; white-space: nowrap; }
.pill.big { font-size: 1rem; padding: 4px 14px; }
.pill.P1 { color: var(--bad); } .pill.P2 { color: var(--warn); } .pill.P3, .pill.Lost { color: var(--muted); } .pill.Won, .ok-pill { color: var(--ok); }

input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 100%; max-width: 100%; }
select { width: auto; }
.filters select, .filters input { width: auto; }
textarea { resize: vertical; line-height: 1.5; }
label { font-size: .85rem; font-weight: 500; color: var(--ink); }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check input { width: auto; }
.stack { display: grid; gap: 8px; }
.stack > label:not(:first-child):not(.check) { margin-top: 6px; }
.stack .btn { justify-self: start; margin-top: 6px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row input { flex: 1 1 200px; width: auto; }
form.inline { display: inline; }

.btn { font: inherit; font-size: .88rem; font-weight: 500; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-d); border-color: var(--orange-d); color: #fff; }
.btn.small { padding: 4px 12px; font-size: .8rem; }
.btn:disabled { opacity: .55; cursor: progress; }

.draft { display: grid; gap: 6px; background: var(--sunk); border-radius: 12px; padding: 14px; }
.copyrow { display: flex; gap: 8px; } .copyrow input { flex: 1; }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 6px 12px; margin: 0; font-size: .88rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.flags { margin: 0; padding-left: 1.1rem; font-size: .88rem; }
.log { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .88rem; }

.plist { margin: 2px 0 6px; padding-left: 1.1rem; font-size: .86rem; display: grid; gap: 2px; }
.plist .unconf { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--warn); }
details > summary { cursor: pointer; }
details.pkg { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 4px; }
details.pkg:first-of-type { border-top: 0; padding-top: 0; }
.pre { white-space: pre-line; min-width: 200px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: start; }
.checks .mark { font-size: .75rem; font-weight: 600; text-align: center; border-radius: 999px; padding: 2px 0; border: 1.5px solid currentColor; }
.checks .ok .mark { color: var(--ok); } .checks .fail .mark { color: var(--bad); } .checks .info .mark { color: var(--muted); }

.chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 520px; overflow-y: auto; }
.chat li { display: grid; gap: 2px; max-width: 88%; }
.chat li.in { justify-self: start; }
.chat li.out { justify-self: end; text-align: right; }
.chat .bubble { padding: 8px 12px; border-radius: 14px; background: var(--sunk); text-align: left; font-size: .9rem; overflow-wrap: anywhere; }
.chat li.out .bubble { background: color-mix(in srgb, var(--orange) 14%, var(--surface)); }

/* ---------- lead page ---------- */
.lead-page { display: grid; gap: 20px; }
.back { justify-self: start; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--orange-d); }
.lead-head { display: grid; gap: 12px; }
.lead-title { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; color: var(--body); }
.jump { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.jump a { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--sunk); color: var(--body); text-decoration: none; font-size: .88rem; }
.jump a:hover { background: var(--line); color: var(--ink); }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .lead-grid { grid-template-columns: 1fr; } }
.lead-main, .lead-side { display: grid; gap: 20px; min-width: 0; }
.lead-main > .panel, .lead-side > .panel { scroll-margin-top: 80px; }

.coach .next { background: color-mix(in srgb, var(--orange) 7%, var(--surface)); border-left: 4px solid var(--orange);
  border-radius: 0 12px 12px 0; padding: 16px 20px; display: grid; gap: 6px; }
.coach .next p { font-size: 1.05rem; line-height: 1.7; color: var(--ink); }
.progress { height: 10px; background: var(--sunk); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--orange); border-radius: 999px; transition: width .4s ease; }
@media (prefers-reduced-motion: reduce) { .progress-bar { transition: none; } }
.case-qa { margin: 0; padding-left: 1.3rem; display: grid; gap: 10px; font-size: .9rem; line-height: 1.55; }
.case-qa details summary { margin-top: 2px; }
.side-cases > details > p { margin: 8px 0 4px; }
.side-cases details.pkg { margin-top: 8px; }
.side-cases .case-qa { font-size: .85rem; gap: 8px; padding-left: 1.1rem; }
.todo-title { display: inline-flex; align-items: center; gap: 10px; }
.todo-title .dot { width: 10px; height: 10px; border-radius: 50%; background: #E5322D; flex: none; }
.steps { margin: 0; padding-left: 1.2rem; display: grid; gap: 6px; }
.steps li { padding-left: 2px; }
.steps li::marker { color: var(--orange); }
.steps .more { list-style: none; margin-left: -1.2rem; font-size: .82rem; }
.steps-lg { gap: 10px; }
.steps-lg li { font-size: 1.02rem; line-height: 1.6; color: var(--ink); }
.steps-sm { gap: 4px; font-size: .88rem; line-height: 1.5; }
.copyable { cursor: pointer; border-bottom: 1px dashed var(--line); overflow-wrap: anywhere; }
.copyable:hover { border-bottom-color: var(--muted); }
.copyable.copied::after { content: " Copied"; color: var(--ok); font-size: .78rem; font-weight: 500; }
.contact-links { display: inline-flex; gap: 10px; margin-left: 8px; font-size: .82rem; }
.situation-text { font-size: 1.05rem; line-height: 1.7; color: var(--ink); max-width: 75ch; }
.sit-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.sit-facts > div { display: grid; gap: 2px; }
.sit-facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; }
.sit-facts dd { margin: 0; }
.offer { display: grid; gap: 8px; }
.offer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.offer-list li { padding: 5px 12px; border-radius: 999px; background: var(--sunk); font-size: .88rem; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions form { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.facts > div { display: grid; gap: 4px; align-content: start; }
.facts p + .lbl { margin-top: 12px; }
.facts p { line-height: 1.65; }
.num-lg { font-weight: 600; font-size: 1.1rem; color: var(--ink); }
.edit-box { border-top: 1px solid var(--line); padding-top: 18px; }
.edit-box h3 { margin: 0; font-size: 1rem; color: var(--ink); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; }
.grid-2 select { width: 100%; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-head form { margin: 0; }
.chat .subj { font-weight: 600; color: var(--ink); }
.pkg-body { display: grid; gap: 6px; padding: 8px 0 6px; }
details.pkg summary { padding: 4px 0; }
.kv.stacked { grid-template-columns: 1fr; gap: 2px; }
.kv.stacked dt { margin-top: 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.kv.stacked dt:first-child { margin-top: 0; }
.kv { row-gap: 10px; }
.inline-h { display: inline; }
details > summary { list-style-position: outside; }
.lead-side details[open] > summary { margin-bottom: 12px; }
.log li { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom: 0; padding-bottom: 0; }
.flags { display: grid; gap: 4px; }

.auth { max-width: 400px; margin: 8vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: grid; gap: 10px; }
.auth-logo { width: 180px; }

@media (max-width: 560px) {
  .tbl td.act { min-width: 220px; }
  .bar-row { grid-template-columns: 110px 1fr 28px; }
  .me { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* "(approved case #43)" in a step, shown as a small tag */
.case-tag { display: inline-block; vertical-align: 2px; margin-left: 4px; padding: 1px 7px; border-radius: 999px;
  font-size: .68rem; font-weight: 600; line-height: 1.5; letter-spacing: .02em; white-space: nowrap; text-decoration: none;
  color: var(--navy); background: color-mix(in srgb, var(--navy) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--navy) 18%, var(--surface)); }
a.case-tag:hover { color: var(--navy); background: color-mix(in srgb, var(--navy) 14%, var(--surface)); text-decoration: none; }

/* Proposal: check step */
.crumbs a { text-decoration: none; font-size: .9rem; }
.prop-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.prop-head p { max-width: 70ch; margin-top: 6px; }
.prop-form { display: grid; gap: 28px; }
.prop-form[inert] { opacity: .7; }
.prop-checks { border-left: 4px solid var(--warn); }
.grid3, .grid2 { display: grid; gap: 12px; margin-top: 8px; }
.grid3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid3 label, .grid2 label, .prop-form section > label { display: grid; gap: 4px; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
.prop-lines td.num, .prop-lines th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prop-lines tr.opt td { color: var(--muted); }
.prop-lines select { max-width: 280px; }
.prop-lines .w-num { width: 64px; min-width: 64px; text-align: right; }
.prop-lines .w-price { width: 110px; min-width: 110px; text-align: right; }
.prop-lines .w-price.changed { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.prop-lines input[type=checkbox] { width: auto; min-width: 0; }
.add-svc { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.add-svc select { max-width: 100%; }
.totals { max-width: 480px; }
.totals dd { text-align: right; font-variant-numeric: tabular-nums; }
.flash.warn { border-left-color: var(--warn); }
.flash ul { margin: 4px 0 0; padding-left: 1.1rem; }
.prop-total .actions { margin-top: 14px; }
.btn.link { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 4px 0; }
.prop-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .88rem; }
.prop-list li { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }

/* Leads page: lead card */
.cards { gap: 18px; }
.card.lc { padding: 20px; gap: 12px; }
.lc-head { display: flex; align-items: center; gap: 10px; }
.lc-head .who { font-size: 1.08rem; line-height: 1.3; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lc-head .who:hover { color: var(--orange-d); }
.lc-id { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.lc-service { font-size: .9rem; font-weight: 500; color: var(--navy); margin-top: -4px; }
.lc-meta { list-style: none; margin: -4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); }
.lc-meta li { display: inline-flex; align-items: center; gap: 5px; }
.lc-warn { color: var(--warn); font-weight: 500; }
.temp { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.temp-hot { background: var(--bad); } .temp-warm { background: var(--warn); } .temp-cold { background: #4F7CAC; }
.lc-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.flag { font-size: .75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.flag.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.flag.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.lc-sum { font-size: .92rem; line-height: 1.6; color: var(--body); padding-top: 12px; border-top: 1px solid var(--line); }
.lc-steps { background: var(--sunk); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; }
.lc-steps .steps-sm { gap: 8px; font-size: .86rem; line-height: 1.55; color: var(--ink); }
.lc-steps .case-tag, .act .case-tag { font-size: .62rem; padding: 0 6px; margin-left: 2px; }
.lc-offer { display: grid; gap: 6px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: .78rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--body); background: var(--surface); }
.chips li.more { color: var(--muted); }
.lc-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 2px; }
@media (max-width: 480px) { .cards { grid-template-columns: 1fr; } .card.lc { padding: 16px; } }

/* Reports */
.rep-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.rep-head p { margin-top: 6px; max-width: 70ch; }
.rep-tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.rep-tiles .num { font-size: 1.6rem; }
.panel h3 { font-size: .92rem; font-weight: 600; color: var(--ink); margin: 0 0 8px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px 28px; margin-top: 10px; }
.rep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; font-size: .88rem; }
.rep-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.rep-list li:last-child { border-bottom: 0; }
.rep-list a { color: var(--ink); text-decoration: none; font-weight: 500; }
.rep-list a:hover { color: var(--orange-d); }
.rep-who { grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
.rep-meta { grid-column: 1; font-size: .78rem; color: var(--muted); }
.rep-time { grid-column: 2; grid-row: 1 / span 2; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.rep-time.ok, .g.ok, .num.ok { color: var(--ok); } .rep-time.warn, .g.warn, .num.warn { color: var(--warn); } .rep-time.bad, .g.bad, .num.bad { color: var(--bad); }
.g { font-weight: 600; }
.rep-table td, .rep-table th { white-space: nowrap; }
.rep-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 28px; }
.rep-two .panel h3 { margin-top: 16px; }
.bars, .trend { display: grid; gap: 8px; margin: 8px 0 4px; font-size: .84rem; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 32px; gap: 10px; align-items: center; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--sunk); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; }
.b-1h { background: var(--ok); } .b-4h { background: color-mix(in srgb, var(--ok) 55%, var(--warn)); } .b-1d { background: var(--warn); }
.b-more { background: var(--bad); } .b-none { background: var(--muted); }
.b-resp { background: var(--navy); } .b-reply { background: var(--orange); }
.trend-row { display: grid; grid-template-columns: 52px 1fr 110px; gap: 10px; align-items: center; }
.trend-row .small { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.trend-bars { display: grid; gap: 3px; } .trend-bars .bar { height: 7px; }
.legend { color: var(--muted); display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.legend i { width: 14px; height: 6px; border-radius: 3px; display: inline-block; }
.rep-how li { font-size: .9rem; margin-bottom: 4px; }
.rep-settings { margin-top: 12px; }
.rep-rebuild { margin-top: 12px; }
@media (max-width: 480px) { .bar-row { grid-template-columns: 100px 1fr 28px; } .rep-two { grid-template-columns: 1fr; } }

/* Late-response alerts */
.nav-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #E5322D; color: #fff;
  font-size: .7rem; font-weight: 600; line-height: 18px; text-align: center; vertical-align: 1px; }
.alerts-box { border-left: 4px solid #E5322D; border-radius: 0 var(--r) var(--r) 0; }
.alerts-box h2 { display: flex; align-items: center; gap: 8px; }
.alerts-box .dot { width: 9px; height: 9px; border-radius: 50%; background: #E5322D; display: inline-block; }
.alert-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
.alert-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.alert-list li.esc .al-time { color: #E5322D; }
.al-who { font-weight: 600; color: var(--ink); text-decoration: none; }
.al-what { font-size: .84rem; color: var(--muted); }
.al-time { font-weight: 600; color: var(--warn); font-variant-numeric: tabular-nums; white-space: nowrap; }
.al-act { display: flex; gap: 6px; flex-wrap: wrap; }
.al-act form { margin: 0; }
@media (max-width: 560px) { .alert-list li { grid-template-columns: 1fr auto; } .al-act { grid-column: 1 / -1; } }

/* Stay warm */
.warm .panel-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.warm-msg { background: var(--sunk); border-radius: 12px; padding: 14px; display: grid; gap: 6px; margin: 10px 0 14px; }
.warm-msg textarea { background: var(--surface); }
.warm-act { margin-top: 6px; }
.warm-act form { margin: 0; }
.warm-steps { margin: 6px 0 10px; padding-left: 1.3rem; display: grid; gap: 4px; font-size: .88rem; }
.warm-steps li span + span { margin-left: 8px; }
.warm-steps .ws-reconnected { color: var(--ok); } .warm-steps .ws-skipped { color: var(--muted); }
.warm-steps .ws-sent { font-weight: 600; }
.warm-edit { margin-top: 4px; } .warm-edit form { margin-top: 10px; }
.warm-form details { margin: 4px 0; }
.warm-ghost { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; display: grid; gap: 6px; }
.warm-sent { margin: 0; padding-left: 1.1rem; display: grid; gap: 2px; }
.warm-box { border-left: 4px solid var(--warn); border-radius: 0 var(--r) var(--r) 0; }
.tpl-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 14px; }
.tpl-nums { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 8px; }
.tpl-nums a { min-width: 30px; text-align: center; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: var(--body); font-size: .85rem; }
.tpl-nums a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.tpl-preview { background: var(--sunk); border-radius: 12px; padding: 14px; margin: 6px 0 10px; font-size: .88rem; }
.tpl-preview pre { white-space: pre-wrap; font: inherit; margin: 8px 0 0; }

/* Snooze the Lead: header, how it works, reminder timeline */
.snz { background: linear-gradient(180deg, color-mix(in srgb, var(--navy) 4%, var(--surface)) 0, var(--surface) 140px); }
.snz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.snz-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: var(--navy); background: color-mix(in srgb, var(--navy) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--navy) 16%, var(--surface)); }
.snz-title { flex: 1; min-width: 180px; }
.snz-title h2 { margin: 0; }
.snz-title p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.snz-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.snz-hint { font-size: .85rem; font-weight: 500; color: var(--warn); margin-bottom: 10px; }
.snz-how { list-style: none; counter-reset: snz; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.snz-how li { counter-increment: snz; position: relative; padding: 12px 12px 12px 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 2px; }
.snz-how li::before { content: counter(snz); position: absolute; left: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: .75rem; font-weight: 600; display: grid; place-items: center; }
.snz-how b { color: var(--ink); font-size: .9rem; }
.snz-how span { font-size: .8rem; color: var(--muted); line-height: 1.45; }
.snz-line { list-style: none; margin: 8px 0 6px; padding: 6px 2px 2px; display: flex; gap: 0; overflow-x: auto; position: relative; }
.snz-line li { position: relative; flex: 1 0 56px; display: grid; justify-items: center; gap: 4px; padding-top: 2px; }
.snz-line li::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 2px; background: color-mix(in srgb, var(--navy) 15%, var(--surface)); z-index: 0; }
.snz-line li:first-child::before { left: 50%; } .snz-line li:last-child::before { right: 50%; }
.snz-line i { position: relative; z-index: 1; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--navy); }
.snz-line .d { font-size: .72rem; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.snz-line .n { font-size: .65rem; color: var(--muted); }
.snz-line .st-preview i { border-style: dashed; border-color: color-mix(in srgb, var(--navy) 45%, var(--surface)); }
.snz-line .st-sent i, .snz-legend .st-sent { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 18%, transparent); }
.snz-line .st-reconnected i, .snz-legend .st-reconnected { background: var(--ok); border-color: var(--ok); }
.snz-line .st-skipped i, .snz-legend .st-skipped { background: var(--line); border-color: var(--muted); }
.snz-line .st-failed i { background: var(--bad); border-color: var(--bad); }
.snz-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .75rem; color: var(--muted); margin: 0 0 8px; }
.snz-legend span { display: inline-flex; align-items: center; gap: 5px; }
.snz-legend i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--navy); display: inline-block; box-shadow: none !important; }
.snz .warm-form { margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* "Clients waiting for a reply": hours waiting in bright red */
.wait-hrs { color: #E8140C; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { .wait-hrs { color: #FF4D45; } }

/* Users: shared mailboxes */
.mbx-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 14px; }
.mbx-add label { display: grid; gap: 4px; flex: 1 1 200px; }
.mbx-add .btn { flex: none; }
#mailboxes .mbx-act { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
#mailboxes .mbx-act form { margin: 0; }
#mailboxes .mbx-act summary { list-style: none; }
#mailboxes .mbx-act summary::-webkit-details-marker { display: none; }
#mailboxes .mbx-rm { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--sunk); min-width: 220px; }
#mailboxes td b { white-space: nowrap; }
#mailboxes .mbx-act { min-width: 250px; }
#mailboxes .mbx-rm input[type=checkbox] { min-width: 0; width: auto; flex: none; }
#mailboxes .mbx-rm label.check { align-items: flex-start; line-height: 1.4; }

/* Copilot key on the Account page */
.copykey { font-size: .85rem; word-break: break-all; background: var(--surface); padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); }
