/* Design system: warm paper, ink, keycaps, one ultramarine signal color.
   Everything is plain CSS; no build step. */

@font-face { font-family: 'Bricolage'; src: url('fonts/bricolage-grotesque.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Instrument'; src: url('fonts/instrument-sans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'JBMono'; src: url('fonts/jetbrains-mono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --paper: #f3f0e8;
  --surface: #fffdf8;
  --surface-2: #f8f5ee;
  --ink: #1a1914;
  --ink-2: #48453d;
  --muted: #7a766c;
  --line: #e4dfd3;
  --line-strong: #cdc6b6;
  --accent: #2a34d4;
  --accent-ink: #ffffff;
  --accent-soft: rgba(42, 52, 212, .09);
  --live: #18925a;
  --warn: #b86e00;
  --bad: #c2321e;
  --live-soft: rgba(24, 146, 90, .12);
  --warn-soft: rgba(184, 110, 0, .12);
  --bad-soft: rgba(194, 50, 30, .10);
  --panel: #1a1914;
  --panel-ink: #f3f0e8;
  --shadow: 0 1px 0 rgba(26, 25, 20, .04), 0 8px 24px -16px rgba(26, 25, 20, .18);
  --r: 16px;
  --r-sm: 10px;
  --display: 'Bricolage', ui-sans-serif, system-ui, sans-serif;
  --body: 'Instrument', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JBMono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12110f;
    --surface: #1b1a17;
    --surface-2: #22201c;
    --ink: #efebe1;
    --ink-2: #cdc8bc;
    --muted: #938e82;
    --line: #2e2c27;
    --line-strong: #3f3c35;
    --accent: #8f97ff;
    --accent-ink: #0d0f2e;
    --accent-soft: rgba(143, 151, 255, .13);
    --live: #4fcf8f;
    --warn: #eba640;
    --bad: #ff7b67;
    --live-soft: rgba(79, 207, 143, .13);
    --warn-soft: rgba(235, 166, 64, .14);
    --bad-soft: rgba(255, 123, 103, .13);
    --panel: #0b0b09;
    --panel-ink: #efebe1;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 30px -18px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15.5px/1.55 var(--body); font-feature-settings: 'ss01';
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 650; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(26px, 3.4vw, 34px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; letter-spacing: -.01em; }
p { margin: 0; }
.mono, code { font-family: var(--mono); font-feature-settings: 'zero'; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 700 19px/1 var(--display); letter-spacing: -.03em; }
.brand .cap { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
.brand-tag { font: 600 11px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 8px; }

/* ---------- keycap: the signature element ---------- */
.cap {
  --face: var(--surface);
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--face); color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 -3px 0 var(--line), 0 1px 0 rgba(0, 0, 0, .05);
  font: 500 19px/1 var(--mono);
}
.cap.lit { --face: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22); }
.cap.ghost { background: transparent; box-shadow: none; border-style: dashed; color: var(--muted); }
.cap.sm { width: 30px; height: 30px; font-size: 14px; border-radius: 8px; box-shadow: inset 0 -2px 0 var(--line); }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, calc((100vw - 1080px) / 2));
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-weight: 600; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 120px; }
.stack > * + * { margin-top: 16px; }
.grid-2 > .card + .card { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }

.subnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 18px 0 6px; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14.5px; padding: 7px 12px; border-radius: 999px; }
.subnav a:hover { background: var(--surface); }
.subnav a.on { background: var(--ink); color: var(--paper); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 40px 0 14px; flex-wrap: wrap; }
.section-head p { color: var(--muted); max-width: 60ch; margin-top: 4px; }
.eyebrow { font: 600 12px/1 var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: block; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2 + p, .card h3 + p { color: var(--muted); margin-top: 4px; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ---------- controls ---------- */
label, .label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; color: var(--ink); }
label .muted, .label .muted { font-weight: 400; }
.hint { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237a766c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
input.mono, textarea.mono { font-family: var(--mono); font-size: 14.5px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0 14px; }
.fields > div > label { margin-top: 14px; }

.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--body); padding: 12px 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--ink); color: var(--paper); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:hover, button:hover { text-decoration: none; box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .6); }
.btn:active, button:active { transform: translateY(1px); }
.btn.accent, button.accent { background: var(--accent); color: var(--accent-ink); }
.btn.quiet, button.quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.quiet:hover, button.quiet:hover { background: var(--surface); box-shadow: none; }
.btn.danger, button.danger { background: var(--bad); color: #fff; }
.btn.sm, button.sm { padding: 8px 12px; font-size: 14px; }
.btn svg, button svg { width: 17px; height: 17px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }

/* segmented choice built from radio buttons */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.seg label { margin: 0; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 1px var(--line); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg input:disabled + span { opacity: .45; cursor: not-allowed; }
.seg svg { width: 15px; height: 15px; }

/* switch-style checkbox rows */
.toggle { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; margin: 12px 0 0; cursor: pointer; }
.toggle input { appearance: none; flex: none; width: 36px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; margin: 1px 0 0; cursor: pointer; transition: background .15s; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(14px); }
.toggle b { display: block; font-weight: 600; }
.toggle small { display: block; color: var(--muted); font-size: 13.5px; }

.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin: 8px 0 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; font-weight: 400; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { accent-color: var(--accent); margin-top: 4px; }
.radio-card b { display: block; }
.radio-card small { color: var(--muted); font-size: 13.5px; }

/* ---------- messages ---------- */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 0 0 16px; font-weight: 500; }
.note svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.note.ok { background: var(--live-soft); color: var(--live); }
.note.err { background: var(--bad-soft); color: var(--bad); }
.note.info { background: var(--accent-soft); color: var(--accent); }
.note ul { margin: 4px 0 0; padding-left: 18px; }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font: 600 13px/1 var(--body); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.live { background: var(--live-soft); border-color: transparent; color: var(--live); }
.pill.live .dot { background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 2.4s infinite; }
.pill.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.pill.warn .dot { background: var(--warn); }
.pill.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.pill.bad .dot { background: var(--bad); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pill.live .dot { animation: none; } * { transition: none !important; } }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { background: var(--panel); color: var(--panel-ink); padding: 40px clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; position: relative; overflow: hidden; }
.auth-art .brand { color: var(--panel-ink); }
.auth-art .brand .cap { --face: #26241f; color: var(--panel-ink); border-color: #3a372f; box-shadow: inset 0 -2px 0 #0d0c0a; }
.auth-art h1 { font-size: clamp(30px, 4.2vw, 52px); font-weight: 600; letter-spacing: -.035em; max-width: 13ch; }
.auth-art p { color: #a9a496; max-width: 38ch; margin-top: 14px; font-size: 16.5px; }
.keypad { display: grid; grid-template-columns: repeat(3, 64px); gap: 12px; }
.keypad .cap { width: 64px; height: 64px; border-radius: 16px; font-size: 24px; --face: #22201c; color: #8e897d; border-color: #34312b; box-shadow: inset 0 -4px 0 #0f0e0c; }
.keypad .cap.lit { --face: #2a34d4; color: #fff; border-color: #3d47e6; box-shadow: inset 0 -4px 0 #1b2394, 0 0 40px -6px rgba(80, 90, 255, .65); }
.keypad .cap small { display: block; font: 600 8.5px/1 var(--body); letter-spacing: .14em; margin-top: 3px; opacity: .6; }
.auth-form { display: grid; place-items: center; padding: 40px 16px; }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form h2 { font-size: 28px; }
.auth-form .box > p { color: var(--muted); margin-top: 6px; }
.auth-form button { width: 100%; margin-top: 22px; padding: 14px; }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 20px; gap: 24px; }
  .auth-art .keypad { display: none; }
  .auth-art h1 { font-size: 30px; }
}

/* ---------- business: the line ---------- */
.line-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding: 28px; border-radius: 22px; background: var(--panel); color: var(--panel-ink); position: relative; overflow: hidden; background: radial-gradient(110% 160% at 100% 0%, rgba(90, 100, 255, .30), transparent 52%), var(--panel); border: 1px solid #2c2a25; }
@media (prefers-color-scheme: dark) { .line-hero { background: radial-gradient(110% 160% at 100% 0%, rgba(143, 151, 255, .20), transparent 52%), #191816; border-color: var(--line-strong); } }
.line-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .06); box-shadow: 0 0 0 40px rgba(255, 255, 255, .025), 0 0 0 80px rgba(255, 255, 255, .02); pointer-events: none; }
.line-hero .eyebrow { color: #9d988b; }
.line-hero .number { font: 500 clamp(28px, 5vw, 46px)/1.05 var(--mono); letter-spacing: -.04em; }
.line-hero .number + .number { margin-top: 6px; font-size: clamp(20px, 3vw, 26px); color: #b9b4a7; }
.line-hero .pill { margin-top: 16px; }
.line-hero .pill.live { background: rgba(79, 207, 143, .14); color: #6fe0a6; }
.line-hero .pill.live .dot { background: #4fcf8f; }
.stats { display: flex; gap: 28px; position: relative; z-index: 1; }
.stat b { display: block; font: 600 30px/1 var(--display); letter-spacing: -.03em; }
.stat span { color: #9d988b; font-size: 13px; }
@media (max-width: 720px) { .line-hero { grid-template-columns: 1fr; padding: 22px; } .stats { gap: 22px; } }

/* ---------- business: call flow as a route ---------- */
.route { position: relative; padding-left: 58px; }
.route::before { content: ''; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: repeating-linear-gradient(to bottom, var(--line-strong) 0 6px, transparent 6px 11px); }
.stop { position: relative; }
.stop + .stop { margin-top: 18px; }
.stop > .node { position: absolute; left: -58px; top: 14px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--line-strong); color: var(--ink-2); z-index: 1; }
.stop > .node svg { width: 19px; height: 19px; }
.stop > .node.start { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.stop-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stop-title .step { font: 600 12px/1 var(--mono); color: var(--muted); letter-spacing: .02em; }
.caller-line { padding: 22px 0 6px; font-weight: 600; color: var(--ink-2); }
.caller-line .mono { color: var(--ink); }
@media (max-width: 560px) { .route { padding-left: 0; } .route::before, .stop > .node { display: none; } }

/* key branches inside the menu stop */
.branch { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: 14px; margin-top: 12px; }
.branch-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.branch-head input[type=text] { font-weight: 600; background: var(--surface); }
.branch.off .branch-body { display: none; }
.branch.off .cap { opacity: .55; }
.branch-body { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.phones { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 8px; }
.phones input { font-family: var(--mono); font-size: 14.5px; background: var(--surface); }
.js .phones input.extra, .js .branch.unused { display: none; }
.no-js-only { }
.js .no-js-only { display: none; }
.add-phone { margin-top: 8px; }
.ring-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.ring-row label { margin: 0; font-weight: 500; color: var(--ink-2); }
.ring-row input { width: 84px; }
.vm-only { color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.vm-only svg { width: 18px; height: 18px; color: var(--muted); }
@media (max-width: 560px) { .branch-head { grid-template-columns: auto minmax(0, 1fr); } .branch-head select { grid-column: 1 / -1; } }

/* save bar */
.savebar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55); width: max-content; max-width: calc(100vw - 32px); }
.savebar span { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.savebar button { background: var(--accent); color: var(--accent-ink); padding: 10px 18px; }
.savebar.clean span::before { content: '✓ '; color: #6fe0a6; }
.savebar.dirty span::before { content: '● '; color: #ffc25c; }

audio { width: 100%; height: 38px; margin-top: 10px; }

/* ---------- activity ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.feed .ico svg { width: 17px; height: 17px; }
.feed .ico.ok { background: var(--live-soft); color: var(--live); }
.feed .ico.vm { background: var(--accent-soft); color: var(--accent); }
.feed .ico.miss { background: var(--warn-soft); color: var(--warn); }
.feed b { font-family: var(--mono); font-weight: 500; font-size: 14.5px; }
.feed .meta { color: var(--muted); font-size: 13.5px; }
.feed time { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }
.vm { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface-2); }
.vm + .vm { margin-top: 10px; }
.vm-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.vm-head b { font-family: var(--mono); font-weight: 500; }
.vm blockquote { margin: 10px 0 0; padding: 0 0 0 12px; border-left: 3px solid var(--accent); font-size: 15px; color: var(--ink); }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty svg { width: 28px; height: 28px; display: block; margin: 0 auto 8px; opacity: .6; }

/* ---------- operator shell ---------- */
.op { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--surface-2); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.side nav a svg { width: 18px; height: 18px; color: var(--muted); }
.side nav a:hover { background: var(--surface); }
.side nav a.on { background: var(--ink); color: var(--paper); }
.side nav a.on svg { color: var(--paper); }
.side .me { margin-top: auto; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.side .me form { margin-top: 8px; }
.op-main { padding: 28px clamp(16px, 4vw, 48px) 80px; max-width: 1060px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 62ch; }
@media (max-width: 860px) {
  .op { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .side .brand-tag, .side .me span { display: none; }
  .side nav { flex-direction: row; }
  .side nav a { padding: 8px 10px; }
  .side nav a span { display: none; }
  .side .me { margin: 0 0 0 auto; }
  .side .me form { margin: 0; }
}

/* signal path: provider -> this server -> phone engine -> app */
.path { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 6px; }
.hop { position: relative; text-align: center; padding: 0 6px; }
.hop::before { content: ''; position: absolute; top: 21px; left: -50%; width: 100%; height: 2px; background: var(--line-strong); z-index: 0; }
.hop:first-child::before { display: none; }
.hop[data-link=good]::before { background: var(--live); }
.hop[data-link=warn]::before { background: repeating-linear-gradient(to right, var(--warn) 0 6px, transparent 6px 10px); }
.hop[data-link=bad]::before { background: repeating-linear-gradient(to right, var(--bad) 0 6px, transparent 6px 10px); }
.hop[data-link=idle]::before { background: repeating-linear-gradient(to right, var(--line-strong) 0 6px, transparent 6px 10px); }
.hop .ring { position: relative; z-index: 1; width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-strong); color: var(--muted); }
.hop .ring svg { width: 19px; height: 19px; }
.hop.good .ring { border-color: var(--live); color: var(--live); }
.hop.warn .ring { border-color: var(--warn); color: var(--warn); }
.hop.bad .ring { border-color: var(--bad); color: var(--bad); }
.hop b { display: block; margin-top: 10px; font-size: 14px; }
.hop span { display: block; color: var(--muted); font-size: 12.5px; }
@media (max-width: 560px) { .hop b { font-size: 12.5px; } .hop span { font-size: 11.5px; } }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; font-size: 14.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.checklist { list-style: none; margin: 0; padding: 0; counter-reset: c; }
.checklist li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--line-strong); color: var(--muted); font: 600 12px/1 var(--mono); }
.checklist .yes .tick { border: 0; background: var(--live); color: #fff; }
.checklist .tick svg { width: 16px; height: 16px; }
.checklist .yes b { color: var(--ink-2); }
.checklist small { display: block; color: var(--muted); font-size: 13.5px; }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; background: var(--live); border-radius: inherit; }

.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table a { font-weight: 600; color: var(--ink); text-decoration: none; }
.table a:hover { color: var(--accent); }
.table-wrap { overflow-x: auto; }
.table td.mono, .table td.nowrap { white-space: nowrap; }
@media (max-width: 560px) { .table .hide-sm { display: none; } }
.biz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.biz { display: block; color: inherit; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.biz:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.biz h3 { font-size: 17px; }
.biz .mono { display: block; margin-top: 10px; font-size: 16px; }
.biz .foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

.copybox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copybox code { font-size: 18px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.preview-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-strong); font-size: 14px; color: var(--ink-2); }
.preview-line b { font-family: var(--mono); font-weight: 500; color: var(--ink); font-size: 15px; }
details > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 14px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '+ '; }
details[open] > summary::before { content: '− '; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }

/* ---- operator extras ---- */
.op-banner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 9px 16px; background: var(--accent); color: var(--accent-ink); font-size: 14px; }
.op-banner svg { width: 17px; height: 17px; }
.op-banner a { color: inherit; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.op-banner a svg { width: 15px; height: 15px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; text-decoration: none; margin-bottom: 10px; }
.crumb:hover { color: var(--ink); }
.crumb svg { width: 16px; height: 16px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.tile b { display: block; font: 600 30px/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
@media (max-width: 720px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.numbers { list-style: none; margin: 12px 0 0; padding: 0; }
.numbers li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.numbers li:last-child { border-bottom: 0; }
.numbers .mono { font-size: 18px; }
.inline-add { display: flex; gap: 8px; margin-top: 14px; }
.inline-add input { flex: 1; min-width: 0; }
.accent-text { color: var(--accent); font-weight: 600; }
.biz .card-head { align-items: center; }
.biz .card-head h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz .owner { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.biz .owner svg { width: 15px; height: 15px; }
.biz .owner.own { color: var(--accent); font-weight: 600; }
.testbox { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 20px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--accent-soft); border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent); }
.testbox-text b { display: block; }
.testbox-text span { color: var(--muted); font-size: 13px; }
.testbox .inline-add { flex: 1 1 320px; max-width: 460px; }

/* ---------- reports ---------- */
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.seg.range a { text-decoration: none; display: block; }
.seg.range a.on span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 1px var(--line); }
.seg.range a:focus-visible { outline: none; }
.seg.range a:focus-visible span { outline: 2px solid var(--accent); outline-offset: 1px; }
.tiles.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tiles.six .tile b { font-size: 26px; }
@media (max-width: 1080px) { .tiles.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiles.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.report-grid { gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .report-grid { grid-template-columns: minmax(0, 1fr); } }
.phone-name b { white-space: nowrap; }
.report-grid .table th, .report-grid .table td { padding-left: 8px; padding-right: 8px; }
.phone-name .num { white-space: nowrap; }
tr.more-row[hidden] { display: none; }
.list-more { display: flex; justify-content: center; margin-top: 12px; }
.report-grid > .card + .card { margin-top: 0; }
.chart { margin: 14px 0 0; }
.chart-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; row-gap: 6px; }
.chart-y { height: 168px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1; margin-top: -5px; margin-bottom: -5px; }
.chart-bars { height: 168px; display: flex; align-items: stretch; gap: 2px; border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(to bottom, var(--line) 1px, transparent 1px) 0 0 / 100% 50%; }
.chart-bars .col { flex: 1 1 0; min-width: 0; position: relative; display: flex; align-items: flex-end; justify-content: center; border-radius: 4px 4px 0 0; outline: none; }
.chart-bars .col i { display: block; width: 100%; max-width: 30px; background: var(--accent); border-radius: 4px 4px 0 0; }
.chart-bars .col:hover, .chart-bars .col:focus-visible { background: var(--accent-soft); }
.chart-bars .col:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.chart-bars .col::after { content: attr(data-tip); position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%); z-index: 5;
  white-space: pre; padding: 7px 10px; border-radius: 8px; background: var(--panel); color: var(--panel-ink); font-size: 12.5px; line-height: 1.45;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .35); pointer-events: none; opacity: 0; transition: opacity .1s; }
.chart-bars .col.edge-l::after { left: 0; transform: translate(0, -100%); }
.chart-bars .col.edge-r::after { left: auto; right: 0; transform: translate(0, -100%); }
.chart-bars .col:hover::after, .chart-bars .col:focus-visible::after { opacity: 1; }
.chart-x { display: flex; gap: 2px; font-size: 11.5px; color: var(--muted); }
.chart-x span { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; overflow: visible; display: flex; justify-content: center; }
.chart-table { margin-top: 12px; font-size: 14px; }
.chart-table .table { margin-top: 8px; font-size: 13.5px; }
.chart-table .table td { padding: 7px 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 4px 0 14px; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.filters > div { flex: 1 1 160px; max-width: 240px; }
.filters label { margin: 0 0 4px; font-size: 13px; }
.filters select { padding-top: 8px; padding-bottom: 8px; }
.filters .filter-actions { flex: 0 0 auto; display: flex; gap: 8px; }
.result { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.result::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.result.answered::before { background: var(--live); }
.result.voicemail::before { background: var(--accent); }
.result.missed::before { background: var(--bad); }
.result.hungup::before { background: var(--line-strong); }
[hidden] { display: none !important; }

/* ---------- phone list and pickers ---------- */
.phonebook .card-head h3 { display: flex; align-items: center; gap: 8px; }
.contacts { display: grid; gap: 8px; margin: 8px 0 12px; }
.contact { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.js .contact.extra { display: none; }
@media (max-width: 560px) { .contact { grid-template-columns: minmax(0, 1fr) auto; } .contact input[type=tel] { grid-column: 1; grid-row: 2; } .contact button { grid-row: 1 / span 2; grid-column: 2; } .contact + .contact { padding-top: 8px; border-top: 1px solid var(--line); } }
.picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.picker .hint { margin: 0; }
.chip { position: relative; margin: 0; font-weight: 400; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px 7px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background .12s, border-color .12s; }
.chip span::before { content: ''; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line-strong); box-sizing: border-box; background: var(--surface); }
.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.chip input:checked + span::before { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip input:disabled + span { opacity: .45; cursor: not-allowed; }
.mode-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; margin-top: 12px; }
.mode-pick .radio-card { margin: 0; }
