/* Brand: navy #0a2a3b, cyan #39c0e0 */
:root {
  --bg: #f2f5f7; --surface: #ffffff; --surface-2: #f6f9fa; --ink: #0f2230; --muted: #5e6f7c; --line: #dde5ea;
  --head: #0a2a3b; --head-ink: #e6f1f6; --accent: #0b7593; --accent-ink: #ffffff; --accent-soft: #e0f3f9;
  --brand-cyan: #39c0e0;
  --g: #1f7a4d; --g-bg: #e3f3ea; --y: #8a5a00; --y-bg: #fdf1d6; --r: #b3261e; --r-bg: #fbe4e2;
  --b: #1c5aa8; --b-bg: #e2ecf9; --p: #7b3fa0; --p-bg: #f1e6f8; --o: #a24d10; --o-bg: #fcebdc; --n: #5f6874; --n-bg: #eceeef;
  --radius: 10px; --shadow: 0 1px 2px rgba(10, 42, 59, .06), 0 2px 8px rgba(10, 42, 59, .05);
  --mono: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;   /* emails, codes, numbers: Poppins too (readable) */
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Jost", "Poppins", system-ui, sans-serif;
  --logo-navy: block; --logo-white: none;
  color-scheme: light;
}
/* dark: follows the computer unless the person picked a theme with the switch */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060d14; --surface: #0f1b27; --surface-2: #142231; --ink: #e8f1f6; --muted: #9ab0bf; --line: #1f3243;
    --head: #03090f; --head-ink: #dcebf2; --accent: #39c0e0; --accent-ink: #04141d; --accent-soft: #0e3242;
    --g: #6fd29d; --g-bg: #133a2c; --y: #f2c063; --y-bg: #3a2f14; --r: #ff8e86; --r-bg: #43211f;
    --b: #8db8f2; --b-bg: #17304d; --p: #d0a2ee; --p-bg: #33244a; --o: #f3a46b; --o-bg: #3d2717; --n: #a3b3bf; --n-bg: #1b3343;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .55); --logo-navy: none; --logo-white: block;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #060d14; --surface: #0f1b27; --surface-2: #142231; --ink: #e8f1f6; --muted: #9ab0bf; --line: #1f3243;
    --head: #03090f; --head-ink: #dcebf2; --accent: #39c0e0; --accent-ink: #04141d; --accent-soft: #0e3242;
    --g: #6fd29d; --g-bg: #133a2c; --y: #f2c063; --y-bg: #3a2f14; --r: #ff8e86; --r-bg: #43211f;
    --b: #8db8f2; --b-bg: #17304d; --p: #d0a2ee; --p-bg: #33244a; --o: #f3a46b; --o-bg: #3d2717; --n: #a3b3bf; --n-bg: #1b3343;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .55); --logo-navy: none; --logo-white: block;
    color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 13.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 18px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.c { text-align: center; } .r { text-align: right; }
[hidden] { display: none !important; }

/* header */
.top { background: var(--head); color: var(--head-ink); display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; position: sticky; top: 0; z-index: 5; }
.brand { color: var(--head-ink); font-weight: 700; font-size: 16px; letter-spacing: .01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 36px; width: auto; display: block; }
.brand-long { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.18); }
.top nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.top nav a { color: #b7c2d3; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.top nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.top nav a.on { background: rgba(255, 255, 255, .12); color: #fff; }
.me { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.me a { color: var(--head-ink); }
.me small { color: #8d9bb1; margin-left: 4px; }
.me .link { color: #b7c2d3; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.actions { display: flex; gap: 8px; align-items: center; }
.back { font-size: 13px; display: inline-block; margin-bottom: 6px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.two > .card { margin-bottom: 0; }

/* buttons */
.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--r); border-color: var(--r); background: transparent; }
.btn.wide { width: 100%; justify-content: center; padding: 10px; }
.link { appearance: none; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--r); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* flash + alerts */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--g-bg); color: var(--g); border: 1px solid color-mix(in srgb, var(--g) 25%, transparent); }
.flash.err { background: var(--r-bg); color: var(--r); border-color: color-mix(in srgb, var(--r) 25%, transparent); }
.alert { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; border-left: 4px solid var(--y); background: var(--y-bg); color: var(--ink); }
.alert.danger { border-left-color: var(--r); background: var(--r-bg); }
#alert-box:not(:empty) { margin-bottom: 18px; }
.alert-more { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 2px 0; }
.alert.info { border-left-color: var(--b); background: var(--b-bg); }

/* welcome tiles */
.welcome { text-align: center; margin: 28px 0 26px; }
.welcome h1 { font-size: 30px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 18px; max-width: 1100px; margin: 0 auto; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px 22px 0; color: var(--ink); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .12s ease, box-shadow .12s ease, border-color .12s; min-height: 250px; }
a.tile:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 18px rgba(16, 33, 59, .1); }
.tile svg { width: 44px; height: 44px; color: var(--accent); margin-bottom: 12px; }
.tile h2 { font-size: 19px; margin: 0 0 4px; }
.tile p { margin: 0 0 14px; color: var(--muted); }
.tile-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 16px; }
.tile-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.tile-stats .warn b { color: var(--y); }
.tile-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 10px 0 12px; font-size: 12px; color: var(--muted); }
.tile-foot.ok::before, .tile-foot.bad::before { content: "●"; margin-right: 6px; }
.tile-foot.ok::before { color: var(--g); } .tile-foot.bad { color: var(--r); }
.tile-alert svg { color: var(--r); }
.tile-quiet svg { color: var(--muted); }
.tile-soon { opacity: .55; border-style: dashed; box-shadow: none; }
.tile-soon svg { color: var(--muted); }

/* port grid */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: -4px; border: 1px solid var(--line); }
.dot.ok { background: var(--g-bg); border-color: var(--g); } .dot.low { background: var(--y-bg); border-color: var(--y); }
.dot.none { background: var(--r-bg); border-color: var(--r); } .dot.unknown { background: var(--r); border-color: var(--r); }
.dot.off { background: var(--n-bg); } .dot.empty { background: var(--surface); border-style: dashed; }
.ports { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.port { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px 7px; min-height: 58px; background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.port .pn { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 600; }
.port .pl { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.port .ps { font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.port .pcall { position: absolute; top: 5px; right: 7px; font-size: 10px; color: var(--b); font-weight: 600; }
.port.empty { border-style: dashed; background: transparent; }
.port.ok { background: var(--g-bg); border-color: color-mix(in srgb, var(--g) 35%, transparent); }
.port.low { background: var(--y-bg); border-color: color-mix(in srgb, var(--y) 45%, transparent); }
.port.none { background: var(--r-bg); border-color: color-mix(in srgb, var(--r) 40%, transparent); }
.port.unknown { background: #b3261e; border-color: #b3261e; }
.port.unknown .pl, .port.unknown .pn, .port.unknown .ps { color: #fff; }
.port.off { background: var(--n-bg); }
.port.off .pl { color: var(--muted); }
.port.other { background: var(--surface-2); }

/* tables */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { min-width: 240px; flex: 0 1 320px; }
.filters .count { margin-left: auto; font-size: 12px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data.compact td { padding: 6px 8px; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-left: 10px; }
.row-actions form { display: inline; }
.empty { color: var(--muted); padding: 14px 0 4px; text-align: center; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip.g { color: var(--g); background: var(--g-bg); } .chip.y { color: var(--y); background: var(--y-bg); }
.chip.r { color: var(--r); background: var(--r-bg); } .chip.b { color: var(--b); background: var(--b-bg); }
.chip.p { color: var(--p); background: var(--p-bg); } .chip.o { color: var(--o); background: var(--o-bg); }
.chip.n { color: var(--n); background: var(--n-bg); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 5px; background: var(--n-bg); color: var(--n); }
.tag.warn { background: var(--y-bg); color: var(--y); }

button.reveal, button.otp { appearance: none; font: inherit; font-family: var(--mono); font-size: 12.5px; border: 1px dashed var(--line); background: var(--surface-2); color: var(--ink); border-radius: 6px; padding: 3px 8px; cursor: pointer; white-space: nowrap; }
button.reveal span { font-family: system-ui, sans-serif; color: var(--accent); font-size: 12px; margin-left: 4px; }
button.reveal.shown, button.otp.shown { border-style: solid; border-color: var(--accent); background: var(--accent-soft); user-select: all; }
button.otp { font-family: system-ui, sans-serif; color: var(--accent); }
button.otp.shown { font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: .06em; color: var(--ink); }
button.otp[data-left]::after { content: attr(data-left); font-size: 10.5px; color: var(--muted); margin-left: 8px; font-weight: 400; letter-spacing: 0; }
button[data-copied]::after { content: " copied" !important; color: var(--g) !important; font-size: 11px; }
.qr-form { margin: 0; } .qr-form label { cursor: pointer; }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* forms */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form h2, .form h3 { grid-column: 1 / -1; margin-bottom: 0; }
.form.narrow { max-width: 480px; grid-template-columns: 1fr; }
.form.sub { padding: 14px 0 0; border-top: 1px solid var(--line); margin-top: 16px; }
.card.form { max-width: 860px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field > label { font-weight: 600; font-size: 12.5px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400 !important; font-size: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.danger-zone { max-width: 860px; margin-top: 4px; }
form.inline { display: flex; gap: 8px; align-items: center; margin: 0; }
form.inline input { padding: 4px 8px; }
.add-team { margin-top: 12px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-page { background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 14%, var(--bg)), var(--bg) 60%); }
.card.login { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 30px; }
.card.login p { margin: -6px 0 6px; }
.card.login label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 12.5px; }

@media (max-width: 900px) {
  .ports { grid-template-columns: repeat(4, 1fr); }
  .two { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .top { padding: 0 12px; gap: 12px; }
  .me small { display: none; }
  .wrap { padding: 16px; }
}
.brand-long { font-weight: 500; color: #b7c2d3; }
@media (max-width: 900px) { .brand-long { display: none; } }

/* logos + theme switch */
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 6px; text-align: center; }
.login-logo img { width: 210px; height: auto; }
.login-logo .on-light { display: var(--logo-navy); }
.login-logo .on-dark { display: var(--logo-white); }
.login-logo span { font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.card.login p { text-align: center; }
.theme-toggle { appearance: none; border: 1px solid rgba(255,255,255,.2); background: transparent; color: var(--head-ink); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.theme-toggle:hover { background: rgba(255,255,255,.08); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: var(--logo-white); } .theme-toggle .i-moon { display: var(--logo-navy); }
.login-toggle { position: fixed; top: 16px; right: 16px; border-color: var(--line); color: var(--ink); background: var(--surface); }
.login-toggle:hover { background: var(--surface-2); }
.port.ok, .port.low, .port.none { color: var(--ink); }
.port.nogsm { box-shadow: inset 0 0 0 2px var(--r); }
.port.nogsm .ps { color: var(--r); font-weight: 600; }
.dot.nogsm { background: transparent; border: 2px solid var(--r); }
.port.novoip { box-shadow: inset 0 0 0 2px var(--o); }
.port.novoip .ps { color: var(--o); font-weight: 600; }
.dot.novoip { background: transparent; border: 2px dashed var(--o); }
.min-note { display: block; font-family: system-ui, sans-serif; font-size: 10.5px; color: var(--y); white-space: nowrap; }

/* resizable columns */
table.data th { padding-right: 14px; }
.col-grip { position: absolute; top: 0; right: 0; width: 10px; height: 100%; cursor: col-resize; z-index: 3; touch-action: none; }
.col-grip::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 0; width: 1px; background: var(--line); }
.col-grip:hover::after, .col-resizing .col-grip:active::after { background: var(--accent); width: 2px; top: 0; bottom: 0; }
body.col-resizing { cursor: col-resize; user-select: none; }
table.data.fixed { table-layout: fixed; max-width: none; }
table.data.fixed td { overflow: hidden; text-overflow: ellipsis; }
table.data td[data-col="exp"], table.data td.mono { white-space: nowrap; }

/* settings page */
.set-grid { display: flex; flex-direction: column; }
.set-row { display: grid; grid-template-columns: minmax(220px, 34%) 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; padding-top: 2px; }
.set-label { display: flex; flex-direction: column; gap: 3px; }
.set-label label { font-weight: 600; }
.set-input { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.set-input input[type=text], .set-input input[type=password] { flex: 1 1 320px; min-width: 0; }
.set-input input.num { width: 120px; }
.set-src { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tag.ok { background: var(--g-bg); color: var(--g); }
.check.small { font-size: 12px; color: var(--muted); }
.save-bar { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.switch { position: relative; width: 42px; height: 24px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--n-bg); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: var(--surface); border-radius: 50%; box-shadow: var(--shadow); transition: .15s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: var(--mono); font-size: 12px; background: var(--n-bg); padding: 1px 5px; border-radius: 4px; }
@media (max-width: 900px) { .set-row { grid-template-columns: 1fr; gap: 6px; } .set-src { margin-left: 0; } }

/* SMS page */
.sms-text { white-space: pre-wrap; word-break: break-word; min-width: 260px; max-width: 640px; }
tr.new-row td { animation: flashrow 1.6s ease-out; }
@keyframes flashrow { from { background: var(--accent-soft); } to { background: transparent; } }
.link.enable { color: var(--g); font-weight: 600; }

/* channel power button + toast */
.port .pwr { position: absolute; right: 5px; bottom: 5px; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1; cursor: pointer; padding: 0; opacity: .55; }
.port:hover .pwr, .port .pwr:focus-visible { opacity: 1; }
.port .pwr.is-on:hover { color: var(--r); border-color: var(--r); }
.port .pwr.is-off { color: var(--g); border-color: var(--g); opacity: 1; }
.port.unknown .pwr { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: 420px; padding: 12px 16px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.18);
  z-index: 50; font-weight: 600; background: var(--g-bg); color: var(--g); border: 1px solid color-mix(in srgb, var(--g) 30%, transparent); }
.toast.err { background: var(--r-bg); color: var(--r); border-color: color-mix(in srgb, var(--r) 30%, transparent); }
.reset-cols { font-size: 12px; margin-left: auto; }
.reset-cols + .count { margin-left: 12px; }

/* Typography: Poppins for text, Jost (geometric, Futura-style) for headings */
h1, h2, h3, .welcome h1, .tile h2, .brand-long, .login-logo span, .page-head h1 {
  font-family: var(--font-display); }
h1 { font-weight: 500; font-size: 28px; letter-spacing: .005em; }
.welcome h1 { font-size: 34px; font-weight: 500; letter-spacing: .01em; }
h2 { font-weight: 600; font-size: 16px; letter-spacing: .02em; }
h3 { font-weight: 600; letter-spacing: .02em; }
.tile h2 { font-size: 21px; font-weight: 500; letter-spacing: .01em; }
.brand-long { font-weight: 500; font-size: 17px; letter-spacing: .03em; }
.login-logo span { font-size: 15px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
table.data th { font-family: var(--font-display); font-weight: 600; font-size: 11.5px; letter-spacing: .1em; }
.top nav a { font-weight: 500; font-size: 13.5px; }
.btn { font-weight: 500; }
.chip { font-weight: 500; }
.tile-stats b { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
/* Poppins is wider than the system font: keep the tables compact */
table.data td { padding: 7px 8px; font-size: 13px; }
table.data th { padding: 8px 14px 8px 8px; }
table.data .mono, table.data td.mono { font-size: 12px; }
.chip { font-size: 11px; padding: 2px 8px; }
.row-actions > * { margin-left: 8px; }
.row-actions { font-size: 12.5px; }

/* ---------- background: cool gradient with a hint of pink at the lower right + corner circles ---------- */
:root { --grad: radial-gradient(50% 55% at 100% 100%, rgba(244, 164, 198, .12), transparent 70%),
                linear-gradient(135deg, #e8f4fa 0%, #f2f4fb 38%, #f0f2f9 66%, #f3f0f6 100%);
        --deco-fill: rgba(57, 192, 224, .16); --deco-fill-2: rgba(10, 42, 59, .07); --deco-stroke: rgba(11, 117, 147, .30);
        --deco-pink: rgba(236, 132, 178, .07); --deco-pink-stroke: rgba(214, 100, 156, .16); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --grad: radial-gradient(60% 55% at 0% 0%, rgba(57, 192, 224, .11), transparent 65%),
          radial-gradient(55% 55% at 100% 100%, rgba(172, 112, 222, .10), transparent 66%),
          linear-gradient(160deg, #050c13 0%, #07121c 45%, #0a111d 100%);
  --deco-fill: rgba(57, 192, 224, .06); --deco-fill-2: rgba(57, 192, 224, .04); --deco-stroke: rgba(57, 192, 224, .20);
  --deco-pink: rgba(190, 122, 230, .07); --deco-pink-stroke: rgba(200, 142, 236, .20); } }
:root[data-theme="dark"] {
  --grad: radial-gradient(60% 55% at 0% 0%, rgba(57, 192, 224, .11), transparent 65%),
          radial-gradient(55% 55% at 100% 100%, rgba(172, 112, 222, .10), transparent 66%),
          linear-gradient(160deg, #050c13 0%, #07121c 45%, #0a111d 100%);
  --deco-fill: rgba(57, 192, 224, .06); --deco-fill-2: rgba(57, 192, 224, .04); --deco-stroke: rgba(57, 192, 224, .20);
  --deco-pink: rgba(190, 122, 230, .07); --deco-pink-stroke: rgba(200, 142, 236, .20); }
html { background: var(--grad); background-attachment: fixed; background-color: var(--bg); min-height: 100%; }
body, body.login-page { background: transparent; min-height: 100vh; }
.bg-deco { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-deco .c { position: absolute; border-radius: 50%; }
/* top-left */
.bg-deco .c1 { width: 420px; height: 420px; left: -170px; top: -150px; background: var(--deco-fill); }
.bg-deco .c2 { width: 300px; height: 300px; left: -40px;  top: -60px;  border: 2px solid var(--deco-stroke); }
.bg-deco .c3 { width: 64px;  height: 64px;  left: 250px;  top: 120px;  border: 2px solid var(--deco-stroke); }
.bg-deco .c4 { width: 22px;  height: 22px;  left: 210px;  top: 230px;  background: var(--deco-stroke); }
/* bottom-right */
.bg-deco .c5 { width: 520px; height: 520px; right: -220px; bottom: -240px; background: var(--deco-pink); }
.bg-deco .c6 { width: 360px; height: 360px; right: -60px;  bottom: -150px; border: 2px solid var(--deco-pink-stroke); }
.bg-deco .c7 { width: 120px; height: 120px; right: 300px;  bottom: 90px;   background: var(--deco-fill-2); border: 2px solid var(--deco-stroke); }
/* top-right accent */
.bg-deco .c8 { width: 180px; height: 180px; right: -70px;  top: 90px;     border: 2px dashed var(--deco-stroke); }
.card, .tile { backdrop-filter: blur(2px); }
@media (max-width: 900px) { .bg-deco .c3, .bg-deco .c4, .bg-deco .c7 { display: none; } }

/* ---------- column header filters ---------- */
.th-filter { appearance: none; border: 0; background: none; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; cursor: pointer;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; display: inline-flex; align-items: center; gap: 5px; }
.th-filter:hover { background: var(--accent-soft); color: var(--accent); }
.th-caret { font-size: 9px; opacity: .55; transition: transform .15s; }
th.filtered .th-filter { color: var(--accent); background: var(--accent-soft); }
th.filtered .th-caret { opacity: 1; }
th.filtered .th-filter::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.col-menu { position: absolute; z-index: 40; width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(10, 42, 59, .22); padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.col-menu-title { font-family: var(--font-display); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; color: var(--muted); }
.col-menu input[type=search], .col-menu input[type=number] { width: 100%; padding: 6px 9px; }
.col-tools { display: flex; gap: 14px; }
.col-list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 4px; }
.col-item { display: flex; align-items: center; gap: 8px; padding: 4px 4px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.col-item:hover { background: var(--surface-2); }
.col-val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.range-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { appearance: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px;
  padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.col-foot { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 9px; }
.btn.small { padding: 5px 12px; font-size: 12.5px; }
.clear-filters { font-size: 12.5px; color: var(--r) !important; }
.filter-hint { margin-left: 4px; }
@media (max-width: 900px) { .filter-hint { display: none; } }

/* ---------- logo-style pluses ---------- */
:root { --plus: rgba(57, 192, 224, .55); }
.bg-deco .plus { position: absolute; width: var(--s, 26px); height: var(--s, 26px); }
.bg-deco .plus::before, .bg-deco .plus::after { content: ""; position: absolute; background: var(--plus); border-radius: 999px; }
.bg-deco .plus::before { left: 33%; width: 34%; height: 100%; }          /* vertical bar */
.bg-deco .plus::after  { top: 33%; height: 34%; width: 100%; }           /* horizontal bar */
.bg-deco .plus.outline::before { display: none; }
.bg-deco .plus.outline::after { inset: 0; width: auto; height: auto; top: 0; border-radius: 0; background: var(--deco-stroke);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M12 2.5h6a1.5 1.5 0 0 1 1.5 1.5v7a1 1 0 0 0 1 1h5.5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5.5a1 1 0 0 0-1 1v7a1.5 1.5 0 0 1-1.5 1.5h-6a1.5 1.5 0 0 1-1.5-1.5v-7a1 1 0 0 0-1-1H4a1.5 1.5 0 0 1-1.5-1.5v-3A1.5 1.5 0 0 1 4 12h5.5a1 1 0 0 0 1-1V4A1.5 1.5 0 0 1 12 2.5z' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M12 2.5h6a1.5 1.5 0 0 1 1.5 1.5v7a1 1 0 0 0 1 1h5.5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5.5a1 1 0 0 0-1 1v7a1.5 1.5 0 0 1-1.5 1.5h-6a1.5 1.5 0 0 1-1.5-1.5v-7a1 1 0 0 0-1-1H4a1.5 1.5 0 0 1-1.5-1.5v-3A1.5 1.5 0 0 1 4 12h5.5a1 1 0 0 0 1-1V4A1.5 1.5 0 0 1 12 2.5z' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat; }
.bg-deco .p1 { --s: 34px; left: 300px; top: 70px; }
.bg-deco .p2 { --s: 18px; left: 120px; top: 300px; opacity: .7; }
.bg-deco .p3 { --s: 26px; right: 220px; top: 110px; }
.bg-deco .p4 { --s: 40px; right: 120px; bottom: 300px; opacity: .8; }
.bg-deco .p5 { --s: 16px; left: 46%; bottom: 40px; opacity: .6; }
.bg-deco .p6 { --s: 30px; left: 70px; bottom: 120px; }
@media (max-width: 900px) { .bg-deco .p1, .bg-deco .p3, .bg-deco .p5 { display: none; } }

/* ---------- animated stroke around a SIM port on hover ---------- */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.port { isolation: isolate; }
.port::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--spin), transparent 0deg, var(--brand-cyan) 70deg, #0b7593 140deg, transparent 200deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .2s; }
.port:not(.empty):hover::after { opacity: 1; animation: port-spin 1.6s linear infinite; }
.port:not(.empty):hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(10, 42, 59, .12); }
.port { transition: transform .15s, box-shadow .15s; }
@keyframes port-spin { to { --spin: 360deg; } }
@media (prefers-reduced-motion: reduce) { .port:not(.empty):hover::after { animation: none; } }

/* tap-to-edit pills, click-to-copy cells */
td.pill-edit .chip { cursor: pointer; box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .12s; }
td.pill-edit .chip:hover { box-shadow: inset 0 0 0 1px currentColor; }
td.pill-edit .chip::after { content: " ▾"; font-size: 8px; opacity: .6; }
.pill-menu { width: auto; min-width: 150px; gap: 4px; padding: 8px; }
.pill-opt { appearance: none; border: 0; background: none; text-align: left; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.pill-opt:hover { background: var(--surface-2); }
td.copyable { cursor: copy; }
td.copyable:hover { color: var(--accent); text-decoration: underline dotted; text-underline-offset: 3px; }

/* ---------- Analytics ---------- */
.snap-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.snap-pick input, .snap-pick select, .ax-filters select, .ax-filters input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.ax-filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px; }
.ax-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ax-filters select { min-width: 180px; max-width: 260px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.ax-custom { display: flex; gap: 10px; align-items: flex-end; }
.ax-custom[hidden] { display: none !important; }
.ax-reset { margin-left: auto; align-self: center; }
.ax-mode { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--g); box-shadow: 0 0 0 0 color-mix(in srgb, var(--g) 60%, transparent); animation: pulse 2s infinite; }
.live-dot.bad { background: var(--r); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--g) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi b { font: 600 28px/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.t-g { color: var(--g); } .t-y { color: var(--y); } .t-r { color: var(--r); } .t-b { color: var(--b); }
table.ax tr.sum-row td, table.ax tfoot td { font-weight: 700; background: var(--surface-2); }
table.ax tfoot td { border-top: 2px solid var(--line); }
table.pivot th { white-space: normal; min-width: 70px; vertical-align: bottom; }
table.pivot td.heat { font-weight: 500; }
/* calm heatmap: one hue, light steps, only the busiest cells stand out */
td.h1 { background: color-mix(in srgb, var(--accent) 4%, transparent); }
td.h2 { background: color-mix(in srgb, var(--accent) 8%, transparent); }
td.h3 { background: color-mix(in srgb, var(--accent) 13%, transparent); }
td.h4 { background: color-mix(in srgb, var(--accent) 19%, transparent); font-weight: 600; }
td.h5 { background: color-mix(in srgb, var(--accent) 27%, transparent); font-weight: 700; }
.ax-gap { margin-top: 18px; margin-bottom: 18px; }
.donut-box { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.donut { width: 200px; height: 200px; flex: 0 0 auto; transform: rotate(0deg); }
.donut-ring { stroke: var(--line); }
.donut .seg { transition: stroke-width .15s; }
.donut .seg:hover { stroke-width: 7.5; }
.donut-num { font: 600 7px var(--font-display); fill: var(--ink); text-anchor: middle; }
.donut-unit { font: 2.6px var(--font); fill: var(--muted); text-anchor: middle; text-transform: uppercase; letter-spacing: .1px; }
.pie-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.pie-legend li { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; }
.pie-legend .lg-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie-legend .muted { font-size: 12px; min-width: 40px; text-align: right; }
.sw { width: 12px; height: 12px; border-radius: 3px; }
.seg.s0 { stroke: #0b7593; } .sw.s0 { background: #0b7593; }
.seg.s1 { stroke: #39c0e0; } .sw.s1 { background: #39c0e0; }
.seg.s2 { stroke: #f2a541; } .sw.s2 { background: #f2a541; }
.seg.s3 { stroke: #7b3fa0; } .sw.s3 { background: #7b3fa0; }
.seg.s4 { stroke: #2e9d68; } .sw.s4 { background: #2e9d68; }
.seg.s5 { stroke: #e76f51; } .sw.s5 { background: #e76f51; }
.seg.s6 { stroke: #0a2a3b; } .sw.s6 { background: #0a2a3b; }
.seg.s7 { stroke: #9aa9b4; } .sw.s7 { background: #9aa9b4; }
:root[data-theme="dark"] .seg.s6 { stroke: #c9d8e1; } :root[data-theme="dark"] .sw.s6 { background: #c9d8e1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg.s6 { stroke: #c9d8e1; } :root:not([data-theme="light"]) .sw.s6 { background: #c9d8e1; } }
.ax-sync summary { cursor: pointer; font-weight: 600; }
.ax-sync table { margin-top: 12px; }
.ax-empty p { max-width: 720px; }
@media (max-width: 700px) { .ax-filters select { min-width: 0; width: 100%; } .ax-filters label { flex: 1 1 100%; } .donut { width: 160px; height: 160px; } }
.ax-scroll { max-height: 640px; overflow: auto; }
.two .table-wrap { max-height: 520px; overflow: auto; }
th.sel, td.sel { width: 34px; text-align: center; padding-left: 6px; padding-right: 6px; }
td.sel input, th.sel input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.danger-link { color: var(--r); }
.btn.danger:disabled { opacity: .45; cursor: default; }

/* ================= Login (new) ================= */
.lg-form { display: flex; flex-direction: column; gap: 16px; }
.lg-field { display: flex; flex-direction: column; gap: 7px; }
.lg-field label { font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.lg-input { position: relative; display: flex; align-items: center; }
.lg-input > svg { position: absolute; left: 14px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; transition: stroke .15s; }
.lg-input input { width: 100%; height: 48px; padding: 0 46px 0 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 14.5px; transition: border-color .15s, box-shadow .15s; }
.lg-input input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.lg-input:focus-within > svg { stroke: var(--accent); }
.lg-eye { position: absolute; right: 6px; width: 36px; height: 36px; border: 0; background: none; border-radius: 9px; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.lg-eye:hover { background: var(--surface-2); color: var(--ink); }
.lg-eye svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lg-eye .eye-shut, .lg-eye.on .eye-open { display: none; }
.lg-eye.on .eye-shut { display: block; }
.lg-caps { color: var(--y); font-size: 12px; font-weight: 500; }
.lg-submit { margin-top: 6px; height: 50px; border: 0; border-radius: 12px; cursor: pointer; font: 500 15px var(--font); letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, #0b7593 0%, #1597b8 55%, #39c0e0 100%); box-shadow: 0 8px 22px -8px rgba(11, 117, 147, .55);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .15s, box-shadow .15s, filter .15s; }
.lg-submit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.lg-submit:hover { filter: brightness(1.06); box-shadow: 0 12px 26px -8px rgba(11, 117, 147, .6); }
.lg-submit:hover svg { transform: translateX(3px); }
.lg-submit:active { transform: translateY(1px); }
.lg-kicker { margin: 0; font: 500 14px var(--font-display); letter-spacing: .32em; text-transform: uppercase; }
.lg-toggle { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.lg-toggle:hover { background: var(--surface-2); }
.lg-split .flash { margin: 0 0 14px; }

/* ----- split screen ----- */
body.lg-split .bg-deco { display: none; }
.lg-split-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); padding: 0; max-width: none; }
.lg-brand { position: relative; overflow: hidden; color: #e6f1f6; display: flex; flex-direction: column; justify-content: center; padding: 56px 64px;
  background: radial-gradient(120% 90% at 15% 10%, #0f4560 0%, #0a2a3b 48%, #061b27 100%); }
.lg-brand-inner { position: relative; z-index: 1; max-width: 460px; }
.lg-logo { width: min(340px, 80%); height: auto; display: block; }
.lg-rule { width: 56px; height: 3px; border-radius: 3px; background: #39c0e0; margin: 34px 0 18px; }
.lg-brand .lg-kicker { color: #fff; font-size: 17px; }
.lg-tag { margin: 12px 0 0; color: #8fb3c5; font-size: 13.5px; letter-spacing: .02em; }
.lg-foot { position: absolute; left: 64px; bottom: 28px; margin: 0; font-size: 12px; color: #6f93a6; z-index: 1; }
.lg-deco { position: absolute; inset: 0; pointer-events: none; }
.lg-deco .d { position: absolute; border-radius: 50%; }
.lg-deco .d1 { width: 520px; height: 520px; right: -200px; top: -180px; background: rgba(57, 192, 224, .10); }
.lg-deco .d2 { width: 380px; height: 380px; right: -90px; top: -110px; border: 1.5px solid rgba(57, 192, 224, .32); }
.lg-deco .d3 { width: 300px; height: 300px; left: -120px; bottom: -140px; border: 1.5px dashed rgba(57, 192, 224, .28); }
.lg-deco .d4 { width: 90px; height: 90px; right: 22%; bottom: 16%; background: rgba(57, 192, 224, .14); border: 1.5px solid rgba(57, 192, 224, .35); }
.lg-deco .d5 { width: 16px; height: 16px; right: 34%; top: 22%; background: #39c0e0; opacity: .7; }
.lg-deco .pl { position: absolute; width: var(--s); height: var(--s); }
.lg-deco .pl::before, .lg-deco .pl::after { content: ""; position: absolute; background: #39c0e0; border-radius: 999px; }
.lg-deco .pl::before { left: 33%; width: 34%; height: 100%; }
.lg-deco .pl::after { top: 33%; height: 34%; width: 100%; }
.lg-deco .pl1 { --s: 38px; right: 16%; top: 30%; }
.lg-deco .pl2 { --s: 20px; left: 12%; top: 14%; opacity: .6; }
.lg-deco .pl3 { --s: 26px; right: 9%; bottom: 30%; opacity: .8; }
.lg-deco .pl4 { --s: 30px; left: 46%; bottom: 12%; opacity: .5; }
.lg-side { position: relative; display: grid; place-items: center; padding: 48px 32px; }
.lg-side .lg-toggle { position: absolute; top: 20px; right: 20px; }
.lg-panel { width: min(400px, 100%); }
.lg-title { font: 500 34px/1.15 var(--font-display); margin: 0 0 6px; letter-spacing: .005em; }
.lg-sub { margin: 0 0 30px; color: var(--muted); }
/* dark: the form side its own night - cyan, violet and a hint of pink glow, a faint dot grid fading out, the form on a
   lit card (a cyan - violet line on its top edge), a soft gradient on the title. Light is as it was */
html.dk .lg-side { overflow: hidden; background:
    radial-gradient(520px 420px at 88% 6%, rgba(63, 200, 230, .18), transparent 70%),
    radial-gradient(620px 500px at 6% 100%, rgba(132, 98, 232, .24), transparent 70%),
    radial-gradient(420px 320px at 100% 92%, rgba(206, 108, 186, .11), transparent 70%),
    linear-gradient(165deg, #071725 0%, #050e18 55%, #080b19 100%); }
html.dk .lg-side::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(165, 212, 240, .11) 1px, transparent 1.3px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 62% at 50% 46%, #000, transparent); mask-image: radial-gradient(70% 62% at 50% 46%, #000, transparent); }
html.dk .lg-panel { position: relative; width: min(448px, 100%); padding: 36px 34px 32px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(23, 52, 79, .78), rgba(11, 28, 44, .84)); border: 1px solid rgba(165, 212, 240, .13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 0 0 1px rgba(0, 0, 0, .25), 0 40px 80px -36px rgba(0, 0, 0, .9),
    0 0 70px -24px rgba(63, 200, 230, .22);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
html.dk .lg-panel::before { content: ""; position: absolute; left: 26px; right: 26px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(63, 200, 230, .85), rgba(178, 148, 240, .75), transparent); }
html.dk .lg-title { background: linear-gradient(92deg, #ffffff 35%, #a6e6f5); -webkit-background-clip: text; background-clip: text;
  color: transparent; }
html.dk .lg-input input { background: rgba(5, 16, 26, .72); border-color: rgba(165, 212, 240, .16); }
html.dk .lg-brand { box-shadow: 1px 0 0 rgba(63, 200, 230, .16); }
@media (max-width: 860px) {
  .lg-split-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100vh; min-height: 100dvh; }
  .lg-brand { padding: calc(28px + env(safe-area-inset-top)) 24px 26px; justify-content: flex-end; min-height: 0;
    border-radius: 0 0 28px 28px; box-shadow: 0 1px 0 rgba(57, 192, 224, .25), 0 14px 30px -18px rgba(6, 27, 39, .6); }
  .lg-brand-inner { display: flex; flex-direction: column; align-items: flex-start; }
  .lg-logo { width: 170px; }
  .lg-rule { margin: 18px 0 10px; width: 40px; }
  .lg-brand .lg-kicker { font-size: 13px; letter-spacing: .28em; }
  .lg-tag, .lg-foot { display: none; }
  .lg-deco .d1 { width: 300px; height: 300px; right: -120px; top: -120px; }
  .lg-deco .d2 { width: 220px; height: 220px; right: -60px; top: -80px; }
  .lg-deco .d3, .lg-deco .d4, .lg-deco .d5, .lg-deco .pl2, .lg-deco .pl4 { display: none; }
  .lg-deco .pl1 { --s: 26px; right: 22%; top: auto; bottom: 30%; }
  .lg-deco .pl3 { --s: 18px; right: 8%; bottom: 16%; }
  .lg-side { padding: 28px 20px calc(32px + env(safe-area-inset-bottom)); place-items: start center; }
  .lg-side .lg-toggle { position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 14px; z-index: 3; color: #e6f1f6;
    background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
  .lg-title { font-size: 26px; }
  .lg-sub { margin-bottom: 22px; }
  html.dk .lg-panel { padding: 26px 22px 24px; border-radius: 20px; }
  .lg-form { gap: 14px; }
  .lg-input input { font-size: 16px; height: 50px; }        /* 16px stops iPhone from zooming in */
  .lg-submit { height: 52px; }
}
@media (max-width: 860px) and (max-height: 700px) {      /* small phones: keep the form on screen */
  .lg-brand { padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: 18px; }
  .lg-logo { width: 130px; }
  .lg-rule { margin: 12px 0 8px; }
  .lg-side { padding-top: 18px; }
  .lg-title { font-size: 22px; } .lg-sub { margin-bottom: 14px; }
}
@media (max-width: 960px) and (orientation: landscape) and (max-height: 520px) {   /* phone turned sideways */
  .lg-split-wrap { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); grid-template-rows: none; }
  .lg-brand { border-radius: 0 24px 24px 0; justify-content: center; padding: 20px 24px calc(20px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left)); }
  .lg-logo { width: 150px; }
  .lg-side { place-items: center; padding: 16px calc(20px + env(safe-area-inset-right)) 16px 20px; overflow-y: auto; }
  .lg-title { font-size: 20px; } .lg-sub { margin-bottom: 10px; font-size: 12.5px; }
  .lg-form { gap: 8px; } .lg-field { gap: 4px; }
  .lg-input input { height: 42px; } .lg-submit { height: 44px; margin-top: 4px; }
  .lg-side .lg-toggle { position: absolute; top: 12px; right: 12px; color: var(--ink); background: var(--surface); border-color: var(--line); }
}
@media (min-width: 861px) and (max-height: 640px) { .lg-brand { padding-top: 32px; padding-bottom: 32px; } .lg-foot { display: none; } }

/* ================= Home (status strip + tiles) ================= */
.hello { max-width: 1240px; margin: 18px auto 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hello h1 { margin: 0; font: 500 32px/1.15 var(--font-display); letter-spacing: .005em; }
.hello-kicker { margin: 0 0 4px; color: var(--accent); font: 500 12px var(--font-display); letter-spacing: .18em; text-transform: uppercase; }
.hello-sub { margin: 0 0 4px; font-size: 13px; }
.strip { max-width: 1240px; margin: 0 auto 22px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.st { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 13px; border-radius: 14px; color: var(--ink);
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden; }
.st::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line); }
.st:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 24px -14px rgba(6, 27, 39, .45); }
.st-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st b { font: 600 26px/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.st b em { font-style: normal; font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.st small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.st-ok::before, .st-ok .dot { background: var(--g); }
.st-ok .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--g) 22%, transparent); }
.st-warn::before { background: var(--y); } .st-warn b { color: var(--y); }
.st-bad::before, .st-bad .dot { background: var(--r); } .st-bad b { color: var(--r); }

.tiles2 { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile2 { --c: var(--accent); position: relative; display: flex; flex-direction: column; padding: 22px 22px 20px; min-height: 196px; border-radius: 18px; color: var(--ink);
  background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden;
  transition: transform .18s, border-color .18s, box-shadow .18s; }
.tile2::after { content: ""; position: absolute; right: -60px; top: -60px; width: 150px; height: 150px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 10%, transparent); transition: transform .2s; pointer-events: none; }
a.tile2:hover, .tile-settings:hover { text-decoration: none; transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 60%, var(--line));
  box-shadow: 0 16px 34px -18px color-mix(in srgb, var(--c) 55%, rgba(6, 27, 39, .5)); }
a.tile2:hover::after { transform: scale(1.25); }
.t-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 16px; flex: 0 0 auto;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); }
.t-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tile2 h2 { margin: 0 0 6px; font: 500 20px var(--font-display); letter-spacing: .01em; }
.tile2 p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; padding-right: 36px; }
.t-go { position: absolute; right: 18px; bottom: 18px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); transition: transform .18s, background .18s; }
.t-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a.tile2:hover .t-go, .ts-head:hover .t-go { transform: translateX(3px); background: color-mix(in srgb, var(--c) 20%, transparent); }
.c-cyan { --c: #1597b8; } .c-blue { --c: #2f6fd0; } .c-teal { --c: #14917a; } .c-violet { --c: #7b4fc4; }
.c-amber { --c: #d08a12; } .c-red { --c: #d2453b; } .c-green { --c: #2e9d68; } .c-slate { --c: #5e7384; } .c-navy { --c: #0b7593; }
.c-wa { --c: #128c6e; } :root[data-theme="dark"] .c-wa { --c: #4fd18b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .c-wa { --c: #4fd18b; } }
:root[data-theme="dark"] .c-cyan { --c: #39c0e0; } :root[data-theme="dark"] .c-blue { --c: #7aa7f0; } :root[data-theme="dark"] .c-teal { --c: #46c9ad; }
:root[data-theme="dark"] .c-violet { --c: #b294f0; } :root[data-theme="dark"] .c-amber { --c: #f2b84b; } :root[data-theme="dark"] .c-red { --c: #ff8e86; }
:root[data-theme="dark"] .c-green { --c: #6fd29d; } :root[data-theme="dark"] .c-slate { --c: #9fb3c2; } :root[data-theme="dark"] .c-navy { --c: #39c0e0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .c-cyan { --c: #39c0e0; } :root:not([data-theme="light"]) .c-blue { --c: #7aa7f0; }
  :root:not([data-theme="light"]) .c-teal { --c: #46c9ad; } :root:not([data-theme="light"]) .c-violet { --c: #b294f0; }
  :root:not([data-theme="light"]) .c-amber { --c: #f2b84b; } :root:not([data-theme="light"]) .c-red { --c: #ff8e86; }
  :root:not([data-theme="light"]) .c-green { --c: #6fd29d; } :root:not([data-theme="light"]) .c-slate { --c: #9fb3c2; }
  :root:not([data-theme="light"]) .c-navy { --c: #39c0e0; } }

/* Settings tile: every editable group, with connection status */
.tile-settings { padding-bottom: 14px; }
.ts-head { display: flex; align-items: center; gap: 12px; color: var(--ink); margin-bottom: 10px; position: relative; }
.ts-head:hover { text-decoration: none; }
.ts-head .t-ico { margin: 0; }
.ts-head h2 { margin: 0; }
.ts-head .t-go { position: static; margin-left: auto; }
.ts-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; position: relative; z-index: 1; }
.ts-list a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; color: var(--ink); font-size: 12px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); white-space: nowrap; }
.ts-list a:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); text-decoration: none; }
.sd { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--line); }
.sd.ok { background: var(--g); } .sd.bad { background: var(--r); } .sd.off { background: transparent; border: 1.5px solid var(--muted); }
.sd.na { background: color-mix(in srgb, var(--c) 45%, transparent); }
.ts-foot { margin: auto 0 0; padding-top: 10px; font-size: 11.5px; color: var(--muted); }
.set-group { scroll-margin-top: 150px; }
.set-group:target { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

@media (max-width: 1180px) { .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tiles2 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hello h1 { font-size: 26px; } .tile2 { min-height: 0; } }
@media (max-width: 520px) { .tiles2 { grid-template-columns: 1fr; } .strip { gap: 8px; } .st { padding: 11px 12px; } .st b { font-size: 22px; } }
@media (max-width: 820px) { .strip .st:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 520px) {
  .tile2 { display: grid; grid-template-columns: 42px 1fr 28px; column-gap: 14px; align-items: center; padding: 14px 14px; border-radius: 14px; }
  .tile2 .t-ico { width: 42px; height: 42px; margin: 0; grid-row: 1 / span 2; }
  .tile2 h2 { font-size: 17px; margin: 0; grid-column: 2; }
  .tile2 p { grid-column: 2; padding: 0; font-size: 12px; line-height: 1.45; }
  .tile2 .t-go { position: static; grid-column: 3; grid-row: 1 / span 2; width: 28px; height: 28px; }
  .tile2::after { width: 90px; height: 90px; right: -40px; top: -40px; }
  .tile-settings { display: flex; flex-direction: column; align-items: stretch; }
  .tile-settings .ts-head .t-go { margin-left: auto; }
  .tiles2 { gap: 10px; }
  .hello { margin-top: 6px; } .hello h1 { font-size: 24px; } .hello-sub { display: none; }
}
@media (max-width: 700px) {
  .top { gap: 10px; padding: 0 12px; }
  .brand-long, .me a small { display: none; }
  .top nav a { padding: 8px 9px; }
}

/* ================= Header (floating pill nav) ================= */
.hdr { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px;
  padding: 12px 22px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.hdr-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); justify-self: start; min-width: 0; }
.hdr-brand:hover { text-decoration: none; }
.hdr-brand img { height: 34px; width: auto; display: block; }
.hdr-brand .on-light { display: var(--logo-navy); } .hdr-brand .on-dark { display: var(--logo-white); }
.hdr-name { font: 500 15px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line); white-space: nowrap; }
.hdr-nav { display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 999px; overflow-x: auto; scrollbar-width: none; max-width: 100%;
  background: linear-gradient(180deg, #0f2f42, #0a2433); border: 1px solid rgba(57, 192, 224, .22);
  box-shadow: 0 10px 30px -14px rgba(6, 27, 39, .6), inset 0 1px 0 rgba(255, 255, 255, .06); }
.hdr-nav::-webkit-scrollbar { display: none; }
.hdr-nav a { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 999px; color: #c4d3dc;
  font: 500 13.5px var(--font); white-space: nowrap; transition: color .15s, background .15s; }
.hdr-nav a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.hdr-nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); text-decoration: none; }
.hdr-nav a:hover svg { opacity: 1; }
.hdr-nav a.on { color: #fff; background: linear-gradient(135deg, #0b7593, #1aa6c8); box-shadow: 0 4px 14px -4px rgba(57, 192, 224, .55), inset 0 1px 0 rgba(255, 255, 255, .18); }
.hdr-nav a.on svg { opacity: 1; }
.hdr-me { display: flex; align-items: center; gap: 8px; justify-self: end; }
.hdr-btn { appearance: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: border-color .15s, color .15s; }
.hdr-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.hdr-btn svg { width: 17px; height: 17px; }
.hdr-user { display: flex; align-items: center; gap: 9px; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.hdr-user:hover { text-decoration: none; border-color: var(--accent); }
.hdr-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 14px var(--font-display); color: #fff;
  background: linear-gradient(135deg, #0b7593, #39c0e0); }
.hdr-who { display: flex; flex-direction: column; line-height: 1.15; }
.hdr-who b { font-size: 13px; font-weight: 500; }
.hdr-who small { font-size: 11px; color: var(--muted); }
@media (max-width: 1560px) { .hdr-name { display: none; } }
@media (max-width: 1360px) { .hdr-nav a { padding: 8px 11px; gap: 6px; } }
@media (max-width: 1240px) { .hdr-who { display: none; } .hdr-user { padding: 3px; } .hdr-nav a svg { display: none; } }
.hdr-burger, .hdr-drawer-head, .hdr-drawer-foot, .hdr-backdrop, .hdr-nav a.hdr-home { display: none; }

/* ----- phones & small tablets: three-bar menu with a sliding drawer ----- */
@media (max-width: 900px) {
  .hdr { display: flex; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); box-shadow: 0 1px 0 var(--line), 0 6px 16px -12px rgba(6, 27, 39, .45); }
  .hdr-burger { order: 3; }
  .hdr-brand img { height: 30px; }
  .hdr-me { margin-left: auto; }
  .hdr-me .hdr-user, .hdr-me form { display: none; }
  .hdr-burger { display: grid; place-content: center; gap: 5px; width: 42px; height: 42px; padding: 0; border-radius: 50%; cursor: pointer; position: relative; z-index: 32;
    border: 1px solid rgba(57, 192, 224, .3); background: linear-gradient(180deg, #0f2f42, #0a2433); box-shadow: 0 6px 18px -10px rgba(6, 27, 39, .7); }
  .hdr-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #e6f1f6; transition: transform .22s cubic-bezier(.7, 0, .2, 1), opacity .2s, width .3s; }
  .hdr-burger span:nth-child(2) { width: 12px; justify-self: end; }
  .hdr-burger:hover span:nth-child(2) { width: 18px; }
  .menu-open .hdr-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .hdr-burger span:nth-child(2) { opacity: 0; transform: translateX(8px); }
  .menu-open .hdr-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hdr-nav { position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(86vw, 340px); max-width: none; overflow-y: auto;
    flex-direction: column; align-items: stretch; gap: 4px; border-radius: 26px 0 0 26px; border-width: 0 0 0 1px;
    padding: calc(76px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
    background: linear-gradient(170deg, #0f3a50 0%, #0a2433 45%, #061b27 100%);
    transform: translateX(105%); visibility: hidden; transition: transform .26s cubic-bezier(.7, 0, .2, 1), visibility 0s linear .26s; }
  .menu-open .hdr-nav { transform: none; visibility: visible; transition: transform .26s cubic-bezier(.7, 0, .2, 1), visibility 0s; }
  .hdr-nav a, .hdr-drawer-foot button { padding: 13px 14px; border-radius: 14px; font-size: 15.5px; gap: 14px; }
  .hdr-nav a svg, .hdr-drawer-foot svg { width: 20px; height: 20px; display: inline; }
  .hdr-nav a.hdr-home { display: inline-flex; }
  .hdr-nav a.on { background: linear-gradient(135deg, #0b7593, #1aa6c8); }

  .hdr-drawer-head { display: flex; align-items: center; gap: 12px; padding: 4px 6px 16px; margin-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .hdr-drawer-head .hdr-av { width: 42px; height: 42px; font-size: 17px; }
  .hdr-drawer-head .hdr-who { display: flex; }
  .hdr-drawer-head .hdr-who b { color: #fff; font-size: 15px; } .hdr-drawer-head .hdr-who small { color: #8fb3c5; font-size: 12px; }
  .hdr-drawer-foot { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
  .hdr-drawer-foot form { margin: 0; }
  .hdr-drawer-foot button { appearance: none; width: 100%; display: flex; align-items: center; border: 0; background: none; color: #ffb4ad; font: 500 15.5px var(--font); cursor: pointer; }
  .hdr-drawer-foot button:hover { background: rgba(255, 142, 134, .1); }
  .hdr-drawer-foot svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

  /* items slide in one after another */
  .hdr-nav > a, .hdr-drawer-head, .hdr-drawer-foot { opacity: 0; transform: translateX(26px); transition: opacity .18s, transform .24s cubic-bezier(.2, .7, .2, 1); }
  .menu-open .hdr-nav > a, .menu-open .hdr-drawer-head, .menu-open .hdr-drawer-foot { opacity: 1; transform: none; }
  .menu-open .hdr-drawer-head { transition-delay: .06s; }
  .menu-open .hdr-nav > a:nth-of-type(1) { transition-delay: .08s; } .menu-open .hdr-nav > a:nth-of-type(2) { transition-delay: .09s; }
  .menu-open .hdr-nav > a:nth-of-type(3) { transition-delay: .11s; } .menu-open .hdr-nav > a:nth-of-type(4) { transition-delay: .12s; }
  .menu-open .hdr-nav > a:nth-of-type(5) { transition-delay: .14s; } .menu-open .hdr-nav > a:nth-of-type(6) { transition-delay: .15s; }
  .menu-open .hdr-nav > a:nth-of-type(7) { transition-delay: .17s; } .menu-open .hdr-nav > a:nth-of-type(8) { transition-delay: .18s; }
  .menu-open .hdr-nav > a:nth-of-type(9) { transition-delay: .20s; } .menu-open .hdr-nav > a:nth-of-type(10) { transition-delay: .21s; }
  .menu-open .hdr-drawer-foot { transition-delay: .23s; }

  .hdr-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(3, 14, 21, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none; transition: opacity .2s; }
  .hdr-backdrop[hidden] { display: block !important; }
  .menu-open .hdr-backdrop { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .hdr-nav, .hdr-nav > a, .hdr-drawer-head, .hdr-drawer-foot, .hdr-burger span, .hdr-backdrop { transition: none !important; }
}

/* ================= System page ================= */
.k-cpu { --k: #1597b8; } .k-mem { --k: #7b4fc4; } .k-disk { --k: #d08a12; }
:root[data-theme="dark"] .k-cpu { --k: #39c0e0; } :root[data-theme="dark"] .k-mem { --k: #b294f0; } :root[data-theme="dark"] .k-disk { --k: #f2b84b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .k-cpu { --k: #39c0e0; } :root:not([data-theme="light"]) .k-mem { --k: #b294f0; }
  :root:not([data-theme="light"]) .k-disk { --k: #f2b84b; } }
.sy-live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.sy-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--g); animation: pulse 2s infinite; }
.sy-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.3fr); gap: 16px; margin-bottom: 18px; }
.sy-card { background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 18px; }
.sy-gauge { position: relative; display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 16px; }
.sy-gauge svg { width: 110px; height: 110px; transform: rotate(-90deg); }
.sy-track { fill: none; stroke: var(--line); stroke-width: 10; }
.sy-val { fill: none; stroke: var(--k); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .5s cubic-bezier(.2, .7, .2, 1), stroke .2s; }
.sy-gauge.warm .sy-val { stroke: var(--y); } .sy-gauge.hot .sy-val { stroke: var(--r); }
.sy-ring { position: relative; width: 110px; height: 110px; }
.sy-gnum { position: absolute; inset: 0; display: grid; place-content: center; grid-auto-flow: column; align-items: baseline; }
.sy-gnum b { font: 600 28px var(--font-display); font-variant-numeric: tabular-nums; }
.sy-gnum span { font-size: 13px; color: var(--muted); margin-left: 1px; }
.sy-glabel h3 { margin: 0 0 4px; font: 500 18px var(--font-display); }
.sy-glabel small { color: var(--muted); font-size: 12.5px; }
.sy-facts dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; height: 100%; align-content: center; }
.sy-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
.sy-facts dd { margin: 3px 0 0; font: 500 17px var(--font-display); font-variant-numeric: tabular-nums; }
.sy-facts dd.ok { color: var(--g); } .sy-facts dd.bad { color: var(--r); }
.sy-range { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); }
.sy-range button { appearance: none; border: 0; background: none; padding: 5px 14px; border-radius: 999px; font: 500 12.5px var(--font); color: var(--muted); cursor: pointer; }
.sy-range button.on { background: var(--accent); color: var(--accent-ink); }
.sy-legend { display: flex; gap: 18px; margin: 4px 0 8px; font-size: 12.5px; color: var(--muted); }
.sy-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--k); margin-right: 7px; vertical-align: middle; }
.sy-chart { position: relative; min-height: 120px; }
.sy-svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.sy-grid { stroke: var(--line); stroke-width: 1; }
.sy-ax { fill: var(--muted); font: 11px var(--font); }
.sy-line-s { fill: none; stroke: var(--k); stroke-width: 2; stroke-linejoin: round; }
.sy-area { fill: color-mix(in srgb, var(--k) 10%, transparent); stroke: none; }
.sy-cross { stroke: var(--muted); stroke-dasharray: 3 3; }
.sy-dot { fill: var(--surface); stroke: var(--k); stroke-width: 2; }
.sy-tip { position: absolute; top: 8px; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  box-shadow: 0 8px 24px -12px rgba(6, 27, 39, .5); display: flex; flex-direction: column; gap: 2px; font-size: 12px; min-width: 130px; }
.sy-tip span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--k); margin-right: 6px; }
.sy-logtools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sy-logtools input[type=search] { min-width: 200px; }
.sy-log { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-family: var(--mono); font-size: 12px; margin-top: 8px; }
.sy-line { display: grid; grid-template-columns: 112px 70px 64px 1fr; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--line); align-items: start; }
.sy-line:last-child { border-bottom: 0; }
.sy-line time { color: var(--muted); white-space: nowrap; }
.sy-line .src { color: var(--accent); }
.sy-line .lv { text-transform: uppercase; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.sy-line pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; }
.sy-line.lv-error { background: color-mix(in srgb, var(--r) 8%, transparent); } .sy-line.lv-error .lv { color: var(--r); }
.sy-line.lv-warning .lv { color: var(--y); }
.sy-empty { padding: 14px; margin: 0; }
@media (max-width: 1200px) { .sy-top { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sy-facts { grid-column: 1 / -1; } .sy-facts dl { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) { .sy-top { grid-template-columns: 1fr; } .sy-facts dl { grid-template-columns: 1fr 1fr; }
  .sy-line { grid-template-columns: 1fr auto; } .sy-line pre { grid-column: 1 / -1; } .sy-line .lv { display: none; } }

/* pills: tap = change, tap twice = filter; serial number on the port tiles */
td.pill-cell .chip { cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: box-shadow .15s, transform .1s; }
td.pill-cell .chip:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
td.pill-cell .chip:active { transform: scale(.96); }
.port .pn .psn { font-style: normal; font-weight: 500; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 10.5px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ================= Scrollbars (whole app): thin, rounded, no arrow buttons ================= */
:root { --sb: color-mix(in srgb, var(--muted) 45%, transparent); --sb-hover: color-mix(in srgb, var(--accent) 70%, transparent); }
@supports (scrollbar-color: auto) {
  * { scrollbar-width: thin; scrollbar-color: var(--sb) transparent; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sb); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--sb-hover); background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

/* ================= Chips: a bit more contrast everywhere ================= */
.chip { border: 1px solid color-mix(in srgb, currentColor 22%, transparent); letter-spacing: .01em; }

/* ================= SIM table ================= */
.qchips { display: flex; flex-wrap: wrap; gap: 6px; }
.qchips button { appearance: none; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 12.5px var(--font); transition: border-color .15s, background .15s; }
.qchips button b { font-weight: 600; font-variant-numeric: tabular-nums; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; }
.qchips button:hover { border-color: var(--accent); }
.qchips button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.qchips button.on b { background: rgba(255, 255, 255, .22); color: inherit; }
.qchips .q-g b { color: var(--g); } .qchips .q-y b { color: var(--y); } .qchips .q-r b { color: var(--r); }
.sim-card .filters { gap: 10px 12px; }
.sim-wrap { max-height: 74vh; overflow: auto; border-radius: 10px; }
.sim-table thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.sim-table td { padding: 9px 10px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.sim-table tbody tr:not(.group-row):nth-child(odd) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.sim-table tbody tr:not(.group-row):hover td { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.sim-table tr td:first-child { box-shadow: inset 3px 0 0 transparent; }
.sim-table tr.rs-ok td:first-child { box-shadow: inset 3px 0 0 var(--g); }
.sim-table tr.rs-low td:first-child { box-shadow: inset 3px 0 0 var(--y); }
.sim-table tr.rs-bad td:first-child { box-shadow: inset 3px 0 0 var(--r); }
.sim-table tr.rs-off td:first-child { box-shadow: inset 3px 0 0 var(--muted); }
.sim-table tr.rs-low td { background: color-mix(in srgb, var(--y) 6%, transparent) !important; }
.sim-table tr.rs-bad td { background: color-mix(in srgb, var(--r) 7%, transparent) !important; }
.sim-table tr.rs-out td { color: var(--muted); }
.sim-table tr.rs-out .chip { opacity: .85; }
.sim-phone { font-weight: 600; color: var(--ink); font-size: 13px; }
.sim-table tr.rs-out .sim-phone { color: var(--muted); }
.sim-user { max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.sim-iccid { font-size: 12px; letter-spacing: .03em; color: var(--muted); }
.gw-ch { font-family: var(--mono); font-weight: 600; }
.gw-name { margin-left: 7px; font-size: 12px; color: var(--muted); }
.sim-min { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sim-table tr[data-q~="low"] .sim-min { color: var(--y); }
.sim-table tr[data-q~="none"] .sim-min { color: var(--r); }
.sim-table .group-row td { position: sticky; top: 37px; z-index: 2; background: var(--surface-2) !important; box-shadow: none !important;
  font: 600 12px var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sim-table .group-row b { margin: 0 10px 0 6px; padding: 1px 9px; border-radius: 999px; background: var(--surface); font-family: var(--font); letter-spacing: 0; }
.sim-table .group-row .muted { text-transform: none; letter-spacing: 0; font-weight: 400; font-family: var(--font); }
.sim-table .group-row.clickable { cursor: pointer; }
.gr-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.gr-dot.g { background: var(--g); } .gr-dot.n { background: var(--muted); }
.gr-caret { display: inline-block; margin-right: 8px; transition: transform .2s; }
tbody.collapsed:not(.force-open) .gr-caret { transform: rotate(-90deg); }
tbody.collapsed:not(.force-open) tr:not(.group-row) { display: none; }
@media (max-width: 900px) { .sim-wrap { max-height: none; } .sim-table .group-row td { top: 0; } }

/* ================= Analytics: tabs, sticky big tables ================= */
.ax-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; padding: 5px; border-radius: 16px; width: fit-content; max-width: 100%;
  background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ax-tabs button { appearance: none; border: 0; background: none; cursor: pointer; padding: 9px 16px; border-radius: 12px; color: var(--muted);
  font: 500 13.5px var(--font); display: inline-flex; align-items: center; gap: 8px; transition: background .15s, color .15s; }
.ax-tabs button b { font-weight: 600; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-variant-numeric: tabular-nums; }
.ax-tabs button:hover { color: var(--ink); background: var(--surface-2); }
.ax-tabs button.on { color: #fff; background: linear-gradient(135deg, #0b7593, #1aa6c8); box-shadow: 0 6px 16px -8px rgba(11, 117, 147, .7); }
.ax-tabs button.on b { background: rgba(255, 255, 255, .2); color: #fff; }
.ax-panel[hidden] { display: none !important; }
.two.ax-panel { margin-bottom: 18px; }
.ax-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ax-find { min-width: 260px; }
.ax-note { margin: -4px 0 10px; }
.ax-scrollbox { max-height: 68vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.ax-scrollbox table.data { margin: 0; }
.ax-scrollbox table.data thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); box-shadow: 0 1px 0 var(--line); }
.ax-scrollbox table.data tfoot td { position: sticky; bottom: 0; z-index: 3; background: var(--surface-2); box-shadow: 0 -1px 0 var(--line); }
.ax-scrollbox table.ax tbody tr.sum-row td { position: sticky; top: 33px; z-index: 2; background: var(--surface-2); }
.ax-scrollbox table.data tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
table.pivot { width: max-content; min-width: 100%; }
table.pivot th, table.pivot td { padding: 7px 10px; }
table.pivot th { white-space: normal; width: 74px; min-width: 74px; max-width: 96px; line-height: 1.25; vertical-align: bottom; font-size: 10.5px; }
table.pivot .stick { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 210px; max-width: 230px; width: 220px; box-shadow: 1px 0 0 var(--line); }
table.pivot thead .stick, table.pivot tfoot .stick { z-index: 4; background: var(--surface-2); }
table.pivot tbody tr:nth-child(even) .stick { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.pv-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-dept { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.pivot td.tot, table.pivot th.tot { background: color-mix(in srgb, var(--accent) 10%, var(--surface)) !important; font-weight: 700; }
table.pivot td.heat { font-variant-numeric: tabular-nums; }
td.h0 { background: transparent; color: var(--muted); }
td.h1 { background: color-mix(in srgb, var(--accent) 4%, transparent) !important; }
td.h2 { background: color-mix(in srgb, var(--accent) 8%, transparent) !important; }
td.h3 { background: color-mix(in srgb, var(--accent) 13%, transparent) !important; }
td.h4 { background: color-mix(in srgb, var(--accent) 19%, transparent) !important; font-weight: 600; }
td.h5 { background: color-mix(in srgb, var(--accent) 28%, transparent) !important; font-weight: 700; }
.two.ax-panel .ax-scrollbox { max-height: 60vh; }
@media (max-width: 700px) { .ax-tabs { width: 100%; } .ax-tabs button { flex: 1 1 45%; justify-content: center; padding: 9px 8px; } .ax-find { min-width: 0; width: 100%; }
  table.pivot .stick { min-width: 150px; width: 150px; } }
.sim-table .min-note { display: block; max-width: 170px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 400 10.5px var(--font); color: var(--muted); }
@media (max-width: 700px) {
  .qchips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; }
  .qchips button { flex: 0 0 auto; padding: 5px 10px; font-size: 12px; }
  .ax-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .ax-filters label { flex: none; } .ax-filters .ax-reset { grid-column: 1 / -1; justify-self: end; }
  .ax-filters .ax-custom { grid-column: 1 / -1; }
  .ax-tabs button { white-space: nowrap; font-size: 12.5px; }
}

/* ================= Right-hand panel ================= */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-back { position: absolute; inset: 0; background: rgba(3, 14, 21, .5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); opacity: 0; transition: opacity .18s; }
.sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: -24px 0 60px -20px rgba(6, 27, 39, .55);
  border-radius: 22px 0 0 22px; transform: translateX(104%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
.sheet-wrap.open .sheet-back { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
body.sheet-open { overflow: hidden; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 18px 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font: 500 20px var(--font-display); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-x { appearance: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.sheet-x:hover { border-color: var(--accent); color: var(--accent); }
.sheet-body { padding: 18px 22px 8px; display: flex; flex-direction: column; gap: 12px; }
.sheet-body h3 { margin: 10px 0 0; font: 600 12px var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sheet-body .field { display: flex; flex-direction: column; gap: 5px; }
.sheet-body .field label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.sheet-body input:not([type=checkbox]):not([type=file]), .sheet-body select { width: 100%; height: 42px; border-radius: 10px; padding: 0 12px; font-size: 14px; }
.sheet-foot { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 14px 0 16px; margin-top: 6px; background: linear-gradient(transparent, var(--surface) 30%); }
.sheet-danger { padding: 6px 22px 26px; }
@media (max-width: 520px) { .sheet { border-radius: 0; width: 100vw; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-back { transition: none; } }

/* profile */
.pf-photo { display: flex; align-items: center; gap: 16px; }
.pf-photo b { display: block; font: 500 18px var(--font-display); }
.pf-photo small { display: block; margin-bottom: 4px; }
.pf-pic { position: relative; width: 84px; height: 84px; border-radius: 50%; cursor: pointer; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #0b7593, #39c0e0); color: #fff; font: 600 32px var(--font-display); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--accent) 40%, transparent); }
.pf-pic img { width: 100%; height: 100%; object-fit: cover; }
.pf-pic img[hidden] { display: none; }
.pf-cam { position: absolute; inset: auto 0 0 0; height: 28px; display: grid; place-items: center; font-size: 13px; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .2s; }
.pf-pic:hover .pf-cam, .pf-pic:focus-within .pf-cam { opacity: 1; }
.pf-teams { display: flex; flex-direction: column; gap: 2px; max-height: 230px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.pf-teams .check { font-size: 13px; }
.pf-teams .d1 { padding-left: 18px; } .pf-teams .d2 { padding-left: 36px; } .pf-teams .d3 { padding-left: 54px; } .pf-teams .d4, .pf-teams .d5 { padding-left: 72px; }

/* avatars + user cards */
.av { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; object-fit: cover; flex: 0 0 auto;
  background: linear-gradient(135deg, #0b7593, #39c0e0); color: #fff; font: 600 17px var(--font-display); }
.av.sm { width: 28px; height: 28px; font-size: 12px; border: 2px solid var(--surface); margin-left: -8px; }
.av.more { background: var(--surface-2); color: var(--muted); }
img.hdr-av { object-fit: cover; }
.ucards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 12px; margin-top: 8px; }
.ucard { appearance: none; text-align: left; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); transition: border-color .15s, transform .15s, box-shadow .15s; }
.ucard:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 10px 22px -16px rgba(6, 27, 39, .6); }
.ucard.off { opacity: .6; }
.uc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.uc-main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-main small { color: var(--muted); font-size: 12px; }
.uc-teams { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.uc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; }
.role { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; letter-spacing: .02em; white-space: nowrap; }
.r-admin { color: var(--p); background: var(--p-bg); } .r-team_leader { color: var(--b); background: var(--b-bg); } .r-analytics { color: var(--o); background: var(--o-bg); }
.r-sales { color: var(--g); background: var(--g-bg); }
.tab-n { font-size: 11px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); margin-left: 4px; }

/* team tree */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree { margin-top: 12px; }
.tree ul { margin-left: 26px; padding-left: 18px; border-left: 2px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.tree li { position: relative; padding: 6px 0; }
.tree ul > li::before { content: ""; position: absolute; left: -18px; top: 34px; width: 18px; border-top: 2px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.tree li.folded > ul { display: none; }
.tn-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2);
  cursor: pointer; max-width: 760px; transition: border-color .15s, box-shadow .15s; }
.tn-card:hover, .tn-card:focus-visible { border-color: var(--accent); box-shadow: 0 8px 22px -16px rgba(6, 27, 39, .6); outline: none; }
.tn-fold { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 26px; height: 26px; border-radius: 8px; cursor: pointer; flex: 0 0 auto; transition: transform .2s; }
.tree li.folded > .tn-card .tn-fold { transform: rotate(-90deg); }
.tn-main { flex: 1; min-width: 0; }
.tn-main h3 { margin: 0; font: 500 16px var(--font-display); }
.tn-heads { margin: 1px 0 4px; font-size: 12.5px; color: var(--accent); }
.tn-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.tn-leaders { display: flex; padding-left: 8px; }
/* team panel */
.tp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; font-size: 11.5px; color: var(--muted); }
.tp-stats span { padding: 8px 4px; border-radius: 10px; background: var(--surface-2); }
.tp-stats b { display: block; font: 600 18px var(--font-display); color: var(--ink); }
.tp-users { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tp-users li { display: flex; align-items: center; justify-content: space-between; }
.tp-members { display: flex; flex-direction: column; gap: 6px; }
.tp-m { display: grid; grid-template-columns: 34px 1.3fr 1fr 32px; gap: 6px; align-items: center; }
.tp-m input { height: 38px !important; font-size: 13px !important; }
.tp-star { display: grid; place-items: center; cursor: pointer; }
.tp-star input { display: none; }
.tp-star span { font-size: 18px; color: var(--line); transition: color .15s, transform .15s; }
.tp-star input:checked + span { color: #f2b84b; transform: scale(1.1); }
.tp-del { appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; height: 32px; }
.tp-del:hover { color: var(--r); background: var(--r-bg); }
.tp-m[hidden] { display: none; }
select option.hl { font-weight: 700; }
.rc-cell { white-space: nowrap; }
.rc-cell .qr-form { display: inline; margin-left: 6px; }
.rc-dl { margin-left: 6px; font-size: 13px; }
.reveal.rc.shown { white-space: pre-line; text-align: left; font-family: var(--mono); font-size: 12px; line-height: 1.5; }
.cols-menu { min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.cols-menu .cm-title { font: 600 11px var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.cols-menu .check { font-size: 13px; padding: 3px 2px; }
.cols-menu .link { margin-top: 6px; align-self: flex-start; }
.cols-btn { padding: 6px 12px; font-size: 12.5px; }
.pf-mate { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pf-mate small { display: block; }
.pf-mate .av { width: 38px; height: 38px; font-size: 15px; }
/* column chooser pop-up (like Bitrix24's field selector) */
.fs-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(3, 14, 21, .55);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s; }
.fs-wrap.open { opacity: 1; }
.fs-box { width: min(720px, 100%); max-height: min(640px, 92vh); display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(6, 27, 39, .6); transform: translateY(10px) scale(.98); transition: transform .2s; }
.fs-wrap.open .fs-box { transform: none; }
.fs-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.fs-head h2 { margin: 0; font: 500 19px var(--font-display); }
.fs-tools { display: flex; align-items: center; gap: 14px; padding: 14px 20px 6px; flex-wrap: wrap; }
.fs-tools input { flex: 1 1 220px; height: 38px; border-radius: 10px; padding: 0 12px; }
.fs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; padding: 10px 20px 16px; overflow: auto; }
.fs-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 13.5px; border: 1px solid transparent; }
.fs-item:hover { background: var(--surface-2); border-color: var(--line); }
.fs-item input { width: 17px; height: 17px; accent-color: var(--accent); }
.fs-item[hidden] { display: none; }
.fs-foot { display: flex; gap: 8px; justify-content: flex-start; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
@media (max-width: 600px) { .fs-grid { grid-template-columns: 1fr 1fr; } }

/* ---- company structure: chart + list */
.vseg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.vseg button { appearance: none; border: 0; background: none; color: var(--muted); font: 500 13px var(--font); padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.vseg button.on { background: var(--accent); color: #fff; box-shadow: 0 4px 12px -6px var(--accent); }
.org-sum { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.org-sum span { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.org-sum b { color: var(--ink); font-weight: 600; }
.tst { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.tst b { color: var(--ink); font-weight: 600; }
.tst.ok { border-color: color-mix(in srgb, #1f9d62 40%, var(--line)); }
.tst.warn { color: #9c5700; background: #fff4e0; border-color: #f3d39c; }
.org-list > .actions { justify-content: flex-end; }

.oc-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.btn.sm { padding: 4px 10px; min-width: 32px; font-size: 13px; }
.oc-viewport { position: relative; overflow: hidden; height: min(70vh, 640px); border-radius: 16px; border: 1px solid var(--line); cursor: grab; touch-action: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent) 1px, transparent 1.4px) 0 0 / 22px 22px, var(--surface-2); }
.oc-viewport.drag { cursor: grabbing; }
.oc-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; padding: 28px; transition: transform .15s ease; }
.oc-viewport.drag .oc-canvas { transition: none; }
.oc, .oc ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.oc ul { padding-top: 26px; position: relative; }
.oc li { position: relative; padding: 26px 8px 0; display: flex; flex-direction: column; align-items: center; }
.oc > li { padding-top: 0; }
:root { --oc-line: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.oc li::before, .oc li::after { content: ""; position: absolute; top: 0; width: 50%; height: 26px; border-top: 2px solid var(--oc-line); }
.oc li::before { right: 50%; } .oc li::after { left: 50%; border-left: 2px solid var(--oc-line); }
.oc li:only-child::before, .oc li:only-child::after { display: none; }
.oc li:only-child { padding-top: 0; }
.oc li:first-child::before, .oc li:last-child::after { border: 0 none; }
.oc li:last-child::before { border-right: 2px solid var(--oc-line); border-radius: 0 10px 0 0; }
.oc li:first-child::after { border-radius: 10px 0 0 0; }
.oc ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 26px; border-left: 2px solid var(--oc-line); }
.oc > li > ul::before, .oc ul:has(> li:only-child)::before { height: 26px; }
.oc li.folded > ul { display: none; }
.oc-box { position: relative; width: 172px; padding: 12px 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; box-shadow: 0 10px 24px -20px rgba(6, 27, 39, .7);
  transition: transform .18s, box-shadow .18s, border-color .18s; animation: ocIn .2s ease both; }
.oc-box:hover, .oc-box:focus-visible { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 16px 30px -18px rgba(6, 27, 39, .7); outline: none; }
.oc-box.dept { border-top: 4px solid var(--accent); }
.oc-box.root { cursor: default; background: linear-gradient(135deg, #1f4e78, var(--accent)); color: #fff; border: 0; width: 200px; }
.oc-box.root .oc-head { color: rgba(255,255,255,.8); }
.oc-box.root:hover { transform: none; }
.oc-top { display: flex; justify-content: center; min-height: 0; margin-bottom: 2px; }
.oc-top .av + .av { margin-left: -6px; }
.oc-name { font: 600 14px var(--font-display); line-height: 1.25; }
.oc-head { font-size: 12px; color: var(--accent); }
.oc-head i { color: var(--muted); }
.oc-nums { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; font-size: 11.5px; color: var(--muted); }
.oc-warn { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: #f0a33a; color: #fff; font: 700 12px/20px var(--font); }
.oc-fold { position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px;
  border: 2px solid var(--surface); background: var(--accent); color: #fff; font: 600 11px var(--font); cursor: pointer; z-index: 1; }
.oc li.folded > .oc-box .oc-fold { background: var(--muted); }
@keyframes ocIn { from { opacity: 0; transform: translateY(6px); } }

.grp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.grp { appearance: none; text-align: left; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; transition: border-color .18s, transform .18s; }
.grp:hover { border-color: var(--accent); transform: translateY(-2px); }
.grp-n { font: 600 26px var(--font-display); } .grp-n small { font: 400 12px var(--font); color: var(--muted); margin-left: 4px; }
.grp-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.grp-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .35s ease; }
.warn-t { color: #9c5700; }
@media (max-width: 640px) { .oc-viewport { height: 62vh; } .oc-box { width: 150px; } }

@media (max-width: 640px) { .tabs { overflow-x: auto; scrollbar-width: none; } .tabs a { white-space: nowrap; flex: 0 0 auto; } .tabs a .tab-n { margin-left: 4px; } }

/* ---- team editor as a centred popup */
.sheet-wrap.modal { display: grid; place-items: center; padding: 16px; }
.sheet-wrap.modal .sheet { position: relative; inset: auto; width: min(860px, 100%); max-height: min(88vh, 900px); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: 0 40px 90px -30px rgba(6, 27, 39, .65); transform: translateY(16px) scale(.97); opacity: 0;
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), opacity .15s; }
.sheet-wrap.modal.open .sheet { transform: none; opacity: 1; }
.sheet-wrap.modal .sheet-head { flex-wrap: wrap; row-gap: 0; }
.sheet-wrap.modal .sheet-head .tp-path { flex-basis: 100%; order: -1; }
.tp-grid { display: flex; flex-direction: column; gap: 12px; }
.tp-side, .tp-people { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sheet-wrap.modal .sheet-foot { justify-content: flex-end; }
@media (min-width: 760px) {
  .sheet-wrap.modal .tp-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
  .sheet-wrap.modal .tp-stats { grid-template-columns: repeat(2, 1fr); }
  .sheet-wrap.modal .tp-people h3 { margin-top: 0; }
}
@media (max-width: 560px) {
  .sheet-wrap.modal { padding: 0; place-items: end stretch; }
  .sheet-wrap.modal .sheet { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; transform: translateY(100%); opacity: 1; }
}

/* ---- tree box popup */
.oc-box.picked, .tn-card.picked { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.oc-box.root.picked { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.tpop { position: fixed; z-index: 40; width: 280px; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 24px 50px -18px rgba(6, 27, 39, .55); opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top center;
  transition: opacity .18s, transform .18s; }
.tpop.open { opacity: 1; transform: none; }
.tpop.bottom { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto; transform: translateY(20px); }
.tpop.bottom.open { transform: none; }
.tpop-head { display: flex; align-items: baseline; gap: 8px; padding: 6px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tpop-head b { font: 600 14px var(--font-display); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpop-x { appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.tpop-a { appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-radius: 10px; background: none;
  color: var(--ink); font: 500 13.5px var(--font); text-align: left; cursor: pointer; }
.tpop-a:hover, .tpop-a:focus-visible { background: var(--surface-2); outline: none; }
.tpop-i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.tpop-move { padding: 8px; border-top: 1px solid var(--line); margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.tpop-l { font-size: 12px; color: var(--muted); }
.tpop-row { display: flex; gap: 6px; }
.tpop-row select { flex: 1; min-width: 0; height: 34px; border-radius: 9px; padding: 0 8px; font-size: 13px; }
.tpop-lr { display: flex; gap: 6px; padding: 0 8px 6px; }
.tpop-lr .btn { flex: 1; }
.oc-box.root { cursor: pointer; }

/* ---- section switcher (SIM Cards: SIM cards | SMS) */
.secnav { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 8px 20px -16px rgba(6, 27, 39, .5); }
.secnav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 16px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px;
  transition: background .2s, color .2s; }
.secnav a:hover { text-decoration: none; color: var(--ink); }
.secnav a.on { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -8px var(--accent); }
.secnav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---- campaign dialer cards */
.cq-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 0 0 12px; }
.cq-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.ok { background: #22c27a; } .dot.warn { background: #f2b53a; } .dot.bad { background: #e5484d; } .dot.off { background: #8f9db0; }
.cq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; margin-bottom: 18px; }
.cq { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 14px; border-radius: 18px; cursor: pointer;
  background: linear-gradient(160deg, #13253a, #0d1a2a); color: #e8f0f8; border: 2px solid #2a3c52;
  box-shadow: 0 16px 34px -24px rgba(6, 27, 39, .9); transition: transform .18s, box-shadow .18s; overflow: hidden; }
.cq:hover, .cq:focus-visible { transform: translateY(-3px); box-shadow: 0 22px 40px -22px rgba(6, 27, 39, .9); outline: none; }
.cq.h-ok { border-color: #22c27a; } .cq.h-warn { border-color: #f2b53a; } .cq.h-bad { border-color: #e5484d; } .cq.h-off { border-color: #3a4b60; }
.cq-badge { position: absolute; top: 0; right: 0; padding: 6px 12px 6px 16px; border-radius: 0 0 0 14px; font: 700 11px var(--font); letter-spacing: .08em;
  background: #2f4058; color: #c9d6e4; }
.cq-badge.b-dialing { background: #22c27a; color: #062b19; animation: cqPulse 1.6s ease-in-out infinite; }
.cq-badge.b-outside-hours, .cq-badge.b-paused { background: #9b59b6; color: #fff; }
.cq-badge.b-dialer-off { background: #f2b53a; color: #3a2600; }
.cq-badge.b-no-pbx { background: #e5484d; color: #fff; }
.cq-badge.b-ready, .cq-badge.b-waiting-for-leads, .cq-badge.b-no-free-agents { background: #1f6fa8; color: #fff; }
@keyframes cqPulse { 50% { filter: brightness(1.25); } }
.cq-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-top: 10px; }
.cq-head h3 { margin: 0; font: 700 20px var(--font-display); color: #33b5f5; }
.cq-head p { margin: 2px 0 0; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8fa3b8; }
.cq-ic { appearance: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid #2f4058; background: #172a40; color: #c9d6e4; cursor: pointer; font-size: 12px; }
.cq-ic:hover { border-color: #33b5f5; color: #fff; }
.cq-big { display: grid; grid-template-columns: 1fr 1fr; border-radius: 14px; background: #182d45; }
.cq-big > div { padding: 12px 8px; text-align: center; }
.cq-big > div + div { border-left: 1px solid #263b55; }
.cq small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8fa3b8; }
.cq-big b { font: 700 30px/1.2 var(--font-display); }
.cq-big b em { font: 500 15px var(--font); color: #8fa3b8; font-style: normal; }
.cq-big b.v { color: #b07cf0; }
.cq-row { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.cq-row b { font: 700 17px var(--font-display); color: #33b5f5; }
.cq-foot { display: flex; justify-content: space-between; gap: 8px; margin: 0; font-size: 11.5px; color: #8fa3b8; border-top: 1px solid #23364d; padding-top: 10px; }
.cq-err { margin: 0; font-size: 12px; color: #ff9b9e; }
.cq.paused .cq-big, .cq.paused .cq-row { opacity: .55; }
.cq-add { align-items: center; justify-content: center; min-height: 220px; border-style: dashed; color: #8fa3b8; font: 600 15px var(--font); background: transparent; }
:root:not([data-theme="dark"]) .cq-add { color: var(--muted); border-color: var(--line); }
.cq-add span { font-size: 34px; line-height: 1; }
.cq-form .cq-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cq-form .cq-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cq-form small { font-size: 11.5px; }
.cq-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cq-days label { cursor: pointer; }
.cq-days input { position: absolute; opacity: 0; pointer-events: none; }
.cq-days span { display: block; text-align: center; padding: 10px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  font-weight: 600; font-size: 13px; color: var(--muted); transition: background .15s, color .15s; }
.cq-days input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.cq-days input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cq-danger { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sheet-wrap.modal .sheet:has(.cq-form) { width: min(620px, 100%); }
@media (max-width: 520px) { .cq-form .cq-3 { grid-template-columns: 1fr 1fr; } }
.cq-hook summary { cursor: pointer; }
.cq-url { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-all; font-size: 13px; }
.cq-url i { color: var(--accent); font-style: normal; font-weight: 600; }
.cq-dlg { border: 1px solid var(--line); border-radius: 20px; padding: 22px; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(6, 27, 39, .65); }
.cq-dlg::backdrop { background: rgba(3, 14, 21, .5); backdrop-filter: blur(2px); }
.cq-dlg h2 { margin: 0 0 12px; font: 500 20px var(--font-display); }
.cq-dlg textarea { width: 100%; }
.chip.ls-pending { background: #e7f1fb; color: #1f6fa8; } .chip.ls-calling { background: #efe6fb; color: #6b3fb0; }
.chip.ls-answered { background: #e3f6ec; color: #11744a; } .chip.ls-no_answer { background: #fdecec; color: #b42328; }
.chip.ev-answered { background: #e3f6ec; color: #11744a; } .chip.ev-no_answer, .chip.ev-error, .chip.ev-rejected { background: #fdecec; color: #b42328; }
.chip.ev-dialed { background: #efe6fb; color: #6b3fb0; } .chip.ev-retry { background: #fff4e0; color: #9c5700; }

/* ---- add / edit forms (page + popup) */
.rf-page { max-width: 820px; margin: 0 auto; }
.rf-page h1 { margin: 6px 0 14px; }
.rf-page .card { padding: 22px; }
.rf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.rf-grid .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rf-grid .field.full { grid-column: 1 / -1; }
.rf-grid .field > label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.rf-grid input:not([type=checkbox]):not([type=file]), .rf-grid select { height: 44px; border-radius: 12px; padding: 0 14px; font-size: 14.5px; width: 100%; }
.rf-grid textarea { border-radius: 12px; padding: 10px 14px; font-size: 14px; width: 100%; resize: vertical; }
.rf-grid input:focus, .rf-grid select:focus, .rf-grid textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.rf-grid small { font-size: 11.5px; line-height: 1.4; }
.rf-grid .check { font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.em-row { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.em-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.rf-grid .em-row input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent; }
.em-row input:first-child { flex: 1.3; }
.em-at { display: grid; place-items: center; padding: 0 4px; color: var(--muted); font-weight: 600; }
.rf-grid .em-row .em-dom { flex: 1; background: var(--surface-2); color: var(--accent); }
.pw-wrap { position: relative; }
.rf-grid .pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 9px; background: none;
  color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { color: var(--accent); background: var(--surface-2); }
.pw-eye svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.pw-eye .eye-x { display: none; }
.pw-eye.on .eye-x { display: inline; }
.pw-eye.on { color: var(--accent); }
.rf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rf-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sheet .rf-foot { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--surface) 30%); border-top: 0; padding-bottom: 6px; }
.rf-danger { margin: 10px 0 0; text-align: right; }
.sheet-wrap.modal .sheet:has(form.rf) { width: min(760px, 100%); }
@media (max-width: 620px) { .rf-grid { grid-template-columns: 1fr; } .em-row { flex-wrap: wrap; } }

/* icon buttons */
.ic-btn { display: inline-flex; align-items: center; gap: 7px; }
.ic-btn svg, .pill-btn svg, .ib svg, button.otp svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.btn.sm.ic-btn { cursor: pointer; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent); font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s; }
.pill-btn:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: var(--accent); text-decoration: none; }
.ib { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s; }
.ib:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.cell-btns { display: inline-flex; align-items: center; gap: 6px; }
.rc-cell .qr-form { display: inline; margin: 0; }
button.reveal, button.otp { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s, background .15s; }
button.reveal:hover, button.otp:hover { border-color: var(--accent); }
button.reveal span { font-weight: 600; }
button.reveal.rc b { font-family: var(--font); }
button.otp { font-weight: 600; }
button.reveal.shown, button.otp.shown { height: auto; min-height: 30px; padding: 4px 12px; border-radius: 12px; }
.open-cell { white-space: nowrap; }
.open-link { appearance: none; border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent); }
.open-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.chip.nn { margin-left: 6px; font-size: 10.5px; }
.qchip.warn { border-color: #f3d39c; color: #9c5700; background: #fff4e0; }
.qchip.warn[aria-pressed="true"] { background: #f2b53a; color: #3a2600; border-color: #f2b53a; }
table.only-noname tbody tr:not([data-noname]) { display: none; }
.qchip { appearance: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: 600 12.5px var(--font); }

/* ---- search everything */
.hdr-search { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 500 13.5px var(--font); transition: border-color .15s, color .15s; }
.hdr-search:hover { border-color: var(--accent); color: var(--ink); }
.hdr-search svg { width: 17px; height: 17px; }
.hdr-search kbd, .srch kbd { white-space: nowrap; font: 600 10.5px var(--font); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
@media (max-width: 1500px) { .hdr-search span, .hdr-search kbd { display: none; } .hdr-search { width: 40px; justify-content: center; padding: 0; } }
.srch-wrap { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 9vh 16px 16px; }
.srch-back { position: absolute; inset: 0; background: rgba(3, 14, 21, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .18s; }
.srch { position: relative; width: min(680px, 100%); max-height: 78vh; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 40px 90px -30px rgba(6, 27, 39, .7);
  transform: translateY(-10px) scale(.98); opacity: 0; transition: transform .2s cubic-bezier(.2, .8, .2, 1), opacity .18s; }
.srch-wrap.open .srch-back { opacity: 1; }
.srch-wrap.open .srch { transform: none; opacity: 1; }
body.srch-open { overflow: hidden; }
.srch-bar { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.srch-bar svg { width: 20px; height: 20px; color: var(--accent); flex: 0 0 auto; }
.srch-bar input { flex: 1; min-width: 0; height: 58px; border: 0 !important; background: none; font-size: 16.5px; color: var(--ink); outline: none; box-shadow: none !important; }
.srch-bar input::-webkit-search-cancel-button { display: none; }
.srch-bar kbd { cursor: pointer; }
.srch-list { overflow-y: auto; padding: 6px 8px 10px; overscroll-behavior: contain; transition: opacity .15s; }
.srch-chips { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.srch-chips::-webkit-scrollbar { display: none; }
.srch-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 12.5px var(--font); white-space: nowrap; }
.srch-chip b { font-weight: 600; font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.srch-chip:hover { border-color: var(--accent); }
.srch-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
.srch-chip.on b { background: rgba(255, 255, 255, .22); color: inherit; }
.srch-list.busy { opacity: .6; }
.srch-hint { margin: 18px 12px; color: var(--muted); font-size: 13.5px; }
.srch-g { display: flex; align-items: center; gap: 8px; padding: 12px 10px 4px; font: 600 11px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.srch-g b { font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); letter-spacing: 0; }
.srch-g a { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 12px; }
.srch-it { user-select: text; -webkit-user-select: text; appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 12px; background: none;
  color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.srch-it.on { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.srch-ic { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; object-fit: cover;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); color: var(--accent); font-size: 15px; }
.srch-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.srch-tx b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-tx small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-tx mark { background: color-mix(in srgb, #f2b53a 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.srch-go { font-size: 11.5px; font-weight: 600; color: var(--accent); opacity: 0; }
.srch-it.on .srch-go { opacity: 1; }
@media (max-width: 560px) { .srch-wrap { padding: 0; } .srch { max-height: 100vh; height: 100%; border-radius: 0; } }

/* ---- email -> extension link, and the highlighted row on the Yeastar page */
.ext-pill { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 999px; font: 600 12.5px var(--mono);
  color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  transition: background .15s, transform .15s; white-space: nowrap; }
.ext-pill:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 20%, var(--surface)); transform: translateY(-1px); }
.ext-pill.auto { border-style: dashed; }
.ext-pill svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
@keyframes hlRow {
  0% { background: transparent; }
  12% { background: color-mix(in srgb, var(--accent) 30%, transparent); }
  30% { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  45% { background: color-mix(in srgb, var(--accent) 26%, transparent); }
  100% { background: transparent; }
}
tr.hl-row > td { animation: hlRow 2.2s ease-out both; }
tr.hl-row > td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
@media (prefers-reduced-motion: reduce) { tr.hl-row > td { animation: none; background: color-mix(in srgb, var(--accent) 18%, transparent); } }
.srch-tx b, .srch-tx small { user-select: text; -webkit-user-select: text; cursor: text; }
.srch-cp { appearance: none; width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; border: 1px solid transparent;
  background: none; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .12s, color .12s, border-color .12s; }
.srch-cp svg { width: 16px; height: 16px; }
.srch-it.on .srch-cp, .srch-it:hover .srch-cp { opacity: 1; }
.srch-cp:hover { color: var(--accent); border-color: var(--line); background: var(--surface); }
@media (hover: none) { .srch-cp { opacity: 1; } }

/* ---- loading: overlay, top bar, popup skeleton */
.ld-ov { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .15s; }
.ld-ov.on { opacity: 1; }
.ld-card { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px 40px 26px; border-radius: 22px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 30px 70px -30px rgba(6, 27, 39, .6); transform: scale(.94); transition: transform .2s cubic-bezier(.2, .9, .3, 1.3); }
.ld-ov.on .ld-card { transform: none; }
.ld-logo { height: 30px; width: auto; animation: ldBreath 1.4s ease-in-out infinite; }
.ld-ring { position: relative; width: 88px; height: 88px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 25%, var(--accent) 60%, #1f4e78 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); animation: ldSpin .8s linear infinite; }
.ld-ring.sm { width: 22px; height: 22px; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); margin-left: auto; }
.ld-text { font: 600 14px var(--font); color: var(--ink); }
.ld-dots { display: flex; gap: 5px; }
.ld-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: ldDot .9s ease-in-out infinite; }
.ld-dots i:nth-child(2) { animation-delay: .15s; } .ld-dots i:nth-child(3) { animation-delay: .3s; }
.ld-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 95; pointer-events: none; opacity: 0; transition: opacity .2s; overflow: hidden; }
.ld-bar.on { opacity: 1; }
.ld-bar i { position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), #33b5f5, transparent); animation: ldBar 1s ease-in-out infinite; }
.sk { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--accent) 10%, var(--surface-2)) 50%, var(--surface-2) 75%);
  background-size: 300% 100%; animation: ldShimmer 1.1s linear infinite; }
.sk-panel .sheet-head { display: flex; align-items: center; }
.sk-title { width: 45%; height: 22px; }
.sk-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 6px; }
.sk-label { width: 28%; height: 11px; border-radius: 6px; }
.sk-input { height: 42px; }
.ld-in { animation: ldFade .16s ease-out both; }
@keyframes ldSpin { to { transform: rotate(1turn); } }
@keyframes ldBreath { 50% { opacity: .55; transform: scale(.97); } }
@keyframes ldDot { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@keyframes ldBar { from { left: -40%; } to { left: 100%; } }
@keyframes ldShimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@keyframes ldFade { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .ld-ring, .ld-logo, .ld-dots i, .sk, .ld-bar i { animation-duration: 2.5s; } }
.ld-card .on-light { display: var(--logo-navy); } .ld-card .on-dark { display: var(--logo-white); }

/* ---- the progress ring (static/progress.js): a real percentage on long waits, filling smoothly as the work reports */
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
.pring { --p: 0; --sz: 96px; --th: 8px; position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--sz); height: var(--sz); border-radius: 50%; transition: --p .7s cubic-bezier(.3, .8, .3, 1); }
.pring::before { content: ""; position: absolute; inset: 0; border-radius: 50%;     /* the track and its fill: a masked ring,
                                                                                      so a see-through card never shows through */
  background: conic-gradient(color-mix(in srgb, var(--accent) 55%, #33b5f5) 0, var(--accent) calc(var(--p) * 1%),
    color-mix(in srgb, var(--accent) 14%, transparent) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--th) - .5px), #000 calc(100% - var(--th)));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--th) - .5px), #000 calc(100% - var(--th))); }
.pring::after { content: ""; position: absolute; top: 0; left: calc(50% - var(--th) / 2); width: var(--th); height: var(--th);
  border-radius: 50%; background: var(--accent); transform-origin: 50% calc(var(--sz) / 2); transform: rotate(calc(var(--p) * 3.6deg));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); opacity: calc(min(var(--p), 1)); }
.pring b { position: relative; font: 600 calc(var(--sz) * .27)/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; }
.pring b small { font-size: .48em; font-weight: 500; color: var(--muted); margin-left: 1px; }
.pring.sm { --sz: 16px; --th: 3px; vertical-align: -3px; } .pring.sm b, .pring.sm::after { display: none; }
.pring.md { --sz: 56px; --th: 5px; }
@media (prefers-reduced-motion: reduce) { .pring { transition: none; } }
/* the loading pop-up: its spinner becomes the ring once the work reports, with what is going on under it */
.ld-card > .pring, .ld-sub { display: none; }
.ld-card.has-p > .pring { display: inline-grid; } .ld-card.has-p > .ld-ring, .ld-card.has-p > .ld-dots { display: none; }
.ld-card.has-p .ld-sub:not(:empty) { display: block; }
.ld-sub { max-width: 300px; margin-top: -6px; text-align: center; font: 500 12.5px/1.35 var(--font); color: var(--muted); }
/* a job's button fills up from the left with its real percentage */
.has-p.sync-btn, .has-p.bx-sync-btn { background-image: linear-gradient(90deg, color-mix(in srgb, var(--accent) 24%, transparent) calc(var(--p) * 1%),
  transparent 0); transition: --p .7s cubic-bezier(.3, .8, .3, 1); }
.p-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.p-what { color: var(--muted); font-weight: 500; }
.wt-sending { display: flex; align-items: center; gap: 10px; }
/* a file on its way to WhatsApp: the ring over its picture, bytes really sent */
.wa-tray-th { position: relative; }
.wa-tray-th > .pring { position: absolute; --sz: 58px; --th: 5px; background: linear-gradient(var(--surface), var(--surface)), var(--bg);
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .45); }
.wa-tray-th > .pring.wait::before { animation: ldBreath 1.2s ease-in-out infinite; }
.hdr-nav a .nav-img { width: 18px; height: 18px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 0 1px rgba(255,255,255,.25)); }
@media (max-width: 1240px) { .hdr-nav a .nav-img { display: none; } }
@media (max-width: 900px) { .hdr-nav a .nav-img { display: inline; width: 22px; height: 22px; } }
.tag.bx { background: color-mix(in srgb, #2fc6f6 14%, var(--surface-2)); border: 1px dashed color-mix(in srgb, #2fc6f6 55%, var(--line)); }
.tag.bx::before { content: "B24 "; font-size: 9.5px; font-weight: 700; color: #1a9fd0; letter-spacing: .04em; }
button.reveal { position: relative; overflow: hidden; }
button.reveal.shown::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent);
  transform-origin: left; animation: revealLeft 2s linear forwards; }
@keyframes revealLeft { to { transform: scaleX(0); } }
.cq-setup summary { cursor: pointer; }
.cq-setup-grid { display: grid; grid-template-columns: minmax(260px, 1fr) 1.5fr; gap: 24px; margin-top: 14px; }
@media (max-width: 900px) { .cq-setup-grid { grid-template-columns: 1fr; } }
.cq-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cq-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.cq-steps li > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cq-steps li small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cq-tick { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  border: 2px solid var(--line); color: var(--muted); }
.cq-steps li.ok .cq-tick { background: #22c27a; border-color: #22c27a; color: #fff; }
.cq-setup-side h3 { margin: 4px 0 6px; font: 600 14px var(--font-display); }
.cq-test { display: grid; grid-template-columns: 1.6fr .7fr auto; gap: 8px; margin: 8px 0; }
.cq-test input, .cq-test select { height: 40px; border-radius: 10px; padding: 0 10px; min-width: 0; }
@media (max-width: 620px) { .cq-test { grid-template-columns: 1fr 1fr; } }
.cq-result { display: flex; flex-direction: column; gap: 3px; margin: 6px 0 10px; padding: 10px 14px; border-radius: 12px; font-size: 13px;
  animation: ldFade .25s ease-out both; }
.cq-result.ok { background: #e3f6ec; color: #0d5c3a; border: 1px solid #a8e2c4; }
.cq-result.bad { background: #fdecec; color: #8f1d22; border: 1px solid #f3b9bc; }
.cq-result small { opacity: .8; }
:root[data-theme="dark"] .cq-result.ok { background: #0f3626; color: #a6f0c9; border-color: #1d6b49; }
:root[data-theme="dark"] .cq-result.bad { background: #3a1416; color: #ffb3b6; border-color: #7a2a2e; }
.cq-howto { margin: 4px 0 8px; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.cq-imp-all { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; cursor: pointer; }
.cq-imp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cq-imp-list label { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; transition: border-color .12s; }
.cq-imp-list label:hover { border-color: var(--accent); }
.cq-imp-list li.have label { opacity: .6; cursor: default; }
.cq-imp-n { font: 700 15px var(--mono); color: var(--accent); min-width: 48px; }
.cq-imp-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pbx-box { padding: 12px 14px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface)); gap: 6px !important; }
.pbx-box .check { color: var(--ink) !important; }
.cq-pbx { border-top: 1px solid var(--line); }
.cq-pbx h3 { margin: 4px 0 0; font: 600 13px var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.agp-find { height: 36px !important; }
.agp-list { max-height: 190px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px;
  padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.agp-it { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; min-width: 0; }
.agp-it:hover { background: var(--surface); }
.agp-it span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agp-it:has(input:checked) { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.agp-n { font: 600 12.5px var(--mono); color: var(--accent); }
.cq-danger form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cq-cdr { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; padding-top: 6px; border-top: 1px dashed currentColor; font-size: 12.5px; }

/* ---- settings: big collapsible sections */
.set-nav { position: sticky; top: 76px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 14px; padding: 8px;
  border-radius: 16px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.set-nav a { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); background: var(--surface); }
.set-nav a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.set-nav-tools { margin-left: auto; display: flex; gap: 6px; }
details.set-group { padding: 0; overflow: hidden; }
details.set-group > .set-grid { padding: 4px 22px 18px; }
.set-head { list-style: none; display: flex; align-items: center; gap: 14px; padding: 18px 22px; cursor: pointer; user-select: none; }
.set-head::-webkit-details-marker { display: none; }
.set-head:hover { background: var(--surface-2); }
.set-ic { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; font: 700 15px var(--font-display);
  color: #fff; background: linear-gradient(135deg, #1f4e78, var(--accent)); }
.set-title { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.set-title b { font: 600 19px var(--font-display); color: var(--ink); }
.set-chev { font-size: 22px; color: var(--muted); transition: transform .2s; line-height: 1; }
details.set-group[open] > .set-head .set-chev { transform: rotate(180deg); }
details.set-group[open] > .set-head { border-bottom: 1px solid var(--line); }
details.set-group.dirty > .set-head .set-title b::after { content: " • unsaved"; font: 600 12px var(--font); color: #d08a12; }
details.set-group.flash-in { animation: setFlash 1.2s ease-out; }
@keyframes setFlash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@media (max-width: 700px) { .set-nav { top: 64px; } .set-nav-tools { margin-left: 0; } .set-title b { font-size: 17px; } }

/* ---- campaign queue cards v2: bigger, livelier */
.cq-grid { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 18px; }
.cq { padding: 22px 22px 18px; gap: 16px; border-radius: 24px; border-width: 2px; isolation: isolate;
  background: radial-gradient(120% 90% at 0% 0%, #1b3654 0%, #10223a 45%, #0b1828 100%); min-height: 330px; }
.cq-glow { position: absolute; inset: auto -30% -60% auto; width: 70%; height: 90%; border-radius: 50%; z-index: -1; filter: blur(50px); opacity: .35;
  background: #2a7bd0; transition: opacity .3s; }
.cq.h-ok .cq-glow { background: #22c27a; } .cq.h-warn .cq-glow { background: #f2b53a; } .cq.h-bad .cq-glow { background: #e5484d; }
.cq.h-off .cq-glow { opacity: .12; }
.cq.dialing { box-shadow: 0 0 0 1px rgba(34,194,122,.25), 0 24px 50px -26px rgba(34,194,122,.6); }
.cq-badge { font-size: 11.5px; padding: 7px 14px 7px 16px; border-radius: 0 0 0 16px; display: inline-flex; align-items: center; gap: 7px; }
.cq-dot { width: 8px; height: 8px; border-radius: 50%; background: #062b19; animation: cqBlink 1s ease-in-out infinite; }
@keyframes cqBlink { 50% { opacity: .25; } }
.cq-head { margin-top: 6px; align-items: center; }
.cq-id { display: flex; flex-direction: column; }
.cq-q { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6f87a2; }
.cq-head h3 { font-size: 34px; line-height: 1.05; letter-spacing: -.01em; background: linear-gradient(90deg, #4cc3ff, #8fd8ff); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.cq-head p { font-size: 13px; margin-top: 4px; color: #a8bacd; }
.cq-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; }
.cq-ic svg { width: 18px; height: 18px; fill: currentColor; }
.cq-ic.play { background: #22c27a; border-color: #22c27a; color: #062b19; }
.cq-ic.play:hover { filter: brightness(1.1); color: #062b19; }
.cq-big { grid-template-columns: 1.15fr 1fr; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }
.cq-big > div { padding: 16px 14px 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cq-big b { font-size: 46px; line-height: 1; }
.cq-big b em { font-size: 18px; }
.cq-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 6px; max-width: 150px; }
.cq-seats i { width: 10px; height: 10px; border-radius: 3px; background: rgba(255,255,255,.12); }
.cq-seats i.on { background: #22c27a; box-shadow: 0 0 8px rgba(34,194,122,.6); }
.cq-seats em { font-size: 10.5px; color: #8fa3b8; font-style: normal; }
.cq-live b { color: #b07cf0; }
.cq-wave { display: flex; align-items: flex-end; gap: 3px; height: 16px; margin-top: 6px; }
.cq-wave i { width: 4px; height: 4px; border-radius: 2px; background: rgba(176,124,240,.35); }
.cq-live.on .cq-wave i { background: #b07cf0; animation: cqWave 1s ease-in-out infinite; }
.cq-live.on .cq-wave i:nth-child(2) { animation-delay: .1s; } .cq-live.on .cq-wave i:nth-child(3) { animation-delay: .2s; }
.cq-live.on .cq-wave i:nth-child(4) { animation-delay: .3s; } .cq-live.on .cq-wave i:nth-child(5) { animation-delay: .4s; }
@keyframes cqWave { 0%, 100% { height: 4px; } 50% { height: 16px; } }
.cq-row { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cq-row > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; background: rgba(255,255,255,.03); }
.cq-row b { font-size: 20px; }
.cq-row b em { font-size: 12px; font-style: normal; color: #8fa3b8; margin-left: 1px; }
.cq-row small { font-size: 10px; }
.cq-res { display: flex; flex-direction: column; gap: 6px; }
.cq-res-bar { height: 6px; border-radius: 6px; background: rgba(229,72,77,.35); overflow: hidden; }
.cq-res-bar i.a { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c27a, #5be0a2); border-radius: 6px; transition: width .6s ease; }
.cq-res-t { font-size: 12px; color: #8fa3b8; display: flex; gap: 6px; align-items: baseline; }
.cq-res-t b.ok { color: #5be0a2; } .cq-res-t b.no { color: #ff9b9e; margin-left: 6px; }
.cq-res-t em { margin-left: auto; font-style: normal; font-weight: 700; color: #e8f0f8; }
.cq-foot { align-items: center; font-size: 12.5px; }
.cq-foot span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.cq-foot svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.cq-edit { color: #4cc3ff; font-weight: 600; opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.cq:hover .cq-edit, .cq:focus-visible .cq-edit { opacity: 1; transform: none; }
.cq-add { min-height: 330px; gap: 6px; border-radius: 24px; }
.cq-add b { font-size: 17px; } .cq-add small { font-size: 12px; opacity: .7; }
@media (max-width: 420px) { .cq-grid { grid-template-columns: 1fr; } .cq-head h3 { font-size: 30px; } .cq-big b { font-size: 40px; } }
@media (prefers-reduced-motion: reduce) { .cq-live.on .cq-wave i, .cq-dot { animation: none; } }
.refresh-btn svg { width: 16px; height: 16px; }
.refresh-btn.spin svg { animation: ldSpin .7s linear infinite; }

/* ---- queue cards: a bit smaller grid + list view */
.cq-viewbar { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
.cq-viewbar .vseg button { display: inline-flex; align-items: center; gap: 6px; }
.cq-viewbar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.cq-grid { grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 14px; }
.cq { padding: 18px 18px 14px; gap: 12px; min-height: 280px; border-radius: 20px; }
.cq-head h3 { font-size: 28px; }
.cq-ic { width: 40px; height: 40px; border-radius: 12px; }
.cq-big > div { padding: 12px 10px 10px; }
.cq-big b { font-size: 38px; }
.cq-big b em { font-size: 15px; }
.cq-row b { font-size: 17px; }
.cq-row > div { padding: 6px 2px; }
.cq-add { min-height: 280px; border-radius: 20px; }

/* list view: one slim row per queue */
.cq-view-list .cq-grid { grid-template-columns: 1fr; gap: 8px; }
.cq-view-list .cq { min-height: 0; flex-direction: row; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 16px; flex-wrap: wrap; }
.cq-view-list .cq:hover { transform: none; }
.cq-view-list .cq-glow, .cq-view-list .cq-seats, .cq-view-list .cq-wave, .cq-view-list .cq-edit, .cq-view-list .cq-q,
.cq-view-list .cq-res-bar, .cq-view-list .cq-row small { display: none; }
.cq-view-list .cq-badge { position: static; order: 2; border-radius: 999px; padding: 5px 11px; font-size: 10.5px; min-width: 128px; justify-content: center; }
.cq-view-list .cq-head { order: 1; margin: 0; min-width: 210px; flex: 0 0 auto; gap: 12px; flex-direction: row-reverse; justify-content: flex-end; }
.cq-view-list .cq-id { flex-direction: row; align-items: baseline; gap: 10px; }
.cq-view-list .cq-head h3 { font-size: 22px; }
.cq-view-list .cq-head p { margin: 0; font-size: 12px; }
.cq-view-list .cq-ic { width: 34px; height: 34px; border-radius: 10px; }
.cq-view-list .cq-big { order: 3; display: flex; background: none; border: 0; gap: 18px; }
.cq-view-list .cq-big > div { padding: 0; flex-direction: row; align-items: baseline; gap: 6px; }
.cq-view-list .cq-big > div + div { border: 0; }
.cq-view-list .cq-big b { font-size: 22px; }
.cq-view-list .cq-big b em { font-size: 12px; }
.cq-view-list .cq-row { order: 4; display: flex; gap: 6px; flex: 1; }
.cq-view-list .cq-row > div { padding: 4px 10px; flex-direction: row; gap: 5px; align-items: baseline; }
.cq-view-list .cq-row > div::after { content: attr(data-l); font-size: 10.5px; color: #8fa3b8; text-transform: uppercase; letter-spacing: .06em; }
.cq-view-list .cq-row b { font-size: 15px; }
.cq-view-list .cq-res { order: 5; min-width: 120px; }
.cq-view-list .cq-res-t { font-size: 11.5px; }
.cq-view-list .cq-foot { order: 6; border: 0; padding: 0; margin-left: auto; }
.cq-view-list .cq-err { order: 7; flex-basis: 100%; margin: 0; }
.cq-view-list .cq-add { min-height: 0; flex-direction: row; padding: 12px; gap: 10px; border-radius: 16px; }
.cq-view-list .cq-add span { font-size: 22px; }
.cq-view-list .cq-add small { display: none; }
@media (max-width: 760px) { .cq-view-list .cq-row { flex-wrap: wrap; } .cq-view-list .cq-foot { margin-left: 0; } }
.cq-view-list .cq-res { min-width: 0; }
.cq-view-list .cq-res-t { white-space: nowrap; font-size: 0; gap: 8px; }
.cq-view-list .cq-res-t b, .cq-view-list .cq-res-t em { font-size: 12.5px; margin: 0; }
.cq-view-list .cq-foot { white-space: nowrap; font-size: 11.5px; }
.cq-view-list .cq-badge { min-width: 112px; }
.cq-view-list .cq-row { flex: 0 1 auto; }
.cq-view-list .cq { flex-wrap: nowrap; gap: 12px; }
.cq-view-list .cq-row > div { padding: 4px 8px; }
.cq-view-list .cq-head { min-width: 190px; }
@media (max-width: 1280px) { .cq-view-list .cq { flex-wrap: wrap; } }
.cq-view-list .cq-head { width: 240px; min-width: 240px; }
.cq-view-list .cq-head p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.cq-view-list .cq-big > div:first-child { min-width: 150px; }
@media (max-width: 1280px) { .cq-view-list .cq-head { width: auto; } }
.secnav-n { margin-left: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff; font: 700 11px/18px var(--font); text-align: center; }
.rep-soon { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 20px; gap: 6px; }
.rep-soon svg { width: 46px; height: 46px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.rep-soon h2 { margin: 6px 0 0; }

/* ---------------------------------------------------------------- Reports (agent login, queue performance) */
.rp-filter { display: flex; flex-direction: column; gap: 14px; }
.rp-top { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.rp-yday { appearance: none; display: inline-flex; align-items: center; gap: 12px; padding: 11px 18px 11px 14px; border-radius: 14px; cursor: pointer;
  font: inherit; color: var(--ink); text-align: left; border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface)); transition: transform .12s, box-shadow .12s, border-color .12s; }
.rp-yday:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(11, 117, 147, .16); border-color: var(--accent); }
.rp-yday svg { width: 30px; height: 30px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rp-yday b { display: block; font-size: 15px; }
.rp-yday small { display: block; color: var(--muted); font-size: 12px; }
.rp-yday.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(11, 117, 147, .22); }
.rp-yday.on svg { stroke: currentColor; } .rp-yday.on small { color: inherit; opacity: .82; }
.rp-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-presets .pill-btn { appearance: none; font: inherit; font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); cursor: pointer; }
.rp-presets .pill-btn:hover { color: var(--ink); border-color: var(--accent); }
.rp-presets .pill-btn.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.rp-line { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding-top: 14px; border-top: 1px dashed var(--line); }
.rp-when, .rp-sel { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.rp-when input { font-family: var(--mono); font-size: 13px; min-width: 210px; }
.rp-sel select { min-width: 170px; }
.rp-num input { width: 120px; }
.rp-arrow { color: var(--muted); padding-bottom: 9px; }
.rp-go { margin-left: auto; }
.rp-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rp-range { display: flex; align-items: center; gap: 6px; margin: -6px 0 14px; }
.rp-range svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.rp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.rp-kpi { --c: var(--accent); position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 13px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.rp-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.rp-kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--c); opacity: .08; }
.rp-kpi span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rp-kpi b { font-family: var(--font-display); font-size: 28px; line-height: 1.15; color: var(--c); font-variant-numeric: tabular-nums; }
.rp-kpi small { color: var(--muted); font-size: 12px; }
.rp-card { padding-top: 14px; }
/* the PBX-report look: navy header, light-blue bands */
table.rp-table th { background: #253858; color: #fff; text-transform: none; letter-spacing: 0; font-size: 12.5px; padding: 11px 10px; border-bottom: 0; }
table.rp-table thead th:first-child { border-top-left-radius: 8px; } table.rp-table thead th:last-child { border-top-right-radius: 8px; }
table.rp-table > tbody > tr:nth-child(4n+1) > td, table.rp-perf > tbody > tr:nth-child(odd) > td { background: #e3f3fb; }
table.rp-perf > tbody > tr:nth-child(4n+1) > td { background: #e3f3fb; } table.rp-perf > tbody > tr:nth-child(4n+3) > td { background: #e3f3fb; }
table.rp-table td { border-bottom: 1px solid #c4e4f2; }
:root[data-theme="dark"] table.rp-table th { background: #0b3a55; }
:root[data-theme="dark"] table.rp-table > tbody > tr:nth-child(4n+1) > td, :root[data-theme="dark"] table.rp-perf > tbody > tr:nth-child(odd) > td { background: #10314a; }
:root[data-theme="dark"] table.rp-table td { border-bottom-color: #1d3a4c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) table.rp-table th { background: #0b3a55; }
  :root:not([data-theme="light"]) table.rp-table > tbody > tr:nth-child(4n+1) > td, :root:not([data-theme="light"]) table.rp-perf > tbody > tr:nth-child(odd) > td { background: #10314a; }
  :root:not([data-theme="light"]) table.rp-table td { border-bottom-color: #1d3a4c; } }
table.rp-table .r { text-align: right; } table.rp-table .c { text-align: center; }
table.rp-table th.r { text-align: right; } table.rp-table th.c { text-align: center; }
.rp-row[data-rp-toggle] { cursor: pointer; }
.rp-row[data-rp-toggle]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rp-caret { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s; vertical-align: 2px; }
.rp-row.open .rp-caret { transform: rotate(45deg); }
.rp-name { color: var(--ink); }
.rp-work { color: var(--g); }
.rp-total td { background: var(--surface-2); border-top: 2px solid #7cc4e4; font-weight: 600; }
.rp-bar-h { min-width: 170px; } .rp-bar-c { min-width: 170px; }
.rp-bar { position: relative; height: 12px; border-radius: 6px; background: var(--n-bg); overflow: hidden; }
.rp-bar i { position: absolute; top: 0; bottom: 0; }
.rp-bar .seg-in { background: #2e9d68; border-radius: 3px; }
.rp-bar .seg-pause { background: #e6a521; top: 2px; bottom: 2px; border-radius: 2px; }
.rp-legend { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rp-legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-left: 8px; }
.rp-legend .lg-in { background: #2e9d68; } .rp-legend .lg-pause, .rp-legend .lg-y { background: #e6a521; }
.rp-legend .lg-v { background: #7b4fc4; } .rp-legend .lg-r { background: #d2453b; } .rp-legend .lg-o { background: #39c0e0; }
.rp-legend-b { margin-top: 10px; }
.rp-detail > td { background: var(--surface-2) !important; padding: 14px 16px 16px; }
.rp-detail h3 { font-size: 13px; margin: 0 0 8px; }
.rp-dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rp-ev { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 7px 10px; border-left: 3px solid #2e9d68; background: var(--surface);
  border-radius: 0 8px 8px 0; margin-bottom: 6px; font-size: 13px; }
.rp-ev.pause { border-left-color: #e6a521; }
.rp-ev small { grid-column: 1 / -1; }
.rp-stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--n-bg); }
.rp-stack i { display: block; height: 100%; }
.rp-stack .v { background: #7b4fc4; } .rp-stack .r { background: #d2453b; } .rp-stack .o { background: #39c0e0; } .rp-stack .y { background: #e6a521; }
.rp-num-pill { display: inline-block; min-width: 30px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.rp-num-pill.v { color: var(--p); background: var(--p-bg); } .rp-num-pill.r { color: var(--r); background: var(--r-bg); } .rp-num-pill.y { color: var(--y); background: var(--y-bg); }
.rp-calls { display: flex; align-items: center; gap: 10px; }
.rp-calls b { min-width: 34px; }
.rp-mini { position: relative; display: block; height: 8px; border-radius: 4px; background: #9fb3c2; overflow: hidden; }
.rp-mini i { position: absolute; inset: 0 auto 0 0; background: #2e9d68; }
table.rp-sub th { background: var(--surface); color: var(--muted); }
.rp-good { color: var(--g); font-weight: 600; } .rp-bad { color: var(--r); font-weight: 600; }
.rp-wide table.data td, .rp-wide table.data th { white-space: nowrap; }
.rp-tabs { margin-bottom: 16px; }
@media (max-width: 1000px) { .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .rp-yday { width: 100%; }
  .rp-presets { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 2px; }
  .rp-presets .pill-btn { flex: 0 0 auto; }
  .rp-line { flex-direction: column; align-items: stretch; }
  .rp-when input, .rp-sel select, .rp-num input { min-width: 0; width: 100%; }
  .rp-arrow { display: none; }
  .rp-go { margin-left: 0; justify-content: center; padding: 11px; }
  .rp-kpi b { font-size: 22px; }
  .rp-dgrid { grid-template-columns: 1fr; }
  .rp-detail > td { padding: 10px; }
}

/* ---------------------------------------------------------------- phone: wide tables become cards */
@media (max-width: 700px) {
  table.rtable, table.rtable > tbody, table.rtable > tfoot { display: block; width: 100%; }
  table.rtable > thead { display: none; }
  table.rtable > tbody > tr, table.rtable > tfoot > tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; padding: 12px 14px;
    margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  table.rtable > tbody > tr[hidden] { display: none; }
  table.rtable > tbody > tr > td, table.rtable > tfoot > tr > td { display: flex; flex-direction: column; padding: 3px 0; border: 0 !important;
    background: none !important; text-align: left !important; min-width: 0; align-items: flex-start; }
  table.rtable > tbody > tr > td::before, table.rtable > tfoot > tr > td::before { content: attr(data-label); font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  table.rtable > tbody > tr > td:first-child, table.rtable > tfoot > tr > td:first-child { grid-column: 1 / -1; font-size: 15px; padding-bottom: 6px;
    border-bottom: 1px solid var(--line) !important; margin-bottom: 4px; flex-direction: row; align-items: center; flex-wrap: wrap; }
  table.rtable > tbody > tr > td:first-child::before, table.rtable > tfoot > tr > td:first-child::before { display: none; }
  table.rtable > tbody > tr > td.rp-bar-c { grid-column: 1 / -1; }
  table.rtable > tbody > tr > td:empty, table.rtable > tfoot > tr > td:empty { display: none; }
  table.rtable > tbody > tr.rp-detail { display: block; padding: 0; border: 0; background: none; margin-top: -6px; }
  table.rtable > tbody > tr.rp-detail[hidden] { display: none; }
  table.rtable > tbody > tr.rp-detail > td { display: block; border-radius: 0 0 12px 12px; }
  table.rtable > tbody > tr.rp-detail > td::before { display: none; }
  table.rtable > tbody > tr.open { border-radius: 12px 12px 0 0; margin-bottom: 0; }
  table.rtable .rp-total, table.rtable > tfoot > tr { background: var(--surface-2); border-color: #7cc4e4; }
  .table-wrap:has(> table.rtable) { margin: 0; padding: 0; overflow: visible; }
  .rp-wide table.data td { white-space: normal; }
}

/* ---------------------------------------------------------------- phone friendly (≤ 700px) */
.port .pwr { display: grid; place-items: center; }
.port .pwr svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (max-width: 700px) {
  .wrap { overflow-x: clip; }
  .page-head h1 { font-size: 26px; }
  .page-head .actions { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  /* section tabs: share the width instead of running off the screen */
  .secnav { display: flex; width: 100%; }
  .secnav a { flex: 1 1 0; min-width: 0; justify-content: center; padding: 8px 6px; font-size: 13px; gap: 5px; text-align: center; line-height: 1.2; }
  .secnav svg { width: 15px; height: 15px; flex: none; }
  /* GOIP ports: 3 per row, readable */
  .ports { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .port { min-height: 68px; padding: 7px 8px 8px; }
  .port .pl { font-size: 13px; }
  .port .ps { padding-right: 26px; }
  .port .pcall { position: static; order: -1; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .port .pwr { opacity: 1; width: 24px; height: 24px; }
  .legend { display: flex; flex-wrap: wrap; gap: 4px 10px; line-height: 1.6; }
  /* filter chips scroll sideways instead of overflowing */
  .qchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .qchips > * { flex: 0 0 auto; }
  .filters input[type=search] { min-width: 0; flex: 1 1 100%; }
  /* user cards: smaller avatar, badges under the name */
  .ucard { flex-wrap: wrap; align-items: flex-start; }
  .ucard .av, .ucard > .hdr-av, .ucard > img { width: 42px; height: 42px; flex: none; }
  .uc-main { flex: 1 1 calc(100% - 60px); }
  .uc-side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; width: 100%; padding-left: 54px; text-align: left; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs a { white-space: nowrap; flex: 0 0 auto; }
  /* card rows for the generic tables (labels come from the column headers, set by app.js) */
  table.rtable > tbody > tr.group-row { display: block; padding: 0; border: 0; background: none; margin: 14px 0 8px; }
  table.rtable > tbody > tr.group-row > td { display: block; padding: 8px 4px !important; border-bottom: 2px solid var(--line) !important; font-size: 13px; }
  table.rtable > tbody > tr.group-row > td::before { display: none; }
  table.rtable tr.rs-ok { border-left: 4px solid var(--g); } table.rtable tr.rs-low { border-left: 4px solid var(--y); }
  table.rtable tr.rs-bad { border-left: 4px solid var(--r); } table.rtable tr.rs-off, table.rtable tr.rs-out { border-left: 4px solid var(--n); }
  table.rtable tr td:first-child { box-shadow: none !important; }
  table.rtable > tbody > tr > td.row-actions, table.rtable > tbody > tr > td.cell-actions { grid-column: 1 / -1; }
  table.rtable > tbody > tr > td[data-label=""]::before { display: none; }
  table.rtable > tbody > tr > td[data-label=""] { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 6px 16px; padding-top: 8px; }
  table.rtable > tbody > tr > td[data-label=""] > * { flex: 0 0 auto; }
  table.rtable > tbody > tr > td { white-space: normal !important; overflow-wrap: anywhere; }
  table.rtable td .cell-btns { flex-wrap: wrap; }
  table.rtable > tbody > tr > td.secret, table.rtable > tbody > tr > td.otp-cell, table.rtable > tbody > tr > td.rc-cell { align-items: flex-start; }
  table.rtable td.mono { word-break: break-all; }
  .sim-wrap { max-height: none; }
  .sim-table thead th { position: static; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .field select, .field input, .field textarea { min-width: 0; width: 100%; max-width: 100%; }
  table.rtable > tbody > tr > td.sms-text, table.rtable > tbody > tr > td.small { grid-column: 1 / -1; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .alert { flex-wrap: wrap; }
}

.rp-warn { color: var(--r); }

/* Google Workspace on the Emails page */
.gw-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13.5px; }
.gw-bar > span:nth-child(2) { flex: 1 1 260px; display: flex; flex-direction: column; gap: 1px; }
.gw-bar form { margin-left: auto; }
.gw-bar.err { border-color: var(--r); }
.gw-err, .gw-warn { color: var(--r); }
.gw-logo svg { width: 26px; height: 26px; display: block; }
.gw-logo path:nth-child(1) { fill: #4285f4; } .gw-logo path:nth-child(2) { fill: #34a853; }
.gw-logo path:nth-child(3) { fill: #fbbc05; } .gw-logo path:nth-child(4) { fill: #ea4335; }
.gw-cell .chip { margin: 1px 2px 1px 0; }
.gw-codes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 6px; }
.gw-codes > span { flex: 1 1 100%; }

/* ---------------------------------------------------------------- Employees + Inventory */
.inv-ic { display: inline-block; width: 22px; height: 22px; flex: none; background: currentColor; color: var(--accent); vertical-align: -6px;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.inv-ic.sm { width: 17px; height: 17px; vertical-align: -3px; margin-right: 5px; }
.k-laptop { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%225%22%20width%3D%2216%22%20height%3D%2210%22%20rx%3D%221.5%22/%3E%3Cpath%20d%3D%22M2%2018.5h20%22/%3E%3C/svg%3E"); }
.k-desktop { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2212%22%20rx%3D%221.5%22/%3E%3Cpath%20d%3D%22M9%2020h6M12%2016v4%22/%3E%3C/svg%3E"); }
.k-monitor { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2212%22%20rx%3D%221.5%22/%3E%3Cpath%20d%3D%22M8%2020h8%22/%3E%3C/svg%3E"); }
.k-phone { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%227%22%20y%3D%222.5%22%20width%3D%2210%22%20height%3D%2219%22%20rx%3D%222.2%22/%3E%3Cpath%20d%3D%22M11%2018.5h2%22/%3E%3C/svg%3E"); }
.k-headset { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2014v-2a8%208%200%200%201%2016%200v2%22/%3E%3Crect%20x%3D%223%22%20y%3D%2213%22%20width%3D%224%22%20height%3D%226%22%20rx%3D%221.5%22/%3E%3Crect%20x%3D%2217%22%20y%3D%2213%22%20width%3D%224%22%20height%3D%226%22%20rx%3D%221.5%22/%3E%3Cpath%20d%3D%22M19%2019c0%201.5-2%202.5-5%202.5%22/%3E%3C/svg%3E"); }
.k-mouse { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%226.5%22%20y%3D%223%22%20width%3D%2211%22%20height%3D%2218%22%20rx%3D%225.5%22/%3E%3Cpath%20d%3D%22M12%203v6%22/%3E%3C/svg%3E"); }
.k-keyboard { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%222.5%22%20y%3D%226.5%22%20width%3D%2219%22%20height%3D%2211%22%20rx%3D%221.8%22/%3E%3Cpath%20d%3D%22M6%2010h.01M9%2010h.01M12%2010h.01M15%2010h.01M18%2010h.01M7%2014h10%22/%3E%3C/svg%3E"); }
.k-other { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203%2020.5%207.5v9L12%2021%203.5%2016.5v-9z%22/%3E%3Cpath%20d%3D%22M3.5%207.5%2012%2012l8.5-4.5M12%2012v9%22/%3E%3C/svg%3E"); }

.inv-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.inv-kind { appearance: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 0 10px;
  align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.inv-kind:hover, .inv-kind.on { border-color: var(--accent); }
.inv-kind .inv-ic { grid-row: span 3; width: 30px; height: 30px; }
.inv-kind b { font-family: var(--font-display); font-size: 22px; line-height: 1.1; }
.inv-kind span:not(.inv-ic) { font-size: 13px; font-weight: 600; }
.inv-kind small { font-size: 11.5px; color: var(--g); } .inv-kind small.zero { color: var(--r); }
.chip.ds-in_stock { color: var(--g); background: var(--g-bg); } .chip.ds-in_use { color: var(--b); background: var(--b-bg); }
.chip.ds-broken { color: var(--r); background: var(--r-bg); } .chip.ds-repair { color: var(--y); background: var(--y-bg); }
.chip.ds-retired { color: var(--n); background: var(--n-bg); }
.emp-table .emp-title { display: block; } .emp-left td { opacity: .62; }
.emp-panel { display: flex; flex-direction: column; gap: 14px; }
.emp-sum { display: flex; align-items: center; gap: 12px; }
.emp-sum > div { display: flex; flex-direction: column; }
.emp-av { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font: 600 20px var(--font-display); color: #fff;
  background: linear-gradient(135deg, #0b7593, #39c0e0); flex: none; }
.emp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.emp-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.emp-box h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px; }
.emp-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 0; color: var(--ink); }
.emp-give { display: flex; gap: 8px; margin-top: 8px; } .emp-give select { flex: 1; min-width: 0; }
.emp-dev { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.emp-dev .mono { grid-column: 2; } .emp-dev .emp-ret { grid-column: 3; grid-row: 1 / span 2; display: flex; gap: 6px; }
.emp-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.emp-hist li { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; }
.emp-edit summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.emp-edit .form { margin: 10px 0; }
.emp-foot { display: flex; justify-content: flex-end; padding-top: 6px; border-top: 1px solid var(--line); }
.onb { display: flex; flex-direction: column; gap: 12px; }
.onb-step { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; }
.onb-step h3 { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 0 0 10px; }
.onb-step h3 > span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--accent); color: var(--accent-ink); }
.onb-step h3 .check { font-weight: 700; }
.onb-devs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.onb-dev { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.onb-dev:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.onb-dev small { display: block; }
.dev-dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; } .dev-dl dt { color: var(--muted); }
.dev-h { font-size: 13px; margin: 18px 0 8px; }
@media (max-width: 700px) {
  .emp-grid { grid-template-columns: 1fr; }
  .emp-hist li { grid-template-columns: 1fr; gap: 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .emp-dev { grid-template-columns: auto 1fr; } .emp-dev .emp-ret { grid-column: 1 / -1; grid-row: auto; }
  .inv-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.onb .em-row input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent;
  flex: 1 1 50%; min-width: 0; width: auto; }
.onb label.check.field { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; }
.emp-dev .link { text-align: left; justify-self: start; }

/* personal background behind the whole dashboard, softly dimmed */
body.has-bg { background-image: linear-gradient(color-mix(in srgb, var(--bg) 78%, transparent), color-mix(in srgb, var(--bg) 84%, transparent)), var(--user-bg);
  background-size: cover; background-position: center; background-attachment: fixed; }
body.has-bg .bg-deco { display: none; }
/* sign-in page popup */
.lg-why-ov { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(3, 14, 21, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: ldFade .2s ease-out both; }
.lg-why { width: min(420px, 100%); background: var(--surface); color: var(--ink); border-radius: 20px; padding: 26px 26px 22px; text-align: center;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5); border: 1px solid var(--line); }
.lg-why h2 { margin: 10px 0 6px; font-size: 21px; } .lg-why p { color: var(--muted); margin: 0 0 18px; line-height: 1.5; }
.lg-why-ic { display: inline-grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: var(--y-bg); color: var(--y); }
.lg-why-elsewhere .lg-why-ic { background: var(--b-bg); color: var(--b); } .lg-why-bye .lg-why-ic { background: var(--g-bg); color: var(--g); }
.lg-why-ic svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lg-why .lg-submit { width: 100%; justify-content: center; }
.lg-why-alt { margin-top: 12px; padding: 6px 10px; background: none; border: 0; border-radius: 8px; color: var(--muted); font: inherit;
  font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.lg-why-alt:hover, .lg-why-alt:focus-visible { color: var(--ink); }
/* 2-step setup */
.tf-steps { margin: 10px 0; padding-left: 20px; line-height: 1.55; font-size: 14px; }
.tf-qr { display: grid; place-items: center; padding: 10px; margin: 6px auto; width: 220px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.tf-qr img { display: block; width: 200px; height: 200px; }
.tf-manual { margin: 8px 0; font-size: 13px; } .tf-manual code { display: block; margin-top: 6px; font-size: 15px; letter-spacing: .08em; word-break: break-all; }
.tf-code { font-family: var(--mono); font-size: 20px; letter-spacing: .3em; }
.pf-2fa { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--g-bg); color: var(--g); font-size: 13.5px; }
.pf-2fa.off { background: var(--y-bg); color: var(--y); }
.pf-bg { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pf-bg-prev { width: 120px; height: 68px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2) center / cover no-repeat; }
.tf-card { max-width: 520px; margin: 0 auto; } .tf-card .tf-qr { margin: 10px 0 14px; }

/* Yeastar logo (white artwork, drawn in the current text colour so it also shows on light backgrounds) */
.ys-logo { display: inline-block; width: 18px; height: 18px; flex: none; background: currentColor;
  -webkit-mask: url("/static/yeastar-white.svg?v=2") center / contain no-repeat; mask: url("/static/yeastar-white.svg?v=2") center / contain no-repeat; }
.hdr-nav a .ys-logo { width: 18px; height: 18px; }
.secnav .ys-logo { width: 16px; height: 16px; }
.tile2 .ys-logo { width: 26px; height: 26px; }
@media (max-width: 1240px) and (min-width: 901px) { .hdr-nav a .ys-logo { display: none; } }

.lg-forgot { margin: -4px 0 8px; text-align: right; font-size: 13px; }
.tf-alt { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.tf-alt form { display: block; } .tf-alt .btn { width: 100%; justify-content: flex-start; }
.tf-alt .btn small { margin-left: auto; }
.fg-via { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; font-size: 14px; }

/* ---------------------------------------------------------------- Lead Sources */
body { --ls-new: #2a78d6; --ls-int: #1baf7a; --ls-done: #eb6834; }      /* validated: blue / aqua / orange */
:root[data-theme="dark"] body { --ls-new: #3987e5; --ls-int: #199e70; --ls-done: #d95926; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body { --ls-new: #3987e5; --ls-int: #199e70; --ls-done: #d95926; } }
.ls-pick { position: relative; }
.ls-pick summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.ls-pick summary::-webkit-details-marker { display: none; }
.ls-pick summary b { display: block; min-width: 170px; max-width: 240px; padding: 8px 30px 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.ls-pick summary b::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); }
.ls-pick-box { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 300px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(6, 27, 39, .5); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ls-pick-list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.ls-pick-list label[hidden] { display: none; }
.ls-pick-foot { display: flex; justify-content: space-between; align-items: center; }
.ls-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.ls-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.ls-kpi span { font-size: 12px; font-weight: 600; color: var(--muted); }
.ls-kpi b { font-family: var(--font-display); font-size: 28px; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.ls-kpi small { font-size: 12px; color: var(--muted); }
.ls-kpi.hero { box-shadow: inset 0 3px 0 var(--ls-done), var(--shadow); }
.ls-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; }
.ls-card .card-head { margin-bottom: 14px; }
.ls-days { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-bottom: 20px; position: relative; border-bottom: 1px solid var(--line); }
.ls-day { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.ls-day i { display: block; background: var(--ls-done); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; transition: opacity .15s; }
.ls-day i.z { background: var(--line); opacity: 1; }
.ls-day:hover i { opacity: 1; }
.ls-day span { position: absolute; bottom: -19px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ls-avg { margin: 22px 0 0; }
.ls-bar { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 96px; gap: 12px; align-items: center; padding: 6px 0; font-size: 13px; }
.ls-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-track { display: flex; flex-direction: column; gap: 2px; }
.ls-track i { display: block; height: 5px; border-radius: 0 4px 4px 0; min-width: 2px; }
.ls-track i.k-new { background: var(--ls-new); } .ls-track i.k-int { background: var(--ls-int); }
.ls-nums { display: flex; gap: 8px; justify-content: flex-end; font-variant-numeric: tabular-nums; align-items: baseline; }
.ls-nums small { color: var(--muted); } .ls-nums em { font-style: normal; font-weight: 700; color: var(--ink); }
.ls-nums em::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ls-done); margin-right: 4px; vertical-align: 1px; }
.ls-legend { display: inline-flex; align-items: center; gap: 6px; }
.ls-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.ls-legend .k-new { background: var(--ls-new); } .ls-legend .k-int { background: var(--ls-int); } .ls-legend .k-done { background: var(--ls-done); }
.ls-done { color: var(--ink); }
/* All sources: the stage columns counted by when a lead moved there, under one heading */
.ls-table .ls-grp th { padding-top: 4px; padding-bottom: 2px; border-bottom: 0; }
table.data.ls-table thead tr:last-child th.r { white-space: normal; line-height: 1.25; vertical-align: bottom; }   /* ten columns fit */
.ls-table .ls-grp .ls-grp-on { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0;
  border-bottom: 2px solid color-mix(in srgb, var(--ls-done) 55%, transparent); }
.ls-done::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ls-done); margin-right: 5px; vertical-align: 1px; }
@media (max-width: 1100px) { .ls-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .ls-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ls-bar { grid-template-columns: minmax(0, 1fr) 90px; }
  .ls-bar .ls-track { grid-column: 1 / -1; grid-row: 2; } .ls-pick summary b { min-width: 0; max-width: none; } .ls-pick-box { width: min(300px, 90vw); } }

/* Task count: plain numbers, a small dot says what kind; click = the leads behind it */
.nz { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.nv { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.nv.k-na::before, .nv.k-td::before, .nv.k-od::before, .nv.k-dn::before { content: ""; display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.nv.k-na::before { background: #eda100; } .nv.k-td::before { background: #2a78d6; } .nv.k-od::before { background: #e34948; }
.nv.k-dn::before { background: #1baf7a; }
button.why-btn { appearance: none; border: 0; background: none; padding: 2px 6px; margin: -2px -6px; border-radius: 6px; cursor: pointer; font: inherit;
  font-weight: 600; color: var(--ink); text-decoration: underline dotted color-mix(in srgb, var(--muted) 60%, transparent); text-underline-offset: 3px; }
button.why-btn:hover { background: var(--accent-soft); text-decoration-color: var(--accent); }
table.ax tbody tr td { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.why-lead { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.why-lead summary { cursor: pointer; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; list-style: none; }
.why-lead summary::-webkit-details-marker { display: none; }
.why-t { display: flex; flex-direction: column; min-width: 0; } .why-t a { font-weight: 600; }
.why-f { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.wf { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.wf.od { color: var(--r); } .wf.td { color: var(--b); } .wf.na { color: var(--y); } .wf.dn { color: var(--g); }
.why-work { list-style: none; margin: 0; padding: 0 12px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.why-work li { display: grid; grid-template-columns: 110px 1fr auto; gap: 2px 10px; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); }
.why-work li.other { opacity: .6; } .why-work .wa { grid-column: 2 / -1; color: var(--muted); font-size: 12px; } .why-work .wk { color: var(--muted); }
.why-work .ww { font-weight: 600; white-space: nowrap; }

.em-alt { margin-top: 3px; font-family: var(--font); }
.em-alt summary { cursor: pointer; font-size: 11.5px; color: var(--muted); list-style: none; display: inline-flex; gap: 5px; align-items: center; }
.em-alt summary::-webkit-details-marker { display: none; }
.em-alt summary::before { content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.em-alt[open] summary::before { transform: rotate(45deg); }
.em-alt b { font-weight: 600; } .em-alt ul { margin: 4px 0 0; padding: 0 0 0 12px; font-family: var(--mono); font-size: 12px; list-style: none; }
.em-alt li { padding: 2px 0; }

/* ---------- Emails: view switch, cards, split view, account panel ---------- */
.vw-switch { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.vw-switch button { appearance: none; border: 0; background: none; color: var(--muted); font: 500 12.5px var(--font); display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 8px; cursor: pointer; }
.vw-switch button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vw-switch button:hover { color: var(--ink); }
.vw-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.card[data-vw="grid"] .table-wrap, .card[data-vw="split"] .table-wrap { display: none; }

.acc-av { flex: 0 0 auto; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font: 600 14px var(--font-display);
  letter-spacing: .02em; color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.acc-av.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.acc-av.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 19px; }
.acc-tx { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.acc-tx b { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-tx .mono { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ext-pill.sm { padding: 1px 8px; font-size: 11.5px; }
.ext-pill.sm svg { width: 12px; height: 12px; }

.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.acc-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); transition: border-color .15s, transform .15s, box-shadow .15s; }
.acc-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.acc-open { appearance: none; border: 0; background: none; color: inherit; font: inherit; width: 100%; padding: 14px 14px 12px; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; }
.acc-open .acc-meta, .acc-open .acc-chips { grid-column: 1 / -1; }
.acc-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 20px; }
.acc-card-qa { display: flex; gap: 6px; padding: 0 14px 12px; }
.acc-card-qa .ib { width: 28px; height: 28px; }
@media (hover: hover) { .acc-card-qa { opacity: .55; transition: opacity .15s; } .acc-card:hover .acc-card-qa, .acc-card:focus-within .acc-card-qa { opacity: 1; } }

.acc-split { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 14px; min-height: 520px; }
.acc-list { display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 230px); overflow-y: auto; padding-right: 4px; overscroll-behavior: contain; }
.acc-li { appearance: none; border: 1px solid transparent; background: none; color: inherit; font: inherit; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 11px; cursor: pointer; text-align: left; }
.acc-li .acc-tx { flex: 1; }
.acc-li:hover { background: var(--surface-2); }
.acc-li.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.acc-li-end { display: flex; align-items: center; gap: 8px; }
.acc-li .dot { width: 8px; height: 8px; border-radius: 50%; margin: 0; border: 0; }
.acc-li .dot.g { background: var(--g); } .acc-li .dot.y { background: var(--y); } .acc-li .dot.r { background: var(--r); }
.acc-pane { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: calc(100vh - 230px); overflow-y: auto; position: sticky; top: 80px;
  transition: opacity .15s; }
.acc-pane.busy { opacity: .55; }
.acc-pane .sheet-x { display: none; }
.acc-pane .sheet-head { border-radius: var(--radius) var(--radius) 0 0; }
.acc-pick { height: 100%; min-height: 420px; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); }
.acc-pick svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .5; }
@media (max-width: 900px) { .acc-split { grid-template-columns: 1fr; min-height: 0; } .acc-pane { display: none; } .acc-list { max-height: none; } }
@media (max-width: 560px) { .acc-grid { grid-template-columns: 1fr; } .vw-switch button { padding: 6px 8px; } .vw-switch button svg + * { display: none; } }

.acc-head .btn { padding: 6px 12px; }
.acc { gap: 16px; }
.acc-hero { display: flex; gap: 14px; align-items: center; }
.acc-hero-tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.acc-name { font: 600 17px var(--font-display); }
.acc-mail { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); word-break: break-all; }
.acc-cp { width: 26px; height: 26px; }
.acc-qa { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-qa .qa { appearance: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: 500 13px var(--font); cursor: pointer; }
.acc-qa .qa svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.acc-qa .qa:hover { border-color: var(--accent); color: var(--accent); }
.acc-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); }
.acc-sec h3 { margin: 0 0 8px; font: 600 11.5px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.acc-dl { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; margin: 0; align-items: center; }
.acc-dl dt { color: var(--muted); font-size: 13px; }
.acc-dl dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.acc-alias { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.acc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.alias-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.alias-add input { flex: 1 1 180px; min-width: 0; }
.acc-notes { margin: 0; white-space: pre-wrap; font-size: 13.5px; }
.acc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 14px; }
@media (max-width: 520px) { .acc-dl { grid-template-columns: 1fr; gap: 3px 0; } .acc-dl dd { margin-bottom: 8px; } }
.card[data-vw="grid"] .cols-btn, .card[data-vw="split"] .cols-btn, .card[data-vw="grid"] [data-filter-clear], .card[data-vw="split"] .qchip.warn { display: none; }
.mono, code { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.emp-link { color: var(--ink); text-align: left; border-bottom: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); } .emp-link:hover { color: var(--accent); }

/* ---------- floating search (top-right corner, grows when the mouse comes near) ---------- */
.fsearch { position: fixed; z-index: 28; top: 92px; right: 22px; height: 48px; width: 48px; padding: 0 15px 0 0; border-radius: 999px;
  display: flex; flex-direction: row-reverse; align-items: center; gap: 10px; overflow: hidden; cursor: pointer; white-space: nowrap;
  border: 0; background: var(--accent); color: var(--accent-ink); font: 500 13.5px var(--font);
  box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--accent) 80%, #000), 0 2px 6px -2px rgba(0, 0, 0, .25);
  transition: width .28s cubic-bezier(.2, .8, .2, 1), background .2s, box-shadow .2s, transform .2s; }
.fsearch svg { width: 18px; height: 18px; flex: 0 0 18px; }
.fsearch span, .fsearch kbd { opacity: 0; transition: opacity .15s; }
.fsearch kbd { margin-right: auto; margin-left: 12px; font: 600 10.5px var(--font); padding: 3px 7px; border-radius: 6px;
  background: color-mix(in srgb, var(--accent-ink) 14%, transparent); color: inherit; border: 0; }
.fsearch.near, .fsearch:hover, .fsearch:focus-visible { width: 300px; }
.fsearch.near span, .fsearch.near kbd, .fsearch:hover span, .fsearch:hover kbd, .fsearch:focus-visible span, .fsearch:focus-visible kbd { opacity: 1; transition-delay: .08s; }
.fsearch:hover { box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--accent) 90%, #000), 0 2px 6px -2px rgba(0, 0, 0, .3); }
.fsearch:active { transform: scale(.97); }
body.sheet-open .fsearch { opacity: 0; pointer-events: none; }
@media (max-width: 900px) {        /* phones: a round button at the bottom right */
  .fsearch { top: auto; bottom: calc(18px + env(safe-area-inset-bottom)); right: 16px; width: 52px; height: 52px; padding: 0 17px 0 0; }
  .fsearch.near, .fsearch:hover { width: 52px; } .fsearch span, .fsearch kbd { display: none; }
}
@media print { .fsearch { display: none; } }

/* the profile button takes the space the search used */
.hdr-user { min-width: 190px; padding: 4px 16px 4px 4px; gap: 11px; }
.hdr-user .hdr-av { width: 36px; height: 36px; }
.hdr-who b { font-size: 13.5px; }
@media (max-width: 1240px) { .hdr-who { display: flex; } .hdr-user { padding: 4px 14px 4px 4px; } }
@media (max-width: 1100px) { .hdr-who { display: none; } .hdr-user { min-width: 0; padding: 3px; } }

/* ---------- campaign lists: queue -> day ---------- */
.cql-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.cql-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cql-seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.cql-seg button { appearance: none; border: 0; background: none; color: var(--muted); font: 500 12.5px var(--font); padding: 6px 11px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.cql-seg button:hover { color: var(--ink); }
.cql-seg button.on { background: var(--accent); color: var(--accent-ink); }
.cql-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cql-date input { padding: 6px 8px; }
.cql-s { flex: 1 1 220px; min-width: 180px; }
.cql-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cql-chips .qchip { cursor: pointer; user-select: none; }
.cql-chips .qchip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.cql-sum { margin-left: auto; }
.cql-older { margin: -4px 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--y-bg); color: var(--y); font-size: 13px; }
.cql-groups { display: flex; flex-direction: column; gap: 10px; }
.cqg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.cqg > summary, .cqd > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cqg > summary::-webkit-details-marker, .cqd > summary::-webkit-details-marker { display: none; }
.cqg > summary::before, .cqd > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s; flex: 0 0 auto; margin-right: 2px; }
.cqg[open] > summary::before, .cqd[open] > summary::before { transform: rotate(45deg); }
.cqg-head { padding: 12px 16px; }
.cqg-head:hover, .cqd-head:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cqg-q { font: 600 16px var(--font-display); color: var(--accent); }
.cqg-name { font-weight: 600; }
.cqg-tot { display: inline-flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); margin-left: auto; }
.cqg-tot b { color: var(--ink); font-weight: 600; }
.cqg-tot .tw { color: var(--b); } .cqg-tot .tc { color: var(--p); } .cqg-tot .ta { color: var(--g); } .cqg-tot .tn { color: var(--r); }
.cqg-tot .trate { padding: 1px 8px; border-radius: 999px; background: var(--g-bg); color: var(--g); font-weight: 600; }
.cqg-tot .ev-n { text-transform: capitalize; }
.cqg-n { min-width: 42px; text-align: center; padding: 2px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font: 600 12px var(--font); font-variant-numeric: tabular-nums; }
.cqg-days { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 10px; }
.cqd { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cqd-head { padding: 9px 12px; }
.cqd-day { font-weight: 600; font-size: 13.5px; }
.cqd-rm { padding: 2px 14px 6px; }
.cqd-body { padding: 0 10px 10px; overflow-x: auto; }
.cqd-load { display: flex; align-items: center; gap: 8px; padding: 14px 6px; color: var(--muted); font-size: 13px; }
.cqb-table { width: 100%; }
.cqb-more { padding: 8px 4px 0; }
.chip.ls-retry { background: var(--o-bg); color: var(--o); } .chip.ls-removed { background: var(--n-bg); color: var(--n); }
@media (max-width: 700px) { .cqg-tot { margin-left: 0; width: 100%; } .cql-sum { margin-left: 0; width: 100%; } .cql-seg { overflow-x: auto; max-width: 100%; } }
.cql-chip { --c: var(--accent); display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 6px 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: 500 12.5px/1 var(--font); cursor: pointer; user-select: none;
  transition: border-color .15s, background .15s; }
.cql-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: 0 0 8px; }
.cql-chip b { min-width: 22px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--surface);
  color: var(--muted); font: 600 11.5px/1 var(--font); font-variant-numeric: tabular-nums; }
.cql-chip:hover { border-color: var(--c); }
.cql-chip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--surface-2)); }
.cql-chip.on b { background: var(--c); color: #fff; }
.cql-chip.st-waiting { --c: var(--b); } .cql-chip.st-retrying { --c: var(--o); } .cql-chip.st-calling { --c: var(--p); }
.cql-chip.st-answered { --c: var(--g); } .cql-chip.st-no_answer { --c: var(--r); } .cql-chip.st-removed { --c: var(--n); }
.cql-chip.st-received { --c: var(--b); } .cql-chip.st-dialed { --c: var(--p); } .cql-chip.st-retry { --c: var(--o); } .cql-chip.st-other { --c: var(--n); }
/* lists polish: totals as labelled pills, theme-aware status chips, toolbar */
.cqg-tot { gap: 6px; }
.cqg-tot .tt { margin-right: 4px; }
.cqg-tot .tp { --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cqg-tot .tp i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cqg-tot .tw { --c: var(--b); } .cqg-tot .tc { --c: var(--p); } .cqg-tot .ta { --c: var(--g); } .cqg-tot .tn { --c: var(--r); } .cqg-tot .tr { --c: var(--n); }
.cqg-tot .ev-received { --c: var(--b); } .cqg-tot .ev-dialed { --c: var(--p); } .cqg-tot .ev-retry { --c: var(--o); }
.cqg-tot .ev-answered { --c: var(--g); } .cqg-tot .ev-no_answer { --c: var(--r); } .cqg-tot .ev-removed { --c: var(--n); }
.cqg-tot .tp.ev-received, .cqg-tot .tp[class*="ev-"] { text-transform: none; }
.cqg-tot .trate { height: 24px; display: inline-flex; align-items: center; padding: 0 10px; font-size: 12px; }
.cqg-n { color: var(--muted); }
.cqd-rm { display: flex; justify-content: flex-end; padding: 0 12px 8px; }
.cqd-rm-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--r); border-color: color-mix(in srgb, var(--r) 40%, var(--line)); background: transparent; }
.cqd-rm-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cqd-rm-btn:hover { background: var(--r-bg); border-color: var(--r); }
.cql-older { display: flex; align-items: center; gap: 6px; }
.cql-chips .cql-sum { display: inline-flex; align-items: center; gap: 4px; }
.cql .chip.ls-pending { background: var(--b-bg); color: var(--b); } .cql .chip.ls-calling { background: var(--p-bg); color: var(--p); }
.cql .chip.ls-answered { background: var(--g-bg); color: var(--g); } .cql .chip.ls-no_answer { background: var(--r-bg); color: var(--r); }
.cql .chip.ls-retry { background: var(--o-bg); color: var(--o); } .cql .chip.ls-removed { background: var(--n-bg); color: var(--n); }
.cql .chip.ev-answered { background: var(--g-bg); color: var(--g); } .cql .chip.ev-no_answer { background: var(--r-bg); color: var(--r); }
.cql .chip.ev-dialed { background: var(--p-bg); color: var(--p); } .cql .chip.ev-retry { background: var(--o-bg); color: var(--o); }
.cql .chip.ev-received { background: var(--b-bg); color: var(--b); } .cql .chip.ev-removed { background: var(--n-bg); color: var(--n); }
.cql-row .cql-s { flex: 1 1 200px; }
.cql-notes { padding-top: 2px; }
.cql-lab { font: 600 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.cql-chip.st-anynote { --c: var(--accent); } .cql-chip.st-note { --c: var(--b); } .cql-chip.st-nonote { --c: var(--y); }
.cqb-note { min-width: 160px; }
.cqb-note .chip.nc { background: var(--b-bg); color: var(--b); margin: 0 4px 3px 0; }
.cql-num { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 12.5px; color: var(--muted); }
.cql-num input { width: 70px; border: 0; background: transparent; padding: 0; height: 28px; text-align: right; color: var(--ink); font: 500 13px var(--font); box-shadow: none; }
.cql-num input:focus { outline: none; }
.cql-num:focus-within { border-color: var(--accent); }
.pl-pop { margin-top: 8px; padding: 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: var(--shadow); animation: plIn .18s ease-out; }
@keyframes plIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pl-head { display: flex; gap: 10px; align-items: center; }
.pl-head small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.pl-av { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font: 600 13px var(--font-display); color: var(--accent); background: var(--accent-soft); flex: 0 0 36px; }
.pl-warn { margin: 8px 0 0; color: var(--y); font-size: 12.5px; }
.pl-ok { margin: 0; color: var(--g); font-size: 13px; }
.pl-btns { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.acc-av.ext { font: 600 12.5px var(--font); letter-spacing: 0; width: 48px; }
.acc-av.sm.ext { width: 42px; font-size: 11.5px; }
.acc-av.lg.ext { width: 72px; font-size: 18px; }
.acc-li .dot.n { background: var(--n); }

/* ---------- Manage queue pop-up ---------- */
.sheet-wrap.modal .sheet:has(.cqp-tabs) { width: min(680px, 100%); }
.cqp-head { gap: 12px; }
.cqp-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.cqp-q { font: 600 24px var(--font-display); color: var(--accent); }
.cqp-name { font: 500 18px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cqp-play { height: 36px; }
.cqp-play svg { fill: currentColor; stroke: none; }
.cqp-play.stop svg { fill: none; stroke: currentColor; stroke-width: 2.4; }
.cqp-play.go { background: var(--g); border-color: var(--g); color: #fff; }
.cqp-play.stop { color: var(--y); border-color: color-mix(in srgb, var(--y) 50%, var(--line)); }
.cqp-live { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 12px 22px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.cqp-state { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font: 700 11px var(--font); letter-spacing: .06em;
  background: var(--n-bg); color: var(--n); }
.cqp-state i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cqp-state.h-ok { background: var(--g-bg); color: var(--g); } .cqp-state.h-ok i { animation: cqDot 1.6s ease-in-out infinite; }
.cqp-state.h-warn { background: var(--y-bg); color: var(--y); } .cqp-state.h-bad { background: var(--r-bg); color: var(--r); }
.cqp-state.h-off { background: var(--p-bg); color: var(--p); }
@keyframes cqDot { 50% { opacity: .35; } }
.cqp-stat { display: inline-flex; align-items: baseline; gap: 5px; }
.cqp-stat b { font: 600 17px var(--font-display); font-variant-numeric: tabular-nums; }
.cqp-stat small { color: var(--muted); font-size: 12px; }
.cqp-err { margin: 0; padding: 8px 22px; background: var(--r-bg); color: var(--r); font-size: 12.5px; }
.cqp-tabs { display: flex; gap: 4px; padding: 10px 18px 0; border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: 73px; z-index: 1; background: var(--surface); }
.cqp-tabs button { appearance: none; border: 0; background: none; color: var(--muted); font: 500 13.5px var(--font); display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 12px 12px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.cqp-tabs button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cqp-tabs button:hover { color: var(--ink); }
.cqp-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.cqp-form { gap: 0; padding-top: 6px; }
.cqp-pane { display: flex; flex-direction: column; gap: 16px; padding: 14px 0 4px; }
.cqp-pane[hidden] { display: none; }
.cqp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cqp-block { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.cqp-lbl { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 13.5px; }
.cqp-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.cqp-presets .chip-btn { padding: 4px 10px; font-size: 12px; }
.cqp-days span { padding: 11px 0; font-weight: 600; }
.cqp-dur { font: 600 13px var(--font); color: var(--accent); }
.cqp-hours { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.cqp-time { display: flex; flex-direction: column; gap: 4px; }
.cqp-time small { color: var(--muted); font-size: 11.5px; }
.cqp-time input { width: 128px; font: 600 15px var(--font); }
.cqp-track { position: relative; height: 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.cqp-track i { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--g))); }
.cqp-track i.bad { background: var(--r); }
.cqp-track em { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .7; }
.cqp-ticks { display: flex; justify-content: space-between; margin-top: 5px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cqp-hint { margin: 0; }
.cqp-step { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.cqp-step-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cqp-step-t b { font-size: 14px; } .cqp-step-t small { color: var(--muted); font-size: 12px; }
.cqp-step-c { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.cqp-step-c input { width: 74px; text-align: center; font: 600 16px var(--font); padding: 6px 4px; -moz-appearance: textfield; }
.cqp-step-c input::-webkit-outer-spin-button, .cqp-step-c input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cqp-pm { appearance: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 18px var(--font); cursor: pointer; }
.cqp-pm:hover { border-color: var(--accent); color: var(--accent); }
.cqp-unit { min-width: 92px; color: var(--muted); font-size: 12px; }
.cqp-sentence { margin: 2px 0 0; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); font-size: 13.5px; line-height: 1.5; }
.cqp-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 0 16px; margin-top: 10px;
  background: linear-gradient(transparent, var(--surface) 30%); }
.cqp-foot[hidden] { display: none; }
.cqp-foot [data-cqp-dirty] { margin-right: auto; color: var(--y); }
.cqp-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.cq-pbx { border-top: 0; }
.cqp-danger { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.cqp-danger > div { display: flex; flex-direction: column; gap: 3px; flex: 1 1 260px; }
.cqp-danger small { color: var(--muted); font-size: 12.5px; }
.cqp-danger.red { border-color: color-mix(in srgb, var(--r) 40%, var(--line)); }
.cqp-danger form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .cqp-grid2 { grid-template-columns: 1fr; }
  .cqp-hours { grid-template-columns: 1fr 1fr; } .cqp-bar { grid-column: 1 / -1; order: 3; }
  .cqp-time input { width: 100%; }
  .cqp-step { flex-direction: column; align-items: stretch; } .cqp-unit { min-width: 0; }
  .cqp-tabs { top: 64px; }
}
.cqp-pane.sheet-body { padding: 16px 22px 20px; } .sheet-body.cq-pbx { padding-top: 16px; }
/* queue card footer: schedule on one line, delay as a small pill */
.cq-foot span:first-child { min-width: 0; flex-wrap: nowrap; white-space: nowrap; }
.cq-foot em { font-style: normal; }
.cq-foot .cq-when { overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.cq-foot .cq-hrs { color: #c9d8e6; font-weight: 600; font-variant-numeric: tabular-nums; }
.cq-foot .cq-when + .cq-hrs::before { content: "·"; margin: 0 6px 0 2px; color: #5d7187; font-weight: 400; }
.cq-gap { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(176, 124, 240, .14);
  color: #c9a6f5; font-weight: 600; white-space: nowrap; }
.cq-gap svg { width: 12px !important; height: 12px !important; }
.cq-foot .cq-edit { margin-left: auto; }
option.opt-dept { font-weight: 700; }

/* ---------- generic views for any list (data-views) ---------- */
.gv-hide { display: none !important; }
.gv-split .acc-list .acc-li .acc-tx b { font-size: 13.5px; }
.gv-group { padding: 10px 10px 4px; font: 600 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.gv-detail { padding: 18px 20px; }
table.rtable.vw-cards, table.rtable.vw-cards > tfoot { display: block; width: 100%; }
table.rtable.vw-cards > tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
table.rtable.vw-cards > thead { display: none; }
table.rtable.vw-cards > tbody > tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface-2); align-content: start; transition: border-color .15s, transform .15s; }
table.rtable.vw-cards > tbody > tr:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-1px); }
table.rtable.vw-cards > tbody > tr[hidden] { display: none; }
table.rtable.vw-cards > tbody > tr > td { display: flex; flex-direction: column; padding: 3px 0; border: 0 !important; background: none !important;
  text-align: left !important; min-width: 0; align-items: flex-start; white-space: normal !important; overflow-wrap: anywhere; }
table.rtable.vw-cards > tbody > tr > td::before { content: attr(data-label); font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); }
table.rtable.vw-cards > tbody > tr > td:first-child { grid-column: 1 / -1; font-size: 15px; padding-bottom: 6px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line) !important; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; }
table.rtable.vw-cards > tbody > tr > td:first-child::before, table.rtable.vw-cards > tbody > tr > td[data-label=""]::before { display: none; }
table.rtable.vw-cards > tbody > tr > td:empty { display: none; }
table.rtable.vw-cards > tbody > tr > td[data-label=""], table.rtable.vw-cards > tbody > tr > td.row-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
table.rtable.vw-cards > tbody > tr.group-row { grid-column: 1 / -1; display: block; padding: 0; border: 0; background: none; margin: 8px 0 0; transform: none; }
table.rtable.vw-cards > tbody > tr.group-row > td { display: block; padding: 6px 2px !important; border-bottom: 2px solid var(--line) !important; }
table.rtable.vw-cards > tbody > tr.group-row > td::before { display: none; }
.table-wrap:has(> table.vw-cards) { overflow: visible; }
.bx-sync-btn svg { transition: transform .3s; }
.bx-sync-btn.spin svg { animation: bxSpin 1s linear infinite; }
@keyframes bxSpin { to { transform: rotate(360deg); } }
.bx-sync-line { display: flex; align-items: center; gap: 8px; margin: -4px 0 10px; }
.bx-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fc6f6; box-shadow: 0 0 0 3px rgba(47, 198, 246, .18); }

/* ---------- queue cards: fold ---------- */
.cq-head { position: relative; }
.cq-head .cq-pause { margin-left: auto; }
.cq-fold-btn { appearance: none; align-self: center; margin-left: 2px; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; border: 1px solid #2a4058;
  background: rgba(255, 255, 255, .04); color: #9fb4c8; display: grid; place-items: center; cursor: pointer; transition: transform .2s, color .15s; }
.cq-fold-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cq-fold-btn:hover { color: #fff; border-color: #3a5b7a; }
.cq:not(.folded) .cq-fold-btn { transform: rotate(180deg); }
.cq-mini { display: none; margin: 6px 0 2px; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: #8fa3b8; }
.cq-mini b { color: #e6f1f6; font-weight: 600; font-variant-numeric: tabular-nums; }
.cq-mini .on b { color: #c9a6f5; }
.cq-mini .hrs { margin-left: auto; color: #c9d8e6; font-weight: 600; }
.cq.folded .cq-mini { display: flex; }
.cq.folded .cq-body { display: none; }
.cq.folded { min-height: 0; align-self: start; }
.cq-grid { align-items: start; }
/* "Add queue" folds with the cards: when no card is open it is as small as a folded card */
.cq-grid:not(:has(article.cq:not(.folded))) .cq-add,
.cq-grid .cq-add.small { min-height: 0; height: auto; flex-direction: row; gap: 12px; padding: 22px 18px; align-self: stretch; }
.cq-grid:not(:has(article.cq:not(.folded))) .cq-add span { font-size: 26px; }
.cq-grid:not(:has(article.cq:not(.folded))) .cq-add small { display: none; }

/* =====================================================================================================
   Background: aurora glow (drifting teal / cyan / violet light over navy) + fine grain + header streak
   ===================================================================================================== */
:root {
  --au-1: rgba(27, 175, 200, .26); --au-2: rgba(57, 192, 224, .22); --au-3: rgba(140, 100, 226, .12); --au-4: rgba(244, 138, 180, .10);
  --au-streak: rgba(255, 255, 255, .55); --au-grain: .05;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --au-1: rgba(22, 160, 190, .22); --au-2: rgba(57, 192, 224, .13); --au-3: rgba(132, 98, 232, .18); --au-4: rgba(206, 108, 186, .11);
  --au-streak: rgba(120, 210, 240, .07); --au-grain: .06; } }
:root[data-theme="dark"] {
  --au-1: rgba(22, 160, 190, .22); --au-2: rgba(57, 192, 224, .13); --au-3: rgba(132, 98, 232, .18); --au-4: rgba(206, 108, 186, .11);
  --au-streak: rgba(120, 210, 240, .07); --au-grain: .06; }
.bg-aurora { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.bg-aurora i { position: absolute; display: block; border-radius: 50%; filter: blur(70px); will-change: transform; }
.bg-aurora .a1 { width: 62vw; height: 62vw; max-width: 980px; max-height: 980px; left: -18vw; top: -26vw; background: radial-gradient(closest-side, var(--au-1), transparent);
  animation: auA 60s ease-in-out infinite alternate; }
.bg-aurora .a2 { width: 48vw; height: 48vw; max-width: 760px; max-height: 760px; right: -14vw; top: -12vw; background: radial-gradient(closest-side, var(--au-2), transparent);
  animation: auB 75s ease-in-out infinite alternate; }
.bg-aurora .a3 { width: 58vw; height: 40vw; left: 22vw; bottom: -22vw; background: radial-gradient(closest-side, var(--au-3), transparent);
  animation: auC 90s ease-in-out infinite alternate; }
.bg-aurora .a4 { width: 34vw; height: 34vw; right: 6vw; bottom: 8vh; background: radial-gradient(closest-side, var(--au-4), transparent);
  animation: auB 70s ease-in-out infinite alternate-reverse; }
.bg-aurora .streak { left: 10%; right: 10%; top: -60px; height: 150px; border-radius: 50%; filter: blur(40px);
  background: radial-gradient(closest-side, var(--au-streak), transparent); }
.bg-aurora .grain { inset: -50%; border-radius: 0; filter: none; opacity: var(--au-grain); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes auA { to { transform: translate(9vw, 7vh) scale(1.12); } }
@keyframes auB { to { transform: translate(-8vw, 9vh) scale(.92); } }
@keyframes auC { to { transform: translate(-10vw, -6vh) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .bg-aurora i, .bg-deco * { animation: none !important; } }
body.has-bg .bg-aurora { display: none; }

/* decorations, refined: thinner gradient rings, glowing pluses that float slowly */
.bg-deco { z-index: -1; }
.bg-deco .c1 { background: radial-gradient(circle at 35% 35%, var(--deco-fill), transparent 70%); }
.bg-deco .c5 { background: radial-gradient(circle at 35% 35%, var(--deco-pink), transparent 70%); }
.bg-deco .c2, .bg-deco .c6, .bg-deco .c3, .bg-deco .c8 { border-width: 1px; opacity: .8;
  -webkit-mask: linear-gradient(135deg, #000 20%, transparent 85%); mask: linear-gradient(135deg, #000 20%, transparent 85%); }
.bg-deco .c6 { -webkit-mask: linear-gradient(315deg, #000 20%, transparent 85%); mask: linear-gradient(315deg, #000 20%, transparent 85%); }
.bg-deco .c4 { background: radial-gradient(circle, var(--deco-stroke), transparent 70%); }
.bg-deco .c7 { background: radial-gradient(circle at 30% 30%, var(--deco-fill), transparent 75%); border: 1px solid var(--deco-stroke); }
.bg-deco .plus { filter: drop-shadow(0 0 10px rgba(57, 192, 224, .55)); animation: decoFloat 14s ease-in-out infinite; }
.bg-deco .p2 { animation-delay: -3s; } .bg-deco .p3 { animation-delay: -6s; animation-duration: 18s; }
.bg-deco .p4 { animation-delay: -9s; animation-duration: 20s; } .bg-deco .p5 { animation-delay: -2s; } .bg-deco .p6 { animation-delay: -11s; }
@keyframes decoFloat { 50% { transform: translateY(-10px) rotate(8deg); } }

/* =====================================================================================================
   Liquid glass panels with a dark navy tint
   ===================================================================================================== */
:root {
  --glass: rgba(246, 250, 253, .6); --glass-2: rgba(226, 238, 246, .5); --glass-solid: rgba(248, 251, 253, .9);
  --glass-line: rgba(14, 52, 82, .11); --glass-edge: rgba(15, 45, 70, .10);
  --glass-hi: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 38%);
  --glass-shadow: 0 10px 34px -14px rgba(10, 42, 59, .28), 0 1px 0 rgba(255, 255, 255, .7) inset;
  --glass-blur: blur(22px) saturate(165%);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --glass: rgba(21, 36, 53, .72); --glass-2: rgba(27, 44, 62, .58); --glass-solid: rgba(13, 24, 36, .94);
  --glass-line: rgba(180, 212, 240, .13); --glass-edge: rgba(0, 0, 0, .4);
  --glass-hi: linear-gradient(180deg, rgba(210, 235, 255, .085), rgba(210, 235, 255, 0) 40%);
  --glass-shadow: 0 22px 48px -26px rgba(0, 0, 0, .9), 0 1px 0 rgba(210, 238, 255, .11) inset, 0 0 0 1px rgba(170, 205, 235, .03) inset;
  --surface: rgba(21, 36, 53, .74); --surface-2: rgba(28, 45, 63, .62); --line: rgba(180, 212, 240, .13); } }
:root[data-theme="dark"] {
  --glass: rgba(21, 36, 53, .72); --glass-2: rgba(27, 44, 62, .58); --glass-solid: rgba(13, 24, 36, .94);
  --glass-line: rgba(180, 212, 240, .13); --glass-edge: rgba(0, 0, 0, .4);
  --glass-hi: linear-gradient(180deg, rgba(210, 235, 255, .085), rgba(210, 235, 255, 0) 40%);
  --glass-shadow: 0 22px 48px -26px rgba(0, 0, 0, .9), 0 1px 0 rgba(210, 238, 255, .11) inset, 0 0 0 1px rgba(170, 205, 235, .03) inset;
  --surface: rgba(21, 36, 53, .74); --surface-2: rgba(28, 45, 63, .62); --line: rgba(180, 212, 240, .13); }

.card, .tile, .st, .gw-bar, .rp-filter, .rp-kpi, .org-sum > span, .ucard, .acc-pane, .cqg, .emp-box, .acc-sec, .cqp-block, .cqp-step,
.cqp-danger, .acc-card, .sec-card, .alert, .tabs.secnav, .secnav {
  background: var(--glass-hi), var(--glass) !important;
  border: 1px solid var(--glass-line) !important;
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.acc-sec, .cqp-block, .cqp-step, .cqp-danger, .emp-box, .cqd, .acc-card { background: var(--glass-hi), var(--glass-2) !important; box-shadow: none; }
.cqd { border-color: var(--glass-line) !important; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
/* side panel + pop-ups: thicker glass so the page behind only glows through */
.sheet { background: var(--glass-hi), var(--glass-solid) !important; border-color: var(--glass-line) !important;
  -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); }
.sheet-head, .cqp-tabs { background: color-mix(in srgb, var(--glass-solid) 80%, transparent) !important;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-color: var(--glass-line) !important; }
.sheet-back { background: rgba(2, 10, 18, .42); -webkit-backdrop-filter: blur(6px) saturate(120%); backdrop-filter: blur(6px) saturate(120%); }
.srch, .col-menu, .cq-dlg, .pl-pop, .toast, dialog:not(.uic) { background: var(--glass-hi), var(--glass-solid) !important; border: 1px solid var(--glass-line) !important;
  -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%); }
/* header pill, user button, floating search */
.hdr { background: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
.hdr-nav { -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%); }
.hdr-user, .hdr-btn, .theme-toggle { background: var(--glass-hi), var(--glass) !important; border-color: var(--glass-line) !important;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.fsearch { box-shadow: 0 10px 30px -10px rgba(57, 192, 224, .7), 0 1px 0 rgba(255, 255, 255, .35) inset; }
/* inputs sit in the glass */
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  background-color: color-mix(in srgb, var(--glass-solid) 70%, transparent); border-color: var(--glass-line); }
table.data thead th { background: transparent; }
table.data tbody tr:hover > td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
/* the queue cards are already dark glass; give them the liquid edge too */
article.cq, .cq-add { -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 18px 44px -22px rgba(0, 8, 16, .85), 0 1px 0 rgba(170, 225, 255, .1) inset; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .sheet, .acc-pane { background: var(--glass-solid) !important; }
}
@media (max-width: 700px) {        /* phones: lighter blur, same look */
  .card, .tile, .acc-pane, .cqg { -webkit-backdrop-filter: blur(12px) saturate(150%); backdrop-filter: blur(12px) saturate(150%); }
}

/* ---------- centred pop-ups: liquid glass with a navy tint (all tables open here) ---------- */
:root { --pop-glass: rgba(236, 244, 250, .74); --pop-line: rgba(14, 52, 82, .14); --pop-hi: linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 30%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pop-glass: rgba(12, 23, 35, .78); --pop-line: rgba(170, 210, 240, .14);
  --pop-hi: linear-gradient(180deg, rgba(150, 215, 255, .10), rgba(150, 215, 255, 0) 26%); } }
:root[data-theme="dark"] { --pop-glass: rgba(12, 23, 35, .78); --pop-line: rgba(170, 210, 240, .14);
  --pop-hi: linear-gradient(180deg, rgba(150, 215, 255, .10), rgba(150, 215, 255, 0) 26%); }
.sheet-wrap.modal .sheet { background: var(--pop-hi), radial-gradient(120% 50% at 0% 0%, rgba(57, 192, 224, .12), transparent 60%),
    radial-gradient(90% 45% at 100% 100%, rgba(124, 92, 230, .10), transparent 60%), var(--pop-glass) !important; background-attachment: local !important; border: 1px solid var(--pop-line) !important; border-radius: 24px;
  -webkit-backdrop-filter: blur(34px) saturate(180%); backdrop-filter: blur(34px) saturate(180%);
  box-shadow: 0 40px 90px -30px rgba(0, 8, 18, .75), 0 0 0 1px rgba(255, 255, 255, .03), 0 1px 0 rgba(180, 230, 255, .12) inset; }
.sheet-wrap.modal .sheet-head, .sheet-wrap.modal .cqp-tabs { background: transparent !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
.sheet-wrap.modal .sheet-head { border-bottom-color: var(--pop-line) !important; }
.sheet-wrap.modal .sheet-back { background: rgba(2, 10, 20, .38); -webkit-backdrop-filter: blur(8px) saturate(120%); backdrop-filter: blur(8px) saturate(120%); }
.sheet-wrap.modal .sheet:has(.acc), .sheet-wrap.modal .sheet:has(.emp-panel) { width: min(760px, 100%); }

/* pop-ups: clear, see-through blurry glass (the page shows through, softly blurred) */
:root { --pop-glass: rgba(240, 247, 252, .38); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pop-glass: rgba(10, 30, 52, .34); } }
:root[data-theme="dark"] { --pop-glass: rgba(10, 30, 52, .34); }
.sheet-wrap.modal .sheet { background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .02) 30%), var(--pop-glass) !important;
  -webkit-backdrop-filter: blur(36px) saturate(185%) brightness(1.04); backdrop-filter: blur(36px) saturate(185%) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, .16) !important;
  box-shadow: 0 30px 80px -30px rgba(0, 8, 18, .6), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(255, 255, 255, .05); }
.sheet-wrap.modal .sheet-back { background: rgba(2, 10, 20, .12); -webkit-backdrop-filter: none; backdrop-filter: none; }
.sheet-wrap.modal .acc-sec, .sheet-wrap.modal .emp-box, .sheet-wrap.modal .cqp-block, .sheet-wrap.modal .cqp-step,
.sheet-wrap.modal .cqp-danger, .sheet-wrap.modal .acc-qa .qa, .sheet-wrap.modal .cqp-note {
  background: rgba(255, 255, 255, .06) !important; border: 1px solid rgba(255, 255, 255, .12) !important; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; }
.sheet-wrap.modal .sheet-head { border-bottom-color: rgba(255, 255, 255, .12) !important; }
.sheet-wrap.modal input:not([type=checkbox]):not([type=radio]), .sheet-wrap.modal select, .sheet-wrap.modal textarea {
  background-color: rgba(255, 255, 255, .07) !important; border-color: rgba(255, 255, 255, .16) !important; }
:root:not([data-theme="dark"]) .sheet-wrap.modal .acc-sec, :root:not([data-theme="dark"]) .sheet-wrap.modal .emp-box,
:root:not([data-theme="dark"]) .sheet-wrap.modal .cqp-block, :root:not([data-theme="dark"]) .sheet-wrap.modal .cqp-step {
  background: rgba(255, 255, 255, .35) !important; border-color: rgba(14, 52, 82, .12) !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sheet-wrap.modal .acc-sec, :root:not([data-theme="light"]) .sheet-wrap.modal .emp-box,
  :root:not([data-theme="light"]) .sheet-wrap.modal .cqp-block, :root:not([data-theme="light"]) .sheet-wrap.modal .cqp-step {
  background: rgba(255, 255, 255, .06) !important; border-color: rgba(255, 255, 255, .12) !important; } }

/* header: a blurry glass bar over the page as it scrolls */
.hdr { background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0)), rgba(8, 26, 44, .28) !important;
  -webkit-backdrop-filter: blur(22px) saturate(180%) !important; backdrop-filter: blur(22px) saturate(180%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 10px 30px -18px rgba(0, 8, 18, .6) !important; }
:root:not([data-theme="dark"]) .hdr { background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .2)), rgba(236, 244, 250, .35) !important;
  border-bottom-color: rgba(14, 52, 82, .08); box-shadow: 0 10px 30px -20px rgba(10, 42, 59, .35) !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hdr {
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0)), rgba(8, 26, 44, .28) !important;
  border-bottom-color: rgba(255, 255, 255, .08); box-shadow: 0 10px 30px -18px rgba(0, 8, 18, .6) !important; } }
.hdr-nav { background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .02)), rgba(6, 22, 38, .45) !important;
  border: 1px solid rgba(255, 255, 255, .12) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 10px 30px -14px rgba(0, 8, 18, .7) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); }
@media (max-width: 900px) { .hdr { background: rgba(8, 26, 44, .55) !important; } }

/* a bit more frost: pop-ups and header */
:root { --pop-glass: rgba(240, 247, 252, .5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pop-glass: rgba(12, 32, 54, .46); } }
:root[data-theme="dark"] { --pop-glass: rgba(12, 32, 54, .46); }
.sheet-wrap.modal .sheet { background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .04) 35%), var(--pop-glass) !important;
  -webkit-backdrop-filter: blur(46px) saturate(170%) brightness(1.05) !important; backdrop-filter: blur(46px) saturate(170%) brightness(1.05) !important; }
.hdr { -webkit-backdrop-filter: blur(30px) saturate(170%) !important; backdrop-filter: blur(30px) saturate(170%) !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hdr { background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)), rgba(10, 30, 50, .4) !important; } }
:root[data-theme="dark"] .hdr { background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)), rgba(10, 30, 50, .4) !important; }
.hdr-nav { -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); }

/* pop-up title bar stays readable: content scrolling under it is frosted away, not shown through */
.sheet-wrap.modal .sheet-head, .sheet-wrap.modal .cqp-tabs {
  background: linear-gradient(180deg, rgba(14, 36, 60, .92), rgba(14, 36, 60, .82)) !important;
  -webkit-backdrop-filter: blur(24px) saturate(160%) !important; backdrop-filter: blur(24px) saturate(160%) !important; z-index: 3; }
:root:not([data-theme="dark"]) .sheet-wrap.modal .sheet-head, :root:not([data-theme="dark"]) .sheet-wrap.modal .cqp-tabs {
  background: linear-gradient(180deg, rgba(246, 250, 253, .94), rgba(240, 247, 252, .86)) !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sheet-wrap.modal .sheet-head, :root:not([data-theme="light"]) .sheet-wrap.modal .cqp-tabs {
  background: linear-gradient(180deg, rgba(14, 36, 60, .92), rgba(14, 36, 60, .82)) !important; } }
.sheet-wrap.modal .sheet-head { border-radius: 24px 24px 0 0; }
.sheet .sheet-head, .sheet .cqp-tabs { isolation: isolate; }

/* email field (name @ domain) = one glass field */
.em-row { background: rgba(255, 255, 255, .07) !important; border: 1px solid rgba(255, 255, 255, .16) !important; }
:root:not([data-theme="dark"]) .em-row { background: rgba(255, 255, 255, .55) !important; border-color: rgba(14, 52, 82, .14) !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .em-row { background: rgba(255, 255, 255, .07) !important; border-color: rgba(255, 255, 255, .16) !important; } }
.em-row input, .sheet-wrap.modal .em-row input { background: transparent !important; border: 0 !important; box-shadow: none !important; }
.em-at { background: transparent !important; padding: 0 2px; opacity: .7; }
.em-row .em-dom, .sheet-wrap.modal .em-row .em-dom { background: color-mix(in srgb, var(--accent) 10%, transparent) !important;
  border-left: 1px solid rgba(255, 255, 255, .10) !important; }

/* sticky Save / Cancel bar in pop-ups: a frosted strip that matches the glass, not a dark band */
.sheet .rf-foot, .sheet .cqp-foot {
  background: linear-gradient(180deg, rgba(14, 36, 60, .55), rgba(14, 36, 60, .85)) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  margin: 18px -22px 0; padding: 12px 22px 14px; border-top: 1px solid rgba(255, 255, 255, .10) !important; z-index: 3; }
:root:not([data-theme="dark"]) .sheet .rf-foot, :root:not([data-theme="dark"]) .sheet .cqp-foot {
  background: linear-gradient(180deg, rgba(246, 250, 253, .6), rgba(246, 250, 253, .92)) !important; border-top-color: rgba(14, 52, 82, .10) !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sheet .rf-foot, :root:not([data-theme="light"]) .sheet .cqp-foot {
  background: linear-gradient(180deg, rgba(14, 36, 60, .55), rgba(14, 36, 60, .85)) !important; border-top-color: rgba(255, 255, 255, .10) !important; } }
.sheet-wrap.modal .sheet .rf-foot:last-child, .sheet-wrap.modal .sheet .cqp-foot:last-child { border-radius: 0 0 24px 24px; }

/* =====================================================================================================
   Frosted navy glass (page panels): deep navy, strong blur, clean edge - no grain, no grey haze
   ===================================================================================================== */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --glass: rgba(11, 30, 52, .52); --glass-2: rgba(20, 44, 72, .38); --glass-line: rgba(150, 205, 240, .14);
  --glass-hi: linear-gradient(180deg, rgba(150, 215, 255, .07), rgba(150, 215, 255, 0) 30%);
  --glass-shadow: 0 20px 50px -24px rgba(0, 6, 14, .85), inset 0 1px 0 rgba(170, 225, 255, .10);
  --glass-blur: blur(30px) saturate(160%); } }
:root[data-theme="dark"] {
  --glass: rgba(11, 30, 52, .52); --glass-2: rgba(20, 44, 72, .38); --glass-line: rgba(150, 205, 240, .14);
  --glass-hi: linear-gradient(180deg, rgba(150, 215, 255, .07), rgba(150, 215, 255, 0) 30%);
  --glass-shadow: 0 20px 50px -24px rgba(0, 6, 14, .85), inset 0 1px 0 rgba(170, 225, 255, .10);
  --glass-blur: blur(30px) saturate(160%); }
.tile2 { background: var(--glass-hi), var(--glass) !important; border: 1px solid var(--glass-line) !important;
  box-shadow: var(--glass-shadow) !important; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.card table.data th { border-bottom-color: var(--glass-line) !important; }
.card table.data td { border-bottom-color: rgba(150, 205, 240, .07) !important; }
.card table.data tbody tr:hover > td { background: rgba(120, 200, 240, .05) !important; }

/* ===================== light mode polish (all panels) ===================== */

:root[data-theme="light"] {
  --glass: rgba(255, 255, 255, .64); --glass-2: rgba(244, 249, 252, .7); --glass-solid: rgba(252, 254, 255, .92);
  --glass-line: rgba(14, 52, 82, .10);
  --glass-hi: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 40%);
  --glass-shadow: 0 14px 36px -20px rgba(10, 42, 59, .30), 0 2px 6px -3px rgba(10, 42, 59, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
  --glass-blur: blur(24px) saturate(180%); }
:root[data-theme="light"] .hdr { background: linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .42)) !important;
  border-bottom: 1px solid rgba(14, 52, 82, .08) !important; box-shadow: 0 8px 24px -18px rgba(10, 42, 59, .35) !important; }
:root[data-theme="light"] .hdr-nav { background: linear-gradient(180deg, rgba(20, 58, 86, .92), rgba(10, 38, 60, .94)) !important;
  border-color: rgba(255, 255, 255, .14) !important; box-shadow: 0 10px 26px -12px rgba(10, 42, 59, .45), inset 0 1px 0 rgba(255, 255, 255, .16) !important; }
:root[data-theme="light"] .hdr-user, :root[data-theme="light"] .hdr-btn, :root[data-theme="light"] .theme-toggle { background: rgba(255, 255, 255, .7) !important; border-color: rgba(14, 52, 82, .12) !important; }
:root[data-theme="light"] .card table.data th { border-bottom-color: rgba(14, 52, 82, .10) !important; color: #5a6e7c; }
:root[data-theme="light"] .card table.data td { border-bottom-color: rgba(14, 52, 82, .06) !important; }
:root[data-theme="light"] .card table.data tbody tr:hover > td { background: rgba(11, 117, 147, .05) !important; }
:root[data-theme="light"] input:not([type=checkbox]):not([type=radio]):not([type=range]), :root[data-theme="light"] select, :root[data-theme="light"] textarea { background-color: rgba(255, 255, 255, .78); border-color: rgba(14, 52, 82, .14); }
:root[data-theme="light"] .acc-sec, :root[data-theme="light"] .emp-box, :root[data-theme="light"] .cqd, :root[data-theme="light"] .cqp-block, :root[data-theme="light"] .cqp-step, :root[data-theme="light"] .cqp-danger, :root[data-theme="light"] .acc-card { background: rgba(255, 255, 255, .55) !important; border-color: rgba(14, 52, 82, .09) !important; }
:root[data-theme="light"] .cqg { background: var(--glass-hi), var(--glass) !important; }
/* queue cards: light frosted glass with navy text */
:root[data-theme="light"] article.cq { background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .62)) !important; color: #0f2230;
  box-shadow: 0 16px 36px -22px rgba(10, 42, 59, .35), inset 0 1px 0 #fff !important; }
:root[data-theme="light"] article.cq:hover { box-shadow: 0 22px 44px -22px rgba(10, 42, 59, .42), inset 0 1px 0 #fff !important; }
:root[data-theme="light"] article.cq.h-off { border-color: rgba(14, 52, 82, .14) !important; }
:root[data-theme="light"] .cq-head h3 { color: #0b7593; }
:root[data-theme="light"] .cq-head p, :root[data-theme="light"] .cq small, :root[data-theme="light"] .cq-big b em, :root[data-theme="light"] .cq-foot, :root[data-theme="light"] .cq-mini { color: #5e6f7c; }
:root[data-theme="light"] .cq-mini b, :root[data-theme="light"] .cq-foot .cq-hrs, :root[data-theme="light"] .cq-mini .hrs { color: #0f2230; }
:root[data-theme="light"] .cq-big { background: rgba(11, 117, 147, .06); border: 1px solid rgba(14, 52, 82, .07); }
:root[data-theme="light"] .cq-big > div + div { border-left-color: rgba(14, 52, 82, .08); }
:root[data-theme="light"] .cq-big b { color: #0f2230; }
:root[data-theme="light"] .cq-row b { color: #0b7593; }
:root[data-theme="light"] .cq-row > div { background: rgba(11, 117, 147, .05) !important; border-color: rgba(14, 52, 82, .06) !important; }
:root[data-theme="light"] .cq-foot { border-top-color: rgba(14, 52, 82, .08); }
:root[data-theme="light"] .cq-ic { background: rgba(255, 255, 255, .85); border-color: rgba(14, 52, 82, .14); color: #31495a; }
:root[data-theme="light"] .cq-ic:hover { color: #0b7593; border-color: #0b7593; }
:root[data-theme="light"] .cq-fold-btn { background: rgba(255, 255, 255, .85); border-color: rgba(14, 52, 82, .14); color: #31495a; }
:root[data-theme="light"] .cq-fold-btn:hover { color: #0b7593; border-color: #0b7593; }
:root[data-theme="light"] .cq-gap { background: rgba(124, 92, 230, .12); color: #6b46c1; }
:root[data-theme="light"] .cq-seats i { background: rgba(14, 52, 82, .12); }
:root[data-theme="light"] .cq-add { background: rgba(255, 255, 255, .45) !important; border-color: rgba(14, 52, 82, .22) !important; color: #5e6f7c !important; box-shadow: none !important; }
:root[data-theme="light"] .cq-add:hover { border-color: #0b7593 !important; color: #0b7593 !important; }
:root[data-theme="light"] .tile2 { background: var(--glass-hi), var(--glass) !important; border-color: var(--glass-line) !important; box-shadow: var(--glass-shadow) !important; }
:root[data-theme="light"] .fsearch { box-shadow: 0 10px 26px -10px rgba(11, 117, 147, .55), inset 0 1px 0 rgba(255, 255, 255, .4); }
:root[data-theme="light"] .vw-switch, :root[data-theme="light"] .cql-seg { background: rgba(255, 255, 255, .6); border-color: rgba(14, 52, 82, .10); }
:root[data-theme="light"] .cql-chip, :root[data-theme="light"] .cql-num { background: rgba(255, 255, 255, .65); border-color: rgba(14, 52, 82, .12); }
:root[data-theme="light"] .cql-chip b { background: rgba(14, 52, 82, .06); }
:root[data-theme="light"] .cqg-n { background: rgba(255, 255, 255, .7); }
:root[data-theme="light"] .tabs a { color: #4f6472; }

@media (prefers-color-scheme: light) {
:root:not([data-theme]) {
  --glass: rgba(255, 255, 255, .64); --glass-2: rgba(244, 249, 252, .7); --glass-solid: rgba(252, 254, 255, .92);
  --glass-line: rgba(14, 52, 82, .10);
  --glass-hi: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 40%);
  --glass-shadow: 0 14px 36px -20px rgba(10, 42, 59, .30), 0 2px 6px -3px rgba(10, 42, 59, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
  --glass-blur: blur(24px) saturate(180%); }
:root:not([data-theme]) .hdr { background: linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .42)) !important;
  border-bottom: 1px solid rgba(14, 52, 82, .08) !important; box-shadow: 0 8px 24px -18px rgba(10, 42, 59, .35) !important; }
:root:not([data-theme]) .hdr-nav { background: linear-gradient(180deg, rgba(20, 58, 86, .92), rgba(10, 38, 60, .94)) !important;
  border-color: rgba(255, 255, 255, .14) !important; box-shadow: 0 10px 26px -12px rgba(10, 42, 59, .45), inset 0 1px 0 rgba(255, 255, 255, .16) !important; }
:root:not([data-theme]) .hdr-user, :root:not([data-theme]) .hdr-btn, :root:not([data-theme]) .theme-toggle { background: rgba(255, 255, 255, .7) !important; border-color: rgba(14, 52, 82, .12) !important; }
:root:not([data-theme]) .card table.data th { border-bottom-color: rgba(14, 52, 82, .10) !important; color: #5a6e7c; }
:root:not([data-theme]) .card table.data td { border-bottom-color: rgba(14, 52, 82, .06) !important; }
:root:not([data-theme]) .card table.data tbody tr:hover > td { background: rgba(11, 117, 147, .05) !important; }
:root:not([data-theme]) input:not([type=checkbox]):not([type=radio]):not([type=range]), :root:not([data-theme]) select, :root:not([data-theme]) textarea { background-color: rgba(255, 255, 255, .78); border-color: rgba(14, 52, 82, .14); }
:root:not([data-theme]) .acc-sec, :root:not([data-theme]) .emp-box, :root:not([data-theme]) .cqd, :root:not([data-theme]) .cqp-block, :root:not([data-theme]) .cqp-step, :root:not([data-theme]) .cqp-danger, :root:not([data-theme]) .acc-card { background: rgba(255, 255, 255, .55) !important; border-color: rgba(14, 52, 82, .09) !important; }
:root:not([data-theme]) .cqg { background: var(--glass-hi), var(--glass) !important; }
/* queue cards: light frosted glass with navy text */
:root:not([data-theme]) article.cq { background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .62)) !important; color: #0f2230;
  box-shadow: 0 16px 36px -22px rgba(10, 42, 59, .35), inset 0 1px 0 #fff !important; }
:root:not([data-theme]) article.cq:hover { box-shadow: 0 22px 44px -22px rgba(10, 42, 59, .42), inset 0 1px 0 #fff !important; }
:root:not([data-theme]) article.cq.h-off { border-color: rgba(14, 52, 82, .14) !important; }
:root:not([data-theme]) .cq-head h3 { color: #0b7593; }
:root:not([data-theme]) .cq-head p, :root:not([data-theme]) .cq small, :root:not([data-theme]) .cq-big b em, :root:not([data-theme]) .cq-foot, :root:not([data-theme]) .cq-mini { color: #5e6f7c; }
:root:not([data-theme]) .cq-mini b, :root:not([data-theme]) .cq-foot .cq-hrs, :root:not([data-theme]) .cq-mini .hrs { color: #0f2230; }
:root:not([data-theme]) .cq-big { background: rgba(11, 117, 147, .06); border: 1px solid rgba(14, 52, 82, .07); }
:root:not([data-theme]) .cq-big > div + div { border-left-color: rgba(14, 52, 82, .08); }
:root:not([data-theme]) .cq-big b { color: #0f2230; }
:root:not([data-theme]) .cq-row b { color: #0b7593; }
:root:not([data-theme]) .cq-row > div { background: rgba(11, 117, 147, .05) !important; border-color: rgba(14, 52, 82, .06) !important; }
:root:not([data-theme]) .cq-foot { border-top-color: rgba(14, 52, 82, .08); }
:root:not([data-theme]) .cq-ic { background: rgba(255, 255, 255, .85); border-color: rgba(14, 52, 82, .14); color: #31495a; }
:root:not([data-theme]) .cq-ic:hover { color: #0b7593; border-color: #0b7593; }
:root:not([data-theme]) .cq-fold-btn { background: rgba(255, 255, 255, .85); border-color: rgba(14, 52, 82, .14); color: #31495a; }
:root:not([data-theme]) .cq-fold-btn:hover { color: #0b7593; border-color: #0b7593; }
:root:not([data-theme]) .cq-gap { background: rgba(124, 92, 230, .12); color: #6b46c1; }
:root:not([data-theme]) .cq-seats i { background: rgba(14, 52, 82, .12); }
:root:not([data-theme]) .cq-add { background: rgba(255, 255, 255, .45) !important; border-color: rgba(14, 52, 82, .22) !important; color: #5e6f7c !important; box-shadow: none !important; }
:root:not([data-theme]) .cq-add:hover { border-color: #0b7593 !important; color: #0b7593 !important; }
:root:not([data-theme]) .tile2 { background: var(--glass-hi), var(--glass) !important; border-color: var(--glass-line) !important; box-shadow: var(--glass-shadow) !important; }
:root:not([data-theme]) .fsearch { box-shadow: 0 10px 26px -10px rgba(11, 117, 147, .55), inset 0 1px 0 rgba(255, 255, 255, .4); }
:root:not([data-theme]) .vw-switch, :root:not([data-theme]) .cql-seg { background: rgba(255, 255, 255, .6); border-color: rgba(14, 52, 82, .10); }
:root:not([data-theme]) .cql-chip, :root:not([data-theme]) .cql-num { background: rgba(255, 255, 255, .65); border-color: rgba(14, 52, 82, .12); }
:root:not([data-theme]) .cql-chip b { background: rgba(14, 52, 82, .06); }
:root:not([data-theme]) .cqg-n { background: rgba(255, 255, 255, .7); }
:root:not([data-theme]) .tabs a { color: #4f6472; }
}
:root[data-theme="light"] .cq-res-t, :root[data-theme="light"] .cq-res-t em { color: #31495a; }
:root[data-theme="light"] .cq-res-bar { background: rgba(14, 52, 82, .10); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .cq-res-t, :root:not([data-theme]) .cq-res-t em { color: #31495a; }
  :root:not([data-theme]) .cq-res-bar { background: rgba(14, 52, 82, .10); } }

/* ---------- employee: the detailed record (pop-up and full page) ---------- */
.sheet-wrap.modal .sheet:has(.emp-panel) { width: min(1040px, 100%); }
.ed-hero { display: flex; gap: 16px; align-items: center; }
.ed-hero .acc-av.lg { width: 64px; height: 64px; font-size: 22px; flex: 0 0 64px; }
.ed-hero-tx { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ed-name { font: 600 21px var(--font-display); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ed-src { font-weight: 500; }
.ed-role { color: var(--muted); font-size: 13.5px; }
.ed-dept { font-weight: 600; color: var(--ink); }
.ed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.ed-wide { grid-column: 1 / -1; }
.ed-grid .acc-sec h3 { display: flex; align-items: center; gap: 7px; }
.ed-grid .acc-sec h3 svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.ed-add { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
.ed-item { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.ed-item:first-of-type { border-top: 0; padding-top: 2px; }
.ed-item-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ed-big { font-size: 14.5px; font-weight: 500; color: var(--ink); word-break: break-all; }
.ed-ext { font: 600 20px var(--font-display); letter-spacing: .02em; padding: 2px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.ed-acts { margin-left: auto; display: inline-flex; gap: 12px; align-items: center; }
.ed-acts form { margin: 0; }
.ed-none { margin: 2px 0; }
.ed-note, .ed-other { margin: 8px 0 0; }
.ed-grid .acc-dl { grid-template-columns: 128px 1fr; }
.emp-page { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.emp-src { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--accent) 6%, transparent); }
.emp-src-ic { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px;
  background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
@media (max-width: 820px) { .ed-grid { grid-template-columns: 1fr; } .ed-hero .acc-av.lg { width: 52px; height: 52px; flex-basis: 52px; } .ed-name { font-size: 18px; } }
.fx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.fx-chips .qchip b { margin-left: 4px; }
.fx-card { margin-bottom: 14px; }
.fx-h { margin: 0; font: 600 16px var(--font-display); display: flex; align-items: center; gap: 6px; }
.fx-how { margin: 4px 0 10px; }
.fx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fx-list li { display: grid; grid-template-columns: minmax(160px, 260px) 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.fx-who { text-align: left; font-weight: 500; }
@media (max-width: 640px) { .fx-list li { grid-template-columns: 1fr auto; } .fx-list li .muted { grid-column: 1; } }
.ed-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ed-link-f { display: flex; gap: 8px; flex: 1 1 260px; min-width: 0; margin: 0; }
.ed-link-f select { flex: 1; min-width: 0; }
.ed-new { white-space: nowrap; }
.ed-chg summary { cursor: pointer; color: var(--muted); margin-top: 8px; }
.fx-chips .qchip { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--ink); }
.fx-chips .qchip:hover { border-color: var(--accent); color: var(--accent); }
.fx-chips .qchip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fx-quick { display: flex; gap: 8px; margin: 0; justify-self: end; }
.fx-quick input, .fx-quick select { height: 34px; min-width: 220px; padding: 0 10px; }
@media (max-width: 640px) { .fx-quick { grid-column: 1 / -1; justify-self: stretch; } .fx-quick input, .fx-quick select { min-width: 0; flex: 1; } }

/* ---------- searchable picker (Link an existing …) ---------- */
.pk { position: relative; flex: 1; min-width: 0; display: flex; }
.pk .pk-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; }
.pk-box { flex: 1; min-width: 0; height: 40px; padding: 0 14px 0 36px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); font: 500 13.5px var(--font);
  background: var(--glass-2, var(--surface-2)) no-repeat 12px 50% / 16px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238ea6b4' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E"); }
.pk-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.pk.pk-set .pk-box { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.pk.pk-taken .pk-box { border-color: #e0a63a; }
.pk-list { position: fixed; z-index: 90; overflow-y: auto; overscroll-behavior: contain; padding: 6px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--glass-solid, var(--surface)); color: var(--ink);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 22px 48px -18px rgba(0, 0, 0, .55), 0 2px 8px -2px rgba(0, 0, 0, .25); }
.pk-group { position: sticky; top: -6px; z-index: 1; margin: 0 -6px; padding: 8px 14px 6px; font: 600 10.5px var(--font); letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); background: var(--glass-solid, var(--surface)); }
.pk-group.taken { color: #e0a63a; }
.pk-opt { appearance: none; display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 10px;
  border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: 500 13.5px var(--font); text-align: left; cursor: pointer; }
.pk-opt:hover, .pk-opt.on { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.pk-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-opt:has(.pk-id) { flex-wrap: wrap; row-gap: 2px; }
.pk-id { display: block; flex: 1 0 100%; margin-top: 0; white-space: nowrap; color: var(--muted); font: 500 11.5px var(--mono, ui-monospace, monospace); letter-spacing: .02em; }
.pk-sub { flex: 0 0 auto; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.pk-opt.taken .pk-sub { color: #e0a63a; }
.pk-opt .pk-sub.bad { color: var(--r); font-weight: 600; }
.pk-empty { padding: 14px; color: var(--muted); font-size: 13px; text-align: center; }

/* native dropdown lists: readable in both themes */
select option, select optgroup { background-color: var(--pop-solid); color: var(--ink); }

/* small floating menus must be readable: solid, never see-through */
:root { --pop-solid: #ffffff; }
:root[data-theme="dark"] { --pop-solid: #0b2236; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pop-solid: #0b2236; } }
.tpop, .pl-pop, .pk-list, .pk-group, .col-menu, .sy-tip, .ls-pick-box { background: var(--pop-solid) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.tpop { box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .6), 0 0 0 1px var(--line) !important; z-index: 60; }
.tpop-head b, .tpop-a { color: var(--ink); }
.pk-list:not([hidden]) { display: block !important; }
.pk-list > .pk-opt { display: flex !important; width: 100% !important; margin: 0; }
.pk-list > .pk-group { display: block; }
.pk input.pk-box { padding-left: 38px !important; background-position: 12px 50% !important; background-size: 16px !important; }

/* ---------- use the room on big screens ---------- */
@media (min-width: 1500px) { .wrap { max-width: min(1760px, 100%); padding: 24px 36px; } }
.ed-rec .acc-dl { grid-template-columns: 128px minmax(0, 1fr) 128px minmax(0, 1fr); }
.ed-rec .emp-edit .form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 16px; }
.ed-rec .emp-edit .form .field.full, .ed-rec .emp-edit .form .form-actions { grid-column: 1 / -1; }
@media (max-width: 900px) { .ed-rec .acc-dl { grid-template-columns: 128px 1fr; } }
/* the split preview pane: as tall as the screen allows */
.acc-split, .gv-split { min-height: calc(100vh - 260px); }
.acc-pane { max-height: calc(100vh - 200px); }
.acc-pane .sheet-head { background: var(--pop-solid) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

.gv-split .acc-li .acc-tx b { font-size: 15px; font-weight: 600; }
.gv-split .acc-li .acc-tx > span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- employee record: collapsible sections with icons ---------- */
.ed-sec { padding: 0 !important; overflow: hidden; }
.ed-sec > :not(summary) { margin-left: 14px; margin-right: 14px; }
.ed-sec > :last-child { margin-bottom: 14px; }
.ed-sum { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; user-select: none; min-width: 0; }
.ed-sum::-webkit-details-marker { display: none; }
.ed-sum:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.ed-sum b { font: 600 14px var(--font-display); white-space: nowrap; }
.ed-sum .tab-n { margin-left: 0; }
.ed-ic { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; display: grid; place-items: center; }
.ed-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ed-ic.c-blue { background: rgba(70, 140, 255, .16); color: #6fa8ff; }
.ed-ic.c-violet { background: rgba(160, 110, 255, .16); color: #b28cff; }
.ed-ic.c-cyan { background: rgba(57, 192, 224, .16); color: #4fd0ee; }
.ed-ic.c-amber { background: rgba(240, 170, 60, .16); color: #f2b14a; }
.ed-ic.c-teal { background: rgba(40, 200, 160, .16); color: #3fd6b0; }
.ed-ic.c-slate { background: rgba(140, 170, 190, .16); color: #9fb6c4; }
.ed-peek { flex: 1; min-width: 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.ed-sec[open] > .ed-sum .ed-peek { visibility: hidden; }
.ed-chev { width: 9px; height: 9px; flex: 0 0 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .18s; margin: 0 4px 0 6px; }
.ed-sec[open] > .ed-sum .ed-chev { transform: rotate(45deg); }
.ed-sec[open] > .ed-sum { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.ed-sec .ed-item:first-of-type { padding-top: 0; }
.ed-link-t { margin-top: 10px; }
.ed-link-t > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--accent);
  padding: 6px 12px; border-radius: 999px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ed-link-t > summary::-webkit-details-marker { display: none; }
.ed-link-t > summary:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ed-link-t[open] > summary { border-style: solid; }
.ed-link-t .ed-link { border-top: 0; padding-top: 0; }
:root:not([data-theme="dark"]) .ed-ic.c-blue { color: #2f6fd6; } :root:not([data-theme="dark"]) .ed-ic.c-violet { color: #7a4fd6; }
:root:not([data-theme="dark"]) .ed-ic.c-cyan { color: #0e8fb0; } :root:not([data-theme="dark"]) .ed-ic.c-amber { color: #b97808; }
:root:not([data-theme="dark"]) .ed-ic.c-teal { color: #0e9a7a; } :root:not([data-theme="dark"]) .ed-ic.c-slate { color: #557080; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ed-ic.c-blue { color: #6fa8ff; } :root:not([data-theme="light"]) .ed-ic.c-violet { color: #b28cff; }
  :root:not([data-theme="light"]) .ed-ic.c-cyan { color: #4fd0ee; } :root:not([data-theme="light"]) .ed-ic.c-amber { color: #f2b14a; }
  :root:not([data-theme="light"]) .ed-ic.c-teal { color: #3fd6b0; } :root:not([data-theme="light"]) .ed-ic.c-slate { color: #9fb6c4; } }
.emp-foot { gap: 10px; justify-content: space-between !important; }
.emp-foot form { margin: 0; }
.btn.ghost-danger { background: transparent; border-color: color-mix(in srgb, #e5484d 45%, var(--line)); color: #e5484d; }
.btn.ghost-danger:hover { background: color-mix(in srgb, #e5484d 12%, transparent); }
.fx-del > summary { cursor: pointer; list-style: none; }
.fx-del > summary::-webkit-details-marker { display: none; }

/* ---------- notifications: bottom-right pop-ups, 5 seconds ---------- */
.ntfs { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none; max-width: min(420px, calc(100vw - 32px)); }
.ntf { pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 12px 12px 14px 14px; border-radius: 14px; background: var(--pop-solid); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .55), 0 2px 6px -2px rgba(0, 0, 0, .25); font: 500 13.5px/1.45 var(--font);
  animation: ntfIn .28s cubic-bezier(.2, .8, .2, 1); }
.ntf.out { animation: ntfOut .26s ease-in forwards; }
.ntf-ic { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; margin-top: 1px; background: #2bb673;
  -webkit-mask: none; position: relative; }
.ntf-ic::after { content: ""; position: absolute; left: 7px; top: 4px; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ntf.err .ntf-ic { background: #e5484d; }
.ntf.err .ntf-ic::after { left: 10px; top: 5px; width: 0; height: 9px; border-width: 0 2px 0 0; transform: none; }
.ntf.err .ntf-ic::before { content: ""; position: absolute; left: 10px; top: 15.5px; width: 2px; height: 2px; background: #fff; border-radius: 1px; }
.ntf-tx { flex: 1; min-width: 0; padding-top: 1px; word-break: break-word; }
.ntf-x { appearance: none; flex: 0 0 24px; height: 24px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.ntf-x:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); }
.ntf-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #2bb673; transform-origin: left; animation: ntfBar 5s linear forwards; }
.ntf.err .ntf-bar { background: #e5484d; }
.ntf.paused .ntf-bar { animation-play-state: paused; }
@keyframes ntfIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ntfOut { to { opacity: 0; transform: translateX(24px); } }
@keyframes ntfBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 900px) { .ntfs { right: 12px; left: 12px; bottom: 84px; max-width: none; } }
@media (prefers-reduced-motion: reduce) { .ntf, .ntf.out { animation: none; } }
body.sheet-open .ntfs { z-index: 120; }

/* ---------- admin tab bar: icon pills ---------- */
.atabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; width: fit-content; max-width: 100%; margin: 4px 0 22px; padding: 5px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--glass-2, var(--surface-2)); }
.atabs a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 12px; color: var(--muted); text-decoration: none;
  font: 500 13.5px var(--font); white-space: nowrap; transition: background .15s, color .15s; }
.atabs a svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.atabs a:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.atabs a.on { color: var(--accent-ink); background: var(--accent); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--accent) 90%, #000); font-weight: 600; }
.atabs-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font: 700 11px var(--font);
  background: #e5484d; color: #fff; }
.atabs a.on .atabs-n { background: rgba(255, 255, 255, .92); color: #c62f34; }
.atabs-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
@media (max-width: 700px) { .atabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; } .atabs-sep { display: none; } }
.fx-sub { font-weight: 400; margin-left: 4px; }

/* ---------- page headings: big, upper case, no description (live status lines stay) ---------- */
.page-head h1 { font: 700 clamp(26px, 2.4vw, 36px)/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.page-head p.muted:not(.status-line), .hello-sub, .fx-how, .fx-sub { display: none; }
.page-head p.status-line { margin-top: 6px; font-size: 12.5px; }

/* ---------- section dock: the page's section switcher, a small bar centred on the left ---------- */
:root { --hdr-h: 72px; --dock-w: 62px; --dock-wide: 214px; }
body:has(main nav.secnav) main nav.secnav { position: fixed; z-index: 26; left: 12px; top: calc(50% + var(--hdr-h) / 2); bottom: auto;
  transform: translateY(-50%); width: var(--dock-w); max-height: calc(100vh - var(--hdr-h) - 40px); margin: 0; padding: 7px;
  display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 4px; overflow: visible;
  border-radius: 20px; border: 1px solid var(--line); background: var(--pop-solid) !important;
  box-shadow: 0 18px 44px -20px rgba(0, 0, 0, .7); transition: transform .24s cubic-bezier(.2, .8, .2, 1), width .2s; }
body:has(main nav.secnav) main nav.secnav a { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; flex: none;
  width: 100%; height: 46px; padding: 0; border-radius: 14px; color: var(--muted); font: 500 13.5px var(--font); white-space: nowrap; }
body:has(main nav.secnav) main nav.secnav a svg, body:has(main nav.secnav) main nav.secnav a .ys-logo { width: 20px; height: 20px; flex: 0 0 20px; }
body:has(main nav.secnav) main nav.secnav a:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
body:has(main nav.secnav) main nav.secnav a.on { background: var(--accent); color: var(--accent-ink, #fff); box-shadow: 0 10px 22px -12px var(--accent); }
/* names pop out next to the icon */
body:has(main nav.secnav) main nav.secnav .sn-tx { position: absolute; left: calc(100% + 14px); top: 50%; transform: translate(-6px, -50%);
  padding: 7px 12px; border-radius: 10px; background: var(--pop-solid); color: var(--ink); border: 1px solid var(--line); font-weight: 600;
  box-shadow: 0 12px 28px -14px rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; }
body:has(main nav.secnav) main nav.secnav a:hover .sn-tx, body:has(main nav.secnav) main nav.secnav a:focus-visible .sn-tx { opacity: 1; transform: translate(0, -50%); }
body:has(main nav.secnav) main nav.secnav .secnav-n, body:has(main nav.secnav) main nav.secnav .atabs-n {
  position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; font-size: 10px; line-height: 17px; margin: 0; }
.sn-sep { display: block; height: 1px; background: var(--line); margin: 3px 8px; flex: none; }
.sn-head { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 0 6px; margin-bottom: 2px; border-bottom: 1px solid var(--line); }
.sn-title { display: none; flex: 1; min-width: 0; padding-left: 6px; font: 700 11px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-gear { appearance: none; width: 34px; height: 30px; flex: 0 0 auto; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.sn-gear:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sn-gear svg, .sn-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.sn-toggle { display: none; position: fixed; z-index: 27; left: 12px; top: calc(50% + var(--hdr-h) / 2); transform: translateY(-50%); width: 40px; height: 40px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--pop-solid); color: var(--ink); cursor: pointer; place-items: center;
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .6); }
.sn-toggle:hover { color: var(--accent); border-color: var(--accent); }
/* icons (rail, the default): just the icons */
body:has(main nav.secnav):not([data-nav="hidden"]) > main { margin-left: calc(var(--dock-w) + 22px); max-width: min(1760px, calc(100% - var(--dock-w) - 22px)); }
/* icons + names (open) */
body:has(main nav.secnav)[data-nav="open"] main nav.secnav { width: var(--dock-wide); }
body:has(main nav.secnav)[data-nav="open"] main nav.secnav a { justify-content: flex-start; padding: 0 12px; }
body:has(main nav.secnav)[data-nav="open"] main nav.secnav .sn-tx { position: static; transform: none; opacity: 1; padding: 0; border: 0; background: none;
  box-shadow: none; color: inherit; font-weight: inherit; overflow: hidden; text-overflow: ellipsis; pointer-events: auto; }
body:has(main nav.secnav)[data-nav="open"] main nav.secnav .secnav-n, body:has(main nav.secnav)[data-nav="open"] main nav.secnav .atabs-n {
  position: static; margin-left: auto; }
body:has(main nav.secnav)[data-nav="open"] .sn-head { justify-content: space-between; }
body:has(main nav.secnav)[data-nav="open"] .sn-title { display: block; }
body:has(main nav.secnav)[data-nav="open"] > main { margin-left: calc(var(--dock-wide) + 22px); max-width: min(1760px, calc(100% - var(--dock-wide) - 22px)); }
/* hidden: ☰ slides it out */
body:has(main nav.secnav)[data-nav="hidden"] .sn-toggle { display: grid; }
body:has(main nav.secnav)[data-nav="hidden"] main nav.secnav { transform: translate(-140%, -50%); }
body.sn-show:has(main nav.secnav) main nav.secnav { transform: translateY(-50%) !important; left: 62px; }
body:has(main nav.secnav)[data-nav="hidden"] > main .page-head { padding-left: 52px; }
@media (max-width: 900px) {
  body:has(main nav.secnav) > main { margin-left: auto !important; max-width: none !important; }
  body:has(main nav.secnav) .sn-toggle { display: grid; }
  body:has(main nav.secnav) main nav.secnav { transform: translate(-140%, -50%); }
  body:has(main nav.secnav) > main .page-head { padding-left: 52px; }
}
@media (prefers-reduced-motion: reduce) { body:has(main nav.secnav) main nav.secnav { transition: none; } }

/* ⚙ pop-up */
.sn-pop { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 16px; background: rgba(2, 10, 20, .4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: ntfIn .2s ease; }
.sn-pop-card { position: relative; width: min(620px, 100%); padding: 22px; border-radius: 20px; background: var(--pop-solid); border: 1px solid var(--line);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .7); }
.sn-pop-card h3 { margin: 0 0 4px; font: 700 18px var(--font-display); text-transform: uppercase; letter-spacing: .06em; }
.sn-pop-card > p { margin: 0 0 16px; }
.sn-pop-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.sn-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sn-mode { appearance: none; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.sn-mode:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.sn-mode.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.sn-mode b { font-size: 14px; } .sn-mode small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.sn-pic { position: relative; height: 70px; border-radius: 10px; border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 4%, transparent); overflow: hidden; display: flex; gap: 6px; padding: 6px; }
.sn-pic i { display: block; border-radius: 6px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.sn-pic .m-side.wide { width: 34%; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.sn-pic .m-side.thin { width: 10%; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.sn-pic .m-page { flex: 1; }
.sn-pic .m-btn { position: absolute; left: 8px; top: 8px; width: 16px; height: 16px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 60%, transparent); }
.sn-pic .m-page.full { flex: 1; margin-left: 22px; }
@media (max-width: 560px) { .sn-modes { grid-template-columns: 1fr; } }

@media (min-width: 901px) { main .page-head { padding-right: 64px; } }
.sn-pic .m-side { align-self: center; height: 62%; }

/* search lives in the dock now */
.fsearch { display: none !important; }
body:has(main nav.secnav) main nav.secnav .sn-search { appearance: none; position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 46px; padding: 0; border: 0; border-radius: 14px; cursor: pointer; flex: none;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font: 600 13.5px var(--font); }
body:has(main nav.secnav) main nav.secnav .sn-search svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
body:has(main nav.secnav) main nav.secnav .sn-search:hover { background: var(--accent); color: var(--accent-ink, #fff); }
body:has(main nav.secnav) main nav.secnav .sn-search kbd { margin-left: 6px; font: 600 10px var(--font); padding: 2px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--muted); }
body:has(main nav.secnav)[data-nav="open"] main nav.secnav .sn-search { justify-content: flex-start; padding: 0 12px; }
body:has(main nav.secnav) main nav.secnav .sn-search:hover .sn-tx, body:has(main nav.secnav) main nav.secnav .sn-search:focus-visible .sn-tx { opacity: 1; transform: translate(0, -50%); }
body:has(main nav.secnav)[data-nav="open"] main nav.secnav .sn-search .sn-tx { transform: none; }
main:has(nav.secnav:not(.sn-base)) > nav.sn-base { display: none; }

/* light / dark: the new theme grows as a circle from the switch (html.theme-vt while it runs) */
html.theme-vt::view-transition-old(root), html.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-vt::view-transition-new(root) { z-index: 2; }
html.theme-vt .hdr-nav a.on { view-transition-name: none !important; }

/* switching sections: the highlighted one slides along the bar to the new one (its text never stretched), the window
   cross-fades - the browser's own fade, which keeps what is the same on both pages (the header) still and never resizes
   anything (a page snapshot sized to the next section - WhatsApp's full width - stretched the one before it). Browsers
   without page-to-page view transitions (and reduced motion) just change */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
@media (min-width: 901px) { .hdr-nav a.on { view-transition-name: nav-on; } }
::view-transition-group(nav-on) { animation-duration: .42s; animation-timing-function: cubic-bezier(.45, 0, .2, 1); }
::view-transition-old(nav-on), ::view-transition-new(nav-on) { animation-duration: .42s; width: 100%; height: 100%; object-fit: none; }
html:not(.theme-vt)::view-transition-old(root), html:not(.theme-vt)::view-transition-new(root) { animation-duration: .28s; }

/* pinned (sticky) table rows must be solid, or the rows scrolling under them show through */
.sim-table .group-row td { background: var(--pop-solid) !important; background-image: linear-gradient(color-mix(in srgb, var(--accent) 7%, transparent), color-mix(in srgb, var(--accent) 7%, transparent)) !important; }
.table-wrap table.data thead th, .sim-wrap table.data thead th, .ax-scrollbox table.data thead th, table.pivot .stick { background-color: var(--pop-solid) !important; }

/* ---------- edit forms: sections with icons ---------- */
.rf { display: flex; flex-direction: column; gap: 14px; }
.rf-sec { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 16px; background: color-mix(in srgb, var(--ink) 3%, transparent); }
.rf-h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 700 12px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rf-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.rf-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rf-acct .rf-ic { background: rgba(160, 110, 255, .16); color: #a985ff; }
.rf-org .rf-ic { background: rgba(40, 200, 160, .16); color: #2ec9a3; }
.rf-more .rf-ic { background: rgba(240, 170, 60, .16); color: #e9a43d; }
.rf .emp-src { flex-direction: row; justify-content: flex-start; text-align: left; padding: 8px 12px; border-style: solid; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.rf .emp-src .small { font-size: 12.5px; line-height: 1.45; }
.rf-foot { align-items: center; }
.rf-gap { flex: 1; }
.rf-danger { margin: 0; text-align: left; }
.rf-danger:not(:has(label)) { display: none; }
.rf-del-btn { padding: 8px 14px; }
.rf-sec > .rf-h { margin: 0 0 16px !important; }
.sheet .rf-foot { position: sticky; bottom: 0; z-index: 3; margin: 6px -22px 0 !important; padding: 12px 22px !important;
  background: var(--pop-solid) !important; border-top: 1px solid var(--line) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
:root:not([data-nope]) .sheet-wrap .sheet > .rf-foot { margin: 0 !important; padding: 12px 22px !important; background: var(--pop-solid) !important; }

/* email field: local part | @domain (the @ belongs to the domain side) */
:root:not([data-nope]) .em-row .em-at { display: flex; align-items: center; padding: 0 1px 0 14px !important; margin: 0; opacity: 1 !important;
  font: 600 15px var(--font); color: var(--accent); border-left: 1px solid var(--line); background: transparent !important; }
:root:not([data-nope]) .em-row .em-dom, :root:not([data-nope]) .sheet-wrap.modal .em-row .em-dom { padding-left: 3px !important;
  background: transparent !important; color: var(--accent); font-weight: 500; border: 0 !important; box-shadow: none !important; }
.srch-ic svg { width: 17px; height: 17px; }
.srch-ic.srch-av { font: 700 12.5px var(--font); letter-spacing: .02em; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.srch-ic.k-devices { color: #e9a43d; } .srch-ic.k-sims { color: #4fd0ee; } .srch-ic.k-emails, .srch-ic.k-syrian_emails { color: #6fa8ff; }
.srch-ic.k-ext { color: #b28cff; } .srch-ic.k-whatsapp, .srch-ic.k-wa_msgs { color: #25d366; } .srch-ic.k-teams, .srch-ic.k-people { color: #2ec9a3; } .srch-ic.k-leads { color: #f07c6a; }

/* ---------- company structure: left-to-right tree (each department's teams stacked, any size fits) ---------- */
.oc, .oc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: center; }
.oc li { position: relative; display: flex; flex-direction: row; align-items: center; padding: 7px 0 7px 36px; }
.oc > li { padding: 0; }
.oc ul { position: relative; padding: 0; margin-left: 40px; }
/* elbow lines */
.oc li::before { content: ""; position: absolute; left: 0; top: 50%; width: 36px; height: 0; border-top: 2px solid var(--oc-line); border-left: 0; border-radius: 0; }
.oc li::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0; height: auto; border-left: 2px solid var(--oc-line); border-top: 0; border-radius: 0; }
.oc li:first-child::after { top: 50%; border-radius: 0; }
.oc li:last-child::after { bottom: 50%; }
.oc li:only-child::after { display: none; }
.oc li:only-child::before, .oc li:first-child::before, .oc li:last-child::before { display: block; border: 0; border-top: 2px solid var(--oc-line); border-radius: 0; }
.oc li:only-child { padding-top: 7px; }
.oc > li::before, .oc > li::after { display: none !important; }
.oc ul::before { content: ""; position: absolute; left: -40px; top: 50%; width: 40px; height: 0; border-top: 2px solid var(--oc-line); border-left: 0; }
.oc > li > ul::before, .oc ul:has(> li:only-child)::before { height: 0; }
.oc li.folded > ul { display: none; }
/* the boxes: compact cards, text on the left */
.oc-box { width: 236px; padding: 10px 40px 10px 14px; text-align: left; align-items: flex-start; gap: 2px; border-radius: 14px; }
.oc-box.dept { border-top: 1px solid var(--line); border-left: 4px solid var(--accent); }
.oc-box.keep { border-left: 4px solid #2ec9a3; }
.oc-box.root { width: 210px; padding: 16px 18px; align-items: flex-start; }
.oc-top { position: absolute; top: 8px; right: 10px; margin: 0; }
.oc-name { font-size: 14px; padding-right: 4px; }
.oc-nums { justify-content: flex-start; }
.oc-warn { top: 8px; right: 8px; left: auto; }
.oc-box:has(.oc-top .av) .oc-warn { right: auto; left: -8px; top: -8px; }
.oc-fold { top: 50%; bottom: auto; left: auto; right: -13px; transform: translateY(-50%); min-width: 26px; height: 26px; border-color: var(--pop-solid); }
.oc-fold::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translateY(-1px); transition: transform .15s; }
.oc li.folded > .oc-box .oc-fold::after { transform: rotate(135deg) translateY(1px); }
.oc-box:hover, .oc-box:focus-visible { transform: translateX(2px); }
/* find */
.oc-tools { gap: 8px; }
.oc-find { width: min(320px, 100%); height: 36px; padding: 0 12px; border-radius: 10px; }
.oc-gap { flex: 1; }
.oc-zoom { display: inline-flex; gap: 6px; }
.oc.finding .oc-box:not(.hit):not(.root) { opacity: .32; }
.oc .oc-box.hit { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent), 0 14px 30px -16px var(--accent); opacity: 1; }
.oc-viewport { height: min(74vh, 760px); }
@media (max-width: 640px) { .oc-box { width: 200px; } .oc li { padding-left: 24px; } .oc li::before { width: 24px; } .oc ul { margin-left: 28px; } .oc ul::before { left: -28px; width: 28px; } }

/* ---------- campaigns: live agents next to the queue cards ---------- */
.cq-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.cq-split > .cq-grid { margin-bottom: 0; }
.ag-panel { position: sticky; top: calc(var(--hdr-h, 72px) + 12px); max-height: calc(100vh - var(--hdr-h, 72px) - 28px); overflow-y: auto;
  border: 1px solid var(--line); border-radius: 18px; background: var(--pop-solid); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.ag-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; border-bottom: 1px solid var(--line); }
.ag-head b { font: 700 12px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ag-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: #2bb673; font-weight: 600; }
.ag-live i { width: 7px; height: 7px; border-radius: 50%; background: #2bb673; animation: agPulse 1.6s ease-in-out infinite; }
@keyframes agPulse { 50% { opacity: .3; } }
.ag-q { border-radius: 12px; border: 1px solid transparent; }
.ag-q[open] { border-color: var(--line); background: color-mix(in srgb, var(--ink) 3%, transparent); }
.ag-q > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 10px; cursor: pointer; border-radius: 12px; user-select: none; }
.ag-q > summary::-webkit-details-marker { display: none; }
.ag-q > summary:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ag-qn { font: 700 13.5px var(--font-display); color: var(--accent); }
.ag-qt { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: .04em; }
.ag-cnt { font-size: 12px; color: var(--muted); } .ag-cnt b { color: #2bb673; font-size: 13.5px; }
.ag-chev { width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin: 0 2px 0 4px; }
.ag-q[open] .ag-chev { transform: rotate(45deg); }
.ag-list { list-style: none; margin: 0; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.ag-list li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 5px 4px; font-size: 13px; border-radius: 8px; }
.ag-list li:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.ag-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.ag-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.ag-ext { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ag-st { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.ag-free .ag-dot { background: #2bb673; box-shadow: 0 0 0 3px rgba(43, 182, 115, .18); } .ag-free .ag-st { color: #2bb673; background: rgba(43, 182, 115, .12); }
.ag-ring .ag-dot { background: #4fd0ee; animation: agPulse .8s ease-in-out infinite; } .ag-ring .ag-st { color: #4fd0ee; background: rgba(79, 208, 238, .12); }
.ag-call .ag-dot { background: #b28cff; } .ag-call .ag-st { color: #b28cff; background: rgba(178, 140, 255, .14); }
.ag-pause .ag-dot { background: #e9a43d; } .ag-pause .ag-st { color: #e9a43d; background: rgba(233, 164, 61, .14); }
.ag-list.off li { opacity: .62; } .ag-list.off li { grid-template-columns: 10px minmax(0, 1fr) auto; }
.ag-sub { padding: 6px 12px 2px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ag-none { margin: 0; padding: 4px 12px 10px; font-size: 12px; color: var(--muted); }
.ag-q.stale .ag-list { opacity: .55; }
@media (max-width: 1200px) { .cq-split { grid-template-columns: 1fr; } .ag-panel { position: static; max-height: none; } }
.otp-rm { display: inline-flex; margin: 0 0 0 6px; vertical-align: middle; }
.ib.danger-ib { color: #e5484d; } .ib.danger-ib:hover { background: rgba(229, 72, 77, .12); border-color: rgba(229, 72, 77, .5); }
.otp-cell { white-space: nowrap; }
.ag-off > summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 12px 8px; border-radius: 8px; user-select: none; }
.ag-off > summary::-webkit-details-marker { display: none; }
.ag-off > summary:hover { color: var(--ink); }
.ag-off > summary .ag-chev { width: 6px; height: 6px; margin-left: 2px; }
.ag-off[open] > summary .ag-chev { transform: rotate(45deg); }
.otp-qr-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.ok-t { color: #2bb673; font-weight: 600; } .err-t { color: #e5484d; font-weight: 600; }
.acc-dl dd:has(.otp-rm), .otp-cell { flex-wrap: nowrap !important; white-space: nowrap; }
.otp-rm { flex: none; }
/* free-agent seats: green in both themes, a soft glow only in dark */
.cq-seats { max-width: 196px; }
:root:not([data-nope]) .cq-seats i.on { background: #22c27a; }
:root[data-theme="light"] .cq-seats i.on { box-shadow: 0 0 0 2px rgba(34, 194, 122, .18); }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .cq-seats i.on { box-shadow: 0 0 0 2px rgba(34, 194, 122, .18); } }
.pw-msg { color: #e5484d; font-size: 12px; line-height: 1.4; }
.pw-msg:empty { display: none; }
.field.pw-bad > label { color: #e5484d; }
.field.pw-bad input[data-pw-rule] { border-color: #e5484d !important; box-shadow: 0 0 0 3px rgba(229, 72, 77, .18) !important; }
.field.pw-bad .pw-wrap { border-color: #e5484d; }
.tfa-req { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); margin: 0 0 10px; }
.tfa-tx { flex: 1; display: flex; flex-direction: column; gap: 2px; } .tfa-tx small { color: var(--muted); font-size: 12px; }
.tfa-sw { appearance: none; position: relative; width: 46px; height: 26px; border-radius: 999px; border: 0; cursor: pointer; flex: none;
  background: color-mix(in srgb, var(--ink) 18%, transparent); transition: background .15s; }
.tfa-sw i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s; }
.tfa-sw.on { background: #2bb673; } .tfa-sw.on i { transform: translateX(20px); }

/* header: the side columns never shrink below their content - the section bar gives way instead (no overlap) */
@media (min-width: 901px) {
  .hdr { grid-template-columns: minmax(max-content, 1fr) minmax(0, max-content) minmax(max-content, 1fr); }
  .hdr-nav { min-width: 0; }
  .hdr-who b, .hdr-who small { white-space: nowrap; }
}
@media (min-width: 901px) and (max-width: 1500px) { .hdr-nav a { padding: 8px 11px; gap: 6px; } .hdr { gap: 10px; padding-inline: 16px; } }
@media (min-width: 901px) and (max-width: 1400px) { .hdr-nav a svg, .hdr-nav a .ys-logo { display: none; } }
/* the name chip always shows the name (shortened when long); only very narrow headers fall back to the round photo */
@media (min-width: 901px) {
  .hdr-me .hdr-who { display: flex; min-width: 0; max-width: 150px; }
  .hdr-me .hdr-who b, .hdr-me .hdr-who small { overflow: hidden; text-overflow: ellipsis; }
  .hdr-me .hdr-user { min-width: 0; padding: 4px 14px 4px 4px; }
}
@media (min-width: 901px) and (max-width: 1080px) {
  .hdr-me .hdr-who { display: none; }
  .hdr-me .hdr-user { padding: 3px; }
}
@media (min-width: 901px) and (max-width: 1080px) { .hdr-nav a { padding: 7px 8px; font-size: 13px; } }

/* ---------- confirm pop-up (uiConfirm): the dashboard's own, same glass as the centred pop-ups ---------- */
dialog.uic { padding: 0; border: 0; outline: none; background: transparent; box-shadow: none; color: var(--ink);
  max-width: calc(100vw - 32px); width: 440px; overflow: visible; }
dialog.uic::backdrop { background: rgba(2, 10, 20, .42); -webkit-backdrop-filter: blur(6px) saturate(120%); backdrop-filter: blur(6px) saturate(120%); }
.uic-box { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 22px 22px 18px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .02) 30%),
    radial-gradient(120% 60% at 0% 0%, rgba(57, 192, 224, .14), transparent 60%), var(--pop-glass, var(--surface));
  -webkit-backdrop-filter: blur(36px) saturate(185%) brightness(1.04); backdrop-filter: blur(36px) saturate(185%) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 30px 80px -30px rgba(0, 8, 18, .6), inset 0 1px 0 rgba(255, 255, 255, .22); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .uic-box { background: var(--surface); } }
.uic-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 20px; }
.uic-ic::before { content: "?"; }
.uic.risky .uic-ic { background: var(--r-bg); color: var(--r); }
.uic.risky .uic-ic::before { content: "!"; }
.uic-main { min-width: 0; align-self: center; }
.uic-t { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.uic-msg { margin-top: 6px; color: var(--muted); font-size: 13.5px; white-space: pre-line; overflow-wrap: anywhere; }
.uic-acts { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.uic-acts .btn { min-width: 96px; justify-content: center; }
.uic-acts .btn.danger-btn { background: var(--r); border-color: var(--r); color: #fff; }
:root[data-theme="dark"] .uic-acts .btn.danger-btn { color: #2a0d0b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .uic-acts .btn.danger-btn { color: #2a0d0b; } }
dialog.uic[open] .uic-box { animation: uicIn .16s ease-out both; }
@keyframes uicIn { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.uic[open] .uic-box { animation: none; } }
@media (max-width: 480px) { .uic-acts .btn { flex: 1 1 0; } }
/* ---------- "Sync now" (templates/_sync.html): one look on every page that has an integration ---------- */
.sync-btn svg { transition: transform .3s; }
.sync-btn:not(:disabled):hover svg { transform: rotate(-60deg); }
.sync-btn.spin svg { animation: bxSpin 1s linear infinite; }
.sync-btn:disabled { opacity: .6; cursor: default; }
.sync-btn.spin:disabled { opacity: 1; }

/* ---------- aliases of a Google account: Edit / Remove on each one, Add at the end ---------- */
.acc-alias { gap: 6px; }
.acc-alias .al-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 32px; }
.acc-alias .al-row > .al-view:first-child { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.acc-alias .al-addr { overflow-wrap: anywhere; }
.al-acts { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.al-btn { appearance: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 8px;
  border-radius: 8px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s; }
.al-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.al-btn:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.al-btn-rm { color: var(--r); }
.al-btn-rm:hover { background: var(--r-bg); border-color: color-mix(in srgb, var(--r) 45%, transparent); }
.al-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.al-edit { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.al-edit[hidden], .al-view[hidden] { display: none !important; }
.al-edit input { flex: 1 1 220px; min-width: 0; }
.acc-alias .al-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; padding-top: 8px;
  border-top: 1px dashed var(--line); }
.acc-alias .al-add input { flex: 1 1 200px; min-width: 0; height: 32px; }
.al-btn-add { height: 32px; }
.al-field .acc-alias { margin-top: 2px; }
@media (max-width: 520px) { .al-btn span { display: none; } .al-btn { padding: 0 8px; } .al-btn-add span { display: inline; } }

/* ---------- app users pop-up (_user_panel.html): same sections as the other editors ---------- */
.uf .uf-photo { margin-bottom: 14px; }
.uf .pf-pic { width: 72px; height: 72px; font: 600 26px var(--font); background: var(--accent-soft); color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.uf .pf-cam svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; }
.uf-who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.uf-who b { font: 600 17px var(--font); overflow-wrap: anywhere; }
.uf-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.uf .pf-teams { max-height: 220px; background: color-mix(in srgb, var(--surface) 50%, transparent); border-radius: 12px; }
.uf-active { flex-direction: row !important; align-items: center; justify-content: space-between; gap: 14px !important;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.uf-active .switch { flex: 0 0 auto; }
.tfa-tx { display: flex; flex-direction: column; gap: 2px; }
.tfa-tx small { color: var(--muted); font-size: 12px; font-weight: 400; }
.uf-warn { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--y-bg); color: var(--y); font-size: 13px; }
.uf-note { display: block; margin-top: 8px; }
.uf-gen { align-self: flex-start; margin-top: 2px; }
.uf-after { padding-top: 0; display: flex; flex-direction: column; gap: 14px; }
.uf-2fa-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.uf-2fa-row .pf-2fa { flex: 1 1 auto; }
.uf-end { justify-content: flex-end; }
.pf-2fa-new { margin-top: 10px; }
@media (max-width: 560px) { .uf .rf-grid { grid-template-columns: 1fr; } }
/* the solid Save / Cancel bar must win over the older see-through dark-mode strip (text scrolled under it showed through) */
:root:not([data-nope]) .sheet-wrap .sheet .rf-foot, :root:not([data-nope]) .sheet-wrap .sheet .cqp-foot {
  background: var(--pop-solid) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* =====================================================================================================
   POP-UP THEME - one set of colours for every pop-up (centred pop-ups, the profile panel, dialogs,
   search, menus) in light AND dark. Earlier layers used white-on-glass values that only worked in
   dark mode (inputs vanished in light). Everything below reads these tokens; it comes last so it wins.
   ===================================================================================================== */
:root {
  --pp-bg: rgba(250, 252, 254, .9);                 /* the pop-up glass */
  --pp-head: rgba(250, 252, 254, .97);              /* title bar / tab bar */
  --pp-line: rgba(14, 52, 82, .12);                 /* outer + dividing lines */
  --pp-card: rgba(255, 255, 255, .78);              /* section cards inside */
  --pp-card-line: rgba(14, 52, 82, .1);
  --pp-field: #ffffff;                              /* inputs, selects, text areas */
  --pp-field-line: rgba(14, 52, 82, .2);
  --pp-field-hover: rgba(14, 52, 82, .34);
  --pp-ph: #8394a1;                                 /* placeholder */
  --pp-btn: rgba(255, 255, 255, .92);               /* small buttons (copy, show, quick actions) */
  --pp-btn-line: rgba(14, 52, 82, .14);
  --pp-back: rgba(10, 30, 45, .3);                  /* the page behind, dimmed */
  --pp-shadow: 0 30px 80px -28px rgba(10, 42, 59, .45), 0 2px 8px -4px rgba(10, 42, 59, .12);
  --pp-hi: rgba(255, 255, 255, .9);                 /* top inner highlight */
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --pp-bg: rgba(10, 28, 47, .88); --pp-head: rgba(11, 30, 50, .97); --pp-line: rgba(150, 205, 240, .14);
  --pp-card: rgba(255, 255, 255, .045); --pp-card-line: rgba(150, 205, 240, .12);
  --pp-field: rgba(3, 14, 26, .55); --pp-field-line: rgba(150, 205, 240, .2); --pp-field-hover: rgba(150, 205, 240, .34); --pp-ph: #7d96a6;
  --pp-btn: rgba(255, 255, 255, .06); --pp-btn-line: rgba(150, 205, 240, .16);
  --pp-back: rgba(2, 10, 20, .5); --pp-shadow: 0 40px 90px -30px rgba(0, 6, 14, .85), 0 0 0 1px rgba(0, 0, 0, .25); --pp-hi: rgba(180, 230, 255, .1); } }
:root[data-theme="dark"] {
  --pp-bg: rgba(10, 28, 47, .88); --pp-head: rgba(11, 30, 50, .97); --pp-line: rgba(150, 205, 240, .14);
  --pp-card: rgba(255, 255, 255, .045); --pp-card-line: rgba(150, 205, 240, .12);
  --pp-field: rgba(3, 14, 26, .55); --pp-field-line: rgba(150, 205, 240, .2); --pp-field-hover: rgba(150, 205, 240, .34); --pp-ph: #7d96a6;
  --pp-btn: rgba(255, 255, 255, .06); --pp-btn-line: rgba(150, 205, 240, .16);
  --pp-back: rgba(2, 10, 20, .5); --pp-shadow: 0 40px 90px -30px rgba(0, 6, 14, .85), 0 0 0 1px rgba(0, 0, 0, .25); --pp-hi: rgba(180, 230, 255, .1); }

/* the pop-up itself: frosted, but solid enough to read (the page only shows through softly) */
html:root:not(#pp) .sheet-wrap .sheet {
  background: var(--pp-bg) !important; border: 1px solid var(--pp-line) !important; color: var(--ink);
  -webkit-backdrop-filter: blur(28px) saturate(160%) !important; backdrop-filter: blur(28px) saturate(160%) !important;
  box-shadow: var(--pp-shadow), inset 0 1px 0 var(--pp-hi) !important; }
html:root:not(#pp) .sheet-wrap .sheet-back { background: var(--pp-back) !important;
  -webkit-backdrop-filter: blur(3px) !important; backdrop-filter: blur(3px) !important; }
html:root:not(#pp) .sheet-wrap .sheet-head, html:root:not(#pp) .sheet-wrap .cqp-tabs {
  background: var(--pp-head) !important; border-bottom: 1px solid var(--pp-line) !important;
  -webkit-backdrop-filter: blur(20px) !important; backdrop-filter: blur(20px) !important; }
html:root:not(#pp) .sheet-wrap .sheet-head h2 { color: var(--ink); }

/* section cards inside */
html:root:not(#pp) .sheet-wrap .rf-sec, html:root:not(#pp) .sheet-wrap .acc-sec, html:root:not(#pp) .sheet-wrap .emp-box, html:root:not(#pp) .sheet-wrap .ed-sec,
html:root:not(#pp) .sheet-wrap .cqp-block, html:root:not(#pp) .sheet-wrap .cqp-step, html:root:not(#pp) .sheet-wrap .cqp-danger, html:root:not(#pp) .sheet-wrap .cqp-note,
html:root:not(#pp) .sheet-wrap .tfa-req, html:root:not(#pp) .sheet-wrap .uf-active, html:root:not(#pp) .sheet-wrap .pf-teams {
  background: var(--pp-card) !important; border: 1px solid var(--pp-card-line) !important; box-shadow: none !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html:root:not(#pp) .sheet-wrap .cqp-danger { border-color: color-mix(in srgb, var(--r) 35%, transparent) !important; }

/* inputs: always a clear box with an edge, in both themes */
html:root:not(#pp) .sheet-wrap input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]),
html:root:not(#pp) .sheet-wrap select, html:root:not(#pp) .sheet-wrap textarea {
  background-color: var(--pp-field) !important; border: 1px solid var(--pp-field-line) !important; color: var(--ink) !important; }
html:root:not(#pp) .sheet-wrap input:not([type=checkbox]):not([type=radio]):hover, html:root:not(#pp) .sheet-wrap select:hover, html:root:not(#pp) .sheet-wrap textarea:hover {
  border-color: var(--pp-field-hover) !important; }
html:root:not(#pp) .sheet-wrap input:not([type=checkbox]):not([type=radio]):focus, html:root:not(#pp) .sheet-wrap select:focus, html:root:not(#pp) .sheet-wrap textarea:focus {
  border-color: var(--accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent) !important; outline: none; }
html:root:not(#pp) .sheet-wrap input::placeholder, html:root:not(#pp) .sheet-wrap textarea::placeholder { color: var(--pp-ph) !important; opacity: 1; }
html:root:not(#pp) .sheet-wrap input[readonly] { background-color: color-mix(in srgb, var(--pp-field) 55%, transparent) !important; color: var(--muted) !important; }
html:root:not(#pp) .sheet-wrap select option { background: var(--pop-solid); color: var(--ink); }
/* the email field (name @ domain) is one box */
html:root:not(#pp) .sheet-wrap .em-row { background: var(--pp-field) !important; border: 1px solid var(--pp-field-line) !important; }
html:root:not(#pp) .sheet-wrap .em-row input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]) {
  background: transparent !important; border: 0 !important; box-shadow: none !important; }
html:root:not(#pp) .sheet-wrap .em-row:focus-within { border-color: var(--accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
html:root:not(#pp) .sheet-wrap .em-row .em-dom { background: color-mix(in srgb, var(--accent) 8%, transparent) !important; }

/* small buttons inside pop-ups */
html:root:not(#pp) .sheet-wrap .acc-qa .qa, html:root:not(#pp) .sheet-wrap .ib, html:root:not(#pp) .sheet-wrap button.reveal, html:root:not(#pp) .sheet-wrap button.otp,
html:root:not(#pp) .sheet-wrap .al-btn {
  background: var(--pp-btn) !important; border: 1px solid var(--pp-btn-line) !important; box-shadow: none !important; }
html:root:not(#pp) .sheet-wrap .acc-qa .qa:hover, html:root:not(#pp) .sheet-wrap .ib:hover, html:root:not(#pp) .sheet-wrap button.reveal:hover,
html:root:not(#pp) .sheet-wrap button.otp:hover, html:root:not(#pp) .sheet-wrap .al-btn:hover {
  background: var(--accent-soft) !important; border-color: color-mix(in srgb, var(--accent) 40%, transparent) !important; }
html:root:not(#pp) .sheet-wrap .al-btn-rm:hover { background: var(--r-bg) !important; border-color: color-mix(in srgb, var(--r) 40%, transparent) !important; }
html:root:not(#pp) .sheet-wrap button.reveal.shown { background: var(--accent-soft) !important; border-color: var(--accent) !important; }
html:root:not(#pp) .sheet-wrap .btn:not(.primary):not(.ghost-danger) { background: var(--pp-btn); border-color: var(--pp-btn-line); color: var(--ink); }

/* the other floating pop-ups use the same glass */
html:root:not(#pp) .cq-dlg, html:root:not(#pp) .srch, html:root:not(#pp) .col-menu, html:root:not(#pp) .pl-pop, html:root:not(#pp) .pk-list {
  background: var(--pp-bg) !important; border: 1px solid var(--pp-line) !important; color: var(--ink);
  box-shadow: var(--pp-shadow) !important; -webkit-backdrop-filter: blur(28px) saturate(160%) !important; backdrop-filter: blur(28px) saturate(160%) !important; }
html:root:not(#pp) .cq-dlg::backdrop { background: var(--pp-back); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
html:root:not(#pp) .srch-back { background: var(--pp-back) !important; }
html:root:not(#pp) .uic-box { background: var(--pp-bg) !important; border: 1px solid var(--pp-line) !important; box-shadow: var(--pp-shadow), inset 0 1px 0 var(--pp-hi) !important; }
html:root:not(#pp) dialog.uic::backdrop { background: var(--pp-back); }
/* day chips (campaign hours): an "off" day is a clear outline chip in both themes */
html:root:not(#pp) .sheet-wrap .cq-days input:not(:checked) + span { background: var(--pp-btn) !important; border-color: var(--pp-btn-line) !important; color: var(--muted) !important; }
html:root:not(#pp) .sheet-wrap .cq-days input:not(:checked) + span:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent) !important; color: var(--ink) !important; }
/* fields inside the <dialog> pop-ups (Add leads ...) look like the ones in the other pop-ups */
html:root:not(#pp) .cq-dlg input:not([type=checkbox]):not([type=radio]):not([type=file]), html:root:not(#pp) .cq-dlg select, html:root:not(#pp) .cq-dlg textarea {
  background-color: var(--pp-field) !important; border: 1px solid var(--pp-field-line) !important; color: var(--ink) !important; }
html:root:not(#pp) .cq-dlg input:focus, html:root:not(#pp) .cq-dlg select:focus, html:root:not(#pp) .cq-dlg textarea:focus {
  border-color: var(--accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent) !important; outline: none; }
html:root:not(#pp) .cq-dlg textarea::placeholder { color: var(--pp-ph) !important; }
/* search matches: readable highlight in both themes */
html:root:not(#pp) .srch-tx mark { background: rgba(242, 181, 58, .38); color: #5a3a00; }
@media (prefers-color-scheme: dark) { html:root:not(#pp):not([data-theme="light"]) .srch-tx mark { background: rgba(242, 192, 99, .22); color: #ffd98a; } }
html:root:not(#pp)[data-theme="dark"] .srch-tx mark { background: rgba(242, 192, 99, .22); color: #ffd98a; }

/* ---------- Permissions tab ---------- */
.pm-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.pm-n { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.pm-card { padding: 0; overflow: hidden; }
.pm-table { width: 100%; }
.pm-table td small { display: block; font-size: 12px; margin-top: 2px; }
.pm-table .pm-c { text-align: center; width: 130px; }
.pm-table tr.pm-g th { position: static; text-align: left; padding: 14px 14px 6px; font: 600 11px var(--font); letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); border-bottom: 1px solid var(--line); }
.pm-table tr.pm-sub td:first-child { padding-left: 34px; }
.pm-table tr.pm-sub td:first-child b { font-weight: 500; }
.pm-sw { vertical-align: middle; }
.pm-sw.pm-changed::after { content: ""; position: absolute; top: -3px; right: -5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--y); box-shadow: 0 0 0 2px var(--surface); }
.pm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--y); margin-right: 4px; vertical-align: middle; }
.pm-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line);
  background: var(--surface); z-index: 2; }
.pm-pick { display: flex; align-items: center; gap: 10px; padding: 16px 16px 0; flex-wrap: wrap; }
.pm-pick select { min-width: min(420px, 100%); height: 40px; }
.pm-note { padding: 6px 16px 10px; margin: 0; }
.pm-sel { height: 34px; min-width: 190px; }
.pm-sel.pm-own { border-color: var(--accent); color: var(--accent); font-weight: 600; }
@media (max-width: 640px) { .pm-table .pm-c { width: 70px; } .pm-sel { min-width: 140px; } }
/* Roles: built-in + added ones */
.pm-roles { padding: 14px 16px 16px; margin-bottom: 16px; overflow: visible; }
.pm-roles-head h2 { margin: 0 0 2px; font-size: 16px; }
.pm-roles-head p { margin: 0 0 10px; }
.pm-rlist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.pm-r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; }
.pm-rform { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.pm-rform input[name="name"] { height: 36px; min-width: 160px; flex: 1 1 160px; max-width: 280px; }
.pm-rform select { height: 36px; min-width: 0; max-width: 100%; }
.pm-radd { padding-top: 10px; border-top: 1px dashed var(--line); }
.pm-base { display: block; font-size: 10.5px; font-weight: 500; }

/* Sync in the employee pop-up header and on the full employee page */
.acc-head form[data-sync] { margin-left: auto; }
.acc-head form[data-sync] + .btn { margin-left: 0; }
.emp-page-acts { display: flex; justify-content: flex-end; margin-bottom: -34px; position: relative; z-index: 1; }

/* =====================================================================================================
   TEAMS TAB - list rows on one line, quick buttons, rename in place, drag & drop, clearer chart boxes
   ===================================================================================================== */
:root { --tm-card: #ffffff; --tm-card-2: #f4f8fb; --tm-line: rgba(14, 52, 82, .14); --tm-ink2: #45596a; --tm-branch: rgba(11, 117, 147, .32); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --tm-card: rgba(18, 44, 66, .92); --tm-card-2: rgba(24, 54, 80, .9); --tm-line: rgba(150, 205, 240, .18); --tm-ink2: #a9c0cf; --tm-branch: rgba(57, 192, 224, .38); } }
:root[data-theme="dark"] {
  --tm-card: rgba(18, 44, 66, .92); --tm-card-2: rgba(24, 54, 80, .9); --tm-line: rgba(150, 205, 240, .18); --tm-ink2: #a9c0cf; --tm-branch: rgba(57, 192, 224, .38); }

/* ---- list: one row per team */
html:root .org-list .tree { margin-top: 6px; }
html:root .org-list .tree ul { margin-left: 16px; padding-left: 16px; border-left: 2px solid var(--tm-branch); }
html:root .org-list .tree li { padding: 3px 0; }
html:root .org-list .tree ul > li::before { left: -16px; top: 24px; width: 14px; border-top: 2px solid var(--tm-branch); }
html:root .org-list .tn-card { display: grid; grid-template-columns: 26px minmax(160px, 1.3fr) minmax(0, 2fr) auto auto; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 12px; background: var(--tm-card); border: 1px solid var(--tm-line); max-width: none; cursor: pointer; }
html:root .org-list .tn-card:hover, html:root .org-list .tn-card:focus-visible { border-color: var(--accent); }
html:root .org-list .tn-card.hit { border-color: var(--y); box-shadow: 0 0 0 3px color-mix(in srgb, var(--y) 30%, transparent); }
.tn-fold-sp { width: 26px; }
.org-list .tn-fold { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--tm-line); background: var(--tm-card-2); color: var(--ink); cursor: pointer; transition: transform .15s; }
.org-list .tn-main { min-width: 0; }
.org-list .tn-name { margin: 0; font: 600 14px var(--font); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink); }
.org-list .tn-name .chip { font-size: 10.5px; padding: 0 6px; }
.org-list .tn-heads { margin: 1px 0 0; font-size: 12px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-list .tn-meta { gap: 4px 6px; justify-content: flex-start; }
.org-list .tn-meta .tst { background: var(--tm-card-2); border-color: var(--tm-line); color: var(--tm-ink2); font-size: 11.5px; padding: 1px 7px; }
.org-list .tn-meta .tst.warn { color: var(--y); border-color: color-mix(in srgb, var(--y) 45%, transparent); }
.org-list .tn-leaders { display: flex; }
.org-list .tn-leaders .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--tm-card); }
.tn-acts { display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.tn-card:hover .tn-acts, .tn-card:focus-within .tn-acts, .oc-box:hover .tn-acts { opacity: 1; }
@media (hover: none) { .tn-acts { opacity: 1; } }
.tn-acts .ib { width: 28px; height: 28px; }
.tn-acts .ib svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tl-hint { margin: 6px 2px 8px; }
.tn-root { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 12px; font: 600 14px var(--font);
  background: color-mix(in srgb, var(--accent) 12%, var(--tm-card)); border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); color: var(--ink); cursor: pointer; }
@media (max-width: 900px) {
  html:root .org-list .tn-card { grid-template-columns: 26px 1fr auto; }
  html:root .org-list .tn-card .tn-meta { grid-column: 2 / -1; }
  html:root .org-list .tn-card .tn-leaders { display: none; }
  html:root .org-list .tn-card .tn-acts { grid-column: 3; grid-row: 1; }
}

/* ---- chart: readable boxes in both themes */
html:root .oc-box { background: var(--tm-card) !important; border: 1px solid var(--tm-line) !important; color: var(--ink); }
html:root .oc-box.dept { background: var(--tm-card-2) !important; }
html:root .oc-box:hover, html:root .oc-box:focus-visible { border-color: var(--accent) !important; }
html:root .oc-box .oc-name { color: var(--ink); overflow-wrap: anywhere; }
html:root .oc-box .oc-nums { color: var(--tm-ink2); }
html:root .oc-box.keep { border-style: dashed !important; }
html:root .oc li::before, html:root .oc li::after, html:root .oc ul::before { border-color: var(--tm-branch) !important; }
.oc-dnd-hint { white-space: nowrap; }
@media (max-width: 900px) { .oc-dnd-hint { display: none; } }

/* ---- rename in place */
.tn-rename { font: 600 14px var(--font); height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--accent); background: var(--surface);
  color: var(--ink); width: min(260px, 100%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---- drag & drop */
.team-dragging [data-team] { transition: box-shadow .12s, border-color .12s, transform .12s; }
[data-team].dragging { opacity: .45; }
[data-team].drop-ok { border-color: var(--accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent) !important; transform: scale(1.02); }
.tn-card[draggable="true"], .oc-box[draggable="true"] { cursor: grab; }
.tn-card[draggable="true"]:active, .oc-box[draggable="true"]:active { cursor: grabbing; }

/* email pop-up: @clinicprof.com / Syrian · Gmail tabs */
.em-tabs { display: flex; gap: 4px; padding: 10px 22px 0; border-bottom: 1px solid var(--pp-line, var(--line)); background: var(--pp-head, var(--surface)); position: sticky; top: 61px; z-index: 3; }
.em-tab { appearance: none; border: 0; background: none; font: 600 13.5px var(--font); color: var(--muted); padding: 9px 14px 10px; border-bottom: 2px solid transparent;
  margin-bottom: -1px; cursor: pointer; border-radius: 10px 10px 0 0; display: inline-flex; gap: 6px; align-items: center; }
.em-tab:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.em-tab.on { color: var(--accent); border-bottom-color: var(--accent); cursor: default; }
.em-tab small { font-weight: 500; font-size: 11px; color: var(--accent); }

/* Employee roles pop-up */
.jr > p { margin: 0 0 12px; }
.jr-add { display: flex; gap: 8px; margin-bottom: 12px; }
.jr-add input { flex: 1; min-width: 0; height: 38px; }
.jr-find { width: 100%; height: 36px; margin-bottom: 8px; }
.jr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.jr-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; }
.jr-form input[name="name"] { flex: 1 1 160px; min-width: 0; height: 34px; }
.jr-n { min-width: 84px; }

/* =====================================================================================================
   EMPLOYEE TRACKING filters - pick several per filter, then Apply (same look in light and dark)
   ===================================================================================================== */
html:root .ax-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(150px, .8fr) auto; gap: 12px 14px;
  align-items: end; padding: 14px 18px; overflow: visible; position: relative; z-index: 5; }
.ax-filters .ax-custom { grid-column: 1 / -2; }
.ax-filters .ax-period select { width: 100%; min-width: 0; max-width: none; }
.ax-pick { min-width: 0; }
.ax-pick summary { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; }
.ax-pick summary b { min-width: 0; max-width: none; width: 100%; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 13.5px;
  color: var(--ink); background: var(--surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-pick.on summary b { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ax-pick[open] summary b { border-color: var(--accent); }
.ax-pick .ls-pick-box { width: min(340px, 92vw); display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28); }
.ax-pick .ls-pick-box input[type=search] { width: 100%; }
.ax-pick-acts { display: flex; justify-content: space-between; }
.ax-filters .ax-pick .ls-pick-list label { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0;
  font-size: 13.5px; font-weight: 400; color: var(--ink); padding: 5px 6px; border-radius: 8px; cursor: pointer; }
.ax-filters .ax-pick .ls-pick-list label:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ax-filters .ax-pick .ls-pick-list label:has(input:checked) { background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 500; }
.ax-filters .ax-pick .ls-pick-list label[hidden] { display: none; }
.ax-f-acts { display: flex; gap: 8px; align-items: center; justify-self: end; }
html:root .ax-filters .ax-reset { margin: 0; }
.ax-filters.dirty .ax-apply { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); animation: ax-nudge 1.6s ease-in-out infinite; }
@keyframes ax-nudge { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 10%, transparent); } }
@media (prefers-reduced-motion: reduce) { .ax-filters.dirty .ax-apply { animation: none; } }
@media (max-width: 1100px) { html:root .ax-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ax-f-acts { grid-column: 1 / -1; } .ax-filters .ax-custom { grid-column: 1 / -1; } }
@media (max-width: 640px) { html:root .ax-filters { grid-template-columns: 1fr; padding: 12px; } .ax-f-acts { justify-self: stretch; } .ax-f-acts .btn { flex: 1; justify-content: center; } }

/* =====================================================================================================
   TASK COUNT - numbers centred under their headers, big and colour-coded pills (light and dark)
   ===================================================================================================== */
:root { --tc-na: #b97800; --tc-td: #1f68c2; --tc-od: #cf3534; --tc-dn: #128a5f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tc-na: #f3b53f; --tc-td: #6aa8f0; --tc-od: #ff7b7a; --tc-dn: #4fd3a0; } }
:root[data-theme="dark"] { --tc-na: #f3b53f; --tc-td: #6aa8f0; --tc-od: #ff7b7a; --tc-dn: #4fd3a0; }
table.tc-big th.n, table.tc-big td.n { text-align: center; width: 132px; min-width: 104px; padding-inline: 8px; }
table.tc-big thead th.n { white-space: normal; line-height: 1.25; }
table.tc-big thead th.k-na { color: var(--tc-na); } table.tc-big thead th.k-td { color: var(--tc-td); }
table.tc-big thead th.k-od { color: var(--tc-od); } table.tc-big thead th.k-dn { color: var(--tc-dn); }
table.tc-big tbody td { padding-block: 9px; vertical-align: middle; }
table.tc-big td.n .nv, table.tc-big td.n button.why-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 30px; margin: 0; padding: 0 12px;
  border-radius: 999px; font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em;
  text-decoration: none; color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
table.tc-big td.n .nv::before { display: none; }
table.tc-big td.n .nv.k-na { color: var(--tc-na); background: color-mix(in srgb, var(--tc-na) 15%, transparent); }
table.tc-big td.n .nv.k-td { color: var(--tc-td); background: color-mix(in srgb, var(--tc-td) 15%, transparent); }
table.tc-big td.n .nv.k-od { color: var(--tc-od); background: color-mix(in srgb, var(--tc-od) 15%, transparent); }
table.tc-big td.n .nv.k-dn { color: var(--tc-dn); background: color-mix(in srgb, var(--tc-dn) 15%, transparent); }
table.tc-big td.n button.why-btn:hover { box-shadow: 0 0 0 2px currentColor; background: color-mix(in srgb, currentColor 22%, transparent); }
table.tc-big td.n button.why-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table.tc-big td.n .nz { font-size: 15px; color: color-mix(in srgb, var(--muted) 50%, transparent); }
table.tc-big tr.sum-row td { font-size: 15px; }
table.tc-big tr.sum-row td.n .nv, table.tc-big tr.sum-row td.n button.why-btn { font-size: 17px; height: 34px; min-width: 58px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); }
@media (max-width: 700px) { table.tc-big th.n, table.tc-big td.n { width: 84px; min-width: 76px; } table.tc-big td.n .nv, table.tc-big td.n button.why-btn { font-size: 14px; min-width: 40px; padding: 0 9px; } }
/* the same number style on Observation and Calls; talk time wider */
table.tc-big td.n .nv.tt { min-width: 92px; font-size: 14.5px; }
table.tc-big th.n { color: var(--muted); }
html:root table.tc-big thead th.k-na { color: var(--tc-na); } html:root table.tc-big thead th.k-td { color: var(--tc-td); }
html:root table.tc-big thead th.k-od { color: var(--tc-od); } html:root table.tc-big thead th.k-dn { color: var(--tc-dn); }
/* half-width cards (Observation, Calls): narrower number columns so nothing scrolls sideways */
table.tc-big.tc-tight th.n, table.tc-big.tc-tight td.n { width: auto; min-width: 64px; padding-inline: 5px; }
table.tc-big.tc-tight td.n .nv, table.tc-big.tc-tight td.n .nz { min-width: 40px; padding: 0 9px; font-size: 14.5px; }
table.tc-big.tc-tight td.n .nv.tt { min-width: 76px; font-size: 13.5px; }
table.tc-big.tc-tight thead th.n { font-size: 10.5px; }
/* side-by-side cards never push the page wider than the window: the table scrolls inside its card instead */
.two.ax-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.two.ax-panel[data-panel="calls"] { grid-template-columns: minmax(240px, .75fr) minmax(0, 2fr); }
.two.ax-panel > .card { min-width: 0; }
@media (max-width: 1100px) { .two.ax-panel, .two.ax-panel[data-panel="calls"] { grid-template-columns: minmax(0, 1fr); } }

/* Teams pop-up: members are employee records picked from a list (a typed name still works) */
.tp-m .tp-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tp-m.linked .tp-who input[name=m_name] { background: color-mix(in srgb, var(--accent) 8%, var(--surface)) !important; font-weight: 600; cursor: default; }
.tp-emp { font-size: 11px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 2px; }
.tp-emp.none { color: var(--y); }
.tp-m { align-items: start; } .tp-m .tp-star, .tp-m .tp-del { margin-top: 4px; }
.tp-pick { position: relative; margin: 10px 0 8px; }
.tp-pick > summary { list-style: none; display: inline-flex; cursor: pointer; }
.tp-pick > summary::-webkit-details-marker { display: none; }
.tp-pick-box { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--pop-solid, var(--surface)); box-shadow: 0 14px 34px rgba(0, 0, 0, .18); }
.tp-pick-box input[type=search] { width: 100%; height: 38px; }
.tp-pick-list { max-height: 280px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.tp-pick-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.tp-pick-row:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.tp-pick-row:has(input:checked) { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.tp-pick-row[hidden] { display: none; }
.tp-pick-row span { display: flex; flex-direction: column; min-width: 0; }
.tp-pick-row b { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.tp-pick-row small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-pick-row.left b { color: var(--muted); }
.tp-pick-foot { display: flex; justify-content: space-between; align-items: center; }
.tp-pick-foot .btn:disabled { opacity: .45; cursor: default; box-shadow: none; }

/* Analytics charts fill their card: bigger donut, centred with its legend, larger legend text */
.two.ax-panel > .card { display: flex; flex-direction: column; }
.two.ax-panel > .card > .donut-box { flex: 1; justify-content: center; align-content: center; gap: 28px 36px; padding: 8px 4px 12px; }
.two.ax-panel .donut { width: clamp(200px, 22vw, 290px); height: clamp(200px, 22vw, 290px); }
.two.ax-panel .pie-legend { gap: 10px; min-width: 240px; max-width: 520px; }
.two.ax-panel .pie-legend li { font-size: 14px; grid-template-columns: 14px 1fr auto auto; padding: 4px 0; border-bottom: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); }
.two.ax-panel .pie-legend li:last-child { border-bottom: 0; }
.two.ax-panel .pie-legend .sw { width: 14px; height: 14px; border-radius: 4px; }
.two.ax-panel .pie-legend b { font-size: 15px; font-variant-numeric: tabular-nums; }
.two.ax-panel[data-panel="obs"] .donut-box, .two.ax-panel[data-panel="calls"] .donut-box { flex-direction: column; }
@media (min-width: 1400px) { .two.ax-panel[data-panel="obs"] .donut-box { flex-direction: row; } }

/* agents list: search + state filter on top (they stay while the list refreshes), one sticky column */
.ag-wrap { position: sticky; top: calc(var(--hdr-h, 72px) + 12px); display: flex; flex-direction: column;
  max-height: calc(100vh - var(--hdr-h, 72px) - 28px); border: 1px solid var(--line); border-radius: 18px; background: var(--pop-solid); overflow: hidden; }
.ag-wrap > .ag-panel { position: static; max-height: none; flex: 1; min-height: 0; border: 0; border-radius: 0; background: transparent; padding-top: 4px; }
.ag-tools { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; padding: 10px 10px 8px; border-bottom: 1px solid var(--line); }
.ag-tools .ag-head { grid-column: 1 / -1; border: 0; padding-bottom: 2px; }
.ag-tools input[type=search] { grid-column: 1 / -1; height: 36px; font-size: 13px; }
.ag-tools select { height: 34px; font-size: 12.5px; min-width: 0; }
.ag-tools [data-ag-team] { grid-column: 1 / -1; }
.ag-tools [data-ag-n] { align-self: center; justify-self: end; }
.ag-list li[hidden], .ag-q[hidden], .ag-off[hidden], .ag-list[hidden] { display: none; }
@media (max-width: 1200px) { .ag-wrap { position: static; max-height: none; } }

/* report filters (Lead Sources, Queue Performance ...): their dropdowns open above the cards below, never behind them */
html:root .rp-filter { position: relative; z-index: 15; overflow: visible; }   /* above the cards below, under the header (20) */
html:root .rp-filter .ls-pick[open] { z-index: 16; }
html:root .ls-pick-box { z-index: 40; }
/* employee picker: compact one-line rows */
.tp-pick-row { padding: 3px 8px; gap: 8px; min-height: 30px; }
.tp-pick-row span { flex-direction: row; align-items: baseline; gap: 8px; }
.tp-pick-row b { font-size: 13px; white-space: nowrap; }
.tp-pick-row small { font-size: 11px; }
.tp-pick-list { max-height: 230px; gap: 0; }
.tp-pick-box { padding: 8px; gap: 6px; }
.tp-pick-box input[type=search] { height: 34px; }
.tp-pick > summary.btn { padding: 6px 12px; font-size: 13px; }

/* call log (CDR): two-line cells - the lead and its Bitrix24 state */
.cdr td { vertical-align: top; }
.cdr .cdr-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.cdr .cdr-sub a { color: var(--accent); }
.cdr .cdr-ok { color: var(--tc-dn, #128a5f); font-weight: 600; }
.cdr-head { margin: 4px 2px 10px; }
/* Analytics → Call log: the call's direction */
.cdr-dir { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.cdr-dir::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cdr-dir.inbound { color: var(--b); } .cdr-dir.outbound { color: var(--g); } .cdr-dir.internal { color: var(--n); }
.cl-synced { margin-left: 4px; }
/* a panel only the super admin may change: shown, not editable */
fieldset.rf-ro { display: contents; border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.rf-ro[disabled] .pf-pic, fieldset.rf-ro[disabled] .uf-gen { pointer-events: none; }
.rf-ro-note { margin: 0 0 4px; }
fieldset.rf-ro[disabled] :is(input, select, textarea) { opacity: .78; cursor: default; }

/* call log filters: responsible, department, status, note, stage, agent */
.cdr-filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; margin-top: 8px; }
.rp-line .cdr-filters { display: contents; }
.cdr-f { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cdr-f select { height: 36px; min-width: 150px; max-width: 230px; font-size: 13px; font-weight: 400; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 8px; }
.cdr-f.on select { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
/* call log pages */
.cdr-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
/* pages under long tables */
.tbl-pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; padding: 10px 4px 2px; }
.tbl-pager[hidden] { display: none; }
.tbl-pager .btn:disabled { opacity: .4; }
.tbl-pp { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.tbl-pp select { height: 30px; font-size: 12.5px; padding: 0 6px; }

/* =====================================================================================================
   Campaigns → Add leads to queue (Manual / From Bitrix24): wide pop-up, filters with counts, a page of leads
   ===================================================================================================== */
html:root .cq-dlg.lp-dlg { width: min(1180px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 18px 20px; overflow: auto; }
.lp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lp-head h2 { margin: 0 !important; }
.lp-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); margin-bottom: 14px; }
.lp-tabs button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; font: 600 13.5px var(--font); color: var(--muted); cursor: pointer; }
.lp-tabs button.on { background: var(--accent); color: #fff; }
.lp-row { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 10px; align-items: end; margin-bottom: 10px; }
.lp-q, .lp-f { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.lp-q select, .lp-f select, .lp-f input { height: 36px; font-size: 13px; }
.lp-s { height: 36px; width: 100%; }
.lp-filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: end; margin-bottom: 8px; }
.lp-pick { position: relative; }
.lp-pick-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }
.lp-pick-l { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.lp-pick-btn b { display: block; min-width: 150px; max-width: 220px; height: 36px; line-height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.lp-pick-btn b::after { content: ""; position: absolute; right: 11px; top: 45%; width: 6px; height: 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-50%) rotate(45deg); }
.lp-pick.on .lp-pick-btn b { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.lp-pick-pop { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: min(320px, 86vw); padding: 8px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--pop-solid, var(--surface)); box-shadow: 0 18px 40px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 6px; }
.lp-pick-pop[hidden] { display: none; }
.lp-pick-pop input[type=search] { height: 34px; width: 100%; }
.lp-pick-acts { display: flex; justify-content: flex-end; }
.lp-pick-list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; }
.lp-pick-list label { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 7px; font-size: 13px; color: var(--ink); cursor: pointer; }
.lp-pick-list label:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.lp-pick-list label:has(input:checked) { background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 500; }
.lp-pick-list label[hidden] { display: none; }
.lp-pick-list em { font-style: normal; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 4px 0 8px; font-size: 13px; }
.lp-sum b { font-size: 15px; }
.lp-warn { color: var(--y); }
.lp-wrap { max-height: min(52vh, 520px); overflow: auto; border: 1px solid var(--line); border-radius: 12px; transition: opacity .15s; }
.lp-wrap.busy { opacity: .55; }
.lp-table { width: 100%; margin: 0; }
.lp-table thead th { position: sticky; top: 0; z-index: 1; background: var(--pop-solid, var(--surface)); }
.lp-table td { vertical-align: middle; }
.lp-table .lp-c { width: 34px; text-align: center; }
.lp-table tr.lp-waiting td { opacity: .55; }
.lp-cc { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 11px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.lp-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.lp-pager { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 760px) { .lp-row { grid-template-columns: 1fr; } .lp-pick-btn b { min-width: 0; width: 100%; } .lp-pick { flex: 1 1 45%; } }
/* filter row: even columns that wrap neatly, text left-aligned */
.lp-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.lp-pick-btn { width: 100%; text-align: left; }
.lp-pick-btn b { width: 100%; max-width: none; min-width: 0; text-align: left; }
.lp-f input, .lp-f select { width: 100%; }

.lp-pp { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.lp-pp select { height: 30px; font-size: 12.5px; }

/* Add leads to queue: nearly the whole window, a taller list, a solid header row the leads scroll under */
html:root .cq-dlg.lp-dlg { width: calc(100vw - 32px); max-width: 1700px; height: calc(100vh - 32px); max-height: none;
  display: flex; flex-direction: column; }
html:root .cq-dlg.lp-dlg:not([open]) { display: none; }
.lp-dlg [data-lp-pane="bx"]:not([hidden]) { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.lp-dlg .lp-wrap { flex: 1; min-height: 240px; max-height: none; }
html:root .lp-table thead th { position: sticky; top: 0; z-index: 3; background: var(--pop-solid) !important;
  box-shadow: 0 1px 0 var(--line); }

/* queue cards: masonry - every card only as tall as it needs, the gaps are filled (rows of 8px, set by campaigns.js) */
.cq-grid.masonry { grid-auto-rows: 8px; grid-auto-flow: row dense; align-items: start; row-gap: 18px; }
.cq-grid.masonry > .cq { margin: 0; }
.cq-grid.masonry > .cq-add { min-height: 160px; }

/* a pop-up that is not (yet / any more) open never blocks the page underneath */
.sheet-wrap:not(.open) { pointer-events: none; }
.sheet-wrap:not(.open) .sheet-back, .sheet-wrap:not(.open) .sheet { pointer-events: none; }

/* every word of a button starts with a capital ("Call Yesterday's Again") */
.btn, .pill-btn, button.link, .tabs a, .lp-tabs button, .cql-seg button { text-transform: capitalize; }

/* =====================================================================================================
   Campaigns: cards per row, and a clean List view (one even row per queue)
   ===================================================================================================== */
.cq-fixed-cols .cq-grid { grid-template-columns: repeat(var(--cq-cols), minmax(0, 1fr)) !important; }
.cq-cols { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.cq-cols select { height: 32px; font-size: 13px; padding: 0 8px; border-radius: 999px; }
.cq-table-wrap { display: none; }
.cq-view-list .cq-grid { display: none !important; }
.cq-view-list .cq-table-wrap { display: block; margin-bottom: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px;
  background: var(--pop-solid); }
.cq-table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; }
.cq-table th { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 11px 8px; white-space: nowrap; }
.cq-table td { padding: 11px 8px; vertical-align: middle; border-top: 1px solid var(--line); }
.cq-table td.cq-thours { min-width: 110px; line-height: 1.35; }
.cq-table th.n, .cq-table td.n { text-align: center; font-variant-numeric: tabular-nums; }
.cq-table td.n b { font-size: 15px; }
.cq-tr { cursor: pointer; transition: background .12s; }
.cq-tr:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.cq-tr td:first-child { border-left: 4px solid transparent; }
.cq-tr.h-ok td:first-child { border-left-color: #2bb673; } .cq-tr.h-warn td:first-child { border-left-color: #e7a600; }
.cq-tr.h-bad td:first-child { border-left-color: #e34948; } .cq-tr.h-off td:first-child { border-left-color: var(--line); }
.cq-table .cq-badge { position: static; display: inline-flex; border-radius: 999px; padding: 3px 10px; font-size: 10.5px; white-space: nowrap; }
.cq-tq { font: 700 17px var(--font-display, var(--font)); color: var(--accent); }
.cq-tn { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cq-live-on { color: #8b5cf6; }
.cq-tres { min-width: 150px; }
.cq-res-bar:empty, .cq-tres .cq-res-bar:empty { background: color-mix(in srgb, var(--muted) 22%, transparent); }
.cq-tres .cq-res-bar { display: block; height: 6px; margin-bottom: 5px; }
.cq-tres .ok { color: #2bb673; } .cq-tres .no { color: #e34948; }
.cq-tact { width: 44px; text-align: right; }
.cq-table-add { margin: 10px 12px 12px; }
.cq-res-off { font-style: normal; color: var(--muted); }

/* =====================================================================================================
   Campaigns grid: "Add queue" is one compact tile that never stretches (it used to grow when the cards
   folded and shrink when they opened), and an open card is shorter
   ===================================================================================================== */
.cq-grid .cq-add, .cq-grid.masonry > .cq-add, .cq-grid:not(:has(article.cq:not(.folded))) .cq-add {
  min-height: 0 !important; height: auto !important; align-self: start !important; flex-direction: row; gap: 12px; padding: 22px 18px; }
.cq-grid .cq-add span { font-size: 26px; }
.cq-grid .cq-add small { display: none; }
article.cq { min-height: 0; }
article.cq:not(.folded) { gap: 12px; padding: 18px 18px 14px; }
.cq-big > div { padding: 10px 10px 9px; gap: 2px; }
.cq-big b { font-size: 34px; }
.cq-big b em { font-size: 14px; }
.cq-seats { margin-top: 4px; gap: 3px; }
.cq-seats i { width: 8px; height: 8px; border-radius: 2px; }
.cq-row { gap: 5px; }
.cq-row > div { padding: 5px 2px; }
.cq-row b { font-size: 16px; }
.cq-row small { font-size: 9.5px; letter-spacing: .04em; }
.cq-res { gap: 4px; }
.cq-foot { flex-wrap: wrap; row-gap: 6px; padding-top: 8px; }
.cq-foot .cq-when { max-width: none; overflow: visible; }
.cq-foot .cq-edit { margin-left: auto; white-space: nowrap; }

/* =====================================================================================================
   Date & time pickers (app.js): 24-hour time and a month calendar, themed like the rest of the app
   ===================================================================================================== */
.dp-wrap { position: relative; display: inline-flex; align-items: center; vertical-align: middle; max-width: 100%; }
.dp-wrap > input.dp-field { padding-right: 34px !important; cursor: pointer; font-variant-numeric: tabular-nums; }
.dp-w-time > input.dp-field { cursor: text; }
.dp-wrap > svg { position: absolute; right: 11px; width: 16px; height: 16px; pointer-events: none; fill: none; stroke: var(--muted);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lp-f .dp-wrap, .sheet-body .dp-wrap, .rf-grid .dp-wrap { display: flex; }
.lp-f .dp-wrap > input, .sheet-body .dp-wrap > input, .rf-grid .dp-wrap > input { width: 100%; }
html:root .cqp-time .dp-wrap { display: inline-flex; }
html:root .sheet-wrap .cqp-time .dp-wrap > input { width: 132px; }
@media (max-width: 640px) { .cqp-time .dp-wrap { display: flex; } html:root .sheet-wrap .cqp-time .dp-wrap > input { width: 100%; } }
.cql-date .dp-wrap > input { width: 132px; }
.dp { position: fixed; inset: auto; margin: 0; z-index: 1000; padding: 12px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--pop-solid, var(--surface)); color: var(--ink); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); font: 500 13px var(--font);
  display: flex; flex-direction: column; gap: 10px; overflow: visible; }
.dp-sec small { display: block; margin: 0 2px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dp-grid { display: grid; gap: 4px; grid-template-columns: repeat(6, 40px); }
.dp-c { height: 32px; min-width: 0; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink);
  font: 600 13px var(--font); font-variant-numeric: tabular-nums; cursor: pointer; text-transform: none; box-shadow: none; }
.dp-c:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.dp-c:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dp-c.on, .dp-c.on:hover { background: var(--accent); color: #fff; }
.dp-c.now:not(.on) { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.dp-c:disabled { opacity: .3; cursor: default; }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dp-head b { font: 700 14px var(--font-display, var(--font)); }
.dp-nav { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink);
  font-size: 18px; line-height: 1; cursor: pointer; }
.dp-nav:hover { border-color: var(--accent); color: var(--accent); }
.dp-cal { display: grid; grid-template-columns: repeat(7, 36px); gap: 3px; }
.dp-cal > span { text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); padding: 2px 0 4px; }
.dp-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 8px; }
.dp-link { border: 0; background: none; padding: 2px 4px; color: var(--accent); font: 600 12.5px var(--font); cursor: pointer; text-transform: none; }
.dp-link:disabled { opacity: .35; cursor: default; }
.dp-link:hover:not(:disabled) { text-decoration: underline; }
@media (max-width: 420px) { .dp-grid { grid-template-columns: repeat(6, 1fr); } .dp-cal { grid-template-columns: repeat(7, 1fr); } .dp { left: 8px !important; right: 8px; } }

/* =====================================================================================================
   Yeastar Teams page
   ===================================================================================================== */
.yt-note { padding: 10px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, #e7a600 45%, transparent);
  background: color-mix(in srgb, #e7a600 10%, transparent); font-size: 13px; }
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; align-items: start; }
.yt { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--pop-solid, var(--surface)); }
.yt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.yt-head h3 { margin: 0; font: 700 19px var(--font-display, var(--font)); color: var(--accent); }
.yt-head small { color: var(--muted); font-size: 12px; }
.yt-mem { display: flex; flex-wrap: wrap; gap: 6px; }
.yt-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px;
  background: color-mix(in srgb, var(--accent) 9%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.yt-chip b { font-variant-numeric: tabular-nums; }
.yt-chip.more { color: var(--muted); }
.yt-qs > small { display: block; margin-bottom: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.yt-qlist { display: flex; flex-wrap: wrap; gap: 6px; }
.yt-q { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 6px 4px 11px; border-radius: 10px; font-size: 12.5px;
  border: 1px solid var(--line); background: var(--surface); }
.yt-q b { color: var(--accent); }
.yt-x { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.yt-x:hover { background: color-mix(in srgb, #e34948 15%, transparent); color: #e34948; }
.yt-add { display: flex; gap: 8px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.yt-add select { flex: 1; min-width: 0; }
.yt-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 16px;
  border: 1px dashed var(--line); border-radius: 20px; text-align: center; }
.yt-pick { max-height: min(52vh, 460px); }
.danger-link { color: #e34948; border-color: transparent; background: transparent; }
.danger-link:hover { border-color: color-mix(in srgb, #e34948 45%, transparent); }
.yt-quick > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.yt-quick .btn.on { border-color: var(--accent); color: var(--accent); }

/* drop-down lists (app.js): themed instead of the browser's grey list */
.ds { padding: 6px; gap: 6px; max-width: min(460px, calc(100vw - 16px)); }
.ds-find { width: 100%; height: 34px; padding: 0 10px; border-radius: 9px; font-size: 13px; }
.ds-opts { max-height: min(340px, 50vh); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 1px; }
.ds-opt { padding: 8px 12px 8px 30px; border-radius: 8px; font-size: 13.5px; line-height: 1.3; cursor: pointer; position: relative;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-opt.act { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.ds-opt.on { color: var(--accent); font-weight: 650; }
.ds-opt.on::before { content: ""; position: absolute; left: 11px; top: 50%; width: 9px; height: 5px; margin-top: -4px;
  border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.ds-opt.off { opacity: .4; cursor: default; }
.ds-grp { padding: 8px 12px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ds-grp:first-child { padding-top: 2px; }
select[aria-expanded="true"] { border-color: var(--accent); }

/* Add leads: country code regions */
.lp-regions { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 0 4px; }
.lp-regions button { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 10px; border-radius: 999px; font: 600 12px var(--font);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-transform: none; }
.lp-regions button em { font-style: normal; font-weight: 500; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lp-regions button:hover:not(:disabled) { border-color: var(--accent); }
.lp-regions button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lp-regions button.on em { color: rgba(255, 255, 255, .8); }
.lp-regions button:disabled { opacity: .35; cursor: default; }

/* queue editor: bigger, Add Leads / Duplicate in the header */
html:root .sheet-wrap.modal .sheet:has(.cqp-tabs) { width: min(980px, 100%); max-height: min(92vh, 1040px); }
.sheet-wrap.modal .sheet:has(.cqp-tabs) .agp-list { max-height: min(46vh, 420px); }
.cqp-head { gap: 8px; }
.cqp-head > .btn { height: 36px; }
.cqp-head .cqp-title { margin-right: auto; }
.cqp-head > [data-cqp-tab].on { border-color: var(--accent); color: var(--accent); }
.cqp-dup { display: flex; flex-direction: column; gap: 14px; }
.cqp-dup-pbx { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
@media (max-width: 640px) { .cqp-head > .btn { padding: 0 10px; font-size: 12.5px; } }

/* agents column: no taller than the queue cards beside it (min 440px), and never taller than the screen */
@media (min-width: 1201px) {
  .ag-wrap { max-height: min(calc(100vh - var(--hdr-h, 72px) - 28px), max(440px, var(--cq-h, 100vh))); }
}

/* =====================================================================================================
   PHONES
   ===================================================================================================== */
/* the header's glass blur made it the frame of the fixed slide-out menu: the closed menu then sat beside the page
   (page 714px wide on a 375px phone -> the browser zoomed everything out) and the open menu was only header-tall */
@media (max-width: 900px) {
  html:root .hdr { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
html, body { overflow-x: clip; }
@media (max-width: 900px) {
  /* solid top bar: nothing shows through it while scrolling */
  html:root .hdr { background: var(--bg) !important; }
  /* the section menu: a row of tabs at the top of the page instead of a hidden side panel behind a floating ☰ */
  html body:has(main nav.secnav) main nav.secnav { position: static; transform: none !important; left: auto; top: auto; width: auto; max-height: none;
    flex-direction: row; align-items: center; gap: 4px; margin: 0 0 14px; padding: 4px; overflow-x: auto; scrollbar-width: none;
    border-radius: 16px; }
  html body:has(main nav.secnav) main nav.secnav::-webkit-scrollbar { display: none; }
  html body:has(main nav.secnav) main nav.secnav a { flex: 0 0 auto; width: auto; height: 40px; padding: 0 14px; gap: 7px; justify-content: center; border-radius: 12px; }
  html body:has(main nav.secnav) main nav.secnav .sn-tx { position: static; transform: none; opacity: 1; padding: 0; border: 0; background: none;
    box-shadow: none; color: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap; pointer-events: auto; }
  html body:has(main nav.secnav) main nav.secnav .sn-search .sn-tx kbd { display: none; }
  html body:has(main nav.secnav) main nav.secnav .sn-search { flex: 0 0 auto; width: 40px; height: 40px; padding: 0; }
  html body:has(main nav.secnav) main nav.secnav .sn-search .sn-tx { display: none; }
  html body:has(main nav.secnav) main nav.secnav .sn-head, html body:has(main nav.secnav) .sn-toggle { display: none !important; }
  html body:has(main nav.secnav) main nav.secnav .sn-sep { width: 1px; height: 22px; margin: 0 2px; flex: none; }
  html body:has(main nav.secnav) main nav.secnav .secnav-n, html body:has(main nav.secnav) main nav.secnav .atabs-n { position: static; transform: none; }
  html body:has(main nav.secnav) > main .page-head { padding-left: 0 !important; }
}
@media (max-width: 640px) {
  /* page title + actions use the whole width; the buttons line up two per row */
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .page-head .actions > * { width: 100%; min-width: 0; justify-content: center; }
  .page-head .actions > form > button, .page-head .actions > form { width: 100%; }
  .page-head .actions .btn { min-height: 42px; white-space: normal; line-height: 1.2; text-align: center; }
  /* 16px in fields: below that, iPhones zoom the page in on every tap into a field */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
  /* comfortable tap targets */
  .btn, button.btn, .tabs a, .qchip, .chip-btn { min-height: 40px; }
  .btn.sm { min-height: 36px; }
}
@media (max-width: 640px) {
  /* queue editor header: title + ✕ on top, Pause / Add Leads / Duplicate as one even row under it */
  .cqp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .cqp-head .cqp-title { order: 0; flex: 1 1 0; min-width: 0; flex-wrap: wrap; row-gap: 0; }
  .cqp-head .cqp-name { white-space: normal; overflow: visible; text-overflow: clip; }
  .cqp-head .sheet-x { order: 1; }
  .cqp-head::after { content: ""; order: 2; flex-basis: 100%; height: 0; }
  .cqp-head > form.inline, .cqp-head > .btn { order: 3; flex: 1 1 0; min-width: 0; margin: 0; }
  .cqp-head > form.inline .btn { width: 100%; }
  .cqp-head > .btn, .cqp-head > form.inline .btn { height: 40px; padding: 0 8px; font-size: 13px; gap: 5px; justify-content: center; }
  .cqp-lbl:has(.cqp-presets) { flex-wrap: wrap; row-gap: 8px; }
  .cqp-lbl:has(.cqp-presets) > span:first-child { flex-basis: 100%; }
  .cq-legend, .cq-key { display: none; }
}
@media (max-width: 640px) {
  /* Add leads to queue: full screen, filters two per row, one compact row per lead, the buttons pinned at the bottom */
  html:root dialog.cq-dlg.lp-dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; padding: 14px 12px 0; }
  .lp-dlg .lp-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .lp-dlg .lp-filters > * { min-width: 0; }
  .lp-dlg .lp-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .lp-dlg .lp-bar { flex-wrap: wrap; gap: 6px 12px; }
  html:root dialog.cq-dlg.lp-dlg[open] { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .lp-dlg [data-lp-pane="bx"]:not([hidden]) { display: block; }
  .lp-dlg .lp-wrap { flex: none; min-height: 0; max-height: none; overflow: visible; border-radius: 12px; }
  .lp-dlg .lp-table thead { display: none; }
  .lp-dlg .lp-table, .lp-dlg .lp-table tbody { display: block; width: 100%; }
  .lp-dlg .lp-table tr { display: flex !important; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; position: relative;
    padding: 10px 10px 10px 44px !important; margin: 0 !important; border: 0 !important; border-bottom: 1px solid var(--line) !important;
    border-radius: 0 !important; background: none !important; box-shadow: none !important; }
  .lp-dlg .lp-table td { display: block !important; padding: 0 !important; border: 0 !important; min-height: 0 !important; text-align: left !important; }
  .lp-dlg .lp-table td::before { content: none !important; display: none !important; }
  .lp-dlg .lp-table td.lp-c { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); }
  .lp-dlg .lp-table td.lp-c input { width: 22px; height: 22px; }
  .lp-dlg .lp-table td:nth-child(2) { flex: 1 1 auto; min-width: 0; font-size: 14.5px; }
  .lp-dlg .lp-table td:nth-child(3) { flex: 0 0 100%; font-size: 13px; }
  .lp-dlg .lp-table td:nth-child(n+4) { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
  .lp-dlg .lp-table td:nth-child(n+5)::before { content: "· " !important; display: inline !important; }
  .lp-dlg .lp-table td:nth-child(8) { display: none !important; }
  .lp-dlg .lp-table td.empty { flex: 1 1 100%; padding: 18px 0 !important; text-align: center !important; }
  .lp-dlg .lp-foot { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px -12px 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--pop-solid); border-top: 1px solid var(--line); }
  .lp-dlg .lp-foot .lp-pager { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .lp-dlg .lp-foot .rf-gap { display: none; }
  .lp-dlg .lp-foot > .btn { width: 100%; min-height: 44px; }
  .lp-dlg [data-lp-pane="manual"] { padding-bottom: 16px; }
}
@media (max-width: 640px) {
  /* list toolbars: every control fits its box, full width */
  .filters { flex-wrap: wrap; gap: 8px; }
  .filters > select, .filters > input, .filters select.team-filter, .filters .pk { flex: 1 1 100%; width: 100% !important; max-width: 100%; min-width: 0; box-sizing: border-box; }
  main select, main input:not([type=checkbox]):not([type=radio]) { max-width: 100%; }
}
@media (max-width: 640px) {
  /* small controls get a finger-sized hit area */
  main button.link { min-height: 40px; padding: 8px 6px; display: inline-flex; align-items: center; }
  .port button.pwr { width: 32px !important; height: 32px !important; right: 4px; bottom: 4px; }
  .port button.pwr svg { width: 16px; height: 16px; }
  main .qchip, main .qchips button, main .seg button, main .chip-btn { min-height: 38px; }
}
@media (max-width: 640px) {
  main button.ib, main button.tn-fold { min-width: 36px; min-height: 36px; }
}

/* Settings: lead stage tick boxes (lead hand-over) */
.set-stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 14px; }
.set-stages .check { display: flex; gap: 8px; align-items: center; min-height: 34px; }

/* Bitrix24 hand-over panel */
.ho { display: flex; flex-direction: column; gap: 12px; }
.ho-mode { margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; border: 1px solid color-mix(in srgb, #e7a600 45%, transparent);
  background: color-mix(in srgb, #e7a600 10%, transparent); }
.ho-mode.on { border-color: color-mix(in srgb, #2bb673 45%, transparent); background: color-mix(in srgb, #2bb673 10%, transparent); }
.ho-n { display: flex; flex-wrap: wrap; gap: 6px; }
.ho-chip { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.ho-chip.s-preview { color: #b07cf0; border-color: color-mix(in srgb, #b07cf0 40%, transparent); }
.ho-chip.s-done { color: #2bb673; border-color: color-mix(in srgb, #2bb673 40%, transparent); }
.ho-chip.s-waiting { color: #e7a600; border-color: color-mix(in srgb, #e7a600 40%, transparent); }
.ho-chip.s-error { color: #e34948; border-color: color-mix(in srgb, #e34948 40%, transparent); }
.ho-chip.s-skipped, .ho-chip.s-new { color: var(--muted); }
.ho-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ho-list li { padding: 10px 2px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.ho-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.ho-top .ho-chip { margin-left: auto; }
.ho-detail { color: var(--ink); }

/* queue cards in plain rows: open cards side by side with equal height, folded cards after them (no staggering) */
[data-cq-cards] .cq-grid { grid-auto-rows: auto !important; grid-auto-flow: row !important; align-items: stretch !important; }
[data-cq-cards] .cq-grid > article.cq { grid-row-end: auto !important; }
[data-cq-cards] .cq-grid > article.cq.folded { order: 1; align-self: start; }
[data-cq-cards] .cq-grid > article.cq:not(.folded) .cq-body { flex: 1; display: flex; flex-direction: column; }
[data-cq-cards] .cq-grid > article.cq:not(.folded) .cq-foot { margin-top: auto; }

/* a card whose queue is missing on the PBX: the fix right there */
.cq-fix { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -4px; }

/* archived queue cards */
.arch { display: flex; flex-direction: column; gap: 12px; }
.arch-list { list-style: none; margin: 0; padding: 0; }
.arch-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--line); }
.arch-list form { margin: 0; flex: none; }
/* dropdown rows keep their height (the list scrolls) - they were squeezed to fit, cutting the text on long lists */
.ds-opts > .ds-opt, .ds-opts > .ds-grp { flex: none; }
html:root .ds .ds-opts > .ds-opt, html:root .ds .ds-opts > .ds-grp { flex: 0 0 auto !important; min-height: max-content; }
html:root .ds .ds-opts > .ds-opt { min-height: 34px; line-height: 1.3; }
.lp-hidden { color: #b07cf0; font-weight: 600; }

/* =====================================================================================================
   Home page: status tiles with icons, section cards with their key number, a slim Settings bar
   ===================================================================================================== */
.strip .st { padding: 14px 16px 13px; gap: 3px; }
.st-ico { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; padding: 6px; border-radius: 10px; fill: none;
  stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  background: color-mix(in srgb, var(--accent) 11%, transparent); }
.st-ok .st-ico { stroke: var(--g); background: color-mix(in srgb, var(--g) 13%, transparent); }
.st-warn .st-ico { stroke: var(--y); background: color-mix(in srgb, var(--y) 15%, transparent); }
.st-bad .st-ico { stroke: var(--r); background: color-mix(in srgb, var(--r) 13%, transparent); }
.strip .st-label { gap: 7px; padding-right: 34px; }
.strip .st .dot { width: 7px; height: 7px; }
.strip .st b { font-size: 28px; margin-top: 4px; }

.tiles2 { display: flex; flex-wrap: wrap; gap: 16px; }
.tiles2 > .tile2 { flex: 1 1 calc(25% - 12px); min-width: 230px; min-height: 0; padding: 20px 20px 18px; }
.tile2 .t-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 14px; position: relative; z-index: 1; }
.tile2 .t-ico { width: 50px; height: 50px; margin: 0; border-radius: 15px; color: #fff;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c)) !important;
  box-shadow: 0 10px 22px -12px var(--c), inset 0 1px 0 rgba(255, 255, 255, .35); }
.tile2 .t-ico svg { width: 25px; height: 25px; stroke-width: 1.9; }
.tile2 .t-ico .ys-logo { filter: brightness(0) invert(1); }
.t-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); white-space: nowrap; }
.t-tag i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.t-tag.ok { color: #2bb673; background: color-mix(in srgb, #2bb673 12%, transparent); }
.t-tag.ok i { animation: tPulse 2s ease-in-out infinite; }
.t-tag.bad { color: #e34948; background: color-mix(in srgb, #e34948 12%, transparent); }
@keyframes tPulse { 50% { opacity: .35; } }
.tile2 h2 { font-size: 19px; margin: 0 0 4px; position: relative; z-index: 1; }
.t-num { display: flex; align-items: baseline; gap: 7px; margin: 0 0 8px; min-height: 34px; position: relative; z-index: 1; }
.t-num b { font: 650 30px/1 var(--font-display); color: var(--c); font-variant-numeric: tabular-nums; }
.t-num em { font-style: normal; font-size: 13px; color: var(--muted); }
.tile2 p { padding-right: 0; font-size: 12.5px; position: relative; z-index: 1; }
.t-open { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 14px; font-size: 13px; font-weight: 600; color: var(--c);
  position: relative; z-index: 1; align-self: flex-start; }
.t-open svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .15s; }
a.tile2:hover .t-open svg { transform: translateX(4px); }
a.tile2:hover { box-shadow: 0 18px 40px -22px var(--c) !important; }
/* Settings: one slim bar across the whole width */
.tiles2 > .tile-settings { flex: 1 1 100%; display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 14px 22px; padding: 16px 20px; }
.tile-settings .ts-head { margin: 0; flex: 0 0 auto; gap: 14px; }
.tile-settings .ts-head .t-ico { width: 44px; height: 44px; border-radius: 13px; }
.tile-settings .ts-head h2 { margin: 0; }
.tile-settings .ts-head small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tile-settings .ts-list { margin: 0; flex: 1 1 400px; }
@media (max-width: 1180px) { .tiles2 > .tile2 { flex-basis: calc(33.333% - 11px); } }
@media (max-width: 820px) { .tiles2 > .tile2 { flex-basis: calc(50% - 8px); min-width: 0; } }
@media (max-width: 520px) {
  .tiles2 > .tile2 { flex-basis: 100%; display: flex; flex-direction: column; padding: 16px; }
  .tile2 .t-top { margin-bottom: 10px; }
  .tile2 .t-ico { width: 44px; height: 44px; grid-row: auto; }
  .tile2 h2, .tile2 p { grid-column: auto; }
  .t-num b { font-size: 26px; }
  .t-open { padding-top: 10px; }
  .tiles2 > .tile-settings { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) { .t-tag.ok i { animation: none; } }
.st-ico { top: auto; bottom: 13px; }
.strip .st-label { padding-right: 0; }
.strip .st .dot { margin-right: 0; }
@media (max-width: 640px) {
  /* pop-up title bars stay solid while the content scrolls under them */
  .sheet-wrap .sheet-head { background: var(--pop-solid, var(--surface)) !important; position: sticky; top: 0; z-index: 3; }
  /* alternate emails: finger-sized Edit / Remove, the address on its own line above them */
  .acc-alias .al-row { row-gap: 8px; }
  .acc-alias .al-row > .al-view:first-child { flex: 1 1 100%; }
  .al-acts { margin-left: 0; }
  html:root:not(#pp) .sheet-wrap .al-btn, .al-btn { height: 38px; min-width: 38px; padding: 0 12px; }
  .al-btn span { display: inline; }
  .acc-alias .al-add input, .al-btn-add { height: 42px; }
  .acc-alias .al-add .al-btn-add { flex: 1 1 100%; justify-content: center; }
}

/* =====================================================================================================
   Yeastar > Reports: tabs, Call Activity
   ===================================================================================================== */
.rep-tabs { margin: 0 0 14px; }
.rep-tabs a { display: inline-flex; align-items: center; gap: 7px; }
.rep-tabs svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ca-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rp-kpi.c-red b { color: #d2453b; } .rp-kpi.c-violet b { color: #7b4fc4; }
.ca-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.ca-table th.sortable::after { content: "\00a0↕"; margin-left: 2px; opacity: .3; font-size: 11px; }
.ca-table th[data-dir="desc"]::after { content: "↓"; opacity: .9; } .ca-table th[data-dir="asc"]::after { content: "↑"; opacity: .9; }
.ca-mix-c { min-width: 150px; }
.ca-mix-c > small { margin-left: 6px; }
.ca-mix { display: inline-flex; width: 110px; height: 8px; border-radius: 999px; overflow: hidden; vertical-align: middle;
  background: color-mix(in srgb, var(--muted) 18%, transparent); }
.ca-mix i { display: block; height: 100%; }
.ca-mix i.a, .lg-ans { background: #2bb673; } .ca-mix i.m, .lg-mis { background: #e7a600; } .ca-mix i.x, .lg-abn { background: #e34948; }
.rp-legend i.lg-ans, .rp-legend i.lg-mis, .rp-legend i.lg-abn { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; vertical-align: -1px; }
.ca-a { color: #2bb673; } .ca-m { color: #c77d0a; font-weight: 600; } .ca-x { color: #e34948; font-weight: 600; }
.ca-rate { display: inline-block; min-width: 46px; padding: 2px 8px; border-radius: 999px; font-weight: 600; text-align: center; }
.ca-rate.good { background: color-mix(in srgb, #2bb673 14%, transparent); color: #1f8f59; }
.ca-rate.mid { background: color-mix(in srgb, #e7a600 16%, transparent); color: #a86c00; }
.ca-rate.low { background: color-mix(in srgb, #e34948 14%, transparent); color: #c0392b; }
.ca-how { margin: 12px 4px 2px; line-height: 1.55; }
@media (max-width: 1100px) { .ca-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ca-kpis { grid-template-columns: 1fr 1fr; } .ca-mix { width: 90px; } }

/* Queue Performance summary: numbers and agents open their calls in the call log */
a.rp-cl { color: inherit; text-decoration: none; border-bottom: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); padding: 0 2px; }
a.rp-cl:hover { color: var(--accent); border-bottom-style: solid; text-decoration: none; }
a.rp-cl.rp-num-pill { border-bottom: 0; }
a.rp-cl.rp-num-pill:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.rp-agent { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }
.rp-agent svg { width: 14px; height: 14px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: translateX(-3px); transition: .15s; }
.rp-agent:hover { color: var(--accent); text-decoration: none; }
.rp-agent:hover svg, .rp-sub tr:hover .rp-agent svg { opacity: 1; transform: none; }

/* Campaigns > Not Interested */
.ni-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 12px; }
.ni-head p { margin: 0; flex: 1 1 420px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.ni-head input { flex: 0 1 300px; }
.ni-table tr.ni-allowed td { opacity: .6; }
.lp-hidden-ni { color: #e34948; font-weight: 600; }

/* ---- installable app: "No connection" page (shown by the service worker when the phone is offline) */
.offline-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; background: var(--bg, #0a2a3b);
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
.offline-box { max-width: 360px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.offline-box img { border-radius: 18px; }
.offline-box h1 { margin: 6px 0 0; font-size: 22px; }
.offline-box p { margin: 0; color: var(--muted); line-height: 1.5; }

/* ---- phones, tall screens (20:9) and the installed Android app ------------------------------------------- */
/* settings: a long help text (e.g. a JSON example) no longer stretches its row off the screen */
@media (max-width: 900px) {
  .set-row { grid-template-columns: minmax(0, 1fr); }
  .set-label, .set-label small, .set-input { min-width: 0; overflow-wrap: anywhere; }
}
/* the app full screen: keep the header and the last row clear of the status bar / gesture bar */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .hdr { padding-top: calc(12px + env(safe-area-inset-top)); }
  main.wrap { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .sheet-wrap.modal .sheet { max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}
/* touch screens: everything you tap is big enough for a finger (Android asks for ~48 px) */
@media (pointer: coarse) {
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; flex: 0 0 auto; }
  .sy-range button { padding: 9px 16px; }
  a.rp-cl { display: inline-block; min-width: 32px; padding: 6px 4px; text-align: center; }
  a.back { display: inline-block; padding: 8px 0; }
}
/* phones: no text smaller than ~11 px */
@media (max-width: 640px) {
  .cq-row small { font-size: 11px; }
  .port .pn .psn { font-size: 11px; }
  .port .pcall { font-size: 11px; }
  table.data th { font-size: 11px; }
}
/* SIM legend: a dot always stays with its label; alerts on phones: text and Dismiss on one line */
.legend .lg-i { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend .lg-i .dot { margin-right: 0; }
@media (max-width: 640px) {
  html:root .alert { flex-wrap: nowrap; padding: 9px 12px; gap: 10px; font-size: 13px; line-height: 1.35; }
  html:root .alert > span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
  html:root .alert > form { flex: 0 0 auto; }
  html:root .alert > form .link { padding: 8px 2px; }
}
/* My account: notifications on this device, my devices */
.pn-kinds { display: grid; gap: 8px; margin: 6px 0 10px; }
.pn-kinds .check { display: flex; align-items: center; gap: 10px; }
.pn-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.pn-state.on { color: var(--g); font-weight: 600; }
.pn-state.err { color: var(--r); }
.pn-dev { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.pn-dev:first-of-type { border-top: 0; }
.pn-dev input { min-width: 0; }
.pn-dev small { grid-column: 1; }
.pn-dev [data-dev-forget] { grid-column: 2; grid-row: 1 / span 2; }
/* Android app: download page, update banner, sign-in link */
.ap-wrap { min-height: 70vh; display: grid; place-items: center; padding: 24px 0; }
.ap-card { max-width: 460px; width: 100%; display: grid; gap: 14px; justify-items: start; padding: 26px 22px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); }
.ap-card h1 { margin: 0; font-size: 24px; }
.ap-icon { border-radius: 20px; }
.ap-dl { width: 100%; justify-content: center; min-height: 50px; font-size: 15px; gap: 8px; }
.ap-dl svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ap-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; }
.ap-sha { word-break: break-all; font-size: 11px; }
.ap-alt summary { cursor: pointer; font-weight: 600; }
.apk-update { display: grid; gap: 2px; margin: 0 0 14px; padding: 12px 16px; border-radius: 14px; background: var(--accent);
  color: var(--accent-ink); text-decoration: none; }
.apk-update:hover { text-decoration: none; filter: brightness(1.05); }
.apk-update span { font-size: 13px; }
.lg-app { margin: 14px 0 0; text-align: center; }
.lg-app a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; padding: 8px 4px; }
.lg-app svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }


/* every table: sortable column titles with an arrow (↕ = can sort, ▼ biggest first / Z-A, ▲ smallest first / A-Z) */
th.sortable { cursor: pointer; user-select: none; }
/* inline with a no-break space: the arrow wraps with the title's last word, never onto a line of its own */
th.sortable::after { content: "\00a0↕"; display: inline; margin-left: 2px; font-size: 10.5px; opacity: .3; transition: opacity .15s; }
th.sortable:hover::after { opacity: .65; }
th.sortable[data-dir="desc"]::after, .ca-table th.sortable[data-dir="desc"]::after { content: "\00a0▼"; opacity: .9; color: var(--accent); }
th.sortable[data-dir="asc"]::after, .ca-table th.sortable[data-dir="asc"]::after { content: "\00a0▲"; opacity: .9; color: var(--accent); }
th.sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.col-sort { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.col-sort .chip-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* WhatsApp: the chat list on the left, the open chat on the right (the list alone on a phone) */
.wa-wrap { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.wa-list { padding: 0; overflow: hidden; }
.wa-list .wa-tabs { margin: 0; padding: 10px 12px 0; }
.wa-find { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.wa-find input[type="search"] { width: 100%; height: 36px; }
.wa-when-row { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.wa-when-row select { height: 32px; font-size: 13px; }
.wa-dates { display: inline-flex; gap: 4px; align-items: center; }
.wa-dates input[type="date"] { height: 32px; font-size: 13px; width: 135px; }
.wa-rows { max-height: calc(100vh - 330px); min-height: 240px; overflow: auto; }
.wa-row { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); color: inherit; text-decoration: none; }
.wa-row:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.wa-row.on { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.wa-row.done { opacity: .72; }
.wa-av { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.wa-av.mine { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.wa-av.big { flex-basis: 46px; width: 46px; height: 46px; font-size: 18px; }
.wa-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.wa-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.wa-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-when { color: var(--muted); font-size: 11px; white-space: nowrap; }
.wa-sub { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.wa-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-last i { font-style: normal; color: var(--accent); }
.wa-unread { background: #25d366; color: #052e16; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; font-size: 11.5px; }
.wa-unread[hidden] { display: none; }
.wa-meta { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-meta em { font-style: normal; color: var(--y); }
.wa-foot { margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); }
.wa-new { display: block; text-align: center; padding: 8px; font-weight: 600; color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.wa-pane { display: flex; flex-direction: column; min-height: 60vh; padding: 0; overflow: hidden; }
.wa-head { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.wa-head h2 { margin: 0; font-size: 18px; }
.wa-head p { margin: 2px 0 0; }
.wa-who { min-width: 0; }
.wa-back { display: none; font-size: 26px; line-height: 1; text-decoration: none; color: var(--muted); padding: 0 4px; }
.wa-open { font-weight: 600; }
.wa-pane .alert { margin: 10px 16px 0; }
.wa-msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); max-height: calc(100vh - 360px); }
.wa-m { max-width: min(72%, 640px); display: flex; flex-direction: column; gap: 2px; }
.wa-m.in { align-self: flex-start; }
.wa-m.out { align-self: flex-end; align-items: flex-end; }
.wa-m.system { align-self: center; max-width: 90%; }
.wa-b { padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.4; background: var(--surface); border: 1px solid var(--line); }
.wa-m.in .wa-b { border-bottom-left-radius: 4px; }
.wa-m.out .wa-b { background: color-mix(in srgb, #25d366 22%, var(--surface)); border-color: color-mix(in srgb, #25d366 40%, var(--line)); border-bottom-right-radius: 4px; }
.wa-m.system .wa-b { background: transparent; border: 0; color: var(--muted); font-size: 12px; text-align: center; }
.wa-t { font-size: 11px; color: var(--muted); padding: 0 4px; }
.wa-file { display: block; font-size: 12.5px; color: var(--accent); margin-top: 4px; }
.wa-send { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 10px 16px 12px; border-top: 1px solid var(--line); align-items: end; }
.wa-send textarea { width: 100%; resize: vertical; min-height: 44px; }
.wa-send .wa-as { grid-column: 1 / -1; }
.wa-ro { padding: 10px 16px; border-top: 1px solid var(--line); margin: 0; }
.wa-none { flex: 1; display: grid; place-items: center; align-content: center; gap: 8px; padding: 40px; }
.wa-none svg { width: 48px; height: 48px; stroke: var(--muted); fill: none; stroke-width: 1.5; }
@media (max-width: 900px) { .wa-wrap { grid-template-columns: 1fr; } .wa-wrap.has-chat .wa-list { display: none; } .wa-back { display: block; } .wa-rows { max-height: none; } .wa-msgs { max-height: 55vh; } }
/* WhatsApp › Chats: the whole width beside the side dock (no centred column), the list and the chat filling the window
   down to its bottom edge, each scrolling on its own - --wa-top (whatsapp.js) is where they start. No cards: the two
   sit flush, edge to edge, one line between them (like the WhatsApp app) */
main.wa-full, body:has(main nav.secnav):not([data-nav="hidden"]) > main.wa-full { max-width: none; padding: 0; margin-bottom: 0; }
html .wa-full .wa-list, html .wa-full .wa-pane { margin: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  background: var(--surface) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html .wa-full .wa-list { border-right: 1px solid var(--line) !important; }
.wa-full .wa-wrap { gap: 0; }
/* the side bar's ☰ (when it is hidden) sits in the list's top bar here, not over the chats */
body:has(main.wa-full)[data-nav="hidden"] .sn-toggle { top: calc(var(--hdr-h) + 7px); left: 8px; transform: none; width: 34px; height: 34px; border-radius: 10px; }
@media (min-width: 901px) { body[data-nav="hidden"] .wa-full .wa-list .wa-tabs { padding-left: 50px; } }
.wa-list .wa-tabs { display: flex; align-items: center; gap: 2px; }
.wa-tabs .wa-sync { margin-left: auto; }
.wa-tabs .wa-sync .sync-btn { padding: 5px 8px; min-height: 0; }
.wa-tabs .wa-sync .sync-btn span:empty { display: none; }
@media (min-width: 901px) {
  .wa-full .wa-wrap { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); align-items: stretch;
    height: calc(100dvh - var(--wa-top, 120px)); min-height: 420px; }
  .wa-full .wa-list { display: flex; flex-direction: column; min-height: 0; }
  .wa-full .wa-rows { flex: 1; max-height: none; min-height: 0; }
  .wa-full .wa-pane { min-height: 0; }
  .wa-full .wa-msgs { max-height: none; min-height: 0; }
}
/* the small WhatsApp button next to a phone number */
.wa-link { display: inline-flex; vertical-align: middle; margin-left: 5px; color: #25d366; opacity: .85; }
.wa-link svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.wa-link:hover { opacity: 1; color: var(--accent); }
/* Teams / SIM groups: the quick-add bar (names in, Enter, done) */
.qa-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; padding: 12px 14px; margin: 0 0 14px; border: 1px dashed var(--line); border-radius: 12px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.qa-bar label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.qa-bar label span { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.qa-bar .qa-main { flex: 1 1 320px; } .qa-bar .qa-main input { width: 100%; height: 38px; }
.qa-bar .qa-under select { height: 38px; min-width: 200px; }
.qa-bar .btn { height: 38px; }
.qa-bar small { flex-basis: 100%; }
/* SIM group panel: the group's SIM cards (number · ICCID · holder), compact, and the picker to add more */
.tp-sfind { width: 100%; height: 36px; margin-bottom: 6px; }
.tp-sims { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.tp-s { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 8px; }
.tp-s:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tp-s[hidden] { display: none; }
.tp-sn { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.tp-sn b { font-size: 13.5px; white-space: nowrap; }
.tp-sn small, .tp-pick-row small.mono { font-size: 11px; color: var(--muted); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-sm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-s .tp-del { margin: 0; }
[data-sim-pick] .tp-pick-list { max-height: 300px; }
.tp-s { grid-template-columns: auto minmax(0, 1fr) 30px; }
.tp-sn small { overflow: visible; text-overflow: clip; }           /* the whole 18-digit ICCID, always */

/* ----- WhatsApp bridge (Admin › WhatsApp bridge, and the page inside Bitrix24) ----- */
.br-status { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 28px; }
@media (max-width: 900px) { .br-status { grid-template-columns: minmax(0, 1fr); } }
.br-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.br-fold > summary::-webkit-details-marker { display: none; }
.br-fold > summary h2 { margin: 0; font-size: 16px; }
.br-fold > summary::after { content: "›"; font-size: 20px; color: var(--muted); transform: rotate(90deg); transition: transform .15s; }
.br-fold[open] > summary::after { transform: rotate(-90deg); }
.br-fold[open] > summary { margin-bottom: 12px; }
table.kv { width: 100%; border-collapse: collapse; }
table.kv th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 10px 6px 0; width: 170px; vertical-align: top; font-size: 13px; }
table.kv td { padding: 6px 0; border-bottom: 1px solid var(--line); word-break: break-all; }
table.kv.small th { width: 150px; }
table.kv tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: var(--g-bg); color: var(--g); }
.pill.warn { background: var(--y-bg); color: var(--y-ink, var(--ink)); }
.alert.ok { border-left-color: var(--g); background: var(--g-bg); }
.br-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.br-sync { white-space: nowrap; align-self: center; }
.uf-emp { margin-bottom: 14px; }
.uf-emp-note { display: inline-block; margin-top: 6px; padding: 3px 9px; border-radius: 8px; background: var(--y-bg); color: var(--ink); font-weight: 600; }
.br-sw { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.br-icon { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.br-icon select { margin-left: 6px; max-width: 100%; }
.br-log { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13px; }
.br-log li.error { color: var(--r); }
.br-log li.warning { color: var(--y-ink, var(--ink)); }
body.bxapp { background: #fff; margin: 0; padding: 0; min-height: 100vh; }
.bxapp-box { max-width: none; margin: 0; background: #fff; border: 0; border-radius: 0; padding: 24px 28px; }
.bxapp-box .alert { margin-bottom: 14px; }
.bxapp-box table.kv th { width: 130px; }
.bxapp-form select { margin-right: 8px; min-width: 220px; }
.bxapp-box h1 { font-size: 20px; margin: 0 0 12px; }
.bxapp-box h1 small { font-size: 13px; font-weight: 500; margin-left: 8px; }
.bxapp-form { margin: 14px 0 6px; }

/* ----- the WhatsApp tab in the Bitrix24 lead card, and the template form ----- */
.bxlead { display: flex; flex-direction: column; min-height: calc(100vh - 48px); }
.bxlead-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.bxlead-head h1 { font-size: 18px; margin: 0; }
.bxlead-chats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.bxlead-chats a { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.bxlead-chats a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.bxlead .wa-msgs { flex: 1; min-height: 260px; max-height: calc(100vh - 250px); border: 1px solid var(--line); border-radius: 12px; }
.bxlead .wa-send { padding-top: 10px; }
.wa-tpl { border-top: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 8px; }
.wa-tpl h3 { margin: 0; font-size: 14px; }
.wa-tpl-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wa-tpl select { min-width: 220px; height: 34px; }
.wa-tpl-body { white-space: pre-wrap; font-size: 13px; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; min-height: 20px; }
.wa-tpl-params { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.wa-tpl-params input { height: 32px; }
.wa-sent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12px; color: var(--muted); }

/* ----- WhatsApp › Templates ----- */
.wt-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .wt-grid { grid-template-columns: minmax(0, 1fr); } }
.wt-form { display: grid; gap: 12px; }
.wt-form .wa-tpl { border-top: 0; padding: 0; }
.wt-recips { display: grid; gap: 8px; }
.wt-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.wt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.wt-chip button { appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; }
.wt-hits { border: 1px solid var(--line); border-radius: 10px; max-height: 220px; overflow: auto; display: none; }
.wt-hits.open { display: block; }
.wt-hit { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.wt-hit:hover { background: var(--surface-2); }
.wt-hit small { color: var(--muted); }
.wt-form textarea { width: 100%; min-height: 70px; }
.wt-results { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.wt-results li.bad { color: var(--r); }

/* ----- WhatsApp look for the chats (Chats pane and the lead tab in Bitrix24) ----- */
:root { --wa-wall: url("/static/wa-wall.svg?v=2"); --wa-paper: #efe7dd; --wa-ink: #111b21; --wa-muted: #667781; --wa-out: #d9fdd3; --wa-in: #ffffff; --wa-green: #00a884; --wa-dark: #008069; }
:root[data-theme="dark"] { --wa-wall: url("/static/wa-wall-dark.svg?v=2"); --wa-paper: #0b141a; --wa-ink: #e9edef; --wa-muted: #8696a0; --wa-out: #005c4b; --wa-in: #202c33; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --wa-wall: url("/static/wa-wall-dark.svg?v=2"); --wa-paper: #0b141a; --wa-ink: #e9edef; --wa-muted: #8696a0; --wa-out: #005c4b; --wa-in: #202c33; } }
.wa-msgs { background-color: var(--wa-paper); background-image: var(--wa-wall); background-size: 480px 480px; padding: 14px 16px; gap: 4px; }
.wa-m { position: relative; max-width: min(70%, 620px); }
.wa-b { position: relative; padding: 7px 10px 16px; border-radius: 10px; border: 0; box-shadow: 0 1px .5px rgba(11,20,26,.13); color: var(--wa-ink); font-size: 14.2px; line-height: 1.38; min-width: 110px; }
.wa-m.in .wa-b { background: var(--wa-in); border-top-left-radius: 2px; }
.wa-m.out .wa-b { background: var(--wa-out); border-top-right-radius: 2px; }
.wa-m.in .wa-b::before, .wa-m.out .wa-b::before { content: ""; position: absolute; top: 0; width: 0; height: 0; border: 7px solid transparent; }
.wa-m.in .wa-b::before { left: -7px; border-top-color: var(--wa-in); border-right-color: var(--wa-in); }
.wa-m.out .wa-b::before { right: -7px; border-top-color: var(--wa-out); border-left-color: var(--wa-out); }
.wa-m .wa-t { position: absolute; right: 10px; bottom: 3px; font-size: 10.5px; color: var(--wa-muted); white-space: nowrap; max-width: 95%; overflow: hidden; text-overflow: ellipsis; }
.wa-m.in .wa-t { right: auto; left: 10px; }
.wa-m.system { align-self: center; max-width: 85%; }
.wa-m.system .wa-b { background: color-mix(in srgb, var(--wa-in) 80%, transparent); color: var(--wa-muted); font-size: 12px; text-align: center; padding: 5px 12px; border-radius: 8px; min-width: 0; box-shadow: 0 1px .5px rgba(11,20,26,.1); }
.wa-m.system .wa-t { position: static; display: block; text-align: center; margin-top: 2px; }
.wa-m.system .wa-b::before { display: none; }
.wa-m.in { align-self: flex-start; } .wa-m.out { align-self: flex-end; }
.wa-m .wa-file { display: block; margin-top: 4px; font-size: 12.5px; }
.wa-send { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 10px 12px; background: color-mix(in srgb, var(--wa-paper) 40%, var(--surface)); border-top: 1px solid var(--line); }
.wa-send textarea { border-radius: 20px; padding: 10px 14px; background: var(--surface); resize: vertical; min-height: 42px; }
.wa-send .btn.primary { height: 42px; min-width: 42px; border-radius: 999px; background: var(--wa-green); border-color: var(--wa-green); padding: 0 16px; }
.wa-send .btn.primary:hover { background: var(--wa-dark); border-color: var(--wa-dark); }
.wa-send .wa-as { grid-column: 1 / -1; margin: 0; font-size: 11.5px; }
.wa-head .wa-av, .bxlead-av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--wa-dark); flex: 0 0 42px; }
.wa-take { margin-left: auto; }
.bxlead-head { align-items: center; }
.bxlead-id { display: flex; align-items: center; gap: 12px; }
.bxlead-owner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--y-bg); border-left: 4px solid var(--y); margin-bottom: 10px; }
.bxlead-owner form { margin: 0; display: inline-flex; gap: 8px; align-items: center; }
.bxlead-locked { display: grid; place-items: center; min-height: 320px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; background: var(--wa-paper); padding: 24px; }

.wa-sent-list li.bad { color: var(--r); }
.wt-chip select { height: 26px; font-size: 12px; max-width: 220px; }
.wa-tpl-row label.small { min-width: 56px; }

.bxlead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bxlead-actions form { margin: 0; }
.wa-take { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.wa-take form { margin: 0; }

/* ----- files in chats ----- */
.wa-pic { display: block; margin: -2px -4px 6px; }
.wa-pic img { display: block; max-width: min(100%, 320px); max-height: 320px; border-radius: 8px; object-fit: cover; }
.wa-media { display: block; max-width: min(100%, 320px); margin: 2px 0 6px; }
video.wa-media { max-height: 320px; border-radius: 8px; }
a.wa-file { display: inline-block; margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--wa-ink) 7%, transparent); color: inherit; text-decoration: none; font-size: 13px; }
a.wa-file:hover { text-decoration: underline; }
.wa-send { grid-template-columns: auto minmax(0, 1fr) auto; }
.wa-attach { position: relative; height: 42px; width: 42px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; font-size: 18px; color: var(--wa-muted); background: var(--surface); border: 1px solid var(--line); }
.wa-attach:hover { color: var(--wa-dark); border-color: var(--wa-dark); }
.wa-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.wa-attach svg { transform: rotate(45deg); }
.wa-attach:has(input:disabled) { opacity: .4; cursor: not-allowed; }

/* ----- WhatsApp › Templates ----- */
.wt-form { display: block; }
.wt-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 900px) { .wt-cols { grid-template-columns: 1fr; } }
.wt-step { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.wt-step h3 { margin: 0; font-size: 15px; }
.wt-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--wa-dark); color: #fff; font: 600 13px var(--font); }
.wt-cnt { margin-left: auto; }
.wt-cnt.danger { color: #e34948; font-weight: 600; }
.wt-select { width: 100%; height: 38px; }
.wt-preview { margin-top: 10px; padding: 14px; border-radius: 12px; background-color: var(--wa-paper); display: flex; justify-content: flex-end; min-height: 64px; }
.wt-preview .wa-m { max-width: 100%; }
.wt-preview .wa-b.muted { color: var(--wa-muted); }
.wt-pickbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.wt-list { border: 1px solid var(--line); border-radius: 12px; max-height: 340px; overflow: auto; }
.wt-list .empty { margin: 0; padding: 18px 12px; }
.wt-r { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 28px; gap: 10px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.wt-r:last-child { border-bottom: 0; }
.wt-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--wa-green) 18%, transparent); color: var(--wa-dark); font-weight: 600; }
.wt-who { display: grid; min-width: 0; }
.wt-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.wt-who small { font-size: 11.5px; }
.wt-num select { height: 30px; font-size: 12.5px; max-width: 220px; }
.wt-x { appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0; }
.wt-x:hover { color: #e34948; }
.wt-numbers { margin-top: 10px; display: grid; gap: 4px; }
.wt-numbers textarea { width: 100%; }
.wt-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.wt-sendbtn { min-width: 130px; }
.lp-row-1 { grid-template-columns: 1fr; }

/* ----- Meta's ticks, template bubbles, notes and notifications ----- */
.wa-tick { margin-left: 4px; font-size: 11px; font-weight: 700; letter-spacing: -2.5px; padding-right: 2px; color: var(--wa-muted); }
.wa-tick.read { color: #53bdeb; }
.wa-tick.failed { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 5px; padding: 0; letter-spacing: 0; border-radius: 50%; background: #e34948; color: #fff; font-size: 10px; vertical-align: -2px; }
.wa-tpl-tag { display: block; margin: 0 0 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--wa-dark); }
.wa-tplm .wa-b { padding-top: 8px; }
.wa-tplm.bad .wa-b { box-shadow: 0 0 0 1.5px color-mix(in srgb, #e34948 70%, transparent), 0 1px .5px rgba(11,20,26,.13); }
.wa-fail { margin: 8px 0 2px; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, #e34948 13%, var(--wa-out)); color: #b3261e; font-size: 12.5px; line-height: 1.35; }
:root[data-theme="dark"] .wa-fail { background: color-mix(in srgb, #e34948 26%, var(--wa-out)); color: #ffb4ab; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-fail { background: color-mix(in srgb, #e34948 26%, var(--wa-out)); color: #ffb4ab; } }
.wa-sys { align-self: center; margin: 12px auto 4px; padding: 7px 14px; max-width: 90%; text-align: center; border-radius: 8px; background: color-mix(in srgb, var(--wa-in) 88%, transparent); color: var(--wa-muted); font-size: 12.5px; box-shadow: 0 1px .5px rgba(11,20,26,.12); }
.bxlead-note { margin: 0 0 10px; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; background: color-mix(in srgb, #ffcf5c 20%, var(--surface)); border: 1px solid color-mix(in srgb, #e0a800 40%, var(--line)); }
.bxlead-note a { font-weight: 600; }
.bx-toasts { position: fixed; top: 14px; right: 14px; z-index: 1000; display: grid; gap: 8px; width: min(380px, calc(100vw - 28px)); }
.bx-toast { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 14px; border-radius: 14px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--wa-green);
  box-shadow: 0 14px 34px rgba(11, 20, 26, .18); font-size: 13.5px; line-height: 1.4; animation: bx-toast-in .22s ease-out; }
.bx-toast.bad { border-left-color: #e34948; }
.bx-toast .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; background: var(--wa-green); }
.bx-toast.bad .ic { background: #e34948; }
.bx-toast button { appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px; line-height: 1; }
.bx-toast.out { opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; }
@keyframes bx-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bx-toast { animation: none; } .bx-toast.out { transition: none; } }
.wt-results { margin: 14px 0 0; gap: 6px; }
.wt-results li { padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--wa-green) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--wa-green) 28%, var(--line)); }
.wt-results li.bad { color: #b3261e; background: color-mix(in srgb, #e34948 8%, var(--surface)); border-color: color-mix(in srgb, #e34948 30%, var(--line)); }
.wa-link-dlg select { width: 100%; height: 40px; }
.wa-link-dlg p { margin: 0 0 12px; }

/* ----- voice messages ----- */
.wa-send { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.wa-mic { height: 42px; width: 42px; padding: 0; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--wa-muted); background: var(--surface); border: 1px solid var(--line); }
.wa-mic:hover:not(:disabled) { color: var(--wa-dark); border-color: var(--wa-dark); }
.wa-mic:disabled { opacity: .4; cursor: not-allowed; }
.wa-send.rec > textarea, .wa-send.rec > .wa-attach, .wa-send.rec > .wa-mic, .wa-send.rec > button.btn { display: none; }
.wa-rec { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 2px 3px 2px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.wa-rec[hidden] { display: none; }
.wa-rec-x { appearance: none; border: 0; background: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; color: #e34948; font-size: 15px; }
.wa-rec-x:hover { background: color-mix(in srgb, #e34948 10%, transparent); }
.wa-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e34948; animation: wa-rec-blink 1.1s ease-in-out infinite; }
.wa-rec-t { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--wa-ink); min-width: 40px; }
.wa-rec-l { flex: 1; min-width: 0; color: var(--wa-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-rec-send { appearance: none; border: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--wa-green); color: #fff; font-size: 16px; cursor: pointer; }
.wa-rec-send:hover { background: var(--wa-dark); }
@keyframes wa-rec-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .wa-rec-dot { animation: none; } }
.wa-voice-page { max-width: 440px; margin: 0 auto; padding: 22px 18px; }
.wa-voice-page h1 { margin: 0 0 2px; font-size: 18px; }
.wa-voice-page .wa-send { grid-template-columns: 1fr; justify-items: center; gap: 12px; padding: 20px 0 0; border: 0; background: none; }
.wa-voice-page .wa-mic { width: 64px; height: 64px; }
.wa-voice-page .wa-mic svg { width: 28px; height: 28px; }
.wa-voice-page .wa-rec { width: 100%; }

/* ----- chats: readable bubbles (the time and the ticks inside, after the text) ----- */
.wa-m .wa-b { display: flow-root; padding: 6px 9px 6px; min-width: 64px; }
.wa-m .wa-b .wa-tx { white-space: pre-wrap; }
.wa-m .wa-t { position: static; float: right; display: inline-flex; align-items: center; gap: 1px; margin: 7px -3px -3px 14px; padding: 0;
  max-width: none; overflow: visible; font-size: 10.5px; line-height: 1; color: var(--wa-muted); white-space: nowrap; }
.wa-m.system .wa-b { min-width: 0; }
.wa-m.system .wa-t { float: none; display: block; text-align: center; margin: 3px 0 0; }
.wa-by { display: block; margin: 0 0 2px; font-size: 12px; font-weight: 600; color: var(--wa-dark); }
.wa-by i { font-style: normal; font-weight: 400; font-size: 11px; color: var(--wa-muted); }
.wa-fail { display: block; }
.wa-blank { display: block; color: var(--wa-muted); font-style: italic; font-size: 13px; }
.wa-pic { display: block; width: fit-content; margin: 0 -5px 3px; }
.wa-pic img { width: 260px; max-width: 100%; height: auto; max-height: 340px; object-fit: cover; border-radius: 7px; }
.wa-pic.stk { margin: 0 0 4px; }                                                  /* a sticker: as WhatsApp shows it */
.wa-pic.stk img { width: 150px; height: 150px; max-height: none; object-fit: contain; border-radius: 0; }
.wa-m .wa-b:has(> .wa-pic.stk):not(:has(> .wa-tx)) { background: transparent; box-shadow: none; padding: 0 0 18px; min-width: 0; }
.wa-m .wa-b:has(> .wa-pic.stk):not(:has(> .wa-tx))::before { display: none; }
.wa-m .wa-b:has(> .wa-pic.stk):not(:has(> .wa-tx)) .wa-t { background: rgba(11, 20, 26, .45); color: #fff; border-radius: 8px; padding: 0 6px; }
.wa-link { color: #027eb5; text-decoration: underline; word-break: break-all; }
.br-log .br-f { display: inline-block; margin: 2px 6px 0 0; }
.br-log .br-err { display: block; margin-top: 3px; }
.br-log .br-tries { display: inline-block; margin: 3px 8px 0 0; }
.br-log .br-resend { display: inline-block; margin-top: 3px; }
.br-missbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
              margin: 10px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.br-missbar > span { display: flex; flex-direction: column; gap: 2px; }
.br-missbar form { margin: 0; }
.br-log .card-head .btn, .au .card-head .btn { margin-left: auto; }
:root[data-theme="dark"] .wa-link { color: #53bdeb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-link { color: #53bdeb; } }
.wa-media { width: 260px; max-width: 100%; margin: 2px 0; }
video.wa-media { width: 260px; max-height: 340px; }

/* ----- the answer box: one row (files, text, template, voice, send), the tray and the hint on their own lines ----- */
.wa-send { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.wa-send > textarea { flex: 1 1 200px; min-width: 0; min-height: 42px; max-height: 160px; resize: none; }
.wa-send > .wa-as, .wa-send > .wa-tray, .wa-send > .wa-rec { flex: 1 1 100%; }
.wa-send .wa-go { width: 42px; min-width: 42px; padding: 0; font-size: 16px; }
.wa-ico { height: 42px; width: 42px; padding: 0; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--wa-muted); background: var(--surface); border: 1px solid var(--line); }
.wa-ico:hover { color: var(--wa-dark); border-color: var(--wa-dark); }
.wa-ico.on { color: #fff; background: var(--wa-green); border-color: var(--wa-green); }
.wa-send.rec > .wa-ico { display: none; }
.wa-tray { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.wa-tray[hidden] { display: none; }
.wa-tray-l { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.wa-tray-i { position: relative; flex: 0 0 auto; width: 150px; display: grid; grid-template-rows: 96px auto; gap: 6px; padding: 6px; border-radius: 10px; background: var(--wa-paper); border: 1px solid var(--line); }
.wa-tray-i.bad { border-color: #e34948; }
.wa-tray-i.busy { opacity: .55; }
.wa-tray-th { display: grid; place-items: center; overflow: hidden; border-radius: 7px; background: var(--surface); font-size: 34px; }
.wa-tray-th img { width: 100%; height: 100%; object-fit: cover; }
.wa-tray-m { display: grid; min-width: 0; }
.wa-tray-m b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.wa-tray-m small { font-size: 11px; }
.wa-tray-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(11, 20, 26, .62); color: #fff; font-size: 11px; cursor: pointer; }
.wa-tray-f { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.wa-tray-n { flex: 1; font-size: 12px; color: var(--wa-muted); }
.wa-pane.drop, .bxlead.drop { position: relative; }
.wa-pane.drop::after, .bxlead.drop::after { content: "Drop the files here — you look them over before they go"; position: absolute; inset: 8px; z-index: 30;
  display: grid; place-items: center; border-radius: 16px; border: 2px dashed var(--wa-green); background: color-mix(in srgb, var(--wa-green) 12%, var(--surface));
  color: var(--wa-dark); font-weight: 600; pointer-events: none; }
.wa-tplpanel { border-top: 1px solid var(--line); background: var(--surface); }
.wa-tplpanel[hidden] { display: none; }
.wa-tplpanel .wa-tpl { border-top: 0; }
.wa-tpl-row select[data-tpl-lang] { min-width: 170px; }

/* ----- WhatsApp › Templates: language then template; your templates; a new template ----- */
.wt-pick2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; }
.wt-pick2 .wt-select { width: 100%; }
.pill.bad { background: color-mix(in srgb, #e34948 14%, var(--surface)); color: #b3261e; }
.wt-manage .card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wt-tlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.wt-t { display: grid; gap: 8px; align-content: start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--wa-paper); }
.wt-t-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wt-t-h .pill { margin-left: auto; }
.wt-t-b { display: grid; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--wa-in); color: var(--wa-ink); box-shadow: 0 1px .5px rgba(11, 20, 26, .13); white-space: pre-wrap; font-size: 13.5px; line-height: 1.4; }
.wt-prev-h { display: block; font-weight: 700; margin-bottom: 2px; }
.wt-prev-f { display: block; margin-top: 4px; color: var(--wa-muted); font-size: 12px; }
.wt-prev-btns { display: grid; gap: 4px; }
.wt-prev-btns span { display: block; padding: 7px; text-align: center; border-radius: 8px; background: var(--wa-in); color: #027eb5; font-size: 13.5px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.wt-new-dlg { width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.wt-new-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr); gap: 22px; }
@media (max-width: 760px) { .wt-new-grid { grid-template-columns: 1fr; } }
.wt-new-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wt-new .field input, .wt-new .field select, .wt-new .field textarea { width: 100%; }
.wt-new-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.wt-new-tools .wt-cnt { margin-left: auto; }
.wtn-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 8px; }
.wtn-ex { display: grid; gap: 4px; }
.wtn-ex span { font-size: 12px; color: var(--muted); }
.wtn-buttons { display: grid; gap: 8px; padding: 8px 12px 12px; border: 1px solid var(--line); border-radius: 12px; }
.wtn-btn { display: grid; grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.wtn-btn input[hidden] { display: none; }
.wt-new-prev { position: sticky; top: 0; align-self: start; display: grid; gap: 8px; }
.wt-prev-paper { display: grid; gap: 4px; align-content: start; min-height: 180px; padding: 16px; border-radius: 14px; background: var(--wa-paper); }
.wt-prev-paper .wa-m { max-width: 100%; }

/* ----- a template's variables: a field each, one-click fills ----- */
.wa-tpl-params { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.wa-var { display: grid; gap: 4px; }
.wa-var-l { font-size: 12px; font-weight: 600; color: var(--muted); font-family: var(--mono, monospace); }
.wa-var input { height: 34px; width: 100%; }
.wa-var-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.wa-chip { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 3px 10px; font: 500 12px var(--font); cursor: pointer; }
.wa-chip:hover { border-color: var(--wa-dark); }
.wa-chip.on { background: var(--wa-green); border-color: var(--wa-green); color: #fff; }
.wt-t-media { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.wt-t-media img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; }
.wt-t-media label.btn { cursor: pointer; }

.pm-table tr.pm-start select { min-width: 140px; }

/* ----- the conversation history: a head with a jump to each conversation, a divider where each starts ----- */
.wa-hist-h { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface); font-size: 13.5px; }
.wa-hist-jump { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.wa-hist-jump a { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--ink); text-decoration: none; background: var(--surface); }
.wa-hist-jump a.done { color: var(--muted); }
.wa-hist-jump a.on, .wa-hist-jump a:hover { border-color: var(--wa-green); color: var(--wa-dark); }
.wa-sess { align-self: stretch; display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; color: var(--wa-muted); font-size: 12px; scroll-margin-top: 10px; }
.wa-sess::before, .wa-sess::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--wa-muted) 35%, transparent); }
.wa-sess span { padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--wa-in) 92%, transparent); box-shadow: 0 1px .5px rgba(11,20,26,.12); text-align: center; max-width: 85%; }
.wa-sess.cur span { background: color-mix(in srgb, var(--wa-green) 16%, var(--wa-in)); color: var(--wa-dark); }
.wa-sess b { font-weight: 600; color: var(--wa-ink); }

/* ----- the template picker: names to pick, a preview on hover; the New / Edit form's photo ----- */
.wa-tpl-menu { display: flex; flex-wrap: wrap; gap: 6px; max-height: 170px; overflow: auto; padding: 2px; flex: 1 1 100%; }
.wa-tpl-opt { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px;
  font: 500 13px var(--font); cursor: pointer; }
.wa-tpl-opt:hover, .wa-tpl-opt:focus-visible { border-color: var(--wa-dark); outline: none; }
.wa-tpl-opt.on { background: var(--wa-green); border-color: var(--wa-green); color: #fff; }
.wa-tpl-pop { position: fixed; z-index: 1200; padding: 12px; border-radius: 14px; background: var(--wa-paper); border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(11, 20, 26, .22); display: grid; gap: 6px; pointer-events: none; }
.wa-tpl-pop .wa-m { max-width: 100%; }
.wa-tpl-pop-n { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--wa-dark); }
.wa-tpl-pop-img, .wt-prev-img { display: block; width: 100%; max-height: 160px; object-fit: cover; border-radius: 7px; margin: 0 0 6px; }
.wa-tpl-pop-media, .wt-prev-media { display: block; margin: 0 0 6px; padding: 18px 10px; border-radius: 7px; text-align: center;
  background: color-mix(in srgb, var(--wa-ink) 7%, transparent); color: var(--wa-muted); font-size: 12.5px; }
.wt-new [hidden] { display: none !important; }

/* ----- notifications: the bell, its list, the pop-up in the corner ----- */
.nt { position: relative; display: inline-flex; }
.nt-bell { position: relative; }
.nt-bell.has svg { animation: nt-ring 1.2s ease-in-out 1; transform-origin: 50% 10%; }
@keyframes nt-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
@media (prefers-reduced-motion: reduce) { .nt-bell.has svg { animation: none; } }
.nt-n { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #e5484d;
  color: #fff; font: 700 10.5px/17px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.nt-pop { position: absolute; top: calc(100% + 10px); right: -6px; z-index: 120; width: min(360px, calc(100vw - 24px)); max-height: 70vh;
  display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line); background: var(--pop-solid, var(--surface));
  box-shadow: 0 18px 48px rgba(8, 24, 40, .22); overflow: hidden; }
.nt-pop[hidden] { display: none; }
.nt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.nt-head b { font: 600 14px var(--font); color: var(--ink); }
.nt-list { overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.nt-empty { padding: 18px 10px; text-align: center; }
.nt-item { display: grid; gap: 2px; padding: 10px 10px 10px 22px; border-radius: 10px; color: var(--ink); text-decoration: none; position: relative; }
.nt-item:hover, .nt-item:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); text-decoration: none; outline: none; }
.nt-item.unread::before { content: ""; position: absolute; left: 8px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.nt-t { font: 600 13px var(--font); }
.nt-item:not(.unread) .nt-t { font-weight: 500; color: var(--muted); }
.nt-b { font-size: 12.5px; color: var(--muted); white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.nt-w { font-size: 11px; color: var(--muted); }
.nt-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1300; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.nt-toast { position: relative; display: grid; gap: 10px; padding: 14px 40px 14px 16px; border-radius: 16px; border: 1px solid var(--line);
  border-left: 4px solid #25a36b; background: var(--pop-solid, var(--surface)); color: var(--ink); box-shadow: 0 18px 48px rgba(8, 24, 40, .28);
  animation: nt-in .25s ease-out; }
.nt-toast.out { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
@keyframes nt-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.nt-toast-tx { display: grid; gap: 3px; }
.nt-toast-tx b { font: 600 14px var(--font); }
.nt-toast-tx span { font-size: 13px; color: var(--muted); white-space: pre-line; }
.nt-toast-go { display: flex; justify-content: flex-end; }
.nt-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.nt-x:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
@media (max-width: 520px) { .nt-pop { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; } }

/* ----- WhatsApp's formatting in chat bubbles: `code` and ```monospace``` ----- */
.wa-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; padding: 0 4px; border-radius: 4px;
  background: color-mix(in srgb, currentColor 10%, transparent); }
.wa-code.wa-pre { display: block; margin: 2px 0; padding: 6px 8px; white-space: pre-wrap; }
.wa-tx b { font-weight: 700; }

/* ----- the audit log ----- */
.au-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.au-filters input[type=search] { flex: 1 1 220px; min-width: 0; }
.au-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.au-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.au-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink); font-size: 12.5px; text-decoration: none; }
.au-chip:hover { text-decoration: none; border-color: var(--accent); }
.au-chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.au-chip i.chip { width: 8px; height: 8px; min-width: 0; padding: 0; border-radius: 50%; }
.au-chip b { font-weight: 600; color: var(--muted); }
.au-sum { margin: 0 0 6px; }
.au-day th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 10px 8px 6px; font: 600 12.5px var(--font); letter-spacing: .02em;
  background: var(--pop-solid, var(--surface)); color: var(--ink); border-bottom: 1px solid var(--line); }
.au-k { font-size: 10.5px; padding: 1px 7px; vertical-align: 1px; }
.au-what { font-weight: 600; }
.au-what.bad { color: var(--r, #d2453b); }
.au-act { margin-left: 4px; font-size: 11px; color: var(--muted); background: none; }
.au-target { word-break: break-word; max-width: 520px; }
.au-risky td:first-child { box-shadow: inset 3px 0 0 var(--r, #d2453b); }
.au-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
@media (max-width: 720px) { .au-act { display: none; } .au-date span { display: none; } }
/* the Log: one list of every source */
.au-filters input.au-who { flex: 0 1 140px; }
.au-filters input.au-target-in { flex: 1 1 200px; }
.au-prob { white-space: nowrap; }
.au-kinds { margin-top: -4px; }
.au-target a, .au-table td a.au-k { color: inherit; }
.au-table td a.au-k:hover { text-decoration: none; filter: brightness(.95); }
.au-detail { word-break: break-word; max-width: 460px; color: var(--ink); }
.au-err td { background: color-mix(in srgb, var(--r) 6%, transparent); }


/* ---- WhatsApp chats, as WhatsApp draws them (the Chats page and the lead tab inside Bitrix24) ---- */
:root { --wa-accent: #008069; }
:root[data-theme="dark"] { --wa-accent: #06cf9c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --wa-accent: #06cf9c; } }
.wa-by, .wa-tpl-tag, .wa-sess.cur span { color: var(--wa-accent); }
.wa-msgs { gap: 2px; }
.wa-m:not(.cont) { margin-top: 6px; }
.wa-m.cont .wa-b::before, .wa-m.cont .wa-by { display: none; }
.wa-m.in.cont .wa-b { border-top-left-radius: 8px; }
.wa-m.out.cont .wa-b { border-top-right-radius: 8px; }
.wa-day { align-self: center; position: sticky; top: 6px; z-index: 3; margin: 10px 0 2px; pointer-events: none; }
.wa-day span { display: inline-block; padding: 5px 12px; border-radius: 8px; background: var(--wa-in); color: var(--wa-muted);
  font-size: 12px; font-weight: 500; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-day.under { visibility: hidden; }
.wa-m .wa-t { font-variant-numeric: tabular-nums; }
/* a photo: edge to edge, the time over it when there is no caption; the caption under it */
.wa-m .wa-b:has(> .wa-pic:not(.stk)) { padding: 3px 3px 5px; }
.wa-m .wa-b:has(> .wa-pic:not(.stk)) > .wa-by { padding: 2px 6px 3px; }
.wa-m .wa-b:has(> .wa-pic:not(.stk)) > .wa-pic { margin: 0 0 2px; }
.wa-m .wa-b:has(> .wa-pic:not(.stk)) > .wa-tx { display: block; padding: 3px 6px 0; }
.wa-m .wa-b:has(> .wa-pic:not(.stk)) > .wa-t { margin-right: 4px; }
.wa-m .wa-b:has(> .wa-pic:not(.stk)):not(:has(> .wa-tx)) { padding-bottom: 3px; }
.wa-m .wa-b:has(> .wa-pic:not(.stk)):not(:has(> .wa-tx)) > .wa-t { position: absolute; right: 9px; left: auto; bottom: 8px; float: none; margin: 0;
  padding: 1px 6px; border-radius: 9px; color: #fff; background: rgba(11, 20, 26, .42); }
.wa-m .wa-b:has(> .wa-pic:not(.stk)):not(:has(> .wa-tx)) > .wa-t .wa-tick:not(.read):not(.failed) { color: #fff; }
.wa-pic img { display: block; width: 300px; max-height: 360px; border-radius: 7px; }
/* a sticker: no bubble, the time on its corner */
.wa-m .wa-b:has(> .wa-pic.stk):not(:has(> .wa-tx)) { padding: 0; }
.wa-m .wa-b:has(> .wa-pic.stk):not(:has(> .wa-tx)) > .wa-t { position: absolute; right: 2px; left: auto; bottom: 6px; float: none; margin: 0; }
.wa-pic.stk img { width: 150px; height: 150px; }
/* a video */
.wa-m .wa-media { display: block; width: 300px; max-width: 100%; border-radius: 7px; margin: 0 0 2px; background: #000; }
.wa-m .wa-b:has(> video.wa-media) { padding: 3px 3px 5px; }
.wa-m .wa-b:has(> video.wa-media) > .wa-tx { display: block; padding: 3px 6px 0; }
.wa-m .wa-b:has(> video.wa-media) > .wa-t { margin-right: 4px; }
/* a voice message */
.wa-voice { display: flex; align-items: center; gap: 10px; width: 270px; max-width: 100%; padding: 3px 2px 2px; }
.wa-vp { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--wa-green); color: #fff; transition: transform .1s ease-out; }
.wa-vp:active { transform: scale(.94); }
.wa-vp svg { width: 20px; height: 20px; fill: currentColor; }
.wa-vp .i-pause, .wa-voice.playing .wa-vp .i-play { display: none; }
.wa-voice.playing .wa-vp .i-pause { display: block; }
.wa-vbar { flex: 1; position: relative; height: 20px; cursor: pointer;
  background: linear-gradient(color-mix(in srgb, var(--wa-muted) 38%, transparent), color-mix(in srgb, var(--wa-muted) 38%, transparent)) center / 100% 4px no-repeat; }
.wa-vbar i { position: absolute; left: 0; top: 8px; height: 4px; width: 0; border-radius: 2px; background: var(--wa-green); }
.wa-vbar i::after { content: ""; position: absolute; right: -6px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--wa-green); }
.wa-vt { flex: 0 0 auto; min-width: 32px; font-size: 11.5px; color: var(--wa-muted); font-variant-numeric: tabular-nums; }
.wa-voice audio { display: none; }
/* a document */
.wa-doc { display: flex; align-items: center; gap: 10px; width: 280px; max-width: 100%; margin: 1px 0 4px; padding: 8px 10px; border-radius: 8px;
  background: color-mix(in srgb, var(--wa-ink) 6%, transparent); color: var(--wa-ink); text-decoration: none; }
a.wa-doc:hover { background: color-mix(in srgb, var(--wa-ink) 11%, transparent); }
.wa-doc.off { opacity: .7; cursor: default; }
.wa-doc-ic { flex: 0 0 auto; width: 32px; height: 40px; display: grid; place-items: end center; padding-bottom: 5px; border-radius: 3px;
  clip-path: polygon(0 0, 68% 0, 100% 24%, 100% 100%, 0 100%); background: #8696a0; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.wa-doc-ic.pdf { background: #e5383b; } .wa-doc-ic.doc { background: #2b7cd3; } .wa-doc-ic.xls { background: #1d8f4e; }
.wa-doc-ic.ppt { background: #e3772d; } .wa-doc-ic.zip { background: #8e6bbf; }
.wa-doc-n { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-doc-go { flex: 0 0 auto; width: 20px; height: 20px; fill: none; stroke: var(--wa-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* back to the latest message */
.wa-jump { position: absolute; z-index: 4; width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--wa-in); color: var(--wa-muted); box-shadow: 0 1px 3px rgba(11,20,26,.25); }
.wa-jump svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wa-jump:hover { color: var(--wa-ink); }
.wa-jump[hidden] { display: none; }
.wa-keys { color: var(--wa-muted); }
@media (hover: none) { .wa-keys { display: none; } }
@media (prefers-reduced-motion: reduce) { .wa-vp { transition: none; } }


/* ---- WhatsApp › Templates: send (the steps, and the phone beside them), the templates (a split: the list, the picked
   one big), the template form (the fields, the phone), sent today ---- */
/* the phone: a template as the customer gets it */
.wph { --wph-link: #027eb5; width: 100%; max-width: 380px; margin: 0 auto; border-radius: 26px; overflow: hidden; border: 1px solid var(--line);
  display: flex; flex-direction: column; background: var(--wa-paper); box-shadow: 0 26px 50px -30px rgba(11, 20, 26, .5), 0 2px 6px rgba(11, 20, 26, .06); }
:root[data-theme="dark"] .wph { --wph-link: #53bdeb; }
.wph-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--wa-dark); color: #fff; }
:root[data-theme="dark"] .wph-top { background: #202c33; }
.wph-av { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: #fff; object-fit: cover; }
.wph-who { display: grid; line-height: 1.25; }
.wph-who b { font-size: 14.5px; font-weight: 600; }
.wph-who small { font-size: 11.5px; opacity: .8; }
.wph-chat { flex: 1; min-height: 380px; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 16px;
  background: var(--wa-paper) var(--wa-wall) 0 0 / 480px 480px; }
.wph-day { align-self: center; margin-bottom: 6px; }
.wph-day span { display: inline-block; padding: 4px 10px; border-radius: 7px; background: var(--wa-in); color: var(--wa-muted); font-size: 11.5px; font-weight: 500;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.wph-empty { margin: auto; padding: 8px 14px; border-radius: 10px; background: color-mix(in srgb, var(--wa-in) 90%, transparent); color: var(--wa-muted);
  font-size: 13px; text-align: center; }
.wph-msg { align-self: flex-start; width: min(100%, 300px); display: grid; gap: 3px; margin-left: 6px; }
.wph-b { position: relative; padding: 3px 3px 5px; border-radius: 0 9px 9px 9px; background: var(--wa-in); color: var(--wa-ink); box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.wph-b::before { content: ""; position: absolute; left: -7px; top: 0; width: 8px; height: 12px; background: var(--wa-in); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.wph-media { margin-bottom: 2px; border-radius: 7px; overflow: hidden; }
.wph-media img { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.wph-media.video, .wph-media.image:not(:has(img)) { aspect-ratio: 16 / 10; display: grid; place-content: center; justify-items: center; gap: 6px;
  background: color-mix(in srgb, var(--wa-ink) 74%, #000); color: #fff; }
.wph-media.video::before { content: ""; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .22)
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 6.5v11l9-5.5z' fill='white'/></svg>") center / 24px no-repeat; }
.wph-media.video .wph-file, .wph-media.image .wph-file { font-size: 12px; opacity: .85; }
.wph-media.document { display: flex; align-items: center; gap: 10px; padding: 10px; background: color-mix(in srgb, var(--wa-ink) 6%, transparent); }
.wph-media.document::before { content: "PDF"; flex: 0 0 auto; width: 30px; height: 38px; display: grid; place-items: end center; padding-bottom: 5px; border-radius: 3px;
  clip-path: polygon(0 0, 68% 0, 100% 24%, 100% 100%, 0 100%); background: #e5383b; color: #fff; font-size: 8.5px; font-weight: 800; }
.wph-media.document .wph-file { min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wph-h { display: block; padding: 5px 7px 0; font-size: 14.5px; }
.wph-tx { padding: 4px 7px 0; font-size: 14px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.wph-f { display: block; padding: 5px 7px 0; color: var(--wa-muted); font-size: 12.5px; }
.wph-t { display: block; padding: 2px 6px 0; text-align: right; color: var(--wa-muted); font-size: 11px; }
.wph-btns { display: grid; gap: 3px; }
.wph-btns span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border-radius: 9px; background: var(--wa-in);
  color: var(--wph-link); font-size: 14px; font-weight: 500; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.wph-btns i { font-style: normal; }
.wph-var { padding: 0 3px; border-radius: 4px; background: color-mix(in srgb, #ffcf4a 45%, transparent); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
:root[data-theme="dark"] .wph-var { background: color-mix(in srgb, #ffcf4a 30%, transparent); }
.wph-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: color-mix(in srgb, var(--wa-paper) 70%, var(--surface)); }
.wph-in { flex: 1; padding: 8px 14px; border-radius: 999px; background: var(--wa-in); color: var(--wa-muted); font-size: 13px; }
.wph-mic { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; background: var(--wa-green)
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'><rect x='9' y='3' width='6' height='11' rx='3'/><path d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21'/></svg>") center / 18px no-repeat; }
.wph-label { display: block; margin: 0 0 10px; text-align: center; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.wph-legend { max-width: 380px; margin: 10px auto 0; text-align: center; color: var(--muted); font-size: 12px; }

/* send: the steps on the left, the phone on the right */
.wts-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 28px; align-items: start; }
.wts-head { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.wts-head h2 { margin: 0; font: 600 19px var(--font-display); }
.wts-step { display: grid; gap: 12px; margin-bottom: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.wts-sh { display: flex; align-items: center; gap: 10px; }
.wts-sh b { font-size: 15px; font-weight: 600; }
.wts-n { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--wa-dark); color: #fff; font-size: 13px; font-weight: 700; }
.wts-cnt { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.wts-langs { display: flex; flex-wrap: wrap; gap: 6px; }
.wts-lang { appearance: none; display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px 6px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); color: var(--ink); font: 500 13px var(--font); cursor: pointer; }
.wts-lang span { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); font-size: 11.5px; text-align: center; }
.wts-lang:hover { border-color: var(--wa-dark); }
.wts-lang[aria-checked="true"] { background: var(--wa-dark); border-color: var(--wa-dark); color: #fff; }
.wts-lang[aria-checked="true"] span { background: rgba(255, 255, 255, .22); }
.wts .wa-tpl-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; max-height: 236px; overflow: auto; padding: 2px; }
.wts .wa-tpl-opt { display: grid; gap: 2px; justify-items: start; padding: 10px 12px; border-radius: 12px; background: var(--surface); text-align: left; }
.wts .wa-tpl-opt b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.wts .wa-tpl-opt small { color: var(--muted); font-size: 11.5px; }
.wts .wa-tpl-opt.on { background: color-mix(in srgb, var(--wa-green) 9%, var(--surface)); border-color: var(--wa-green); color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wa-green) 16%, transparent); }
.wts .wa-tpl-opt.on small { color: var(--wa-dark); }
.wts-params { padding-top: 12px; border-top: 1px dashed var(--line); }
.wts-pickbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wts-list { max-height: 300px; }
.wts-empty { margin: 0; padding: 20px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.wts-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 4px 2px; }
.wts-send { min-width: 210px; height: 44px; border-radius: 12px; font-size: 15px; }
.wts-side { position: sticky; top: calc(var(--hdr-h, 72px) + 14px); }
@media (max-width: 1000px) { .wts-grid { grid-template-columns: 1fr; } .wts-side { position: static; } }

/* the templates: the list (search, Meta's review) and the picked one big beside it */
.wtl-head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.wtl-title { display: flex; align-items: baseline; gap: 6px 10px; flex-wrap: wrap; margin-right: auto; }
.wtl-title h2 { margin: 0; font: 600 19px var(--font-display); }
.wtl-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wtl-q { width: 220px; height: 34px; }
.wtl-chips { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.wtl-chip { appearance: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 0; border-radius: 999px; background: none;
  color: var(--muted); font: 500 12.5px var(--font); cursor: pointer; }
.wtl-chip span { font-size: 11px; opacity: .85; }
.wtl-chip[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(11, 20, 26, .12); }
.wtl-split { grid-template-columns: minmax(250px, 340px) 1fr; min-height: 600px; }
.wtl-list { max-height: 760px; }
.wtl-li { padding: 8px 10px; border-radius: 12px; text-align: left; }
.wtl-li .acc-tx { display: grid; gap: 1px; min-width: 0; }
.wtl-li .acc-tx b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.wtl-li .acc-tx span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.wtl-th { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.wtl-th img { width: 100%; height: 100%; object-fit: cover; }
.wtl-th:not(:has(img))::before { content: ""; width: 22px; height: 22px; background: var(--muted); opacity: .75;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.wtl-th.text { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'><path d='M4.5 4.5h15a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H11l-4.5 3.5v-3.5h-2a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2zM7 9h10M7 12.5h6.5'/></svg>"); }
.wtl-th.image { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'><rect x='3' y='4.5' width='18' height='15' rx='2.5'/><circle cx='9' cy='10' r='2'/><path d='m4 18 5.5-5 4 3.5 2.5-2 4 3.5'/></svg>"); }
.wtl-th.video { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'><rect x='3' y='5.5' width='13' height='13' rx='2.5'/><path d='m16 10 5-3v10l-5-3z'/></svg>"); }
.wtl-th.document { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'><path d='M6 3h8l4 4v14H6zM14 3v4h4M9 12h6M9 15.5h6'/></svg>"); }
.wtl-st { flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.wtl-st.ok { background: var(--g-bg); color: var(--g); }
.wtl-st.warn { background: var(--y-bg); color: var(--y); }
.wtl-st.bad { background: var(--r-bg); color: var(--r); }
.wtl-none { padding: 14px 10px; }
.wtl-pane { display: grid; gap: 14px; align-content: start; padding: 18px 20px 22px; }
.wtl-ph { display: flex; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; }
.wtl-pt { display: grid; gap: 7px; min-width: 0; margin-right: auto; }
.wtl-pt h3 { margin: 0; font: 600 20px var(--font-display); overflow-wrap: anywhere; }
.wtl-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.wtl-tag { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; }
.wtl-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wtl-del { color: var(--r); }
.wtl-reason { margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--r-bg); color: var(--r); font-size: 13px; }
.wtl-stage { padding: 28px 16px; border-radius: 18px;
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--wa-green) 10%, transparent), transparent 70%), var(--surface-2); }
.wtl-stage .wph { max-width: 400px; }
.wtl-note { margin: 0; color: var(--muted); font-size: 12.5px; text-align: center; }
@media (max-width: 900px) { .wtl-split .acc-pane { display: grid; max-height: none; } .wtl-list { max-height: 330px; } .wtl-q { width: 100%; } }

/* the template form: the fields on the left, the phone on the right */
html .cq-dlg.wtb { width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden; }
html .cq-dlg.wtb[open] { display: flex; flex-direction: column; }
.wtb .wt-new { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wtb-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.wtb-head > div { display: grid; gap: 3px; margin-right: auto; }
.wtb-head h2 { margin: 0; }
.wtb-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); }
.wtb-fields { display: grid; gap: 12px; align-content: start; padding: 16px 22px 20px; overflow: auto; }
.wtb-sec { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.wtb-sec h3 { margin: 0; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.wtb-sec h3 span { margin-left: 6px; font-weight: 500; letter-spacing: 0; text-transform: none; opacity: .85; }
.wtb-sec .field { margin: 0; }
.wtb-seg { justify-self: start; display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.wtb-seg button { appearance: none; padding: 6px 12px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: 500 13px var(--font); cursor: pointer; }
.wtb-seg button:hover { color: var(--ink); }
.wtb-seg button.on { background: var(--wa-dark); color: #fff; }
.wtb .wtn-buttons { margin: 0; padding: 0; border: 0; }
.wtb .wtn-buttons legend { margin-bottom: 6px; padding: 0; color: var(--muted); font-size: 12.5px; }
.wtb-prev { overflow: auto; padding: 18px 20px; border-left: 1px solid var(--line);
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--wa-green) 10%, transparent), transparent 70%), var(--surface-2); }
.wtb-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--surface); }
@media (max-width: 900px) { .wtb-split { grid-template-columns: 1fr; overflow: auto; } .wtb-fields, .wtb-prev { overflow: visible; }
  .wtb-prev { border-left: 0; border-top: 1px solid var(--line); } }

/* sent today */
.wtt-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.wtt-title { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-right: auto; }
.wtt-title h2 { margin: 0; font: 600 19px var(--font-display); }
.wtt-sum { display: flex; gap: 6px; flex-wrap: wrap; }
.wtt-k { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; }
.wtt-k b { color: var(--ink); font-weight: 700; }
.wtt-k.read b { color: var(--b); }
.wtt-k.delivered b { color: var(--g); }
.wtt-k.failed { border-color: transparent; background: var(--r-bg); color: var(--r); }
.wtt-k.failed b { color: var(--r); }
.wtt-list { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.wtt-r { display: grid; grid-template-columns: 56px minmax(150px, 1.15fr) minmax(150px, 1fr) minmax(190px, 1.35fr) minmax(90px, .55fr); gap: 14px;
  align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.wtt-th { padding-block: 8px; border-top: 0; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wtt-r:not(.wtt-th):hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.wtt-time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.wtt-to, .wtt-tpl, .wtt-st { display: grid; gap: 1px; min-width: 0; }
.wtt-to a, .wtt-to b, .wtt-tpl b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.wtt-to small, .wtt-tpl small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.wtt-st { justify-items: start; }
.wtt-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 6px; border-radius: 999px; background: var(--n-bg); color: var(--n); font-size: 12px; font-weight: 600; }
.wtt-pill .wa-tick { margin-left: 0; color: inherit; }
.wtt-pill.delivered { background: var(--g-bg); color: var(--g); }
.wtt-pill.read { background: var(--b-bg); color: var(--b); }
.wtt-pill.failed { background: var(--r-bg); color: var(--r); }
.wtt-st small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--r); font-size: 12px; }
.wtt-by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.wtt-none { margin: 0; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
@media (max-width: 760px) {
  .wtt-th { display: none; }
  .wtt-r { grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-areas: "time to st" "time tpl by"; row-gap: 4px; }
  .wtt-time { grid-area: time; } .wtt-to { grid-area: to; } .wtt-tpl { grid-area: tpl; } .wtt-st { grid-area: st; justify-items: end; } .wtt-by { grid-area: by; text-align: right; }
}


/* ---- Observation: the tasks behind a number (a lead with more than one for the same person stands out) ---- */
.obs-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.obs-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.obs-row.dup { border-color: color-mix(in srgb, var(--o) 45%, var(--line)); background: color-mix(in srgb, var(--o-bg) 55%, var(--surface)); }
.obs-t, .obs-l { display: grid; gap: 2px; min-width: 0; }
.obs-t a, .obs-t b, .obs-l a, .obs-l b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.obs-t small { font-size: 12px; }
.obs-l .wf { justify-self: start; }
@media (max-width: 640px) { .obs-row { grid-template-columns: 1fr; } }


/* the messages in the top layer (above an open form): the browser's pop-over look taken off again */
.ntfs[popover] { inset: auto 20px 20px auto; width: auto; height: auto; margin: 0; padding: 0; border: 0; background: transparent;
  color: inherit; overflow: visible; }
@media (max-width: 900px) { .ntfs[popover] { inset: auto 12px 84px 12px; } }


/* Assign to…: the people a conversation can go to */
.wa-assign-dlg { width: min(460px, calc(100vw - 32px)); }
.wa-as-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wa-as-head h2 { margin: 0; }
.wa-as-q { width: 100%; height: 38px; margin: 10px 0 8px; }
.wa-as-list { display: grid; gap: 2px; max-height: min(420px, 60vh); overflow: auto; margin: 0 -6px; padding: 0 6px; }
.wa-as-p { appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.wa-as-p:hover, .wa-as-p:focus-visible { background: var(--surface-2); outline: none; }
.wa-as-p:disabled { opacity: .55; cursor: progress; }
.wa-as-p.cur { background: var(--accent-soft); }
.wa-as-av { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%;
  background: color-mix(in srgb, var(--wa-green, #00a884) 18%, transparent); color: var(--wa-dark, #008069); font-weight: 700; font-size: 13px; }
.wa-as-n { display: grid; flex: 1; min-width: 0; }
.wa-as-n b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.wa-as-n small { color: var(--muted); font-size: 12px; }
.wa-as-p i { color: var(--muted); font-size: 11.5px; font-style: normal; }


/* a photo or a video in a chat, in its viewer (as on WhatsApp Web): the photo big on a screen in the theme's colour, the
   tools on top, the chat's other photos and videos below - not the glass of the other dialogs */
:root { --lb-bg: #fff; --lb-ink: #111b21; --lb-ink-2: #667781; --lb-ic: #54656f; --lb-hover: rgba(11, 20, 26, .07);
  --lb-nav: #fff; --lb-nav-shadow: 0 1px 3px rgba(11, 20, 26, .14), 0 4px 14px rgba(11, 20, 26, .1); --lb-pic-shadow: 0 4px 28px rgba(11, 20, 26, .16); }
:root[data-theme="dark"] { --lb-bg: #0b141a; --lb-ink: #e9edef; --lb-ink-2: #8696a0; --lb-ic: #aebac1; --lb-hover: rgba(255, 255, 255, .1);
  --lb-nav: #202c33; --lb-nav-shadow: 0 1px 3px rgba(0, 0, 0, .5); --lb-pic-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --lb-bg: #0b141a; --lb-ink: #e9edef; --lb-ink-2: #8696a0;
  --lb-ic: #aebac1; --lb-hover: rgba(255, 255, 255, .1); --lb-nav: #202c33; --lb-nav-shadow: 0 1px 3px rgba(0, 0, 0, .5); --lb-pic-shadow: 0 10px 40px rgba(0, 0, 0, .5); } }
.wa-lb { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; color: var(--lb-ink); overflow: hidden; }
html dialog.wa-lb { background: var(--lb-bg) !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html dialog.wa-lb::backdrop { background: transparent !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.wa-lb[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
html.wa-lb-open { overflow: hidden; }
.wa-lb-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.wa-lb-who { display: grid; gap: 1px; min-width: 0; margin-right: auto; }
.wa-lb-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.wa-lb-who small { color: var(--lb-ink-2); font-size: 12.5px; }
.wa-lb-acts { display: flex; align-items: center; gap: 4px; }
.wa-lb-acts > *, .wa-lb-nav { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--lb-ic); cursor: pointer; text-decoration: none; transition: background-color .12s, transform .12s; }
.wa-lb-acts > :hover, .wa-lb-acts > :focus-visible { background: var(--lb-hover); color: var(--lb-ink); outline: none; }
.wa-lb-acts > :disabled { opacity: .35; cursor: default; background: transparent; }
.wa-lb.video [data-lb="in"], .wa-lb.video [data-lb="out"] { display: none; }
.wa-lb svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wa-lb svg.fill { fill: currentColor; stroke: none; }
.wa-lb-stage { position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; min-height: 0;
  overflow: hidden; touch-action: none; }                     /* one cell the stage's size: a tall photo fits it too */
.wa-lb-stage > img, .wa-lb-stage > video { grid-area: 1 / 1; max-width: calc(100% - 128px); max-height: calc(100% - 16px); border-radius: 4px;
  box-shadow: var(--lb-pic-shadow); }
.wa-lb-stage > img { transform-origin: center; transition: transform .16s ease-out; cursor: zoom-in; user-select: none; -webkit-user-drag: none; }
.wa-lb-stage > video { background: #000; }
.wa-lb-stage > [hidden] { display: none; }
.wa-lb.zoomed .wa-lb-stage > img { cursor: grab; }
.wa-lb.dragging .wa-lb-stage > img { cursor: grabbing; transition: none; }
.wa-lb-nav { position: absolute; top: 50%; margin-top: -21px; background: var(--lb-nav); box-shadow: var(--lb-nav-shadow); }
.wa-lb-nav:hover, .wa-lb-nav:focus-visible { color: var(--lb-ink); outline: none; transform: scale(1.06); }
.wa-lb-nav.prev { left: 20px; } .wa-lb-nav.next { right: 20px; }
.wa-lb-nav[hidden] { display: none; }
.wa-lb-strip { display: flex; gap: 8px; padding: 10px 16px 16px; overflow-x: auto; }
.wa-lb-strip > :first-child { margin-left: auto; } .wa-lb-strip > :last-child { margin-right: auto; }     /* centred, and still scrolls */
.wa-lb-strip[hidden] { display: none; }
.wa-lb-strip > button { position: relative; flex: 0 0 auto; width: 54px; height: 54px; padding: 0; border: 0; border-radius: 6px; overflow: hidden;
  background: var(--lb-hover); color: #fff; opacity: .55; cursor: pointer; transition: opacity .12s; }
.wa-lb-strip > button:hover, .wa-lb-strip > button:focus-visible { opacity: .9; }
.wa-lb-strip > button.on { opacity: 1; outline: 2px solid #00a884; outline-offset: 2px; }
.wa-lb-strip img, .wa-lb-strip video { display: block; width: 100%; height: 100%; object-fit: cover; }
.wa-lb-strip svg { position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.wa-pic { cursor: zoom-in; }
.wa-pic.stk { cursor: default; }
/* a video in a chat: its first frame with a play button */
.wa-vid { position: relative; cursor: pointer; }
.wa-vid video { display: block; width: 260px; max-width: 100%; height: auto; max-height: 340px; object-fit: cover; border-radius: 7px; background: #000; pointer-events: none; }
.wa-play { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(11, 20, 26, .55); color: #fff; transition: background-color .12s; }
.wa-vid:hover .wa-play { background: rgba(11, 20, 26, .75); }
.wa-play svg { width: 26px; height: 26px; margin-left: 3px; fill: currentColor; }
@media (prefers-reduced-motion: reduce) { .wa-lb-stage > img, .wa-lb-acts > *, .wa-lb-nav, .wa-lb-strip > button { transition: none; } }
@media (max-width: 640px) {
  .wa-lb-nav { display: none; }
  .wa-lb-stage > img, .wa-lb-stage > video { max-width: 100%; border-radius: 0; }
}

/* the template's video in the phone */
.wph-media.video.has { aspect-ratio: auto; display: block; background: #000; }
.wph-media.video.has::before { content: none; }
.wph-media.video video { display: block; width: 100%; max-height: 320px; background: #000; }


/* the WhatsApp panel in Bitrix24's menu: the agent's conversations on the left, the one picked on the right */
body.bxpanel-body { overflow: hidden; }
.bxpanel { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 12px; height: 100vh; padding: 12px; box-sizing: border-box; }
.bxpanel-list { display: flex; flex-direction: column; min-height: 0; }
.bxpanel-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 4px; }
.bxpanel-head h1 { margin: 0; font-size: 18px; line-height: 1.2; letter-spacing: -.01em; }
.bxpanel-head p { margin: 1px 0 0; }
.bxpanel-logo { width: 30px; height: 30px; flex: 0 0 auto; fill: #25d366; }
.bxpanel-logo .ln { fill: #fff; }
.bxpanel-alert { margin: 6px 12px 0; }
.bxpanel .wa-rows { flex: 1 1 auto; min-height: 0; max-height: none; }
.bxpanel-pane { position: relative; display: grid; min-height: 0; }
.bxpanel-pane iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.bxpanel-pane iframe[hidden] { display: none; }
.bxpanel-empty { display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; }
.bxpanel-empty[hidden] { display: none; }
.bxpanel-empty svg { width: 64px; height: 64px; fill: color-mix(in srgb, #25d366 22%, transparent); }
.bxpanel-empty h2 { margin: 6px 0 0; font-size: 18px; }
.bxpanel-empty p { max-width: 380px; margin: 0; }
.bxpanel-back { display: none; }
.bxpanel .wa-row, .bxpanel .wa-row:hover, .bxpanel .wa-row:focus-visible { text-decoration: none; }
/* the lead's WhatsApp tab inside the panel: it fills the frame - the messages give way, the box to write in stays in view */
html.in-panel, html.in-panel body { height: 100%; overflow: hidden; }
.bxlead-numlink { display: none; }                   /* the number, a link to its lead: in the panel only - a lead's card is that lead */
html.in-panel .bxlead-numlink { display: inline; }
html.in-panel .bxlead-num.has-link { display: none; }
html.in-panel .bxapp-box.bxlead { height: 100vh; min-height: 0; overflow: auto; box-sizing: border-box; padding: 16px 18px 12px; }
html.in-panel .bxlead .wa-msgs { flex: 1 1 0; min-height: 140px; max-height: none; }
@media (max-width: 760px) {
  .bxpanel { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
  .bxpanel.has-chat .bxpanel-list, .bxpanel:not(.has-chat) .bxpanel-pane { display: none; }
  .bxpanel.has-chat .bxpanel-pane { grid-template-rows: auto minmax(0, 1fr); }
  .bxpanel.has-chat .bxpanel-back { display: block; padding: 10px 14px; text-decoration: none; }
}
/* WhatsApp › Bridge › Numbers: any number of WhatsApp numbers, each on its own Open Channel line */
.br-nums .br-nrow { padding: 8px 6px; }
.br-nform, .br-nadd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.br-nform input[name=label] { flex: 1 1 150px; min-width: 120px; }
.br-nform input[name=waba_id], .br-nadd input[name=waba_id] { flex: 0 1 190px; }
.br-nform select, .br-nadd select { max-width: 260px; }
.br-lineno { width: 110px; }
.br-disp { flex: 0 1 200px; display: inline-flex; flex-direction: column; }
.br-nacts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.br-reg { display: inline-flex; gap: 6px; align-items: center; }
.br-reg input { width: 80px; }
.br-off td { opacity: .6; }
.br-nadd { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.br-nadd input[name=phone_id] { flex: 0 1 200px; }
.br-nadd input[name=label] { flex: 1 1 160px; }
.wts-from { max-width: 220px; }


/* Switch account: the saved accounts as cards, every account in a list, and the bar while in someone's account */
.sw-h { margin: 0; font-size: 15px; font-weight: 600; }
.sw-saved { margin: 0 0 16px; }
.sw-saved .sw-h { margin-bottom: 10px; }
.sw-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.sw-card { position: relative; display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.sw-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sw-go { margin: 0; }
.sw-go button { display: flex; align-items: center; gap: 10px; padding: 10px 34px 10px 12px; border: 0; background: transparent; color: inherit;
  cursor: pointer; text-align: left; border-radius: 14px; font: inherit; }
.sw-go button:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.sw-go button:disabled { cursor: default; }
.sw-x { position: absolute; top: 4px; right: 4px; margin: 0; }
.sw-x button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.sw-x button:hover { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--ink); }
.sw-av { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; object-fit: cover;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); font-weight: 700; }
.sw-who { display: grid; min-width: 0; }
.sw-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-who small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-all { padding: 0; overflow: hidden; }
.sw-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sw-find { flex: 1 1 260px; max-width: 420px; height: 36px; margin-left: auto; }
.sw-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; margin: 0;
  padding: 10px 16px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.sw-row:last-of-type { border-bottom: 0; }
.sw-row.on { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.sw-row[hidden] { display: none; }
.sw-last { white-space: nowrap; }
.sw-bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px;
  background: #fff4d6; color: #5c4400; border-bottom: 1px solid #f0d27a; font-size: 13.5px; }
.sw-bar form { margin: 0 0 0 auto; }
.sw-bar-link { color: inherit; font-weight: 600; }
:root[data-theme="dark"] .sw-bar { background: #3a2f10; color: #ffe2a0; border-bottom-color: #6b5520; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sw-bar { background: #3a2f10; color: #ffe2a0; border-bottom-color: #6b5520; } }
@media (max-width: 760px) {
  .sw-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .sw-row .chip, .sw-last { display: none; }
}
/* inside the Android app: "Turn on notifications" (one tap -> Android's own question) */
.pn-ask { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 85;
  max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center;
  padding: 14px 16px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 22px 48px -20px rgba(6, 27, 39, .6); transform: translateY(140%); opacity: 0;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.1), opacity .2s; }
.pn-ask.on { transform: none; opacity: 1; }
.pn-ask[hidden] { display: none; }
.pn-ask-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.pn-ask-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pn-ask-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pn-ask-tx b { font: 600 14.5px var(--font-display); color: var(--ink); }
.pn-ask-tx span { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.pn-ask-acts { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .pn-ask { transition: opacity .2s; } }

/* ---------- dark mode, refined: a lit top edge on the glass (shadows only: coloured edges stay), quieter scrollbars,
   a soft glow on the field being typed in, faint rows in tables, a calmer chat wallpaper and lifted bubbles ---------- */
:root[data-theme="dark"] { --sb: color-mix(in srgb, var(--muted) 28%, transparent); }
:root[data-theme="dark"] :is(input, select, textarea):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(57, 192, 224, .26); }
:root[data-theme="dark"] table.data tbody tr:nth-child(even) > td { background: rgba(255, 255, 255, .018); }
:root[data-theme="dark"] table.data tbody tr:hover > td { background: color-mix(in srgb, var(--accent) 9%, transparent); }
:root[data-theme="dark"] .wa-msgs { background-image: linear-gradient(rgba(11, 20, 26, .42), rgba(11, 20, 26, .42)), var(--wa-wall); }
:root[data-theme="dark"] .wa-b { box-shadow: 0 1px .5px rgba(0, 0, 0, .35); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --sb: color-mix(in srgb, var(--muted) 28%, transparent); }
  :root:not([data-theme="light"]) :is(input, select, textarea):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(57, 192, 224, .26); }
  :root:not([data-theme="light"]) table.data tbody tr:nth-child(even) > td { background: rgba(255, 255, 255, .018); }
  :root:not([data-theme="light"]) table.data tbody tr:hover > td { background: color-mix(in srgb, var(--accent) 9%, transparent); }
  :root:not([data-theme="light"]) .wa-msgs { background-image: linear-gradient(rgba(11, 20, 26, .42), rgba(11, 20, 26, .42)), var(--wa-wall); }
  :root:not([data-theme="light"]) .wa-b { box-shadow: 0 1px .5px rgba(0, 0, 0, .35); }
}

/* =====================================================================================================
   Home · Launchpad - the default Home (Classic is the other layout: each person picks one with Home's switch) - and
   the app address's Home: the time, the sections as app icons with their counts as badges, the live numbers in a dock
   ===================================================================================================== */
.lp { max-width: 1500px; min-height: calc(100vh - 160px); margin: 0 auto; padding: 2vh 0 6vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; }
.lp-clock { margin: 0; font: 300 clamp(72px, min(8.4vw, 14vh), 140px)/1 var(--font-display); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.lp-hero h1 { margin: 12px 0 4px; font: 500 clamp(24px, 2.3vw, 36px)/1.2 var(--font-display); letter-spacing: -.005em; }
.lp-date { margin: 0; color: var(--muted); font-size: clamp(14px, 1vw, 17px); }
.lp-search { margin: clamp(22px, 3.6vh, 34px) auto 0; width: min(780px, 92vw); display: flex; align-items: center; gap: 14px; padding: 17px 24px;
  border-radius: 999px; cursor: text; font: inherit; color: var(--muted); text-align: left; background: var(--glass-hi), var(--glass-solid);
  border: 1px solid var(--glass-line); box-shadow: 0 18px 40px -22px rgba(10, 42, 59, .45); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.lp-search:hover { border-color: var(--accent); }
.lp-search svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: 0 0 auto; }
.lp-search span { flex: 1; font-size: 16.5px; }
.lp-search kbd { font: 600 12px var(--font); padding: 4px 8px; border-radius: 7px; border: 1px solid var(--glass-line); color: var(--muted); }
.lp-apps { margin: clamp(30px, 5.4vh, 58px) auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 34px clamp(16px, 1.5vw, 28px); width: 100%; }
.lp-app { position: relative; width: clamp(104px, 7.4vw, 136px); display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--ink); font-weight: 500; font-size: clamp(13.5px, .95vw, 15.5px); }
.lp-app:hover { text-decoration: none; }
.lp-app .t-ico { --sz: clamp(76px, 5.3vw, 100px); margin: 0; width: var(--sz); height: var(--sz); border-radius: 28%; border: 0; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 88%, #fff), color-mix(in srgb, var(--c) 82%, #000));
  box-shadow: 0 16px 30px -16px color-mix(in srgb, var(--c) 80%, #000), inset 0 1px 0 rgba(255, 255, 255, .35); transition: transform .2s; }
.lp-app .t-ico svg { width: 44%; height: 44%; stroke-width: 1.6; }
.lp-app .t-ico .ys-logo { width: 50%; height: 50%; }
.lp-app:hover .t-ico { transform: translateY(-4px) scale(1.04); }
.lp-app:active .t-ico { transform: scale(.96); transition-duration: .08s; }
.lp-badge { position: absolute; top: -7px; left: calc(50% + clamp(24px, 1.8vw, 34px)); min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px;
  display: grid; place-items: center; font: 700 13px var(--font); color: #fff; background: #e5484d; box-shadow: 0 0 0 3px var(--bg); }
.lp-dock { margin: clamp(30px, 5.6vh, 60px) auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 9px; border-radius: 24px;
  width: fit-content; max-width: 100%; background: var(--glass-hi), var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.lp-dock .st { background: transparent !important; border: 0 !important; box-shadow: none; padding: 10px 18px; border-radius: 15px; align-items: center;
  text-align: center; -webkit-backdrop-filter: none; backdrop-filter: none; }
.lp-dock .st::before, .lp-dock .st small { display: none; }
.lp-dock .st:hover { background: color-mix(in srgb, var(--accent) 8%, transparent) !important; transform: none; }
.lp-dock .st-label { font-size: 11.5px; }
.lp-dock .st b { font-size: 25px; }
.lp-search.lp-find { margin: clamp(28px, 4.6vh, 44px) auto 0; width: min(460px, 100%); }   /* the app address: under the apps */

/* the app address's Home: what waits for this person in WhatsApp (the newest five), then their sections */
.lp-wait { margin: clamp(26px, 4.6vh, 46px) auto 0; width: min(760px, 100%); text-align: left; padding: 18px 16px 12px; border-radius: 26px;
  background: var(--glass-hi), var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.lp-wait-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 8px 10px; }
.lp-wait-h h2 { margin: 0; font: 600 19px var(--font-display); }
.lp-wait-n { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center; font: 700 13px var(--font);
  color: #fff; background: #e5484d; }
.lp-wait-sub { color: var(--muted); font-size: 13.5px; }
.lp-wait-h a { margin-left: auto; font-size: 13.5px; font-weight: 500; }
.lp-chats { list-style: none; margin: 0; padding: 0; }
.lp-chat { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 16px; color: var(--ink); }
.lp-chat:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.lp-av { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font: 600 16px var(--font-display); color: #fff;
  background: linear-gradient(145deg, #3ccf7f, #179a55); }
.lp-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lp-who b, .lp-who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-who b { font-weight: 600; font-size: 15px; }
.lp-who small { color: var(--muted); font-size: 13.5px; }
.lp-chat time { flex: 0 0 auto; align-self: flex-start; margin-top: 3px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.lp-more { display: block; padding: 8px 8px 4px; font-size: 13.5px; font-weight: 500; }
.lp-calm { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 8px 12px; color: var(--g); font-weight: 500; }
.lp-calm svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: reduce) { .lp-app .t-ico { transition: none; } .lp-app:hover .t-ico, .lp-app:active .t-ico { transform: none; } }
@media (max-height: 760px) and (min-width: 621px) {            /* a laptop's short screen: all of it without scrolling */
  .lp { padding-bottom: 0; }
  .lp-clock { font-size: clamp(64px, 12vh, 120px); }
  .lp-search { padding: 14px 22px; }
  .lp-apps { margin-top: 4vh; }
  .lp-dock { margin-top: 3.5vh; }
}
@media (max-width: 620px) {
  .lp { min-height: 0; padding: 4px 0 0; }
  .lp-clock { font-size: 66px; }
  .lp-search { display: none; }   /* the top bar has the search on a phone */
  .lp-apps { margin-top: 30px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 6px; }
  .lp-app { width: auto; gap: 8px; font-size: 11.5px; }
  .lp-app .t-ico { --sz: 60px; }
  .lp-badge { left: calc(50% + 17px); min-width: 22px; height: 22px; padding: 0 6px; font-size: 11.5px; }
  .lp-apps-few { display: flex; gap: 22px 18px; }             /* the app address: a few icons, centred */
  .lp-apps-few .lp-app { width: 84px; }
  .lp-search.lp-find { display: flex; padding: 14px 18px; }  /* no side bar there: its search stays */
  .lp-find kbd { display: none; }
  .lp-dock { margin-top: 32px; }
  .lp-dock .st b { font-size: 20px; }
  .lp-wait { margin-top: 26px; padding: 14px 8px 8px; border-radius: 22px; }
}
/* its background: the logo's navy and cyan (as on the sign-in page) - a glow behind the clock, the logo's pluses and
   circles round the edges (.bg-deco in its colours, no pink) and a halo of rings round the clock */
:root:has(body.home-lp) {
  --grad: radial-gradient(46% 40% at 50% 0%, rgba(57, 192, 224, .26), transparent 70%),
          radial-gradient(40% 50% at 100% 100%, rgba(57, 192, 224, .14), transparent 70%),
          radial-gradient(120% 95% at 8% 0%, #d9f0f8 0%, #eaf5fa 40%, #f4f9fb 100%);
  --deco-fill: rgba(57, 192, 224, .14); --deco-fill-2: rgba(57, 192, 224, .10); --deco-stroke: rgba(30, 160, 200, .40);
  --deco-pink: rgba(57, 192, 224, .12); --deco-pink-stroke: rgba(30, 160, 200, .32); --plus: rgba(57, 192, 224, .80);
  --halo: rgba(30, 160, 200, .30); --halo-glow: rgba(57, 192, 224, .20); }
:root[data-theme="dark"]:has(body.home-lp) {
  --grad: radial-gradient(46% 40% at 50% 0%, rgba(57, 192, 224, .24), transparent 70%),
          radial-gradient(40% 50% at 100% 100%, rgba(57, 192, 224, .12), transparent 70%),
          radial-gradient(120% 95% at 8% 0%, #0f4560 0%, #0a2a3b 42%, #061b27 100%);
  --deco-fill: rgba(57, 192, 224, .10); --deco-fill-2: rgba(57, 192, 224, .08); --deco-stroke: rgba(57, 192, 224, .34);
  --deco-pink: rgba(57, 192, 224, .08); --deco-pink-stroke: rgba(57, 192, 224, .26); --plus: rgba(57, 192, 224, .85);
  --halo: rgba(57, 192, 224, .36); --halo-glow: rgba(57, 192, 224, .22); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):has(body.home-lp) {
  --grad: radial-gradient(46% 40% at 50% 0%, rgba(57, 192, 224, .24), transparent 70%),
          radial-gradient(40% 50% at 100% 100%, rgba(57, 192, 224, .12), transparent 70%),
          radial-gradient(120% 95% at 8% 0%, #0f4560 0%, #0a2a3b 42%, #061b27 100%);
  --deco-fill: rgba(57, 192, 224, .10); --deco-fill-2: rgba(57, 192, 224, .08); --deco-stroke: rgba(57, 192, 224, .34);
  --deco-pink: rgba(57, 192, 224, .08); --deco-pink-stroke: rgba(57, 192, 224, .26); --plus: rgba(57, 192, 224, .85);
  --halo: rgba(57, 192, 224, .36); --halo-glow: rgba(57, 192, 224, .22); } }
body.home-lp .bg-aurora { display: none; }
html.dk:has(body.home-lp) { background: var(--grad) fixed !important; background-color: #061b27 !important; }   /* ui.css paints dark pages its own way */
/* the halo: a glow and two rings round the clock, the logo's pluses beside it, two dots on the rings */
.lp-hero { position: relative; z-index: 0; }
.lp-halo { position: absolute; left: 50%; top: clamp(36px, min(4.2vw, 7vh), 70px); width: 0; height: 0; z-index: -1; pointer-events: none; }
.lp-halo i { position: absolute; display: block; border-radius: 50%; }
.lp-halo .g { width: 460px; height: 460px; left: -230px; top: -230px; background: radial-gradient(circle, var(--halo-glow), transparent 66%); }
.lp-halo .r1 { width: 540px; height: 540px; left: -270px; top: -270px; border: 1.5px solid var(--halo);
  -webkit-mask: linear-gradient(180deg, #000 45%, transparent 80%); mask: linear-gradient(180deg, #000 45%, transparent 80%); }
.lp-halo .r2 { width: 720px; height: 720px; left: -360px; top: -360px; border: 1.5px dashed var(--halo); opacity: .85;
  -webkit-mask: linear-gradient(180deg, #000 40%, transparent 70%); mask: linear-gradient(180deg, #000 40%, transparent 70%); }
.lp-halo .d1 { width: 12px; height: 12px; left: 226px; top: -152px; background: var(--plus); box-shadow: 0 0 12px var(--plus); }
.lp-halo .d2 { width: 8px; height: 8px; left: -300px; top: -200px; background: var(--plus); opacity: .7; }
.lp-halo .p { width: var(--s); height: var(--s); border-radius: 0; filter: drop-shadow(0 0 10px rgba(57, 192, 224, .5)); }
.lp-halo .p::before, .lp-halo .p::after { content: ""; position: absolute; background: var(--plus); border-radius: 999px; }
.lp-halo .p::before { left: 33%; top: 0; width: 34%; height: 100%; }
.lp-halo .p::after { left: 0; top: 33%; height: 34%; width: 100%; }
.lp-halo .p1 { --s: 34px; left: -420px; top: -10px; }
.lp-halo .p2 { --s: 22px; left: 380px; top: -96px; opacity: .8; }
.lp-halo .p3 { --s: 16px; left: 330px; top: 58px; opacity: .6; }
@media (max-width: 900px) { .lp-halo .r2, .lp-halo .p1, .lp-halo .p2, .lp-halo .p3, .lp-halo .d2 { display: none; }
  .lp-halo .g { width: 300px; height: 300px; left: -150px; top: -150px; }
  .lp-halo .r1 { width: 320px; height: 320px; left: -160px; top: -160px; }
  .lp-halo .d1 { left: 130px; top: -96px; } }
/* icons: the time of day by the greeting, a calendar by the date, each live number's own in the dock */
.lp-hero h1 { display: flex; justify-content: center; align-items: center; gap: 12px; }
.lp-dp { width: 1.05em; height: 1.05em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lp-dp.sun { color: #f2a93b; } .lp-dp.moon { color: #39c0e0; }
.lp-date { display: flex; justify-content: center; align-items: center; gap: 7px; }
.lp-date svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lp-dock .st-ico { display: block; position: static; width: 30px; height: 30px; margin: 0 0 6px; }

/* My profile › Personalization: Home's layout, light / dark, the sidebar and the background (choices kept at once) */
.pz-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pz-opts.pz-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pz-opts .sn-mode { cursor: pointer; }
.pz-pic { height: 70px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; gap: 5px; padding: 7px;
  background: color-mix(in srgb, var(--ink) 4%, transparent); }
.pz-pic i { display: block; border-radius: 4px; background: color-mix(in srgb, var(--ink) 14%, transparent); }
.pz-lp { align-items: center; justify-content: center; }
.pz-lp .t { width: 30%; height: 9px; }
.pz-lp .r { display: flex; gap: 5px; }
.pz-lp .r i { width: 13px; height: 13px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.pz-lp .d { width: 44%; height: 6px; }
.pz-cl .s { display: flex; gap: 4px; }
.pz-cl .s i { flex: 1; height: 9px; }
.pz-cl .g { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.pz-cl .g i { background: color-mix(in srgb, var(--accent) 32%, transparent); }
.pz-th .h { height: 9px; }
.pz-th .c { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.pz-th.light { background: #eef4f8; } .pz-th.light .h { background: #0a2a3b; } .pz-th.light .c i { background: #fff; }
.pz-th.dark { background: #07111a; border-color: #1c2a36; } .pz-th.dark .h { background: #152634; } .pz-th.dark .c i { background: #12202c; }
@media (max-width: 520px) { .pz-opts.pz-3 { grid-template-columns: 1fr 1fr; } }
