/* Support Hub admin panel
   Switchboard theme: quiet slate panels, one teal accent, status lamps. Rubik covers Hebrew + Latin. */

@font-face { font-family: Rubik; font-weight: 400; font-display: swap; src: url(/fonts/rubik-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AA; }
@font-face { font-family: Rubik; font-weight: 500; font-display: swap; src: url(/fonts/rubik-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AA; }
@font-face { font-family: Rubik; font-weight: 600; font-display: swap; src: url(/fonts/rubik-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AA; }
@font-face { font-family: Rubik; font-weight: 400; font-display: swap; src: url(/fonts/rubik-hebrew-400-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: Rubik; font-weight: 500; font-display: swap; src: url(/fonts/rubik-hebrew-500-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: Rubik; font-weight: 600; font-display: swap; src: url(/fonts/rubik-hebrew-600-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }

:root {
  /* Slate and teal (0.42). Text and buttons use the deeper teal for contrast (AA on white);
     the brighter one marks focus and small accents. */
  --page: #F8FAFC;
  --panel: #FFFFFF;
  --sunk: #F1F5F9;
  --ink: #0F172A;
  --muted: #64748B;
  --line: #E2E8F0;
  --accent: #0F766E;
  --accent-hover: #115E59;
  --accent-bright: #0D9488;
  --accent-ink: #FFFFFF;
  --accent-soft: #CCFBF1;
  --ok: #16A34A;
  --wait: #D97706;
  --fault: #DC2626;
  --fault-soft: #FEF2F2;
  --info: #2563EB;
  --bubble-in: #FFFFFF;
  --bubble-out: #CCFBF1;
  --bubble-sys: #F1F5F9;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --focus: 0 0 0 3px rgba(13, 148, 136, .35);
  --r-sm: 8px;
  --r-md: 12px;
  color-scheme: light;
}
/* Dark: its own palette (not inverted), by the system unless the user picked light; or picked dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0B1120; --panel: #111827; --sunk: #0F172A; --ink: #E2E8F0; --muted: #94A3B8; --line: #263244;
    --accent: #2DD4BF; --accent-hover: #5EEAD4; --accent-bright: #2DD4BF; --accent-ink: #042F2E; --accent-soft: #123C3A;
    --ok: #4ADE80; --wait: #FBBF24; --fault: #F87171; --fault-soft: #3B1D1D; --info: #60A5FA;
    --bubble-in: #1E293B; --bubble-out: #123C3A; --bubble-sys: #172033; --shadow: 0 1px 2px rgba(0, 0, 0, .3); --focus: 0 0 0 3px rgba(45, 212, 191, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0B1120; --panel: #111827; --sunk: #0F172A; --ink: #E2E8F0; --muted: #94A3B8; --line: #263244;
  --accent: #2DD4BF; --accent-hover: #5EEAD4; --accent-bright: #2DD4BF; --accent-ink: #042F2E; --accent-soft: #123C3A;
  --ok: #4ADE80; --wait: #FBBF24; --fault: #F87171; --fault-soft: #3B1D1D; --info: #60A5FA;
  --bubble-in: #1E293B; --bubble-out: #123C3A; --bubble-sys: #172033; --shadow: 0 1px 2px rgba(0, 0, 0, .3); --focus: 0 0 0 3px rgba(45, 212, 191, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font: 400 15px/1.5 Rubik, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 .75rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; max-width: 72ch; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.mono { font-variant-numeric: tabular-nums; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.nav { background: var(--panel); border-inline-end: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; font-weight: 600; font-size: 1.05rem; }
.brand img { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; white-space: nowrap; }
.brand-tenant { font-weight: 500; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.nav a:hover { background: var(--sunk); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 500; box-shadow: inset 3px 0 0 var(--accent); }
[dir="rtl"] .nav a[aria-current="page"], [dir="rtl"] .ws-item.current { box-shadow: inset -3px 0 0 var(--accent); }
.nav .count { font-size: .8rem; color: var(--muted); }
.nav .spacer { flex: 1; }
.nav .who { padding: 10px; border-top: 1px solid var(--line); margin-top: 8px; font-size: .88rem; }
.nav .who button { margin-top: 6px; }
.main { padding: 28px 36px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.menu-btn { display: none; }
.brand .nav-collapse { margin-inline-start: auto; padding: 2px 8px; border: 0; background: none; color: var(--muted); font-size: 1.1rem; }
.brand .nav-collapse:hover { color: var(--ink); background: var(--sunk); }
@media (min-width: 861px) {
  body.nav-collapsed .shell { grid-template-columns: 1fr; }
  body.nav-collapsed .nav { display: none; }
  body.nav-collapsed .main > .menu-btn { display: inline-flex; margin-bottom: 12px; }
}
@media (max-width: 860px) { .brand .nav-collapse { display: none; } }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; inset: 0 auto 0 0; width: 240px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  .nav.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .main { padding: 16px 16px 48px; }
  .menu-btn { display: inline-flex; margin-bottom: 12px; }
}

/* ---------- Panels, forms ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 18px; }
.panel.flush { padding: 0; overflow: hidden; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.grid2 > .panel { margin-bottom: 0; }

label.field, div.field { display: block; margin-bottom: 14px; max-width: 560px; }
label.field > span, div.field > span { display: block; font-weight: 500; margin-bottom: 4px; font-size: .92rem; }
label.field > small, div.field > small { display: block; color: var(--muted); margin-top: 4px; font-size: .84rem; }
input[type=text], input[type=tel], input[type=password], input[type=url], input[type=email], input[type=number], input[type=search], input[type=time], input[type=date], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px;
}
textarea { min-height: 70px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); vertical-align: -3px; margin: 0 6px 0 0; }
.check { display: flex; align-items: flex-start; gap: 2px; margin-bottom: 12px; }
.check small { display: block; color: var(--muted); }

button, .btn {
  font: inherit; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 7px 14px; border-radius: var(--r-sm); text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--fault); }
button.danger:hover { border-color: var(--fault); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
button:disabled { opacity: .55; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.error-box { background: var(--fault-soft); color: var(--fault); border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 12px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: .85rem; background: var(--sunk); }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--muted); font-size: .85rem; }
.empty { padding: 28px 20px; color: var(--muted); }

/* ---------- Lamps (status) ---------- */
.lamp { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.lamp.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.lamp.wait { background: var(--wait); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wait) 25%, transparent); }
.lamp.fault { background: var(--fault); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fault) 22%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .lamp.wait { animation: blink 1.6s ease-in-out infinite; }
  @keyframes blink { 50% { opacity: .35; } }
}
.status { display: inline-flex; align-items: center; gap: 8px; }
.tag { display: inline-block; font-size: .8rem; padding: 1px 8px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); color: var(--muted); }
.tag.open { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.tag.bad { color: var(--fault); border-color: color-mix(in srgb, var(--fault) 40%, transparent); background: var(--fault-soft); }

/* ---------- Switchboard (dashboard centrepiece) ---------- */
.board { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 0; margin-bottom: 18px; }
.board-row { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(120px, 2fr) minmax(150px, 1fr); align-items: center; padding: 14px 22px; gap: 0; }
.board-row + .board-row { border-top: 1px dashed var(--line); }
.jack { display: flex; align-items: center; gap: 10px; min-width: 0; }
.jack b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jack .sub { display: block; font-size: .82rem; color: var(--muted); }
.jack.right { justify-content: flex-end; text-align: end; }
.cable { height: 34px; position: relative; margin: 0 14px; }
.cable svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cable path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.cable.idle path { stroke: var(--line); stroke-dasharray: 2 6; }
.cable .plug { fill: var(--panel); stroke: var(--accent); stroke-width: 2.5; }
.cable.idle .plug { stroke: var(--line); }
.cable .label { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); font-size: .78rem; color: var(--muted); background: var(--panel); padding: 0 6px; white-space: nowrap; }
@media (max-width: 640px) {
  .board-row { grid-template-columns: 1fr; gap: 6px; }
  .cable { display: none; }
  .jack.right { justify-content: flex-start; text-align: start; padding-inline-start: 20px; }
}

.figures { display: flex; gap: 36px; flex-wrap: wrap; margin-bottom: 4px; }
.figures div { min-width: 90px; }
.figures strong { display: block; font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.figures span { color: var(--muted); font-size: .88rem; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; margin-top: 14px; }
.bars .day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.bars .stack { width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; height: 80px; }
.bars .in { background: var(--accent); border-radius: 3px 3px 0 0; }
.bars .out { background: color-mix(in srgb, var(--accent) 35%, var(--panel)); }
.bars small { color: var(--muted); font-size: .75rem; }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 5px; vertical-align: -1px; }

.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.events li:last-child { border-bottom: 0; }
.events time { color: var(--muted); font-size: .82rem; }
.events .error { color: var(--fault); }

/* ---------- Conversations ---------- */
.inbox { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; height: calc(100vh - 150px); min-height: 480px; }
.inbox-list { border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inbox-filters { padding: 12px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg button { flex: 1; border: 0; border-radius: 0; justify-content: center; padding: 6px 8px; font-weight: 400; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--accent-soft); font-weight: 500; }
.convs { overflow-y: auto; flex: 1; }
.conv { display: block; width: 100%; text-align: start; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 11px 14px; background: none; font-weight: 400; }
.conv:hover { background: var(--sunk); }
.conv[aria-current="true"] { background: var(--accent-soft); }
.conv .top { display: flex; justify-content: space-between; gap: 8px; }
.conv .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv time { color: var(--muted); font-size: .8rem; flex: none; }
.conv .preview { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; margin-top: 2px; }
.conv .meta { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }

.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.thread-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.thread-head h2 { margin: 0; text-align: start; unicode-bidi: plaintext; }
.messages { flex: 1; overflow-y: auto; padding: 18px 20px; background: var(--sunk); display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: min(560px, 80%); padding: 8px 12px; border-radius: 12px; background: var(--bubble-in); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; align-self: flex-start; }
.msg.out { align-self: flex-end; background: var(--bubble-out); border-color: transparent; }
.msg.system, .msg.bot { background: var(--bubble-sys); border-style: dashed; }
.msg .by { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 2px; white-space: normal; }
.msg .when { display: block; font-size: .74rem; color: var(--muted); margin-top: 3px; text-align: end; }
.msg.failed { border: 1px solid var(--fault); }
.msg .err { display: block; color: var(--fault); font-size: .8rem; margin-top: 4px; white-space: normal; }
.msg img, .msg video { max-width: 100%; max-height: 300px; border-radius: 8px; display: block; margin-top: 4px; }
.msg audio { display: block; margin-top: 4px; max-width: 100%; }
.composer { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { min-height: 44px; max-height: 180px; }
.composer-note { border-top: 1px solid var(--line); padding: 12px 20px; color: var(--muted); font-size: .9rem; }
.thread-empty { margin: auto; color: var(--muted); padding: 40px; text-align: center; }
@media (max-width: 860px) {
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox.has-thread .inbox-list { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
  .messages { max-height: 60vh; }
}

/* ---------- Channel linking ---------- */
.link-box { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 16px; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--sunk); margin-top: 12px; }
.link-box img { width: 232px; height: 232px; background: #fff; padding: 8px; border-radius: 8px; }
.code { font-size: 2.1rem; font-weight: 600; letter-spacing: .12em; padding: 6px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); }
.link-box ol { margin: 0; padding-inline-start: 20px; }

/* ---------- Hours ---------- */
.week { display: grid; gap: 0; }
.week .day { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.week .day:last-child { border-bottom: 0; }
.ranges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.range { display: inline-flex; gap: 4px; align-items: center; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px 6px; }
.range input { width: 108px; padding: 4px 6px; }
.range button { padding: 2px 7px; border: 0; background: none; color: var(--muted); }

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .panel { width: 100%; max-width: 400px; padding: 28px; }
.auth .brand { padding: 0 0 18px; }
.auth h1 { font-size: 1.35rem; margin-bottom: 6px; }
.totp-qr { width: 200px; height: 200px; background: #fff; padding: 6px; border-radius: 8px; display: block; margin: 10px 0; }
.secret { font-size: .9rem; word-break: break-all; background: var(--sunk); padding: 6px 8px; border-radius: var(--r-sm); }

/* ---------- Modal + toast ---------- */
dialog { border: 1px solid var(--line); border-radius: var(--r-md); padding: 0; background: var(--panel); color: var(--ink); width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
dialog::backdrop { background: rgba(10, 20, 30, .45); }
dialog form.body { padding: 22px 24px; overflow-y: auto; max-height: calc(100vh - 140px); }
dialog .foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--sunk); }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--page); padding: 9px 16px; border-radius: var(--r-sm); font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; }
#toast.bad { background: var(--fault); color: #fff; }

.rtl-input { direction: rtl; text-align: right; }
.placeholders { font-size: .84rem; color: var(--muted); }
.placeholders code { background: var(--sunk); padding: 0 4px; border-radius: 4px; }

/* ---------- v0.2: nav groups, account menu ---------- */
.nav-group { margin: 14px 10px 4px; font-size: .8rem; color: var(--muted); }
.nav .who { position: relative; }
.who-btn { width: 100%; border: 0; background: none; padding: 6px; justify-content: flex-start; gap: 10px; text-align: start; font-weight: 400; }
.who-btn:hover { background: var(--sunk); }
.who-btn b { display: block; font-weight: 500; }
.who-btn small { display: block; color: var(--muted); font-size: .8rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-weight: 600; flex: none; }
.acct-menu { position: absolute; bottom: calc(100% + 6px); inset-inline: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; box-shadow: 0 12px 30px rgba(10, 20, 30, .18); z-index: 30; }
.acct-menu button { display: flex; width: 100%; border: 0; background: none; font-weight: 400; padding: 8px 10px; }
.acct-menu button:hover, .acct-menu button:focus-visible { background: var(--sunk); }
.acct-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.context-help { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 50%; font-weight: 600; }

/* ---------- auth extras ---------- */
.or-google, .or-email { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; justify-items: stretch; }
.or-google > span { text-align: center; margin-top: -26px; background: var(--panel); justify-self: center; padding: 0 8px; }
.btn.google { justify-content: center; }
.or-email .row input { flex: 1; min-width: 160px; }
.tfa-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.tfa-options > div { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
@media (max-width: 640px) { .tfa-options { grid-template-columns: 1fr; } }
.changelog h3 { margin-top: 14px; }
.changelog ul { margin: 0; padding-inline-start: 20px; }
fieldset.plain { border: 0; padding: 0; margin: 0 0 14px; }
fieldset.plain legend { font-weight: 500; font-size: .92rem; margin-bottom: 6px; padding: 0; }
.ch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; padding-inline-start: 24px; }

/* ---------- Release Center ---------- */
.update-status.running { border-color: var(--wait); }
.update-status.done { border-color: var(--ok); }
.update-status.failed { border-color: var(--fault); }
.error-text { color: var(--fault); margin: 8px 0 0; }
td.changes pre { white-space: pre-wrap; font: inherit; font-size: .86rem; margin: 6px 0 0; max-width: 46ch; }
td.changes summary { cursor: pointer; color: var(--accent); }

/* ---------- Hebrew text, holidays, calendar ---------- */
.he { font-family: Rubik, system-ui, sans-serif; unicode-bidi: plaintext; }
.holiday-rules td { vertical-align: middle; padding: 8px 10px; }
.holiday-rules td:first-child .he { font-weight: 500; }
.holiday-rules select { width: auto; min-width: 140px; }
.calendar-wrap { min-width: 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cal-head > div { text-align: center; display: grid; }
.cal-head button { width: 34px; height: 34px; justify-content: center; padding: 0; font-size: 1.2rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-dow { text-align: center; font-size: .78rem; color: var(--muted); padding-bottom: 2px; display: grid; }
.cal-dow .he { font-size: .72rem; }
.cal-day { min-height: 74px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 5px; display: flex; flex-direction: column; gap: 1px; font-size: .74rem; min-width: 0; background: var(--panel); }
.cal-day.empty { border: 0; background: none; }
.cal-day.special { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.cal-day.closed .cal-hours { color: var(--fault); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-top { display: flex; justify-content: space-between; gap: 4px; align-items: baseline; }
.cal-top b { font-size: .88rem; }
.cal-top .he { color: var(--muted); }
.cal-hol { color: var(--accent); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-hours { color: var(--muted); margin-top: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .cal-day { min-height: 54px; } .cal-hours, .cal-hol { display: none; } .cal-day.special::after { content: '•'; color: var(--accent); } }

/* ---------- Help center ---------- */
.help-center { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.help-nav { position: sticky; top: 16px; padding: 10px; display: flex; flex-direction: column; gap: 1px; max-height: calc(100vh - 40px); overflow-y: auto; }
.help-nav a { padding: 6px 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-size: .92rem; }
.help-nav a:hover { background: var(--sunk); }
.help-nav a[aria-current="page"] { background: var(--accent-soft); font-weight: 500; }
.help-nav .download { margin-top: 12px; color: var(--accent); font-size: .86rem; }
.help-body { padding: 26px 32px; min-width: 0; }
.help-body h1 { margin-bottom: 14px; }
.help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 22px; }
.help-card { display: block; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; text-decoration: none; color: var(--ink); }
.help-card:hover { border-color: var(--accent); }
.help-card b { display: block; margin-bottom: 4px; }
.help-card span { color: var(--muted); font-size: .88rem; }
.article-body { max-width: 74ch; line-height: 1.65; }
.article-body h2 { font-size: 1.12rem; margin: 26px 0 8px; }
.article-body h3 { font-size: 1rem; margin: 20px 0 6px; }
.article-body ul, .article-body ol { padding-inline-start: 22px; }
.article-body li { margin: 4px 0; }
.article-body li.sub { margin-inline-start: 18px; list-style: circle; }
.article-body code { background: var(--sunk); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: .9em; }
.article-body pre { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; overflow-x: auto; }
.article-body pre code { border: 0; padding: 0; background: none; }
.article-body table { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--r-sm); }
.article-body .tip { background: var(--accent-soft); border-inline-start: 3px solid var(--accent); padding: 10px 14px; border-radius: var(--r-sm); margin: 14px 0; }
.article-body kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font: inherit; font-size: .85em; }
.next-article { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .help-center { grid-template-columns: 1fr; } .help-nav { position: static; max-height: none; } .help-body { padding: 18px; } }

/* ---------- Tour ---------- */
.tour { position: fixed; inset: 0; z-index: 60; }
.tour-shade { position: absolute; inset: 0; background: rgba(10, 20, 30, .55); }
.tour.has-spot .tour-shade { background: transparent; }
.tour-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(10, 20, 30, .55), 0 0 0 3px var(--accent); pointer-events: none; display: none; }
.tour-card { position: fixed; width: min(360px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); padding: 16px 18px 14px; }
.tour-step { font-size: .8rem; color: var(--muted); }
.tour-card h3 { margin: 4px 0 6px; font-size: 1.08rem; }
.tour-card p { margin: 0 0 14px; line-height: 1.55; }
.tour-actions { display: flex; gap: 6px; align-items: center; }
.tour-actions > span { flex: 1; }
@media (prefers-reduced-motion: no-preference) { .tour-spot { transition: all .18s ease; } }

/* ---------- v0.3: attachments, API tokens ---------- */
.composer { align-items: flex-end; }
.composer-main { flex: 1; display: grid; gap: 6px; min-width: 0; }
.attach-btn { padding: 7px 10px; font-size: 1.05rem; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--sunk); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: .86rem; max-width: 100%; justify-self: start; }
.attach-chip button { border: 0; background: none; padding: 0 6px; color: var(--muted); }
.file-link { display: inline-block; margin-top: 4px; word-break: break-all; }
tr.revoked td { opacity: .55; }
pre.code { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; white-space: pre-wrap; word-break: break-all; font-size: .85rem; direction: ltr; text-align: left; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }

/* Manager permissions */
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; }
.perm-group h4 { margin: 6px 0 2px; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.perm-group .check { margin-bottom: 4px; }
.danger-perm > span::after { content: 'Sensitive'; margin-inline-start: 6px; font-size: .72rem; padding: 0 6px; border-radius: 999px; color: var(--fault); border: 1px solid color-mix(in srgb, var(--fault) 40%, transparent); }
.perm-list { margin: 0; padding-inline-start: 18px; columns: 2 240px; }

/* Update progress */
.upd-dialog { width: min(560px, calc(100vw - 32px)); }
.upd-dialog .body { padding: 24px 26px 18px; }
.upd-dialog h2 { margin: 0 0 4px; }
.upd-bar { height: 6px; border-radius: 999px; background: var(--sunk); overflow: hidden; margin: 18px 0 12px; }
.upd-bar > div { height: 100%; width: 0; background: var(--accent); transition: width .6s ease; }
.upd-dialog.ok .upd-bar > div { background: var(--ok); }
.upd-dialog.failed .upd-bar > div { background: var(--fault); }
.upd-headline { font-weight: 500; margin: 0 0 12px; min-height: 1.4em; }
.upd-dialog.failed .upd-headline { color: var(--fault); }
.upd-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.upd-steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .92rem; }
.upd-steps li.current, .upd-steps li.failed { color: var(--ink); font-weight: 500; }
.upd-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; box-sizing: border-box; }
.upd-steps li.done .upd-dot { background: var(--ok); border-color: var(--ok); }
.upd-steps li.current .upd-dot { border-color: var(--accent); border-top-color: transparent; animation: upd-spin .9s linear infinite; }
.upd-steps li.failed .upd-dot { background: var(--fault); border-color: var(--fault); }
@keyframes upd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .upd-steps li.current .upd-dot { animation: none; background: var(--accent); } .upd-bar > div { transition: none; } }
.upd-details { margin-top: 10px; }
.upd-log { max-height: 180px; overflow: auto; font-size: .78rem; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm, 6px); padding: 8px 10px; white-space: pre-wrap; direction: ltr; }
.version-banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 6px 24px rgba(0,0,0,.15); padding: 10px 14px; max-width: calc(100vw - 32px); }

/* Password with Generate / Show / Copy */
.pw-row { display: flex; gap: 6px; align-items: stretch; }
.pw-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; direction: ltr; }
.pw-row .pw-btn { flex: none; padding-inline: 10px; }
@media (max-width: 520px) { .pw-row { flex-wrap: wrap; } .pw-row input { flex-basis: 100%; } }

/* Website chat admin */
.wc-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-inline-end: 8px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.12); }
.wc-color { width: 44px; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.wc-preview { --wc: #0f766e; position: relative; height: 92px; border: 1px dashed var(--line); border-radius: var(--r-md); margin: 0 0 14px; background: var(--sunk); overflow: hidden; }
.wc-preview-head { position: absolute; right: 64px; bottom: 14px; width: 170px; padding: 8px 12px; border-radius: 10px; background: var(--wc); color: #fff; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-preview-btn { position: absolute; right: 12px; bottom: 12px; width: 42px; height: 42px; border-radius: 50%; background: var(--wc); box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.wc-preview.left .wc-preview-head { right: auto; left: 64px; }
.wc-preview.left .wc-preview-btn { right: auto; left: 12px; }
.grid2.tight { gap: 0 14px; }
.code-block { margin-bottom: 16px; }
.code-block h3 { margin: 0; font-size: .95rem; flex: 1; }
.code-block pre { margin: 6px 0 0; padding: 10px 12px; background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; font-size: .78rem; overflow-x: auto; white-space: pre; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.conv-context { margin-top: 6px; font-size: .85rem; }
.ai-summary { margin-top: 8px; font-size: .88rem; max-width: 70ch; }
.ai-summary summary { cursor: pointer; font-weight: 600; }
.ai-summary-text { white-space: pre-wrap; background: var(--sunk); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.msg .ai-text { display: block; white-space: pre-wrap; font-size: .85em; opacity: .85; border-inline-start: 3px solid currentColor; padding-inline-start: 8px; margin-top: 4px; }
.conv-context pre { margin: 6px 0 0; white-space: pre-wrap; font: inherit; background: var(--sunk); border-radius: 8px; padding: 8px 10px; }

.ask-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }

/* Changelog notes (Release Center, What's new) */
td.changes .article-body { font-size: .88rem; line-height: 1.5; max-width: 52ch; }
.changelog .article-body { font-size: .92rem; line-height: 1.55; }
td.changes .article-body ul, .changelog .article-body ul { margin: 6px 0 0; }
td .article-body li.sub { display: list-item; color: inherit; font-size: inherit; margin-top: 4px; }

.indent { margin-inline-start: 28px; }

/* Drive space */
.storage { margin-top: 16px; }
.disk-meter { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--sunk); margin: 12px 0 6px; }
.disk-meter .hub, .legend i.hub { background: var(--accent); }
.disk-meter .sys, .legend i.sys { background: color-mix(in srgb, var(--accent) 35%, var(--panel)); }
.legend i.free { background: var(--sunk); outline: 1px solid color-mix(in srgb, currentColor 20%, transparent); }
.disk-meter.low .hub { background: var(--bad, #c0392b); }
.storage-parts { width: 100%; border-collapse: collapse; margin-top: 12px; }
.storage-parts td { padding: 6px 4px; vertical-align: middle; border-top: 1px solid var(--line, rgba(0,0,0,.08)); }
.storage-parts .sub { display: block; font-size: .8em; opacity: .7; }
.storage-parts .bar-cell { width: 40%; }
.storage-parts .part-bar { display: block; height: 8px; min-width: 2px; border-radius: 4px; background: var(--accent); }
.storage-parts .num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Admin viewing as another user */
.viewas-banner { position: sticky; top: 0; z-index: 50; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 8px 16px; background: #b45309; color: #fff; font-size: .92rem; }
.viewas-banner button { background: #fff; color: #7c2d12; border: 0; font-weight: 600; }
.support-banner { background: #1d4ed8; }
.support-banner button { color: #1e3a8a; }
.shell.with-banner { min-height: calc(100vh - 44px); }
.shell.with-banner .nav { top: 44px; height: calc(100vh - 44px); }

.disk-block + .disk-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.disk-block h3 { margin: 0 0 6px; font-size: .95rem; }
.import-list { display: grid; gap: 8px; max-height: 50vh; overflow: auto; }

.msg .held { display: block; font-size: .82em; opacity: .75; margin-top: 4px; }

/* Menu: scrolls when it doesn't fit, Settings folds away, tighter on short screens */
.nav .nav-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.nav .nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav .nav-items[hidden] { display: none; }
button.nav-group { display: flex; align-items: center; justify-content: space-between; width: auto; background: none; border: 0; padding: 6px 10px; margin: 12px 0 2px; font: inherit; font-size: .8rem; color: var(--muted); cursor: pointer; border-radius: var(--r-sm); text-align: start; }
button.nav-group:hover { background: var(--sunk); color: var(--ink); }
button.nav-group .chev { transition: transform .15s; }
button.nav-group[aria-expanded="false"] .chev { transform: rotate(-90deg); }
@media (max-height: 760px) {
  .nav { padding-top: 12px; padding-bottom: 8px; }
  .nav a { padding: 5px 10px; }
  .nav .brand { padding-bottom: 8px; }
  button.nav-group { margin-top: 6px; }
  .nav .who { padding: 6px 10px; margin-top: 4px; }
}
.nav #nav-help { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 10px; }

/* "New message": picking the customer in the helpdesk */
.pick-list { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; margin: -6px 0 10px; }
.pick-list:empty { display: none; }
.pick { display: grid; gap: 2px; text-align: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.pick:hover, .pick:focus-visible { border-color: var(--accent); }
.picked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 8px; margin: -6px 0 12px; background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.picked > span:first-child { flex: 1 1 auto; }

/* AI review */
.review-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--panel); }
.review-item > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.review-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 900px) { .review-cols { grid-template-columns: 1fr; } }
.review-col h4, .review-suggest h4 { margin: 0 0 6px; font-size: .85rem; color: var(--muted); }
.review-text { white-space: pre-wrap; background: var(--sunk); border-radius: 8px; padding: 8px 10px; font-size: .9rem; max-height: 260px; overflow-y: auto; }
.review-suggest { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.bubble-preview { white-space: pre-wrap; background: var(--sunk); border-radius: 10px; padding: 10px 12px; margin: 6px 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; margin-bottom: 10px; }
.tag.warn { color: color-mix(in srgb, var(--wait) 70%, var(--ink, currentColor)); border-color: color-mix(in srgb, var(--wait) 45%, transparent); background: color-mix(in srgb, var(--wait) 14%, var(--panel)); }
.kb-targets { display: grid; gap: 6px; margin: 6px 0 10px; }
.kb-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.kb-row .tag { margin-inline-start: 6px; }

/* ---------- Agent toolbar ---------- */
.main-col { min-width: 0; display: flex; flex-direction: column; }
#agentbar-slot:empty { display: none; }
#agentbar-slot { position: sticky; top: 0; z-index: 30; }
.agentbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 16px; background: #12262C; color: #F4F8F9; font-size: .9rem; }
.agentbar button, .agentbar a { font: inherit; }
.ab-ext { color: #9DB4BA; font-size: .82rem; }
.ab-status-wrap { position: relative; }
.ab-status { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #4B6B73; background: transparent; color: #fff; font-weight: 500; }
.ab-status.ready { background: #163F35; border-color: #2F8A5E; }
.ab-status.paused { background: #4A3A12; border-color: #B8862A; }
.ab-dot { width: 9px; height: 9px; border-radius: 50%; background: #5D7880; flex: none; }
.ab-status.ready .ab-dot { background: #43B873; }
.ab-status.paused .ab-dot { background: #E2B13A; }
.ab-time { color: #9DB4BA; font-variant-numeric: tabular-nums; }
.ab-menu { position: absolute; top: 42px; inset-inline-start: 0; z-index: 40; width: 260px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(10,30,36,.22); padding: 6px; display: grid; gap: 2px; }
.ab-menu button { text-align: start; border: 0; background: transparent; color: inherit; padding: 9px 12px; border-radius: 8px; }
.ab-menu button:hover:not(:disabled), .ab-menu button.on { background: var(--accent-soft); }
.ab-menu .ab-resume { font-weight: 600; color: var(--ok, #1F9D5C); }
.ab-menu-label { font-size: .78rem; color: var(--muted); padding: 6px 12px 2px; }
.ab-queues { display: flex; flex-wrap: wrap; gap: 6px; }
.ab-queue { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px dashed #4B6B73; background: transparent; color: #9DB4BA; font-size: .85rem; }
.ab-queue.in { border-style: solid; border-color: #3D7F87; background: #1F4F55; color: #fff; }
.ab-queue.in .ab-dot { background: #43B873; }
.ab-queue.in.paused .ab-dot { background: #E2B13A; }
.ab-wait { color: #F2C46D; }
.ab-call { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; border: 1px solid #2E5660; background: #1C3940; color: #fff; text-decoration: none; }
.ab-call.ringing { border-color: #2BA8A6; animation: ab-ring 1s ease-in-out infinite alternate; }
.ab-call.ringing .ab-dot { background: #2BA8A6; }
.ab-call.oncall .ab-dot { background: #E0634F; }
.ab-call:hover { color: #fff; border-color: #2BA8A6; }
.ab-open { color: #2BA8A6; font-weight: 600; }
@keyframes ab-ring { from { box-shadow: 0 0 0 0 rgba(43,168,166,.0); } to { box-shadow: 0 0 0 4px rgba(43,168,166,.35); } }
@media (prefers-reduced-motion: reduce) { .ab-call.ringing { animation: none; } }
.ab-warn { color: #F2C46D; font-size: .85rem; }
.ab-notif { border: 1px solid #4B6B73; background: transparent; color: #fff; border-radius: 8px; height: 32px; padding: 0 10px; }
.ab-pop { position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 100; display: flex; gap: 12px; align-items: center; background: var(--panel); color: var(--ink); border: 1px solid var(--accent); border-radius: 14px; box-shadow: 0 16px 40px rgba(10,30,36,.25); padding: 14px 16px; max-width: 420px; }
.ext-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.ext-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ab-callwrap { display: inline-flex; gap: 6px; align-items: center; }
.ab-xfer { height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid #4B7883; background: transparent; color: #fff; }
.xfer-list { display: grid; gap: 4px; margin: 8px 0; }
.xfer-item { display: flex; gap: 8px; align-items: center; text-align: start; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 10px; }
.xfer-item .tag { margin-inline-start: auto; }
.call-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .call-grid { grid-template-columns: 1fr; } }
.ai-call .ai-need { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 8px 0; display: grid; gap: 4px; }
.ai-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ai-suggest { white-space: pre-wrap; background: var(--sunk); border-radius: 10px; padding: 10px 12px; margin: 4px 0; line-height: 1.55; }
.ai-transcript { max-height: 360px; overflow-y: auto; display: grid; gap: 6px; margin-top: 4px; }
.ai-transcript .tline { display: grid; gap: 1px; padding: 2px 0; }
.ai-transcript .who { font-size: .75rem; font-weight: 600; color: var(--muted); }
.ai-transcript .tline.customer .who { color: #2B6CB0; }
.rec-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--fault); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fault) 25%, transparent); }
.ab-dial { display: inline-flex; align-items: center; gap: 0; border: 1px solid #4B6B73; border-radius: 8px; overflow: hidden; }
.ab-dial input { width: 150px; height: 32px; border: 0; border-radius: 0; background: transparent; color: #fff; padding: 0 10px; box-shadow: none; }
.ab-dial input::placeholder { color: #9DB4BA; }
.ab-dial button { display: inline-flex; align-items: center; gap: 6px; height: 32px; border: 0; border-inline-start: 1px solid #4B6B73; background: #2BA8A6; color: #06201F; font-weight: 600; padding: 0 12px; }
/* Take a waiting caller */
.ab-queues { position: relative; }
.ab-take { height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid #E0A43A; background: rgba(224,164,58,.18); color: #fff; font-weight: 600; }
.ab-takemenu { width: 320px; inset-inline-start: auto; }
.waiting-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 0; }
.small-btn { padding: 3px 10px; font-size: .85rem; border-radius: 6px; }
.small-select { padding: 3px 6px; font-size: .85rem; max-width: 170px; }
/* Waiting list on hover (bar queue chip) */
.ab-queue { position: relative; }
.ab-waitlist { display: none; position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 45; min-width: 360px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(10,30,36,.22); padding: 6px 4px; text-align: start; font-weight: 400; }
.ab-queue:hover .ab-waitlist, .ab-queue:focus-visible .ab-waitlist { display: block; }
.ab-waitrow { display: flex; gap: 8px; align-items: center; padding: 6px 12px; white-space: nowrap; }
.ab-waitrow .ab-time { margin-inline-start: auto; color: var(--muted); }
.who-line { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cid-tag { font-size: .75rem; padding: 0 6px; }
/* Insights on calls */
.insights { display: grid; gap: 10px; margin: 8px 0 12px; }
.risk-banner { background: var(--fault-soft); color: var(--fault); border: 1px solid color-mix(in srgb, var(--fault) 35%, transparent); border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.talkbar-track { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line); margin-top: 4px; }
.talkbar-agent { background: var(--accent); }
.talkbar-cust { background: color-mix(in srgb, var(--wait) 70%, transparent); }
.review-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.ck { font-weight: 700; width: 1.2em; text-align: center; }
.ck.ok { color: var(--ok, #1F9D5C); } .ck.bad { color: var(--fault); } .ck.muted { color: var(--muted); }
.coach, .coach-note { background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; }
.score { display: inline-block; min-width: 2.4em; text-align: center; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.score.ok { background: color-mix(in srgb, var(--ok, #1F9D5C) 16%, transparent); color: var(--ok, #1F9D5C); }
.score.warn { background: color-mix(in srgb, var(--wait) 18%, transparent); color: color-mix(in srgb, var(--wait) 70%, var(--ink)); }
.score.bad { background: var(--fault-soft); color: var(--fault); }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--accent-soft); }
.ab-waitrow .who-line { flex-wrap: nowrap; }

/* live updates: lines still being said, a partly-down PBX link, the live link lost */
.ai-transcript .tline.partial span[dir] { color: var(--muted); font-style: italic; }
.warn-text { color: #B7791F; }
.live-lost .live-fresh::after { content: ' · reconnecting…'; color: #B7791F; }

/* Queues live: counters, filters, sortable columns, wall screen mode */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 0 0 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.kpi-v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-l { font-size: .78rem; color: var(--muted); }
.kpi.ok .kpi-v { color: var(--ok); }
.kpi.warn .kpi-v { color: #B7791F; }
.kpi.bad .kpi-v { color: var(--fault); }
.board-filters { margin: 0 0 14px; }
.board-filters input[type=search] { max-width: 240px; }
.board-filters select { width: auto; }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.th-sort:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tv { font-size: 1.25rem; }
.tv .kpi-v { font-size: 2.6rem; }
.tv .kpi-l { font-size: 1rem; }
.tv table td, .tv table th { padding-top: 10px; padding-bottom: 10px; }
.tv .board-filters input[type=search] { display: none; }

/* Calls: hang up, a second call, the inspector, the PBX servers */
.ab-hangup { height: 34px; padding: 0 12px; border-radius: 8px; background: transparent; color: #fff; border: 1px solid color-mix(in srgb, var(--fault) 70%, #fff); }
.ab-hangup:hover { background: var(--fault); }
.ab-more { margin-inline-start: 6px; white-space: nowrap; }
details.tech summary { cursor: pointer; font-weight: 600; }
table.kv th { text-align: start; font-weight: 500; color: var(--muted); padding-inline-end: 14px; white-space: nowrap; }
table.kv td { word-break: break-all; }
.node-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 8px 0; }
.node-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; display: grid; gap: 3px; }

/* Message delivery under a message to a customer */
.msg .dlv { display: block; font-size: .75rem; color: var(--muted); margin-top: 2px; }
.msg .dlv .dlv-icon { font-weight: 700; }
.msg .dlv-read .dlv-icon { color: #3182CE; }
.msg .dlv-delivered .dlv-icon, .msg .dlv-accepted .dlv-icon { color: var(--muted); }
.msg .dlv-retry_wait, .msg .dlv-uncertain { color: #B7791F; }
.msg .dlv-failed { color: var(--fault); }
.msg .dlv button.link { font-size: .75rem; padding: 0; }
.msg.uncertain { border-style: dashed; }

/* The AI summary under the conversation's header (not beside its buttons) */
.thread > .ai-summary { margin: 0; padding: 8px 20px; max-width: none; border-bottom: 1px solid var(--line); max-height: 40vh; overflow: auto; flex: none; }
.conv-actions { align-self: flex-start; }

/* Shared inbox: notes, owner, bulk, composer tabs, mentions */
.msg.note { align-self: center; background: #FFF8E1; border: 1px dashed #D69E2E; color: #5F4B12; max-width: 85%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg.note { background: #3A3218; color: #F3E3B3; border-color: #8C6D1F; } }
:root[data-theme="dark"] .msg.note { background: #3A3218; color: #F3E3B3; border-color: #8C6D1F; }
.msg.note .mention { color: inherit; }
.conv-row { display: flex; align-items: flex-start; gap: 6px; }
.conv-row .conv { flex: 1; min-width: 0; }
.conv-pick { margin: 14px 0 0 10px; }
.bulk-bar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--sunk); font-size: .88rem; }
.bulk-bar[hidden] { display: none; }
.bulk-bar select { width: auto; }
.tag.owner { color: var(--ink); }
.tag.muted-tag { opacity: .75; }
.owner-select, .pri-select, .conv-actions select { width: auto; max-width: 190px; }
.composer-wrap { border-top: 1px solid var(--line); padding: 6px 12px 10px; display: grid; gap: 6px; }
.composer-wrap .composer { border-top: 0; padding: 0; }
.composer-wrap.note-mode textarea { background: #FFF8E1; }
.compose-tabs button { padding: 3px 10px; font-size: .85rem; }
.composer-main { position: relative; }
.mention-list { position: absolute; bottom: 100%; inset-inline-start: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); display: grid; min-width: 220px; z-index: 5; }
.mention-list[hidden] { display: none; }
.mention-list button { text-align: start; background: none; border: 0; padding: 6px 10px; }
.mention-list button:hover { background: var(--sunk); }
.writers:empty { display: none; }
.nav-badge { margin-inline-start: 6px; font-size: .72rem; background: var(--fault); color: #fff; border-radius: 999px; padding: 0 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .composer-wrap.note-mode textarea { background: #3A3218; } }
:root[data-theme="dark"] .composer-wrap.note-mode textarea { background: #3A3218; }
.msg.note > .small { display: block; margin-top: 2px; }

/* Search hits, saved replies, jumping to a message */
.preview.hit mark { background: color-mix(in srgb, #F6E05E 55%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.seg-small button { padding: 3px 10px; font-size: .82rem; }
.mention-list .qr-item { display: block; width: 100%; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-list .qr-item[aria-selected="true"] { background: var(--sunk); }
.msg.flash, .note.flash { outline: 3px solid #F6E05E; outline-offset: 2px; transition: outline-color 2s; }

/* The customer beside the conversation */
.customer-panel { display: none; border-inline-start: 1px solid var(--line); overflow-y: auto; min-height: 0; padding: 0 14px 14px; }
.inbox.with-customer { grid-template-columns: minmax(260px, 320px) 1fr minmax(260px, 320px); }
.inbox.with-customer .customer-panel { display: block; }
.cust-head { justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--panel); padding: 12px 0 8px; z-index: 1; }
.cust-sec { border-top: 1px solid var(--line); padding: 10px 0; }
.cust-sec h3 { font-size: .85rem; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.cust-calls li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.cust-toggle[aria-pressed="true"] { background: var(--sunk); }
@media (max-width: 1100px) {
  .inbox.with-customer { grid-template-columns: minmax(240px, 300px) 1fr; }
  .inbox.with-customer .customer-panel { position: fixed; inset-inline-end: 0; top: 0; bottom: 0; width: min(360px, 92vw); background: var(--panel); z-index: 40; box-shadow: -8px 0 24px rgba(0,0,0,.15); }
}

/* ---------- Customers and cases ---------- */
.seg button[aria-selected="true"] { background: var(--accent-soft); font-weight: 500; }
.small-seg button { padding: 4px 8px; font-size: .85rem; }
.case-line { margin-top: 4px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.case-line .tag { font-size: .75rem; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.tl-item { border-inline-start: 3px solid var(--line); padding: 6px 12px; margin: 0 0 8px; }
.tl-item.tl-in { border-color: var(--accent); }
.tl-item.tl-out { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.tl-item.tl-note { border-color: var(--wait); background: color-mix(in srgb, var(--wait) 7%, transparent); }
.tl-item.tl-call { border-color: #6366f1; }
.tl-item.tl-event { border-color: transparent; padding-top: 2px; padding-bottom: 2px; }
.tl-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.tl-meta .tag { font-size: .72rem; text-decoration: none; }
.ident-list li { padding: 3px 0; }
.case-list li { padding: 4px 0; }
.warn-panel { border-color: color-mix(in srgb, var(--wait) 45%, var(--line)); background: color-mix(in srgb, var(--wait) 6%, var(--panel)); }
.note-box { background: var(--sunk); border-radius: var(--r-sm); padding: 10px 12px; white-space: pre-wrap; max-width: none; }
.danger-text { color: var(--fault); }
.ok-text { color: var(--accent); }

/* ---------- Translation ---------- */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--page); padding: 9px 16px; border-radius: var(--r-sm); font-size: .92rem; z-index: 60; max-width: calc(100vw - 32px); }
.toast .link { color: var(--page); text-decoration: underline; }
.tline-tx { display: block; margin-top: 3px; padding-top: 3px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .92em; white-space: pre-wrap; }
.msg-tx { display: block; }
.tx-menu { bottom: auto; top: auto; inset-inline-start: auto; right: 0; width: 200px; max-height: 320px; overflow-y: auto; position: absolute; transform: translateY(-100%); margin-top: -8px; }
.tx-menu button { display: block; width: 100%; text-align: start; border: 0; background: none; padding: 6px 10px; }
.tx-menu button:hover { background: var(--sunk); }
.composer { position: relative; }

/* ---------- Presence and routing ---------- */
.avatar { position: relative; }
.presence-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; border: 2px solid var(--panel); vertical-align: middle; }
.avatar .presence-dot { position: absolute; inset-inline-end: -2px; bottom: -2px; }
.presence-dot.p-available { background: #16a34a; }
.presence-dot.p-busy, .presence-dot.p-on_call, .presence-dot.p-ringing { background: #dc2626; }
.presence-dot.p-after_call_work, .presence-dot.p-paused, .presence-dot.p-away { background: #f59e0b; }
.presence-dot.p-dnd { background: #7f1d1d; }
.presence-dot.p-unknown { display: none; }
.presence-tag { display: inline-flex; align-items: center; gap: 6px; }
.presence-tag .presence-dot { border: 0; }
.load { position: relative; width: 120px; height: 18px; background: var(--sunk); border-radius: 9px; overflow: hidden; }
.load-fill { height: 100%; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.load-fill.high { background: color-mix(in srgb, var(--wait) 70%, transparent); }
.load-fill.full { background: color-mix(in srgb, var(--fault) 60%, transparent); }
.load-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-variant-numeric: tabular-nums; }
.acct-menu button[role="menuitemradio"] { display: block; width: 100%; text-align: start; }

/* Kala CRM */
.crm-line { margin-top: 4px; }
.crm-line:empty { display: none; }
.kala-tag { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.kala-card { display: grid; gap: 4px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kala-tag { background: #1e1b4b; color: #c7d2fe; border-color: #3730a3; } }
:root[data-theme="dark"] .kala-tag { background: #1e1b4b; color: #c7d2fe; border-color: #3730a3; }
.kala-fields { border-collapse: collapse; margin-top: 4px; width: 100%; }
.kala-fields th, .kala-fields td { padding: 3px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; word-break: break-word; }
.kala-fields th { font-weight: 500; color: var(--muted); white-space: nowrap; width: 1%; font-family: ui-monospace, monospace; }
.kala-more { display: inline-block; margin-inline-start: 6px; }
.kala-more[open] { display: block; }

/* Workspace: my conversations | the one open | what helps answer it */
.ws { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.ws-rail { position: sticky; top: 12px; max-height: calc(100vh - 40px); overflow-y: auto; }
.ws-rail-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.ws-list { list-style: none; margin: 0; padding: 0; }
.ws-item { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.ws-item:hover { background: var(--accent-soft); }
.ws-item.current { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ws-item-top { display: flex; align-items: center; gap: 6px; }
.ws-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.ws-empty { padding: 12px; }
.ws-timer { font-variant-numeric: tabular-nums; font-size: .8rem; padding: 1px 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.ws-timer.warn { background: #FEF3C7; color: #92400E; }
.ws-timer.bad { background: #FEE2E2; color: #991B1B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ws-timer.warn { background: #3A3218; color: #F3E3B3; } :root:not([data-theme="light"]) .ws-timer.bad { background: #3B1D1D; color: #FCA5A5; } }
:root[data-theme="dark"] .ws-timer.warn { background: #3A3218; color: #F3E3B3; }
:root[data-theme="dark"] .ws-timer.bad { background: #3B1D1D; color: #FCA5A5; }
.ch-badge { font-size: .7rem; font-weight: 600; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); flex: none; }
.ch-badge.ch-wa { color: #15803D; border-color: #86EFAC; }
.ch-badge.ch-web { color: #1D4ED8; border-color: #93C5FD; }
.ch-badge.ch-mail { color: #7C3AED; border-color: #C4B5FD; }
.ws-center { min-width: 0; }
.ws-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.ws-head h1 { margin: 0 0 2px; font-size: 1.4rem; unicode-bidi: plaintext; }
.ws-age { font-variant-numeric: tabular-nums; }
.ws-tabs { margin-bottom: 12px; }
/* the conversation inside: just the thread (the list is on the left, the customer on the right) */
.ws-conv > .page-head, .ws-conv .inbox-list, .ws-conv .cust-toggle, .ws-conv .menu-btn, .ws-conv .customer-panel { display: none !important; }
.ws-conv .inbox, .ws-conv .inbox.with-customer { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 210px); }
.ws-pane > .page-head h1 { font-size: 1.2rem; }
.ws-side { display: grid; gap: 12px; }
.ws-side .panel { margin: 0; }
.ws-side h2 { font-size: 1rem; margin: 0 0 8px; }
.ws-who { display: flex; gap: 10px; align-items: center; }
.ws-who .avatar { width: 40px; height: 40px; font-size: 1.1rem; }
.ws-reach { margin-top: 10px; flex-wrap: wrap; gap: 6px; }
.ws-reach button, .ws-reach .btn { padding: 4px 10px; font-size: .85rem; }
.ws-replies li + li, .ws-similar li + li { margin-top: 6px; }
.ws-reply { display: block; width: 100%; text-align: start; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.ws-reply:hover { border-color: var(--accent); }
.ws-reply .tag { margin-inline-start: 6px; }
.ws-ai { margin-top: 8px; padding: 10px; border: 1px dashed var(--accent); border-radius: 8px; display: grid; gap: 6px; }
.ws-ai-text { white-space: pre-wrap; }
.ws-similar li { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.ws-answer { margin-top: 2px; }
.ws-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0 0 8px; font-size: .9rem; }
.ws-dl dt { color: var(--muted); }
.ws-dl dd { margin: 0; overflow-wrap: anywhere; }
.ws-avg b { font-size: 1.4rem; }
.ws-none { text-align: center; padding: 40px; }
@media (max-width: 1280px) { .ws { grid-template-columns: 230px minmax(0, 1fr); } .ws-side { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } }
@media (max-width: 760px) { .ws { grid-template-columns: 1fr; } .ws-rail { position: static; max-height: 40vh; } .ws-conv .inbox, .ws-conv .inbox.with-customer { height: 70vh; } }
dialog.wide-dialog { width: min(760px, calc(100vw - 32px)); }
.small-head { font-size: .9rem; margin: 14px 0 6px; color: var(--muted); font-weight: 600; }

/* Reports and My day */
.my-day { margin-bottom: 16px; }
.my-day .kpis { margin: 10px 0 0; }
.kpi.warn .kpi-v { color: #B45309; }
.kpi.bad .kpi-v { color: #B91C1C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kpi.warn .kpi-v { color: #FBBF24; } :root:not([data-theme="light"]) .kpi.bad .kpi-v { color: #F87171; } }
:root[data-theme="dark"] .kpi.warn .kpi-v { color: #FBBF24; }
:root[data-theme="dark"] .kpi.bad .kpi-v { color: #F87171; }
.kpi-s { margin-top: 2px; }
.report-filters { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.report-filters select, .report-filters input { width: auto; }
.report-period { font-size: 1.05rem; margin: 4px 0 12px; }
[aria-busy="true"] { opacity: .55; transition: opacity .2s; }
.hour-chart { margin: 0; }
.hour-chart figcaption { margin-bottom: 6px; }
.hbars { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; height: 140px; align-items: end; border-bottom: 1px solid var(--line); }
.hbar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; outline-offset: 1px; }
.hbar-fill { background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.hbar:hover .hbar-fill, .hbar:focus .hbar-fill { filter: brightness(1.15); }
.hbar small { position: absolute; bottom: -18px; left: 0; font-size: .65rem; color: var(--muted); }
.hour-chart .hbars { margin-bottom: 20px; }
.report-table { width: 100%; }
.report-table td.num, .report-table th.num { text-align: end; font-variant-numeric: tabular-nums; }
.th-sort { font-weight: 600; color: inherit; text-decoration: none; padding: 0; white-space: nowrap; }

/* SLA */
.sla-tag { font-variant-numeric: tabular-nums; }
.sla-tag.sla-warning { background: #FEF3C7; color: #92400E; border-color: #FCD34D; }
.sla-tag.sla-breach { background: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sla-tag.sla-warning { background: #3A3218; color: #F3E3B3; border-color: #8C6D1F; } :root:not([data-theme="light"]) .sla-tag.sla-breach { background: #3B1D1D; color: #FCA5A5; border-color: #7F1D1D; } }
:root[data-theme="dark"] .sla-tag.sla-warning { background: #3A3218; color: #F3E3B3; border-color: #8C6D1F; }
:root[data-theme="dark"] .sla-tag.sla-breach { background: #3B1D1D; color: #FCA5A5; border-color: #7F1D1D; }
.sla-line { margin-top: 4px; }
.ab-pop.sla-pop-breach { border-color: #DC2626; }
.ws-item .sla-tag { margin-top: 4px; display: inline-block; }

/* ---------- Right-to-left (Hebrew) ---------- */
[dir="rtl"] body { font-feature-settings: normal; }
[dir="rtl"] .chev, [dir="rtl"] .rtl-flip { display: inline-block; transform: scaleX(-1); }
/* phone numbers, addresses, ids stay left-to-right inside Hebrew */
[dir="rtl"] .mono, [dir="rtl"] input[type="tel"], [dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"], [dir="rtl"] input[inputmode="numeric"] { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] input[type="tel"], [dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"] { text-align: end; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; }
[dir="rtl"] body { line-height: 1.6; }

/* account menu: language and theme */
.acct-label { font-size: .75rem; color: var(--muted); padding: 6px 10px 2px; }
.acct-seg { display: flex; margin: 2px 8px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.acct-menu .acct-seg button { flex: 1; justify-content: center; padding: 6px 4px; border-radius: 0; font-size: .86rem; }
.acct-menu .acct-seg button + button { border-inline-start: 1px solid var(--line); }
.acct-menu .acct-seg button[aria-checked="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

/* ---------- Service procedures (0.43) ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .doc-grid { grid-template-columns: 1fr; } }
.doc-fields select, .doc-fields textarea { width: 100%; }
.doc-choice { display: flex; flex-direction: column; gap: 4px; }
.doc-opt { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
.doc-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.doc-ai { margin-top: 6px; background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.doc-handover { border-inline-start: 3px solid var(--wait); padding: 8px 12px; background: color-mix(in srgb, var(--wait) 10%, var(--panel)); border-radius: var(--r-sm); margin: 8px 0; }
.docs-badge { border: 1px solid var(--wait); background: color-mix(in srgb, var(--wait) 14%, transparent); color: inherit; border-radius: 999px; padding: 2px 10px; font-weight: 500; white-space: nowrap; }
.docs-badge.late { border-color: var(--fault); background: color-mix(in srgb, var(--fault) 16%, transparent); }
.main-col > .docs-badge { margin: 8px 36px 0; align-self: flex-start; width: auto; display: inline-flex; }
.routine h3 { margin-top: 14px; }
.routine-checks li { padding: 4px 0; }
.routine table input { width: 100%; }
.proc-table td { padding: 4px 6px; border: 0; vertical-align: middle; }
.proc-table input[type="text"] { width: 100%; min-width: 180px; }
.dist li { position: relative; padding: 3px 6px; }
.dist-bar { position: absolute; inset-block: 2px; inset-inline-start: 0; background: var(--accent-soft); border-radius: 4px; z-index: 0; }
.dist li > :not(.dist-bar) { position: relative; z-index: 1; }
.warn-list { color: var(--wait); margin: 6px 0; }
.kpi-btn { text-align: start; cursor: pointer; font: inherit; color: inherit; }
.kpi-btn:disabled { cursor: default; }

/* ---------- The new shell (0.44): sidebar, header, phone bar ---------- */
.shell2 { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.ui-new .side { background: var(--panel); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; min-width: 0; }
.shell2.with-banner .side { top: 44px; height: calc(100vh - 44px); }
.side-brand { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 14px; border-bottom: 1px solid var(--line); flex: none; }
.side-brand img { width: 28px; height: 28px; }
.side-brand b { font-size: 1.02rem; white-space: nowrap; }
.side-fold { margin-inline-start: auto; width: 30px; height: 30px; padding: 0; justify-content: center; border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: var(--r-sm); }
.side-org { margin: 12px 12px 4px; display: grid; grid-template-columns: 1fr auto; text-align: start; gap: 0 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); font: inherit; font-weight: 400; }
.side-org .muted { grid-column: 1; font-size: .72rem; }
.side-org b { grid-column: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-org > span[aria-hidden] { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--muted); }
.side-org:disabled { cursor: default; opacity: 1; }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 10px; }
.side-group { display: flex; width: 100%; align-items: center; justify-content: space-between; background: none; border: 0; padding: 14px 10px 4px; font: inherit; font-size: .72rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
[dir="rtl"] .side-group { letter-spacing: 0; text-transform: none; }
.side-group[aria-expanded="false"] .chev { transform: rotate(90deg); }
[dir="rtl"] .side-group[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.side-items { display: flex; flex-direction: column; gap: 1px; }
.side-items[hidden] { display: none; }
.ui-new .side a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-size: .93rem; }
.ui-new .side a:hover { background: var(--sunk); }
.ui-new .side a .ico { color: var(--muted); flex: none; }
.ui-new .side a[aria-current="page"] { background: var(--accent-soft); font-weight: 600; color: var(--ink); }
.ui-new .side a[aria-current="page"] .ico { color: var(--accent); }
.side-foot { border-top: 1px solid var(--line); padding: 8px 10px 12px; flex: none; }
.side-status { display: flex; align-items: center; gap: 8px; padding: 8px 10px 0; color: var(--muted); }
.side-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { margin-inline-start: auto; }

/* folded to icons */
body.side-folded .shell2 { grid-template-columns: 68px minmax(0, 1fr); }
body.side-folded .side .side-label, body.side-folded .side-org, body.side-folded .side-group span:first-child { display: none; }
body.side-folded .side-group { justify-content: center; padding: 10px 0 2px; }
body.side-folded .side-brand { justify-content: center; padding: 0 6px; }
body.side-folded .side-brand img { display: none; }
body.side-folded .side-fold { margin: 0; }
body.side-folded .side-fold .rtl-flip { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] body.side-folded .side-fold .rtl-flip { transform: none; }
body.side-folded .ui-new .side a, body.side-folded .side a { justify-content: center; padding: 9px 0; }

/* header */
.topbar { position: sticky; top: 0; z-index: 35; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: .9rem; min-width: 0; white-space: nowrap; }
.crumbs > span:last-child { font-weight: 600; }
.side-toggle { display: none; border: 0; background: none; font-size: 1.2rem; padding: 4px 8px; }
.top-gap { flex: 1; }
.top-search { display: inline-flex; align-items: center; gap: 8px; height: 38px; min-width: 260px; max-width: 420px; flex: 0 1 380px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--page); color: var(--muted); font: inherit; font-weight: 400; cursor: text; }
.top-search span { flex: 1; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search kbd, .pal-head kbd { font: inherit; font-size: .72rem; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: var(--panel); color: var(--muted); }
.top-live { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.top-bell { position: relative; padding: 0 10px; height: 38px; }
.bell-count { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--fault); color: #fff; font-size: .7rem; display: grid; place-items: center; padding: 0 4px; }
.top-who-wrap { position: relative; }
.top-who { width: auto; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 10px 4px 6px; gap: 8px; }
.top-name { display: flex; flex-direction: column; line-height: 1.15; text-align: start; }
.top-name small { color: var(--muted); font-size: .74rem; }
.topbar .acct-menu, .bell-menu { position: absolute; top: calc(100% + 6px); bottom: auto; inset-inline: auto 0; width: 290px; max-height: 80vh; overflow-y: auto; }
.bell-menu { width: 340px; }
.top-bell + .bell-menu { inset-inline: auto 0; }
.bell-item { display: flex; flex-wrap: wrap; gap: 2px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; text-align: start; border: 0; background: none; font: inherit; }
.bell-item:hover { background: var(--sunk); }
.org-menu { position: absolute; top: 120px; inset-inline: 12px; width: auto; }
.top-phone { gap: 6px; height: 38px; }
.topbar .docs-badge { height: 32px; }

/* the phone bar under the header: light, slim */
.phone-row { position: sticky; top: 60px; z-index: 34; display: flex; align-items: stretch; background: var(--panel); border-bottom: 1px solid var(--line); }
.phone-row[hidden] { display: none; }
.phone-row #agentbar-slot { flex: 1; min-width: 0; position: static; }
.phone-row #agentbar-slot:empty + .phone-hide { display: none; }
.phone-hide { border: 0; background: none; color: var(--muted); padding: 0 14px; font-size: .9rem; }
.ui-new .agentbar { background: var(--panel); color: var(--ink); padding: 8px 20px; gap: 8px; font-size: .88rem; }
.ui-new .ab-ext { color: var(--muted); }
.ui-new .ab-status { color: var(--ink); border-color: var(--line); height: 32px; }
.ui-new .ab-status.ready { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.ui-new .ab-status.paused { background: color-mix(in srgb, var(--wait) 14%, transparent); border-color: color-mix(in srgb, var(--wait) 50%, transparent); }
.ui-new .ab-time { color: var(--muted); }
.ui-new .ab-queue { color: var(--muted); border-color: var(--line); height: 30px; }
.ui-new .ab-queue.in { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--ink); }
.ui-new .ab-wait { color: var(--wait); }
.ui-new .ab-take { color: var(--ink); }
.ui-new .ab-call { background: var(--sunk); border-color: var(--line); color: var(--ink); }
.ui-new .ab-call:hover { color: var(--ink); border-color: var(--accent); }
.ui-new .ab-open { color: var(--accent); }
.ui-new .ab-xfer, .ui-new .ab-notif { color: var(--ink); border-color: var(--line); height: 32px; }
.ui-new .ab-dial { border-color: var(--line); }
.ui-new .ab-dial input { color: var(--ink); }
.ui-new .ab-dial input::placeholder { color: var(--muted); }
.ui-new .ab-dial button { background: var(--accent); color: var(--accent-ink); border-color: var(--line); }
.ui-new .ab-warn { color: var(--wait); }
.ui-new .main { padding: 24px 28px 60px; }
.ui-new .main > .menu-btn { display: none !important; }
.ui-new .panel { box-shadow: var(--shadow); }

/* search everything */
.palette { width: min(640px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); color: var(--ink); margin-top: 12vh; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); }
.palette::backdrop { background: rgba(15, 23, 42, .35); }
.pal-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pal-head input { flex: 1; border: 0; box-shadow: none; background: transparent; font-size: 1rem; padding: 6px 0; color: var(--ink); }
.pal-head input:focus { box-shadow: none; }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 6px; display: grid; gap: 1px; }
.pal-item { display: grid; grid-template-columns: 110px auto 1fr; align-items: baseline; gap: 8px; text-align: start; border: 0; background: none; border-radius: var(--r-sm); padding: 8px 10px; font: inherit; font-weight: 400; color: var(--ink); }
.pal-item[aria-selected="true"], .pal-item:hover { background: var(--accent-soft); }
.pal-kind { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* narrow screens: the sidebar slides in */
@media (max-width: 960px) {
  .shell2, body.side-folded .shell2 { grid-template-columns: minmax(0, 1fr); }
  .ui-new .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 264px; z-index: 60; transform: translateX(-105%); transition: transform .2s; }
  [dir="rtl"] .ui-new .side { transform: translateX(105%); }
  body.side-open .ui-new .side, body.side-open.ui-new .side { transform: none; box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .35); }
  body.side-folded .side .side-label, body.side-folded .side-org { display: revert; }
  .side-toggle { display: inline-block; }
  .side-fold { display: none; }
  .top-search { min-width: 0; flex: 1 1 auto; }
  .top-search span, .top-search kbd, .top-live, .top-name { display: none; }
  .topbar { padding: 0 12px; gap: 6px; }
  .crumbs > span { display: none; }
  .ui-new .main { padding: 16px 14px 60px; }
  .ui-new .agentbar { padding: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) { .ui-new .side { transition: none; } }
.acct-menu button { white-space: normal; text-align: start; line-height: 1.35; }

/* ---------- 0.45: drawer, live calls, customer 360, workspace ---------- */
.drawer { margin: 0; margin-inline-start: auto; height: 100vh; max-height: 100vh; width: min(560px, 100vw); padding: 0; border: 0; border-inline-start: 1px solid var(--line); background: var(--panel); color: var(--ink); box-shadow: -12px 0 40px rgba(15, 23, 42, .18); }
.drawer::backdrop { background: rgba(15, 23, 42, .3); }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.drawer-head h2 { margin: 0; }
.drawer-content { padding: 14px 18px; display: grid; gap: 12px; }
.drawer-body { display: grid; gap: 10px; }
.diag-pre { max-height: 60vh; overflow: auto; font-size: .78rem; }
.live-kpis { margin-bottom: 14px; }
.live-table td, .live-table th { white-space: nowrap; }
.cust-tabs { margin-bottom: 14px; }
.ws-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ws-top h1 { margin: 0; }
.ws-top .seg { margin-inline-start: 8px; }
.ws-top .primary { margin-inline-start: auto; }

/* ---- 0.46: home views, settings hub, density ---- */
.home-views { display: inline-flex; margin: -6px 0 14px; }
.home-views button { padding-inline: 16px; }
.home-kpis { margin-bottom: 16px; }
.home-list { list-style: none; margin: 0; padding: 0; }
.home-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.home-list li:last-child { border-bottom: 0; }
.home-list li > a { flex: 1 1 220px; min-width: 0; }
.home-snippet { flex: 2 1 260px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-team td { vertical-align: middle; }
.home-team .presence-dot { position: static; display: inline-block; vertical-align: middle; }
.hub-group { margin-bottom: 22px; }
.hub-group h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 10px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.hub-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: inherit; text-decoration: none; }
.hub-card:hover, .hub-card:focus-visible { border-color: var(--accent); box-shadow: 0 1px 6px rgb(15 118 110 / .12); }
.hub-card b { color: var(--accent); }
html.density-compact { --pad-scale: .7; }
html.density-compact body { font-size: 13px; }
html.density-compact .panel { padding: 12px 14px; margin-bottom: 12px; }
html.density-compact .page-head { margin-bottom: 10px; }
html.density-compact .page-head h1 { font-size: 20px; }
html.density-compact .report-table td, html.density-compact .report-table th { padding-block: 4px; }
html.density-compact .kpi { padding: 8px 10px; }
html.density-compact .kpi-v { font-size: 20px; }
html.density-compact .side a, html.density-compact .side-group { padding-block: 5px; }
html.density-compact .home-list li { padding: 5px 0; }
html.density-compact .ws-rail .item, html.density-compact .conv-list li { padding-block: 6px; }
html.density-compact button, html.density-compact .btn, html.density-compact input, html.density-compact select { padding-block: 5px; }
.hub-find { margin: -4px 0 18px; } .hub-find input { width: 100%; }

/* ---- 0.47: callbacks ---- */
.cb-kpis { margin-bottom: 10px; }
.cb-tabs { display: inline-flex; }
.cb-tabs button { padding-inline: 14px; }
.cb-tabs .count { font-weight: 600; color: var(--accent); }
.cb-table td { vertical-align: top; }
.cb-table .row.end { flex-wrap: nowrap; }
.cb-reason { max-width: 280px; }
tr.cb-late td:first-child { box-shadow: inset 3px 0 0 #DC2626; }
[dir=rtl] tr.cb-late td:first-child { box-shadow: inset -3px 0 0 #DC2626; }
.cb-results { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.cb-results button[aria-checked="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
a.kpi-link { color: inherit; text-decoration: none; display: block; } a.kpi-link:hover { border-color: var(--accent); }

/* ---- 0.48: knowledge base ---- */
.kb-filters { gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.kb-status { display: inline-flex; }
.kb-status button { padding-inline: 14px; }
.kb-status .count { color: var(--accent); font-weight: 600; }
.kb-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-cats button { border-radius: 999px; padding: 4px 12px; font-weight: 400; }
.kb-cats button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); font-weight: 500; }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.kb-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: inherit; text-decoration: none; }
.kb-card:hover, .kb-card:focus-visible { border-color: var(--accent); }
.kb-card b { color: var(--accent); }
.kb-snippet { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-article h1 { margin: 0 0 6px; }
.kb-body { margin: 18px 0; line-height: 1.65; }
.kb-tags { gap: 6px; margin-bottom: 12px; }
.kb-vote { gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; flex-wrap: wrap; }
.kb-edit { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.kb-editor { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; min-height: 340px; }
.kb-side { position: sticky; top: 12px; max-height: calc(100vh - 140px); overflow: auto; }
.kb-msg { white-space: pre-wrap; background: var(--sunk); padding: 10px 12px; border-radius: 8px; font-family: inherit; font-size: 13px; }
.ws-kb li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.ws-kb li:last-child { border-bottom: 0; }
.callout.warn { background: color-mix(in srgb, #F59E0B 12%, var(--panel)); border: 1px solid color-mix(in srgb, #F59E0B 40%, var(--line)); padding: 8px 12px; border-radius: 8px; }
@media (max-width: 900px) { .kb-edit { grid-template-columns: 1fr; } .kb-side { position: static; max-height: none; } }

/* ---- 0.49: AI copilot ---- */
.cp-panel { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 420px; padding: 0; overflow: hidden; }
.cp-log { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.cp-q { align-self: flex-end; max-width: 75%; background: var(--accent); color: #fff; padding: 9px 13px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
[dir=rtl] .cp-q { border-radius: 14px 14px 14px 4px; }
.cp-answer { align-self: flex-start; max-width: 85%; background: var(--sunk); padding: 10px 14px; border-radius: 14px 14px 14px 4px; }
.cp-text { white-space: pre-wrap; line-height: 1.55; }
.cp-pending { font-style: italic; }
.cp-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cp-source { display: inline-flex; gap: 4px; align-items: baseline; font-size: 12px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); text-decoration: none; color: inherit; }
.cp-source:hover { border-color: var(--accent); }
.cp-n { color: var(--accent); font-weight: 600; }
.cp-tools { margin-top: 4px; }
.cp-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--panel); }
.cp-form textarea { flex: 1; resize: none; }
.cp-empty { margin: auto; text-align: center; max-width: 520px; }
.cp-examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cp-chip { border-radius: 999px; font-weight: 400; }
.cp-box .cp-answer { max-width: none; margin-top: 8px; }
.cp-box form { margin-top: 8px; }
.cp-box form input { flex: 1; }

/* ---- 0.50: automations ---- */
.auto-tabs { display: inline-flex; margin-bottom: 14px; }
.auto-tabs button { padding-inline: 16px; }
.auto-list { display: flex; flex-direction: column; gap: 10px; }
.auto-rule { display: flex; align-items: center; gap: 14px; margin: 0; }
.auto-rule .auto-main { flex: 1; min-width: 0; }
.auto-rule:not(.on) .auto-main b { color: var(--muted); }
.auto-fs { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 4px; margin: 0 0 12px; }
.auto-fs legend { font-weight: 600; padding: 0 6px; }
.auto-act { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.auto-templates li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row.wrap { flex-wrap: wrap; }
.check.inline { display: inline-flex; margin-inline-end: 12px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch .slider::before { content: ''; position: absolute; width: 16px; height: 16px; inset-block-start: 3px; inset-inline-start: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }
[dir=rtl] .switch input:checked + .slider::before { transform: translateX(-18px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- 0.51: data and privacy ---- */
.priv-table { width: 100%; }
.priv-table td { vertical-align: top; padding-block: 10px; }
.priv-found li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* ---- 0.52: tasks and teams ---- */
.task-filters { gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.task-filters .seg { display: inline-flex; }
.task-filters .seg button { padding-inline: 14px; }
.task-group h2 { font-size: 14px; margin: 0 0 6px; }
.task-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row input[type=checkbox] { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.task-main { flex: 1; min-width: 0; text-align: start; background: none; border: 0; padding: 0; font-weight: 400; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.task-title { font-weight: 500; }
.task-row.closed .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.task-detail { display: flex; flex-direction: column; gap: 10px; }
.task-detail h3 { margin: 8px 0 0; font-size: 14px; }
.task-title-in { font-size: 17px; font-weight: 600; }
.task-detail .seg { display: inline-flex; }
.task-drop { border: 2px dashed var(--line); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; }
.task-drop.over, .task-drop:hover { border-color: var(--accent); color: var(--accent); }
.task-files li, .task-comments li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.task-comment { white-space: pre-wrap; }
.task-detail form textarea { flex: 1; }
.team-card input[type=text] { font-weight: 600; max-width: 220px; }
.team-people { display: flex; flex-wrap: wrap; gap: 4px 0; padding: 6px 0; }
.row.tight { gap: 10px; }

/* ---- 0.52: the menu's scroll bar on its outer edge; breadcrumbs; moving between settings ---- */
[dir=rtl] .side-scroll { direction: ltr; }
[dir=rtl] .side-scroll > * { direction: rtl; }
.side-scroll::-webkit-scrollbar { width: 6px; }
.side-scroll::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 3px; }
.crumbs .crumb-link { color: var(--muted); text-decoration: none; }
.crumbs .crumb-link:hover, .crumbs .crumb-link:focus-visible { color: var(--accent); text-decoration: underline; }
.crumbs .crumb-back { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 18px; line-height: 1; }
.crumbs .crumb-back:hover { border-color: var(--accent); color: var(--accent); }
.crumbs .crumb-switch { background: none; border: 1px solid transparent; padding: 3px 8px; border-radius: 8px; font-weight: 600; }
.crumbs .crumb-switch:hover, .crumbs .crumb-switch[aria-expanded="true"] { border-color: var(--line); background: var(--sunk); }
.crumbs { position: relative; }
.settings-menu { position: absolute; bottom: auto; top: calc(100% + 6px); inset-inline-end: auto; inset-inline-start: 40px; z-index: 50; max-height: 70vh; overflow-y: auto; min-width: 240px; }
.settings-menu a { display: block; padding: 6px 10px; border-radius: 6px; color: inherit; text-decoration: none; }
.settings-menu a:hover, .settings-menu a:focus-visible { background: var(--sunk); }
.settings-menu a[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
.settings-menu .settings-all { font-weight: 600; color: var(--accent); }
.task-main { align-items: flex-start; justify-content: flex-start; width: 100%; }
.task-filters select { width: auto; max-width: 220px; }
.task-filters input[type=search] { flex: 0 1 240px; }

/* ---- 0.53: integrations ---- */
.integ-list { display: flex; flex-direction: column; gap: 10px; }
.integ-card { text-align: start; font-weight: 400; cursor: pointer; }
.integ-add { color: var(--accent); font-weight: 600; margin-top: 4px; }
.lookup-card + .lookup-card { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.integ-card { height: auto; min-height: 0; align-items: stretch; justify-content: flex-start; white-space: normal; }

/* The menu's scroll bar: a thin bar without arrows, only while the pointer is on the menu (Chrome and Edge
   use the -webkit- one when no scrollbar-width is set; Firefox gets a thin one) */
.side-scroll::-webkit-scrollbar { width: 6px; }
.side-scroll::-webkit-scrollbar-button { display: none; height: 0; }
.side-scroll::-webkit-scrollbar-track { background: transparent; }
.side-scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.side-scroll:hover::-webkit-scrollbar-thumb, .side-scroll:focus-within::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); }
@supports not selector(::-webkit-scrollbar) { .side-scroll { scrollbar-width: thin; scrollbar-color: transparent transparent; } .side-scroll:hover { scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent; } }

/* The header's clock: time, date and the Hebrew date */
.top-clock { display: flex; align-items: center; gap: 8px; padding-inline: 10px; line-height: 1.15; white-space: nowrap; }
.top-time { font-size: 1rem; font-variant-numeric: tabular-nums; }
.top-dates { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); }
.top-hebdate { font-size: 11px; }
@media (max-width: 1100px) { .top-dates { display: none; } }
@media (max-width: 760px) { .top-clock { display: none; } }

/* ---- 0.54: AI rewrite beside an editor; Q&A; copilot review ---- */
.ai-rw-bar { gap: 6px; margin: 4px 0; flex-wrap: wrap; }
.ai-rw-bar .small-btn, .ai-rw-bar button { padding: 4px 10px; font-size: 13px; }
.ai-rw { border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; }
.ai-rw-text { white-space: pre-wrap; background: var(--panel); border-radius: 8px; padding: 8px 10px; margin: 6px 0; max-height: 300px; overflow: auto; }
.qa-item { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.qa-item:last-child { border-bottom: 0; }
.qa-item .qa-a { white-space: pre-wrap; }
.qa-item.off { opacity: .55; }
.cr-item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cr-item:last-child { border-bottom: 0; }
.cr-body { white-space: pre-wrap; }
.cp-feedback { gap: 6px; align-items: center; }
.cp-feedback button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.rv-item { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.rv-item:last-child { border-bottom: 0; }
.rv-a { white-space: pre-wrap; background: var(--sunk); padding: 8px 10px; border-radius: 8px; max-height: 160px; overflow: auto; }
.fix-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--panel); }
.fix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin: 10px 0 16px; }

/* ---- 0.55: the menu as a rail of sections and a panel of their pages ---- */
.shell2 { grid-template-columns: 284px minmax(0, 1fr); }
.ui-new .side { flex-direction: row; }
.side-rail { width: 72px; flex: none; display: flex; flex-direction: column; align-items: stretch; border-inline-end: 1px solid var(--line); background: color-mix(in srgb, var(--sunk) 60%, var(--panel)); padding: 8px 0; gap: 2px; }
.rail-brand { display: flex; justify-content: center; align-items: center; height: 44px; margin-bottom: 6px; }
.rail-brand img { width: 30px; height: 30px; }
.rail-secs { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.rail-secs::-webkit-scrollbar { display: none; }
.rail-foot { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; border-top: 1px solid var(--line); }
.ui-new .side .rail-btn, .rail-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 0 6px; padding: 8px 2px 6px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-size: 10.5px; font-weight: 500; line-height: 1.15; text-align: center; text-decoration: none; cursor: pointer; overflow-wrap: normal; word-break: normal; hyphens: none; }
.rail-btn:hover { background: var(--sunk); color: var(--ink); }
.rail-btn[aria-pressed="true"], .rail-btn[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.rail-ico { position: relative; display: inline-flex; }
.rail-label { max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: normal; overflow-wrap: normal; word-break: normal; hyphens: none; letter-spacing: -.1px; }
.rail-dot { position: absolute; inset-block-start: -6px; inset-inline-end: -10px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #DC2626; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.side-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-panel .side-brand { height: 60px; }
.side-panel-title { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; }
.side-sub { font-size: .7rem; font-weight: 600; color: var(--muted); padding: 12px 10px 4px; text-transform: uppercase; letter-spacing: .03em; }
[dir="rtl"] .side-sub { text-transform: none; letter-spacing: 0; }
.nav-count { margin-inline-start: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--sunk); color: var(--ink); font-size: 11.5px; font-weight: 600; line-height: 20px; text-align: center; }
.nav-count.hot { background: #DC2626; color: #fff; }
/* folded: the rail only */
body.side-folded .shell2 { grid-template-columns: 72px minmax(0, 1fr); }
body.side-folded .side-panel { display: none; }
body.side-folded .side-rail { border-inline-end: 0; }
@media (max-width: 960px) {
  .ui-new .side { width: 300px; }
  body.side-folded .side-panel { display: flex; }
}

/* 0.55.1: the fold button is a "hide the panel" icon (.rtl-flip mirrors it in Hebrew) */
.side-fold-ico { display: inline-flex; }

/* 0.56: the Integration Center */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.dot.ok { background: #16A34A; } .dot.bad { background: #DC2626; }
.ic-cmd { position: relative; margin: 8px 0; }
.ic-cmd pre { margin: 0; padding: 12px 14px; padding-inline-end: 70px; background: var(--sunk); border-radius: 8px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; white-space: pre; text-align: left; }
.ic-cmd .btn { position: absolute; top: 8px; inset-inline-end: 8px; }
.ic-learned { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.ic-calls td .tag + .tag { margin-inline-start: 4px; }
.table-wrap { overflow-x: auto; }
.ic-tabs { display: inline-flex; width: auto; margin: 0 0 14px; }
.ic-tabs .btn { border: 0; border-radius: 0; padding: 7px 16px; }
.ic-tabs .btn + .btn { border-inline-start: 1px solid var(--line); }
.ic-tabs .btn[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.group-list { max-height: 50vh; overflow: auto; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; }
.group-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 0; }
.group-row > label.small { flex: none; color: var(--muted); }
.group-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.group-people summary { cursor: pointer; font-size: 13px; }
.group-people ul { margin: 4px 0; padding-inline-start: 18px; max-height: 220px; overflow: auto; font-size: 13px; }
.group-people li .tag { margin-inline-start: 6px; }
.case-tickets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0; font-size: 13px; }
.case-ticket { display: inline-flex; align-items: center; gap: 4px; }
.msg .msg-move { display: none; margin-inline-start: 8px; }
.msg:hover .msg-move, .msg:focus-within .msg-move { display: inline; }
.msg .msg-case { margin-inline-start: 6px; font-size: 11px; }
.follow-case { margin: 4px 0; }
.call-cases h3 { margin: 12px 0 4px; font-size: 14px; }
.call-case-now { font-weight: 600; }
.spy-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin: 0 0 12px; border-radius: var(--r-md); background: var(--sunk); border: 1px solid var(--line); }
.spy-bar.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.spy-bar button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.row-actions { white-space: nowrap; }
.row-actions > * + * { margin-inline-start: 4px; }
.sup-sec { margin-bottom: 14px; }
.sup-sec h3 { margin: 0 0 6px; font-size: 14px; }

/* Chat between the team (chat.js): docked at the bottom, like Google Chat */
.top-chat { position: relative; padding: 0 10px; height: 38px; }
.chat-dock { position: fixed; bottom: 0; inset-inline-end: 16px; z-index: 85; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 10px; pointer-events: none; max-width: calc(100vw - 32px); }
.chat-dock.side-start { inset-inline-end: auto; inset-inline-start: 16px; flex-direction: row; }
.chat-dock[hidden] { display: none; }
.chat-win { pointer-events: auto; width: 330px; height: 460px; max-height: calc(100vh - 80px); display: flex; flex-direction: column; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: 0 8px 30px rgba(10,30,36,.22); overflow: hidden; }
.chat-list-win { width: 300px; }
.chat-win.min { height: auto; width: 240px; }
.chat-win.min .chat-head { cursor: pointer; border-bottom: 0; }
.chat-win.has-new .chat-head { background: var(--accent); color: #fff; }
.chat-win.has-new .chat-ico { color: #fff; }
.chat-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); min-height: 42px; }
.chat-head .presence-dot { position: static; flex: none; }
.chat-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.chat-head .grow, .chat-row .grow { flex: 1; min-width: 0; }
.chat-ico { border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; line-height: 1; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: inline-grid; place-items: center; }
.chat-ico:hover { background: var(--sunk); color: var(--ink); }
.chat-new { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.chat-new select { width: 100%; }
.chat-list { overflow-y: auto; flex: 1; }
.chat-row { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px; width: 100%; text-align: start; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; cursor: pointer; color: inherit; font: inherit; }
.chat-row:hover { background: var(--sunk); }
.chat-row.unread b { color: var(--accent); }
.chat-row-top { display: flex; align-items: center; gap: 8px; }
.chat-row-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .presence-dot { position: static; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--bg, #f6f8f9); }
.chat-msg { max-width: 82%; align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 10px; }
.chat-msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 16%, var(--panel)); border-color: transparent; }
.chat-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; }
.chat-from { display: block; font-weight: 600; color: var(--accent); }
.chat-at { display: block; font-size: .7rem; margin-top: 1px; }
.chat-compose { display: flex; gap: 6px; align-items: flex-end; padding: 8px; border-top: 1px solid var(--line); margin: 0; background: var(--panel); }
.chat-compose textarea { flex: 1; resize: none; min-height: 38px; max-height: 110px; border-radius: 18px; padding: 8px 12px; }
.chat-send { width: 38px; height: 38px; border-radius: 50%; padding: 0; display: grid; place-items: center; flex: none; }
@media (max-width: 700px) {
  .chat-dock, .chat-dock.side-start { inset-inline: 0; max-width: 100vw; gap: 0; }
  .chat-win, .chat-list-win { width: 100vw; height: 70vh; border-radius: 12px 12px 0 0; }
  .chat-win.min { width: auto; flex: 1; }
}
.chat-agent { margin-inline-start: 6px; text-decoration: none; }

/* 0.63: the menu as a pop-out (like Teams): the rail stays; a section's pages fly out over the page and close
   once one is picked (📌 keeps the panel open, as before) */
.side-unpin { display: inline-flex; }
.side-pin { display: none; }
body.side-folded .side-unpin { display: none; }
body.side-folded .side-pin { display: inline-flex; font-size: 15px; }
@media (min-width: 961px) {
  body.side-fly .ui-new .side, body.side-fly.ui-new .side, body.side-fly .side { z-index: 80; }
  body.side-folded.side-fly .side-panel { display: flex; position: fixed; inset-block: 0; inset-inline-start: 72px; width: 240px; z-index: 70; background: var(--panel); border-inline-end: 1px solid var(--line); box-shadow: 8px 0 30px rgba(15, 23, 42, .18); animation: side-fly-in .14s ease-out; }
  body.side-folded.side-fly .shell2.with-banner .side-panel { inset-block-start: 44px; }
  body.side-folded.side-fly .side-org { display: grid; }
  body.side-folded.side-fly .side-panel .side-label { display: inline; }
  body.side-folded.side-fly .side-panel a, body.side-folded.side-fly .side-panel .side-group { justify-content: flex-start; padding: 8px 10px; }
  body.side-folded.side-fly .side-brand { justify-content: space-between; padding: 0 12px; }
}
@keyframes side-fly-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
[dir="rtl"] body.side-folded.side-fly .side-panel { animation-name: side-fly-in-rtl; }
@keyframes side-fly-in-rtl { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { body.side-folded.side-fly .side-panel { animation: none; } }
/* on a phone the menu slides in from ☰ either way: the full panel, no pin */
@media (max-width: 960px) {
  body.side-folded .ui-new .side a, body.side-folded .side a { justify-content: flex-start; padding: 8px 10px; }
  body.side-folded .ui-new .side .rail-btn, body.side-folded .side .rail-btn { justify-content: center; padding: 8px 2px 6px; }
  body.side-folded .side-org { display: grid; }
  body.side-folded .side-brand { justify-content: space-between; padding: 0 12px; }
  .side-pin, .side-unpin { display: none !important; }
}

/* New ticket (tickets.js) */
.tk-who { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin: 4px 0 10px; background: var(--sunk); }
.tk-who p { margin: 0 0 6px; }
.tk-results { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; margin: 6px 0; }
.tk-contact { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.tk-contact input { margin-top: 3px; }
.tk-search input[type=search] { width: 100%; }
.tk-new { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 600px) { .tk-new { grid-template-columns: 1fr; } }
.case-ticket-actions { display: inline-flex; gap: 6px; margin-inline-start: 6px; }
.tk-phone { display: flex; gap: 8px; align-items: center; } .tk-phone input { flex: 1; min-width: 0; }
.tk-via { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.tk-via p { margin: 0; }
.tk-via-opt { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--panel); }
.tk-via-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.tk-via-opt input { margin-top: 3px; }
.tk-wa-yes { color: #15803D; font-weight: 600; }
/* on a phone the menu slides in over the page: the page has the whole width, folded menu or not
   (0.63 made the folded menu the default, and its 72px column squeezed every page on phones) */
@media (max-width: 960px) {
  body.side-folded .shell2, .shell2 { grid-template-columns: minmax(0, 1fr); }
}

/* 0.65: checkboxes and radios never touch their label; tags and the buttons after them keep apart */
label > input[type=checkbox], label > input[type=radio] { margin-inline-end: 6px; }
.ident-list .tag + button, .ident-list button + button { margin-inline-start: 6px; }
input[type=time] { min-width: 112px; }
/* code and commands inside Hebrew text keep their own order */
code, kbd, .ic-cmd pre { unicode-bidi: isolate; direction: ltr; }
[dir="rtl"] .ic-cmd pre { padding-left: 70px; padding-right: 14px; }
@media (max-width: 960px) {
  /* a row of tabs wider than the phone scrolls inside itself, not the page */
  [role="tablist"], .seg, .tabs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .crumbs { overflow: hidden; min-width: 0; }
  .crumbs > * { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 700px) {
  /* a chat open on a phone covers the list (back to it with ✕ or 💬) */
  .chat-dock:has(.chat-win:not(.min):not(.chat-list-win)) .chat-list-win { display: none; }
}

/* 0.68: section colours. Like the coloured cables of a switchboard, each part of the panel has its own:
   on its menu icon, the page you're on, a thin band under the header, the mark beside the page's title,
   and its number tiles. Waiting and late still read amber and red. */
:root {
  --sec-work: #0F766E; --sec-work-soft: #CCFBF1;
  --sec-phone: #4F46E5; --sec-phone-soft: #E0E7FF;
  --sec-customers: #B45309; --sec-customers-soft: #FEF3C7;
  --sec-knowledge: #7C3AED; --sec-knowledge-soft: #EDE9FE;
  --sec-team: #BE185D; --sec-team-soft: #FCE7F3;
  --sec-settings: #475569; --sec-settings-soft: #E2E8F0;
  --sec: var(--sec-work); --sec-soft: var(--sec-work-soft);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sec-work: #2DD4BF; --sec-work-soft: #123C3A;
    --sec-phone: #A5B4FC; --sec-phone-soft: #1E1B4B;
    --sec-customers: #FBBF24; --sec-customers-soft: #3A2A0B;
    --sec-knowledge: #C4B5FD; --sec-knowledge-soft: #2E1065;
    --sec-team: #F9A8D4; --sec-team-soft: #3B0A24;
    --sec-settings: #CBD5E1; --sec-settings-soft: #1E293B;
  }
}
:root[data-theme="dark"] {
  --sec-work: #2DD4BF; --sec-work-soft: #123C3A;
  --sec-phone: #A5B4FC; --sec-phone-soft: #1E1B4B;
  --sec-customers: #FBBF24; --sec-customers-soft: #3A2A0B;
  --sec-knowledge: #C4B5FD; --sec-knowledge-soft: #2E1065;
  --sec-team: #F9A8D4; --sec-team-soft: #3B0A24;
  --sec-settings: #CBD5E1; --sec-settings-soft: #1E293B;
}
body[data-sec="phone"] { --sec: var(--sec-phone); --sec-soft: var(--sec-phone-soft); }
body[data-sec="customers"] { --sec: var(--sec-customers); --sec-soft: var(--sec-customers-soft); }
body[data-sec="knowledge"] { --sec: var(--sec-knowledge); --sec-soft: var(--sec-knowledge-soft); }
body[data-sec="team"] { --sec: var(--sec-team); --sec-soft: var(--sec-team-soft); }
body[data-sec="settings"], body[data-sec="help"] { --sec: var(--sec-settings); --sec-soft: var(--sec-settings-soft); }

/* the menu: every section's icon in its colour; the open one on its tint */
.rail-btn[data-sec="work"] { --c: var(--sec-work); --cs: var(--sec-work-soft); }
.rail-btn[data-sec="phone"] { --c: var(--sec-phone); --cs: var(--sec-phone-soft); }
.rail-btn[data-sec="customers"] { --c: var(--sec-customers); --cs: var(--sec-customers-soft); }
.rail-btn[data-sec="knowledge"] { --c: var(--sec-knowledge); --cs: var(--sec-knowledge-soft); }
.rail-btn[data-sec="team"] { --c: var(--sec-team); --cs: var(--sec-team-soft); }
.rail-btn[data-sec="settings"] { --c: var(--sec-settings); --cs: var(--sec-settings-soft); }
.rail-btn[data-sec] .rail-ico { color: var(--c); }
.rail-btn[data-sec][aria-pressed="true"] { background: var(--cs); color: var(--c); }
.side-panel .side-items a[aria-current="page"] { background: var(--sec-soft); }
.side-panel .side-items a[aria-current="page"] .ico { color: var(--sec); }
.side-panel-title { color: var(--sec); }

/* the band under the header, and the mark beside the page's title */
.topbar { box-shadow: inset 0 -3px 0 var(--sec); border-bottom-color: transparent; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head h1::before { content: ''; flex: none; width: 6px; height: 1.05em; border-radius: 3px; background: var(--sec); }

/* number tiles: the section's colour on top; waiting / late in amber / red */
.kpi { border-top: 3px solid var(--sec); }
.kpi .kpi-v { color: var(--sec); }
.kpi.ok { border-top-color: var(--ok); } .kpi.ok .kpi-v { color: var(--ok); }
.kpi.warn { border-top-color: var(--wait); background: color-mix(in srgb, var(--wait) 6%, var(--panel)); }
.kpi.bad { border-top-color: var(--fault); background: var(--fault-soft); }
.kpi.warn .kpi-v { color: #B45309; } .kpi.bad .kpi-v { color: #B91C1C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kpi.warn .kpi-v { color: #FBBF24; } :root:not([data-theme="light"]) .kpi.bad .kpi-v { color: #F87171; } }
:root[data-theme="dark"] .kpi.warn .kpi-v { color: #FBBF24; } :root[data-theme="dark"] .kpi.bad .kpi-v { color: #F87171; }
/* panels: their heading takes the section's colour, quietly */
.panel > h2:first-child { color: color-mix(in srgb, var(--sec) 70%, var(--ink)); }
@media print { .topbar { box-shadow: none; } }

/* one save bar per settings page (savebar.js) */
.sb-hidden { display: none !important; }
.sb-bar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 80; width: min(720px, calc(100vw - 32px)); display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; background: var(--ink); color: var(--panel); border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, .28); animation: sb-in .18s ease-out; }
.sb-bar[hidden] { display: none; }
.sb-bar .grow { flex: 1; }
.sb-bar button:not(.primary) { background: transparent; color: var(--panel); border-color: color-mix(in srgb, var(--panel) 35%, transparent); }
.sb-bar .primary { background: var(--sec, var(--accent)); border-color: transparent; color: var(--panel); }
.sb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--wait); flex: none; }
body.has-sb main, body.has-sb .main { padding-bottom: 90px; }
@keyframes sb-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .sb-bar { animation: none; } }

/* switched off: what it controls is dimmed (app.js whenOn) */
.is-off { opacity: .5; filter: saturate(.4); transition: opacity .15s; }
.is-off:focus-within { opacity: .85; }
.off-note { color: var(--wait); margin: 4px 0 8px; }
@media (prefers-reduced-motion: reduce) { .is-off { transition: none; } }

/* long settings pages: the bar of their parts (savebar.js) */
.page-toc { position: sticky; top: 62px; z-index: 20; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 14px; padding: 8px 0; background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(6px); }
.page-toc::-webkit-scrollbar { display: none; }
.toc-chip { flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.toc-chip:hover { border-color: var(--sec); }
.toc-chip[aria-current="true"] { background: var(--sec-soft); border-color: var(--sec); color: var(--sec); font-weight: 600; }
.panel[data-toc-i] { scroll-margin-top: 120px; }

/* the conversation's ⋯ menu: priority, snooze, task */
.more-menu { position: relative; }
.more-menu > summary { list-style: none; cursor: pointer; padding: 0 12px; font-size: 1.1rem; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-items { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 12px 30px rgba(15, 23, 42, .16); }
.more-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .9rem; }
.more-row select { flex: 1; max-width: 160px; }
.more-items > button, .more-items > .btn { width: 100%; justify-content: center; }
.tag.pri-high { background: color-mix(in srgb, var(--wait) 16%, var(--panel)); color: #B45309; }
.tag.pri-urgent { background: var(--fault-soft); color: #B91C1C; }
.more-check input { width: 18px; height: 18px; }

/* Cases: what the case is about, how it ended, tags */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 720px) { .grid3 { grid-template-columns: minmax(0, 1fr); } }
.case-about textarea { width: 100%; }
.note-box.warn { background: color-mix(in srgb, var(--wait) 14%, var(--panel)); }
.case-head + .note-box, .page-head + .note-box, .note-box + .note-box { margin-bottom: 12px; }
.note-box[role=status] { margin-bottom: 12px; white-space: normal; }
.case-tag { display: inline-block; font-size: 11px; padding: 0 6px; margin-inline-end: 4px; border-radius: 999px; background: var(--sec-soft, var(--sunk)); }

/* the account button's chevron: small and quiet, turns over while the menu is open */
.who-chev { display: inline-flex; color: var(--muted); opacity: .9; transition: transform .15s ease, opacity .15s; }
.top-who:hover .who-chev { opacity: 1; }
.top-who[aria-expanded="true"] .who-chev { transform: rotate(180deg); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .who-chev { transition: none; } }

/* settings home: each card with its page's picture */
.hub-card { flex-direction: row; align-items: flex-start; gap: 12px; }
.hub-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.hub-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
