/* DangLive Support dashboard - "Navy & Gold" (tokens from the games admin theme.css), phone first.
   gold = action / you are here, green = online / OK, orange = waiting long, red = waiting very long / danger. */

@font-face { font-family: "Outfit"; src: url("fonts/Outfit-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("fonts/Outfit-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("fonts/Outfit-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Noto Kufi Arabic"; src: url("fonts/NotoKufiArabic-Regular.ttf") format("truetype"); font-weight: 400 500;
  font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Noto Kufi Arabic"; src: url("fonts/NotoKufiArabic-SemiBold.ttf") format("truetype"); font-weight: 600 800;
  font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }

:root {
  color-scheme: dark;
  --bg: #0a1121;
  --bg-glow: rgba(56, 92, 170, 0.18);
  --surface: #0f192c;
  --surface-2: #142036;
  --surface-3: #1a2842;
  --surface-hover: #1b2943;
  --input: #0b1426;
  --line: #1d2a44;
  --line-2: #2a3a5a;
  --text: #edf1f8;
  --text-2: #b4bfd3;
  --muted: #8592ab;
  --gold: #e3b65c;
  --gold-2: #f1cf86;
  --gold-3: #b88c3a;
  --gold-text: #f1cf86;
  --gold-soft: rgba(227, 182, 92, 0.12);
  --gold-line: rgba(227, 182, 92, 0.40);
  --on-gold: #0b1222;
  --ok: #3ccf8e;
  --ok-soft: rgba(60, 207, 142, 0.12);
  --danger: #f06272;
  --danger-soft: rgba(240, 98, 114, 0.12);
  --warn: #ff8044;
  --warn-soft: rgba(255, 128, 68, 0.12);
  --info: #86acff;
  --info-soft: rgba(134, 172, 255, 0.12);
  --offline: #5d6b86;
  --bubble-in: #16233b;
  --bubble-in-line: #20304e;
  --bubble-out: linear-gradient(160deg, #2b2615 0%, #231f13 100%);
  --bubble-out-line: rgba(227, 182, 92, 0.34);
  --bubble-out-text: #f6ead0;
  --system: #111c31;
  --shadow-1: 0 1px 2px rgba(2, 6, 16, 0.5);
  --shadow-2: 0 10px 28px rgba(2, 6, 16, 0.45);
  --shadow-3: 0 28px 70px rgba(2, 6, 16, 0.65);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --font: "Outfit", "Noto Kufi Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5fa;
  --bg-glow: rgba(227, 182, 92, 0.16);
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --surface-3: #e9edf5;
  --surface-hover: #eef2f8;
  --input: #ffffff;
  --line: #e2e7f0;
  --line-2: #cfd7e4;
  --text: #0e1828;
  --text-2: #3f4d66;
  --muted: #66738b;
  --gold: #e3b65c;
  --gold-2: #f1cf86;
  --gold-3: #b88c3a;
  --gold-text: #8a6214;
  --gold-soft: rgba(227, 182, 92, 0.16);
  --gold-line: rgba(184, 140, 58, 0.45);
  --on-gold: #1a1406;
  --ok: #129a62;
  --ok-soft: rgba(18, 154, 98, 0.10);
  --danger: #d23a4c;
  --danger-soft: rgba(210, 58, 76, 0.09);
  --warn: #d4561a;
  --warn-soft: rgba(212, 86, 26, 0.10);
  --info: #2f62d6;
  --info-soft: rgba(47, 98, 214, 0.09);
  --offline: #a3adbf;
  --bubble-in: #ffffff;
  --bubble-in-line: #e2e7f0;
  --bubble-out: linear-gradient(160deg, #fbf1db 0%, #f7e6c0 100%);
  --bubble-out-line: rgba(184, 140, 58, 0.35);
  --bubble-out-text: #2b2006;
  --system: #f7f8fc;
  --shadow-1: 0 1px 2px rgba(15, 25, 45, 0.06);
  --shadow-2: 0 10px 28px rgba(15, 25, 45, 0.10);
  --shadow-3: 0 28px 70px rgba(15, 25, 45, 0.20);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f3f5fa; --bg-glow: rgba(227, 182, 92, 0.16); --surface: #ffffff; --surface-2: #f4f6fb; --surface-3: #e9edf5;
    --surface-hover: #eef2f8; --input: #ffffff; --line: #e2e7f0; --line-2: #cfd7e4; --text: #0e1828; --text-2: #3f4d66;
    --muted: #66738b; --gold-text: #8a6214; --gold-soft: rgba(227, 182, 92, 0.16); --gold-line: rgba(184, 140, 58, 0.45);
    --on-gold: #1a1406; --ok: #129a62; --ok-soft: rgba(18, 154, 98, 0.10); --danger: #d23a4c; --danger-soft: rgba(210, 58, 76, 0.09);
    --warn: #d4561a; --warn-soft: rgba(212, 86, 26, 0.10); --info: #2f62d6; --info-soft: rgba(47, 98, 214, 0.09); --offline: #a3adbf;
    --bubble-in: #ffffff; --bubble-in-line: #e2e7f0; --bubble-out: linear-gradient(160deg, #fbf1db 0%, #f7e6c0 100%);
    --bubble-out-line: rgba(184, 140, 58, 0.35); --bubble-out-text: #2b2006; --system: #f7f8fc;
    --shadow-1: 0 1px 2px rgba(15, 25, 45, 0.06); --shadow-2: 0 10px 28px rgba(15, 25, 45, 0.10); --shadow-3: 0 28px 70px rgba(15, 25, 45, 0.20);
  }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.45; color: var(--text);
  background: radial-gradient(1100px 560px at 85% -10%, var(--bg-glow), transparent 62%), var(--bg);
  background-attachment: fixed; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
img { display: block; max-width: 100%; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.xs { width: 13px; height: 13px; stroke-width: 2.1; }
svg.i.lg { width: 24px; height: 24px; }
svg.i.fill { fill: currentColor; stroke: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.noscript { padding: 24px; color: var(--text); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
bdi { unicode-bidi: isolate; }
::selection { background: rgba(227, 182, 92, 0.32); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ------------------------------------------------------------------ buttons, chips, inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-md); font-weight: 600; font-size: 14.5px; letter-spacing: 0.01em; white-space: nowrap;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { background: var(--surface-hover); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.gold {
  background: linear-gradient(180deg, var(--gold-2) 0%, var(--gold) 48%, #d2a24a 100%); color: var(--on-gold); border-color: rgba(255, 228, 160, 0.55);
  box-shadow: 0 6px 18px rgba(227, 182, 92, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn.gold:hover { filter: brightness(1.04); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.outline { background: transparent; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.big { min-height: 52px; font-size: 16px; padding: 0 22px; border-radius: 14px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.icon-btn {
  position: relative; width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--text-2); flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { color: var(--gold-text); background: var(--gold-soft); }
.icon-btn .n {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 800; background: var(--danger); color: #fff; border: 2px solid var(--surface);
}
.tab-only, .tab-inline { display: none; }
.icon-btn.gold { color: var(--on-gold); background: var(--gold); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--text-2); background: var(--surface-3); border: 1px solid transparent; white-space: nowrap;
}
.chip.gold { color: var(--gold-text); background: var(--gold-soft); border-color: var(--gold-line); }
.chip.ok { color: var(--ok); background: var(--ok-soft); }
.chip.warn { color: var(--warn); background: var(--warn-soft); }
.chip.danger { color: var(--danger); background: var(--danger-soft); }
.chip.blue { color: var(--info); background: var(--info-soft); }
.chip.line { background: transparent; border-color: var(--line-2); }

.lang {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px 0 4px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--surface-3); color: var(--text); white-space: nowrap; letter-spacing: 0.02em;
}
.lang b { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 4px; border-radius: 6px; font-size: 10.5px; color: #fff; letter-spacing: 0.04em; }
.lang .nat { font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.lang.en b { background: linear-gradient(135deg, #3d6fe0, #2a4fa8); }
.lang.ku b { background: linear-gradient(180deg, #e0453f 0 24%, #fbfaf6 24% 76%, #2f9e57 76%); color: #10192b; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.lang.ar b { background: linear-gradient(135deg, #1f8a5a, #146b44); }
.lang.none b { background: var(--offline); }
.lang.btn-like { cursor: pointer; border: 1px solid var(--line-2); }
.lang.btn-like:hover { border-color: var(--gold-line); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12.5px; }
.input, textarea.input, select.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--input);
  color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; font-size: 15.5px;
}
textarea.input { resize: vertical; min-height: 96px; line-height: 1.5; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.input::placeholder { color: var(--muted); }
.input.code { text-align: center; font-size: 26px; font-weight: 600; letter-spacing: 0.42em; padding-left: 0.42em; font-variant-numeric: tabular-nums; }

/* avatar + online dot */
.av { position: relative; display: inline-block; vertical-align: middle; flex: none; width: 44px; height: 44px; border-radius: 50%; }
.av > img, .av > .ini { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.av > .ini { display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; letter-spacing: 0.02em; }
.av.s32 { width: 32px; height: 32px; } .av.s32 > .ini { font-size: 12px; }
.av.s36 { width: 36px; height: 36px; } .av.s36 > .ini { font-size: 13px; }
.av.s40 { width: 40px; height: 40px; }
.av.s72 { width: 72px; height: 72px; } .av.s72 > .ini { font-size: 26px; }
.av .dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid var(--surface); background: var(--offline); }
.av.s72 .dot { width: 17px; height: 17px; right: 2px; bottom: 2px; border-width: 3px; }
.av .dot.on { background: var(--ok); box-shadow: 0 0 0 2px rgba(60, 207, 142, 0.18); }
.presence { display: inline-flex; align-items: center; gap: 5px; }
.presence.on { color: var(--ok); font-weight: 600; }
.presence.on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* ------------------------------------------------------------------ app frame (phone first) */
.app { height: 100dvh; display: flex; flex-direction: column; }
.rail { display: none; }
.topbar {
  flex: none; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 12px 10px 16px; min-height: 60px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: start; border-radius: 12px; }
.mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; color: var(--on-gold);
  background: linear-gradient(145deg, #f7dc9c 0%, #e3b65c 45%, #b88c3a 100%); box-shadow: 0 6px 16px rgba(227, 182, 92, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.mark svg { width: 20px; height: 20px; stroke-width: 2.1; }
.brand-t { display: grid; line-height: 1.15; min-width: 0; }
.brand-t b { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.brand-t span { font-size: 11px; font-weight: 700; color: var(--gold-text); letter-spacing: 0.16em; text-transform: uppercase; }
.lane { font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; color: var(--warn); border: 1px solid currentColor; border-radius: 6px; padding: 1px 6px; }
.topbar .grow { flex: 1; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.conn.stale::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.conn.err::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.conn.wide-only, .wide-inline { display: none; }

.main { flex: 1; min-height: 0; display: flex; position: relative; }
.pane-list { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.pane-case { display: none; flex: 1; min-width: 0; min-height: 0; flex-direction: column; background: var(--bg); }
.pane-info { display: none; }
.app.show-case .pane-list { display: none; }
.app.show-case .pane-case { display: flex; }
.app.show-case .bottombar, .app.show-case .topbar { display: none; }
.app.show-page .pane-case { display: flex; }
.app.show-page .pane-list { display: none; }

.bottombar {
  flex: none; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(14px);
}
.tabbtn {
  position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 2px 4px; border-radius: 12px; color: var(--muted);
  font-size: 11.5px; font-weight: 600; min-height: 52px;
}
.tabbtn.on { color: var(--gold-text); }
.tabbtn.on svg { stroke-width: 2.2; }
.tabbtn .n {
  position: absolute; top: 2px; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text); border: 2px solid var(--surface);
}
.tabbtn .n.hot { background: var(--danger); color: #fff; }
.tabbtn .n.gold { background: var(--gold); color: var(--on-gold); }

/* list header (title + tabs on wide screens) */
.list-head { flex: none; padding: 14px 16px 10px; display: flex; align-items: center; gap: 10px; }
.list-head h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: 0.005em; }
.list-head .sub { color: var(--muted); font-size: 13px; }
.seg { display: none; }
.filters { display: flex; gap: 8px; padding: 0 16px 10px; overflow-x: auto; flex: none; }
.filters .chip { height: 32px; padding: 0 12px; font-size: 13px; cursor: pointer; border: 1px solid var(--line-2); background: transparent; }
.filters .chip.on { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-text); }
.list { flex: 1; overflow-y: auto; padding: 2px 12px calc(16px + var(--safe-b)); overscroll-behavior: contain; container-type: inline-size; }
@container (max-width: 345px) { .card-foot .lw { display: none; } }
.list-empty { padding: 48px 24px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.list-empty .ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--gold-text); border: 1px solid var(--line); }
.list-empty b { color: var(--text); font-size: 16px; }

/* request card */
.card {
  width: 100%; text-align: start; display: grid; gap: 10px; padding: 14px; margin: 0 0 10px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: border-color .15s, background .15s, transform .08s;
  position: relative;
}
.card:hover { border-color: var(--line-2); background: color-mix(in srgb, var(--surface) 70%, var(--surface-2)); }
.card:active { transform: scale(0.995); }
.card.sel { border-color: var(--gold-line); background: linear-gradient(180deg, var(--gold-soft), transparent 140%), var(--surface); box-shadow: 0 0 0 1px var(--gold-line) inset, var(--shadow-1); }
.card.vip::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 16px 0 0 16px; background: linear-gradient(var(--gold-2), var(--gold-3)); }
.card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-id { flex: 1; min-width: 0; display: grid; gap: 2px; }
.card-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 650; font-size: 15.5px; }
.card-name bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.card-sub .sep { opacity: .5; }
.card-right { display: grid; justify-items: end; gap: 6px; flex: none; }
.wait { font-size: 12.5px; font-weight: 700; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.wait.warn { color: var(--warn); }
.wait.hot { color: var(--danger); }
.card-body { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.preview {
  margin: 0; flex: 1; min-width: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
.preview .who { color: var(--muted); font-weight: 600; }
.preview.media-only { color: var(--muted); font-style: normal; display: flex; align-items: center; gap: 6px; }
.thumb { position: relative; flex: none; width: 54px; height: 54px; border-radius: 10px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.45)); }
.thumb .play svg { width: 18px; height: 18px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.card-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-foot .no { margin-inline-start: auto; font-size: 12px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.vip-chip { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em;
  color: var(--on-gold); background: linear-gradient(135deg, var(--gold-2), var(--gold)); flex: none; }
.vip-chip svg { width: 11px; height: 11px; stroke-width: 2.4; }
.unread { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--gold); color: var(--on-gold); font-weight: 800; font-size: 12px; display: inline-grid; place-items: center; }

/* ------------------------------------------------------------------ case view */
.case-head {
  flex: none; display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t)) 8px 8px; min-height: 64px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px);
}
.case-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: start; border-radius: 12px; padding: 4px; }
.case-who .t { min-width: 0; display: grid; gap: 1px; }
.case-who .nm { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 16px; min-width: 0; }
.case-who .nm bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-who .sb { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.case-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.case-acts .wide { display: none; }
.case-strip {
  flex: none; display: flex; align-items: center; gap: 8px; row-gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 8px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; font-size: 12.5px;
}
.case-strip::-webkit-scrollbar { display: none; }
.case-strip > * { flex: none; }
.case-strip .no { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.new { color: var(--gold-text); background: var(--gold-soft); }
.status.active { color: var(--ok); background: var(--ok-soft); }
.status.closed { color: var(--muted); background: var(--surface-3); }
.banner {
  flex: none; display: flex; gap: 9px; align-items: flex-start; margin: 10px 12px 0; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45;
  background: var(--info-soft); color: var(--text-2); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
}
.banner svg { color: var(--info); margin-top: 1px; }
.banner.gold { background: var(--gold-soft); border-color: var(--gold-line); }
.banner.gold svg { color: var(--gold-text); }
.banner b { color: var(--text); }

.thread {
  flex: 1; overflow-y: auto; padding: 16px 12px 12px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; scroll-behavior: auto;
}
/* soft top edge only while scrolled down (no cut-off half line under the header) */
.thread.faded { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 44px); mask-image: linear-gradient(to bottom, transparent 0, #000 44px); }
.day { align-self: center; margin: 12px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  background: var(--surface-2); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.row { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.row.out { justify-content: flex-end; }
.row + .row.gap { margin-top: 10px; }
.row .av { margin-bottom: 2px; }
.row .av.ghost { visibility: hidden; }
.msg { max-width: min(78%, 560px); display: grid; gap: 4px; }
.who-line { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 6px; }
.row.out .who-line { text-align: end; color: var(--gold-text); }
.bubble {
  padding: 9px 13px 7px; border-radius: 18px; background: var(--bubble-in); border: 1px solid var(--bubble-in-line); color: var(--text);
  font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--shadow-1);
}
.row.in .bubble { border-bottom-left-radius: 6px; }
.row.out .bubble { background: var(--bubble-out); border-color: var(--bubble-out-line); color: var(--bubble-out-text); border-bottom-right-radius: 6px; }
.row.in.cont .bubble { border-top-left-radius: 8px; }
.row.out.cont .bubble { border-top-right-radius: 8px; }
.meta { display: flex; justify-content: flex-end; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.row.out .meta { color: color-mix(in srgb, var(--bubble-out-text) 60%, transparent); }
.media {
  position: relative; border-radius: 16px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); cursor: zoom-in;
  width: min(240px, 60vw); max-height: 340px;
}
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.media .play { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.5)); color: #fff; }
.media .play span { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(10, 17, 33, 0.55); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.25); }
.media .play svg { width: 22px; height: 22px; margin-left: 3px; }
.media .dur { position: absolute; right: 8px; bottom: 8px; font-size: 11.5px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.55); padding: 2px 7px; border-radius: 999px; }
.media { aspect-ratio: 3 / 4; }
.media > img, .media > video { position: absolute; inset: 0; }
.media .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.media.is-video .ph, .thumb.is-video .ph { background: linear-gradient(160deg, var(--surface-3), var(--surface-2)); }
.media + .bubble { margin-top: 4px; }

.sys { align-self: stretch; display: flex; justify-content: center; margin: 10px 0; }
.sys-card {
  width: min(100%, 520px); background: var(--system); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 8px; box-shadow: var(--shadow-1);
}
.sys-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.sys-head .badge { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-weight: 700; font-size: 13px; }
.sys-head .badge svg { color: var(--info); width: 15px; height: 15px; }
.sys-head .kind { margin-inline-start: auto; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--gold-text); }
.sys-body { white-space: pre-wrap; font-size: 14px; line-height: 1.65; color: var(--text-2); overflow-wrap: anywhere; }
.langs { display: flex; gap: 8px; flex-wrap: wrap; }
.langs span { flex: 1; min-width: 84px; text-align: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line-2); font-weight: 600; font-size: 14px; color: var(--text-2); }
.langs span.on { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-text); box-shadow: 0 0 0 1px var(--gold-line) inset; }
.sys-note { font-size: 12px; color: var(--muted); }

/* composer */
.composer { flex: none; padding: 8px 10px calc(8px + var(--safe-b)); background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--line); }
.comp-row { display: flex; align-items: flex-end; gap: 6px; }
.comp-box { flex: 1; min-width: 0; display: flex; align-items: flex-end; background: var(--input); border: 1px solid var(--line-2); border-radius: 22px; padding: 2px 4px 2px 14px; transition: border-color .15s, box-shadow .15s; }
.comp-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.comp-box textarea {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent; resize: none; padding: 11px 0; min-height: 44px; max-height: 160px;
  font-size: 15.5px; line-height: 1.45; color: var(--text);
}
.comp-box textarea::placeholder { color: var(--muted); }
.send { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--on-gold);
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, #d2a24a); box-shadow: 0 6px 16px rgba(227, 182, 92, 0.3); }
.send[disabled] { opacity: .45; box-shadow: none; }
.send svg { width: 20px; height: 20px; margin-left: -2px; stroke-width: 2.1; }
.comp-hint { display: none; font-size: 11.5px; color: var(--muted); padding: 6px 4px 0; }
.comp-hint kbd { font-family: inherit; font-size: 11px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface-2); }
.uploads { display: flex; gap: 8px; padding: 0 0 8px; overflow-x: auto; }
.up { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--surface-3); flex: none; border: 1px solid var(--line-2); }
.up img, .up video { width: 100%; height: 100%; object-fit: cover; }
.up .bar { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; border-radius: 4px; background: rgba(0, 0, 0, 0.45); overflow: hidden; }
.up .bar i { display: block; height: 100%; background: var(--gold); width: 0; }
.up .x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.6); color: #fff; }
.up.err { border-color: var(--danger); }
.accept-bar { flex: none; display: grid; gap: 10px; padding: 12px 12px calc(12px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
.accept-bar p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.accept-bar p svg { margin-top: 1px; color: var(--gold-text); }
.accept-bar p b { color: var(--text); font-weight: 600; }
.locked-bar { flex: none; padding: 14px 16px calc(14px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); display: flex; gap: 10px; align-items: center; }

/* side info (desktop column, sheet on phone) */
.info { display: grid; gap: 14px; padding: 16px; align-content: start; }
.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: grid; gap: 12px; }
.info-card h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.info-card h3 .grow { flex: 1; }
.who-big { display: flex; gap: 12px; align-items: center; }
.who-big .nm { font-size: 17px; font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.idline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.copy { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); }
.copy:hover { background: var(--surface-2); color: var(--text); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: end; color: var(--text); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.notes { display: grid; gap: 8px; }
.note { background: color-mix(in srgb, var(--gold) 9%, var(--surface)); border: 1px solid var(--gold-line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; }
.note .b { white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.note .m { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.hist { display: grid; gap: 6px; }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.hist-row .no { font-weight: 700; font-variant-numeric: tabular-nums; }
.hist-row .grow { flex: 1; color: var(--muted); }

/* sheets / dialogs, toasts, lightbox */
.scrim { position: fixed; inset: 0; background: rgba(3, 7, 16, 0.6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet {
  width: 100%; max-height: 88dvh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0; border: 1px solid var(--line);
  padding: 8px 16px calc(16px + var(--safe-b)); box-shadow: var(--shadow-3); animation: up .2s ease;
}
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 5px; background: var(--line-2); margin: 4px auto 10px; }
.sheet h2 { margin: 4px 0 14px; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.sheet h2 .grow { flex: 1; }
.sheet .acts { display: flex; gap: 10px; margin-top: 16px; }
.sheet .acts .btn { flex: 1; }
.menu-list { display: grid; gap: 4px; }
.menu-item { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 12px; border-radius: 12px; font-weight: 600; text-align: start; color: var(--text); width: 100%; }
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { color: var(--text-2); }
.menu-item .grow { flex: 1; }
.menu-item.on { background: var(--gold-soft); color: var(--gold-text); }
.menu-item.on svg { color: var(--gold-text); }
.menu-item.danger, .menu-item.danger svg { color: var(--danger); }
.toasts { position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 70; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #0d1628; color: #edf1f8; border: 1px solid #22314f; border-radius: 14px; padding: 12px 14px; font-size: 14px; box-shadow: var(--shadow-2); display: flex; gap: 10px; align-items: center; animation: up .2s ease; }
.toast.err { border-color: rgba(240, 98, 114, 0.5); }
.toast.ok svg { color: #3ccf8e; }
.toast.err svg { color: #f06272; }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(2, 5, 12, 0.94); display: grid; place-items: center; padding: 56px 12px 24px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: calc(100dvh - 90px); border-radius: 12px; }
.lightbox .icon-btn { position: absolute; top: calc(10px + var(--safe-t)); right: 10px; color: #fff; background: rgba(255, 255, 255, 0.08); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(16px); opacity: 0; } }

/* ------------------------------------------------------------------ pages (team, audit, settings, search ...) */
.page { flex: 1; overflow-y: auto; padding: 4px 16px calc(24px + var(--safe-b)); }
.page-in { max-width: 1040px; margin: 0 auto; display: grid; gap: 16px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; flex: 1; min-width: 160px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; flex-basis: 100%; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 14px; }
.panel h2 { margin: 0; font-size: 15px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.panel h2 .grow { flex: 1; }
.panel p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.grid { display: grid; gap: 12px; }
.agent {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: grid; gap: 12px; box-shadow: var(--shadow-1);
}
.agent.off { opacity: .72; }
.agent-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.agent-top .t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.agent-top .nm { font-weight: 700; font-size: 16px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.agent-top .nm bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-top .sb { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role { height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; display: inline-flex; align-items: center; flex: none; }
.role.owner { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--on-gold); }
.role.supervisor { background: var(--info-soft); color: var(--info); }
.role.agent { background: var(--surface-3); color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 9px 10px; display: grid; gap: 1px; min-width: 0; }
.stat b { font-size: 15.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.agent-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.agent-acts .btn { flex: 1 1 0; min-width: max-content; }
.welcome { background: linear-gradient(135deg, rgba(227, 182, 92, 0.16), rgba(227, 182, 92, 0.04) 60%), var(--surface); border-color: var(--gold-line); }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: s; }
.steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.steps li::before { counter-increment: s; content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--gold); color: var(--on-gold); }
.steps li.done { color: var(--muted); text-decoration: line-through; }
.steps li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.table { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.tr { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.tr:first-child { border-top: 0; }
.tr.th { display: none; }
.tr .a { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tr .d { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.seg2 { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg2 button { min-height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 700; color: var(--text-2); }
.seg2 button.on { background: var(--gold); color: var(--on-gold); box-shadow: 0 4px 12px rgba(227, 182, 92, 0.25); }
.switch { position: relative; width: 50px; height: 30px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .15s; }
.switch.on { background: var(--gold); border-color: var(--gold); }
.switch.on::after { transform: translateX(20px); }
.set-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.set-row .t { display: grid; gap: 2px; }
.set-row .t b { font-size: 14.5px; }
.set-row .t span { color: var(--muted); font-size: 12.5px; }
.textbox { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13.5px; line-height: 1.6; color: var(--text-2); overflow-wrap: anywhere; }
.tpl { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.tpl .h { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.tpl .h .grow { flex: 1; }
.tpl .v { display: grid; gap: 6px; }
.tpl .v div { display: flex; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.tpl .v div .lang { flex: none; }
.tpl .v div p { margin: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qr-wrap { display: grid; justify-items: center; gap: 10px; }
.qr-wrap img { width: 200px; height: 200px; border-radius: 12px; background: #fff; padding: 6px; }
.secret { font-size: 16px; font-weight: 700; letter-spacing: 0.08em; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line-2); text-align: center; overflow-wrap: anywhere; }
.qlist { display: grid; gap: 8px; max-height: 52dvh; overflow: auto; }
.qitem { text-align: start; display: grid; gap: 4px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.qitem:hover { border-color: var(--gold-line); }
.qitem b { font-size: 14px; }
.qitem p { margin: 0; font-size: 13.5px; color: var(--text-2); white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b)); overflow: auto; height: 100dvh; }
.login-card {
  width: 100%; max-width: 420px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line); border-radius: 24px;
  padding: 28px 22px 22px; box-shadow: var(--shadow-3); display: grid; gap: 18px; backdrop-filter: blur(10px);
}
.login-brand { display: grid; justify-items: center; gap: 12px; text-align: center; }
.login-brand .mark { width: 64px; height: 64px; border-radius: 20px; }
.login-brand .mark svg { width: 34px; height: 34px; }
.login-brand h1 { margin: 0; font-size: 24px; font-weight: 700; }
.login-brand p { margin: 0; color: var(--muted); font-size: 14px; }
.login form { display: grid; gap: 14px; }
.login .alt { text-align: center; font-size: 14px; color: var(--muted); }
.link { color: var(--gold-text); font-weight: 600; text-decoration: none; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.err-box { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; display: flex; gap: 8px; }
.ok-box { background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.login-foot { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.login-foot svg { color: var(--gold-text); flex: none; margin-top: 1px; }
.login-art { display: none; }
.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw button { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }

.splash { height: 100dvh; display: grid; place-items: center; }
.splash .mark { width: 56px; height: 56px; border-radius: 18px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.94); opacity: .75; } }

/* ------------------------------------------------------------------ tablet: two panes */
@media (min-width: 768px) and (min-height: 501px) {
  body { font-size: 14.5px; }
  .app { flex-direction: column; }
  .main { flex-direction: row; }
  .pane-list { flex: none; width: 360px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 40%, transparent); }
  .pane-case { display: flex; }
  .app.show-case .pane-list { display: flex; }
  .app.show-case .topbar { display: flex; }
  .app.show-case .bottombar { display: none; }
  .bottombar { display: none; }
  .seg { display: flex; gap: 4px; padding: 0 12px 10px; flex: none; }
  .seg button { flex: 1; min-height: 40px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; }
  .seg button:hover { background: var(--surface-2); }
  .seg button.on { background: var(--gold-soft); color: var(--gold-text); border-color: var(--gold-line); }
  .seg .n { font-size: 11.5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text); }
  .seg .n.hot { background: var(--danger); color: #fff; }
  .seg .n.gold { background: var(--gold); color: var(--on-gold); }
  .case-head .back { display: none; }
  .case-head { padding-top: 8px; padding-left: 14px; }
  .case-acts .wide { display: inline-flex; }
  .case-acts .narrow { display: none; }
  .thread { padding: 18px 22px 14px; }
  .msg { max-width: min(72%, 560px); }
  .composer { padding: 10px 16px 12px; }
  .comp-hint { display: block; }
  .accept-bar { padding: 14px 18px; }
  .tab-only { display: inline-grid; }
  .tab-inline { display: inline; }
  .topbar { gap: 6px; }
  .scrim { align-items: center; padding: 24px; }
  .sheet { max-width: 520px; border-radius: 22px; padding: 20px 22px 20px; max-height: 86vh; }
  .sheet::before { display: none; }
  .toasts { bottom: 28px; }
  .grid.agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page { padding: 4px 24px 32px; }
  .tr { grid-template-columns: 150px 170px 1fr; align-items: center; gap: 12px; }
  .tr.th { display: grid; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
  .tr.tickets { grid-template-columns: 1.3fr 2fr auto; }
  .empty-case { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px; }
  .empty-case .ring { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--surface); border: 1px solid var(--line); color: var(--gold-text); box-shadow: var(--shadow-2); }
  .empty-case b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
  .login-wrap { display: grid; grid-template-columns: 1fr; }
  .case-acts .btn.wide { width: 44px; padding: 0; background: transparent; border-color: transparent; color: var(--text-2); }
  .case-acts .btn.wide:hover { background: var(--surface-2); color: var(--text); }
  .case-acts .btn.danger.wide { color: var(--danger); }
  .case-acts .btn.wide .lbl { display: none; }
}

/* ------------------------------------------------------------------ desktop: rail + three panes */
@media (min-width: 1200px) and (min-height: 501px) {
  .app { flex-direction: row; }
  .topbar { display: none !important; }
  .rail {
    display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; flex: none; padding: 16px 0 14px; border-right: 1px solid var(--line);
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface) 70%, transparent));
  }
  .rail .mark { margin-bottom: 14px; width: 44px; height: 44px; border-radius: 14px; }
  .rail .mark svg { width: 24px; height: 24px; }
  .rail-btn { position: relative; width: 68px; display: grid; justify-items: center; gap: 4px; padding: 9px 0 7px; border-radius: 14px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .rail-btn:hover { background: var(--surface-2); color: var(--text); }
  .rail-btn.on { color: var(--gold-text); background: var(--gold-soft); }
  .rail-btn.on::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--gold); }
  .rail-btn .n { position: absolute; top: 4px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; background: var(--danger); color: #fff; border: 2px solid var(--surface); }
  .rail .grow { flex: 1; }
  .rail .me { margin-top: 6px; border-radius: 50%; padding: 3px; border: 2px solid transparent; }
  .rail .me:hover { border-color: var(--gold-line); }
  .rail .lane { margin-bottom: 8px; }
  .main { flex: 1; }
  .pane-list { width: 384px; }
  .pane-info { display: block; flex: none; width: 344px; border-left: 1px solid var(--line); overflow-y: auto; background: color-mix(in srgb, var(--surface) 40%, transparent); }
  .pane-info.empty { display: none; }
  .case-acts .info-btn { display: none; }
  .case-acts .btn.wide { width: auto; padding: 0 16px; background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
  .case-acts .btn.danger.wide { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
  .case-acts .btn.wide:hover { background: var(--surface-hover); }
  .case-acts .btn.danger.wide:hover { background: var(--danger-soft); }
  .case-acts .btn.wide .lbl { display: inline; }
  .accept-bar { grid-template-columns: 1fr auto; align-items: center; gap: 18px; }
  .wide-inline { display: inline; }
  .list-head { padding: 22px 18px 12px; }
  .list-head h1 { font-size: 24px; }
  .thread { padding: 22px 28px 16px; }
  .grid.agents { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
  .conn.wide-only { display: inline-flex; }
  .page { padding: 8px 36px 40px; }
  .page-head h1 { font-size: 26px; }
  .tr { grid-template-columns: 170px 190px 1fr 120px; }
  .tr.tickets { grid-template-columns: 1.3fr 2.4fr auto; }
  .toasts { left: auto; right: 28px; transform: none; bottom: auto; top: 22px; }
  .login { grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr); place-items: stretch; padding: 0; }
  .login-art {
    display: grid; align-content: center; gap: 28px; padding: 72px; position: relative; overflow: hidden; border-right: 1px solid var(--line);
    background: radial-gradient(700px 420px at 20% 10%, rgba(227, 182, 92, 0.22), transparent 60%), radial-gradient(800px 500px at 90% 100%, rgba(56, 92, 170, 0.28), transparent 60%), #08101f;
    color: #edf1f8;
  }
  .login-art h2 { margin: 0; font-size: 44px; line-height: 1.08; font-weight: 700; letter-spacing: -0.01em; max-width: 540px; }
  .login-art h2 em { font-style: normal; color: #f1cf86; }
  .login-art p { margin: 0; color: #b4bfd3; font-size: 17px; max-width: 520px; line-height: 1.55; }
  .login-art ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; max-width: 520px; }
  .login-art li { display: flex; gap: 14px; align-items: center; font-size: 15.5px; color: #dbe2ef; }
  .login-art li span.ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(227, 182, 92, 0.12); color: #f1cf86; border: 1px solid rgba(227, 182, 92, 0.3); flex: none; }
  .login-art .bubbles { display: grid; gap: 10px; max-width: 460px; margin-top: 10px; }
  .login-art .b1, .login-art .b2 { padding: 10px 14px; border-radius: 16px; font-size: 14.5px; max-width: 80%; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
  .login-art .b1 { background: #16233b; border: 1px solid #20304e; border-bottom-left-radius: 6px; justify-self: start; }
  .login-art .b2 { background: linear-gradient(160deg, #2b2615, #231f13); border: 1px solid rgba(227, 182, 92, 0.34); color: #f6ead0; border-bottom-right-radius: 6px; justify-self: end; }
  .login-side { display: grid; place-items: center; padding: 40px; }
  .login-card { box-shadow: var(--shadow-2); }
}

@media (min-width: 1500px) and (min-height: 501px) {
  .pane-list { width: 400px; }
  .pane-info { width: 360px; }
}

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

/* ---- review fixes 2026-10-12 ---- */
.main { min-width: 0; }
.comp-box { padding: 2px 14px; }
.case-acts .info-btn { display: none; }
.case-who .sb > .presence { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.case-who .sb > .presence.on::before { display: inline-block; margin-inline-end: 5px; vertical-align: 1px; }
.card.vip { overflow: hidden; }
.card.vip::before { inset: 0 auto 0 0; border-radius: 0; }
.brand-t b { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .topbar .conn .t { display: none; } }
@media (max-height: 500px) {
  .comp-hint { display: none; }
  .accept-bar { grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding-top: 8px; padding-bottom: calc(8px + var(--safe-b)); }
  .accept-bar .btn.big { min-height: 44px; }
  .banner { margin-top: 6px; padding: 6px 10px; }
}
/* 1200-1399 px laptops: rail + list + chat; user info opens as a sheet (name / avatar / i button) */
@media (min-width: 1200px) and (max-width: 1399px) and (min-height: 501px) {
  .pane-info { display: none; }
  .case-acts .info-btn { display: inline-grid; }
}

/* ---- review fixes 2026-10-12 (2): touch tablets, exact accept text, sign-in identity, required authenticator ---- */
@media (hover: none) { .comp-hint { display: none !important; } }
.accept-info { display: grid; gap: 8px; min-width: 0; }
.accept-text {
  margin: 0; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.55; color: var(--text-2);
  background: var(--gold-soft, color-mix(in srgb, var(--gold) 12%, transparent)); border-inline-start: 3px solid var(--gold);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; overflow-wrap: anywhere;
}
.accept-text:lang(ckb), .accept-text:lang(ar) { font-family: "Noto Kufi Arabic", var(--font, sans-serif); font-size: 12.5px; line-height: 1.8; }
@media (max-height: 500px) { .accept-text { -webkit-line-clamp: 1; line-clamp: 1; padding: 4px 10px; } .accept-info { gap: 4px; } }
.ident { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.ident b { color: var(--text); font-weight: 600; }
.ident svg { color: var(--gold-text); flex: none; }
.login.enrol { justify-content: center; grid-template-columns: 1fr; place-items: center; } /* one card, centred on every width (2026-10-12) */
.login.enrol .login-side { flex: 1; }
.nw { white-space: nowrap; }
