/* Missed Call Reply: ink band, cool paper, marigold for attention, leaf for done. */
:root {
  --ink: #13203a;
  --ink-2: #1c2d4f;
  --ink-3: #2a3d63;
  --ink-text: #e9edf6;
  --ink-muted: #9aa6c1;
  --paper: #f4f5f9;
  --surface: #ffffff;
  --line: #e2e5ee;
  --line-2: #eef0f5;
  --text: #141b2b;
  --muted: #5d6780;
  --marigold: #f0a500;
  --marigold-deep: #9a6400;
  --marigold-soft: #fff4d9;
  --leaf: #17845a;
  --leaf-soft: #e2f3eb;
  --ai: #3a4f86;
  --ai-soft: #e9edf7;
  --danger: #b8322a;
  --danger-soft: #fdebea;
  --radius: 14px;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Oriya", "Noto Sans Devanagari", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
.boot { padding: 48px; color: var(--muted); text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 6px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 8px 14px; min-height: 38px;
  font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: #c9cfdc; background: #fafbfd; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-2); }
.btn.marigold { background: var(--marigold); border-color: var(--marigold); color: #241600; }
.btn.marigold:hover { background: #ffb81f; }
.btn.on-ink { background: transparent; border-color: var(--ink-3); color: var(--ink-text); }
.btn.on-ink:hover { background: var(--ink-2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.btn.wide { width: 100%; min-height: 46px; font-size: 15px; }
.linkbtn { background: none; border: 0; padding: 4px 2px; cursor: pointer; color: var(--ink-muted); font-weight: 600; font-size: 14px; }
.linkbtn:hover { color: #fff; }
.linkbtn.dark { color: var(--ai); }
.linkbtn.dark:hover { color: var(--ink); text-decoration: underline; }

/* ── Inputs ── */
input[type=text], input[type=password], input[type=search], input[type=tel], input[type=date], textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(42, 61, 99, .14); }
textarea { resize: vertical; min-height: 44px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.error-text { color: var(--danger); font-size: 14px; min-height: 20px; margin: 8px 0 0; }

/* ── Ink band ── */
.band { background: var(--ink); color: var(--ink-text); padding: 0 28px 22px; }
.band-top { display: flex; align-items: center; gap: 18px; height: 60px; max-width: 1240px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; text-decoration: none; color: #fff; letter-spacing: -0.01em; }
.mark { width: 32px; height: 32px; display: grid; place-items: center; flex: none; }
.mark svg { width: 32px; height: 32px; overflow: visible; }
.mark .bubble { fill: #fff; }
.mark .handset { fill: var(--ink); }
.mark circle { fill: var(--marigold); stroke: var(--ink); stroke-width: 16; }
.tabs { display: flex; gap: 4px; margin-left: 14px; }
.tab { padding: 6px 12px; border-radius: 8px; color: var(--ink-muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.tab:hover { color: #fff; background: var(--ink-2); }
.tab[aria-current=page] { color: #fff; background: var(--ink-2); box-shadow: inset 0 -2px 0 var(--marigold); }
.spacer { flex: 1; }
.who { color: var(--ink-muted); font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.band-main { max-width: 1240px; margin: 14px auto 0; display: flex; align-items: flex-end; gap: 20px; }
.heading { min-width: 0; flex: 1; }
.heading h1 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; color: #fff; line-height: 1.08; overflow-wrap: anywhere; }
.heading .sub { margin: 6px 0 0; color: var(--ink-muted); font-size: 15px; }
.back { display: inline-block; color: var(--ink-muted); text-decoration: none; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.back::before { content: "‹ "; }
.back:hover { color: #fff; }
.aside, .aside-inner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-state { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-text); }
.ai-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-muted); }
.ai-state.on::before { background: #3ecf8e; box-shadow: 0 0 0 4px rgba(62, 207, 142, .18); }

/* Day strip */
.strip-wrap { max-width: 1240px; margin: 22px auto 0; }
.strip { position: relative; }
.strip .plot { position: relative; height: 58px; }
.strip svg { position: absolute; inset: 0 0 1px 0; width: 100%; height: calc(100% - 1px); }
.strip .busy { fill: var(--ink-3); }
.strip .axis { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #3b4e77; border-radius: 2px; }
.strip .now { position: absolute; top: -6px; bottom: 0; width: 0; border-left: 1.5px dashed rgba(255, 255, 255, .6); }
.strip .call { position: absolute; bottom: 1px; width: 13px; height: 13px; margin-left: -6.5px; transform: translateY(50%); border-radius: 50%; border: 2.5px solid var(--ink); }
.strip .call.ok { background: #3ecf8e; }
.strip .call.miss { background: var(--marigold); }
.strip .hours { position: relative; height: 22px; }
.strip .hr { position: absolute; top: 8px; transform: translateX(-50%); font-size: 12px; color: var(--ink-muted); white-space: nowrap; }
.strip .hr:first-child { transform: none; }
.strip .hr:last-child { transform: translateX(-100%); }
.strip.compact .plot { height: 16px; }
.strip.compact .call { width: 10px; height: 10px; margin-left: -5px; border-width: 2px; }

.figures { max-width: 1240px; margin: 18px auto 0; border-top: 1px solid var(--ink-2); padding-top: 16px; }
.figures-inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.fig-v { font-size: 26px; font-weight: 800; color: #fff; line-height: 1.1; }
.fig-v small { font-size: 15px; font-weight: 600; color: var(--ink-muted); }
.fig-l { font-size: 13.5px; color: var(--ink-muted); margin-top: 2px; }
.fig-x { font-size: 12.5px; color: #c8d0e3; margin-top: 4px; }
.band .meter { margin-top: 8px; background: var(--ink-2); }

.meter { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: #3ecf8e; border-radius: inherit; }
.meter.high span { background: var(--marigold); }
.meter.full span { background: #e5584f; }

/* ── Page ── */
.page { max-width: 1296px; margin: 0 auto; padding: 24px 28px 48px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel-title { font-size: 18px; font-weight: 800; margin: 0 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.actions-row { display: flex; align-items: center; gap: 12px; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty.center { margin: auto; display: grid; gap: 4px; }
.empty b { color: var(--text); }
.notice { background: var(--marigold-soft); color: #5d3d00; border-radius: 10px; padding: 11px 14px; font-size: 14px; margin-bottom: 14px; }
.notice.attn { background: var(--danger-soft); color: var(--danger); }

/* Pills */
.pill { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.pill.ok { background: var(--leaf-soft); color: var(--leaf); }
.pill.attn { background: var(--marigold); color: #241600; }
.pill.ai { background: var(--ai-soft); color: var(--ai); }
.pill.wait { background: var(--line-2); color: var(--muted); }
.pill.quiet { background: var(--line-2); color: var(--muted); }

/* ── Clients table ── */
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.toolbar input { max-width: 320px; }
.add-panel { margin-bottom: 16px; }
.table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: visible; }
.thead, .trow { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(140px, 1.2fr) minmax(150px, 1.3fr) minmax(150px, 1.2fr) 250px; gap: 16px; align-items: center; padding: 14px 20px; }
.thead { font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding-top: 11px; padding-bottom: 11px; }
.trow + .trow { border-top: 1px solid var(--line-2); }
.trow.paused { background: #fafbfc; }
.trow.paused .biz-name { color: var(--muted); }
.biz-name { font-weight: 800; font-size: 16px; text-decoration: none; }
.biz-name:hover { text-decoration: underline; }
.biz-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 3px; }
.plan { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 7px; background: var(--ai-soft); color: var(--ai); }
.plan-basic { background: var(--line-2); color: var(--muted); }
.plan-pro { background: var(--ink); color: #fff; }
.status { font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #c3c8d4; }
.status.on::before { background: var(--leaf); }
.today b, .month b { font-size: 17px; }
.mini { margin-top: 6px; background: var(--ink); border-radius: 8px; padding: 2px 12px 10px; }
.month .meter { margin-top: 6px; }
.acts { display: flex; gap: 6px; justify-content: flex-end; }

.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 12px 32px rgba(19, 32, 58, .16); display: grid; }
.menu-list button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; }
.menu-list button:hover { background: var(--line-2); }
.menu-list button.danger { color: var(--danger); }

/* ── Inbox ── */
.workspace { display: grid; grid-template-columns: 390px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); height: calc(100vh - 140px); min-height: 520px; overflow: hidden; }
.leads-pane { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.leads-tools { padding: 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.leads-tools .row { display: flex; gap: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .count:empty { display: none; }
.chip .count { background: var(--marigold); color: #241600; border-radius: 999px; padding: 0 6px; font-size: 11.5px; }
.leads-list { overflow-y: auto; flex: 1; }
.lead { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--line-2); background: none; text-align: left; cursor: pointer; position: relative; }
.lead:hover { background: #fafbfd; }
.lead[aria-current=true] { background: var(--ai-soft); }
.lead[aria-current=true]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ink); }
.lead.needs::after { content: ""; position: absolute; right: 8px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--marigold); }
.avatar { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.a0 { background: #e6ebf7; color: #33467a; } .a1 { background: #fdf0d5; color: #8a5a00; } .a2 { background: #e0f2ea; color: #1d6b4c; }
.a3 { background: #f6e6ee; color: #8b3b62; } .a4 { background: #e8e9ee; color: #474e60; }
.lead-main { min-width: 0; display: grid; }
.lead .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead .preview { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-meta { display: grid; justify-items: end; gap: 5px; }
.lead-meta .when { font-size: 12px; color: var(--muted); }

.chat-pane { display: flex; flex-direction: column; min-height: 0; background: #eef0f5; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-head .who { min-width: 0; flex: 1; color: inherit; max-width: none; display: grid; }
.chat-head .who b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request { margin: 12px 16px 0; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ai); border-radius: 12px; padding: 11px 14px; }
.request.ready { border-left-color: var(--leaf); }
.request-label { font-size: 12.5px; font-weight: 700; color: var(--ai); }
.request.ready .request-label { color: var(--leaf); }
.request p { margin: 2px 0 0; font-weight: 600; }
.request dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 0; font-size: 13.5px; }
.request dt { color: var(--muted); text-transform: capitalize; }
.request dd { margin: 0; }
.statebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; font-size: 13.5px; color: var(--muted); }
.chat-body { flex: 1; overflow-y: auto; padding: 8px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.day { align-self: center; font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, .8); padding: 2px 10px; border-radius: 999px; margin: 10px 0 4px; }
.bubble { max-width: min(76%, 540px); padding: 8px 12px 6px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.bubble.in { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.bot { background: var(--ai-soft); }
.bubble.you { background: var(--leaf-soft); }
.bubble.auto { background: transparent; border: 1px dashed #c3c9d6; color: var(--muted); font-size: 13.5px; }
.bubble .sender { display: block; font-size: 11.5px; font-weight: 700; margin-bottom: 1px; color: var(--ai); }
.bubble.you .sender { color: var(--leaf); }
.bubble .meta { display: block; text-align: right; font-size: 11px; color: var(--muted); margin-top: 3px; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 12px; background: var(--surface); border-top: 1px solid var(--line); }
.composer textarea { max-height: 140px; }
.locked { padding: 12px 16px; background: var(--marigold-soft); color: #5d3d00; font-size: 14px; border-top: 1px solid #f3dfae; }
.back-btn { display: none; }

/* ── Settings ── */
.settings { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.toggle { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; cursor: pointer; position: relative; }
.toggle input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.toggle .knob { flex: none; width: 44px; height: 26px; border-radius: 999px; background: #cdd2dd; position: relative; transition: background .15s; }
.toggle .knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.toggle input:checked + .knob { background: var(--leaf); }
.toggle input:checked + .knob::after { transform: translateX(18px); }
.toggle input:focus-visible + .knob { outline: 3px solid var(--marigold); outline-offset: 2px; }
.toggle-text { display: grid; gap: 2px; }
.admin-only { background: #f8f9fc; border: 1px dashed var(--line); border-radius: 12px; padding: 14px 14px 0; margin-bottom: 18px; }
.panel .panel-title:not(:first-child) { margin-top: 8px; }
.sticky-save { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); margin: 18px -22px -22px; padding: 14px 22px; border-radius: 0 0 var(--radius) var(--radius); justify-content: flex-end; }
.side { display: grid; gap: 18px; align-content: start; }
.test-log { background: #eef0f5; border-radius: 12px; height: 380px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.test-panel .composer { padding: 0; border: 0; background: none; margin-bottom: 6px; }

.hint { margin: -2px 0 8px; }
.svc { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fafbfd; }
.svc-head, .svc-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 76px; gap: 8px; align-items: center; }
.svc-head { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 2px 6px; }
.svc-photo { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.svc > .small:empty { display: none; }
.svc > .small { display: block; margin: -2px 0 10px; color: var(--leaf); font-weight: 600; }
.svc-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.svc-row input { background: var(--surface); }

/* ── Login ── */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-story { background: var(--ink); color: var(--ink-text); padding: 36px 48px; display: flex; flex-direction: column; }
.story { margin: auto 0; max-width: 560px; }
.story h2 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; font-weight: 800; color: #fff; }
.story p { color: var(--ink-muted); font-size: 17px; max-width: 46ch; }
.story-strip { margin: 30px 0 10px; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 14px !important; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend .dot.ok { background: #3ecf8e; }
.legend .dot.miss { background: var(--marigold); margin-left: 12px; }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 48px; max-width: 460px; width: 100%; margin: 0 auto; }
.login-form h1 { font-size: 30px; font-weight: 800; }
.login-form > .muted { margin: 6px 0 24px; }

.cc { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.cc:focus-within { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(42, 61, 99, .14); }
.cc span { display: grid; place-items: center; padding: 0 12px; background: var(--paper); color: var(--muted); font-weight: 600; border-right: 1px solid var(--line); }
.cc input { border: 0; box-shadow: none !important; border-radius: 0; font-size: 16px; letter-spacing: .02em; }
.pwbox { position: relative; }
.pwbox input { padding-right: 64px; font-size: 16px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--ai); font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px 8px; }
.forgot { margin-top: 14px; }
.keyform { display: flex; gap: 8px; margin-top: 10px; }
.login.single { grid-template-columns: 1fr; background: var(--paper); }
.brand.dark { color: var(--text); margin-bottom: 28px; }
.brand.dark .mark .bubble { fill: var(--ink); }
.brand.dark .mark .handset { fill: #fff; }
.brand.dark .mark circle { stroke: var(--paper); }
.warn { color: var(--marigold-deep); font-weight: 600; }
dl.cred { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 14px 0 8px; }
dl.cred dt { color: var(--muted); font-size: 13.5px; }
dl.cred dd { margin: 0; font-weight: 700; }
dl.cred dd.pw { font-family: ui-monospace, Menlo, monospace; font-size: 17px; letter-spacing: .06em; }
.inline-add input[type=tel] { max-width: 170px; }

/* ── Dialog, toast ── */
dialog { border: 0; border-radius: 16px; padding: 24px; width: min(480px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(19, 32, 58, .3); }
dialog::backdrop { background: rgba(19, 32, 58, .5); }
dialog h3 { font-size: 19px; font-weight: 800; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; word-break: break-all; }
.dlg-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(16px); opacity: 0; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; transition: .2s; pointer-events: none; z-index: 60; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(19, 32, 58, .3); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── Shared small pieces ── */
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0 16px; }
.notice.ok { background: var(--leaf-soft); color: var(--leaf); }
.linkbtn.danger { color: var(--danger); }
.push-left { margin-right: auto; }
.avatar.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 12.5px; }

/* ── Staff logins (owner settings) ── */
.staff-list { display: grid; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.staff-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 12px; }
.staff-row + .staff-row { border-top: 1px solid var(--line-2); }
.staff-row.off { opacity: .6; }
.staff-main { display: grid; min-width: 0; }
.inline-add { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-add input { flex: 1 1 150px; }

/* ── Sales pipeline (in the ink band) ── */
.pipeline { max-width: 1240px; margin: 4px auto 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 0; align-items: end; }
.stage { padding: 0 18px 0 0; position: relative; }
.stage + .stage { padding-left: 18px; border-left: 1px solid var(--ink-2); }
.stage-n { font-size: 34px; font-weight: 800; color: #fff; line-height: 1.1; }
.stage-l { font-size: 13.5px; color: var(--ink-muted); }
.stage-bar { height: 8px; border-radius: 999px; background: var(--ink-2); margin-top: 10px; overflow: hidden; }
.stage-bar span { display: block; height: 100%; border-radius: inherit; background: #6f84b8; min-width: 8px; }
.s-demo .stage-bar span { background: var(--marigold); }
.s-signed .stage-bar span { background: #3ecf8e; }
.stage-out { font-size: 13px; color: var(--ink-muted); padding-left: 18px; white-space: nowrap; align-self: end; padding-bottom: 0; }

/* ── Shops list ── */
.seg { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg-btn { padding: 6px 14px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg-btn[aria-current=page] { background: var(--ink); color: #fff; }
.shops-pane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.shops-pane .leads-tools input { max-width: 420px; }
.lead.shop { grid-template-columns: 42px minmax(0, 1fr) auto; padding: 14px 18px; }
.lead .note { font-size: 13px; color: var(--text); opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.lead-meta .when.due { color: var(--marigold-deep); font-weight: 700; }

/* ── Shop editor ── */
dialog.sheet { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h3 { margin: 0; }
.sheet-links { display: flex; gap: 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text); }
.choice[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice:disabled { opacity: .4; cursor: not-allowed; }
.follow { display: grid; gap: 8px; }
.follow input { max-width: 220px; }

/* ── Team (admin) ── */
.thead.mgrid, .trow.mgrid { grid-template-columns: minmax(200px, 2fr) repeat(4, minmax(110px, 1fr)) 150px; }
.ready { margin-bottom: 16px; border-left: 4px solid var(--marigold); }
.ready-row, .wait-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); }
.wait-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.waiting { margin-bottom: 16px; }

@media (max-width: 1080px) {
  .thead.mgrid { display: none; }
  .trow.mgrid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stage { padding-right: 10px; }
  .stage + .stage { padding-left: 10px; }
  .stage-n { font-size: 26px; }
  .stage-l { font-size: 12px; }
  .stage-out { grid-column: 1 / -1; padding: 10px 0 0; }
  .grid3 { grid-template-columns: 1fr; }
  .trow.mgrid { grid-template-columns: 1fr 1fr; }
  .trow.mgrid .biz, .trow.mgrid .acts { grid-column: 1 / -1; }
  .lead.shop { padding: 13px 14px; }
  .ready-row { grid-template-columns: 1fr auto; }
  .ready-row > :nth-child(3) { grid-column: 1; }
  .sheet-head { flex-wrap: wrap; }
  .staff-row { grid-template-columns: 34px minmax(0, 1fr); }
  .staff-row .btn { grid-column: span 1; }
}

/* ── Tablet and phone ── */
@media (max-width: 1080px) {
  .thead { display: none; }
  .trow { grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  .trow .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .settings { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .band { padding: 0 16px 16px; }
  .band-top { height: 56px; gap: 10px; }
  .brand span:last-child { display: none; }
  .tabs { margin-left: 0; }
  .who { display: none; }
  .band-main { flex-direction: column; align-items: flex-start; gap: 12px; }
  .strip .plot { height: 46px; }
  .figures-inner { grid-template-columns: 1fr 1fr; gap: 14px; }
  .fig-v { font-size: 22px; }
  .page { padding: 14px 12px 32px; }
  .workspace { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .leads-pane { border-right: 0; }
  .leads-list { overflow: visible; }
  .workspace.chat-open .leads-pane { display: none; }
  .workspace:not(.chat-open) .chat-pane { display: none; }
  .workspace.chat-open { position: fixed; inset: 0; z-index: 40; border-radius: 0; border: 0; height: 100dvh; }
  .back-btn { display: inline-flex; }
  .hide-sm { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .svc-head { display: none; }
  .svc-row { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
  .svc-row input:first-child { grid-column: 1 / -1; }
  .trow { grid-template-columns: 1fr; }
  .toolbar input { max-width: none; }
  .login { grid-template-columns: 1fr; }
  .login-story { padding: 20px 20px 22px; }
  .login-story .story p, .story-strip, .legend { display: none; }
  .story h2 { font-size: 26px; margin-bottom: 0; }
  .story { margin: 28px 0 0; }
  .login-form { padding: 28px 20px 40px; }
}
