:root {
  --navy: #0a1a2e;
  --navy-2: #13294a;
  --red: #be1828;
  --blue: #1b5fa8;
  --blue-soft: #e8f0fa;
  --bg: #f4f6f9;
  --card: #ffffff;
  --card-2: #f6f8fb;
  --chip: #e5e7eb;
  --line: #dde2ea;
  --line-strong: #b8c1cf;
  --ink: #111827;
  --ink-2: #334155;
  --muted: #4b5563;
  --violet: #6d28d9;
  --violet-soft: #ede9fe;
  --ok: #146c43;
  --ok-soft: #e3f4ea;
  --warn: #8a5300;
  --warn-soft: #fdf1dc;
  --bad: #b3261e;
  --bad-soft: #fbe7e5;
  --on-fill: #fff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(10, 26, 46, .06), 0 4px 14px rgba(10, 26, 46, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; }
[hidden] { display: none !important; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
a { color: var(--blue); }
small { color: var(--muted); font-weight: 400; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.fine { font-size: 13px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: #b8c1cf; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #a3121f; }
.btn.small { min-height: 44px; padding: 8px 12px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn:focus-visible, .nav:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .drop:focus-visible, .row:focus-visible, .qa-btn:focus-visible, .qa-item:focus-visible, .staff-tabs a:focus-visible { outline: 3px solid #7fb0e8; outline-offset: 2px; }
.link { color: #fff; font-size: 14px; }

/* ---- sign in ---- */
.signin, body.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 20% -10%, #1d3a64 0%, var(--navy) 55%); }
.signin-card, .card.narrow { width: 100%; max-width: 420px; background: var(--card); border-radius: 16px; padding: 36px 32px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.signin-card h1, .card.narrow h1 { font-size: 26px; margin: 14px 0 8px; }
.signin-card h1 span, .brand span { color: var(--red); }
.signin-card p { color: var(--muted); margin: 0 0 22px; }
.signin-card .stage-badge { display: inline-block; margin: 0 0 18px; }
.btn.ms { width: 100%; min-height: 46px; font-size: 15px; background: var(--card); border-color: #8c8c8c; }
.btn.ms:hover { background: var(--card-2); }
.signin-card .fine { margin: 18px 0 0; }
.card.narrow p { color: var(--muted); }
.card.narrow .btn { margin-top: 8px; }

/* ---- layout ---- */
.app { display: grid; grid-template-columns: 236px 1fr; grid-template-rows: 60px 1fr; height: 100vh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 20px; padding: 0 20px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 17px; white-space: nowrap; }
.brand span { color: #ff6b77; }
.stage-badge { background: #f2b705; color: #1a1300; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.org { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.org span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org select { background: var(--navy-2); color: #fff; border: 1px solid #39537a; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 14px; max-width: 260px; }
.user { display: flex; align-items: center; gap: 16px; font-size: 14px; color: #d6deea; white-space: nowrap; }
.user .avatar { width: 32px; height: 32px; min-width: 32px; max-width: 32px; min-height: 32px; max-height: 32px; aspect-ratio: 1; margin-right: -6px; border-radius: 50%; overflow: hidden; flex: 0 0 32px; display: grid; place-items: center;
  background: #2f4a73; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.user .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.side { padding: 18px 14px; border-right: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.send-btn { margin-bottom: 14px; min-height: 44px; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav:hover { background: var(--bg); }
.nav.on { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.count { background: var(--red); color: #fff; border-radius: 999px; font-size: 13px; font-weight: 700; padding: 1px 8px; min-width: 22px; text-align: center; }
.numbers { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.numbers b { display: block; color: var(--ink); font-size: 14px; }

.main { overflow: hidden; min-width: 0; }

/* ---- folder ---- */
.folder { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; height: 100%; }
.list-pane { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--card); min-height: 0; }
.list-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.list-head input { width: 100%; }
.list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:hover { background: var(--card-2); }
.row.on { background: var(--blue-soft); }
.row .doc { width: 40px; height: 48px; border: 1px solid var(--line); border-radius: 4px; background: var(--card) linear-gradient(#e5e9ef, #e5e9ef) 7px 10px / 22px 2px no-repeat; position: relative; }
.row .doc::after { content: ""; position: absolute; left: 7px; right: 7px; top: 16px; height: 18px; background: repeating-linear-gradient(#e5e9ef 0 2px, transparent 2px 6px); }
.row .who { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.unread .who { font-weight: 700; }
.row.unread .doc { border-color: var(--red); box-shadow: inset 3px 0 0 var(--red); }
.row .meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row > * { min-width: 0; }
.row .who, .row .meta { display: block; }
.row .when { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.chip { display: inline-block; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 1px 9px; margin-top: 4px; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.empty { padding: 28px 18px; color: var(--muted); text-align: center; }

.preview-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.preview-empty { margin: auto; text-align: center; color: var(--muted); opacity: .9; }
.preview-empty img { opacity: .35; }
.pv-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; justify-content: space-between; padding: 16px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.pv-head h2 { margin: 0 0 4px; font-size: 18px; }
.pv-facts { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--muted); }
.pv-facts b { color: var(--ink); font-weight: 600; }
.pv-note { margin: 6px 0 0; }
.pv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pv-back { display: none; }
.pv-alert { margin: 0; padding: 10px 20px; background: var(--bad-soft); color: var(--bad); border-bottom: 1px solid #f1c7c3; }
.pv-flag { margin: 0; padding: 10px 20px; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid #efd9a8; font-size: 14px; }
.pv-flag span { display: block; margin-top: 2px; }
.pv-name { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.pv-name label { flex: 1 1 260px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select { min-height: 36px; padding: 6px 10px; font-size: 14px; }
.tag-filter { border: 1px solid var(--blue); background: var(--blue-soft); color: var(--blue); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.tag { display: inline-block; margin: 4px 4px 0 0; border: 1px solid var(--line); background: var(--card-2); color: var(--ink-2); border-radius: 999px; padding: 0 9px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; line-height: 20px; }
.tag:hover { border-color: var(--blue); color: var(--blue); }
.assignee { display: inline-block; margin: 4px 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pv-work, .pv-fwd { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 10px 14px; padding: 12px 20px; background: var(--card-2); border-bottom: 1px solid var(--line); }
.pv-work label, .pv-fwd label { font-size: 13px; }
.pv-work .wide, .pv-fwd .wide, .pv-fwd fieldset, .pv-fwd .fwd-fax, .pv-fwd .fwd-email { grid-column: 1 / -1; }
.pv-work input, .pv-work select, .pv-work textarea, .pv-fwd input, .pv-fwd textarea { min-height: 36px; padding: 6px 10px; font-size: 14px; }
.pv-fwd { background: var(--card-2); }
.pv-fwd fieldset { border: 0; margin: 0; padding: 0; display: flex; gap: 18px; align-items: center; }
.pv-fwd legend { font-weight: 700; font-size: 14px; margin-right: 12px; float: left; }
.pv-fwd .fwd-fax { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.work-actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; }
.pv-doc { flex: 1; border: 0; width: 100%; background: #525659; }
.pv-msg { margin: auto; padding: 24px; text-align: center; color: var(--muted); max-width: 420px; }

/* ---- forms ---- */
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 12px; min-height: 42px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
label.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--red); }

.send, .activity { height: 100%; overflow-y: auto; padding: 28px 24px 48px; }
.send-layout { display: grid; grid-template-columns: minmax(0, 640px) minmax(280px, 420px); gap: 24px; justify-content: center; align-items: start; }
.send .card, .page .card { max-width: 720px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.drop { border: 2px dashed #b8c1cf; border-radius: 12px; padding: 26px 16px; text-align: center; color: var(--muted); cursor: pointer; background: var(--card-2); }
.drop p { margin: 6px 0 0; }
.drop b { color: var(--ink); }
.drop.over { border-color: var(--blue); background: var(--blue-soft); }
.files { list-style: none; margin: -6px 0 0; padding: 0; display: grid; gap: 8px; }
.files li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.files li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li small { white-space: nowrap; }
.files button { border: 0; background: none; color: var(--bad); font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 6px; }
#coverFields { display: grid; gap: 16px; }
.error { margin: 0; padding: 10px 14px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-weight: 500; }
.actions { display: flex; gap: 10px; }

/* ---- nav groups ---- */
.nav-group { display: grid; gap: 2px; margin-bottom: 10px; }
.nav-head { margin: 6px 12px 4px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---- phone pages ---- */
.page { height: 100%; overflow-y: auto; padding: 28px 24px 48px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.page-head .sub { margin: 4px 0 0; }
.page-head input { width: 260px; max-width: 100%; }
.calls td { vertical-align: middle; }
.call-who { display: flex; align-items: center; gap: 10px; }
.call-who b { display: block; font-weight: 600; }
.call-who small { display: block; }
.dir { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--blue-soft); color: var(--blue); }
.dir.missed { background: var(--bad-soft); color: var(--bad); }
.dir.out { background: var(--ok-soft); color: var(--ok); }
.more { text-align: center; margin: 16px 0 0; }
.vm-list, .team { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.vm { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 10px; }
.vm.new { border-left: 4px solid var(--red); }
.vm-top { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; }
.vm-top b { font-size: 16px; }
.vm-top .fine { margin: 0; }
.vm-text { margin: 0; color: var(--ink); background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.team { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.member { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 6px; }
.member-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.member b { font-size: 16px; }
.dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #9aa5b4; }
.dot.on { color: var(--ok); }
.dot.on::before { background: #1f9d55; }
.member .fine { margin: 0; }
.empty-card { background: var(--card); border: 1px dashed #b8c1cf; border-radius: 12px; padding: 24px; color: var(--muted); text-align: center; }
.cmp-empty { margin: 0 0 16px; } .cmp-empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; } .cmp-empty p { margin: 0 auto; max-width: 52ch; }

/* ---- cover options ---- */
.flags { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.flags legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.flags label { display: flex; align-items: center; gap: 7px; font-weight: 500; font-size: 14px; }
.flags input { width: 17px; height: 17px; min-height: 0; accent-color: var(--red); }
.cover-preview { position: sticky; top: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; height: min(78vh, 640px); }
.cp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.cp-head .fine { margin: 0; }
.cover-preview iframe { flex: 1; border: 0; width: 100%; background: #525659; }
.cover-sheet-btn, #coverPreviewPane .cover-sheet-close { display: none; }
.page .card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.logo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-box { width: 220px; height: 80px; border: 1px dashed #b8c1cf; border-radius: 10px; display: grid; place-items: center; background: #fff; padding: 8px; color: #334155; }
.logo-box .fine { color: #334155; }
.logo-box img { max-width: 100%; max-height: 100%; }
.logo-actions { flex: 1 1 240px; display: grid; gap: 8px; justify-items: start; }
.logo-actions .fine { margin: 0; }

/* ---- settings tabs, admin ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { padding: 9px 14px; border-radius: 8px 8px 0 0; color: var(--ink); text-decoration: none; font-weight: 500; border: 1px solid transparent; margin-bottom: -1px; }
.tab.on { border-color: var(--line); border-bottom-color: var(--bg); background: var(--bg); color: var(--blue); font-weight: 600; }
.narrow-card { max-width: 720px; }
.card h2 { font-size: 16px; margin: 6px 0 -4px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form label { flex: 1 1 200px; }
.role-pick { min-height: 34px; padding: 4px 8px; font-size: 13px; }
.linkish { border: 0; background: none; color: var(--bad); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }
.more-opts { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.more-opts summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.more-opts[open] { display: grid; gap: 14px; }
.usage-pick { display: flex; gap: 8px; align-items: center; }
.usage-pick input { min-height: 36px; padding: 5px 10px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-top: 20px; align-items: start; }
.client-link { border: 0; background: none; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-align: left; }
.muted-row td { color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.pv-banner { margin: 0; padding: 10px 20px; background: var(--blue-soft); color: var(--ink); border-bottom: 1px solid var(--line); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }

/* ---- recipients, address book ---- */
.to-wrap { position: relative; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; list-style: none; margin: 4px 0 0; padding: 4px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; }
.suggest li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-weight: 500; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; }
.suggest li small { color: var(--muted); }
.suggest li.on, .suggest li:hover { background: var(--blue-soft); }
.list-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.contact-name { min-height: 34px; padding: 4px 8px; font-size: 14px; width: 100%; max-width: 320px; }
.row-actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; }

/* ---- OneDrive / SharePoint picker ---- */
.cloud-box { width: min(640px, 100%); height: min(80vh, 680px); }
.cloud-tabs { display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid var(--line); }
.cloud-tabs .tab { border: 1px solid transparent; background: none; font: inherit; cursor: pointer; }
.cloud-search { padding: 10px 16px 0; }
.cloud-search input { width: 100%; }
.cloud-list { list-style: none; margin: 0; padding: 8px 16px; overflow-y: auto; flex: 1; }
.cloud-list li { border-bottom: 1px solid var(--line); }
.cloud-list button { width: 100%; text-align: left; border: 0; background: none; padding: 10px 6px; font: inherit; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; color: var(--ink); }
.cloud-list button:hover { background: var(--bg); }
.cloud-list small { color: var(--muted); }
.cloud-list .up button { color: var(--blue); font-weight: 600; }
.cloud-list .note { padding: 14px 6px; color: var(--muted); border: 0; }
.cloud-save { display: flex; gap: 10px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }
.cloud-save label { flex: 1; }
#cloudError { margin: 0 16px 12px; }
.files li.converting span::after { content: " (converting to PDF…)"; color: var(--muted); }

.header-sample { font-family: Helvetica, Arial, sans-serif; font-size: 13px; background: var(--card); border: 1px solid var(--line); padding: 2px 6px; display: inline-block; margin-top: 4px; color: var(--ink); }
.attach-more { margin: -8px 0 0; }
.cloud-list .file-row button span::before { content: "📄 "; }

/* ---- sign and send back ---- */
.sign-box { width: min(1100px, 100%); height: 94vh; }
.sign-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.sign-tools .link-like { border-color: transparent; color: var(--blue); margin-left: auto; }
.sign-pages { flex: 1; overflow: auto; background: #525659; padding: 20px; display: grid; gap: 20px; justify-content: center; }
.sign-pages.placing .sign-page { cursor: crosshair; }
.sign-page { position: relative; background: var(--card); box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.sign-page canvas { display: block; width: 100%; height: 100%; }
.sign-item { position: absolute; cursor: move; outline: 1px dashed #1b5fa8; outline-offset: 2px; touch-action: none; }
.sign-item img { width: 100%; height: 100%; display: block; pointer-events: none; }
.sign-text .txt { display: inline-block; min-width: 20px; padding: 0 2px; color: #000; font-family: Helvetica, Arial, sans-serif; line-height: 1.15; cursor: text; outline: none; white-space: pre; }
.sign-check, .sign-cross { width: 26px; height: 26px; font-size: 24px; line-height: 26px; text-align: center; color: #000; font-weight: 700; }
.sign-x { position: absolute; top: -12px; right: -12px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--bad); color: var(--on-fill); font-size: 14px; line-height: 22px; cursor: pointer; padding: 0; }
.sign-loading { color: #fff; }
.sigpad { z-index: 30; }
.sigpad-box { width: min(620px, 100%); height: auto; padding-bottom: 16px; }
.sigpad-box canvas { margin: 16px auto 0; display: block; width: min(560px, calc(100% - 32px)); border: 1px solid var(--line-strong); border-radius: 8px; touch-action: none; background: var(--card); }
.sigpad-row { padding: 12px 20px 0; }

.hit { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.hit mark { background: var(--warn-soft); color: var(--ink); padding: 0 1px; border-radius: 2px; }
.index-note { margin: 0; }

.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rule-list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.rule-list li.off { opacity: .6; }
.rule-list b { display: block; }
.rule-list small { color: var(--muted); }
#ruleForm { margin-top: 16px; }

.line-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.line-list li { display: grid; grid-template-columns: 150px 1fr 1.5fr auto; gap: 10px; align-items: end; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.line-list .num { font-weight: 600; padding-bottom: 10px; }
.line-list input { min-height: 36px; padding: 6px 10px; font-size: 14px; }
@media (max-width: 900px) { .line-list li { grid-template-columns: 1fr; } }

/* ---- activity ---- */
.activity h1 { margin-bottom: 4px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--card-2); }
td.nowrap { white-space: nowrap; }

.link-btn { margin-left: auto; border-color: transparent; }
.modal { position: fixed; inset: 0; background: rgba(10, 26, 46, .6); display: grid; place-items: center; padding: 24px; z-index: 20; }
.modal-box { width: min(980px, 100%); height: min(92vh, 1100px); background: var(--card); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.modal-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-head .fine { margin: 2px 0 0; }
.modal-doc { flex: 1; border: 0; width: 100%; background: #525659; }
@media (max-width: 1180px) {
  .send-layout { grid-template-columns: 1fr; }
  .cover-preview { position: static; height: 560px; max-width: 640px; width: 100%; margin: 0 auto; }
}

@media (max-width: 900px) { .modal { padding: 0; } .modal-box { height: 100vh; border-radius: 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); font-weight: 500; z-index: 10; max-width: calc(100% - 32px); }

/* ---- small screens ---- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; height: auto; min-height: 100vh; }
  .top { flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; }
  .org { order: 3; flex-basis: 100%; }
  .user { margin-left: auto; }
  .user #userName { display: none; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .send-btn { margin: 0 6px 0 0; min-height: 40px; }
  .numbers { display: none; }
  .main { overflow: visible; }
  .folder { display: block; height: auto; }
  .list-pane { border-right: 0; }
  .preview-pane { display: none; }
  .folder.viewing .list-pane { display: none; }
  .folder.viewing .preview-pane { display: flex; height: auto; }
  .folder.viewing .pv-doc { min-height: min(70dvh, 640px); flex: none; }
  .pv-back { display: inline-flex; }
  .send, .activity, .page { padding: 20px 16px 40px; height: auto; }
  .nav-group { display: contents; }
  .nav-head { display: none; }
  .calls th:nth-child(2), .calls td:nth-child(2) { display: none; }
  .send .card { padding: 20px 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .send-layout { grid-template-columns: 1fr; }
  .cover-preview { position: static; height: 520px; }
  #coverPreviewPane { display: none; height: auto; }
  #coverPreviewPane.sheet { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; height: min(78vh, 640px); max-width: none; margin: 0; border-radius: 16px 16px 0 0; }
  .cover-sheet-btn { display: inline-flex; margin: 0 0 12px; }
  .cover-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(15, 23, 42, .35); }
  #coverPreviewPane .cover-sheet-close { display: inline-flex; margin-left: auto; }
  .pv-work, .pv-fwd, .pv-fwd .fwd-fax { grid-template-columns: 1fr; }
}

/* Per-fax history */
.pv-hist { border-bottom: 1px solid var(--line); padding: 10px 20px; background: var(--card-2); }
.pv-hist[open] .hist-body { max-height: 320px; overflow: auto; }
.pv-hist summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.pv-hist summary small { font-weight: 400; color: var(--muted, #5b6676); margin-left: 6px; }
.hist { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.hist th { text-align: left; font-weight: 600; color: var(--muted, #5b6676); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.hist td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.hist td:first-child { white-space: nowrap; }
.hist .fine { display: block; margin-top: 2px; word-break: break-word; }
.hist-foot { margin: 10px 0 0; }
@media (max-width: 640px) { .hist td:first-child { white-space: normal; } }

/* Activity log filters */
.audit-filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 14px 0 12px; }
.audit-filters label { font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.audit-filters .grow { flex: 1 1 200px; }
.audit-filters select, .audit-filters input { min-height: 34px; }
.audit-more { margin: 12px 0 0; }

/* Usage & costs */
.usage-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.ucard { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.ucard span { font-size: 13px; color: var(--muted); }
.ucard b { font-size: 22px; }
.ucard small { font-size: 13px; color: var(--muted); }
.usage-table tfoot th, .usage-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.rates { margin: 16px 0; }
.rates summary { cursor: pointer; font-weight: 600; }
.rates summary small { font-weight: 400; color: var(--muted); }
.rates-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; margin-top: 12px; }
.rates-form label { font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.rates-form .actions, .rates-form .wide { grid-column: 1 / -1; }
fieldset.billing { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 12px; }
fieldset.billing legend { font-size: 13px; font-weight: 600; padding: 0 4px; }

/* ---- Icons, navigation and toolbars ---- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 18px; height: 18px; flex: none; }
.nav { justify-content: flex-start; gap: 12px; min-height: 40px; color: var(--ink-2); }
.nav .ic { color: var(--muted); }
.nav:hover .ic { color: var(--ink); }
.nav.on .ic { color: var(--blue); }
.nav .count { margin-left: auto; }
.nav-group { margin-bottom: 14px; }
.nav-head { margin: 4px 12px 6px; }
.send-btn { margin-bottom: 20px; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }

/* Fax view: title row, then one toolbar row of grouped buttons */
.pv-head { flex-direction: column; align-items: stretch; gap: 12px; }
.pv-actions { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 0 20px 14px; background: var(--card); border-bottom: 1px solid var(--line); margin-top: -1px; }
.pv-head + .pv-actions { padding-top: 0; }
.tgroup { display: inline-flex; }
.tgroup > .btn { border-radius: 0; margin-left: -1px; }
.tgroup > .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.tgroup > .btn:last-child { border-radius: 0 8px 8px 0; }
.tgroup > .btn:only-child { border-radius: 8px; }
.tgroup > .btn:hover { position: relative; z-index: 1; background: var(--card-2); }
.tgroup > .btn.primary:hover { background: #a3121f; }
.pv-actions .btn { gap: 6px; color: var(--ink); }
.pv-actions .btn.primary { color: #fff; }
.pv-actions .btn .ic { width: 16px; height: 16px; color: var(--muted); }
.pv-actions .btn.primary .ic { color: #fff; }

/* More menu */
.menu { position: relative; margin-left: auto; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: var(--card-2); }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: min(220px, calc(100vw - 16px)); max-width: calc(100vw - 16px); padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .14); display: grid; }
.menu-list > button, .menu-list > a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.menu-list > button:hover, .menu-list > a:hover, .menu-list > button:focus-visible, .menu-list > a:focus-visible { background: var(--card-2); }
.menu-list .ic { width: 16px; height: 16px; color: var(--muted); }

.print-frame { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }

/* Narrow fax panes: the less-used buttons (marked .slim) show only their icon, then Print and Archive too. */
.preview-pane { container-type: inline-size; }
.pv-actions .btn { position: relative; }
@container (max-width: 860px) {
  .pv-actions .btn.slim, .pv-actions .menu > summary { padding: 6px 9px; }
  .pv-actions .btn.slim span, .pv-actions .menu > summary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@container (max-width: 700px) {
  .pv-actions .btn[data-act="print"], .pv-actions .btn[data-act="archive"], .pv-actions .btn[data-act="unarchive"] { padding: 6px 9px; }
  .pv-actions .btn[data-act="print"] span, .pv-actions .btn[data-act="archive"] span, .pv-actions .btn[data-act="unarchive"] span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.usage-table td small { white-space: nowrap; }
.usage-table td:first-child small { white-space: normal; }
.usage-table .btn { white-space: nowrap; }
.card.rates { max-width: none; width: auto; margin: 16px 0; }

/* Phone columns on the usage page appear only on the VoIP site */
#admin .voice-col { display: none; }
#admin.with-phone th.voice-col, #admin.with-phone td.voice-col { display: table-cell; }
#admin.with-phone label.voice-col { display: flex; }
#admin.with-phone p.voice-col { display: block; }
.rates-sub { grid-column: 1 / -1; margin: 8px 0 0; font-weight: 700; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.usage-table th:first-child, .usage-table td:first-child { min-width: 180px; }

/* Help & support */
.help-hero { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-end; justify-content: space-between; padding: 26px 28px; margin-bottom: 18px; border-radius: 16px;
  background: linear-gradient(135deg, #0a1a2e 0%, #17325a 60%, #23477a 100%); color: #fff; }
.help-hero h1 { margin: 0 0 4px; font-size: 28px; color: #fff; }
.help-hero .sub { margin: 0; color: #d6deea; max-width: 520px; }
.help-search { flex: 1 1 320px; max-width: 460px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 10px; background: var(--card); color: var(--muted); box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.help-search input { flex: 1; border: 0; outline: 0; min-height: 48px; font-size: 15px; background: transparent; }
.help-search:focus-within { outline: 3px solid #7fb0e8; }
.quick-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
@media (max-width: 1100px) { .quick-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .quick-cards { grid-template-columns: 1fr; } }
.qcard { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: center; text-align: left; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; font: inherit; color: var(--ink); box-shadow: 0 1px 2px rgba(15,23,42,.05); transition: border-color .15s, box-shadow .15s, transform .15s; }
.qcard:hover { border-color: #b8c7dc; box-shadow: 0 6px 18px rgba(15,23,42,.08); transform: translateY(-1px); }
.qcard .qicon { grid-row: 1 / 3; }
.qcard b { font-size: 14px; }
.qcard small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.qicon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); flex: none; }
.qicon .ic { width: 20px; height: 20px; }
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 26px; align-items: start; }
.help-group { margin-bottom: 24px; }
.help-group h2 { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 0 0 10px; color: var(--ink); }
.gicon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--card-2); color: var(--muted); }
.gicon .ic { width: 16px; height: 16px; }
.guide { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; transition: box-shadow .15s; }
.guide[open] { box-shadow: 0 6px 18px rgba(15,23,42,.06); border-color: #c9d4e3; }
.guide > summary { cursor: pointer; padding: 13px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--line-strong); border-bottom: 2px solid var(--line-strong); transform: rotate(45deg); transition: transform .15s; flex: none; margin-right: 4px; }
.guide[open] > summary::after { transform: rotate(-135deg); }
.guide[open] > summary { border-bottom: 1px solid var(--line); }
.guide-body { padding: 6px 18px 14px; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.guide-body ul { padding-left: 20px; }
.guide-body li { margin: 5px 0; }
.guide-body ol { list-style: none; padding-left: 0; counter-reset: step; }
.guide-body ol > li { counter-increment: step; position: relative; padding-left: 38px; margin: 10px 0; }
.guide-body ol > li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.help-side { display: grid; gap: 14px; position: sticky; top: 16px; }
.help-side .card { padding: 18px; }
.help-side h2 { margin: 0; font-size: 16px; }
.side-head { display: flex; gap: 12px; align-items: flex-start; }
.side-head .fine { margin: 4px 0 0; }
.side-card { display: flex; gap: 12px; align-items: flex-start; }
.side-card p { margin: 4px 0 0; }
.side-link { text-decoration: none; color: var(--ink); transition: border-color .15s; }
.side-link:hover { border-color: #b8c7dc; }
.support-form { display: grid; gap: 12px; }
.support-form label { display: grid; gap: 4px; font-size: 13px; }
.support-form label.check { display: flex; align-items: flex-start; gap: 8px; }
.support-form textarea { width: 100%; }
.support-form .btn .ic { width: 16px; height: 16px; }
@media (max-width: 1000px) { .help-layout { grid-template-columns: 1fr; } .help-side { position: static; } }

/* Address book cards */
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.contact-form { margin: 0 0 18px; padding: 18px; display: grid; gap: 14px; }
.contact-form h2 { margin: 0; font-size: 17px; }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }
.cf-grid label { display: grid; gap: 4px; font-size: 13px; }
.cf-grid .wide { grid-column: 1 / -1; }
.cf-numbers { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; }
.cf-numbers legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.cf-num { display: grid; grid-template-columns: minmax(120px, 200px) minmax(150px, 220px) auto; gap: 8px; align-items: center; }
.num-chip { display: inline-block; margin: 0 8px 4px 0; white-space: nowrap; }
.num-chip small { color: var(--muted); }
.linkish.danger { color: var(--bad); margin-left: auto; }
@media (max-width: 640px) { .cf-num { grid-template-columns: 1fr; } }
.page .card.contact-form { max-width: none; margin: 0 0 18px; }

/* Secure link page for recipients */
.share-page { text-align: center; max-width: 440px; }
.share-page form { display: grid; gap: 12px; justify-items: center; margin-top: 8px; }
.share-code label { display: grid; gap: 6px; font-size: 13px; text-align: left; }
.share-code input { font-size: 24px; letter-spacing: 8px; text-align: center; width: 220px; padding: 10px; }
.share-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.share-alt { margin-top: 4px; }
.share-foot { margin-top: 18px; }

/* Printable documents (security summary) */
body.doc-page { background: var(--card-2); }
body.doc-page .doc { max-width: 820px; margin: 32px auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 40px 48px; color: var(--ink); line-height: 1.6; }
body.doc-page .doc-head { display: flex; gap: 18px; align-items: flex-start; border-bottom: 2px solid var(--red); padding-bottom: 18px; margin-bottom: 8px; }
body.doc-page .doc-kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
body.doc-page .doc h1 { margin: 2px 0 6px; font-size: 30px; }
body.doc-page .doc-lede { margin: 0; color: var(--muted); }
body.doc-page .doc h2 { font-size: 18px; margin: 26px 0 8px; color: var(--navy, #0a1a2e); }
body.doc-page .doc ul { padding-left: 20px; margin: 0; }
body.doc-page .doc li { margin: 6px 0; }
body.doc-page .doc-table { border-collapse: collapse; width: 100%; font-size: 14px; }
body.doc-page .doc-table th { text-align: left; width: 130px; padding: 8px 12px 8px 0; vertical-align: top; }
body.doc-page .doc-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
body.doc-page .doc dt { font-weight: 700; margin-top: 12px; }
body.doc-page .doc dd { margin: 4px 0 0; color: var(--ink-2); }
body.doc-page .doc-foot { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
@media (max-width: 640px) { body.doc-page .doc { margin: 0; border-radius: 0; padding: 24px 18px; } body.doc-page .doc-head { flex-direction: column; } }
@media print { body.doc-page { background: var(--card); } body.doc-page .doc { border: 0; margin: 0; padding: 0; max-width: none; } body.doc-page .doc a { color: inherit; text-decoration: none; } }

/* Recipient chips */
.to-wrap { display: grid; gap: 4px; position: relative; font-size: 14px; }
.to-label { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: text; }
.chips:focus-within { outline: 3px solid #7fb0e8; outline-offset: 1px; }
.chip-list { display: contents; }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--ink); font-size: 13px; }
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: none; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); }
.chip button:hover { background: rgba(15, 23, 42, .1); }
.chips input { flex: 1 1 140px; min-width: 120px; border: 0; outline: 0; padding: 6px 2px; font: inherit; background: transparent; }
.to-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.chips { position: relative; }
/* Address-book picker */
.pick-box { width: min(620px, 100%); height: min(80vh, 760px); }
.pick-list { list-style: none; margin: 0; padding: 6px 10px; overflow-y: auto; flex: 1; }
.pick-list li label { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.pick-list li label:hover { background: var(--card-2); }
.pick-mail { color: var(--muted); }
.pick-foot { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }
.pick-foot .fine { margin-right: auto; }
.help-side .card { margin: 0; max-width: none; width: auto; }

/* Recipient rows on Send a fax */
.recips { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 0; display: grid; gap: 8px; background: var(--card-2); }
.recips legend { font-weight: 700; padding: 0 6px; font-size: 15px; }
.recip-head, .recip-row { display: grid; grid-template-columns: minmax(0, 1fr) 138px minmax(0, 1fr) 54px 46px 40px 28px; gap: 6px; align-items: center; }
.recip-head span:nth-child(n+4) { text-align: center; font-size: 13px; line-height: 1.2; }
.r-check { display: grid; justify-items: center; }
.r-check input { width: 18px; height: 18px; }
.r-check input:disabled { opacity: .35; }
.recip-key { margin: 0; }
.recip-row input:not([type=checkbox]) { padding-left: 9px; padding-right: 9px; font-size: 14px; }
.recip-head { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 2px; }

.recip-rows { display: grid; gap: 8px; }
.recip-row input:not([type=checkbox]) { width: 100%; min-height: 40px; }
.recip-row input.bad { border-color: var(--red); background: var(--bad-soft); }
.r-save { display: grid; justify-items: center; gap: 0; font-size: 13px; color: var(--muted); }
.r-save input { width: 18px; height: 18px; }
.r-rm { border: 0; background: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px; color: var(--muted); }
.r-rm:hover { background: var(--card-2); color: var(--red); }
.recips .to-tools { margin-top: 2px; }
.recips .to-tools .btn .ic { width: 16px; height: 16px; }
.recip-tip { margin: 0; }
.recips .suggest { position: absolute; z-index: 30; }
@media (max-width: 760px) {
  .recip-head { display: none; }
  /* Phone: name and number side by side, email under them, then the three choices with their words. */
  .recip-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .recip-row .r-name, .recip-row .r-num { grid-column: span 3; }
  .recip-row .r-email { grid-column: 1 / -1; }
  .recip-row .r-check, .recip-row .r-save { grid-column: span 2; display: flex; align-items: center; justify-content: flex-start; gap: 6px; font-size: 14px; color: var(--ink); min-height: 32px; }
  .recip-row .r-rm { grid-column: 6; justify-self: end; }
  .recip-row:has(.r-rm:not([hidden])) .r-save { grid-column: span 1; }
}
.r-lbl { display: none; }
@media (max-width: 760px) { .r-lbl { display: inline; } .r-check:has(input:disabled) .r-lbl { color: var(--muted); } }

/* First-page thumbnails in the fax list */
.row .doc.has-thumb { background: var(--card); overflow: hidden; }
.row .doc.has-thumb::after { display: none; }
.row .doc img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

/* Dashboard */
.nav-home { margin-bottom: 8px; }
.dash-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.dash-head h1 { margin: 0 0 2px; font-size: 26px; }
.dash-head .sub { margin: 0; }
.dash-actions { display: flex; gap: 10px; }
.dash-actions .btn .ic { width: 16px; height: 16px; }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 20px; }
.dcard { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.dcard:hover { border-color: #b8c7dc; box-shadow: 0 6px 18px rgba(15,23,42,.07); }
.dcard-body { display: grid; gap: 1px; min-width: 0; }
.dcard-body small { color: var(--muted); font-size: 13px; }
.dcard-body b { font-size: 26px; line-height: 1.15; }
.dcard-body span { color: var(--muted); font-size: 13px; }
.dcard.hot { border-color: #f1b3b8; background: var(--bad-soft); }
.dcard.hot .qicon { background: var(--bad-soft); color: var(--bad); }
.dcard.warn .qicon { background: var(--warn-soft); color: var(--warn); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.dpanel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.dpanel h2 { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 0 0 8px; }
.dmore { margin-left: auto; font-size: 13px; font-weight: 500; }
.dlist { list-style: none; margin: 0; padding: 0; }
.dlist li a { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.dlist li:first-child a { border-top: 0; }
.dlist li a:hover { background: var(--card-2); }
.di-main { display: grid; min-width: 0; flex: 1; }
.di-main b, .di-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.di-main small { color: var(--muted); font-size: 13px; }
.di-when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.dempty { color: var(--muted); font-size: 14px; margin: 6px 0; }
.dstat { margin: 6px 0; }
.bad-text { color: var(--bad); }
/* Call quality */
.qdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.call-len, .call-q-inline { display: none; }
.qdot.good, .qfill.good { background: #16a34a; }
.qdot.fair, .qfill.fair { background: #d97706; }
.qdot.poor, .qfill.poor { background: #dc2626; }
.qbadge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.qbadge small { color: var(--muted); font-weight: 500; }
.qsum { display: flex; gap: 18px; align-items: center; margin: 6px 0 4px; }
.qbig { display: grid; justify-items: center; padding: 10px 14px; border-radius: 12px; background: var(--ok-soft); min-width: 96px; }
.qbig b { font-size: 30px; line-height: 1; }
.qbig small { color: var(--muted); font-size: 13px; text-align: center; }
.qbig.good b { color: var(--ok); } .qbig.fair { background: var(--warn-soft); } .qbig.fair b { color: var(--warn); } .qbig.poor { background: var(--bad-soft); } .qbig.poor b { color: var(--bad); }
.qbars { flex: 1; display: grid; gap: 6px; }
.qbar { display: grid; grid-template-columns: 40px 1fr 28px; gap: 8px; align-items: center; font-size: 13px; }
.qtrack { height: 8px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.qfill { display: block; height: 100%; border-radius: 999px; }
.call-row { cursor: pointer; }
.call-row:hover, .call-row.open { background: var(--card-2); }
/* The initials badge is a span too. Only the name block should grow; the badge stays a circle. */
.call-who > span:not(.av) { min-width: 0; flex: 1; }
.call-who .qa { margin-left: auto; flex: none; }
.call-who b, .call-who small { overflow-wrap: anywhere; }
.call-detail td { background: var(--card-2); padding: 4px 16px 14px; }
.cdl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 4px 0 0; font-size: 13px; }
.cdl dt { color: var(--muted); }
.cdl dd { margin: 0; }

.drow { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); }
.dlist li:first-child .drow { border-top: 0; }
.drow .btn .ic { width: 15px; height: 15px; }
/* Calls to return: the name and number take the full row. The buttons sit underneath
   so a narrow card cannot squeeze the text down to a few pixels. */
.drow:has(.ret-btns) { flex-wrap: wrap; align-items: flex-start; }
.drow:has(.ret-btns) .di-main { flex: 1 1 100%; }
.drow:has(.ret-btns) .di-main b,
.drow:has(.ret-btns) .di-main small { white-space: normal; overflow: visible; text-overflow: unset; }
.drow:has(.ret-btns) .di-main b { color: var(--ink); }
.drow:has(.ret-btns) .di-main small { color: var(--ink-2); }
.dcard.hot, .dcard.hot .dcard-body small, .dcard.hot .dcard-body span { color: var(--ink); }
.dcard.hot .dcard-body span, .dcard.hot .dcard-body small { color: var(--ink-2); }

/* Freedom Tech overview */
.health { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 16px; }
.hpill { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.hpill b { display: block; font-size: 14px; }
.hpill small { color: var(--muted); font-size: 13px; }
.hdot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: #94a3b8; box-shadow: 0 0 0 4px #f1f5f9; }
.hpill.ok .hdot { background: #16a34a; box-shadow: 0 0 0 4px #dcfce7; }
.hpill.bad { border-color: #fecaca; background: var(--bad-soft); }
.hpill.bad .hdot { background: #dc2626; box-shadow: 0 0 0 4px #fee2e2; }
.ft-table { margin-bottom: 18px; }
.ft-table td small { white-space: nowrap; }
.ft-table .btn .ic { width: 15px; height: 15px; }

/* Card rows sized to the number of cards, so none is left alone on a line */
.dash-cards[data-n] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-cards[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-cards[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1500px) { .dash-cards[data-n="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); } .dash-cards[data-n="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .dash-cards[data-n] { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-cards[data-n="5"] > :last-child { grid-column: span 2; } }
@media (max-width: 560px) { .dash-cards[data-n] { grid-template-columns: 1fr; } }

.usage-cards[data-n="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.usage-cards[data-n="8"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1300px) { .usage-cards[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .usage-cards[data-n] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Panel grids: 4 panels as 2 x 2, 2 side by side; 3, 6, 9 fill rows of three */
.dash-grid[data-n] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-grid[data-n="4"], .dash-grid[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid[data-n="1"] { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) { .dash-grid[data-n] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .dash-grid[data-n] { grid-template-columns: 1fr; } }

/* ---- Header ---- */
.top { gap: 18px; min-height: 64px; padding: 0 18px; background: linear-gradient(90deg, #0a1a2e 0%, #10274a 55%, #163463 100%); border-bottom: 1px solid #22406b; box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.brand { gap: 12px; font-size: 17px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); flex: none; }   /* white in both themes: the eagle is dark */
.brand-mark img { width: 28px; height: auto; display: block; }
.brand-text { display: flex; align-items: center; gap: 8px; }
.brand-text b { font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.brand .app-word { color: #fff; background: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; line-height: 1.2; }
.org { justify-content: flex-start; }
.org-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #e6edf7; font-weight: 600; font-size: 14px; }
.org-chip .ic { width: 16px; height: 16px; color: #9fb4d3; flex: none; }
.org-label { font-size: 13px; font-weight: 600; color: #9fb4d3; text-transform: uppercase; letter-spacing: .06em; }
.org-chip select { background: transparent; border: 0; color: #fff; font-weight: 600; padding: 2px 4px; width: 180px; max-width: min(240px, 46vw); min-width: 0; cursor: pointer; }
.org-chip select:focus-visible { outline: 2px solid #7fb0e8; border-radius: 6px; }
.org-chip select option { color: var(--ink); }
.user-menu { margin-left: auto; position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: 999px; color: #e6edf7; border: 1px solid transparent; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); }
.user-menu .avatar { margin-right: 0; width: 34px; height: 34px; min-width: 34px; max-width: 34px; min-height: 34px; max-height: 34px; flex-basis: 34px; aspect-ratio: 1; }
.user-text { display: grid; line-height: 1.15; text-align: left; }
.user-text #userName { font-weight: 600; font-size: 14px; color: #fff; }
.user-text small { font-size: 13px; color: #9fb4d3; }
.user-menu > summary > .ic { width: 16px; height: 16px; color: #9fb4d3; }
.user-menu .menu-list { top: calc(100% + 8px); min-width: min(230px, calc(100vw - 16px)); }
.user-menu .menu-list .menu-sub { font-size: 13px; color: var(--muted); padding-left: 36px; }
@media (max-width: 900px) {
  .user-text, .org-label { display: none; }
  .brand-text b { font-size: 16px; }
}

/* Your phone panel */
.myphone { display: grid; gap: 12px; margin-top: 4px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--chip); position: relative; flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid #7fb0e8; outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }
.switch b { display: block; font-size: 14px; }
.switch small { color: var(--muted); font-size: 13px; }
.fwd-row { display: flex; gap: 8px; padding-left: 54px; }
.fwd-row input { flex: 1; min-height: 36px; }
.myphone-note { margin: 0; }
.cd-actions { margin: 10px 0 0; }
.cd-actions .btn .ic, .drow .btn .ic { width: 15px; height: 15px; }

/* Voicemail actions and transcripts */
.vm-text { margin: 8px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--card-2); border-left: 3px solid var(--line); font-size: 14px; line-height: 1.5; }
.vm-text.pending { color: var(--muted); font-style: italic; }
.vm-text { white-space: pre-line; }
.vm-said { margin-top: 6px; } .vm-said .vm-text { max-height: 320px; overflow-y: auto; }
.vm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vm-actions .btn .ic { width: 15px; height: 15px; }

/* A group of settings fields that shows or hides together, spaced like the form around it. */
.sub-grid { display: grid; gap: 16px; }

/* Office-hours bar on the dashboard */
.hours-bar { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.hours-bar.closed, .hours-bar.other { border-color: #efd9a8; background: var(--warn-soft); }
.hours-bar.closed .qicon, .hours-bar.other .qicon { background: var(--warn-soft); color: var(--warn); }
.hours-bar.open { border-color: #b7dfc4; background: var(--ok-soft); }
.hours-main { display: grid; gap: 1px; flex: 1 1 260px; min-width: 0; }
.hours-main small, .hours-main span { color: var(--muted); font-size: 13px; }
.hours-bar.closed .hours-main span { color: var(--warn); }
.hours-main b { font-size: 16px; }
.hours-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hours-form { flex: 1 0 100%; display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); max-width: 520px; }
.hours-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.hours-form legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
/* Normal hours: one quiet line under the greeting; opens into a card only while someone is changing it */
.hours-bar.quiet:not(.editing) { padding: 0; margin: -10px 0 16px; border: 0; background: none; }
.hours-line { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 13px; }
.hours-line .ic { width: 15px; height: 15px; }
.hours-line .linkish { color: var(--blue); }
.hours-bar.editing .hours-line .linkish { display: none; }
.cd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cd-book { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 10px; max-width: 520px; }
.cd-book label { flex: 1 1 240px; display: grid; gap: 4px; font-size: 13px; }

/* Voicemail follow-up: assignee, notes, handled */
.vm-show select { min-height: 38px; }
.vm.done { opacity: .82; }
.vm.done .vm-text { border-left-color: #b7dfc4; }
.vm-notes { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.vm-notes li { display: grid; gap: 2px; padding: 8px 12px; border-radius: 8px; background: var(--card-2); font-size: 14px; }
.vm-notes li.vn-done { background: var(--ok-soft); }
.vn-by small { color: var(--muted); font-size: 13px; }
.vm-assign { display: inline-flex; align-items: center; gap: 6px; padding: 0 0 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.vm-assign .ic { width: 15px; height: 15px; color: var(--muted); }
.vm-assign select { border: 0; min-height: 32px; padding: 4px 8px 4px 0; background: transparent; font-size: 13px; }
.vm-more { display: inline-flex; gap: 4px; margin-left: auto; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--card-2); color: var(--ink); }
.vm-note-form { display: grid; gap: 8px; max-width: 640px; }
.vm-note-form textarea { width: 100%; }
.vm-note-form .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.chip-btn:hover { border-color: #b8c7dc; background: var(--blue-soft); }

/* Contact history (address book) */
.ch-panel { margin-bottom: 16px; }
.ch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.ch-head h2 { margin: 0 0 2px; font-size: 18px; }
.ch-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ch-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.ch-list .qicon { width: 34px; height: 34px; }
.ch-list .qicon .ic { width: 17px; height: 17px; }
.ch-bad .qicon { background: var(--bad-soft); color: var(--bad); }
.ch-body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.ch-body a { color: var(--ink); text-decoration: none; }
.ch-body a:hover b { text-decoration: underline; }
.ch-body small { color: var(--muted); font-size: 13px; }
.ch-quote { margin: 4px 0 0; padding: 6px 10px; border-left: 3px solid var(--line); background: var(--card-2); font-size: 14px; }
.ch-note { margin: 4px 0 0; font-size: 14px; }
.ch-when { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* Calls to return: follow-up */
.ret-btns { display: inline-flex; gap: 6px; flex: none; }
.ret-btns .btn .ic { width: 15px; height: 15px; }
.ret-note { display: block; margin-top: 2px; color: var(--ink); }
.ret-note i { color: var(--muted); font-style: normal; }
.ret-form { display: grid; gap: 8px; margin: 10px 0 4px; padding: 12px; border-radius: 10px; background: var(--card-2); }
.ret-form label:not(.check) { display: grid; gap: 4px; font-size: 13px; }
.ret-form textarea { width: 100%; }
.ret-form .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cd-follow { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.cd-follow > p { margin: 0; }

/* Small round "call" button next to a number */
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: 2px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--blue); cursor: pointer; vertical-align: middle; }
.icon-btn:hover { background: var(--blue-soft); border-color: #b8c7dc; }
.icon-btn .ic { width: 14px; height: 14px; }

/* Freedom Tech: client setup, ports, summary */
.setup-score { margin: 0 0 6px; }
.setup-bar { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; margin-bottom: 16px; }
.setup-bar span { display: block; width: 0; height: 100%; background: var(--ok); }
.setup-group { margin-bottom: 14px; }
.setup-group h2 { margin: 0 0 6px; font-size: 16px; }
.setup-list { list-style: none; margin: 0; padding: 0; display: grid; }
.setup-list li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.setup-list li:first-child { border-top: 0; }
.setup-list li > div { display: grid; gap: 2px; }
.setup-list small { color: var(--muted); font-size: 13px; }
.setup-list li.todo b { color: var(--ink); }
.setup-mark { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); }
.setup-list li.done .setup-mark:not(.manual) { border-color: var(--ok); background: var(--ok); color: var(--on-fill); }
.setup-mark .ic { width: 14px; height: 14px; }
.setup-mark.manual { border: 0; width: 24px; }
.setup-mark.manual input { width: 20px; height: 20px; margin: 0; }
.summary-view { overflow-x: auto; }
.usage-table .usage-who { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: 1px 0 0 var(--line); min-width: 220px; }
.usage-table thead .usage-who { z-index: 2; background: var(--bg); }
.usage-who-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.usage-table tr.usage-current .usage-who { box-shadow: inset 3px 0 0 var(--blue), 1px 0 0 var(--line); }
tr.client-current td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.page-error { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; flex: none; margin: 12px 24px 0; padding: 12px 16px; border: 1px solid currentColor; border-radius: 12px; background: var(--warn-soft); color: var(--warn); }
.page-error > .ic { width: 20px; height: 20px; flex: none; }
.page-error p { margin: 0; flex: 1 1 220px; font-weight: 600; }
.page-error .btn { flex: none; }
@media (max-width: 900px) { .page-error { margin: 10px 16px 0; } }
/* While a page can't load, its empty tables and lists would read as "nothing here": hide them. */
.main.has-page-error .page table:not(:has(tbody tr)), .main.has-page-error .page .table-wrap:not(:has(tbody tr)), .main.has-page-error .page .empty, .main.has-page-error .page .empty-card, .main.has-page-error .page tr:has(> .empty-cell) { display: none; }
.settings-read h2 { margin: 0 0 8px; font-size: 18px; }
.read-dl { display: grid; gap: 10px; margin: 0; }
.read-dl div { display: grid; gap: 2px; }
.read-dl dt { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.read-dl dd { margin: 0; }
.read-logo { display: block; max-width: 180px; max-height: 64px; margin-bottom: 8px; }
#portRows td:first-child b, #portRows .chip { white-space: nowrap; }

/* When calls come in (heat map) and blocked numbers */
#callStats, #blockedList { margin-bottom: 16px; }
#statsDays { min-height: 28px; padding: 2px 6px; font-size: 13px; }
.heat-wrap { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 3px; font-size: 13px; }
.heat th { color: var(--muted); font-weight: 600; padding: 2px 4px; text-align: center; }
.heat tbody th { text-align: left; padding-right: 8px; }
.heat td { min-width: 30px; height: 28px; text-align: center; border-radius: 5px; color: #0f2a4a; background: rgba(27, 95, 168, var(--a, 0)); }
.heat td[data-a] { font-weight: 600; }
.heat td:empty { background: var(--card-2); }
.heat td.miss { box-shadow: inset 0 0 0 2px var(--red); }
.block-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.block-add input[name=number] { flex: 0 1 180px; }
.block-add input[name=reason] { flex: 1 1 220px; }
.heat td.dark { color: #fff; }
/* The summary is email HTML (inline styles); the portal's security policy drops those, so it's styled here too. */
.summary-view h2 { margin: 0 0 4px; }
.summary-view h3 { margin: 22px 0 6px; font-size: 17px; }
.summary-view table { border-collapse: collapse; width: 100%; font-size: 14px; }
.summary-view td { padding: 6px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.summary-view td:first-child { color: var(--muted); width: 38%; }
.summary-view .sm-attn { padding: 10px 14px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); }
.summary-view .sm-attn ul { margin: 6px 0 0; padding-left: 20px; }
.summary-view .sm-ok { color: var(--ok); }
.summary-view .sm-bad { color: var(--bad); }
.summary-view .sm-lead { margin: 0 0 14px; color: var(--ink-2); }
.summary-view .sm-current { box-shadow: inset 3px 0 0 var(--blue); padding-left: 8px; scroll-margin-top: 12px; }

/* To do list */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 8px 14px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--blue-soft); color: var(--ink); font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line); }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.todo-item { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 14px; align-items: start; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.todo-item.mine { border-left: 4px solid var(--blue); }
.todo-main { display: grid; gap: 2px; min-width: 0; }
.todo-main a { color: var(--ink); text-decoration: none; }
.todo-main a:hover b { text-decoration: underline; }
.todo-main small { color: var(--muted); font-size: 13px; }
.todo-snip { margin: 4px 0 0; font-size: 14px; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.todo-age { color: var(--muted); font-size: 13px; white-space: nowrap; }
.todo-acts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.todo-acts .btn .ic { width: 15px; height: 15px; }

/* Client logo: a white badge in the dark header, and above the greeting on the dashboard */
.org-logo { display: inline-flex; align-items: center; height: 30px; padding: 3px 10px; margin-left: -6px; border-radius: 999px; background: #fff; flex: none; }
.org-logo img { display: block; height: 100%; width: auto; max-width: 130px; object-fit: contain; }
.dash-logo { display: block; height: 48px; width: auto; max-width: 240px; object-fit: contain; margin: 0 0 10px; }
@media (max-width: 640px) { .org-logo { display: none; } .dash-logo { height: 40px; } }

/* Go-live board */
.golive-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.golive-card h2 { margin: 0 0 8px; font-size: 16px; }
.golive-card.wide { grid-column: 1 / -1; }
.cutover + .cutover { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.cutover .btn { margin-right: 8px; }
.cut-failed b { color: var(--bad, #b91c1c); }
.cut-waiting .setup-mark { border-style: dashed; }
.golive-phones td { vertical-align: top; }
.golive-phones small { color: var(--muted); }
.add-phone { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.add-phone input[name=mac] { flex: 1 1 200px; }
.add-phone small { flex-basis: 100%; }
.golive-calls { list-style: none; margin: 0; padding: 0; display: grid; }
.golive-calls li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.golive-calls li:first-child { border-top: 0; }
.golive-calls li.hot { background: var(--ok-soft); }
.gc-when { color: var(--muted); width: 64px; flex: none; }
.golive-calls li > span:nth-child(2) { flex: 1; min-width: 180px; }
#goliveBody .golive-card { max-width: none; margin: 0; }
.gl-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gl-line .chip { margin-top: 0; }
.golive-phones .chip { margin-top: 0; }

/* Import from Outlook */
.import-tools { margin: 0 0 6px; font-size: 14px; }
.import-tools .linkish { color: var(--blue); }
.import-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.import-list li { padding: 8px 12px; border-top: 1px solid var(--line); }
.import-list li:first-child { border-top: 0; }
.import-list label { align-items: flex-start; }
.import-list small { color: var(--muted); }

/* ---- Make a call ---- */
.send-btn .ic { width: 18px; height: 18px; }
.dialer-box { max-width: 460px; height: auto; margin: 10vh auto 0; padding: 20px; display: grid; gap: 12px; }
.dialer-box label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.dialer-box input { font-size: 20px; min-height: 48px; }
.dialer-hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.dialer-hits button { width: 100%; display: grid; text-align: left; gap: 1px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font: inherit; cursor: pointer; }
.dialer-hits button:hover { border-color: #b8c7dc; background: var(--blue-soft); }
.dialer-hits small { color: var(--muted); font-size: 13px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-size: 18px; }

/* ---- phones: bottom tab bar + slide-up menu ---- */
.app { --tab-h: 0px; }
.tabbar { display: none; }
@media (max-width: 900px) {
  .app { --tab-h: calc(52px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: var(--tab-h); box-sizing: border-box;
    background: var(--card); border-top: 1px solid var(--line); padding: 2px 0 env(safe-area-inset-bottom); }
  .tabbar > a, .tabbar > button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 44px; padding: 4px 2px 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; line-height: 1.15; text-decoration: none; cursor: pointer; }
  .tabbar > a > span, .tabbar > button > span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .ic { width: 22px; height: 22px; flex: none; }
  .tabbar > a.on, .tabbar > button.on { color: var(--blue); }
  .tabbar .tab-main { color: var(--bad); }
  .tabbar .tab-main > span { color: var(--ink); font-weight: 700; }
  .tab-badge { position: absolute; top: 1px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; border: 2px solid var(--card); background: var(--red); color: #fff; font-size: 13px; line-height: 16px; text-align: center; box-sizing: border-box; pointer-events: none; }
  /* The sidebar becomes a sheet that slides up from the tab bar. */
  .app { grid-template-rows: auto 1fr; }
  .side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-height: 78vh; overflow-y: auto; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 2px;
    padding: 14px 14px calc(var(--tab-h) + 16px); border: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(15, 23, 42, .2);
    transform: translateY(105%); transition: transform .22s ease; }
  body.menu-open .side { transform: none; }
  .side .nav-group { display: block; }
  .side .send-btn { display: none; }
  .nav-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(15, 23, 42, .35); }
  .main { padding-bottom: var(--tab-h); }
  .toast { bottom: calc(var(--tab-h) + 12px); }
  .dialer-box { margin: 0; height: auto; min-height: 100%; border-radius: 0; }
}
@media (max-width: 900px) {
  .tabbar { z-index: 45; }
  .side .nav-head { display: block; margin: 10px 8px 2px; }
  .side::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--chip); margin: 0 auto 8px; flex: none; }
}
/* Phones: one compact header row (logo and name, office, search, account). */
@media (max-width: 600px) {
  .top { padding: 8px 12px; gap: 6px 10px; }
  .brand-text b { display: none; }
  .stage-badge { font-size: 13px; padding: 2px 8px; }
  .org-chip { padding: 4px 10px; font-size: 13px; }
}
#dialer { z-index: 60; }
.dialer-box { align-content: start; }
.dialer-box .actions .btn { width: 100%; min-height: 48px; justify-content: center; font-size: 16px; }
@media (max-width: 900px) { .dialer-box { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); } }

/* Calls: day headings, filters; loading placeholders */
.calls .day-row td { background: var(--card-2); color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 6px 14px; }
.call-filter { margin-bottom: 12px; flex-wrap: wrap; }
.empty-cell { color: var(--muted); padding: 24px 14px !important; text-align: center; }
.skel { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef2f7 0%, #f7f9fc 50%, #eef2f7 100%); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
.skel.w85 { width: 85%; } .skel.w80 { width: 80%; } .skel.w60 { width: 60%; } .skel.w50 { width: 50%; }
.skel-item { display: grid; gap: 8px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; list-style: none; }
.skel-row td { padding: 14px; }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* Team: one live status per person */
#teamList { align-items: stretch; }
.member { grid-template-rows: auto auto 1fr; }
.member.me { border-color: #b8c7dc; }
.member-act { align-self: end; display: flex; gap: 8px; }
.pstat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.pstat i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pstat.on { background: var(--ok-soft); color: var(--ok); }
.pstat.busy { background: var(--bad-soft); color: var(--bad); }
.pstat.ring { background: var(--warn-soft); color: var(--warn); }
.pstat.dnd { background: var(--violet-soft); color: var(--violet); }
.pstat.fwd { background: var(--blue-soft); color: var(--blue); }

/* Header search + Ctrl K */
.top-search { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; min-width: 44px; min-height: 44px; padding: 7px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #dbe5f3; font: inherit; font-size: 14px; cursor: pointer; }
.top-search:hover { background: rgba(255,255,255,.14); }
.top-search .ic { width: 16px; height: 16px; }
.top-search kbd { font: inherit; font-size: 13px; padding: 1px 6px; border-radius: 5px; background: rgba(255,255,255,.12); color: #b9c8de; }
.top-search + .user-menu { margin-left: 0; }
.search-box { max-width: 640px; width: 100%; height: auto; max-height: 80vh; margin: 8vh auto 0; padding: 0; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.search-in { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.search-in .ic { width: 18px; height: 18px; color: var(--muted); }
.search-in input { flex: 1; border: 0; font-size: 18px; min-height: 40px; outline: none; }
.search-results { overflow-y: auto; padding: 8px 14px 14px; }
.search-results h3 { margin: 12px 4px 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.search-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.search-list a { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.search-list a:hover, .search-list a:focus { background: var(--blue-soft); outline: none; }
.search-list .qicon { width: 32px; height: 32px; }
.search-list .qicon .ic { width: 16px; height: 16px; }
.search-list small { color: var(--muted); font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-list .di-main { min-width: 0; }
@media (max-width: 900px) { .top-search span, .top-search kbd { display: none; } .top-search { padding: 10px; min-width: 44px; min-height: 44px; } .search-box { margin: 0; max-height: none; min-height: 100%; border-radius: 0; } }
/* Inbox: what's unread, instead of an empty pane */
.pe-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; width: min(360px, 90%); }
.pe-list a { display: grid; gap: 1px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); text-decoration: none; text-align: left; }
.pe-list a:hover { border-color: #b8c7dc; }
.pe-list small { color: var(--muted); }
.skel-card { display: grid; gap: 10px; min-height: 90px; align-content: center; }
.dash-clear { display: flex; gap: 8px; align-items: center; margin: -4px 0 16px; padding: 10px 14px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-size: 14px; }
.dash-clear .ic { width: 16px; height: 16px; flex: none; }
.dsub { margin: -4px 0 6px; }

/* Calls on a phone: the page chrome stacks. The row itself switches whenever the table
   is narrow (a phone, or a tablet/landscape window with the sidebar beside it). */
@media (max-width: 700px) {
  #calls .page-head { flex-wrap: wrap; }
  #calls .dash-actions { flex-wrap: wrap; width: 100%; }
  #callSearch { flex: 1 1 100%; }
  .call-filter { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .call-filter button { white-space: nowrap; }
}
#calls .table-wrap { container-type: inline-size; container-name: calls; }
@container calls (max-width: 860px) {
  table.calls thead { display: none; }
  table.calls, table.calls tbody { display: block; }
  table.calls tr.call-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.calls tr.call-row td { padding: 0; border: 0; }
  table.calls tr.call-row td:nth-child(2), table.calls tr.call-row td:nth-child(4), table.calls tr.call-row td:nth-child(6) { display: none; }
  table.calls tr.call-row td:nth-child(1) { grid-row: span 2; min-width: 0; }
  table.calls tr.call-row td:nth-child(3), table.calls tr.call-row td:nth-child(5) { text-align: right; font-size: 13px; white-space: nowrap; }
  .call-len { display: inline; margin-left: 6px; color: var(--muted); }
  .call-q-inline { display: inline-block; margin-left: 6px; vertical-align: middle; }
  table.calls tr.day-row, table.calls tr.call-detail { display: block; }
  table.calls tr.day-row td, table.calls tr.call-detail td { display: block; }
  .call-who small { white-space: normal; }
}
/* Very narrow call lists: give the name the whole row, and put the time and result underneath. */
@container calls (max-width: 460px) {
  table.calls tr.call-row { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "who who" "when result"; }
  table.calls tr.call-row td:nth-child(1) { grid-area: who; grid-row: auto; }
  table.calls tr.call-row td:nth-child(3) { grid-area: when; text-align: left; }
  table.calls tr.call-row td:nth-child(5) { grid-area: result; text-align: right; }
}
/* Wide call log: the caller column keeps most of the row so the name is not a sliver. */
@container calls (min-width: 861px) {
  table.calls th:first-child, table.calls td:first-child { width: 42%; }
  table.calls td:nth-child(n+3) { white-space: nowrap; }
}

/* Team: parked calls, notes, workload */
.parked { margin-bottom: 16px; }
.parked h2 { margin: 0 0 8px; font-size: 16px; }
.park-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.park-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.park-list li.busy { border-color: #efd9a8; background: var(--warn-soft); }
.park-list li > span { display: grid; flex: 1; min-width: 0; }
.park-list small { color: var(--muted); font-size: 13px; }
.team-note { display: flex; align-items: center; gap: 6px; margin: 0; padding: 6px 10px; border-radius: 8px; background: var(--violet-soft); color: var(--violet); font-size: 14px; }
.team-note .ic { width: 14px; height: 14px; flex: none; }
.team-note span { flex: 1; }
.team-note .linkish { color: var(--violet); }
.team-work { margin: 0; font-size: 13px; }
.team-work a { color: var(--blue); }
.member { grid-template-rows: auto auto auto auto 1fr; }
.member-act { flex-wrap: wrap; }
.note-form { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.note-form label { display: grid; gap: 4px; font-size: 13px; }
.note-form .actions { display: flex; gap: 8px; }

/* Freedom Tech: view as */
.top-viewas { padding: 7px 12px; border-radius: 10px; border: 1px solid rgba(242,183,5,.6); background: rgba(242,183,5,.12); color: #ffd666; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.top-viewas:hover { background: rgba(242,183,5,.2); }
.viewas-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; width: max-content; max-width: calc(100% - 32px);
  padding: 10px 12px 10px 16px; border-radius: 14px; background: #f59e0b; color: #1a1300; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
@media (max-width: 900px) { .viewas-bar { bottom: calc(var(--tab-h) + 12px); } }
.viewas-bar .btn { background: var(--card); }
body.viewing-as .top { box-shadow: inset 0 -3px 0 #f59e0b; }
.dialer-box label { display: grid; gap: 6px; }
@media (max-width: 900px) { .top-viewas { display: none; } }
@media (min-width: 901px) { #viewAsMenu { display: none !important; } }
.theme-pick .seg button { min-height: 44px; min-width: 44px; padding: 8px 12px; }

/* Incoming-call pop-up */
.ring-cards { position: fixed; right: 16px; top: 72px; z-index: 12; display: grid; gap: 10px; width: min(360px, calc(100% - 32px)); }
.ring-card { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--navy); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .22); padding: 12px 14px; }
.ring-card.ringing { border-left-color: #15803d; }
.ring-card.fresh { animation: ring-in .25s ease-out; }
.ring-card.spam { border-left-color: var(--bad); }
.ring-card.ended { opacity: .85; border-left-color: var(--line); }
.rc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rc-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ok); text-transform: uppercase; letter-spacing: .03em; }
.ring-card.ended .rc-status, .ring-card:not(.ringing) .rc-status { color: var(--muted, #475569); }
.rc-status small { text-transform: none; font-weight: 500; letter-spacing: 0; }
.rc-status .ic { width: 16px; height: 16px; }
.rc-head .icon-btn { font-size: 20px; line-height: 1; min-width: 32px; min-height: 32px; }
.rc-name { margin: 4px 0 0; font-size: 19px; font-weight: 700; color: var(--ink); }
.rc-sub { margin: 2px 0 0; font-size: 14px; color: var(--muted, #475569); }
.rc-list { list-style: none; margin: 10px 0 6px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.rc-list li { display: flex; gap: 8px; align-items: flex-start; }
.rc-list .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted, #475569); }
.rc-list small { color: var(--muted, #475569); font-size: 13px; }
.rc-warn { color: var(--bad); font-weight: 600; }
.rc-warn .ic { color: var(--bad); }
.rc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
@keyframes ring-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) { .ring-cards { top: auto; bottom: 84px; right: 16px; left: 16px; width: auto; } }
@media (max-width: 900px) { body.on-call .ring-cards { bottom: calc(150px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .ring-card.fresh { animation: none; } }

.spam-box { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.spam-box h3 { margin: 0 0 4px; font-size: 15px; }
.spam-box select { margin-left: 4px; }

/* Initials badges (one color per person, same everywhere) and status dots.
   Width and height stay equal so a narrow flex row cannot stretch them into pills. */
.av { position: relative; flex: 0 0 auto; display: inline-grid; place-items: center; width: 34px; height: 34px; min-width: 34px; max-width: 34px; min-height: 34px; max-height: 34px; aspect-ratio: 1; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em; line-height: 1; user-select: none; }
.av-lg { width: 42px; height: 42px; min-width: 42px; max-width: 42px; min-height: 42px; max-height: 42px; font-size: 15px; }
.av-sm { width: 28px; height: 28px; min-width: 28px; max-width: 28px; min-height: 28px; max-height: 28px; font-size: 13px; letter-spacing: 0; }
.av-sm .av-dot { width: 10px; height: 10px; right: -2px; bottom: -2px; border-width: 1.5px; }
.av .ic { width: 16px; height: 16px; }
.av-none { background: var(--chip); color: var(--muted); }
.av-c0 { background: #1d4ed8; } .av-c1 { background: #047857; } .av-c2 { background: #b45309; } .av-c3 { background: #7c3aed; }
.av-c4 { background: #be123c; } .av-c5 { background: #0f766e; } .av-c6 { background: #4338ca; } .av-c7 { background: #a21caf; }
.av-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--card); background: #9ca3af; }
.av-lg .av-dot { width: 14px; height: 14px; }
.av-dot.on { background: #16a34a; } .av-dot.busy { background: #dc2626; } .av-dot.ring { background: #f59e0b; } .av-dot.dnd { background: #7c3aed; } .av-dot.fwd { background: #2563eb; } .av-dot.off { background: #9ca3af; }
.av-badge { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--card); display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.av-badge svg, .av-badge .ic { width: 11px; height: 11px; }
.av-badge.dir.missed, .av-badge.k-call { background: var(--bad-soft); color: var(--bad); }
.av-badge.dir.out { background: var(--ok-soft); color: var(--ok); }
.av-badge.k-voicemail { background: var(--violet-soft); color: var(--violet); }
.av-badge.k-fax { background: var(--blue-soft); color: var(--blue); }
.call-who .av { margin-right: 2px; }
.vm-who, .member-who, .rc-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rc-who { margin-top: 6px; }
.rc-who .rc-name { margin: 0; }
.todo-item > .av { align-self: start; }
@media (prefers-reduced-motion: no-preference) { .av-dot.ring { animation: av-pulse 1.2s ease-in-out infinite; } }
@keyframes av-pulse { 50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, .35); } }

/* Voicemail player */
.vplayer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 620px; }
.vplayer audio { display: none; }
.vp-play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--primary, var(--navy)); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.vp-play .ic { width: 20px; height: 20px; }
.vp-play:hover { filter: brightness(1.15); }
.vp-back, .vp-speed { min-width: 44px; height: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); font: 600 13px/1 inherit; cursor: pointer; padding: 0 10px; }
.vp-back:hover, .vp-speed:hover { background: var(--bg); }
.vp-seek { border: 0; padding: 0; box-shadow: none; flex: 1 1 160px; min-width: 120px; height: 24px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; --pct: 0%; }
.vp-seek::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--primary, var(--navy)) var(--pct), var(--line) var(--pct)); }
.vp-seek::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--primary, var(--navy)) var(--pct), var(--line) var(--pct)); }
.vp-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; background: var(--primary, var(--navy)); border: 2px solid var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.vp-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--primary, var(--navy)); border: 2px solid var(--card); }
.vp-time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); min-width: 84px; }
.vm .vm-text { font-size: 15px; line-height: 1.5; }
@media (max-width: 560px) { .vp-seek { order: 5; flex-basis: 100%; } }

/* Team status: dashboard card and the header list */
.team-menu { position: relative; }
.team-sum { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 4px 10px; border-radius: 999px; color: #e6edf7; cursor: pointer; }
.team-sum::-webkit-details-marker { display: none; }
.team-sum:hover, .team-menu[open] > .team-sum { background: rgba(255, 255, 255, .08); }
.team-sum .ic { width: 20px; height: 20px; }
.team-dots { display: inline-flex; gap: 3px; }
.team-dots i { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.team-dots i.on { background: #16a34a; } .team-dots i.busy { background: #f87171; } .team-dots i.ring { background: #fbbf24; }
.team-dots i.dnd { background: #c4b5fd; } .team-dots i.fwd { background: #93c5fd; } .team-dots i.off { background: #9ca3af; }
.team-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(340px, calc(100vw - 16px)); max-width: calc(100vw - 16px); max-height: min(70vh, 520px); overflow: auto; padding: 8px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.tp-row { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 2px 4px; border-radius: 8px; }
.tp-row:hover { background: var(--bg); }
.st-name { flex: 1; min-width: 0; display: grid; text-decoration: none; color: var(--ink); line-height: 1.2; }
.st-name span { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-name small { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.st-btn .ic { width: 18px; height: 18px; }
.st-btn:hover { background: var(--blue-soft); color: var(--blue); }
.st-btn:disabled { opacity: .35; cursor: default; background: transparent; }

/* Row actions: always a visible ⋯ button. Hover (fine pointer) and keyboard focus open the same menu. */
.qa { position: relative; display: inline-flex; flex: none; }
.qa-btn { min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); font: 700 18px/1 inherit; letter-spacing: .08em; cursor: pointer; }
.qa-btn:hover, .qa.open > .qa-btn, .qa:focus-within > .qa-btn { background: var(--blue-soft); color: var(--ink); }
.qa-menu { display: none; position: fixed; z-index: 80; min-width: 200px; max-width: min(280px, 84vw); padding: 6px; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); flex-direction: column; gap: 2px; }
.qa.open > .qa-menu, .qa:focus-within > .qa-menu { display: flex; }
@media (hover: hover) and (pointer: fine) {
  .qa:hover > .qa-menu { display: flex; }
  .qa.qa-shut:not(.open):not(:focus-within) > .qa-menu { display: none; }
}
.qa-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: 600 14px/1.2 inherit; text-align: left; text-decoration: none; cursor: pointer; }
.qa-item:hover, .qa-item:focus-visible { background: var(--blue-soft); color: var(--ink); }
.qa-item:disabled { opacity: .45; cursor: default; }
.qa-item .ic { width: 16px; height: 16px; flex: none; color: var(--ink-2); }
.qa-book { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 8px 0; }
.qa-book label { display: grid; gap: 4px; flex: 1; min-width: 160px; }
.staff-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.staff-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink-2); text-decoration: none; font-weight: 600; }
.staff-tabs a[aria-current="page"] { background: var(--blue-soft); color: var(--ink); border-color: var(--line-strong); }
.dash-team { margin: 0 0 16px; }
.dash-team h2 .ic { width: 18px; height: 18px; }
.dash-team ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.dt-row { display: flex; align-items: center; gap: 4px; }
.dt-row .dt-person { flex: 1; min-width: 0; }
.dt-person { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px; border-radius: 10px; background: var(--card-2); color: inherit; text-decoration: none; }
.dt-who { flex: 1; min-width: 0; display: grid; }
.dt-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.dt-who small { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-person .pstat { flex: none; }
body.in-teams .team-sum { color: var(--ink-2); }
body.in-teams .team-sum:hover, body.in-teams .team-menu[open] > .team-sum { background: var(--card-2); }
@media (max-width: 900px) {
  .team-menu[open] .team-pop { position: fixed; top: calc(env(safe-area-inset-top) + 96px); left: 8px; right: 8px; width: auto; max-height: calc(100dvh - 96px - var(--tab-h) - 16px); }
}

/* My call, pinned */
.call-bar { position: fixed; left: 0; bottom: 0; width: 236px; z-index: 11; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--navy); color: #fff; box-shadow: 0 -6px 18px rgba(15, 23, 42, .18); }
.call-bar .av-dot { border-color: var(--navy); }
.cb-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.cb-text b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-text small { color: #cbd5e1; font-size: 13px; font-variant-numeric: tabular-nums; }
.call-bar .btn { min-height: 32px; padding: 6px 10px; }
body.on-call .side { padding-bottom: 84px; }
@media (max-width: 900px) {
  .call-bar { width: auto; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 8px); border-radius: 14px; }
  body.on-call .side { padding-bottom: calc(var(--tab-h) + 8px); }
}

/* Person page */
.av-xl { width: 64px; height: 64px; min-width: 64px; max-width: 64px; min-height: 64px; max-height: 64px; font-size: 22px; }
.av-xl .ic { width: 26px; height: 26px; }
.person-head { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px 18px; display: grid; gap: 12px; max-width: 860px; }
.person-head > .linkish { display: inline-flex; align-items: center; gap: 4px; justify-self: start; font-size: 14px; color: var(--muted); text-decoration: none; }
.person-head > .linkish .ic { width: 16px; height: 16px; }
.ph-top { display: flex; align-items: center; gap: 16px; }
.ph-name h1 { margin: 0; font-size: 26px; line-height: 1.2; }
.ph-name .sub { margin: 4px 0 0; }
.ph-flag { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--blue-soft); color: var(--ink); font-size: 14px; }
.ph-flag .ic { width: 16px; height: 16px; color: var(--blue); flex: none; }
.ph-numbers { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ph-numbers li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.ph-num { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ph-num b { font-size: 17px; font-variant-numeric: tabular-nums; }
.ph-acts { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.ph-info { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.ph-info dt { color: var(--muted); }
.ph-info dd { margin: 0; white-space: pre-wrap; }
.ph-more { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.ph-save { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.ph-save label { display: grid; gap: 4px; flex: 1 1 240px; font-size: 14px; }
.person-filter { margin: 16px 0 8px; }
.person-filter small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.timeline { list-style: none; margin: 0; padding: 0; max-width: 860px; display: grid; gap: 8px; }
.tl-day { margin: 10px 0 0; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tl-item { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tl-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--blue-soft); color: var(--blue); }
.tl-icon svg, .tl-icon .ic { width: 16px; height: 16px; }
.tl-missed .tl-icon { background: var(--bad-soft); color: var(--bad); }
.tl-out .tl-icon { background: var(--ok-soft); color: var(--ok); }
.tl-vm .tl-icon { background: var(--violet-soft); color: var(--violet); }
.tl-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.tl-title { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tl-body > small { color: var(--muted); }
.tl-body .vm-notes, .tl-body .vm-text { margin: 0; }
.tl-acts { margin: 0; display: flex; gap: 8px; }
.who-link { color: inherit; text-decoration: none; }
.who-link:hover b { text-decoration: underline; }
@media (max-width: 560px) { .ph-name h1 { font-size: 22px; } .av-xl { width: 52px; height: 52px; min-width: 52px; max-width: 52px; min-height: 52px; max-height: 52px; font-size: 18px; } .person-head { padding: 14px; } }

/* Keyboard shortcuts */
.keys-box { max-width: 420px; height: auto; margin: 10vh auto 0; padding: 18px 20px; }
.keys-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.keys-list li { display: flex; align-items: center; gap: 12px; }
kbd { display: inline-block; min-width: 30px; padding: 3px 8px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--bg); font: 600 13px/1.4 inherit; text-align: center; color: var(--ink); }
/* Connect as an app */
.app-card h2 { margin-top: 0; }
.qr-row { display: flex; gap: 16px; align-items: center; margin-top: 8px; }
.qr { width: 132px; height: 132px; flex: none; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.qr svg { width: 100%; height: 100%; display: block; }
@media (max-width: 480px) { .qr-row { flex-direction: column; align-items: flex-start; } }

/* ---- Dark mode: follows the computer's setting, or the choice in the account menu (Auto / Light / Dark) ---- */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0b1220; --card: #121b2b; --card-2: #182337; --chip: #26334a; --line: #2a3850; --line-strong: #3b4c68;
  --ink: #e6ebf2; --ink-2: #c9d3e1; --muted: #a3b2c7; --blue: #8ab8ff; --blue-soft: #16294a;
  --ok: #5fd394; --ok-soft: #0f2e20; --warn: #f2bd57; --warn-soft: #33260b; --bad: #ff8f86; --bad-soft: #3a1718; --on-fill: #1a1300;
  --violet: #b9a2ff; --violet-soft: #251a45; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35); color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0b1220; --card: #121b2b; --card-2: #182337; --chip: #26334a; --line: #2a3850; --line-strong: #3b4c68;
  --ink: #e6ebf2; --ink-2: #c9d3e1; --muted: #a3b2c7; --blue: #8ab8ff; --blue-soft: #16294a;
  --ok: #5fd394; --ok-soft: #0f2e20; --warn: #f2bd57; --warn-soft: #33260b; --bad: #ff8f86; --bad-soft: #3a1718; --on-fill: #1a1300;
  --violet: #b9a2ff; --violet-soft: #251a45; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35); color-scheme: dark;
}
/* The word Connect on the sign-in card uses the brand red, which is too dark on a dark card. */
:root[data-theme="dark"] .signin-card h1 .app-word { color: var(--bad); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .signin-card h1 .app-word { color: var(--bad); } }

/* Things that stay light on purpose: QR codes, fax pages, logos. */
.qr, .qr svg { background: #fff; }

.theme-pick { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.theme-pick .seg button { padding: 5px 10px; font-size: 13px; }
.theme-pick .seg button[aria-pressed="true"] { background: var(--blue-soft); color: var(--ink); font-weight: 600; }

/* Client logos are made for white paper: in dark mode they sit on a white plate. */
:root[data-theme="dark"] .dash-logo { background: #fff; padding: 6px 12px; border-radius: 10px; box-sizing: content-box; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dash-logo { background: #fff; padding: 6px 12px; border-radius: 10px; box-sizing: content-box; } }

:root[data-theme="dark"] .heat td { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .heat td { color: var(--ink); } }

/* Counts on filter tabs */
.seg-n { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--chip); color: var(--ink); font-size: 13px; font-weight: 700; line-height: 20px; text-align: center; }
.seg button[aria-checked="true"] .seg-n { background: var(--blue); color: var(--card); }
#callFilter [data-filter="missed"] .seg-n { background: var(--bad); color: var(--on-fill); }

/* Inside Teams: Teams has its own account controls, so sign-out is hidden; leave room for Teams' own header. */
body.in-teams .user-menu .menu-list a[href^="/auth/logout"] { display: none; }
#teamsOpen { margin-top: 8px; width: 100%; }

/* Notifications on this device */
.push-head { margin: 16px 0 4px; font-size: 15px; }
.push-kinds { display: grid; gap: 6px; margin: 6px 0; }
.push-group { border: 1px solid var(--line); border-radius: 10px; margin: 0; padding: 6px 12px 10px; display: grid; gap: 8px; }
.push-group legend { font-size: 14px; font-weight: 700; padding: 0 6px; color: var(--ink); }
.push-kind { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.push-kind label.check { align-items: flex-start; flex: 1 1 220px; }
.push-kind label.check input { margin-top: 3px; flex: none; }
.push-kind small.fine { display: block; font-weight: 400; }
.push-scope { width: auto; margin-left: 28px; min-height: 36px; font-size: 14px; padding: 4px 8px; }
.push-quiet { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-left: 28px; }
.push-quiet label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.push-quiet input { width: auto; }
.push-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }

/* Texts */
.texts-layout { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; height: calc(100vh - 210px); min-height: 460px; }
.texts-layout .texts-list, .texts-layout .texts-thread { padding: 0; display: flex; flex-direction: column; overflow: hidden; max-width: none; margin: 0; gap: 0; }
.texts-list input { margin: 12px; width: auto; flex: none; height: auto; min-height: 40px; }
.conv-list { list-style: none; margin: 0; padding: 0 6px 8px; overflow-y: auto; flex: 1; }
.conv { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.conv:hover { background: var(--card-2); }
.conv.on { background: var(--blue-soft); }
.conv-main { flex: 1; min-width: 0; display: grid; }
.conv-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .conv-main b, .conv.unread .conv-main small { font-weight: 700; color: var(--ink); }
.conv-side { display: grid; justify-items: end; gap: 4px; }
.conv-side .count { margin: 0; }
.conv-empty { padding: 12px; }
.thread-empty { margin: auto; padding: 24px; text-align: center; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.th-name { flex: 1; min-width: 0; display: grid; }
.th-name b { font-size: 16px; }
.th-acts { display: flex; gap: 8px; }
.thread-back { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; background: var(--card-2); }
.msg-day { align-self: center; margin: 10px 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.msg { display: grid; max-width: min(78%, 560px); gap: 2px; }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; justify-items: end; }
.bubble { padding: 9px 13px; border-radius: 18px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble p { margin: 0; }
.bubble img { display: block; max-width: 240px; max-height: 320px; border-radius: 12px; margin-bottom: 4px; }
.msg.in .bubble { background: var(--card); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 6px; }
.msg.out .bubble { background: #1b5fa8; color: #fff; border-bottom-right-radius: 6px; }
.msg.out .bubble a { color: #fff; }
.msg small { font-size: 13px; }
.composer { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--card); }
.composer textarea { resize: none; min-height: 44px; max-height: 160px; }
.composer .btn { align-self: end; }
.composer .sms-count { grid-column: 1 / -1; margin: 0; }
.composer > .btn { grid-column: 3; }
.optout { margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--warn-soft); color: var(--warn); font-size: 14px; }
@media (max-width: 900px) {
  .texts-layout { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .texts-list .conv-list { max-height: none; }
  .msgs { max-height: 56vh; min-height: 240px; }
  .texts-layout.viewing .texts-list { display: none; }
  .texts-layout:not(.viewing) .texts-thread { display: none; }
  .thread-back { display: inline-grid; }
  .th-acts .btn span { display: none; }
}

.sms-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sms-add input { flex: 1 1 160px; }
#smsLines .setup-list li { align-items: center; }

/* Texts: filters, follow-up bar, team notes, composer modes, settings */
.text-filter { margin: 0 12px 8px; display: flex; }
.text-filter button { flex: 1; padding: 6px 4px; font-size: 13px; }
.conv-line { font-size: 13px; color: var(--muted); }
.thread-follow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--card); }
.thread-follow .fine { margin: 0; }
.msg.note { align-self: center; justify-items: center; max-width: min(86%, 600px); }
.msg.note .bubble { background: var(--warn-soft); color: var(--ink); border: 1px dashed var(--warn); border-radius: 12px; }
.msg.note .bubble b { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); margin-bottom: 2px; }
.composer-tabs { grid-column: 1; justify-self: start; }
.composer-tabs button { padding: 4px 12px; font-size: 13px; }
.composer.noting textarea { background: var(--warn-soft); }
.saved-pick { grid-column: 2 / -1; justify-self: end; }
.saved-pick select { min-height: 34px; padding: 4px 28px 4px 8px; font-size: 14px; width: auto; max-width: 220px; }
#textSettings { max-width: 760px; margin: 0 0 16px; }
#textSettings h3 { margin: 18px 0 4px; font-size: 16px; }
#tsetForm { display: grid; gap: 10px; }
.tset-reply { display: grid; grid-template-columns: 200px 1fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.tset-hours { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; }
.tset-hours legend { font-weight: 600; padding: 0 4px; }
.tset-hours label:not(.check) { display: flex; align-items: center; gap: 6px; }
/* A call queue's own hours (Call routing → the queue): days and times on one wrapping row. */
.q-hours { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 6px 0; }
.q-hours label:not(.check) { display: flex; align-items: center; gap: 6px; }
@media (max-width: 640px) { .tset-reply { grid-template-columns: 1fr; } }
.av-badge.k-text { background: var(--ok-soft); color: var(--ok); }
.composer > textarea { grid-column: 1 / 3; }
.composer > .optout { grid-column: 1 / -1; margin: 0 -12px -10px; }

/* Projection */
.proj-pick { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.proj-pick label { display: grid; gap: 4px; font-size: 14px; }
.proj-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 10px; }
.proj-head > div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; background: var(--card); }
.proj-head b { font-size: 24px; }
.proj-head .ok b { color: var(--ok); } .proj-head .bad b { color: var(--bad); }
.proj-table td.num, .proj-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.proj-table .proj-total td { font-weight: 700; border-top: 2px solid var(--line); }
.proj-notes { margin: 10px 0 0; padding-left: 18px; }
@media (max-width: 640px) { .proj-head { grid-template-columns: 1fr; } }

/* Texting: conversation topic, attachments */
.conv-main .conv-topic { color: var(--brand); font-weight: 600; }
.th-topic { display: inline-flex; align-items: center; gap: 4px; justify-self: start; max-width: 100%; margin-top: 2px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.th-topic span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-topic .ic { width: 13px; height: 13px; flex: none; }
.th-topic.empty { border-style: dashed; color: var(--muted); }
.th-topic:hover { border-color: var(--brand); }
.th-topic-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.th-topic-edit input { min-height: 44px; flex: 1 1 140px; }
.attach-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.attach-btn { cursor: pointer; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 6px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; max-width: 260px; }
.attach-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; }
.attach-chip .ic { width: 16px; height: 16px; flex: none; }
.attach-chip .linkish { font-size: 18px; line-height: 1; padding: 0 4px; text-decoration: none; }
.bubble video { display: block; max-width: 260px; border-radius: 12px; margin-bottom: 4px; }
.bubble audio { display: block; width: 240px; max-width: 100%; margin-bottom: 4px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; margin-bottom: 4px; border-radius: 10px; background: rgba(127,127,127,.15); color: inherit; font-size: 13px; text-decoration: none; }
.file-chip .ic { width: 16px; height: 16px; }

/* Inside Microsoft Teams: Teams already shows "Phones & Fax" above Connect, so Connect's own logo band goes.
   A thin bar in Teams' light/dark colors keeps the office, search and the account menu. */
body.in-teams .top { min-height: 48px; padding: 6px 16px; gap: 10px; background: var(--card); color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: none; flex-wrap: nowrap; }
body.in-teams .top .brand { display: none; }
body.in-teams .org-chip { background: transparent; border-color: transparent; color: var(--ink); padding: 4px 0; font-size: 14px; }
body.in-teams .org-label { color: var(--muted); }
body.in-teams .top-viewas { color: #1a1300; background: #f2b705; border-color: #d4a004; }
body.in-teams .org-chip .ic, body.in-teams .user-menu > summary > .ic { color: var(--muted); }
body.in-teams .top-search { color: var(--ink-2); background: var(--card-2); border-color: var(--line); }
body.in-teams .top-search:hover { background: var(--chip); }
body.in-teams .top-search kbd { background: var(--chip); color: var(--muted); }
body.in-teams .user { color: var(--ink-2); }
body.in-teams .user-text { display: grid; min-width: 0; }
body.in-teams .user-text #userName { color: var(--ink); }
body.in-teams .user-text small { color: var(--muted); }
body.in-teams .user .avatar { width: 30px; height: 30px; margin-right: 0; }
body.in-teams .org select, body.in-teams .org-chip select { background: var(--card-2); color: var(--ink); border: 1px solid var(--line); }
@media (max-width: 900px) {
  body.in-teams .top { flex-wrap: wrap; min-width: 0; }
  body.in-teams .org { order: 3; flex: 1 1 100%; min-width: 0; }
  body.in-teams .user-text { display: grid; }
  body.in-teams .user #userName { display: block; }
  body.in-teams .user-text #userName, body.in-teams .user-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }
}
@media (max-width: 760px) {
  body.in-teams .top { padding: 6px 12px; }
  body.in-teams .top-search { min-width: 44px; min-height: 44px; padding: 10px; margin-left: 0; }
  /* Office name stays on its own row (set at 900px). Putting it back inline made the bar wider than a phone. */
  body.in-teams .org-chip { max-width: 100%; overflow: hidden; }
  body.in-teams .org-chip #orgName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.in-teams .top-search span, body.in-teams .top-search kbd { display: none; }
}

/* Below a desktop window the account name and the Search label crowd out the office name. */
@media (max-width: 1100px) {
  .user-text, .org-label { display: none; }
  .top-search span, .top-search kbd { display: none; }
  .top-search { padding: 10px; min-width: 44px; }
}

/* Phones and tablets: logo and name, office, team, search and account all on one row (the office is shortened with
   … when long). Nothing is allowed to wrap the account button onto the left, which sent its menu off the screen. */
@media (max-width: 900px) {
  .top {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 6px;
    padding: 8px 10px;
    min-width: 0;
    max-width: 100%;
  }
  .top > .brand { grid-column: 1; grid-row: 1; min-width: max-content; }
  .top > .stage-badge { grid-column: 2; grid-row: 1; }
  .top > .org { grid-column: 3; grid-row: 1; order: 0; flex-basis: auto; margin: 0; min-width: 0; max-width: 100%; }
  .top > .top-viewas { grid-column: 3; grid-row: 1; justify-self: end; margin: 0; }
  .top > .team-menu { grid-column: 4; grid-row: 1; margin: 0; }
  .top > .top-search { grid-column: 5; grid-row: 1; margin: 0; }
  .top > .user-menu { grid-column: 6; grid-row: 1; margin: 0; }
  .top .user { margin-left: 0; }
  .top .org-chip { max-width: 100%; min-width: 0; overflow: hidden; }
  .top .org-chip #orgName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top .org-chip select, .top #orgName { min-width: 0; max-width: 100%; }
}
/* Freedom Tech staff switch offices from the header: on phones and small windows the switcher gets its own row
   instead of being squeezed to nothing beside the test-site badge. */
@media (max-width: 900px) {
  .top > .org:has(#orgPick:not([hidden])) { grid-column: 1 / -1; grid-row: 2; }
  .top > .org:has(#orgPick:not([hidden])) .org-chip { width: 100%; }
  .top > .org:has(#orgPick:not([hidden])) #orgPick { flex: 1; width: auto; max-width: none; }
}
@media (max-width: 430px) {
  .top { column-gap: 6px; padding: 6px 8px; }
  .top > .brand { gap: 6px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .brand .app-word { font-size: 10px; letter-spacing: .04em; padding: 2px 5px; }
  .top > .stage-badge { font-size: 13px; letter-spacing: .02em; padding: 2px 5px; }
  .team-sum { padding: 6px 8px; }
  .user-menu > summary { gap: 4px; padding: 2px 6px 2px 2px; }
  .top-search { min-width: 44px; min-height: 44px; padding: 10px; }
  /* Narrow phones: the avatar alone opens the account menu (the chevron beside it made the header 10px too wide
     with the test-site badge and team button). */
  .top .user > .ic:last-child { display: none; }
  .top .user-menu > summary { padding-right: 2px; }
}
/* Presence dots need about 50px. They fit from a large phone up; below that the logo and badges win. */
@media (max-width: 419px) {
  .team-dots { display: none; }
}
@media (max-width: 340px) {
  .top { column-gap: 4px; padding: 6px; }
  .top > .brand { gap: 4px; }
  .team-sum, .top > .top-search { min-width: 40px; min-height: 40px; padding: 8px; }
  .user-menu > summary > .ic { display: none; }
}

.as-link { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.link-status { display: flex; align-items: center; gap: 4px; margin: 2px 0 6px; font-size: 13px; opacity: .9; }
.link-status .ic { width: 14px; height: 14px; }
.msg.out .link-status { color: #fff; }
.msg.in .link-status, .msg.out .link-status:not(.opened) { opacity: .85; }

/* Office status on the dashboard: open (green), closed (gray), holiday (amber) */
.hours-line .hdot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.hours-line.open .hdot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.hours-line.holiday .hdot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.hours-line b { font-weight: 700; color: var(--ink); }
.hours-line.holiday b { color: var(--warn); }

/* Sidebar team: collapsed row of faces, "+N more", show/hide */
.st-more:hover { color: var(--ink); }
.st-more { display: block; margin: 2px 0 0 12px; font-size: 13px; color: var(--blue); }

/* Dashboard top: greeting with the office logo, actions, and a horizontal strip (status, weather, next holiday) */
.dash-hello { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dash-hello .dash-logo { max-height: 52px; max-width: 140px; object-fit: contain; }
.dash-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: -6px 0 18px; }
.dash-strip .hours-bar.quiet:not(.editing) { margin: 0; }
.dash-strip .hours-bar.editing, .dash-strip .hours-bar:not(.quiet) { flex: 1 1 100%; margin: 0; }
.strip-extra { display: contents; }
.strip-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.strip-chip b { color: var(--ink); font-weight: 700; }
.strip-chip .ic { width: 15px; height: 15px; color: var(--muted); }
.wx-i { font-size: 16px; line-height: 1; }
.wx-alerts { display: grid; gap: 8px; margin: -6px 0 18px; }
.wx-alert { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #f1b7b0; border-radius: 12px; background: var(--bad-soft); }
.wx-alert > div { flex: 1; display: grid; gap: 2px; min-width: 0; }
.wx-alert b { color: var(--bad); }
.wx-alert span { font-size: 13px; color: var(--ink-2); }
@media (max-width: 760px) {
  .dash-head { align-items: stretch; }
  .dash-head h1 { font-size: 22px; }
  .dash-hello .dash-logo { max-height: 40px; max-width: 96px; }
  .dash-actions { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
  .dash-actions .btn { justify-content: center; padding-left: 8px; padding-right: 8px; }
  .dash-strip { gap: 6px 16px; }
  /* The count cards: a compact 2 x 2 grid instead of four tall cards */
  .dash-cards[data-n] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-cards .dcard { padding: 12px; gap: 10px; }
  .dash-cards .dcard .qicon { width: 30px; height: 30px; }
  .dash-cards .dcard-body b { font-size: 22px; }
  .dash-cards .dcard-body span { font-size: 13px; }
}

.lbl-short { display: none; }
@media (max-width: 760px) {
  .dash-actions .lbl-long { display: none; }
  .dash-actions .lbl-short { display: inline; }
  .dash-cards .dcard { flex-direction: column; gap: 2px; }
  .dash-cards .dcard .qicon { display: none; }
  .dash-cards .dcard-body small { font-size: 13px; }
}

a.strip-chip { color: var(--muted); text-decoration: none; }
a.strip-chip:hover span { color: var(--ink); }
.wx-court { font-size: 13px; color: var(--bad); font-weight: 600; margin-top: 2px; }
/* Today's calls by hour */
.hbars { display: flex; align-items: flex-end; gap: 4px; height: 120px; margin-top: 6px; }
.hb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.hb-col { flex: 1; width: 100%; max-width: 26px; display: flex; flex-direction: column; justify-content: flex-end; }
.hb-stack { display: flex; flex-direction: column; border-radius: 4px 4px 2px 2px; overflow: hidden; min-height: 0; }
.hb-stack > span { display: block; min-height: 3px; }
.hb small { font-size: 13px; color: var(--muted); }
.hb.now small { color: var(--ink); font-weight: 700; }
.hb-in { background: var(--ok); } .hb-miss { background: var(--bad); } .hb-out { background: var(--blue); }
.hb-key { display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.hb-key span { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: -6px; }

/* Photos in avatars (coworkers' Microsoft 365 photos), over the initials */
.av { position: relative; overflow: visible; }
.av .av-img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.av .av-dot, .av .av-badge { z-index: 1; }

/* Next holiday: "Open or closed?" for admins, then the answer with Change */
.strip-chip.hol { flex-wrap: wrap; }
.hol-ask { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; color: var(--ink); font-weight: 600; }
.hol-ask .chip-btn { padding: 2px 10px; }
.hol-plan { border-radius: 999px; padding: 1px 9px; background: var(--warn-soft); color: var(--ink); font-weight: 600; }
.hol-plan.open { background: var(--ok-soft); }
.strip-chip.hol .linkish { font-size: 13px; }

/* Fax pages drawn with pdf.js (Teams has no built-in PDF viewer) */
.pv-pages { overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px; }
.pv-pages .pv-page { width: 100%; max-width: 1100px; height: auto; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.pv-pages .fine { color: #e5e7eb; }
.pv-pages .fine a { color: #fff; }

/* AI calls: hot leads stay visually first */
.voice-msgs, .voice-calls { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.voice-msgs li, .voice-calls li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.voice-msgs li.hot { border-color: var(--bad); box-shadow: inset 4px 0 0 var(--bad); }
.voice-admin { margin-top: 22px; display: grid; gap: 14px; }
.voice-admin form, .voice-admin .card { display: grid; gap: 8px; }
.voice-admin label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.voice-admin input, .voice-admin select, .voice-admin textarea { font: inherit; color: var(--ink); padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.voice-admin .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }

/* To do: one person's assigned items */
.todo-who { margin-left: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; max-width: 220px; }
@media (max-width: 640px) { .todo-who { margin: 8px 0 0; max-width: none; width: 100%; } }

/* Alerts (alerts.js): the banner on every page, the alert buttons, bells */
.alert-banner { display: flex; align-items: center; gap: 12px; flex: none; margin: 12px 24px 0; padding: 12px 16px; border-radius: 12px; background: var(--bad); color: #fff; box-shadow: var(--shadow); }
.alert-banner .ic { width: 26px; height: 26px; flex: none; }
.alert-banner > div { flex: 1; min-width: 0; }
.alert-banner span { opacity: .92; font-size: 14px; }
.alert-banner .btn { background: #fff; color: var(--ink); border-color: #fff; }
.alert-banner.k-evacuate { background: #b45309; }
.alert-banner.k-shelter { background: #1d4ed8; }
.alerts-body { display: grid; gap: 18px; }
.alerts-body > .card { width: 100%; }
/* While an alert is on, the banner sits above whichever page is open and the page takes the rest of the height. */
body.alert-on .main { display: flex; flex-direction: column; }
body.alert-on .main > section, body.status-on .main > section { flex: 1 1 auto; min-height: 0; height: auto; }
@media (max-width: 900px) { .alert-banner { margin: 10px 16px 0; } }
.alerts-body h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.alerts-body .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.alert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.alert-btn { display: grid; gap: 6px; text-align: left; padding: 16px; min-height: 110px; border-radius: 12px; border: 0; color: #fff; font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; }
.alert-btn small { align-self: start; color: inherit; font-size: 14px; font-weight: 400; opacity: .95; }
.alert-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.k-lockdown.alert-btn { background: #b91c1c; }   /* fixed shades: white text stays readable in dark mode too */
.k-evacuate.alert-btn { background: #b45309; }
.k-shelter.alert-btn { background: #1d4ed8; }
.k-clear.alert-btn { background: #15803d; }
.alert-confirm { border: 2px solid var(--bad); border-radius: 12px; padding: 14px 16px; background: var(--bad-soft); color: var(--ink); }
.alert-confirm p { margin: 0 0 10px; }
.alert-now { border-left: 6px solid var(--bad) !important; }
.alert-now.k-evacuate { border-left-color: #b45309 !important; }
.alert-now.k-shelter { border-left-color: #1d4ed8 !important; }
.alert-now p { margin: 0; }
.chip.k-lockdown, .chip.k-panic { background: var(--bad-soft); color: var(--bad); }
.chip.k-evacuate { background: var(--warn-soft); color: var(--warn); }
.chip.k-shelter { background: var(--blue-soft); color: var(--blue); }
.chip.k-clear { background: var(--ok-soft); color: var(--ok); }
.alert-custom, .page-now, .tpl, .bell-form { display: grid; gap: 10px; }
.alerts-body label { display: grid; gap: 6px; }
.alerts-body label.check { display: flex; gap: 6px; align-items: center; }
.alerts-body .row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.alerts-body fieldset.days { display: flex; flex-wrap: wrap; gap: 6px 14px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0; }
.bell-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bell-list > li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); }
.bell-list > li small { flex-basis: 100%; color: var(--muted); }
.bell-list > li .btn { margin-left: auto; }
.bell-list > li.off { opacity: .6; }
.pause-row { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.bell-list > li small { order: 2; }
.screen-form { display: grid; gap: 10px; }
.screen-form label { display: grid; gap: 6px; }
.screen-form label.check { display: flex; gap: 8px; align-items: center; }
.screen-form .fine { margin: -4px 0 0; }
.hold-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.hold-form label { display: grid; gap: 6px; }
.hold-form .actions { grid-column: 1 / -1; }
.hold-form input, .hold-form select { width: 100%; min-width: 0; }
.wall-link { display: flex; gap: 8px; align-items: center; margin: 0; }
.wall-link input { flex: 1; min-width: 0; }
.screen-form .row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.screen-form textarea[readonly] { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

/* Service status (src/status.js): the banner, and staff notices on the Overview */
.status-banner { display: flex; align-items: center; gap: 12px; flex: none; margin: 12px 24px 0; padding: 10px 16px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); border: 1px solid currentColor; }
.status-banner.down { background: var(--bad-soft); color: var(--bad); }
.status-banner.maintenance { background: var(--blue-soft); color: var(--blue); }
.status-banner span { flex: 1; }
.status-banner a { color: inherit; font-weight: 600; white-space: nowrap; }
@media (max-width: 900px) { .status-banner { margin: 10px 16px 0; } }
.ft-status { margin: 0 0 18px; display: grid; gap: 12px; }
.ft-status h2 { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.notice-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.notice-form label { display: grid; gap: 4px; }
.notice-form .wide, .notice-form .actions { grid-column: 1 / -1; }
body.status-on .main { display: flex; flex-direction: column; }
.fleet-body { display: grid; gap: 18px; }
.fleet-body .card { max-width: none; width: 100%; }
.fleet-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.fleet-tools label { display: grid; gap: 4px; }
.fw-target { display: flex; gap: 6px; }
.fw-target input { width: 130px; }
.fleet-body tr.off td { color: var(--muted); }
.chip.ok, .fleet-body .chip { margin: 2px 2px 2px 0; }
.consent { max-width: 520px; text-align: left; }
.consent .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* How calls are answered */
.flow-numbers p { margin: 0 0 14px; line-height: 1.7; }
.flow-cards { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.flow-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; transition: box-shadow .3s; }
.flow-card.flash { box-shadow: 0 0 0 3px var(--blue-soft); }
.flow-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.flow-head small { display: block; color: var(--muted); font-size: 13px; }
.flow-step { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--ink); font-weight: 700; font-size: 14px; }
.flow-card ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.flow-edit { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.flow-edit small { color: var(--muted); }

/* Teams meeting box */
.meet-row { display: flex; gap: 10px; }
.meet-row label { flex: 1; }
.meet-link { width: 100%; font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); margin: 6px 0 10px; }
.meet-done .actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Branded caller ID (staff) */
.brand-form { margin: 10px 0 14px; display: grid; gap: 8px; }
.brand-form h3 { margin: 4px 0 0; font-size: 15px; }
.brand-grid { display: grid; gap: 8px 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.brand-grid label, .brand-form > label { display: grid; gap: 3px; font-size: 13px; }
.brand-logo { border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* Call recording */
.cd-rec { margin: 10px 0; display: grid; gap: 6px; }
.cd-rec b { color: #dc2626; font-size: 13px; }
.call-bar .rec-on { color: #fff; background: #dc2626; border-color: #dc2626; }
.sum-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--card); font-size: 14px; }
.sum-box p { margin: 4px 0 8px; }
.sum-actions { margin: 4px 0 6px; padding-left: 18px; display: grid; gap: 6px; }
.sum-actions li span { margin-right: 8px; }
.sum-actions select { font: inherit; font-size: 13px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.sum-transcript { white-space: pre-wrap; max-height: 260px; overflow: auto; }

/* Softphone call panel */
.soft-call { position: fixed; right: 18px; bottom: 18px; z-index: 120; width: min(340px, calc(100vw - 32px)); background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,.25); padding: 14px; display: grid; gap: 10px; }
.soft-call .sc-who { display: flex; gap: 10px; align-items: center; }
.soft-call .sc-who small { display: block; color: var(--muted); font-size: 13px; }
.soft-call .sc-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.soft-call .sc-answer { background: #16a34a; border-color: #16a34a; color: #fff; flex: 1; }
.soft-call .sc-hang { background: #dc2626; border-color: #dc2626; color: #fff; }
.soft-call .btn.on { background: var(--blue-soft); }
.soft-call .sc-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.soft-call .sc-keys button { padding: 10px 0; font-size: 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); cursor: pointer; }
.soft-call .sc-keys small { grid-column: 1 / -1; text-align: center; color: var(--muted); min-height: 1em; }
.soft-call .sc-xfer { display: flex; gap: 6px; }
.soft-call .sc-xfer input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
@media (max-width: 760px) { .soft-call { left: 16px; right: 16px; bottom: 76px; width: auto; } }
.soft-status { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.soft-status.ready .hdot { background: var(--ok); }
.soft-status.connecting .hdot { background: var(--warn); }
.soft-status.error .hdot { background: #dc2626; }

/* About Connect */
.about-box { max-width: 460px; height: auto; margin: 10vh auto 0; }
.about-box .about-list, .about-box > .fine { padding: 0 22px; }
.about-box > .fine { margin: 0 0 20px; }
.about-box h2 { display: flex; align-items: center; gap: 10px; }
.about-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 12px 0; font-size: 15px; }
.about-list dt { color: var(--muted); }
.about-list dd { margin: 0; text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }

/* ==== UI refresh (2026-10-30): light, with Freedom Tech navy for actions and red for the brand and for what needs
   attention. One set of tokens; the shell (sidebar, buttons) and the dashboard use them. ==== */
:root { --primary: #13294a; --primary-hover: #0a1a2e; --primary-soft: #e9eef6; --primary-ink: #13294a; --radius: 12px; --shadow-sm: 0 1px 2px rgba(10, 26, 46, .05); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --primary: #3d6db3; --primary-hover: #4d7ec4; --primary-soft: #16294a; --primary-ink: #c9dcff; --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); } }
:root[data-theme="dark"] { --primary: #3d6db3; --primary-hover: #4d7ec4; --primary-soft: #16294a; --primary-ink: #c9dcff; --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); }

/* Buttons: navy is "do this"; red stays for the brand and for problems. */
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn { border-radius: 10px; font-weight: 600; }

/* Sidebar: the current page has a navy tint and a red marker; section names are quieter. */
@media (min-width: 901px) { .side { padding: 16px 12px; gap: 2px; } }   /* phones keep the sheet's own padding (room above the tab bar) */
.side .send-btn { margin-bottom: 16px; }
.nav { border-radius: 10px; min-height: 40px; }
.nav.on { background: var(--primary-soft); color: var(--primary-ink); box-shadow: inset 3px 0 0 var(--red); }
.nav.on .ic { color: var(--primary-ink); }
.nav-head { margin: 16px 12px 4px; font-size: 13px; letter-spacing: .08em; color: var(--muted); opacity: .85; }

/* Dashboard heading */
.dash-head { align-items: center; margin-bottom: 16px; }
.dash-head h1 { font-size: 28px; letter-spacing: -.02em; }
@media (min-width: 901px) { .dash-actions .dash-call { display: none; } }   /* the sidebar's Make a call is right there */

/* The status line becomes tiles: office status, weather, next holiday, who's out. */
.dash-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 0 0 18px; }
.dash-strip > .hours-bar.quiet:not(.editing), .dash-strip .strip-chip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 54px; margin: 0;
  padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); font-size: 14px; color: var(--ink-2); }
.dash-strip .hours-bar.quiet .hours-line { font-size: 14px; flex-wrap: wrap; }
.dash-strip .hours-bar.editing, .dash-strip .hours-bar:not(.quiet) { grid-column: 1 / -1; }
.dash-strip .strip-chip .ic { width: 17px; height: 17px; }
.dash-strip a.strip-chip:hover { border-color: var(--line-strong); }
.dash-strip .hol-ask { margin-left: 0; }

/* Cards: white, one pattern; anything that needs attention gets a red edge and a red number instead of a pink fill. */
.dcard { border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; }
.dcard.hot { background: var(--card); border-color: var(--line); box-shadow: inset 4px 0 0 var(--red), var(--shadow-sm); }
.dcard.hot .dcard-body b { color: var(--bad); }
.dcard.hot .qicon { background: var(--bad-soft); color: var(--bad); }
.dcard-body small { font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.dcard-body b { font-size: 28px; letter-spacing: -.02em; }
.dcard-body b.dcard-word { font-size: 19px; line-height: 1.3; margin: 4px 0 2px; }

/* Panels on the dashboard share the card look. */
.dpanel { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.dash-strip > *, .dash-strip .strip-chip { align-self: stretch; }

/* Header: Freedom Tech's client picker and View as… are one pill; the test-site tag is small. */
.org-label { display: none; }
.org-chip { gap: 10px; padding: 4px 6px 4px 10px; }
.chip-viewas { margin-left: 2px; padding: 5px 11px; border-radius: 999px; border: 0; background: rgba(242, 183, 5, .16); color: #ffd666; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip-viewas:hover { background: rgba(242, 183, 5, .26); }
.top .stage-badge { font-size: 13px; padding: 2px 7px; border-radius: 5px; }
@media (max-width: 900px) { .chip-viewas { display: none; } }   /* phones: View as… is in the name menu */

/* Sidebar "More" */
.nav-more { margin-top: 10px; }
.nav-more > summary { list-style: none; cursor: pointer; color: var(--muted); }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary .ic { transform: rotate(-90deg); transition: transform .15s; }
.nav-more[open] > summary .ic { transform: none; }
.nav-more > .nav { padding-left: 22px; }

/* Office status: "· opens Mon 8:00 AM" inline elsewhere; in the dashboard tile the status and Change share the first
   line and the time is the second. */
.hl-sub::before { content: "· "; }
.dash-strip .hours-line { width: 100%; }
.dash-strip .hours-line .linkish { order: 2; margin-left: auto; }
.dash-strip .hours-line .hl-sub { order: 3; flex-basis: 100%; padding-left: 15px; color: var(--muted); font-size: 13px; }
.dash-strip .hours-line .hl-sub::before { content: none; }

/* Pages (Calls, Voicemail, Team, To do, Texts): the same card, filter and heading look as the dashboard. */
.page-head { align-items: center; }
.page-head h1 { font-size: 26px; letter-spacing: -.02em; }
.vm, .member, .todo-item, .table-wrap, .card, .empty-card { border-radius: var(--radius); }
.vm, .member, .todo-item, .table-wrap, .card { box-shadow: var(--shadow-sm); }
.seg { border-radius: 10px; box-shadow: var(--shadow-sm); }
.seg button[aria-checked="true"] { background: var(--primary); color: #fff; }
.seg button[aria-checked="true"] .seg-n { background: #fff; color: var(--primary); }
.calls thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.member:hover, .todo-item:hover, .vm:hover { border-color: var(--line-strong); }

/* Front desk (receptionist console) */
.con-live { display: flex; align-items: center; gap: 6px; margin: 0; }
.con-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.con-live.stale::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.con-grid { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2.4fr) minmax(200px, .9fr); gap: 16px; align-items: start; }
.con-col h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.con-calls, .con-park, .con-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.con-people { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.con-call { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.con-call[draggable] { cursor: grab; }
.con-call div { min-width: 0; }
.con-call b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.con-call small { font-size: 13px; }
.con-call.ringing { box-shadow: inset 4px 0 0 var(--red), var(--shadow-sm); animation: conRing 1.6s ease-in-out infinite; }
@keyframes conRing { 50% { background: var(--bad-soft); } }
@media (prefers-reduced-motion: reduce) { .con-call.ringing { animation: none; } }
.con-call.picked { outline: 3px solid var(--primary); outline-offset: 1px; }
.con-call.dragging { opacity: .5; }
.con-call .slot { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; }
.con-person { display: grid; gap: 6px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.con-person .cp-top { display: flex; gap: 10px; align-items: center; }
.con-person .cp-top small { display: block; font-size: 13px; }
.con-person .cp-st { margin: 0; font-size: 13px; color: var(--ink-2); }
.con-person.busy { border-color: #f1b3b8; }
.con-person.ring { border-color: var(--warn); }
.con-person.off { opacity: .65; }
.con-person .cp-vm { justify-self: start; min-height: 32px; }
.con-drop { padding: 16px; border: 2px dashed var(--line-strong); border-radius: var(--radius); text-align: center; color: var(--muted); font-size: 13px; }
.con-picking #console [data-to], #console [data-to].over { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); cursor: pointer; }
@media (max-width: 1100px) { .con-grid { grid-template-columns: 1fr; } }

/* Settings: a grouped menu on the left, one setting on the right. */
.set-layout { display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: 24px; align-items: start; }
.set-menu.tabs { display: flex; flex-direction: column; gap: 2px; border: 0; margin: 0; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); position: sticky; top: 0; flex-wrap: nowrap; overflow-y: auto; overflow-x: hidden; max-height: calc(100dvh - var(--top-h, 64px) - 32px); overscroll-behavior: contain; }
.set-menu .set-group { margin: 12px 10px 4px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.set-menu .set-group:first-child { margin-top: 4px; }
.set-menu .tab { display: block; margin: 0; padding: 8px 10px; border: 0; border-radius: 8px; color: var(--ink-2); font-weight: 500; text-decoration: none; white-space: normal; }
.set-menu .tab:hover { background: var(--bg); }
.set-menu .tab.on { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--red); }
.set-body > .tab-panel > .card, .set-body > .tab-panel > form.card, .set-body .narrow-card { max-width: 760px; margin-left: 0; }
@media (max-width: 900px) {
  .set-layout { grid-template-columns: 1fr; gap: 12px; }
  .set-menu.tabs { flex-direction: row; overflow-x: auto; position: static; padding: 6px; max-height: none; }
  .set-menu .set-group { display: none; }
  .set-menu .tab { white-space: nowrap; }
}

/* Forms inside a settings card: one field per row with room between them. */
.stack-form { display: grid; gap: 16px; }
.stack-form > label:not(.check) { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.stack-form > label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.stack-form > label.check input { margin-top: 3px; }
.stack-form .staff-only { padding: 10px 12px; border-radius: 10px; background: #fff7d6; border: 1px solid #f2d47a; color: #5c4400; }
:root[data-theme="dark"] .stack-form .staff-only { background: #33260b; border-color: #6b5313; color: #f2d47a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stack-form .staff-only { background: #33260b; border-color: #6b5313; color: #f2d47a; } }
.stack-form > .actions { margin-top: 4px; }

/* Freedom Tech: client cards and the client page */
.client-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 18px; }
.ccard { display: grid; gap: 12px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.ccard.current { box-shadow: inset 4px 0 0 var(--primary), var(--shadow-sm); }
.ccard header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ccard header .client-link { font-size: 17px; font-weight: 700; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.ccard header .client-link:hover { text-decoration: underline; }
.ccard-health { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.ccard-health i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.ccard.warn .ccard-health i { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.ccard.off .ccard-health i { background: var(--muted); box-shadow: none; }
.ccard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.ccard-stats small { display: block; font-size: 13px; color: var(--muted); }
.ccard-stats b { font-size: 18px; }
.ccard footer { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-usage, #newClientBox { margin-bottom: 14px; }
.admin-usage > summary, #newClientBox > summary, .cd-sec > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.admin-usage > summary::-webkit-details-marker, #newClientBox > summary::-webkit-details-marker, .cd-sec > summary::-webkit-details-marker { display: none; }
.admin-usage > summary::before, #newClientBox > summary::before, .cd-sec > summary::before { content: "›"; display: inline-block; width: 12px; color: var(--muted); transition: transform .15s; }
.admin-usage[open] > summary::before, #newClientBox[open] > summary::before, .cd-sec[open] > summary::before { transform: rotate(90deg); }
.admin-usage[open] > summary, #newClientBox[open] > summary { margin-bottom: 12px; }
.client-page { display: grid; gap: 12px; max-width: 900px; }
.client-page form#editClient { display: grid; gap: 12px; }
.cd-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px 18px; display: grid; gap: 10px; }
.cd-sec > summary b { font-size: 16px; }
.cd-sec > summary small { font-size: 13px; }
.cd-sec[open] > summary { margin-bottom: 4px; }
.cd-sec > label:not(.check), .cd-sec .billing label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.cd-sec .billing { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.cd-sec h3 { margin: 10px 0 0; font-size: 15px; }
.cd-sec .staff-switch { padding: 10px 12px; border-radius: 10px; background: #fff7d6; border: 1px solid #f2d47a; color: #5c4400; display: flex; gap: 10px; }
.admin-usage, #newClientBox { max-width: none; width: 100%; margin-left: 0; margin-right: 0; }
.ccard-stats { grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); }
.ccard-stats b { font-size: 17px; white-space: nowrap; }

/* ==== Polish pass (2026-10-30): type, header, fields, buttons, empty states and motion ==== */
body { font-feature-settings: "cv11", "ss01", "ss03"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
.dcard-body b, .ccard-stats b, .ucard b, .con-call small, .about-list dd, .dash-strip b { font-variant-numeric: tabular-nums; }
h1, h2, h3 { color: var(--ink); }

/* Header: solid navy and a wordmark instead of a badge. */
.top { background: var(--navy); border-bottom: 1px solid rgba(255, 255, 255, .06); box-shadow: none; }
.brand .app-word { background: none; color: #ff7c86; font-size: 18px; font-weight: 600; letter-spacing: -.01em; text-transform: none; padding: 0; border-radius: 0; }
.top .stage-badge { background: transparent; border: 1px solid rgba(242, 183, 5, .55); color: #ffd666; }
.org-chip { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }

/* Fields: sized to what they hold, one look everywhere in the page. */
.main input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), .main select, .main textarea, .modal input:not([type=checkbox]):not([type=radio]), .modal select, .modal textarea {
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.main input:focus-visible, .main select:focus-visible, .main textarea:focus-visible, .modal input:focus-visible, .modal select:focus-visible, .modal textarea:focus-visible {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.narrow-card input:not([type=checkbox]):not([type=radio]):not([type=range]), .narrow-card select, .narrow-card textarea, .cd-sec input:not([type=checkbox]), .cd-sec select { max-width: 460px; }
.narrow-card input[maxlength="2"], .cd-sec input[maxlength="2"] { max-width: 7ch; }
.narrow-card > p.fine, .stack-form > p.fine, .cd-sec > p.fine, .page-head .sub { max-width: 72ch; }

/* Buttons: smaller on desktop with a mouse (phones keep the large touch size), a gentle press. */
.btn { transition: background .15s, border-color .15s, box-shadow .15s, transform .06s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:not(.primary):not(.ghost):not(.sc-answer):not(.sc-hang) { box-shadow: var(--shadow-sm); }
@media (min-width: 901px) and (pointer: fine) { .btn.small { min-height: 34px; padding: 6px 12px; } .btn { min-height: 38px; } }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Empty states: an icon and a calm panel instead of a dashed box. */
.empty-card { border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-sm); padding: 28px 20px; display: grid; justify-items: center; gap: 10px; font-size: 14px; }
.empty-card::before { content: ""; width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7f99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 20px no-repeat; }

/* Can't load (the phone system didn't answer): a warning sign instead of the check. */
.empty-card.offline { color: var(--warn); }
.empty-card.offline::before { background: var(--warn-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a5300' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9L2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E") center / 20px no-repeat; }
.cmp-empty::before { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .empty-card.offline::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f2bd57' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9L2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E"); } }
:root[data-theme="dark"] .empty-card.offline::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f2bd57' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9L2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E"); }

/* Weather and status tiles use line icons. */
.wx-i .ic { width: 20px; height: 20px; color: var(--primary-ink); }
.wx-i.wx-warn .ic { color: var(--warn); }
.dash-strip .strip-chip .wx-i { display: inline-grid; place-items: center; }

/* Cards lift a little under the mouse. */
@media (pointer: fine) { .dcard, .ccard, .con-person, .member { transition: transform .15s, box-shadow .15s, border-color .15s; }
  a.dcard:hover, .ccard:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(10, 26, 46, .06), 0 10px 24px rgba(10, 26, 46, .08); } }

/* Motion: pages, dialogs, menus and folding sections ease in (off for people who prefer less motion). */
@media (prefers-reduced-motion: no-preference) {
  .page:not([hidden]) { animation: ftPageIn .18s ease-out; }
  .modal:not([hidden]) .modal-box, .soft-call { animation: ftPopIn .16s ease-out; }
  .menu[open] .menu-list, .menu[open] .team-pop { animation: ftPopIn .12s ease-out; transform-origin: top right; }
  details[open] > :not(summary) { animation: ftFade .16s ease-out; }
  @keyframes ftPageIn { from { opacity: 0; transform: translateY(4px); } }
  @keyframes ftPopIn { from { opacity: 0; transform: scale(.98); } }
  @keyframes ftFade { from { opacity: 0; } }
}
.main .narrow-card input[maxlength="2"], .main .cd-sec input[maxlength="2"] { max-width: 8ch !important; }
.narrow-card select, .cd-sec select { max-width: 560px; }

/* Support codes */
.verify-box { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 10px 24px; align-items: center; margin-bottom: 16px; }
.verify-box h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: 16px; }
.verify-row { display: flex; gap: 8px; }
.verify-row input { font-size: 20px; letter-spacing: .12em; text-align: center; max-width: 180px; font-variant-numeric: tabular-nums; }
.verify-out { grid-column: 1 / -1; display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.verify-out.ok { background: var(--ok-soft); color: var(--ink); }
.verify-out.ok b { color: var(--ok); display: flex; align-items: center; gap: 6px; }
.verify-out.bad { background: var(--bad-soft); color: var(--bad); }
.code-digits { margin: 18px 22px 6px; font-size: 44px; font-weight: 700; letter-spacing: .14em; text-align: center; font-variant-numeric: tabular-nums; color: var(--primary-ink); }
@media (max-width: 760px) { .verify-box { grid-template-columns: 1fr; } }

/* Phones: in the More sheet, everything is listed (no extra More fold), and the sheet scrolls to its last item. */
@media (max-width: 900px) {
  .nav-more { margin-top: 4px; }
  .nav-more > summary { display: none; }
  .nav-more > .nav { padding-left: 12px; }
  .side { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
}

/* ===== Phone layer (iPhone app audit, 2026-10-31) =====
   Last in the file on purpose: these settle conflicts between older phone rules. */

/* Taps: no grey browser flash; a quick dim instead. Hover looks only for a real mouse (on touch they stuck). */
* { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  .nav:hover, .set-menu .tab:hover { background: transparent; }
  .nav.on:hover { background: var(--primary-soft); }
  .set-menu .tab.on:hover { background: var(--primary-soft); }
  .nav:hover .ic { color: inherit; }
  .menu-list > button:hover, .menu-list > a:hover { background: transparent; }
  .btn:hover { border-color: var(--line); }
  .qcard:hover { transform: none; box-shadow: var(--shadow-sm); }
  .member:hover, .todo-item:hover, .vm:hover { border-color: var(--line); }
  .btn:active, .nav:active, .tabbar > a:active, .tabbar > button:active, .menu-list > a:active, .menu-list > button:active, .set-menu .tab:active, .qcard:active { opacity: .55; }
}

/* In the iPhone app the navy header runs up behind the clock (the app sets viewport-fit=cover). */
html.in-app .top { padding-top: calc(8px + env(safe-area-inset-top)); }
/* Pages scroll under the clock; a navy strip stays behind it so the white status bar is always readable. */
html.in-app body::before { content: ""; position: fixed; z-index: 90; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--top-bg, var(--navy)); pointer-events: none; }
html.in-app .modal-box { margin-top: env(safe-area-inset-top); }
/* The full-screen dialer: a navy strip behind the clock (the status bar stays white for the navy header). */
html.in-app .dialer-box { margin-top: 0; padding-top: calc(16px + env(safe-area-inset-top)); }
html.in-app #dialer:not([hidden])::before { content: ""; position: fixed; z-index: 2; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--navy); }

/* Dial pad: phones and touch screens only. */
.dialpad { display: none; }
@media (max-width: 900px), (pointer: coarse) {
  .dialpad { display: grid; grid-template-columns: repeat(3, 72px); justify-content: center; gap: 14px 28px; margin: 18px 0 8px; }
  .dialpad button { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--chip); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; font: inherit; cursor: pointer; }
  .dialpad button b { font-size: 28px; font-weight: 500; line-height: 1.1; }
  .dialpad button small { min-height: 13px; font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
  .dialpad button:active { background: var(--line-strong); }
  .dialpad .dp-del { grid-column: 3; background: none; }
  .dialpad .dp-del .ic { width: 26px; height: 26px; }
}

@media (max-width: 900px) {
  /* More sheet: Home, Calls and Voicemail already have tabs; the last group gets a heading. */
  .side .nav[data-box="dashboard"] { display: none; }
  body.tab-calls .side .nav[data-box="calls"], body.tab-vm .side .nav[data-box="voicemail"] { display: none; }
  .side .nav-more > summary { display: none; }
  .side .nav-more-head { display: block; }

  /* Settings: a grouped list like the iPhone's Settings app, then one setting per screen with a back link. */
  #settings.set-index .set-body, #settings:not(.set-index) .set-menu, #settings:not(.set-index) .page-head { display: none; }
  .set-back { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 10px -4px; min-height: 44px; color: var(--blue); font-weight: 600; text-decoration: none; }
  .set-back .ic { width: 22px; height: 22px; }
  .set-menu.tabs { flex-direction: column; flex-wrap: nowrap; overflow: visible; padding: 4px 0; gap: 0; }
  .set-menu .set-group { display: block; margin: 16px 16px 6px; }
  .set-menu .set-group[hidden] { display: none; }
  .set-menu .tab { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; border-radius: 0; border-top: 1px solid var(--line); white-space: normal; color: var(--ink); }
  .set-menu .set-group + .tab { border-top: 0; }
  .set-menu .tab::after { content: "›"; font-size: 22px; line-height: 1; color: var(--muted); }
  .set-menu .tab[data-tab="flow"]::after { content: none; }   /* opens its own page; it already shows ↗ */
  .set-menu .tab[hidden] { display: none; }
  #settings.set-index .set-menu .tab.on { background: none; box-shadow: none; color: var(--ink); font-weight: 500; }
}
@media (min-width: 901px) { .set-back, .side .nav-more-head { display: none; } }

@media (max-width: 700px) {
  /* Calls: search on its own row, the two buttons share the next (the Home page's grid rule squeezed them). */
  #calls .dash-actions { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row; }
  #calls #callSearch { grid-column: 1 / -1; width: 100%; max-width: none; box-sizing: border-box; }
  #calls .dash-actions .btn { justify-content: center; white-space: nowrap; }
  /* The six filters as two even rows of three, all visible. */
  .seg.call-filter { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; gap: 1px; background: var(--line); overflow: hidden; }
  .seg.call-filter button { background: var(--card); border-left: 0; padding: 10px 4px; text-align: center; }
  .seg.call-filter button[aria-checked="true"] { background: var(--primary); color: #fff; }

  /* Activity log: filters two to a row, and each entry as a small card instead of a wide table. */
  .audit-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .audit-filters .audit-date { min-width: 0; }
  .audit-filters input[type="date"] { min-width: 0; -webkit-appearance: none; appearance: none; background: var(--card); text-align: left; }
  .audit-filters > label:not(.audit-date), .audit-filters .audit-btns, .audit-date-hint { grid-column: 1 / -1; }
  .audit-filters select, .audit-filters input { width: 100%; box-sizing: border-box; min-height: 44px; }
  .audit-filters .audit-btns .btn { width: 100%; justify-content: center; min-height: 44px; }
  .audit-date-hint { margin: -4px 0 0; }
  #activity .table-wrap { background: none; border: 0; box-shadow: none; overflow: visible; }
  #activity table, #activity tbody { display: block; }
  #activity thead { display: none; }
  #activity tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; margin-bottom: 8px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
  #activity tbody td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  #activity tbody td:nth-child(1) { grid-column: 2; grid-row: 1; font-size: 13px; color: var(--muted); white-space: nowrap; }
  #activity tbody td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-size: 13px; color: var(--ink-2); }
  #activity tbody td:nth-child(3) { grid-column: 1; grid-row: 1; font-weight: 600; }
  #activity tbody td:nth-child(4) { grid-column: 1 / -1; font-size: 13px; }
  #activity tbody td:nth-child(4):empty { display: none; }
  #activity tbody td[colspan] { grid-column: 1 / -1; }
}
.audit-date-hint { display: none; }
@media (max-width: 700px) { .audit-date-hint { display: block; } }
/* Sign-in in the app: the navy fills the whole screen, down past the home bar. */
html.in-app .signin { min-height: 100dvh; box-sizing: border-box; padding-top: calc(24px + env(safe-area-inset-top)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
html.in-app:has(#signin:not([hidden])), html.in-app body:has(#signin:not([hidden])) { background: var(--navy); }

/* In the iPhone app: the call is full screen; Connect shows a green bar that brings it back. */
.soft-call.sc-bar { padding: 0; background: #16a34a; border: 0; }
.soft-call.sc-bar .sc-back { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px; border: 0; background: none; color: #fff; font: inherit; text-align: left; cursor: pointer; }
.soft-call.sc-bar .sc-back .ic { width: 22px; height: 22px; flex: none; }
.soft-call.sc-bar .sc-back span { display: grid; }
.soft-call.sc-bar .sc-back small { color: rgba(255,255,255,.85); font-size: 13px; }

/* Settings -> Phone -> What callers ask (learning.js) */
.learned-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.learned-list .learned { border: 1px solid var(--line, #ddd); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.learned-list .learned label { display: grid; gap: 4px; }
.learned-list .learned input, .learned-list .learned textarea { width: 100%; }
.learned-list .learned.approved { border-left: 4px solid #2e8b57; }
.learned-list .learned.dismissed { opacity: 0.6; }
.guide-form label { display: grid; gap: 4px; }
.guide-form input, .guide-form textarea { width: 100%; }
.guide-status { font-weight: 600; }

/* Settings → Apps: coming soon list */
.soon-group { font-size: 14px; margin: 16px 0 6px; }
.soon-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.soon-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.soon-list .chip { margin: 0; padding: 2px 9px; font-size: 13px; white-space: nowrap; }

/* Settings → Phone → Call screening */
#screenForm fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 0 0 12px; }
#screenForm legend { font-weight: 600; padding: 0 6px; }
#screenForm .check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
#screenForm .check small { font-size: 13px; }
.day-picks, .ai-kinds { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.scr-hours { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; margin-top: 6px; }
.scr-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; }
.scr-people label { display: flex; flex-direction: column; gap: 4px; }

/* Settings → Phone → Sounds & greetings */
.sound-list { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; gap: 8px; }
.sound-list li, .greet-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(180px, 260px) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.sound-list audio, .greet-row audio, #myGreeting audio { width: 100%; height: 36px; }
.greet-people { display: grid; gap: 8px; margin-top: 8px; }
.blank-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
@media (max-width: 640px) { .sound-list li, .greet-row { grid-template-columns: 1fr; } }

/* Dialing guide and star codes */
.dial-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.dial-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dial-table { width: 100%; border-collapse: collapse; }
.dial-table th { text-align: left; vertical-align: top; white-space: nowrap; padding: 8px 12px 8px 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }
.dial-table th small { display: block; font-family: inherit; font-weight: 400; font-size: 13px; color: var(--muted, #5b6472); }
.dial-table td { padding: 8px 0; border-top: 1px solid var(--line); }
.dial-table tr:first-child td { border-top: 0; }
.code-row { display: grid; grid-template-columns: 1fr 150px 70px; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.code-row input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 640px) { .dial-cards { grid-template-columns: 1fr; } .code-row { grid-template-columns: 1fr 110px; } .code-row .check { grid-column: 2; } }

/* Settings: icons in the menu, and tabs inside pages with several parts */
.set-menu .tab { display: flex; align-items: center; gap: 10px; }
.set-menu .tab .ic { width: 18px; height: 18px; flex: none; color: var(--muted); }
.set-menu .tab.on .ic { color: var(--red); }
.sub-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; max-width: 760px; }
.sub-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.sub-tab .ic { width: 17px; height: 17px; color: var(--muted); }
.sub-tab:hover { border-color: var(--line-strong); }
.sub-tab[aria-selected="true"] { background: var(--primary-soft); border-color: var(--primary-ink); color: var(--primary-ink); font-weight: 600; }
.sub-tab[aria-selected="true"] .ic { color: var(--red); }
.sub-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 900px) { .sub-tabs { flex-wrap: nowrap; overflow-x: auto; } .sub-tab { white-space: nowrap; } }
.set-body .set-intro { padding-top: 14px; padding-bottom: 14px; }
.set-intro h2 { margin: 0 0 4px; }
.set-intro p { margin: 0; }
.set-body { min-width: 0; }
.sub-tabs { min-width: 0; }

/* Settings → Phone → Call routing */
.route-list { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 8px; }
.route-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.route-acts { display: flex; gap: 6px; flex: none; }
.route-editor { margin-top: 12px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); }
.route-editor h3 { margin-top: 0; }
.pick-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; }
.pick-people .check { align-items: center; }
.pick-people .order { width: 72px; margin-left: auto; }
@media (max-width: 640px) { .route-list li { flex-direction: column; align-items: flex-start; } }
.key-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.key-row [name=kn] { grid-column: 2; }
.key-row select[name=kd] { font-weight: 700; text-align: center; }

/* Call flow map */
.flow-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.flow-designer { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.flow-canvas { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: var(--radius); background: #f7f9fc; }
.flow-canvas:focus-visible { outline: 2px solid var(--blue); }
.flow-side .card { margin-bottom: 12px; }
.flow-side h2 { font-size: 16px; margin: 0 0 8px; }
.flow-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.flow-checks li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: default; }
.flow-checks li[data-flow-focus] { cursor: pointer; }
.flow-checks .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.flow-checks .chk-ok .ic { color: var(--ok, #15803d); } .flow-checks .chk-error .ic { color: var(--bad); } .flow-checks .chk-warn .ic { color: #b45309; } .flow-checks .chk-info .ic { color: var(--muted); }
.flow-steps { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.flow-steps .bad { color: var(--bad); font-weight: 600; }
@media (max-width: 1300px) { .flow-designer { grid-template-columns: 1fr; } .flow-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; } .flow-side .card { margin: 0; } }
.num-route select { min-width: 220px; }
.skill-grid { border-collapse: collapse; }
.skill-grid th, .skill-grid td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.skill-grid select { width: 64px; }

/* Reports */
.rep-range { align-items: end; gap: 10px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; }
.stat-tile b { font-size: 28px; line-height: 1.2; }
.day-bars { display: flex; align-items: flex-end; gap: 4px; height: 200px; padding: 8px 0 22px; overflow-x: auto; }
.day-bar { position: relative; flex: 1 0 18px; max-width: 42px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.day-bar small { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 13px; color: var(--muted); white-space: nowrap; }
.b-ans { background: #1d63b4; border-radius: 0 0 4px 4px; } .b-miss { background: #e3a008; border-radius: 4px 4px 0 0; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin: 0 4px 0 10px; } .key-ans { background: #1d63b4; } .key-miss { background: #e3a008; }
.rep-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.rep-table th { text-align: left; } .rep-table td, .rep-table th { padding: 7px 10px; white-space: nowrap; }

/* Settings → Phones & extensions → Speed dials */
.sd-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.sd-row input { min-width: 0; }
@media (max-width: 560px) { .sd-row { grid-template-columns: 56px minmax(0, 1fr) auto; } .sd-row [name=number] { grid-column: 2; grid-row: 2; } }

/* Desk phones: whether each phone fetched its settings */
.desk-good { color: var(--ok); }
.desk-good .ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.desk-bad { color: var(--bad); }
.desk-wait { color: var(--muted); }

/* Phone defaults: each setting says what it's following, or "Set here" with a Reset */
.pd-group { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--card); }
.pd-group > summary { cursor: pointer; padding: 12px 0; min-height: 44px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd-group > summary .chip { margin-top: 0; }
.pd-row { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.pd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pd-head label { display: inline; font-weight: 600; }
.pd-head .chip { margin-top: 0; }
.pd-row .fine { margin: 0; }
.pd-state { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.pd-state.pd-set { color: var(--ok); }
.pd-state.pd-unmanaged { font-weight: 400; font-style: italic; }
.pd-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pd-ctl select, .pd-ctl input { flex: 1 1 200px; min-width: 0; max-width: 360px; }
.pd-save { position: sticky; bottom: 0; display: grid; gap: 8px; padding: 12px 0 4px; background: var(--card); border-top: 1px solid var(--line); }
.pd-dirty { color: var(--warn); font-weight: 600; margin: 0; }
.pd-note { border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); padding: 10px 12px; display: grid; gap: 8px; justify-items: start; margin: 0 0 12px; }
.pd-note p { margin: 0; color: var(--ink); }
.pd-note.warn { background: var(--warn-soft); border-color: var(--warn); }
.pd-note.warn p { color: var(--warn); }
#setDesk h2[tabindex="-1"]:focus { outline: none; }
.pd-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--blue); }
.pd-back .ic { width: 16px; height: 16px; }
.pd-radios { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.pd-radios legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 4px; }
.pd-net { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.pd-net li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.pd-net-to { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.pd-net-ports { font-size: 14px; }
.pd-net-acts { flex-wrap: wrap; margin: 0 0 8px; }
.pd-net-acts .ic { width: 16px; height: 16px; }
.pd-tips { margin: 4px 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }

/* Network access: the allowed addresses */
.net-rows { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; display: grid; gap: 8px; justify-items: start; }
.net-rows legend { font-weight: 600; padding: 0 4px; }
.net-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; width: 100%; }
.net-row input { min-width: 0; width: 100%; }
@media (max-width: 560px) { .net-row { grid-template-columns: minmax(0, 1fr) auto; } .net-row label:nth-child(2) { grid-column: 1; grid-row: 2; } .net-row button { grid-row: 1; grid-column: 2; } }

/* Locations & map */
.map-locs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.map-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin: 8px 0 12px; }
.pmap { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); touch-action: none; user-select: none; }
.pmap img { display: block; width: 100%; height: auto; }
.pmap.placing { cursor: crosshair; outline: 2px dashed var(--primary-ink); outline-offset: -2px; }
.pmap-pin { position: absolute; transform: translate(-50%, -50%); min-width: 34px; height: 26px; padding: 0 6px; border-radius: 13px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
  color: #fff; font: 600 13px/22px inherit; cursor: grab; }
.pmap-pin.free, .map-dot.free { background: var(--ok); }
.pmap-pin.call, .map-dot.call { background: var(--bad); }
.pmap-pin.ring, .map-dot.ring { background: var(--warn); }
.pmap-pin.off, .map-dot.off { background: #6b7280; }
.map-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.map-key { display: inline-flex; flex-wrap: wrap; gap: 12px; margin-left: 4px; }
.map-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.map-chip { display: inline-flex; align-items: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.map-chip.on { border-color: var(--primary-ink); background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }

/* Conference bridges: who's on now */
.conf-members { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.route-list .conf-members li { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 6px; font-size: 14px; padding: 4px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
.route-list li:has(.conf-members) > span:first-child { flex: 1; min-width: 0; }
.conf-members .route-acts { margin-left: auto; }
#setConf .route-acts { flex-wrap: wrap; }
#setConf audio { max-width: 100%; width: 260px; height: 36px; }
#setConf .route-list { min-width: 0; }

/* Voicemail drop picker, above the call bar */
.drop-menu { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; margin: 6px 8px; }
.drop-menu p { width: 100%; margin: 0 0 4px; }

/* Caller surveys: the three numbers */
.sv-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.sv-stats > div { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.sv-stats b { display: block; font-size: 24px; }
.sv-stats small { color: var(--muted); font-size: 13px; }

/* Team chat */
.chat-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.chat-list { padding: 12px; display: grid; gap: 2px; }
.chat-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; }
.chat-item:hover { background: var(--chip); }
.chat-item.on { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.chat-item .count { margin-left: auto; }
.chat-item .ic { width: 16px; height: 16px; }
.chat-av { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); font-size: 13px; font-weight: 700; }
.chat-start { margin-top: 10px; font-size: 14px; }
.chat-layout > .card { max-width: none; margin: 0; }
.chat-thread { display: flex; flex-direction: column; min-height: calc(100vh - 230px); }
.chat-msgs { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; max-height: calc(100vh - 360px); display: grid; gap: 12px; align-content: start; }
.chat-msg { display: flex; gap: 10px; }
.chat-msg .chat-body { margin-top: 2px; overflow-wrap: anywhere; }
.chat-acts { display: inline-flex; gap: 10px; font-size: 13px; opacity: .8; }
.chat-compose { display: flex; flex-direction: column; gap: 0; margin-top: 12px; }
.chat-compose textarea { flex: 1; min-width: 0; resize: vertical; }
@media (max-width: 760px) { .chat-layout { grid-template-columns: 1fr; } .chat-thread { min-height: 60vh; } .chat-msgs { max-height: 55vh; } }
/* Calendar */
.cal-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.cal-head h2 { margin: 0 8px; min-width: 170px; text-align: center; font-size: 20px; }
.cal-grid { padding: 8px; margin-bottom: 16px; }
.cal-dows, .cal-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dows span { font-size: 13px; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-cell { min-height: 92px; display: flex; flex-direction: column; gap: 2px; align-items: stretch; text-align: left; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; overflow: hidden; }
.cal-cell.out { opacity: .5; background: transparent; border-color: transparent; }
.cal-cell.today .cal-num { background: var(--primary); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: inline-grid; place-items: center; }
.cal-cell.on { outline: 2px solid var(--primary-ink); outline-offset: -2px; }
.cal-num { font-size: 13px; font-weight: 600; }
.cal-ev { font-size: 13px; line-height: 1.25; padding: 1px 4px; border-radius: 4px; background: var(--primary-soft); color: var(--primary-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.booking { background: var(--ok-soft); color: var(--ok); }
.cal-more { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .cal-cell { min-height: 54px; padding: 4px; } .cal-ev { font-size: 0; height: 6px; padding: 0; } .cal-more { display: none; } }
@media (hover: hover) { .chat-msg .chat-acts { opacity: 0; } .chat-msg:hover .chat-acts, .chat-msg:focus-within .chat-acts { opacity: 1; } }

/* Campaigns */
.cmp-bar { height: 6px; border-radius: 3px; background: var(--chip); margin-top: 6px; overflow: hidden; max-width: 320px; }
.cmp-bar span { display: block; height: 100%; background: var(--ok); }
.cmp-info { min-width: 0; flex: 1; }
.cmp-new { margin-top: 12px; }
.cmp-new > summary { list-style: none; display: inline-flex; }
.cmp-new > summary::-webkit-details-marker { display: none; }
.cmp-new[open] > summary { margin-bottom: 10px; }
.cmp-work { max-width: 760px; }
.cmp-person { display: grid; gap: 2px; margin: 14px 0; }
.cmp-person b { font-size: 20px; }
.cmp-num { font-size: 22px; font-weight: 600; letter-spacing: .5px; }
.cmp-script { border-left: 3px solid var(--primary-ink); padding: 4px 12px; margin: 12px 0; background: var(--primary-soft); border-radius: 0 8px 8px 0; }
.cmp-outcomes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; }
.cmp-note { font-weight: 600; }

/* API & webhooks */
.dev-doc pre { background: var(--chip); padding: 10px; border-radius: 8px; overflow-x: auto; font-size: 13px; }
.dev-doc code, #setKeys code, #setHooks code { font-size: 13px; overflow-wrap: anywhere; }
.shown-once { border: 2px solid var(--primary-ink); border-radius: 10px; padding: 10px; margin-top: 10px; }
.shown-once input { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 13px; margin-top: 6px; }
#setKeys, #setHooks { min-width: 0; }
#setKeys fieldset, #setHooks fieldset { min-width: 0; }
#setKeys .table-wrap, #setHooks .table-wrap { max-width: 100%; overflow-x: auto; }
#setKeys > *, #setHooks > * { min-width: 0; }
#setHooks .route-list b, #setKeys .route-list b { overflow-wrap: anywhere; }

/* Readable text: browsers shrink <small> to about 11px; keep it at 13px or more. */
small { font-size: max(13px, .85em); }
/* Phones: small text buttons and "see all" links get at least a 24px-tall tap area. */
@media (max-width: 640px) { .linkish { min-height: 24px; } .dmore { display: inline-block; padding: 2px 0; } }
/* Cards space their rows with the grid gap, so paragraphs drop their own margins; a description sits close under the
   setting it describes. */
.page .card > p { margin: 0; }
.page .card > :is(label, .grid2, .row2) + p.fine { margin-top: -8px; }
.me-off { display: none !important; }
/* ---- Conversations (public/conversations.js): views | list | thread | details; one pane at a time on a phone ---- */
.cv-page { max-width: none; }
.cv { display: grid; grid-template-columns: 200px minmax(280px, 340px) minmax(0, 1fr) 290px; gap: 12px; height: calc(100vh - 150px); min-height: 520px; }
.cv > .card { margin: 0; max-width: none; padding: 0; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.cv-views { padding: 10px 8px !important; overflow-y: auto !important; gap: 1px; }
.cv-sec { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 8px 4px; display: flex; justify-content: space-between; align-items: center; }
.cv-sec:first-child { margin-top: 4px; }
.cv-edit-tags { font-size: 13px; text-transform: none; letter-spacing: 0; }
.cv-view { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: 14px; color: var(--ink); background: none; border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; min-height: 36px; }
.cv-view:hover { background: var(--card-2); }
.cv-view.on { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.cv-view span:first-child, .cv-view .cv-dot + span { flex: 1; }
.cv-n { font-size: 13px; font-weight: 700; color: var(--muted); }
.cv-n.hot { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 7px; }
.cv-dot { width: 9px; height: 9px; border-radius: 50%; flex: none !important; background: var(--tag-ink, #6b7280); }
.cv-list-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px; gap: 8px; }
.cv-list-head h1 { font-size: 19px; margin: 0; }
.cv-list-tools { display: flex; gap: 8px; padding: 4px 14px 10px; border-bottom: 1px solid var(--line); }
.cv-list-tools input { flex: 1; min-width: 0; height: 38px; }
.cv-viewpick { display: none; }
.cv-items { list-style: none; margin: 0; padding: 4px; overflow-y: auto; flex: 1; }
.cv-none { padding: 24px 14px; color: var(--muted); text-align: center; }
.cv-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; color: var(--ink); text-decoration: none; position: relative; }
.cv-item:hover { background: var(--card-2); }
.cv-item.on { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.cv-item.unread b, .cv-item.unread .cv-item-prev { font-weight: 700; color: var(--ink); }
.cv-av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--chip); color: var(--ink-2); }
.cv-av.big { width: 48px; height: 48px; font-size: 16px; }
.cv-item-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cv-item-top { display: flex; justify-content: space-between; gap: 8px; min-width: 0; max-width: 100%; }
.cv-item-top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The organization they're with, after their name (offices that serve businesses). */
.cv-item-who { display: flex; flex: 1 1 0; max-width: 100%; align-items: baseline; gap: 6px; min-width: 0; overflow: hidden; }
.cv-person-org { display: block; }
.cv-item-who b { flex: 0 1 auto; min-width: 0; }
.cv-org { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.cv-org::before { content: "· "; }
.cv-org-head { font-weight: 600; color: var(--text, inherit); }
.cv-item-top small { color: var(--muted); flex: none; font-size: 13px; }
.cv-item-prev { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-you { color: var(--muted); }
.cv-item-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; align-items: center; }
.cv-unread { position: absolute; right: 10px; bottom: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.cv-who { width: 26px; height: 26px; border-radius: 50%; background: #f2c14e; color: #1a1300; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
.cv-chip { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; line-height: 18px; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--ink-2); }
.cv-text { background: var(--ok-soft); color: var(--ok); }
.cv-chat { background: var(--blue-soft); color: var(--blue); }
.cv-email { background: var(--warn-soft); color: var(--warn); }
.cv-snz { background: var(--violet-soft); color: var(--violet); }
.cv-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; line-height: 18px; padding: 1px 8px; border-radius: 999px; background: var(--tag-bg, var(--chip)); color: var(--tag-ink, var(--ink-2)); }
.cv-tag button { border: 0; background: none; color: inherit; font: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 0 0 2px; min-width: 20px; min-height: 20px; }
[data-color="blue"] { --tag-bg: #e3edfa; --tag-ink: #174f8c; } [data-color="orange"] { --tag-bg: #fdeee0; --tag-ink: #8a3a0b; }
[data-color="green"] { --tag-bg: #e3f4ea; --tag-ink: #11603b; } [data-color="purple"] { --tag-bg: #efeafc; --tag-ink: #4a2fa3; }
[data-color="red"] { --tag-bg: #fbe7e5; --tag-ink: #8c1d18; } [data-color="teal"] { --tag-bg: #dff3f1; --tag-ink: #0d5c55; }
[data-color="gray"] { --tag-bg: #eef0f3; --tag-ink: #374151; } [data-color="pink"] { --tag-bg: #fce7f1; --tag-ink: #8a1c55; }
.cv-dot[data-color] { background: var(--tag-ink); }
:root[data-theme="dark"] [data-color="blue"] { --tag-bg: #16294a; --tag-ink: #9cc3ff; } :root[data-theme="dark"] [data-color="orange"] { --tag-bg: #3a2410; --tag-ink: #f6b37a; }
:root[data-theme="dark"] [data-color="green"] { --tag-bg: #0f2e20; --tag-ink: #7fdcaa; } :root[data-theme="dark"] [data-color="purple"] { --tag-bg: #251a45; --tag-ink: #c4b2ff; }
:root[data-theme="dark"] [data-color="red"] { --tag-bg: #3a1718; --tag-ink: #ff9d95; } :root[data-theme="dark"] [data-color="teal"] { --tag-bg: #0f2f2c; --tag-ink: #7fd8cd; }
:root[data-theme="dark"] [data-color="gray"] { --tag-bg: #26334a; --tag-ink: #c9d3e1; } :root[data-theme="dark"] [data-color="pink"] { --tag-bg: #3a1528; --tag-ink: #f6a0c8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [data-color="blue"] { --tag-bg: #16294a; --tag-ink: #9cc3ff; } :root:not([data-theme="light"]) [data-color="orange"] { --tag-bg: #3a2410; --tag-ink: #f6b37a; }
  :root:not([data-theme="light"]) [data-color="green"] { --tag-bg: #0f2e20; --tag-ink: #7fdcaa; } :root:not([data-theme="light"]) [data-color="purple"] { --tag-bg: #251a45; --tag-ink: #c4b2ff; }
  :root:not([data-theme="light"]) [data-color="red"] { --tag-bg: #3a1718; --tag-ink: #ff9d95; } :root:not([data-theme="light"]) [data-color="teal"] { --tag-bg: #0f2f2c; --tag-ink: #7fd8cd; }
  :root:not([data-theme="light"]) [data-color="gray"] { --tag-bg: #26334a; --tag-ink: #c9d3e1; } :root:not([data-theme="light"]) [data-color="pink"] { --tag-bg: #3a1528; --tag-ink: #f6a0c8; } }

.cv-thread { background: var(--card); }
.cv-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cv-head-main { flex: 1; min-width: 0; }
.cv-head h2 { margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-head p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-back, .cv-side-head .btn { display: none; }
.cv-viewers { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cv-live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.cv-timeline { list-style: none; margin: 0; padding: 16px 20px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: var(--card-2); }
.cv-day { align-self: center; font-size: 13px; font-weight: 600; color: var(--muted); margin: 6px 0; }
.cv-ev { align-self: center; font-size: 13px; color: var(--muted); text-align: center; max-width: 90%; }
.cv-msg { max-width: min(76%, 560px); display: flex; flex-direction: column; gap: 4px; }
.cv-msg.out { align-self: flex-end; align-items: flex-end; }
.cv-bubble { padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: var(--card); border: 1px solid var(--line); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.cv-msg.out .cv-bubble { border-radius: 16px 16px 4px 16px; background: var(--blue); color: #fff; border-color: transparent; }
:root[data-theme="dark"] .cv-msg.out .cv-bubble { background: #2f5f9e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cv-msg.out .cv-bubble { background: #2f5f9e; } }
.cv-msg.ai .cv-bubble { background: var(--violet-soft); color: var(--ink); }
.cv-subj { font-weight: 600; font-size: 14px; }
.cv-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.cv-err { color: var(--bad); }
.cv-media { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cv-media img { max-width: 220px; max-height: 220px; border-radius: 10px; display: block; }
.cv-file { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.cv-note { align-self: stretch; max-width: 640px; margin-left: auto; background: #fff6d6; border: 1px solid #f0d77a; border-radius: 12px; padding: 9px 13px; color: #2b2000; }
:root[data-theme="dark"] .cv-note { background: #3a3110; border-color: #6b5a1c; color: #f6ecc4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cv-note { background: #3a3110; border-color: #6b5a1c; color: #f6ecc4; } }
.cv-note-by { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.cv-note-by span { font-weight: 400; opacity: .85; }
.cv-note-body { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.cv-at { background: #f2c14e; color: #1a1300; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.cv-call { align-self: center; display: flex; gap: 10px; max-width: min(84%, 600px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.cv-call p { margin: 4px 0 0; line-height: 1.45; }
.cv-call-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--chip); display: flex; align-items: center; justify-content: center; flex: none; }
.cv-call-ic .ic { width: 15px; height: 15px; }
.cv-compose { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: grid; gap: 8px; background: var(--card); margin: 0; max-width: none; }
.cv-compose.noting .cv-box textarea { background: #fffbea; }
:root[data-theme="dark"] .cv-compose.noting .cv-box textarea { background: #2a2410; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cv-compose.noting .cv-box textarea { background: #2a2410; } }
.cv-compose-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cv-mode button { min-height: 34px; }
.cv-via { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.cv-box { position: relative; }
.cv-box textarea { width: 100%; resize: vertical; min-height: 64px; font: inherit; font-size: 15px; }
.cv-mention-pick { position: absolute; left: 8px; bottom: 100%; margin: 0 0 4px; padding: 4px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 200px; z-index: 5; }
.cv-mention-pick li { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.cv-mention-pick li:hover, .cv-mention-pick li[aria-selected="true"] { background: var(--primary-soft); }
.cv-compose-bottom { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.cv-compose-bottom .fine { margin-right: auto; }
.cv-empty { margin: auto; text-align: center; padding: 30px; display: grid; gap: 6px; justify-items: center; }
.cv-empty > .ic { width: 36px; height: 36px; color: var(--muted); }
.cv-newform { display: flex; flex-direction: column; height: 100%; margin: 0; max-width: none; }
.cv-newform-body { padding: 16px 20px; display: grid; gap: 12px; max-width: 520px; }
.cv-newform label, .cv-field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }

.cv-side { padding: 0 !important; overflow-y: auto !important; }
.cv-side-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cv-side-head h2 { margin: 0; font-size: 16px; }
.cv-side > *:not(.cv-side-head) { margin: 0 16px; }
.cv-person { display: flex; gap: 12px; align-items: center; margin-top: 16px !important; }
.cv-person b { display: block; font-size: 16px; }
.cv-facts { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px 10px; font-size: 14px; margin-top: 14px !important; }
.cv-facts dt { color: var(--muted); }
.cv-facts dd { margin: 0; overflow-wrap: anywhere; }
.cv-field { margin-top: 16px !important; }
.cv-field > span { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cv-status { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cv-status select { flex: 1; min-width: 140px; }
.cv-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cv-tags input { width: 110px; height: 30px; font-size: 13px; }
.cv-recent { list-style: none; margin: 0; padding: 0; font-weight: 400; }
.cv-recent li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cv-recent li span { flex: 1; }
.cv-recent small { color: var(--muted); }
.cv-recent .ic { width: 15px; height: 15px; color: var(--muted); }
.cv-side > .cv-field:last-child { margin-bottom: 18px !important; }
.cv-tagform { padding: 0 4px; display: grid; gap: 8px; }
.cv-tagform ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cv-tagrow { display: flex; align-items: center; gap: 6px; }
.cv-tagrow input { flex: 1; min-width: 0; height: 34px; }
.cv-tagrow select { width: 82px; height: 34px; }

/* Below very wide screens the views fold into a menu above the list; below 1280px the details slide over the thread. */
@media (max-width: 1599px) {
  .cv { grid-template-columns: minmax(270px, 310px) minmax(0, 1fr) 280px; }
  .cv-views { display: none !important; }
  .cv-viewpick { display: block; width: 128px; height: 38px; }
}
@media (max-width: 1280px) {
  .cv { grid-template-columns: minmax(260px, 300px) minmax(0, 1fr); position: relative; }
  .cv-side { display: none !important; }
  .cv[data-pane="side"] .cv-side { display: flex !important; position: absolute; right: 0; top: 0; bottom: 0; width: min(340px, 100%); z-index: 6; box-shadow: var(--shadow); }
  .cv-side-head .btn { display: inline-flex; }
}
@media (min-width: 1281px) { .cv-info { display: none; } }
/* Phones: one pane at a time (list → thread → details). */
@media (max-width: 900px) {
  /* Exactly the space between the header and the tab bar, edge to edge. */
  #convos { padding: 0; }
  .cv { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--top-h, 140px) - var(--tab-h)); height: calc(100dvh - var(--top-h, 140px) - var(--tab-h)); min-height: 0; gap: 0; }
  body.cv-open .tabbar { display: none; }
  body.cv-open .app { --tab-h: env(safe-area-inset-bottom); }
  /* …and so does Connect's own header: the conversation's header (name, call, handled, back) is the whole top. */
  body.cv-open .top { display: none; }
  body.cv-open .cv-head, body.cv-open .cv-side-head { padding-top: calc(8px + env(safe-area-inset-top)); }
  .cv > .card { border-radius: 0; border-left: 0; border-right: 0; }
  .cv-list, .cv-thread { display: none !important; }
  .cv[data-pane="list"] .cv-list { display: flex !important; }
  .cv[data-pane="thread"] .cv-thread, .cv[data-pane="side"] .cv-thread { display: flex !important; }
  .cv[data-pane="side"] .cv-side { width: 100%; }
  .cv-back { display: inline-flex; }
  .cv-timeline { padding: 12px; }
  .cv-msg { max-width: 86%; }
  .cv-head { padding: 8px 8px; gap: 4px; }
  .cv-head .btn span { display: none; }
  .cv-head .btn { min-width: 40px; justify-content: center; }
  .cv-hint, #cvHint { display: none; }
  .cv-item { padding: 12px 10px; }
}

/* Website chat settings: questions and answers */
.faq { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 14px; display: grid; gap: 8px; }
.faq legend { font-weight: 600; padding: 0 4px; }
.faq ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.faq-row { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.faq-row .linkish { justify-self: start; }
.cv-via-pick { height: 34px; font-size: 13px; max-width: 260px; }

/* Settings: email inboxes in Conversations */
.mb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mb-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mb-acts { display: flex; gap: 10px; align-items: center; flex: none; }
.cv-files { font-size: 13px; color: var(--muted); }

/* Conversations: DeskDay tickets in the details */
.cv-dd .btn { justify-self: start; margin-top: 6px; }
.cv-tickets li { align-items: flex-start; }
.cv-tk { font-weight: 600; }
.cv-tk-open, .cv-tk-reopened, .cv-tk-in_progress { color: var(--blue); }
.cv-tk-resolved, .cv-tk-closed { color: var(--ok); }
.cv-tk-pending { color: var(--warn); }
.cv-ddform { display: grid; gap: 8px; margin-top: 8px; font-weight: 400; }
.cv-ddform label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }

.cv-draft { color: var(--violet); }

/* Conversations: translation */
.cv-tr { font-size: 13px; color: var(--muted); max-width: 100%; overflow-wrap: anywhere; }
.cv-msg.out .cv-tr { text-align: right; }
.cv-lang { background: var(--violet-soft); color: var(--violet); vertical-align: middle; margin-left: 6px; }
.cv-trans { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--violet); margin-right: 8px; }

.cv-form { background: var(--chip); color: var(--ink-2); }
.cv-hint-support { color: var(--blue); font-weight: 600; }

/* Conversations: saved replies menu and the numbers */
.cv-macro-menu { max-height: 260px; overflow-y: auto; min-width: 280px; }
.cv-macro-menu small { color: var(--muted); }
.cv-list-head h1 { flex: 1; }
.cv-numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding: 16px 20px; }
.cv-stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.cv-stat b { font-size: 24px; }
.cv-stat span { color: var(--muted); font-size: 13px; }
.cv-numbers-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 0 20px 20px; overflow-y: auto; }
.cv-numbers-tables caption { text-align: left; font-weight: 700; padding: 6px 0; }
.cv-numbers-tables th, .cv-numbers-tables td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.mc-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mc-list { list-style: none; margin: 0; padding: 0; }
.cv-typing { color: var(--violet); font-style: italic; }
.cv-late { background: var(--bad-soft); color: var(--bad); }
.rt-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rt-list { list-style: none; margin: 0; padding: 0; }
.rt-members { display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 400; }
.cv-messenger { background: #e7f0ff; color: #0a52c4; } .cv-instagram { background: #fde8f1; color: #9b1c5a; } .cv-whatsapp { background: #e1f6ea; color: #0f6a3b; }
:root[data-theme="dark"] .cv-messenger, :root[data-theme="dark"] .cv-instagram, :root[data-theme="dark"] .cv-whatsapp { background: var(--chip); color: var(--ink); }

/* Touch screens: iPhone zooms the page into any text box smaller than 16px, so they are at least 16px there. */
@media (hover: none) and (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea { font-size: max(16px, 1em) !important; }
  .dialer-box input { font-size: 20px !important; }
  .share-code input { font-size: 24px !important; }
  .search-in input { font-size: 18px !important; }
}
/* Phones: quick taps (back, then back again) are taps, not double-tap zoom. Pinch to zoom still works. */
html { touch-action: manipulation; }
/* Touch screens: small text buttons and links are at least 44pt tall to tap (Apple's minimum), without changing how
   they look. */
@media (hover: none) and (pointer: coarse) {
  .linkish, .dmore, .cal-head .btn, .todo-main > a { min-height: 44px; display: inline-flex; align-items: center; }
  .cal-head .btn { min-width: 44px; justify-content: center; }
  .chat-item { min-height: 44px; }
  .main details > summary:not(.btn) { padding-block: 11px; }
  /* Buttons, menus, text boxes, tabs and filters across the app: 44pt tall on touch screens. */
  .main .btn, .main select, .main .seg > button, .main .seg > a, .main [role=tab], .tabbar a, .tabs a, .tabs button,
  .main input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]),
  .modal .btn, .modal select, .modal input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), nav.side .nav { min-height: 44px; }
  .main .btn, .modal .btn, .main .seg > button { display: inline-flex; align-items: center; justify-content: center; }
  /* Checkboxes and switches: the whole label row is the target. */
  .main label:has(> input[type=checkbox]), .main label:has(> input[type=radio]) { min-height: 44px; align-items: center; }
}

/* Live notes on a call: a panel above the call bar (above the tab bar on phones). */
.call-notes { position: fixed; z-index: 44; right: 16px; bottom: 84px; width: min(380px, calc(100vw - 32px)); max-height: min(50vh, 420px); display: flex; flex-direction: column; padding: 0; overflow: hidden; box-shadow: var(--shadow); }
.call-notes header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.call-notes header b { flex: 1; }
.cn-live { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; animation: cnpulse 1.4s ease-in-out infinite; }
@keyframes cnpulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .cn-live { animation: none; } }
.cn-body { overflow-y: auto; padding: 10px 12px; display: grid; gap: 6px; font-size: 15px; }
.cn-body p { margin: 0; }
.cn-sum { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.cn-sum ul { margin: 6px 0 0 18px; padding: 0; }
@media (max-width: 900px) { .call-notes { left: 12px; right: 12px; width: auto; bottom: calc(var(--tab-h) + 76px); } }

/* Phones: form fields never push a card wider than the screen (Recording & AI and Star codes ran off the right edge).
   A field's natural width (from its longest option or its size) no longer sets the width of its row. */
@media (max-width: 640px) {
  .page .card, label { grid-template-columns: minmax(0, 1fr); }
  label > input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), label > select, label > textarea,
  .page .card select { width: 100%; min-width: 0; max-width: 100%; }
}

/* Settings list: plain-English descriptions, search, and the technical settings folded under Advanced. */
.set-txt { display: grid; gap: 2px; min-width: 0; }
.set-desc { display: none; font-size: 13px; font-weight: 400; color: var(--muted); line-height: 1.35; }
#settings.set-index .set-desc { display: block; }
.set-search { display: block; margin: 0 0 8px; }
.set-search input { width: 100%; box-sizing: border-box; }
.set-none { margin: 4px 10px 10px; }
.set-menu .no-match { display: none !important; }
#settings .set-menu:not(.adv-open):not(.searching) .tab.set-adv:not(.on) { display: none !important; }
.set-adv-head { margin-top: 14px !important; }
.set-adv-btn { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; width: 100%; min-height: 44px; padding: 6px 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; cursor: pointer; }
.set-adv-btn::before { content: "›"; display: inline-block; font-size: 16px; transition: transform .15s; }
.set-menu.adv-open .set-adv-btn::before, .set-menu.searching .set-adv-btn::before { transform: rotate(90deg); }
.set-adv-btn small { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
/* Computer: Settings opens on the same list, one readable column. Choosing one shows the menu beside it as before. */
@media (min-width: 901px) {
  #settings.set-index .set-layout { grid-template-columns: minmax(0, 760px); }
  #settings.set-index .set-body { display: none; }
  #settings.set-index .set-menu.tabs { position: static; max-height: none; overflow: visible; padding: 14px 16px; }
  #settings.set-index .set-menu .tab { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
  #settings.set-index .set-menu .tab.on { background: none; box-shadow: none; color: var(--ink-2); font-weight: 500; }
  #settings.set-index .set-menu .tab .set-txt > span { font-weight: 600; color: var(--ink); }
}
/* Phone list: the description sits under the name, the › stays on the right. */
@media (max-width: 900px) {
  .set-menu .tab { padding-top: 8px; padding-bottom: 8px; gap: 12px; }
  .set-search { margin: 4px 12px 4px; }
  .set-adv-head { margin: 16px 16px 0 !important; }
}

/* Every setting has an icon in a colored tile, one color per group, so people can find things by sight. */
.set-txt { flex: 1; }
#settings.set-index .set-menu .tab > .ic { box-sizing: border-box; width: 32px; height: 32px; padding: 7px; border-radius: 8px; flex: none; color: #fff; background: #475569; }
#settings.set-index .set-menu .tab[data-group="office"] > .ic { background: #1d4ed8; }
#settings.set-index .set-menu .tab[data-group="calls"] > .ic { background: #15803d; }
#settings.set-index .set-menu .tab[data-group="fax"] > .ic { background: #7c3aed; }
#settings.set-index .set-menu .tab[data-group="messages"] > .ic { background: #0f766e; }
#settings.set-index .set-menu .tab[data-group="privacy"] > .ic { background: #b91c1c; }
#settings.set-index .set-menu .tab[data-group="connections"] > .ic { background: #c2410c; }
#settings.set-index .set-menu .tab[data-group="advanced"] > .ic { background: #64748b; }
#settings.set-index .set-menu .tab[data-group="you"] > .ic { background: #1e3a5f; }
@media (max-width: 900px) { .set-menu .tab { justify-content: flex-start; } .set-menu .tab::after { margin-left: auto; } }

/* "What's this?" tips beside technical terms in Settings (public/tips.js). */
.tip { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; margin: 0 0 0 6px; padding: 0; border: 1.5px solid var(--muted); border-radius: 50%; background: none; color: var(--muted); font-size: 12px; line-height: 1; vertical-align: middle; cursor: help; flex: none; justify-self: start; }
.tip > span:first-child { font: italic 700 12px/1 Georgia, serif; }
.tip::before { content: ""; position: absolute; inset: -12px; }   /* a 44pt target around the small circle */
.tip:hover, .tip:focus-visible, .tip[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
.tip-box { display: none; position: absolute; z-index: 60; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: min(280px, 80vw); padding: 10px 12px; border-radius: 10px; background: var(--ink); color: var(--card); font-size: 14px; font-weight: 400; line-height: 1.45; font-style: normal; letter-spacing: 0; text-transform: none; text-align: left; white-space: normal; box-shadow: var(--shadow); pointer-events: none; }
.tip:hover .tip-box, .tip:focus-visible .tip-box, .tip[aria-expanded="true"] .tip-box { display: block; }
.tip-row { display: flex; align-items: center; flex-wrap: wrap; }
/* Phones: the explanation shows as a bubble across the bottom of the screen, above the tab bar, so it never runs off an edge. */
@media (max-width: 640px) { .tip-box { position: fixed; left: 16px; right: 16px; top: auto; bottom: calc(var(--tab-h, 64px) + 16px); transform: none; width: auto; max-width: none; font-size: 15px; padding: 14px 16px; } }
/* Phones: the row of section tabs scrolls sideways without a visible scrollbar line, with room above and below. */
@media (max-width: 900px) { .sub-tabs { scrollbar-width: none; margin-top: 12px; margin-bottom: 12px; } .sub-tabs::-webkit-scrollbar { display: none; } }

/* Sign-in page: other ways in (passkey, Google, emailed code) under Microsoft. */
.signin-other { display: grid; gap: 10px; margin-top: 10px; text-align: left; }
.signin-other .btn.signin-alt { width: 100%; min-height: 46px; justify-content: center; gap: 10px; font-size: 15px; background: var(--card); border-color: #8c8c8c; color: var(--ink); }
.signin-or { display: flex; align-items: center; gap: 10px; margin: 8px 0 0 !important; font-size: 13px; color: var(--muted); }
.signin-or::before, .signin-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.signin-code { display: grid; gap: 8px; }
.signin-code input { min-height: 46px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); color: var(--ink); font-size: 16px; }
#codeInput { font-size: 22px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
#codeInput:placeholder-shown { font-size: 16px; letter-spacing: normal; }
.signin-code .btn { min-height: 46px; justify-content: center; }
.signin-code .fine { margin: 0 !important; }
.signin-code .linkish { justify-self: center; min-height: 44px; }
.signin-err { margin: 0 !important; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad) !important; font-size: 14px; }
.signin-ways { margin: 4px 0 12px; }
.passkey-nudge { flex-wrap: wrap; }
.passkey-nudge > span { flex: 1 1 260px; }
.staff-box { display: grid; gap: 8px; margin: 8px 0 12px; padding: 12px 14px; border-radius: 10px; background: #fff7d6; border: 1px solid #f2d47a; color: #5c4400; }
.staff-box p { margin: 0; }
.staff-box .fine { color: #5c4400; }
.staff-box code { overflow-wrap: anywhere; font-size: 13px; }
:root[data-theme="dark"] .staff-box { background: #33260b; border-color: #6b5313; color: #f2d47a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .staff-box { background: #33260b; border-color: #6b5313; color: #f2d47a; } :root:not([data-theme="light"]) .staff-box .fine { color: #f2d47a; } }
:root[data-theme="dark"] .staff-box .fine { color: #f2d47a; }
.totp-qr { width: 200px; max-width: 70vw; margin: 4px auto; padding: 6px; background: #fff; border-radius: 10px; }
.totp-qr svg { display: block; width: 100%; height: auto; }
.totp-setup code, #myTotp code { overflow-wrap: anywhere; font-size: 14px; letter-spacing: .04em; }
#setupTotpBtn { min-height: 44px; }
.totp-setup { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); gap: 10px; }
#setup1p { margin-top: 12px !important; }
.btn.ms[hidden] { display: none; }

/* Holiday planner (Settings → Office hours & holidays) */
.plan-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.plan-day { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.plan-day.past { opacity: .6; }
.plan-when { display: grid; gap: 2px; min-width: 0; }
.plan-seg { display: inline-flex; }
.plan-seg > button { font-size: 14px; padding: 6px 12px; }
.plan-early { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.plan-early select { width: auto; }
.plan-quick { display: flex; flex-wrap: wrap; gap: 8px; }
#holidayPlanner h2 small { font-weight: 400; margin-left: 6px; }
#holidayPlanner .check small { display: block; font-weight: 400; margin-top: 2px; }
@media (max-width: 640px) { .plan-day { grid-template-columns: 1fr; } .plan-seg { width: 100%; } .plan-seg > button { flex: 1; } }
#holidayPlanner label.check { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: 8px; }
#holidayPlanner label.check small { grid-column: 2; }
.greet-ed { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; display: grid; gap: 10px; }
.greet-ed legend { font-weight: 700; padding: 0 4px; }
.greet-body { display: grid; gap: 10px; }
.greet-body textarea { width: 100%; box-sizing: border-box; }
.greet-mode { display: grid; gap: 6px; }
.greet-mode select { width: auto; max-width: 100%; margin-left: 4px; }
.greet-preview { margin: 0 0 12px; }
.holiday-answer .big { font-size: 20px; font-weight: 700; color: var(--ink); }
.holiday-answer form { margin: 16px 0; }
.holiday-answer .btn.primary { min-width: 200px; min-height: 48px; }
#holidayPlanner .greet-mode label.check, #closuresCard .greet-mode label.check, .greet-ed > label.check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.greet-mode select { margin-left: 0; }


/* ==== Refresh foundation (stage 3 of the UI refresh, Nov 2026) ====
   One set of design basics every screen draws from. New and changed screens use these names only:
   type --fs-1..6, spacing --s1..7, rounding --r-ctl / --r-card / --r-pill, shadows --sh-1 (resting) / --sh-2 (raised).
   Colours keep their existing names (--ink, --muted, --line, --card...) so older rules follow along. */
:root {
  --fs-1: 13px; --fs-2: 14px; --fs-3: 15px; --fs-4: 17px; --fs-5: 20px; --fs-6: 26px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-ctl: 8px; --r-card: 12px; --r-pill: 999px; --radius: var(--r-card);
  --sh-1: 0 1px 2px rgba(10, 26, 46, .06); --sh-2: 0 12px 32px -10px rgba(10, 26, 46, .28); --shadow: var(--sh-1);
  --line: #e2e7ee; --sunken: #eef2f7;
  /* Top bar: light, a shade apart from the page in both themes. */
  --top-bg: #ffffff; --top-ink: var(--ink); --top-ink-2: var(--muted); --top-line: var(--line); --top-field: #f1f4f8; --top-field-line: #dbe1ea; --brand-word: #be1828;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --line: #233047; --sunken: #0e1626; --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 12px 32px -8px rgba(0, 0, 0, .6);
  --top-bg: #0e1626; --top-field: #182337; --top-field-line: #2a3850; --brand-word: #ff8f86; } }
:root[data-theme="dark"] {
  --line: #233047; --sunken: #0e1626; --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 12px 32px -8px rgba(0, 0, 0, .6);
  --top-bg: #0e1626; --top-field: #182337; --top-field-line: #2a3850; --brand-word: #ff8f86; }

/* Light top bar */
.app .top { background: var(--top-bg); color: var(--top-ink); border-bottom: 1px solid var(--top-line); box-shadow: none; }
.app .brand, .app .brand-text b { color: var(--top-ink); }
.app .brand .app-word { color: var(--brand-word); }
.app .brand-mark { box-shadow: 0 0 0 1px var(--top-line); }
.app .org-chip { background: var(--top-field); border-color: var(--top-field-line); color: var(--top-ink); }
.app .org-chip .ic, .app .org-label { color: var(--top-ink-2); }
.app .org-chip select { color: var(--top-ink); }
.app .org select { background: var(--top-field); color: var(--top-ink); border-color: var(--top-field-line); }
.app .team-sum { color: var(--top-ink); }
.app .team-sum:hover, .app .team-menu[open] > .team-sum { background: var(--top-field); }
.app .top-search { color: var(--top-ink-2); background: var(--top-field); border-color: var(--top-field-line); }
.app .top-search:hover { background: var(--sunken); color: var(--top-ink); }
.app .top-search kbd { background: var(--card); color: var(--top-ink-2); border: 1px solid var(--top-field-line); }
.app .user, .app .user-menu > summary { color: var(--top-ink); }
.app .user-text #userName { color: var(--top-ink); }
.app .user-text small, .app .user-menu > summary > .ic { color: var(--top-ink-2); }
.app .user-menu > summary:hover, .app .user-menu[open] > summary { background: var(--top-field); border-color: var(--top-field-line); }
.app .user .avatar { box-shadow: 0 0 0 2px var(--top-line); }
.app .top .stage-badge { background: #fdf1dc; border-color: #e3b35a; color: #6b3f00; }
.app .top-viewas { background: #fdf1dc; border-color: #e3b35a; color: #6b3f00; }
:root[data-theme="dark"] .app .top .stage-badge, :root[data-theme="dark"] .app .top-viewas { background: #33260b; border-color: #7a5a1a; color: #ffd666; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .app .top .stage-badge, :root:not([data-theme="light"]) .app .top-viewas { background: #33260b; border-color: #7a5a1a; color: #ffd666; } }

/* Fields: typed text is normal weight (labels wrap their fields, and the label's bold used to carry over). */
label input, label select, label textarea, .field input, .field select, .field textarea { font-weight: 400; }
input, select, textarea { border-radius: var(--r-ctl); }
input::placeholder, textarea::placeholder { font-weight: 400; }
/* One dropdown look everywhere: our own chevron instead of each browser's. */
select:not([multiple]):not([size]) { -webkit-appearance: none; appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23556072' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; }
.app .org-chip select { padding-right: 26px; background-position: right 6px center; }

/* Buttons: one family. Main (.primary), secondary (.btn), quiet (.ghost), danger (.danger). */
.btn { border-radius: var(--r-ctl); border-color: var(--line-strong); font-size: var(--fs-2); }
.btn:hover { background: var(--sunken); border-color: var(--line-strong); }
.btn.primary, .btn.primary:hover { border-color: transparent; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn.danger { border-color: transparent; background: transparent; color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }

/* Badges and cards */
.count { font-size: var(--fs-1); font-variant-numeric: tabular-nums; }

/* ==== Refresh: dashboard ====
   One quiet row of counts (red only for what's waiting on you), "For you" first, Team and your phone in a side column. */
.dash .dash-cards[data-n] { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 1px; margin-bottom: var(--s5);
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-1); overflow: hidden; }
.dash .dash-cards[data-n="2"] { --n: 2; } .dash .dash-cards[data-n="3"] { --n: 3; } .dash .dash-cards[data-n="4"] { --n: 4; } .dash .dash-cards[data-n="6"] { --n: 6; }
.dash .dcard, .dash .dcard.hot, .dash .dcard.warn { border: 0; border-radius: 0; box-shadow: none; background: var(--card); padding: var(--s4) var(--s5); gap: 0; }
.dash a.dcard:hover { background: var(--card-2); transform: none; box-shadow: none; }
.dash .dcard .qicon { display: none; }
.dash .dcard-body small { font-size: var(--fs-1); font-weight: 500; color: var(--muted); }
.dash .dcard-body b { font-size: var(--fs-5); line-height: 1.3; color: var(--ink); letter-spacing: 0; }
.dash .dcard-body b.dcard-word { font-size: var(--fs-4); margin: 0; }
.dash .dcard-body span { font-size: var(--fs-1); color: var(--muted); }
.dash .dcard.hot .dcard-body b, .dash .dcard.hot .dcard-body span { color: var(--bad); }
.dash .dcard.hot .dcard-body span { font-weight: 600; }
.dash .dcard.warn .dcard-body b { color: var(--warn); }
@media (max-width: 1100px) { .dash .dash-cards[data-n] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash .dash-cards[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash .dash-cards[data-n="5"] > :nth-child(n+4) { grid-column: span 1; } .dash .dash-cards[data-n="5"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dash .dash-cards[data-n="5"] > :nth-child(-n+3) { grid-column: span 2; } .dash .dash-cards[data-n="5"] > :nth-child(n+4) { grid-column: span 3; } }
@media (max-width: 640px) { .dash .dash-cards[data-n], .dash .dash-cards[data-n="5"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash .dash-cards[data-n] > .dcard { grid-column: auto; padding: var(--s3) var(--s4); }
  .dash .dash-cards[data-n] > .dcard:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.dash .ret-btns .btn.small.ib { box-shadow: none; background: transparent; }

.dash .dash-clear { margin: calc(-1 * var(--s3)) 0 var(--s5); border-radius: var(--r-card); }
.dash-body { display: grid; gap: var(--s5); align-items: start; }
.dash-body:not([data-side="0"]), .dash-body:has(#dashTeam:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); }
.dash-side { display: grid; gap: var(--s4); align-content: start; min-width: 0; }
.dash-side:not(:has(#dashTeam:not([hidden]))):has(#dashSide:empty) { display: none; }
#dashSide { display: grid; gap: var(--s4); }
#dashSide:empty { display: none; }
.dash .dash-grid[data-n] { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
@media (max-width: 1100px) { .dash-body:not([data-side="0"]), .dash-body:has(#dashTeam:not([hidden])) { grid-template-columns: minmax(0, 1fr); } }

.dash .dpanel { border-radius: var(--r-card); box-shadow: var(--sh-1); padding: var(--s4) var(--s5); }
.dash .dpanel h2 { font-size: var(--fs-4); gap: var(--s2); margin-bottom: var(--s2); }
.dash .dpanel h2 .gicon { display: none; }
.dash .dpanel.hot { border-color: var(--line); }
.dash .dmore { font-weight: 600; text-decoration: none; color: var(--blue); }
.dash .dmore.dcount { color: var(--muted); font-weight: 500; }
.dash .dlist li a, .dash .dlist .drow { padding: var(--s3) var(--s1); }
.fy-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-ctl); background: var(--sunken); color: var(--ink-2); flex: none; }
.fy-ic .ic { width: 16px; height: 16px; display: block; margin: 0; }
.fy-ic.fy-vm, .fy-ic.fy-call { background: var(--bad-soft); color: var(--bad); }
.fy-ic.fy-msg { background: var(--blue-soft); color: var(--blue); }

/* Calls to return: Call back, then icon buttons that all share one shape */
.dash .ret-btns { align-items: center; gap: var(--s1); }
.dash .ret-btns .btn.ib, .dash .ret-btns .icon-btn, .dash .ret-btns .qa-btn { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--ink-2); display: inline-grid; place-items: center; }
.dash .ret-btns .btn.ib:hover, .dash .ret-btns .icon-btn:hover, .dash .ret-btns .qa-btn:hover { background: var(--sunken); color: var(--ink); }
.dash .ret-btns .btn.primary { min-height: 36px; }

/* Team in the side column: status as a dot and a word under the name, so names don't wrap */
.dash-side .dash-team { margin: 0; }
.dash-side .dash-team ul { grid-template-columns: minmax(0, 1fr); gap: 0; }
.dash-side .dt-row { padding: var(--s2) 0; border-top: 1px solid var(--line); }
.dash-side .dt-row:first-child { border-top: 0; }
.dash-side .dt-person { background: transparent; padding: 0; }
.dt-who small { display: inline-flex; align-items: center; gap: 6px; }
.pdot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex: none; display: inline-block; }
.pdot.on { background: #16a34a; } .pdot.busy { background: #dc2626; } .pdot.ring { background: #d97706; } .pdot.dnd { background: #7c3aed; } .pdot.fwd { background: #2563eb; }
/* ==== Refresh: voicemail ====
   Call back (main), Text and Mark handled, then who it's assigned to as one pill, and everything else under "…". */
#voicemail .vm { border-radius: var(--r-card); box-shadow: var(--sh-1); padding: var(--s4) var(--s5); gap: var(--s3); }
#voicemail .vm.new { box-shadow: inset 3px 0 0 var(--red), var(--sh-1); }
#voicemail .vm-actions { align-items: center; gap: var(--s2); margin-top: var(--s1); }
#voicemail .vm-actions .btn { min-height: 36px; }
#voicemail .vm-actions .qa { margin-left: auto; }
#voicemail .vm-actions .qa-btn { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--ink-2); }
#voicemail .vm-actions .qa-btn:hover, #voicemail .vm-actions .qa.open > .qa-btn { background: var(--sunken); color: var(--ink); }
.vm-assign { height: 36px; padding: 0 2px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--card); }
.vm-assign select { border: 0; min-height: 32px; height: 32px; padding: 0 28px 0 2px; background-color: transparent; background-position: right 10px center; font-size: var(--fs-2); font-weight: 500; box-shadow: none; }
.vm-assign select:focus-visible { outline: 0; }
.vm-assign:focus-within { outline: 3px solid var(--focus, #7fb0e8); outline-offset: 2px; }
.qa-sep { border: 0; border-top: 1px solid var(--line); margin: var(--s1) 0; width: 100%; }
.qa-item.danger { color: var(--bad); }
.qa-item.danger:hover, .qa-item.danger:focus-visible { background: var(--bad-soft); color: var(--bad); }
.vm-when { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  #voicemail .vm { padding: var(--s4); }
  #voicemail .vm-actions .btn span { white-space: nowrap; }
}
/* ==== Refresh: Send a fax ====
   Recipients as clean two-line rows at every width (name and number, then email and the three choices with their words),
   no shaded box around them, and "Mark as" as tap-on chips. */
.recips { background: transparent; border: 0; padding: 0; gap: var(--s3); }
.recips legend { font-size: var(--fs-3); font-weight: 600; padding: 0; margin-bottom: var(--s2); }
.recip-head { display: none; }
.recip-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s2); padding: 0 0 var(--s3); border-bottom: 1px solid var(--line); }
.recip-row .r-name, .recip-row .r-num { grid-column: span 3; }
.recip-row .r-email { grid-column: 1 / -1; }
.recip-row .r-check, .recip-row .r-save { grid-column: span 2; display: flex; align-items: center; justify-content: flex-start; gap: 6px; font-size: var(--fs-2); color: var(--ink); min-height: 32px; }
.recip-row .r-rm { grid-column: 6; justify-self: end; }
.recip-row:has(.r-rm:not([hidden])) .r-save { grid-column: span 1; }
@media (min-width: 761px) {
  .recip-row { grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1.2fr); }
  .recip-row .r-name, .recip-row .r-num, .recip-row .r-email { grid-column: auto; }
  .recip-row .r-check, .recip-row .r-save { grid-column: auto; }
  .recip-row:has(.r-rm:not([hidden])) .r-save { grid-column: auto; }
  .recip-row .r-rm { grid-column: auto; }
  /* second line: the three choices sit under the fields, left-aligned, with the remove button at the end */
  .recip-row { grid-template-areas: "name num email" "opts opts opts"; }
  .recip-row .r-name { grid-area: name; } .recip-row .r-num { grid-area: num; } .recip-row .r-email { grid-area: email; }
  .recip-row .r-check, .recip-row .r-save, .recip-row .r-rm { grid-row: 2; }
  .recip-row .r-check:nth-of-type(1) { grid-column: 1; } .recip-row .r-check:nth-of-type(2) { grid-column: 2; }
  .recip-row .r-save { grid-column: 3; justify-self: start; }
  .recip-row .r-rm { grid-column: 3; justify-self: end; }
}
.r-lbl { display: inline; }
.r-check:has(input:disabled) .r-lbl { color: var(--muted); }
.recips .recip-key, .recips .recip-tip { font-size: var(--fs-1); color: var(--muted); }

/* "Mark as" chips */
.flags { gap: var(--s2); }
.flags legend { font-size: var(--fs-2); margin-bottom: var(--s2); }
.flags label { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--card); color: var(--ink-2); font-size: var(--fs-2); font-weight: 500; cursor: pointer; user-select: none; }
.flags label:hover { background: var(--sunken); }
.flags input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.flags label::before { content: "+"; font-weight: 600; color: var(--muted); }
.flags label:has(input:checked) { background: var(--blue-soft); border-color: var(--blue); color: var(--ink); font-weight: 600; }
.flags label:has(input:checked)::before { content: "✓"; color: var(--blue); }
.flags label:has(input:focus-visible) { outline: 3px solid #7fb0e8; outline-offset: 2px; }

/* ==== Refresh: shared pieces ====
   Page frame, headings, cards, filters, tabs, tables, lists and the side menus, so every screen picks up the same look. */
.page { padding: var(--s6) var(--s6) var(--s7); }
.page-head { margin-bottom: var(--s5); gap: var(--s3) var(--s5); }
.page-head h1 { font-size: var(--fs-6); letter-spacing: -.01em; }
.page-head .sub, .page > .sub { font-size: var(--fs-3); color: var(--muted); }
@media (max-width: 760px) { .page { padding: var(--s5) var(--s4) var(--s7); } }

/* Cards and panels */
.page .card { border-radius: var(--r-card); box-shadow: var(--sh-1); padding: var(--s5); gap: var(--s4); border-color: var(--line); }
.page .card h2, .card h2 { font-size: var(--fs-4); }
.table-wrap { border-radius: var(--r-card); box-shadow: var(--sh-1); border-color: var(--line); }
.empty-card { border-radius: var(--r-card); box-shadow: none; border: 1px dashed var(--line-strong); background: transparent; }

/* Side menu: soft fill for the current page, no red bar */
.nav { color: var(--ink-2); }
.nav:hover { background: var(--sunken); color: var(--ink); }
.nav.on, .nav.on:hover { background: var(--primary-soft); color: var(--primary-ink); box-shadow: none; font-weight: 600; }
.nav.on .ic { color: var(--primary-ink); }
.nav-head { font-weight: 600; letter-spacing: .06em; opacity: 1; }
.set-menu.tabs { box-shadow: var(--sh-1); border-radius: var(--r-card); }
.set-menu .tab.on, .set-menu .tab.on:hover { box-shadow: none; background: var(--primary-soft); color: var(--primary-ink); }
.set-menu .tab.on .ic { color: var(--primary-ink); }
.set-menu .set-group { font-weight: 600; letter-spacing: .06em; }

/* Filters: one segmented control look (a raised white segment for the current choice) */
.seg { border: 0; border-radius: var(--r-ctl); background: var(--sunken); padding: 3px; gap: 2px; box-shadow: none; overflow: visible; }
.seg button, .seg > a { border: 0; border-radius: 6px; padding: 7px 12px; font-size: var(--fs-2); color: var(--ink-2); font-weight: 500; }
.seg button + button { border-left: 0; }
.seg button:hover { color: var(--ink); background: rgba(127, 127, 127, .08); }
.seg button[aria-checked="true"], .seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
.seg button[aria-checked="true"] .seg-n { background: var(--primary); color: #fff; }
@media (max-width: 760px) {
  .seg.call-filter { gap: 2px; background: var(--sunken); padding: 3px; }
  .seg.call-filter button { background: transparent; }
  .seg.call-filter button[aria-checked="true"] { background: var(--card); color: var(--ink); }
}

/* Tabs inside a page: one row of underlined tabs that scrolls sideways instead of wrapping */
.sub-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 2px; max-width: none; border-bottom: 1px solid var(--line); margin-bottom: var(--s5); scrollbar-width: thin; }
.sub-tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 10px 12px; margin-bottom: -1px; white-space: nowrap; color: var(--ink-2); font-size: var(--fs-2); }
.sub-tab:hover { border-color: transparent; border-bottom-color: var(--line-strong); color: var(--ink); }
.sub-tab[aria-selected="true"] { background: transparent; border-color: transparent; border-bottom-color: var(--primary-ink); color: var(--ink); }
.sub-tab[aria-selected="true"] .ic { color: var(--primary-ink); }

/* Lists of settings items (ring groups, menus, schedules, passkeys...): one grouped list instead of a box per row */
.route-list { gap: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); overflow: hidden; }
.route-list > li { border: 0; border-radius: 0; border-top: 1px solid var(--line); padding: var(--s3) var(--s4); }
.route-list > li:first-child { border-top: 0; }

/* Tables */
table.calls th, .table-wrap th { font-size: var(--fs-1); font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.table-wrap tbody tr:hover > td { background: var(--card-2); }

/* Chips: one pill shape */
.chip { border-radius: var(--r-pill); font-size: var(--fs-1); }

/* The "…" menu button: one quiet icon button everywhere (no box around it) */
.qa-btn { width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--ink-2); font-size: 18px; }
.qa-btn:hover, .qa.open > .qa-btn, .qa:focus-within > .qa-btn { background: var(--sunken); color: var(--ink); }
.qa-menu { border-color: var(--line); border-radius: var(--r-card); box-shadow: var(--sh-2); }
.qa-item:hover, .qa-item:focus-visible { background: var(--sunken); }
@media (pointer: coarse) { .qa-btn { width: 44px; min-width: 44px; height: 44px; min-height: 44px; } }

/* ==== Refresh: individual screens ==== */
/* Messages: no empty details column until a conversation is open */
@media (min-width: 1281px) {
  .cv:has(.cv-side:empty) { grid-template-columns: minmax(270px, 320px) minmax(0, 1fr); }
  .cv-side:empty { display: none !important; }
}
@media (min-width: 1600px) { .cv:has(.cv-side:empty) { grid-template-columns: 200px minmax(280px, 340px) minmax(0, 1fr); } }
.cv > .card { border-radius: var(--r-card); box-shadow: var(--sh-1); }
.cv-list-head h1 { white-space: nowrap; }

/* Calendar: fills the page like the other screens; a month is one grid with hairlines, not a box per day */
#calendar .card, #calendar .cal-grid { max-width: none; margin-left: 0; margin-right: 0; }
#calendar .cal-head h2 { text-align: left; min-width: 0; }
#calendar .cal-cells { gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; }
#calendar .cal-cell { border: 0; border-radius: 0; background: var(--card); min-height: 104px; }
#calendar .cal-cell.out { background: var(--card-2); opacity: 1; color: var(--muted); }
#calendar .cal-dows { gap: 1px; }

/* Team: names stay on one line; status drops below when space is tight */
#team .member { border-radius: var(--r-card); box-shadow: var(--sh-1); }
#team .member-top { flex-wrap: wrap; }
#team .member-who { flex: 1 1 160px; min-width: 0; }
#team .member-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Campaigns: the two starting buttons sit side by side */
#campaigns .cmp-new { display: inline-block; margin-right: var(--s2); vertical-align: top; }

/* Segmented filters keep their numbers beside the words */
.seg button { white-space: nowrap; }
/* Page width rule: cards line up with the page heading on the left instead of floating in the middle */
.page .card { margin-left: 0; margin-right: 0; }
/* Messages on phones: the view picker takes what it needs and search gets the rest */
@media (max-width: 760px) {
  .cv-list-tools { display: flex; gap: var(--s2); align-items: center; }
  .cv-list-tools .cv-viewpick { width: auto; flex: 0 1 auto; max-width: 55%; }
  .cv-list-tools #cvSearch { flex: 1 1 auto; min-width: 0; width: auto; }
}
/* Empty right-hand panes (fax preview, texts thread): one centred, quiet message */
.preview-empty .pe-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--sunken); color: var(--muted); margin: 0 auto var(--s2); }
.preview-empty .pe-ic .ic { width: 22px; height: 22px; }
.preview-empty p { margin: 0; }
#thread:has(> .thread-empty:only-child) { display: grid; place-items: center; min-height: 320px; }

/* App Review sign-in (src/review.js) */
.signin-review { margin-top: var(--s3); text-align: left; display: grid; gap: var(--s2); justify-items: start; }
.signin-review .signin-code { width: 100%; }
.review-bar { position: fixed; left: 50%; top: calc(var(--top-h, 64px) + 8px); bottom: auto; transform: translateX(-50%); z-index: 95; max-width: min(560px, calc(100vw - 24px));
  padding: 6px 14px; border-radius: var(--r-pill); background: var(--ink); color: var(--card); font-size: var(--fs-1); font-weight: 500; text-align: center; white-space: nowrap; box-shadow: var(--sh-2); pointer-events: none; }
.review-codes .review-fresh { padding: var(--s3) var(--s4); border-radius: var(--r-ctl); background: var(--ok-soft); display: grid; gap: var(--s1); }
.review-codes .review-fresh p { margin: 0; }
.review-codes .review-fresh code { font-size: var(--fs-3); font-weight: 600; letter-spacing: .04em; user-select: all; }

/* iPhone app, sign-in screen: the band behind the clock is navy like the page (white clock), not the light top bar's colour. */
html.in-app:has(#signin:not([hidden])) body::before { background: var(--navy); }

/* Dialer: speed-dial chips and "Call from" (dialerExtras in app.js). */
.dialer-speed { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.dialer-speed .chip-btn { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.dialer-speed .chip-btn small { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 2px; }
.dialer-from { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.dialer-from span { white-space: nowrap; font-size: 14px; color: var(--muted); }
.dialer-from select { flex: 1; min-width: 0; }

/* My preferences → Emergency calls (911). */
.e911-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.e911-list li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.e911-list .ic { flex: none; margin-top: 3px; color: var(--muted); }
.e911-list .warn-text { color: var(--warn-ink, #8a4b00); }

/* To do: kind chips (All · Voicemail · Missed · Texts · Faxes) and the inline voicemail player. */
.todo-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.kind-chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 12px; min-height: 36px; font: inherit; font-size: 14px; cursor: pointer; }
.kind-chip .n { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 2px; }
.kind-chip[aria-checked="true"] { background: var(--navy, #0a1a2e); border-color: var(--navy, #0a1a2e); color: #fff; }
.kind-chip[aria-checked="true"] .n { color: rgba(255,255,255,.75); }
.todo-player { grid-column: 1 / -1; margin-top: 8px; }

/* Voicemail: the one-line summary above the transcript. */
.vm-summary { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0 6px; font-weight: 600; color: var(--ink); }
.vm-summary .ic { flex: none; margin-top: 3px; color: var(--accent, #b91c2b); }

/* Messages: attach pictures and files to a text. */
.cv-attach { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.cv-attach-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* Team chat: replies, pictures, reactions, "Seen by". */
.chat-quote { display: block; border-left: 3px solid var(--line); padding: 2px 8px; margin: 4px 0; color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 520px; }
.chat-quote b { color: var(--ink); font-weight: 600; }
.chat-media { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chat-media img { max-width: 220px; max-height: 220px; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; }
.chat-rxs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chat-rxs:empty { display: none; }
.chat-rx { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 2px 8px; font: inherit; font-size: 13px; cursor: pointer; min-height: 28px; }
.chat-rx.mine { border-color: #9db6dc; background: var(--blue-soft); }
.chat-rx span { color: var(--muted); }
.chat-rx-pick { display: inline-flex; gap: 2px; margin-left: 6px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.chat-rx-pick button { border: 0; background: none; font-size: 18px; min-width: 32px; min-height: 32px; cursor: pointer; border-radius: 8px; }
.chat-rx-pick button:hover { background: var(--blue-soft); }
.chat-seen { display: block; margin-top: 2px; }
.chat-replying { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); padding: 4px 8px; border-left: 3px solid var(--line); margin-bottom: 6px; }
.chat-pics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chat-compose-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-compose-row textarea { flex: 1; }
.chat-attach { cursor: pointer; }
.chat-msg.flash > div { background: var(--blue-soft); border-radius: 8px; transition: background .3s; }

/* ==== Dialer (redesign): a phone keypad, not a form. Big digits, round keys, a round green call button. ==== */
#dialer .dialer-box { max-width: 380px; margin: 8vh auto 0; padding: 14px 22px 22px; display: flex; flex-direction: column; gap: 0; border-radius: 22px; }
#dialer .dl-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 8px; }
#dialer .dl-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; margin-left: -10px; }
#dialer .dl-close:hover { background: var(--chip); color: var(--ink); }
#dialer .dl-close .ic { width: 22px; height: 22px; }
#dialer .dl-from { display: inline-flex; align-items: center; gap: 6px; background: var(--chip); border-radius: 999px; padding: 0 4px 0 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
#dialer .dl-from[hidden] { display: none; }
#dialer .dl-from select { border: 0; background-color: transparent; font: inherit; font-weight: 600; color: var(--ink); min-height: 34px; padding: 0 30px 0 2px; box-shadow: none; background-position: right 8px center; }
#dialer .dl-display { text-align: center; padding: 6px 0 4px; }
#dialer .dl-number { width: 100%; border: 0 !important; background: none; box-shadow: none !important; outline: none; text-align: center; font-size: 32px !important; font-weight: 500; letter-spacing: .01em; color: var(--ink); min-height: 52px; padding: 0; font-variant-numeric: tabular-nums; caret-color: var(--accent, #b91c2b); }
#dialer .dl-number::placeholder { color: var(--muted); font-size: 22px; font-weight: 400; opacity: .7; }
#dialer .dl-match { min-height: 20px; margin: 2px 0 0; font-size: 14px; color: var(--muted); font-weight: 500; }
#dialer .dialer-hits { margin: 6px 0 2px; }
#dialer .dialer-speed { justify-content: center; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 8px -22px 4px; padding: 2px 22px; }
#dialer .dialer-speed::-webkit-scrollbar { display: none; }
#dialer .dialer-speed .chip-btn { flex: none; background: var(--card); }
#dialer .dialpad { display: grid; grid-template-columns: repeat(3, 76px); justify-content: center; gap: 14px 26px; margin: 14px 0 6px; }
#dialer .dialpad button { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--chip); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; font: inherit; cursor: pointer; transition: background .12s, transform .08s; -webkit-tap-highlight-color: transparent; }
#dialer .dialpad button:hover { background: var(--line); }
#dialer .dialpad button:active { background: var(--line-strong); transform: scale(.96); }
#dialer .dialpad button b { font-size: 30px; font-weight: 400; line-height: 1.05; }
#dialer .dialpad button small { min-height: 12px; font-size: 10px; font-weight: 700; letter-spacing: .16em; color: var(--muted); }
#dialer .dl-actions { display: grid; grid-template-columns: repeat(3, 76px); justify-content: center; gap: 0 26px; align-items: center; margin-top: 8px; }
#dialer .dl-call { width: 76px; height: 76px; border-radius: 50%; border: 0; background: #16a34a; color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgba(22, 163, 74, .35); transition: transform .08s, background .12s; }
#dialer .dl-call:hover { background: #15803d; }
#dialer .dl-call:active { transform: scale(.95); }
#dialer .dl-call .ic { width: 32px; height: 32px; }
#dialer .dl-del { width: 76px; height: 76px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
#dialer .dl-del:hover { color: var(--ink); background: var(--chip); }
#dialer .dl-del .ic { width: 28px; height: 28px; }
#dialer .dl-del[hidden] { visibility: hidden; display: grid; }
#dialer .dl-note { text-align: center; margin: 14px 0 0; }
#dialer .modal-head, #dialer .actions { display: none; }
@media (max-width: 900px) {
  #dialer .dialer-box { max-width: none; margin: 0; min-height: 100%; border-radius: 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); justify-content: flex-start; }
  #dialer .dl-display { padding-top: 6vh; }
  #dialer .dialpad { margin-top: auto; }
  #dialer .dialer-speed { margin-left: -16px; margin-right: -16px; padding: 2px 16px; justify-content: flex-start; }
}
@media (max-height: 700px) and (max-width: 900px) {
  #dialer .dialpad { grid-template-columns: repeat(3, 68px); gap: 10px 22px; }
  #dialer .dialpad button, #dialer .dl-call, #dialer .dl-del { width: 68px; height: 68px; }
  #dialer .dl-actions { grid-template-columns: repeat(3, 68px); gap: 0 22px; }
  #dialer .dl-display { padding-top: 2vh; }
}
html.in-app #dialer .dialer-box { padding-top: calc(10px + env(safe-area-inset-top)); }
@media (min-width: 901px) and (max-height: 860px) {
  #dialer .dialer-box { margin-top: 3vh; }
  #dialer .dialpad { grid-template-columns: repeat(3, 64px); gap: 10px 24px; margin-top: 10px; }
  #dialer .dialpad button, #dialer .dl-call, #dialer .dl-del { width: 64px; height: 64px; }
  #dialer .dialpad button b { font-size: 26px; }
  #dialer .dl-actions { grid-template-columns: repeat(3, 64px); gap: 0 24px; }
}

/* Dialer: calls waiting in park (one tap takes the call). */
#dialer .dl-parked { display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none; margin: 4px 0 6px; padding: 2px 0; }
#dialer .dl-parked[hidden] { display: none; }
#dialer .dl-parked-head { flex: none; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
#dialer .dl-park { flex: none; display: grid; text-align: left; gap: 1px; border: 1px solid #f2c46d; background: var(--warn-soft, #fff7e6); color: var(--ink); border-radius: 12px; padding: 6px 12px; font: inherit; cursor: pointer; min-height: 44px; }
#dialer .dl-park b { font-size: 13px; }
#dialer .dl-park span { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Text size choice in the account menu (theme.js). */
.theme-pick .seg .ts-l { font-size: 15px; } .theme-pick .seg .ts-xl { font-size: 18px; }

/* The customer card (CRM) on a person's page, and "My customer tasks" in the address book */
.person-crm { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px 18px; display: grid; gap: 14px; max-width: 860px; margin-top: 12px; }
.crm-head { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 18px; }
.crm-head h2 { margin: 0 auto 0 0; font-size: 18px; }
.crm-head label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.crm-head select { min-width: 170px; }
.crm-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.crm-box { display: grid; gap: 8px; align-content: start; border-top: 1px solid var(--line); padding-top: 10px; }
.crm-box h3 { margin: 0; font-size: 15px; }
.crm-box h3 small, .crm-mine h2 small { color: var(--muted); font-weight: 500; font-size: 13px; }
.crm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.crm-list > li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; font-size: 14px; }
.crm-list small { color: var(--muted); font-size: 13px; }
.crm-task small { grid-column: 1; padding-left: 28px; }
.crm-task .icon-btn { grid-row: 1 / span 2; grid-column: 2; }
.crm-task.done label span { text-decoration: line-through; color: var(--muted); }
.crm-task.late small { color: var(--bad, #b42318); font-weight: 600; }
.crm-deal { grid-template-columns: 1fr auto auto !important; }
.crm-deal > div { display: grid; }
.crm-deal.won b { color: var(--good, #067647); }
.crm-deal.lost b { color: var(--muted); text-decoration: line-through; }
.crm-note { grid-template-columns: 1fr auto !important; }
.crm-note p { margin: 0; white-space: pre-wrap; }
.crm-note small { grid-column: 1; }
.crm-note .icon-btn { grid-row: 1 / span 2; grid-column: 2; }
.crm-add { display: grid; gap: 6px; }
.crm-add-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.crm-add-row label { display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.crm-add-row .btn { margin-left: auto; }
.crm-done summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.crm-mine { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 14px; display: grid; gap: 8px; }
.crm-mine h2 { margin: 0; font-size: 16px; }
.crm-mine a { display: grid; text-decoration: none; color: inherit; }
.crm-mine .crm-task small { padding-left: 0; }
.rc-crm span { font-weight: 600; }
@media (max-width: 560px) { .person-crm { padding: 14px; } .crm-head select { min-width: 0; width: 100%; } .crm-head label { flex: 1 1 140px; } }
/* The add forms stay one line until someone starts one */
.crm-add:not(:focus-within):has(> input:placeholder-shown, > textarea:placeholder-shown) .crm-add-row { display: none; }
.crm-add:not(:focus-within):has(> textarea:placeholder-shown) textarea { min-height: 0; height: 42px; }

/* Live Help: the sharer's banner and Freedom Tech's pointer; the staff viewer */
.live-banner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 12px;
  background: #0a1a2e; color: #fff; padding: 8px 10px 8px 16px; border-radius: 0 0 14px 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); font-size: 14px; max-width: calc(100vw - 16px); }
.live-banner .btn { background: #fff; color: #0a1a2e; border-color: #fff; }
.live-banner .lb-code { font-size: 18px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.lb-dot { width: 10px; height: 10px; border-radius: 50%; background: #f5a524; flex: none; }
.lb-dot.live { background: #ef4444; animation: lb-blink 1.4s ease-in-out infinite; }
@keyframes lb-blink { 50% { opacity: .35; } }
.live-pointer { position: fixed; left: 0; top: 0; z-index: 1001; pointer-events: none; transition: transform .08s linear; }
.live-pointer::before { content: ""; position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; border: 3px solid #e11d48; background: rgba(225, 29, 72, .15); }
.live-pointer.pulse::before { animation: lp-pulse .7s ease-out 2; }
@keyframes lp-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.8); opacity: .5; } 100% { transform: scale(1); } }
.live-pointer span { position: absolute; left: 16px; top: 12px; background: #e11d48; color: #fff; font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.live-join { display: flex !important; flex-wrap: wrap; align-items: end; gap: 12px 16px; max-width: none !important; margin-bottom: 16px; }
.live-join > div { flex: 1 1 280px; }
.live-join h2 { margin: 0; font-size: 17px; }
.live-join label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.live-join input { font-size: 20px; letter-spacing: .1em; width: 9ch; font-variant-numeric: tabular-nums; }
.live-view { position: fixed; inset: 0; z-index: 1002; background: #05080f; display: grid; grid-template-rows: auto 1fr; }
.lv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; color: #fff; border-bottom: 1px solid #1f2a3a; }
.lv-head > div { display: grid; margin-right: auto; }
.lv-head small, .lv-head .fine { color: #b8c3d1; margin: 0; }
.lv-stage { position: relative; min-height: 0; cursor: crosshair; display: grid; place-items: center; padding: 8px; }
.lv-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: 8px; }
.live-card .live-start { margin: 10px 0 0; }

/* Settings → Apps: chat alerts and Zapier */
.ca-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ca-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.ca-item.paused { opacity: .75; }
.ca-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ca-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.ca-evs { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ca-evs legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.ca-add summary { cursor: pointer; font-weight: 600; }
.ca-add form { margin-top: 10px; }
.ok-text { color: var(--good, #067647); }
.zap-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* AI call scores (under a recorded call's summary) */
.score-box { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.score-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; }
.score-chip { font-weight: 700; font-size: 14px; padding: 2px 10px; border-radius: 999px; background: var(--chip, #eef1f5); }
.score-chip.good { background: #dcfce7; color: #14532d; }
.score-chip.fair { background: #fef3c7; color: #78350f; }
.score-chip.poor { background: #fee2e2; color: #7f1d1d; }
.score-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 14px; }
.score-items li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; }
.score-items small { color: var(--muted); }
.sc-mark { font-weight: 700; text-align: center; }
.sc-met .sc-mark { color: #15803d; }
.sc-missed .sc-mark { color: #b91c1c; }
.sc-na { color: var(--muted); }
.score-tip { margin: 0; font-size: 14px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .score-chip.good { background: #14532d; color: #dcfce7; } :root:not([data-theme="light"]) .score-chip.fair { background: #78350f; color: #fef3c7; } :root:not([data-theme="light"]) .score-chip.poor { background: #7f1d1d; color: #fee2e2; } }
:root[data-theme="dark"] .score-chip.good { background: #14532d; color: #dcfce7; }
:root[data-theme="dark"] .score-chip.fair { background: #78350f; color: #fef3c7; }
:root[data-theme="dark"] .score-chip.poor { background: #7f1d1d; color: #fee2e2; }

/* Group texts in Messages */
.cv-from { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 2px 4px; }
.cv-av.grp { background: var(--accent-soft, #e0e7ff); color: var(--accent, #1e3a8a); font-weight: 700; }

/* My preferences → Shared desk phones */
.hd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hd-desk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.hd-desk > div { display: grid; flex: 1 1 200px; }
.hd-desk small { color: var(--muted); font-size: 13px; }
.hd-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.hd-admin summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }

/* Inside the iPhone app, its own tab bar replaces the page's (app.js: ft-tabs). */
html.ft-tabs .tabbar { display: none !important; }
html.ft-tabs .app { --tab-h: 0px !important; }

/* The call flow map (drawn as SVG in app.js). These rules live here because the security policy drops a <style>
   written into the page; the copy inside the SVG is only used by Export picture. */
#flowSvg .flow-edge { fill: none; stroke: #8a94a6; stroke-width: 2; }
#flowSvg .flow-edge.lit { stroke: #c8102e; stroke-width: 3.5; }
#flowSvg .flow-elabel { font: 600 13px system-ui, sans-serif; fill: #4b5563; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
#flowSvg .flow-box { fill: #fff; stroke: #cfd6e0; stroke-width: 1.5; }
#flowSvg .flow-node.lit .flow-box { stroke: #c8102e; stroke-width: 3; }
#flowSvg .flow-node.faint { opacity: .55; }
#flowSvg .flow-title { font: 600 14px system-ui, sans-serif; fill: #0f172a; }
#flowSvg .flow-sub { font: 13px system-ui, sans-serif; fill: #4b5563; }
#flowSvg .flow-handle { fill: #fff; stroke: #1d63b4; stroke-width: 3; cursor: grab; }
#flowSvg .flow-handle:hover, #flowSvg .flow-handle.on, #flowSvg .flow-handle:focus { fill: #1d63b4; outline: none; }
#flowSvg .flow-drag { stroke: #1d63b4; stroke-width: 3; stroke-dasharray: 6 5; fill: none; }
#flowSvg .flow-node.drop .flow-box { stroke: #1d63b4; stroke-width: 3.5; }
#flowSvg .flow-node { cursor: pointer; }
/* Printing one dialing card in a window of its own. */
body.print-page { background: #fff; padding: 24px; font: 15px/1.4 system-ui, sans-serif; }
body.print-page .no-print { display: none; }
body.print-page .dial-card { border: 0; box-shadow: none; break-inside: avoid; margin-bottom: 24px; }

/* ---- Support page (#/support): three cards on top, then tickets ---- */
.support .page-head .btn { flex: none; }
.sp-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.page .card.sp-card, .page .card.sp-tickets, .page .card.sp-detail { max-width: none; margin: 0; width: auto; }
.page .card.sp-card { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s5); }
.sp-card p { margin: 0; }
.sp-card-head { display: flex; align-items: center; gap: var(--s3); }
.sp-card-head h2 { margin: 0; font-size: var(--fs-4); }
.sp-act { margin-top: auto !important; padding-top: var(--s2); }
.sp-card .fine { margin: 0; }
.sp-note { color: var(--ink-2); }
.sp-code { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--s3) var(--s4); border-radius: var(--r-ctl); background: var(--primary-soft); }
.sp-digits { font-size: 36px; line-height: 1.15; font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--primary-ink); }
.sp-digits.gone { text-decoration: line-through; opacity: .6; }
.sp-code .fine { color: var(--ink-2); }
.sp-phone { font-size: var(--fs-5); font-weight: 700; }
.sp-phone a { text-decoration: none; color: var(--blue); }
.sp-phone a:hover { text-decoration: underline; }

.page .card.sp-tickets { display: grid; gap: var(--s4); }
.sp-tickets-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.sp-tickets-head h2 { margin: 0; font-size: var(--fs-5); }
.sp-tickets-head .fine { margin: 2px 0 0; }
.sp-sec { display: flex; align-items: center; gap: var(--s2); margin: var(--s2) 0 var(--s2); font-size: var(--fs-2); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sp-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--sunken); color: var(--ink-2); font-size: var(--fs-1); letter-spacing: 0; }
.sp-list { list-style: none; margin: 0 0 var(--s3); padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.sp-list li + li { border-top: 1px solid var(--line); }
.sp-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: var(--s1) var(--s3); padding: var(--s3) var(--s4); color: var(--ink); text-decoration: none; min-height: 52px; }
.sp-row:hover { background: var(--card-2); }
.sp-row:focus-visible { outline: 3px solid #7fb0e8; outline-offset: -3px; }
.sp-num { font-size: var(--fs-1); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-list.closed .sp-title { font-weight: 500; color: var(--ink-2); }
.sp-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s1) var(--s3); font-size: var(--fs-1); color: var(--muted); }
.sp-status { display: inline-block; padding: 2px 9px; border-radius: var(--r-pill); font-size: var(--fs-1); font-weight: 600; white-space: nowrap; }
.sp-status.warn { background: var(--warn-soft); color: var(--warn); }
.sp-status.info { background: var(--blue-soft); color: var(--blue); }
.sp-status.wait { background: var(--violet-soft); color: var(--violet); }
.sp-status.ok { background: var(--ok-soft); color: var(--ok); }
.sp-status.done { background: var(--sunken); color: var(--ink-2); }
.sp-pri-w { font-weight: 600; color: var(--ink-2); }
.sp-pri-w.high { color: var(--warn); }
.sp-pri-w.urgent { color: var(--bad); }
.sp-empty { margin: 0 0 var(--s3); padding: var(--s4); border: 1px dashed var(--line-strong); border-radius: var(--r-card); color: var(--muted); }
.sp-off { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); border-radius: var(--r-card); background: var(--sunken); }
.sp-off > .ic { width: 22px; height: 22px; flex: none; color: var(--blue); margin-top: 2px; }
.sp-off p { margin: 0 0 var(--s1); }
.sp-map { margin: 0; padding: var(--s2) var(--s3); border-left: 3px solid var(--line-strong); color: var(--ink-2); }

.sp-new { display: grid; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card-2); }
.sp-new h3 { margin: 0; font-size: var(--fs-4); }
.sp-new .fine { margin: -4px 0 0; }
.sp-new .actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.sp-pri { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0; padding: 0; border: 0; }
.sp-pri legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: var(--fs-2); }
.sp-radio { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--card); font-weight: 500; cursor: pointer; }
.sp-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.sp-radio:has(input:checked) { background: var(--primary-soft); border-color: var(--primary-ink); color: var(--primary-ink); font-weight: 600; }
.sp-radio:has(input:focus-visible) { outline: 3px solid #7fb0e8; outline-offset: 2px; }

.page .card.sp-detail { display: grid; gap: var(--s3); }
.sp-detail > p { margin: 0; }
.sp-back { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; min-height: 32px; }
.sp-back .ic { width: 18px; height: 18px; }
.sp-d-head { display: grid; gap: 2px; }
.sp-d-head h2 { margin: 0; font-size: var(--fs-5); }
.sp-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s3) var(--s4); margin: 0; padding: var(--s4); border-radius: var(--r-card); background: var(--sunken); }
.sp-facts dt { font-size: var(--fs-1); color: var(--muted); }
.sp-facts dd { margin: 2px 0 0; font-weight: 600; }
.sp-desc { white-space: pre-wrap; overflow-wrap: anywhere; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); max-height: 480px; overflow: auto; }

@media (max-width: 1100px) { .sp-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .sp-top { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .page .card.sp-card, .page .card.sp-tickets, .page .card.sp-detail { padding: var(--s4); }
  .sp-row { grid-template-columns: minmax(0, 1fr); padding: var(--s3); }
  .sp-title { white-space: normal; }
  .sp-meta { justify-content: flex-start; }
  .sp-tickets-head .btn { width: 100%; }
  .support .page-head .btn { width: 100%; }
}
/* Clients → a client → Help desk tickets: suggested DeskDay customers */
.dd-sugg { list-style: none; margin: 0 0 var(--s3); padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); }
.dd-sugg li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); padding: var(--s2) var(--s3); }
.dd-sugg li + li { border-top: 1px solid var(--line); }
.dd-sugg li > div { min-width: 0; overflow-wrap: anywhere; }
/* Settings pages: the tabs line up with the cards below them (760px) and, on a computer, wrap onto a second row
   instead of running off the right edge (Call routing has seven). Phones keep the one sideways-scrolling row. */
.set-body .sub-tabs { max-width: 760px; }
@media (min-width: 901px) { .set-body .sub-tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; } }

/* Settings → Sign-in safety: groups of choices */
.choice-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 6px; margin: 0 0 12px; min-width: 0; }
.choice-group legend { font-weight: 600; padding: 0 4px; }
.choice-group > .fine { margin: 2px 0 8px; }
#signinCheck .check { margin-top: 12px; text-align: left; }
#signinCheck .btn { width: 100%; }
.choice-group .check { align-items: flex-start; margin: 8px 0; }
.choice-group .check input { flex: none; margin-top: 3px; }
.rep-table.wrap-cells td { white-space: normal; overflow-wrap: break-word; min-width: 72px; }
.rep-table.wrap-cells td.nowrap { white-space: nowrap; }

/* ---- Call queues: my status in the Team menu, wrap-up codes, call script, the live board on the Team page ---- */
.queue-mine { padding: 6px 4px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.qm-head { margin: 0 0 8px; }
.qm-head > span { display: grid; }
.qm-head small { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.qm-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qm-reason select { min-height: 44px; font-size: 14px; max-width: 150px; }
.qm-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.qm-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qm-list li > span { display: grid; min-width: 0; }
.qm-list small { color: var(--ink-2); font-size: 13px; }
.team-sum { position: relative; }
.team-sum.q-away::after { content: ""; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #a78bfa; border: 2px solid var(--navy); }
.pdot.off { background: #94a3b8; }

.wrap-box { position: fixed; z-index: 14; right: 16px; bottom: 16px; width: min(380px, calc(100% - 32px)); padding: 14px 16px; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); }
.wrap-head { margin: 0 0 10px; display: grid; gap: 2px; }
.wrap-head small { color: var(--ink-2); font-size: 13px; }
.wrap-codes { display: flex; flex-wrap: wrap; gap: 6px; }
.wrap-note { display: block; margin-top: 10px; }
.wrap-note input { width: 100%; min-height: 44px; }
.wrap-acts { margin: 8px 0 0; text-align: right; }
body.on-call .wrap-box { bottom: 96px; }
@media (max-width: 900px) { .wrap-box { left: 12px; right: 12px; width: auto; bottom: calc(var(--tab-h, 0px) + 12px); } body.on-call .wrap-box { bottom: calc(var(--tab-h, 0px) + 96px); } }

.call-script { position: fixed; z-index: 11; left: 12px; bottom: 78px; width: min(420px, calc(100% - 24px)); max-height: 45vh; overflow: auto; padding: 12px 14px; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); }
.cs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
.cs-text { margin: 0; white-space: pre-wrap; font-size: 15px; }
@media (max-width: 900px) { .call-script { bottom: calc(var(--tab-h, 0px) + 84px); } }
.rc-script { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: var(--blue-soft); color: var(--ink); }
.rc-script b { font-size: 13px; }
.rc-script p { margin: 2px 0 0; white-space: pre-wrap; font-size: 14px; }

#queueLive { margin-bottom: 16px; }
.ql-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.ql-head h2 { margin: 0; font-size: 17px; }
.ql-reason { display: grid; gap: 2px; font-size: 13px; color: var(--ink-2); }
.ql-reason select { min-height: 40px; }
.ql-queues { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ql-q { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card-2); }
.ql-q.over { border: 2px solid var(--bad); }
.ql-name { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ql-name .chip { margin-top: 0; }
.ql-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 6px; }
.ql-nums b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ql-nums div > span { font-size: 13px; color: var(--ink-2); }
.ql-q .fine { margin: 6px 0 0; color: var(--ink-2); }
.ql-sub { font-size: 15px; margin: 16px 0 6px; }
.ql-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ql-people li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.ql-who { min-width: 0; }
.ql-who small { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.ql-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ql-chips .chip { min-height: 32px; padding: 4px 10px; border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: 13px; margin: 0; }
.ql-acts { display: flex; flex-wrap: wrap; gap: 6px; }
/* People routing (My preferences → Where my calls go / My voicemail, and an extension's routing for office admins) */
.pr-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 0; min-width: 0; display: grid; gap: 10px; }
.pr-box legend { font-weight: 600; font-size: 15px; padding: 0 4px; }
.pr-status { display: flex; flex-wrap: wrap; gap: 8px; }
.pr-pill { border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; min-height: 40px; cursor: pointer; }
.pr-pill[aria-checked="true"] { background: var(--primary, var(--blue)); border-color: var(--primary, var(--blue)); color: #fff; font-weight: 600; }
.pr-pill:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.pr-line { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px; align-items: center; }
.pr-label { font-weight: 600; font-size: 14px; }
.pr-dest { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.pr-dest select, .pr-dest input { flex: 1 1 160px; min-width: 0; }
.pr-step, .pr-rule { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.pr-step select, .pr-step > input, .pr-rule input, .pr-rule select { flex: 1 1 170px; min-width: 0; }
.pr-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--chip); color: var(--ink); font-weight: 700; font-size: 13px; flex: none; }
.screen-form label.pr-sec { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.pr-step label.pr-sec { white-space: nowrap; flex-wrap: nowrap; }
.pr-sec input { width: 76px; }
.pr-day { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.pr-day span { font-size: 14px; color: var(--muted); }
.pr-mode { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.pr-greet { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); list-style: none; }
.pr-new { margin-top: 12px; }
.pr-new summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
@media (max-width: 560px) {
  .pr-line { grid-template-columns: 1fr; }
  .pr-day { grid-template-columns: 1fr auto 1fr; }
  .pr-day label.check { grid-column: 1 / -1; }
}
/* ---- Office status switch (batch 6): header, account menu on phones, call flow page ---- */
.office-menu { position: relative; }
.office-sum { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--top-field-line, var(--line)); background: var(--top-field, var(--card-2)); color: var(--top-ink, var(--ink)); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.office-sum::-webkit-details-marker { display: none; }
.office-sum:hover, .office-menu[open] > .office-sum { border-color: var(--line-strong); }
.odot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ok); }
.odot.holiday { background: var(--violet); }
.odot.emergency { background: var(--bad); }
.odot.weather, .odot.closed { background: var(--warn); }
.office-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(360px, calc(100vw - 16px)); max-height: min(75vh, 560px); overflow: auto; padding: 12px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.office-switch { display: grid; gap: 10px; }
.office-switch .fine { margin: 0; }
.office-now { display: flex; align-items: flex-start; gap: 10px; margin: 0; }
.office-now .odot { margin-top: 6px; }
.office-now b { display: block; font-size: 15px; }
.office-now small { display: block; font-size: 13px; }
.office-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0; background: none; border: 0; }
.office-seg button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.office-seg button[aria-checked="true"] { border-color: var(--blue); background: var(--blue-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--blue); }
.office-seg button:disabled { opacity: .6; cursor: default; }
.office-form { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); }
.office-form label { display: grid; gap: 4px; font-size: 14px; }
.office-form select, .office-form input { min-height: 40px; font: inherit; font-size: 14px; }
.office-form .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.menu-list > .office-item { display: none; }
#flowStatus .office-switch { margin-top: 8px; }
.mode-ed { display: grid; gap: 8px; margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.mode-ed legend { font-weight: 600; padding: 0 4px; }
.mode-note { display: grid; gap: 8px; }
.hol-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.hol-add { margin-top: 8px; }
.hol-add > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--blue); }
#holExtrasForm fieldset { display: grid; gap: 8px; margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
#holExtrasForm legend { font-weight: 600; padding: 0 4px; }
/* Phones and small windows: no room in the header row, so the switch opens from the account menu. */
@media (max-width: 900px) {
  .top > .office-menu { position: absolute; width: 0; height: 0; overflow: visible; }
  .top > .office-menu > .office-sum { display: none; }
  .office-menu[open] .office-pop { position: fixed; top: calc(env(safe-area-inset-top) + 64px); left: 8px; right: 8px; width: auto; max-height: calc(100dvh - 80px - var(--tab-h, 0px)); }
  .menu-list > .office-item:not([hidden]) { display: flex; }
}
.flow-side .card { align-content: start; }

/* Batch 9: wallboard layouts (Settings → Phone → TV wallboard), booking pages, the Book dialog, bells history. */
.wall-list, .bk-pages { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; }
.wall-list > li, .bk-pages > li { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.wall-head, .bk-head { display: flex; flex-direction: column; gap: 2px; }
.wall-tiles ol { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.wall-tiles li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
.wall-tiles li > .check { flex: 1 1 200px; margin: 0; }
.wall-size select { min-width: 9em; }
.wall-move { display: flex; gap: 4px; }
.wall-move .btn { min-width: 44px; min-height: 36px; font-size: 16px; }
.wall-form fieldset, .bk-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; display: grid; gap: 8px; }
.wall-form legend, .bk-form legend { font-weight: 600; padding: 0 4px; }
.bk-qs { display: grid; gap: 6px; }
.bk-qs .row2 { align-items: end; }
.book-box .modal-box { height: auto; max-height: 92vh; width: min(560px, 100%); overflow: auto; }
.book-box .book-body { padding: 16px 20px 20px; display: grid; gap: 12px; }
.book-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.book-slots .chip-btn { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong, var(--line)); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.book-slots .chip-btn[aria-pressed="true"] { background: var(--blue-soft, #e8f0fe); border-color: var(--blue, #1d4ed8); font-weight: 600; }
.book-remind { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.bell-log { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 14px; }
.bell-log li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.bell-log li b { min-width: 9em; }
.skip-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.skip-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.wx-kinds { display: grid; gap: 6px; }
.wx-kinds .row2 { align-items: center; }
.wx-places { display: grid; gap: 8px; }
.wall-list > li > *, .bk-pages > li > *, .bk-form, .wall-form { min-width: 0; }
.bk-form input:not([type=checkbox]), .bk-form textarea, .bk-form select, .wall-form input:not([type=checkbox]), .wall-form select { max-width: 100%; box-sizing: border-box; }
@media (max-width: 600px) { .wall-list > li, .bk-pages > li { padding: 10px; } }
.book-box fieldset, .wx-kinds, .wx-places { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; min-width: 0; }
.book-box legend, .wx-kinds legend, .wx-places legend { font-weight: 600; padding: 0 4px; }
/* Batch 7: one-time codes hidden until Show, client-matter time, office helpers. */
.otp { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.otp-dots { letter-spacing: 2px; color: var(--muted); }
.otp-show { font: inherit; font-size: 13px; font-weight: 600; color: var(--blue, #1d4ed8); background: none; border: 0; padding: 2px 4px; min-height: 28px; cursor: pointer; text-decoration: underline; }
.otp.shown { font-weight: 600; letter-spacing: 1px; }
#dialer .dl-top { flex-wrap: wrap; gap: 6px; }
#dialer .dl-matter select { max-width: 60vw; }
.cd-matter { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 10px 0; }
.cd-matter label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.cd-matter label.grow { flex: 1 1 220px; }
.cd-matter select, .cd-matter input { font-size: 14px; min-height: 36px; }
.matter-tag { font-weight: 600; color: var(--ink-2); }
.matter-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.matter-list li.muted .ch-body b { color: var(--muted); }
.row-acts { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.inline-form .grow { flex: 1 1 240px; }
.time-totals { width: 100%; border-collapse: collapse; font-size: 14px; }
.time-totals th, .time-totals td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.time-totals th { font-size: 13px; color: var(--muted); font-weight: 600; }
.time-list .chip { display: inline-block; width: auto; margin-top: 4px; }
.auto-contact { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.auto-contact .linkish { font-size: 13px; min-height: 28px; }
.auto-contact .chip, .auto-contact .linkish { white-space: nowrap; }
.matter-list li, .time-list li { flex-wrap: wrap; }
.matter-list .ch-body, .time-list .ch-body { flex: 1 1 200px; min-width: 0; }
@media (max-width: 600px) {
  .row-acts { margin-left: 0; width: 100%; }
  .time-totals th:nth-child(2), .time-totals td:nth-child(2) { display: none; }
}
/* Settings → Numbers & identity (numbersid.js) */
.nid-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.nid-list > li { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--card); }
.nid-list > li > div:first-child { display: grid; gap: 3px; min-width: 0; flex: 1 1 240px; }
.nid-list .fine { margin: 0; overflow-wrap: anywhere; }
.nid-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nid-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; margin-top: 4px; }
.nid-inline select { max-width: 100%; }
.nid-carrier { padding: 4px 8px; border-radius: 6px; }
.nid-carrier.ok { background: var(--ok-soft); color: var(--ok); }
.nid-carrier.bad { background: var(--bad-soft); color: var(--bad); }
.nid-pick { display: grid; gap: 6px; margin-top: 6px; }
.nid-pick .fine { margin: 6px 0 0; }
.nid-dept { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.nid-dept label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.nid-brand { margin-bottom: 10px; }
.nid-table select { min-width: 140px; }
.nid-sheet { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--card-2); margin: 12px 0; }
.nid-sheet h3 { margin: 0 0 10px; font-size: 15px; }
.team-group { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; margin: 0 0 12px; }
@media (max-width: 600px) {
  .nid-dept { grid-template-columns: 1fr; }
  .nid-sheet .kv { grid-template-columns: 1fr; }
  .nid-sheet .kv dt { margin-top: 6px; }
}
@media print {
  body.print-one * { visibility: hidden; }
  body.print-one #portSheet, body.print-one #portSheet * { visibility: visible; }
  body.print-one #portSheet { position: absolute; left: 0; top: 0; width: 100%; border: 0; background: #fff; color: #000; }
}

/* Settings → Users & roles: roles, permissions and single sign-on (batch 10a) */
.role-list { list-style: none; margin: 12px 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.role-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.role-list li:last-child { border-bottom: 0; }
.role-meta { display: flex; gap: 10px; align-items: center; white-space: nowrap; font-size: 13px; }
.role-form { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.role-form h3 { margin: 0 0 8px; }
.perm-list { display: grid; gap: 10px; margin: 8px 0 14px; }
.perm-area { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
.perm-area legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
.perm-row { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; font-weight: 400; padding: 4px 0; }
.perm-row input { margin-top: 3px; flex: none; }
.perm-readonly .perm-row { color: var(--ink); }
.perm-changed { color: var(--warn); font-weight: 600; }
.saml-facts { display: grid; grid-template-columns: minmax(0, 14em) minmax(0, 1fr); gap: 6px 12px; margin: 8px 0 16px; font-size: 14px; }
.saml-facts dt { color: var(--muted); }
.saml-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.saml-facts code { font-size: 13px; }
@media (max-width: 640px) {
  .saml-facts { grid-template-columns: 1fr; }
  .saml-facts dd { margin-bottom: 6px; }
  .role-list li { flex-direction: column; align-items: flex-start; }
}

/* Alerts → Room check (public/emap.js): the emergency map. Every status has an icon and words, not only a color. */
.em-going { border-left: 6px solid var(--primary-ink, #1d4ed8) !important; }
.em-now h2 { font-size: 24px; }
.em-since { color: var(--muted); margin: 0 0 12px; }
.em-drill { border: 2px dashed #1d4ed8 !important; }
.em-drilltag { display: inline-block; padding: 2px 10px; border-radius: 8px; background: #1d4ed8; color: #fff; font-size: 16px; letter-spacing: .06em; vertical-align: middle; }
.em-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.em-count { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; padding: 12px; border-radius: 12px; border: 2px solid currentColor; }
.em-count .ic { width: 26px; height: 26px; }
.em-count b { font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }
.em-count span { grid-column: 1 / -1; font-weight: 600; font-size: 15px; }
.em-count.em-safe, .em-badge.em-safe { color: var(--ok); background: var(--ok-soft); }
.em-count.em-help, .em-badge.em-help { color: var(--bad); background: var(--bad-soft); }
.em-count.em-none, .em-badge.em-none { color: var(--ink); background: var(--line); }
.em-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 6px; border-radius: 999px; border: 1.5px solid currentColor; font-weight: 700; font-size: 14px; white-space: nowrap; }
.em-badge .ic { width: 16px; height: 16px; }
.em-report { display: grid; gap: 12px; }
.em-report select, .em-report input { font-size: 17px; }
.em-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.em-choice { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 72px; padding: 14px; border-radius: 14px; border: 0; color: #fff; font: inherit; font-size: 20px; font-weight: 700; cursor: pointer; }
.em-choice .ic { width: 28px; height: 28px; }
.em-choice.em-safe { background: #166534; } .em-choice.em-help { background: #b91c1c; }   /* fixed shades: white text stays readable in dark mode */
.em-choice:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.em-choice:disabled { opacity: .6; cursor: default; }
.em-link { display: flex; gap: 8px; }
.em-link input { flex: 1; min-width: 0; font-size: 15px; }
.em-inline { display: inline-flex; align-items: center; gap: 8px; }
.em-rooms { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.em-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.em-row b { font-size: 17px; }
.em-row.em-help { border-color: var(--bad); border-width: 2px; }
.em-pin { position: absolute; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 3px; max-width: 45%; padding: 2px 8px 2px 4px; border-radius: 999px; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4); background: #334155; color: #fff; font: 700 13px/20px inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.em-pin .ic { width: 15px; height: 15px; flex: none; }
.em-pin.em-safe { background: #166534; } .em-pin.em-help { background: #b91c1c; outline: 3px solid #facc15; z-index: 2; } .em-pin.em-none { background: #475569; } .em-pin.em-plain { background: #1e40af; }
.em-pin[data-em-drag] { cursor: grab; touch-action: none; }
.em-map.placing { cursor: crosshair; outline: 2px dashed var(--primary-ink, #1d4ed8); outline-offset: -2px; }
.em-settings fieldset { display: grid; gap: 6px; }
.em-start { display: grid; gap: 10px; }
@media (max-width: 560px) { .em-count b { font-size: 26px; } .em-count { padding: 8px; } .em-choice { font-size: 18px; min-height: 64px; } }
#emap { display: grid; gap: 18px; min-width: 0; }
#emap > .card { width: 100%; }
.em-settings fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 12px 0 0; }
.em-settings legend { font-weight: 700; padding: 0 6px; }
.em-mapwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
.em-map { min-width: 600px; max-width: 1000px; }
.em-map { touch-action: pan-x pan-y; }
/* Reports → Call sources → Website numbers */
#webNumbers { display: grid; gap: 16px; margin-top: 16px; }
#webNumbers:empty { display: none; }
.web-pool > li { flex-wrap: wrap; }
.web-pool > li > span:first-child { flex: 1 1 auto; min-width: min(200px, 100%); }
.web-pool .route-acts { flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.web-pool .route-acts select { min-width: 0; max-width: 100%; }
/* Batch 10b: spoken menu choices, phone keys */
.screen-form .key-row .key-say { grid-column: 2 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin: -2px 0 6px; }
.screen-form .key-row .key-say input { width: 100%; min-width: 0; }
.screen-form .say-note { margin-top: 6px; }
.lk-row { display: grid; grid-template-columns: 96px minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.lk-row .lk-n { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.lk-row .lk-n input { width: 52px; }
.lk-row label { margin: 0; }
.lk-row select, .lk-row input { width: 100%; min-width: 0; }
.lk-now ul { margin: 6px 0 0; padding-left: 18px; }
.pr-boss { margin: 0 0 12px; }
@media (max-width: 700px) {
  .screen-form .key-row .key-say { grid-column: 1 / -1; grid-template-columns: 1fr; gap: 4px; }
  .lk-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 8px 0; border-bottom: 1px solid var(--line); }
  .lk-row .lk-n { grid-row: 1; grid-column: 1; }
  .lk-row .lk-del { grid-row: 1; grid-column: 2; justify-self: end; }
  .lk-row .lk-label { grid-column: 1 / -1; }
}

/* Batch 11b: languages & announcing, greetings by caller, Freedom Tech extension tools (routingadmin.js) */
.ra-item { border-top: 1px solid var(--line); padding: 10px 0 4px; display: grid; gap: 6px; }
.ra-item:first-of-type { border-top: 0; padding-top: 0; }
.ra-item > p { margin: 0; }
.ra-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.ra-table th, .ra-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.ra-table tr.ra-bad td:last-child { color: var(--bad, #b42318); font-weight: 600; }
.ra-pin { font-size: 18px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.ql-name .btn { margin-left: 8px; }
/* ---- Batch 11g: PIN lock, "Is this you?" on the sign-in check, Get the apps, push to talk (apps.js) ---- */
.pin-lock { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto;
  background: radial-gradient(1200px 600px at 20% -10%, #1d3a64 0%, var(--navy) 55%); }
.pin-lock[hidden] { display: none; }
body.pin-locked > *:not(#pinLock) { visibility: hidden; }   /* nothing of the page shows behind the lock */
.pin-card { width: 100%; max-width: 380px; display: grid; gap: 12px; background: var(--card); color: var(--ink); border-radius: 16px; padding: 28px 24px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.pin-card > .ic { width: 36px; height: 36px; justify-self: center; color: var(--navy-2); }
.pin-card h1 { font-size: 22px; margin: 0; }
.pin-card label { display: grid; gap: 4px; text-align: left; font-size: 14px; font-weight: 600; }
.pin-card input { font-size: 22px; letter-spacing: 6px; text-align: center; padding: 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); color: var(--ink); }
.pin-card .fine { margin: 0; }
.check-app { margin: 4px 0 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); }
.check-app p { margin: 0 0 6px !important; }
.check-app-number { font-size: 34px; font-weight: 700; letter-spacing: 4px; color: var(--ink) !important; }
.get-apps { margin-top: 12px; }
.get-apps .qr { width: 112px; height: 112px; }
.get-apps p { margin: 0 0 8px; }
.ptt-member { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; display: grid; gap: 8px; }
.ptt-hours { display: grid; gap: 8px; }
.ptt-hours[hidden] { display: none; }
.ptt-days { display: flex; flex-wrap: wrap; gap: 4px 12px; }
/* ---- Batch 11c (msgextras.js): scheduled texts, text spam, Text the caller, keyword flags, caller mood, alert groups ---- */
.tx-spam { display: flex; align-items: center; gap: 10px; margin: 8px 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-size: 14px; }
.tx-spam > span { flex: 1; }
.tx-schedule { margin: 8px 12px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.tx-schedule h3 { margin: 0 0 6px; font-size: 14px; }
.tx-schedule ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tx-sch { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.tx-sch-main { flex: 1; min-width: 200px; }
.tx-sch-main p { margin: 2px 0 0; font-size: 15px; white-space: pre-wrap; }
.tx-sch.failed .tx-sch-main small { color: var(--bad); }
.tx-sch-acts { display: flex; gap: 6px; }
.tx-sch-edit, .tx-when { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 6px; }
.tx-sch-edit label, .tx-when label { flex: 1; min-width: 200px; }
.tx-when .fine { flex-basis: 100%; }
.call-text { position: fixed; z-index: 12; right: 12px; bottom: 78px; width: min(420px, calc(100% - 24px)); max-height: 60vh; overflow: auto; padding: 12px 14px; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); }
.call-text label { display: block; margin: 6px 0; }
.call-text select, .call-text textarea { width: 100%; }
@media (max-width: 900px) { .call-text { bottom: calc(var(--tab-h, 0px) + 84px); } }
.call-mood { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; }
.chip.mood-happy { background: var(--ok-soft); color: var(--ok); }
.chip.mood-neutral { background: var(--chip); color: var(--ink-2); }
.chip.mood-frustrated { background: var(--bad-soft); color: var(--bad); }
.chip .ic { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }
.cd-flags { margin: 8px 0; font-size: 14px; }
.cd-flags ul, .flag-list, .ng-list, .ng-members { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.ng-members li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.check-grid { display: flex; flex-wrap: wrap; gap: 4px 16px; }
/* Batch 11e: More connections (public/connectors.js), recent Gmail on a person's page */
.con-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.con-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; min-width: 0; }
.con-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.con-item .screen-form { margin-top: 4px; }
.mail-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mail-recent li { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.mail-recent p { margin: 0; }
#personMail h2 { display: flex; align-items: center; gap: 8px; }

/* ---- batch 11f (public/admintools.js) ---- */
/* Portal view level: menus and Settings pages above the person's level step aside (permissions are unchanged). */
.view-simple [data-vmin="intermediate"], .view-simple [data-vmin="advanced"], .view-intermediate [data-vmin="advanced"] { display: none !important; }
.view-simple .set-group.v-empty, .view-intermediate .set-group.v-empty { display: none !important; }
.theme-pick .seg button[aria-pressed="true"] { background: var(--blue-soft); color: var(--ink); font-weight: 600; }
.theme-pick .seg button:disabled { opacity: .55; cursor: not-allowed; }
.plain-list { list-style: none; margin: 8px 0; padding: 0; }
.plain-list li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.plain-list li:last-child { border-bottom: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.good-text { color: var(--ok); }
.qf-items { padding-left: 20px; margin: 8px 0; }
.qf-items li { margin-bottom: 6px; grid-template-columns: 1fr 80px; }
.qa-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.qa-item legend { font-size: 14px; font-weight: 600; padding: 0 4px; }
.qa-item .seg { margin: 4px 0 8px; }
.qa-item .seg label { padding: 6px 12px; font-size: 14px; cursor: pointer; }
.qa-item .seg label:has(input:checked) { background: var(--blue-soft); font-weight: 600; }
.qa-item .seg input { margin-right: 4px; }
.ask-card { margin: 0 0 16px; }
.ask-form label { display: block; margin-bottom: 8px; }
.ask-form .row2 { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ask-answer { margin-top: 12px; padding: 12px 14px; border-left: 3px solid var(--blue, #2563eb); background: var(--blue-soft); border-radius: 8px; font-size: 15px; }
.ask-answer p { margin: 0 0 8px; }
@media (max-width: 600px) { .ask-form .row2 { grid-template-columns: 1fr; } }
.soft-devices { display: grid; gap: 8px; margin: 8px 0; }

/* Your numbers: filters */
.num-filter { align-items: flex-end; flex-wrap: wrap; margin: 8px 0; }
.num-filter #numCount { margin: 0 0 8px; }
.route-list li[hidden] { display: none; }
