/* ==========================================================================
   NOC Command Center v3 — design tokens + components (no build step)
   ========================================================================== */
:root {
  color-scheme: dark;
  --bg: #0a0f1c;
  --bg-2: #0e1526;
  --surface: #121a2e;
  --surface-2: #18223a;
  --surface-3: #1f2a46;
  --border: rgba(148, 163, 184, .14);
  --border-strong: rgba(148, 163, 184, .26);
  --text: #e7ecf6;
  --text-2: #b2bdd3;
  --muted: #7d89a6;
  --accent: #4f8cff;
  --accent-2: #3a74e6;
  --accent-soft: rgba(79, 140, 255, .14);
  --ok: #22c55e;   --ok-soft: rgba(34, 197, 94, .14);
  --warn: #f59e0b; --warn-soft: rgba(245, 158, 11, .15);
  --bad: #ef4444;  --bad-soft: rgba(239, 68, 68, .15);
  --info: #38bdf8; --info-soft: rgba(56, 189, 248, .14);
  --violet: #a78bfa; --violet-soft: rgba(167, 139, 250, .15);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.28);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', 'Noto Sans Myanmar', 'Pyidaungsu', 'Padauk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar-w: 236px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f9;
  --bg-2: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eceff5;
  --border: #e2e7ef;
  --border-strong: #cfd6e2;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, .09);
  --ok: #16a34a;   --ok-soft: rgba(22, 163, 74, .1);
  --warn: #d97706; --warn-soft: rgba(217, 119, 6, .11);
  --bad: #dc2626;  --bad-soft: rgba(220, 38, 38, .09);
  --info: #0284c7; --info-soft: rgba(2, 132, 199, .09);
  --violet: #7c3aed; --violet-soft: rgba(124, 58, 237, .09);
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--accent); text-decoration: none; }
.mono { font-family: var(--mono); font-feature-settings: "zero"; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { border-color: var(--border-strong); background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover { filter: brightness(1.08); background: var(--ok); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn i { font-size: 12px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 11.5px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.input, .select, .textarea { width: 100%; height: 36px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-2); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.select option { background: var(--surface); color: var(--text); }
.input-sm, .select-sm { height: 30px; font-size: 12.5px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; pointer-events: none; }
.input-icon > .input { padding-left: 32px; }
.hint { font-size: 11.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12.5px; color: var(--text-2); user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 34px; height: 20px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { left: 16px; background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--border); }
.seg button { height: 26px; padding: 0 11px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.seg .count { font-size: 10.5px; padding: 0 6px; border-radius: 10px; background: var(--surface); color: var(--text-2); line-height: 17px; }
.seg button.on .count { background: var(--accent); color: #fff; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-open { color: var(--warn); background: var(--warn-soft); }
.b-progress { color: var(--info); background: var(--info-soft); }
.b-hold { color: var(--muted); background: var(--surface-3); }
.b-resolved { color: var(--ok); background: var(--ok-soft); }
.b-report { color: var(--violet); background: var(--violet-soft); }
.b-bad { color: var(--bad); background: var(--bad-soft); }
.b-neutral { color: var(--text-2); background: var(--surface-3); }
.b-accent { color: var(--accent); background: var(--accent-soft); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.prio::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--muted); }
.prio.Low::before { background: #64748b; }
.prio.Normal::before { background: var(--accent); }
.prio.High::before { background: var(--warn); }
.prio.Critical::before { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.sla { font-size: 11.5px; font-weight: 600; font-family: var(--mono); white-space: nowrap; }
.sla.ok { color: var(--muted); }
.sla.soon { color: var(--warn); }
.sla.breached { color: var(--bad); }
.pill-count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; background: var(--bad); color: #fff; }
.pill-count.soft { background: var(--surface-3); color: var(--text-2); }

/* ---------- Login (split layout) ---------- */
.brand-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #7c5cff); color: #fff; font-size: 19px; box-shadow: 0 8px 20px rgba(79,140,255,.35); flex: none; }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); background: var(--bg); }
.login-hero { position: relative; overflow: hidden; padding: 44px 52px; display: flex; flex-direction: column; color: #e8eefc;
  background: radial-gradient(900px 600px at 0% 0%, rgba(79,140,255,.35), transparent 60%), radial-gradient(700px 500px at 100% 100%, rgba(124,92,255,.32), transparent 60%), linear-gradient(160deg, #0b1330 0%, #0a0f24 55%, #0d0b26 100%); }
.login-hero::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 40% 45%, #000 20%, transparent 75%); pointer-events: none; }
.login-hero > * { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; gap: 12px; }
.hero-brand b { font-size: 15px; letter-spacing: .06em; display: block; }
.hero-brand small { font-size: 11px; opacity: .6; letter-spacing: .12em; text-transform: uppercase; }
.hero-copy { margin-top: auto; max-width: 520px; }
.hero-copy .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 20px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.hero-copy .eyebrow .led { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.18); }
.hero-copy h2 { font-size: 40px; line-height: 1.1; letter-spacing: -.03em; margin: 18px 0 14px; font-weight: 700; }
.hero-copy h2 span { background: linear-gradient(90deg, #7fb0ff, #b69cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy p { font-size: 15px; line-height: 1.6; color: rgba(232,238,252,.72); }
.hero-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.hero-feat { padding: 14px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(6px); }
.hero-feat i { font-size: 15px; color: #8fb6ff; }
.hero-feat b { display: block; font-size: 13px; margin-top: 8px; }
.hero-feat span { font-size: 11.5px; color: rgba(232,238,252,.6); line-height: 1.4; display: block; margin-top: 2px; }
.hero-net { position: absolute; right: -40px; top: 60px; width: 560px; height: 380px; opacity: .9; z-index: 0 !important; }
.hero-net line { stroke: rgba(143,182,255,.28); stroke-width: 1.2; }
.hero-net line.flow { stroke: #8fb6ff; stroke-width: 1.6; stroke-dasharray: 6 14; animation: flow 3s linear infinite; }
.hero-net circle { fill: #0f1a3d; stroke: #8fb6ff; stroke-width: 1.6; }
.hero-net circle.core { fill: #4f8cff; stroke: #c7dbff; }
.hero-net circle.pulse { fill: none; stroke: #4f8cff; animation: ping 2.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes flow { to { stroke-dashoffset: -40; } }
@keyframes ping { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(3.2); opacity: 0; } }
.hero-foot { margin-top: 36px; font-size: 12px; color: rgba(232,238,252,.45); display: flex; gap: 16px; }
.login-side { display: flex; flex-direction: column; padding: 28px 32px; position: relative; }
.login-side .top { display: flex; justify-content: flex-end; }
.login-card { width: 100%; max-width: 380px; margin: auto; }
.login-card h1 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 6px; }
.login-card p.sub { color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.login-card .field > label { font-size: 12.5px; }
.login-card .input { height: 44px; font-size: 14px; background: var(--surface); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-wrap button { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.pw-wrap button:hover { background: var(--surface-2); color: var(--text); }
.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-2); }
.login-row label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.login-row input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); }
.caps { color: var(--warn); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.login .err { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 12.5px; }
.login .err:empty { display: none; }
.btn-login { height: 46px; width: 100%; font-size: 14.5px; border-radius: 10px; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.login-status { margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--muted); }
.login-status .led { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.login-status .led.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.login-status .led.off { background: var(--bad); }
.login-foot { text-align: center; font-size: 11.5px; color: var(--muted); padding-top: 16px; }
@media (max-width: 960px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: 24px 22px 28px; min-height: auto; }
  .hero-net, .hero-feats, .hero-foot, .hero-copy p { display: none; }
  .hero-copy { margin-top: 28px; }
  .hero-copy h2 { font-size: 26px; margin: 12px 0 0; }
  .login-side { padding: 20px 20px 28px; }
  .login-card { margin: 12px auto 0; }
}

/* ---------- Shell ---------- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: var(--sidebar-w); flex: none; background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 14px 10px; gap: 4px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand .brand-mark { width: 34px; height: 34px; font-size: 15px; border-radius: 9px; }
.brand b { display: block; font-size: 13.5px; letter-spacing: .02em; }
.brand small { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.nav-group { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 13.5px; width: 100%; text-align: left; }
.nav-item i { width: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.on { background: var(--accent-soft); color: var(--text); }
.nav-item.on i { color: var(--accent); }
.nav-item .pill-count { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--muted); }
.sys-line { display: flex; align-items: center; gap: 7px; }
.sys-line .led { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.led.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.led.off { background: var(--bad); }
.led.warn { background: var(--warn); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid var(--border); background: var(--bg); }
.topbar h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.topbar .sub { font-size: 12px; color: var(--muted); }
.topbar .search { width: 300px; }
.live { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border); color: var(--muted); }
.live .led { width: 7px; height: 7px; border-radius: 50%; }
.live.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.live.on .led { background: var(--ok); animation: pulse 2s infinite; }
.live.off { color: var(--bad); }
.live.off .led { background: var(--bad); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--ok-soft); } 50% { box-shadow: 0 0 0 5px transparent; } }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 10px; border: 1px solid transparent; }
.user-chip:hover { border-color: var(--border); background: var(--surface); }
.avatar { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; background: linear-gradient(135deg, #4f8cff, #7c5cff); flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; border-radius: 6px; }
.avatar.tech { background: linear-gradient(135deg, #14b8a6, #0ea5e9); }
.user-chip .who { text-align: left; line-height: 1.15; }
.user-chip .who b { font-size: 12.5px; display: block; }
.user-chip .who small { font-size: 10.5px; color: var(--muted); text-transform: capitalize; }
.content { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }
.menu-btn { display: none; }

/* ---------- Cards & KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-h h3 { font-size: 13.5px; font-weight: 700; }
.card-h .sub { font-size: 12px; color: var(--muted); }
.card-b { padding: 16px; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(4, 1fr); }
#ovAttention { max-height: 332px; overflow-y: auto; }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; position: relative; cursor: default; }
.kpi[data-act] { cursor: pointer; }
.kpi[data-act]:hover { border-color: var(--border-strong); }
.kpi .k-label { font-size: 11.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .k-label i { font-size: 11px; }
.kpi .k-val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k-val small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.kpi .k-foot { font-size: 11.5px; color: var(--muted); }
.kpi.danger .k-val { color: var(--bad); }
.kpi.warn .k-val { color: var(--warn); }
.kpi.ok .k-val { color: var(--ok); }
.cols-2 { grid-template-columns: 1.6fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 220px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.list-row:last-child { border-bottom: 0; }
.list-row[data-act] { cursor: pointer; }
.list-row[data-act]:hover { background: var(--surface-2); }
.bar-inline { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; flex: 1; max-width: 120px; }
.bar-inline > span { display: block; height: 100%; border-radius: 4px; background: var(--series-1); }
.rank { width: 20px; font-size: 11.5px; color: var(--muted); font-weight: 700; font-family: var(--mono); }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.toolbar .select, .toolbar .input { width: auto; min-width: 0; max-width: 200px; }
.toolbar .search { width: 260px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.filter-chip button { width: 18px; height: 18px; border-radius: 50%; color: inherit; display: grid; place-items: center; font-size: 10px; }
.filter-chip button:hover { background: var(--accent); color: #fff; }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.t th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.t th[data-sort] { cursor: pointer; }
.t th[data-sort]:hover { color: var(--text); }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tbody tr { cursor: pointer; transition: background .1s; }
.t tbody tr:hover td { background: var(--surface-2); }
.t tbody tr.sel td { background: var(--accent-soft); }
.t tbody tr.flash td { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.t .tid { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.t .tid.rep { color: var(--violet); }
.t .cust { font-weight: 600; white-space: nowrap; }
.t .cust small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.t .complain { color: var(--text-2); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t .time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.t .time b { display: block; color: var(--text-2); font-weight: 500; }
.t .ph { color: var(--muted); font-size: 12px; white-space: nowrap; }
.t tr.breached td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.t tr.crit td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.table-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty i { font-size: 26px; margin-bottom: 10px; display: block; opacity: .6; }
.empty b { display: block; color: var(--text-2); margin-bottom: 4px; }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; height: 12px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(3, 7, 18, .55); backdrop-filter: blur(2px); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); border-left: 1px solid var(--border); z-index: 61; transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.drawer:not(.on) { box-shadow: none; visibility: hidden; transition: transform .25s cubic-bezier(.2,.8,.2,1), visibility 0s .25s; }
.drawer.on { transform: none; }
.drawer-h { padding: 16px 20px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.drawer-h .top { display: flex; align-items: center; gap: 10px; }
.drawer-h .tid { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.drawer-h .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); align-items: center; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.section-title { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.section-title .grow { height: 1px; background: var(--border); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; }
.kv > div small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.kv > div b { font-weight: 600; font-size: 13px; word-break: break-word; }
.quote { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: 8px; padding: 10px 12px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.quote.res { border-left-color: var(--ok); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photos button { aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.photos button:hover img { transform: scale(1.05); }
.timeline { position: relative; display: flex; flex-direction: column; gap: 2px; }
.tl { display: flex; gap: 10px; padding: 6px 0; position: relative; }
.tl::before { content: ''; position: absolute; left: 11px; top: 30px; bottom: -6px; width: 2px; background: var(--border); }
.tl:last-child::before { display: none; }
.tl .ico { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; flex: none; background: var(--surface-3); color: var(--text-2); z-index: 1; }
.tl .ico.created { background: var(--accent-soft); color: var(--accent); }
.tl .ico.resolved { background: var(--ok-soft); color: var(--ok); }
.tl .ico.reopened, .tl .ico.sla { background: var(--bad-soft); color: var(--bad); }
.tl .ico.comment { background: var(--info-soft); color: var(--info); }
.tl .ico.tech { background: var(--violet-soft); color: var(--violet); }
.tl .body { flex: 1; min-width: 0; font-size: 13px; }
.tl .body .who { font-weight: 600; }
.tl .body .when { color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.tl .body .txt { color: var(--text-2); margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.tl .bubble { margin-top: 4px; padding: 8px 11px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; word-break: break-word; color: var(--text); }
.tl .bubble.internal { border-style: dashed; background: transparent; }
.tl .bubble.tech { background: var(--violet-soft); border-color: transparent; }
.composer { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.composer textarea { border: 0; border-radius: 0; background: transparent; min-height: 64px; }
.composer textarea:focus { box-shadow: none; }
.composer .bar { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface-2); }
.billing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; font-size: 12.5px; }
.billing-grid div small { display: block; color: var(--muted); font-size: 11px; }
.billing-grid div b { font-weight: 600; font-family: var(--mono); font-size: 12px; word-break: break-word; }
.hist-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.hist-row:hover { background: var(--surface-2); }
.resolve-box { border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--border)); border-radius: 12px; padding: 14px; background: var(--ok-soft); display: flex; flex-direction: column; gap: 10px; }
.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 28px; padding: 0 11px; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; color: var(--text-2); }
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(3, 7, 18, .6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fadeIn .15s; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); animation: rise .18s cubic-bezier(.2,.8,.2,1); }
.modal.wide { max-width: 680px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; position: sticky; top: 0; background: var(--surface); z-index: 3; border-radius: 14px 14px 0 0; }
.modal-h h3 { font-size: 15px; }
.modal-b { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 0 0 14px 14px; position: sticky; bottom: 0; z-index: 3; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.92); display: flex; flex-direction: column; }
.lightbox .lb-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; color: #fff; font-size: 13px; }
.lightbox .lb-main { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; min-height: 0; padding: 0 60px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 16px; }
.lightbox .nav:hover { background: rgba(255,255,255,.2); }
.lightbox .prev { left: 10px; } .lightbox .next { right: 10px; }
.lightbox .thumbs { display: flex; gap: 8px; justify-content: center; padding: 12px; overflow-x: auto; }
.lightbox .thumbs img { width: 58px; height: 58px; object-fit: cover; opacity: .45; cursor: pointer; border-radius: 6px; border: 2px solid transparent; }
.lightbox .thumbs img.on { opacity: 1; border-color: var(--accent); }
.lightbox .btn { color: #fff; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; gap: 11px; align-items: flex-start; min-width: 280px; max-width: 380px; padding: 12px 14px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); animation: rise .2s; font-size: 13px; }
.toast i { margin-top: 2px; }
.toast b { display: block; font-size: 13px; }
.toast span { color: var(--text-2); font-size: 12.5px; }
.toast.ok i { color: var(--ok); } .toast.err i { color: var(--bad); } .toast.info i { color: var(--accent); } .toast.warn i { color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .25s; }

/* ---------- Workflow builder ---------- */
.pipeline { display: flex; flex-direction: column; }
.node { position: relative; padding-left: 30px; padding-bottom: 12px; }
.node::before { content: ''; position: absolute; left: 9px; top: 28px; bottom: -2px; width: 2px; background: var(--border-strong); }
.node:last-child::before { display: none; }
.node .pin { position: absolute; left: 3px; top: 17px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.node.off .pin { border-color: var(--muted); }
.node.off .node-card { opacity: .55; }
.node.rep .pin { border-color: var(--violet); }
.node-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.node-card .ni { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; font-size: 13px; }
.node.rep .ni { background: var(--violet-soft); color: var(--violet); }
.node-card h4 { font-size: 13px; font-weight: 600; }
.node-card p { font-size: 11.5px; color: var(--muted); }
.node-card .opts .switch { white-space: nowrap; }
.node-card .opts { margin-left: auto; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.tag { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; letter-spacing: .03em; text-transform: uppercase; }
.tag.req { color: var(--ok); background: var(--ok-soft); }
.tag.cfg { color: var(--warn); background: var(--warn-soft); }
.list-editor { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.le-row { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.le-row .n { font-size: 11px; color: var(--muted); width: 20px; font-family: var(--mono); }
.le-row input { flex: 1; border: 0; background: transparent; height: 28px; font-size: 13px; min-width: 0; }
.le-row input:focus { outline: none; }
.le-row .btn-icon { width: 26px; height: 26px; color: var(--muted); }
.savebar { position: sticky; bottom: 0; margin-top: 16px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow-lg); z-index: 5; }
.tg-preview { background: #17212b; color: #f5f5f5; border-radius: 12px; padding: 12px 14px; font-size: 13px; white-space: pre-wrap; line-height: 1.5; font-family: -apple-system, 'Segoe UI', 'Noto Sans Myanmar', sans-serif; }
:root[data-theme="light"] .tg-preview { background: #eef3f8; color: #111; }
.sla-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 70; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .search, .topbar .user-chip .who, .topbar .hide-sm { display: none; }
  .content { padding: 14px 12px 40px; }
  .toolbar .search { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .sla-grid { grid-template-columns: 1fr 1fr; }
  .t .hide-md { display: none; }
  .drawer { width: 100vw; }
}
/* ---------- Tables become cards on phones ---------- */
.prio-m { display: none; }
@media (max-width: 700px) {
  .t-cards thead { display: none; }
  .t-cards, .t-cards tbody { display: block; }
  .t-cards tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "tid status" "cust sla" "issue issue" "time time"; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .t-cards td { padding: 0; border: 0; display: block; background: none !important; }
  .t-cards .c-prio, .t-cards .c-eng { display: none; }
  .t-cards .c-tid { grid-area: tid; display: flex; align-items: center; gap: 8px; }
  .t-cards .prio-m { display: inline-flex; font-size: 11px; }
  .t-cards .c-status { grid-area: status; text-align: right; }
  .t-cards .c-cust { grid-area: cust; }
  .t-cards .c-sla { grid-area: sla; text-align: right; }
  .t-cards .c-issue { grid-area: issue; }
  .t-cards .c-issue .complain { max-width: none; white-space: normal; }
  .t-cards .c-time { grid-area: time; display: flex; gap: 8px; }
  .t-cards .c-time b { display: inline; }
  .t-cards .c-time .truncate { display: inline !important; }
  .t-cards tr.breached { box-shadow: inset 3px 0 0 var(--bad); }
  .t-cards tr.breached td:first-child { box-shadow: none; }
  .t-rep tr { grid-template-areas: "tid time" "cust cust" "issue issue" "res res" "tech ph"; }
  .t-rep .c-res { grid-area: res; } .t-rep .c-res .complain { max-width: none; white-space: normal; }
  .t-rep .c-tech { grid-area: tech; } .t-rep .c-ph { grid-area: ph; text-align: right; }
  .t-rep .c-time { justify-content: flex-end; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: none; }
  .topbar h2 { font-size: 15px; white-space: nowrap; }
  .toolbar .select { flex: 1 1 140px; max-width: none; }
  .drawer-actions .select { flex: 1 1 120px; }
  .kv { grid-template-columns: 1fr 1fr; }
  .grid[style*="1fr 1fr"] { grid-template-columns: 1fr !important; }
  .card-b.grid { grid-template-columns: 1fr !important; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- v3.1: field jobs, stages, Telegram routing ---------- */
.b-stage-unassigned { color: var(--bad); background: var(--bad-soft); }
.b-stage-pool { color: var(--warn); background: var(--warn-soft); }
.b-stage-assigned { color: var(--violet); background: var(--violet-soft); }
.b-stage-accepted, .b-stage-enroute { color: var(--info); background: var(--info-soft); }
.b-stage-onsite { color: var(--accent); background: var(--accent-soft); }
.b-stage-resolved { color: var(--ok); background: var(--ok-soft); }
.b-stage-cancelled, .b-cancel { color: var(--muted); background: var(--surface-3); text-decoration: line-through; }
.b-noc { color: #fff; background: var(--bad); animation: nocpulse 1.8s infinite; }
@keyframes nocpulse { 50% { box-shadow: 0 0 0 4px var(--bad-soft); } }
.tid.job { color: #14b8a6; }
.mini-steps { display: flex; gap: 3px; margin-top: 5px; }
.mini-steps i { width: 14px; height: 4px; border-radius: 2px; background: var(--surface-3); display: block; }
.mini-steps i.on { background: var(--accent); }
.mini-steps.done i { background: var(--ok); }
.stepper { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin: 4px 0 2px; }
.stepper .st { position: relative; text-align: center; font-size: 11px; color: var(--muted); padding-top: 26px; }
.stepper .st::before { content: ''; position: absolute; top: 10px; left: -50%; right: 50%; height: 2px; background: var(--border-strong); }
.stepper .st:first-child::before { display: none; }
.stepper .st .dot { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: 8px; color: #fff; z-index: 1; }
.stepper .st.done { color: var(--text-2); }
.stepper .st.done::before, .stepper .st.cur::before { background: var(--accent); }
.stepper .st.done .dot { background: var(--accent); border-color: var(--accent); }
.stepper .st.cur .dot { background: var(--bg); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stepper .st.cur { color: var(--text); font-weight: 600; }
.stepper .st small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.noc-banner { border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.noc-banner > i { color: var(--bad); font-size: 18px; margin-top: 2px; }
.tech-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); flex-wrap: wrap; }
.tech-card .who { flex: 1; min-width: 160px; }
.tech-card .who b { display: block; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.check-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.check-item b { margin-left: auto; font-family: var(--mono); font-size: 12px; }
.check-item .ok { color: var(--ok); } .check-item .bad { color: var(--bad); } .check-item .na { color: var(--muted); }
.tech-pick { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.tech-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; background: var(--surface); text-align: left; width: 100%; }
.tech-opt:hover { border-color: var(--border-strong); }
.tech-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.tech-opt .dot-av { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.tech-opt .dot-av.off { background: var(--muted); }
.tech-opt .grow { min-width: 0; }
.tech-opt small { color: var(--muted); font-size: 11.5px; display: block; }
.route-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.route-table th, .route-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: center; }
.route-table th:first-child, .route-table td:first-child { text-align: left; }
.route-table th { font-size: 11.5px; color: var(--text-2); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
.route-table td small { display: block; color: var(--muted); font-size: 11px; }
.route-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.chan-row { display: grid; grid-template-columns: 1.3fr 1.2fr .7fr auto auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.chan-row:last-child { border-bottom: 0; }
.chat-pill { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px dashed var(--border-strong); border-radius: 10px; font-size: 12.5px; }
.chat-pill .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--info-soft); color: var(--info); flex: none; }
.chat-pill b { display: block; font-size: 13px; }
.new-menu { position: absolute; top: 52px; right: 120px; z-index: 50; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; width: 260px; }
.new-menu button { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 10px; border-radius: 8px; text-align: left; }
.new-menu button:hover { background: var(--surface-2); }
.new-menu button i { margin-top: 2px; width: 18px; text-align: center; }
.new-menu b { display: block; font-size: 13px; } .new-menu small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 700px) {
  .chan-row { grid-template-columns: 1fr 1fr; }
  .stepper { grid-template-columns: repeat(3, 1fr); row-gap: 10px; }
  .t-job tr { grid-template-areas: "tid status" "cust sla" "issue issue" "tech time"; }
  .t-job .c-tech { grid-area: tech; }
  .new-menu { right: 12px; }
}

.ov-field { grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 700px) { .ov-field { grid-template-columns: 1fr 1fr; } }

/* ===================================================================
   v3.2 — template picker · photo notes · quick operations
   =================================================================== */
.tpick { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); padding: 8px; }
.tpick-top { display: flex; align-items: center; gap: 8px; padding: 0 4px 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px; color: var(--muted); }
.tpick-q { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); height: 26px; font-size: 13px; }
.tpick-q:focus { outline: none; }
.tpick-count { font-size: 11.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.tpick-clear { font-size: 11.5px; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.tpick-clear:hover { color: var(--text); background: var(--surface-3); }
.tpick-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 176px; overflow: auto; }
.tpick .chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.tpick .chip:hover { border-color: var(--accent); color: var(--text); }
.tpick .chip small { font-size: 10px; color: var(--muted); background: var(--surface-3); border-radius: 8px; padding: 0 5px; line-height: 15px; }
.tpick .chip.sug { border-color: rgba(245, 158, 11, .55); }
.tpick .chip.sug .fa-star { color: #f59e0b; font-size: 10px; }
.tpick .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tpick .chip.on small { background: rgba(255,255,255,.22); color: #fff; }
.tpick .chip.on .fa-check { font-size: 10px; }
.tpick-hint { margin-top: 6px; }
.tpick-none { font-size: 12px; padding: 4px; }

.composer.drop { outline: 2px dashed var(--accent); outline-offset: 3px; border-radius: 10px; }
.att-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; }
.att { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.att img { width: 100%; height: 100%; object-fit: cover; }
.att button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; display: grid; place-items: center; }
.tl-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tl-photos button { width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); padding: 0; }
.tl-photos img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.tl-photos button:hover img { transform: scale(1.06); }
.b-tg { color: #2aabee; background: rgba(42, 171, 238, .13); }

.op-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.op-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: var(--violet-soft); flex: none; }
.op-prog { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: 6px 0 4px; max-width: 320px; }
.op-prog span { display: block; height: 100%; background: var(--warn); border-radius: 6px; transition: width .3s; }
.op-prog span.full { background: var(--ok); }
.op-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.op-f { padding: 8px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.op-f small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.op-f b { word-break: break-all; }
.op-f.miss { border-color: rgba(245, 158, 11, .5); border-style: dashed; }
.op-edit { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.op-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.op-slot { position: relative; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.op-slot.req:not(.has) { border: 1px dashed rgba(245, 158, 11, .6); }
.op-img { display: block; width: 100%; aspect-ratio: 4/3; padding: 0; background: var(--surface-3); }
.op-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.op-img.empty { display: grid; place-items: center; color: var(--muted); font-size: 20px; }
.op-l { display: block; font-size: 11.5px; padding: 6px 8px; line-height: 1.3; }
.op-up { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 12px; }
.op-up.busy { opacity: .5; pointer-events: none; }
.secret { gap: 4px; flex-wrap: nowrap; }
.seg-sm button { height: 24px; padding: 0 10px; font-size: 12px; }
.seg[data-type="yesno"] button.on[data-v="yes"] { background: var(--ok-soft); color: var(--ok); }
.seg[data-type="yesno"] button.on[data-v="no"] { background: var(--bad-soft); color: var(--bad); }
.op-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.op-card { text-align: left; border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; background: var(--surface-2); display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; align-items: center; transition: border-color .15s, background .15s; }
.op-card .op-ico { width: 32px; height: 32px; font-size: 16px; grid-row: span 2; }
.op-card b { font-size: 12.5px; line-height: 1.25; }
.op-card small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.op-card:hover { border-color: var(--border-strong); }
.op-card.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.op-pre { border: 1px solid var(--border); border-radius: 11px; padding: 12px; background: var(--bg-2); }
.op-pre-h { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.op-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--violet); background: var(--violet-soft); border-radius: 6px; padding: 1px 7px; margin-bottom: 3px; }
.ov-ops { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.op-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-2); color: var(--text); font-size: 12.5px; }
.op-pill:hover { border-color: var(--violet); }
.op-editor { display: flex; flex-direction: column; gap: 8px; }
.wop { border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.wop.off { opacity: .6; }
.wop-h { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; }
.wop-h .chev { color: var(--muted); font-size: 11px; transition: transform .15s; }
.wop.open .wop-h .chev { transform: rotate(90deg); }
.wop-b { padding: 4px 12px 12px; border-top: 1px solid var(--border); }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.kpi-mini { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); }
.kpi-mini b { display: block; font-size: 18px; }
.kpi-mini span { font-size: 11px; color: var(--muted); }
@media (max-width: 720px) {
  .op-cards { grid-template-columns: 1fr 1fr; }
  .op-fields { grid-template-columns: 1fr 1fr; }
}
.why-box { border: 1px solid var(--border); background: var(--surface-2); border-radius: 11px; padding: 12px 14px; font-size: 12.5px; color: var(--text-2); }
.why-box p { margin: 6px 0; }
.why-box ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
.why-box { border: 1px solid var(--border); background: var(--surface-2); border-radius: 11px; padding: 12px 14px; font-size: 12.5px; color: var(--text-2); }
.why-box p { margin: 6px 0; }
.why-box ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; }


/* ===================== v3.6 — checklists editor ===================== */
.form-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { position: relative; cursor: pointer; }
.fchip input { position: absolute; opacity: 0; pointer-events: none; }
.fchip span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; color: var(--text-2); transition: all .12s; }
.fchip span i { font-size: 11px; opacity: .7; }
.fchip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.fchip input:checked + span i { opacity: 1; }
.fchip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ichip { height: 26px; padding: 0 10px; border-radius: 20px; border: 1px dashed var(--border-strong); background: transparent; font-size: 12px; color: var(--text-2); }
.ichip:hover { border-color: var(--accent); }
.ichip.on { border-style: solid; background: var(--warn-soft); border-color: var(--warn); color: var(--warn); font-weight: 600; }
.check-item.fail { background: var(--bad-soft); }

/* ===================== v3.6 — broadcast messages ===================== */
.msg-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.msg-list { position: sticky; top: 12px; max-height: calc(100vh - 120px); overflow: auto; }
.msg-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 10px 6px; }
.msg-group:first-child { padding-top: 4px; }
.msg-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--text); }
.msg-item:hover { background: var(--surface-2); }
.msg-item.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.msg-item .mi { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); font-size: 15px; flex: none; }
.msg-item.on .mi { background: var(--surface); }
.msg-item b { display: block; font-size: 13px; font-weight: 600; }
.msg-flags { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.mf { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; letter-spacing: .02em; }
.mf.on { color: var(--ok); background: var(--ok-soft); }
.mf.off { color: var(--bad); background: var(--bad-soft); }
.mf.silent { color: var(--violet); background: var(--violet-soft); }
.mf.custom { color: var(--info); background: var(--info-soft); }
.msg-edit { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; transition: opacity .15s; }
.msg-edit.is-off { opacity: .45; }
.msg-tpl { min-height: 300px; font-size: 12.5px; line-height: 1.55; tab-size: 2; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow: auto; }
.ph-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 5px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; color: var(--text-2); max-width: 100%; }
.ph-chip code { font-family: var(--mono); font-size: 11px; background: var(--accent-soft); color: var(--accent); padding: 1px 5px; border-radius: 5px; }
.ph-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.ph-chip:hover { border-color: var(--accent); color: var(--text); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; }
.seg:empty { display: none; }
.seg button { height: 24px; padding: 0 10px; border-radius: 6px; border: 0; background: none; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tg-chat { border-radius: 14px; padding: 16px 14px; min-height: 180px; background: #0e1621 linear-gradient(160deg, rgba(42,171,238,.10), rgba(124,92,255,.08)); }
:root[data-theme="light"] .tg-chat { background: #cfe3d0 linear-gradient(160deg, rgba(255,255,255,.35), rgba(0,0,0,.04)); }
.tg-bubble { position: relative; max-width: 100%; background: #182533; color: #f5f5f5; border-radius: 14px 14px 14px 4px; padding: 9px 12px 10px; font-size: 13.5px; line-height: 1.5; font-family: -apple-system, 'Segoe UI', 'Noto Sans Myanmar', sans-serif; word-wrap: break-word; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
:root[data-theme="light"] .tg-bubble { background: #fff; color: #111; }
.tg-bubble code { font-family: var(--mono); font-size: 12.5px; color: #7ec8ff; background: none; padding: 0; }
:root[data-theme="light"] .tg-bubble code { color: #1d6fb8; }
.tg-bubble a { color: #6ab3f3; text-decoration: none; }
:root[data-theme="light"] .tg-bubble a { color: #168acd; }
.tg-bubble a.tg-user { color: #6ab3f3; font-weight: 600; }
@media (max-width: 1100px) { .msg-edit { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .msg-layout { grid-template-columns: 1fr; } .msg-list { position: static; max-height: none; } }

/* v3.6.2 — task tabs + grouped rows */
.task-tabs { display: flex; align-items: center; gap: 8px; margin: -2px 0 10px; }
.task-tabs:empty { display: none; }
.tt-scroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: 2px 0; }
.tt-scroll::-webkit-scrollbar { display: none; }
.task-tabs button { flex: none; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.task-tabs button:hover { color: var(--text); border-color: var(--border-2, var(--border)); }
.task-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.task-tabs .count { font-size: 10.5px; padding: 0 6px; border-radius: 10px; background: var(--bg-2); color: var(--text-2); line-height: 17px; }
.task-tabs button.on .count { background: rgba(255,255,255,.22); color: #fff; }
.task-tabs .count.bad { background: var(--bad-soft); color: var(--bad); }
.task-tabs .tt-group { border-radius: 8px; }
.task-tabs .tt-group.on { background: var(--surface-3); border-color: var(--border); color: var(--text); }
.t tr.grp-row td { background: var(--bg-2); padding: 7px 14px; border-bottom: 1px solid var(--border); cursor: default; }
.t tr.grp-row:hover td { background: var(--bg-2); }
.grp-h { font-weight: 700; font-size: 12.5px; margin-right: 8px; }
.t tr.grp-row .count { font-size: 10.5px; padding: 0 7px; border-radius: 10px; background: var(--surface); color: var(--text-2); line-height: 17px; margin-right: 8px; }
@media (max-width: 700px) {
  .t-cards tr.grp-row { display: block; padding: 0; }
  .t-cards tr.grp-row td { display: block; padding: 8px 14px; background: var(--bg-2) !important; }
}
.tech-note { border-left-color: var(--accent) !important; }

/* v3.6.3 — task menu */
.nav-item .nav-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-emoji { width: 18px; text-align: center; font-size: 13px; line-height: 1; }
.nav-item.sub { height: 32px; padding-left: 30px; font-size: 12.5px; position: relative; }
.nav-item.sub::before { content: ''; position: absolute; left: 18px; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.nav-item .pill-count + .pill-count { margin-left: 4px; }
.nav-item .pill-count.help { background: var(--bad-soft); color: var(--bad); margin-left: auto; }
.nav-item .pill-count.help + .pill-count { margin-left: 4px; }

/* unified list: task · issue type · complain in separate columns */
.type-tag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 0 5px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; }
.type-tag.job { background: rgba(20,184,166,.14); color: #14b8a6; }
.type-tag.rep { background: var(--violet-soft); color: var(--violet); }
.t-uni .task-cell { display: block; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.t-uni .cat-cell { font-weight: 500; }
.t-uni .c-compl .complain { max-width: 260px; }
.t-uni .complain.note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.t-uni .op-tag { margin: 3px 0 0; }
@media (max-width: 700px) {
  .t-uni tr { grid-template-areas: "tid status" "cust sla" "task task" "cat cat" "compl compl" "time time"; }
  .t-uni .c-task { grid-area: task; } .t-uni .c-cat { grid-area: cat; } .t-uni .c-compl { grid-area: compl; }
  .t-uni .c-compl .complain { max-width: none; white-space: normal; }
  .t-uni .c-cat .hint { display: none; }
}
.input.autofill { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); background: color-mix(in srgb, var(--ok) 6%, var(--surface-2)); }
.nt-more summary { cursor: pointer; }
.perm-t th.c, .perm-t td.c { text-align: center; width: 110px; }
.perm-t .switch { display: inline-flex; }
.nav-item:has(.nav-l) { height: auto; min-height: 36px; padding-top: 7px; padding-bottom: 7px; }
.nav-item.sub:has(.nav-l) { min-height: 32px; padding-top: 6px; padding-bottom: 6px; }
.nav-item .nav-l { white-space: normal; line-height: 1.25; }
.t-uni .c-compl .complain { max-width: 220px; }
.t-uni td.c-tid { white-space: nowrap; }
@media (max-width: 1500px) and (min-width: 701px) { .t-uni .c-prio, .t-uni th:first-child { display: none; } .t-uni .prio-m { display: inline-flex; font-size: 11px; margin-left: 6px; } .t-uni td.c-tid { white-space: normal; } }

/* ===== v3.6.4 — animated analytics overview ===== */
.ov-anim { animation: ovIn .6s cubic-bezier(.2,.75,.25,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
.ov-static .ov-anim, .ov-static .tb-row, .ov-static .hc { animation: none !important; }
@keyframes ovIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.ov-kpis .kpi { overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.ov-kpis .kpi[data-act]:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(0,0,0,.45); }
.ov-kpis .kpi::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--series-1), transparent); opacity: .7; }
.ov-kpis .kpi.danger::after { background: linear-gradient(90deg, var(--bad), transparent); }
.ov-kpis .kpi.warn::after { background: linear-gradient(90deg, var(--warn), transparent); }
.ov-kpis .kpi.ok::after { background: linear-gradient(90deg, var(--ok), transparent); }
.ov-kpis .kpi .k-foot { position: relative; z-index: 1; }
.ov-kpis .kpi .k-foot b { color: var(--text-2); }
.kpi .spark { position: absolute; right: 12px; bottom: 12px; width: 42%; height: 30px; opacity: .9; }
.kpi .spark-l { stroke-dasharray: 400; stroke-dashoffset: 0; animation: sparkDraw 1.1s ease-out both; animation-delay: calc(var(--i, 0) * 45ms + 250ms); }
.ov-static .kpi .spark-l { animation: none; }
@keyframes sparkDraw { from { stroke-dashoffset: 400; } }
.dchip { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.dchip i { font-size: 8.5px; }
.dchip.good { background: var(--ok-soft); color: var(--ok); }
.dchip.bad { background: var(--bad-soft); color: var(--bad); }
.meter { display: block; height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--series-1) 18%, var(--surface-3)); overflow: hidden; margin-top: 4px; }
.meter > span { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--series-1); transition: width 1s cubic-bezier(.2,.75,.25,1); }
.meter > span.bad { background: var(--bad); }
.ov-row-a { grid-template-columns: 2fr 1fr; margin-top: 14px; }
.ov-gap { margin-top: 14px; }
@media (max-width: 1200px) { .ov-row-a { grid-template-columns: 1fr; } }
.sla-wrap { position: relative; width: 150px; height: 150px; margin: 2px auto 12px; }
.ring { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: color-mix(in srgb, var(--series-1) 14%, var(--surface-3)); stroke-width: 11; }
.ring-val { fill: none; stroke: var(--series-1); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset 1.3s cubic-bezier(.2,.75,.25,1); }
.ring-val.bad { stroke: var(--bad); }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-txt b { font-size: 30px; letter-spacing: -.02em; }
.ring-txt span { font-size: 11.5px; color: var(--muted); }
.t.mini th, .t.mini td { padding: 7px 10px; font-size: 12.5px; }
.t.mini td.n, .t.mini th.n { text-align: right; font-variant-numeric: tabular-nums; }
.grow-bar > span { width: 0; transition: width 1s cubic-bezier(.2,.75,.25,1); }
.task-bars { display: grid; gap: 9px; }
.tb-row { display: grid; grid-template-columns: minmax(120px, 1.1fr) 2fr 42px 64px; align-items: center; gap: 10px; font-size: 12.5px; cursor: pointer; animation: ovIn .5s both; animation-delay: calc(var(--i, 0) * 50ms + 200ms); border-radius: 8px; padding: 2px 4px; }
.tb-row:hover { background: var(--surface-2); }
.tb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tb-bar { display: flex; height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; gap: 2px; }
.tb-bar > span { display: block; height: 100%; width: 0; transition: width 1.1s cubic-bezier(.2,.75,.25,1); }
.tb-done { background: var(--series-1); border-radius: 5px 0 0 5px; }
.tb-open { background: color-mix(in srgb, var(--series-1) 35%, var(--surface-3)); border-radius: 0 5px 5px 0; }
.tb-n { text-align: right; font-variant-numeric: tabular-nums; }
.tb-s { text-align: right; color: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.heat { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 3px; align-items: center; }
.heat .hl { font-size: 11px; color: var(--muted); }
.heat .hx { font-size: 10px; color: var(--muted); text-align: left; font-family: var(--mono); }
.hc { display: block; aspect-ratio: 1.25; min-height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--series-1) var(--lv, 0%), var(--surface-2)); animation: hcIn .45s ease-out both; animation-delay: var(--d, 0ms); transition: transform .12s; }
.hc:hover { transform: scale(1.25); outline: 2px solid var(--surface); z-index: 1; }
@keyframes hcIn { from { opacity: 0; transform: scale(.4); } }
.heat-leg { display: flex; align-items: center; gap: 4px; margin-top: 10px; justify-content: flex-end; }
.heat-leg .hc { width: 16px; min-height: 10px; aspect-ratio: auto; height: 10px; animation: none; }
@media (max-width: 700px) { .kpi .spark { display: none; } .tb-row { grid-template-columns: 1fr 1.2fr 34px; } .tb-s { display: none; } .heat { gap: 2px; } }
@media (min-width: 701px) { .ov-kpis .kpi:has(.spark) .k-foot { max-width: 54%; } }

/* v3.6.5 — New ticket photos */
.nt-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); transition: border-color .15s, background .15s; }
.nt-drop.drop { border-color: var(--accent); background: var(--accent-soft); }
.nt-drop .att-strip { margin: 0; }
.nt-drop .att-strip:empty { display: none; }
.qr-menu { position: fixed; z-index: 90; width: 360px; max-height: 340px; overflow: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg, 0 18px 40px -12px rgba(0,0,0,.5)); padding: 8px; display: grid; gap: 4px; animation: ovIn .18s ease-out both; }
.qr-menu button { text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text-2); line-height: 1.35; }
.qr-menu button:hover { background: var(--accent-soft); color: var(--text); }

/* v3.6.6 — two-side confirmation */
.badge.b-closed { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.verify-sec .verify-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.verify-sec .verify-rows > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.verify-sec small { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.v-ok { color: var(--ok); } .v-ok b { color: var(--text); }
.v-bad { color: var(--bad); } .v-bad b { color: var(--text); }
.v-wait { color: var(--warn); }
@media (max-width: 700px) { .verify-sec .verify-rows { grid-template-columns: 1fr; } }

/* v3.6.6 — live activity feed */
.feed-btn { position: relative; }
.feed-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.feed-panel { position: fixed; z-index: 95; width: 380px; max-width: calc(100vw - 20px); max-height: min(560px, 75vh); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 22px 50px -18px rgba(0,0,0,.55); animation: ovIn .2s ease-out both; overflow: hidden; }
.fp-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.fp-list { overflow: auto; padding: 6px; }
.fp-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px; }
.fp-item:hover { background: var(--surface-2); }
.fp-item > i { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.fp-item.danger > i { background: var(--bad-soft); color: var(--bad); }
.fp-item.new > i { background: var(--warn-soft); color: var(--warn); }
.fp-item b { display: block; font-size: 13px; font-weight: 600; }
.fp-item small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.fp-item time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.fp-item.unread b::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
.toast.clickable { cursor: pointer; }

/* ---------- v3.6.9 Billing check ---------- */
.bc-card { border: 1px solid var(--border); border-top: 4px solid var(--muted); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }
.bc-card.ok { border-top-color: var(--ok); } .bc-card.warn { border-top-color: var(--warn); } .bc-card.bad { border-top-color: var(--bad); }
.bc-top { display: flex; align-items: center; }
.bc-st { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px; font-weight: 700; font-size: 13px; background: var(--surface-3); color: var(--text-2); }
.bc-card.ok .bc-st { color: var(--ok); background: var(--ok-soft); } .bc-card.warn .bc-st { color: var(--warn); background: var(--warn-soft); } .bc-card.bad .bc-st { color: var(--bad); background: var(--bad-soft); }
.bc-name { margin: 10px 0 12px; } .bc-name b { font-size: 17px; }
.bc-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bc-kpi > div { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; min-width: 0; }
.bc-kpi small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.bc-kpi b { display: block; font-size: 14px; margin-top: 2px; word-break: break-word; }
.bc-kpi em { display: block; font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.bc-card.warn .bc-kpi em { color: var(--warn); } .bc-card.bad .bc-kpi em { color: var(--bad); }
.bc-contact { margin-top: 10px; font-size: 13px; color: var(--text-2); } .bc-contact i { color: var(--muted); }
.bc-more { margin-top: 10px; font-size: 13px; } .bc-more summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.bc-h { margin: 16px 0 8px; font-size: 13px; }
.bc-list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.bc-row { display: grid; grid-template-columns: 170px 1fr auto 90px; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 13px; text-decoration: none; }
.bc-row:last-child { border-bottom: 0; } .bc-row:hover { background: var(--surface-2); }
@media (max-width: 640px) { .bc-kpi { grid-template-columns: 1fr 1fr; } .bc-row { grid-template-columns: 1fr auto; } .bc-row .mono, .bc-row > .muted { display: none; } }

/* ---------- v3.6.10 Quick chat ---------- */
.t-uni th.c-chat-h { width: 44px; padding-left: 4px; padding-right: 4px; text-align: center; }
.t-uni td.c-chat { width: 44px; padding-left: 4px; padding-right: 4px; text-align: center; }
@media (max-width: 1500px) and (min-width: 701px) { .t-uni .c-compl .complain { max-width: 180px; } .t-uni td.c-time .truncate { max-width: 110px !important; } }
.qc-btn { position: relative; display: inline-grid; place-items: center; min-width: 36px; height: 32px; padding: 0 7px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 14px; cursor: pointer; transition: background .15s, color .15s, transform .1s; }
.qc-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.qc-btn:active { transform: scale(.94); }
.qc-btn.has { color: var(--text-2); }
.qc-btn .n { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.qc-btn.unread { color: #fff; background: var(--accent); border-color: transparent; animation: qcPulse 1.8s ease-in-out infinite; }
.qc-btn.unread .n { background: var(--bad); color: #fff; }
@keyframes qcPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
.btn-chat { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.btn-chat .n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; }

.qc { position: fixed; right: 20px; bottom: 20px; width: 380px; max-width: calc(100vw - 24px); height: min(560px, calc(100vh - 100px)); z-index: 70; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg), 0 20px 60px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; animation: qcIn .22s cubic-bezier(.2,.8,.2,1); }
@keyframes qcIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.qc.min { height: auto; }
.qc.min .qc-tabs, .qc.min .qc-wrap, .qc.min .qc-f, .qc.min .qc-typing { display: none; }
.qc.min .qc-h { cursor: pointer; }
.qc.drop { outline: 2px dashed var(--accent); outline-offset: -6px; }
.qc-h { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 12px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, var(--accent-soft), transparent 70%); }
.qc-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.qc-title { flex: 1; min-width: 0; }
.qc-title b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-title b span { font-weight: 500; color: var(--muted); }
.qc-title small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-tabs { display: flex; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.qc-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 4px 0 9px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 11.5px; color: var(--text-2); cursor: pointer; }
.qc-tab:hover { border-color: var(--accent); color: var(--accent); }
.qc-tab span { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-family: inherit; }
.qc-tab span:hover { background: var(--surface-3); }
.qc-b { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.qc-empty { margin: auto; color: var(--muted); font-size: 13px; text-align: center; }
.qm { max-width: 82%; display: flex; flex-direction: column; }
.qm.in { align-self: flex-start; } .qm.out { align-self: flex-end; align-items: flex-end; }
.qm-who { font-size: 11px; font-weight: 600; color: var(--muted); margin: 0 4px 2px; display: flex; gap: 4px; align-items: center; }
.qm-who .badge { height: 16px; font-size: 10px; padding: 0 5px; }
.qm-b { padding: 8px 11px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.qm.in .qm-b { background: var(--violet-soft); color: var(--text); border-bottom-left-radius: 4px; }
.qm.out .qm-b { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.qm.internal .qm-b { background: transparent; color: var(--text-2); border: 1px dashed var(--border); }
.qm-t { font-size: 10.5px; color: var(--muted); margin: 2px 4px 0; }
.qm-ph { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.qm-ph button { padding: 0; border: 0; background: none; cursor: zoom-in; }
.qm-ph img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; display: block; }
.qs { align-self: center; max-width: 92%; text-align: center; }
.qs span { display: inline-block; font-size: 11.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 12px; }
.qs.cmp span { color: var(--text-2); text-align: left; white-space: pre-wrap; }
.qs.resolved span, .qs.verify span { color: var(--ok); } .qs.noc_help span, .qs.reopened span, .qs.declined span { color: var(--bad); }
.qc-f { border-top: 1px solid var(--border); padding: 8px 10px 10px; background: var(--surface); }
.qc-f .textarea { min-height: 42px; max-height: 140px; resize: none; font-size: 13.5px; }
.qc-f .att-strip { margin-bottom: 6px; }
.qc-bar { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.qc-to { display: flex; gap: 4px; flex-wrap: wrap; }
.qc-chip input { display: none; }
.qc-chip span { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 13px; border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.qc-chip input:checked + span { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.qc-chip.int input:checked + span { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 700px) {
  .qc { right: 8px; left: 8px; bottom: 8px; width: auto; max-width: none; height: min(75vh, 560px); }
  .t-uni tr { grid-template-areas: "tid status" "cust sla" "task task" "cat cat" "compl compl" "time chat"; }
  .t-uni td.c-chat { grid-area: chat; width: auto; text-align: right; }
}

/* v3.6.11 live chat */
.qc-wrap { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.qc-wrap .qc-b { flex: 1; min-height: 0; }
.qc-newpill { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); height: 28px; padding: 0 12px; border-radius: 14px; border: 0; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.2); cursor: pointer; animation: qcIn .2s; }
.qc-typing { height: 0; overflow: hidden; padding: 0 14px; font-size: 11.5px; color: var(--muted); background: var(--bg); transition: height .15s; display: flex; align-items: center; gap: 6px; }
.qc-typing.on { height: 22px; }
.qc-typing .dots { display: inline-flex; gap: 3px; }
.qc-typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: qcDot 1.2s infinite ease-in-out; }
.qc-typing .dots i:nth-child(2) { animation-delay: .15s; } .qc-typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes qcDot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.qd { align-self: center; margin: 6px 0 2px; } .qd span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.qm.pending.sending .qm-b { opacity: .7; }
.qm.pending.failed .qm-b { background: var(--bad-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.qm-sending { color: var(--muted); }
.qm-fail { color: var(--bad); font-weight: 600; } .qm-fail button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.qm-ok { color: var(--accent); font-size: 10px; margin-left: 2px; }
.qm-who .badge { height: 16px; font-size: 10px; padding: 0 5px; }

/* =====================================================================
   v3.6.13 — Ticket view: wide centred window (was the right sidebar)
   ===================================================================== */
.scrim { backdrop-filter: blur(4px) saturate(.9); background: rgba(3, 7, 18, .5); }
.drawer {
  top: 50%; left: 50%; right: auto; bottom: auto;
  width: min(1640px, calc(100vw - 40px)); height: calc(100vh - 32px);
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  transform: translate(-50%, -48%) scale(.965); opacity: 0;
  transition: transform .24s cubic-bezier(.2,.8,.2,1), opacity .18s ease;
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.02);
}
.drawer.on { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.drawer:not(.on) { visibility: hidden; pointer-events: none; transition: transform .2s ease, opacity .15s ease, visibility 0s .2s; }

/* header */
.drawer-h { padding: 14px 18px 12px 18px; background: linear-gradient(180deg, var(--surface), var(--surface)); }
.drawer-h .top { gap: 12px; }
.tv-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 19px; flex: none; background: var(--accent-soft); color: var(--accent); }
.tv-ic.job { background: rgba(20,184,166,.14); color: #14b8a6; } .tv-ic.rep { background: var(--violet-soft); color: var(--violet); }
.tv-hl { min-width: 0; display: flex; flex-direction: column; }
.tv-hl b { font-size: 18px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); }
.tv-hl b span { font-family: var(--font, inherit); font-weight: 500; color: var(--text-2); font-size: 15px; margin-left: 6px; }
.tv-hl small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 560px; }
.drawer-h .tid { font-size: 12px; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); }
.drawer-h .meta { margin-top: 10px; padding-left: 56px; }
.drawer-actions { padding: 10px 18px; background: var(--surface-2); }

/* v3.6.15 — one scrolling page: key facts on top, then work (left) + conversation / billing / history (right) */
.drawer-b.tv-body { display: block; padding: 18px 22px 28px; overflow-y: auto; background: var(--bg); scroll-behavior: smooth; scrollbar-gutter: stable; }
.tv-overview { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.tv-tile { flex: 1 1 170px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px; min-width: 0; }
.tv-tile.wide { flex: 2 1 300px; }
.tv-tile .sub { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-top: 2px; }
.tv-tile a.sub { color: var(--accent); }
.tv-tile small { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.tv-tile small i { width: 13px; text-align: center; color: var(--accent); opacity: .8; }
.tv-tile b { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.tv-tile b .hint { font-weight: 500; }
.tv-tile.ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); } .tv-tile.ok small i { color: var(--ok); }
.btn-xs { width: 22px; height: 22px; font-size: 11px; vertical-align: 1px; }
.tv-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(380px, 1fr); gap: 16px; align-items: start; }
.tv-main, .tv-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tv-main > section, .tv-aside > section, .tv-main > .stepper { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin: 0; }
.tv-main .section-title, .tv-aside .section-title { margin-bottom: 12px; }
.tv-main > .stepper { padding: 14px 10px 12px; }
.tv-main .photos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tv-main .photos img { aspect-ratio: 4 / 3; height: auto; }
.tv-main .quote { font-size: 14px; line-height: 1.55; }
/* conversation card */
.tv-aside #actSec { padding: 0; overflow: hidden; }
.tv-conv-h { padding: 12px 16px; margin: 0 !important; border-bottom: 1px solid var(--border); }
.seg-xs button { height: 24px; padding: 0 9px; font-size: 11.5px; }
.tv-aside #actSec .timeline { padding: 12px 16px 6px; }
.tv-aside .composer { margin: 0 !important; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; border-top: 1px solid var(--border); background: var(--surface-2); padding: 10px 12px 12px; }
.tv-aside .composer .textarea { min-height: 64px; max-height: 200px; background: var(--surface); }
.tv-aside .composer .bar { flex-wrap: wrap; row-gap: 6px; }
.tv-aside .composer .bar > .grow { order: 2; }
.tv-aside .composer .bar > [data-act="t-comment"] { order: 3; margin-left: auto; }
.tv-aside .composer .bar > .switch { order: 5; font-size: 12px; }
.tv-aside .composer .bar::after { content: ''; order: 4; flex-basis: 100%; height: 0; }
#actSec.chat-only .tl:not(.tl-comment) { display: none; }
/* billing card */
.tv-bill { padding: 0 !important; overflow: hidden; }
.tv-bill .card { border: 0; border-radius: 0; background: transparent; }
.tv-bill .billing-grid { grid-template-columns: 1fr 1fr; }
.bill-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 16px; font-weight: 700; font-size: 12.5px; margin-bottom: 10px; background: var(--surface-3); color: var(--text-2); }
.bill-pill.ok { background: var(--ok-soft); color: var(--ok); } .bill-pill.warn { background: var(--warn-soft); color: var(--warn); } .bill-pill.bad { background: var(--bad-soft); color: var(--bad); }
/* customer history rows */
.tv-aside .hist-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "id st" "what when"; gap: 2px 8px; padding: 9px 6px; border-bottom: 1px solid var(--border); border-radius: 0; }
.tv-aside .hist-row:last-child { border-bottom: 0; }
.tv-aside .hist-row > .mono { grid-area: id; } .tv-aside .hist-row > .grow { grid-area: what; } .tv-aside .hist-row > .badge { grid-area: st; justify-self: end; } .tv-aside .hist-row > .hint { grid-area: when; justify-self: end; }

/* laptops: same page, slightly narrower right column */
@media (max-width: 1280px) { .tv-grid { grid-template-columns: minmax(0, 1.3fr) minmax(340px, 1fr); } }
/* tablets / phones: one column — work, then conversation, billing, history */
@media (max-width: 980px) {
  .tv-grid { grid-template-columns: 1fr; }
  .drawer-b.tv-body { padding: 12px 12px 24px; }
  .tv-tile { flex-basis: 140px; }
}
@media (max-width: 900px) {
  .drawer { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .drawer-h { padding: 10px 12px; }
  .drawer-h .meta { padding-left: 0; }
  .drawer-h .top { gap: 6px; }
  .drawer-h .top .tid, .drawer-h .top > [data-act="copy"], .drawer-h .top [data-act="t-delete"], .drawer-h .top [data-act="t-edit"] { display: none; }
  .tv-ic { width: 38px; height: 38px; font-size: 16px; }
  .tv-hl { flex: 1; } .tv-hl b { font-size: 16px; } .tv-hl b span { display: none; }
  .tv-hl small { max-width: none; }
  .drawer-h .btn-chat { font-size: 0; gap: 4px; padding: 0 8px; } .drawer-h .btn-chat i { font-size: 14px; } .drawer-h .btn-chat .n { font-size: 11px; }
}

/* =====================================================================
   v3.6.16 — "Aurora" design layer: depth, light and motion
   (pure CSS on top of the existing components; honours reduced motion)
   ===================================================================== */
:root {
  --grad: linear-gradient(135deg, #4f8cff 0%, #7c5cff 55%, #c05cff 100%);
  --grad-soft: linear-gradient(135deg, rgba(79,140,255,.16), rgba(124,92,255,.14));
  --glow: 0 0 0 1px rgba(124,92,255,.25), 0 10px 30px -8px rgba(79,140,255,.45);
  --glass: color-mix(in srgb, var(--bg-2) 72%, transparent);
  --spring: cubic-bezier(.3, 1.4, .5, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="light"] {
  --grad: linear-gradient(135deg, #2563eb 0%, #6d4aff 60%, #a94dff 100%);
  --grad-soft: linear-gradient(135deg, rgba(37,99,235,.10), rgba(109,74,255,.08));
  --glow: 0 0 0 1px rgba(109,74,255,.18), 0 10px 26px -10px rgba(37,99,235,.35);
  --glass: color-mix(in srgb, #ffffff 70%, transparent);
}

/* ---- living background (aurora) ---- */
.shell { position: relative; isolation: isolate; }
.shell::before {
  content: ''; position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vmax 30vmax at 12% 8%, rgba(79,140,255,.16), transparent 60%),
    radial-gradient(38vmax 28vmax at 88% 12%, rgba(192,92,255,.12), transparent 60%),
    radial-gradient(40vmax 30vmax at 70% 95%, rgba(20,184,166,.10), transparent 60%);
  will-change: transform; animation: aurora 38s ease-in-out infinite alternate;
}
:root[data-theme="light"] .shell::before {
  background:
    radial-gradient(40vmax 30vmax at 12% 8%, rgba(37,99,235,.10), transparent 60%),
    radial-gradient(38vmax 28vmax at 88% 12%, rgba(169,77,255,.08), transparent 60%),
    radial-gradient(40vmax 30vmax at 70% 95%, rgba(20,184,166,.07), transparent 60%);
}
@keyframes aurora { 0% { transform: translate3d(0,0,0) rotate(0deg); } 50% { transform: translate3d(3vmax,-2vmax,0) rotate(8deg); } 100% { transform: translate3d(-2vmax,2vmax,0) rotate(-6deg); } }
.main, .content { background: transparent; }

/* ---- glass chrome ---- */
.sidebar { background: var(--glass); backdrop-filter: blur(18px) saturate(1.3); border-right: 1px solid color-mix(in srgb, var(--border) 80%, transparent); position: relative; }
.sidebar::after { content: ''; position: absolute; top: 0; right: -1px; width: 1px; height: 100%; background: linear-gradient(180deg, transparent, rgba(124,92,255,.45), transparent); pointer-events: none; }
.topbar { background: var(--glass); backdrop-filter: blur(16px) saturate(1.3); position: relative; z-index: 5; }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(79,140,255,.5), rgba(192,92,255,.4), transparent); opacity: .6; }

/* ---- brand: radar ring around the tower ---- */
.brand-mark { position: relative; background: var(--grad); box-shadow: var(--glow); }
.brand-mark::before { content: ''; position: absolute; inset: -4px; border-radius: inherit; padding: 2px;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(124,92,255,.9) 85%, rgba(79,140,255,1) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 3.2s linear infinite; }
.brand-mark i { animation: towerPulse 2.6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes towerPulse { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); } 50% { transform: scale(1.08); filter: drop-shadow(0 0 6px rgba(255,255,255,.7)); } }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- navigation ---- */
.nav-item { position: relative; overflow: hidden; transition: background .18s, color .18s, transform .18s var(--spring); }
.nav-item:hover { transform: translateX(2px); }
.nav-item:hover > i { animation: iconPop .5s var(--spring); color: var(--accent); }
.nav-item.on { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(124,92,255,.18); }
.nav-item.on::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); box-shadow: 0 0 12px rgba(124,92,255,.8); animation: barIn .35s var(--spring); }
.nav-item.on > i { color: var(--accent); animation: iconFloat 3s ease-in-out infinite; }
.nav-item .pill-count:not(.soft) { box-shadow: 0 0 0 0 rgba(239,68,68,.6); animation: countGlow 2.4s ease-out infinite; }
@keyframes iconPop { 0% { transform: scale(1) rotate(0); } 40% { transform: scale(1.3) rotate(-10deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes iconFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes barIn { from { transform: scaleY(0); } }
@keyframes countGlow { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.55); } 70% { box-shadow: 0 0 0 7px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }

/* ---- buttons ---- */
.btn { position: relative; overflow: hidden; transition: background .15s, border-color .15s, transform .12s var(--spring), box-shadow .2s; }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn-primary { background: var(--grad); border-color: transparent; box-shadow: 0 6px 18px -6px rgba(79,140,255,.6); background-size: 150% 150%; }
.btn-primary:hover { background: var(--grad); background-size: 150% 150%; background-position: 100% 0; box-shadow: var(--glow); }
.btn-success { box-shadow: 0 6px 18px -8px rgba(34,197,94,.7); }
.btn-success:hover { filter: brightness(1.08); box-shadow: 0 8px 22px -6px rgba(34,197,94,.7); }
.btn:hover > i { animation: iconPop .45s var(--spring); }
.btn[data-act="new-menu"]::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); animation: shine 6s ease-in-out infinite; }
@keyframes shine { 0%, 70% { left: -60%; } 85%, 100% { left: 130%; } }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .18; transform: scale(0); animation: ripple .6s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* topbar icon buttons: each icon has its own little motion */
.topbar .btn-icon:hover > .fa-bell { animation: bellSwing .8s ease; transform-origin: 50% 5%; }
.topbar .btn-icon:hover > .fa-circle-half-stroke { animation: spinOnce .6s var(--ease); }
.topbar .btn-icon:hover > .fa-bolt { animation: flicker .7s steps(2) 2; }
.topbar .billing-btn:hover > i { animation: coin .6s var(--spring); }
@keyframes bellSwing { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(16deg); } 40% { transform: rotate(-14deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
@keyframes spinOnce { to { transform: rotate(180deg); } }
@keyframes flicker { 50% { opacity: .3; } }
@keyframes coin { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }

/* live badge: radar rings */
.live.on { background: var(--ok-soft); border-color: transparent; }
.live.on .led { position: relative; }
.live.on .led::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--ok); animation: radar 1.8s ease-out infinite; }
@keyframes radar { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }

/* ---- cards, KPIs, tabs ---- */
.card { transition: box-shadow .25s, border-color .25s, transform .25s var(--ease); }
.kpi[data-act]:hover, .ov-kpis .kpi:hover { border-color: rgba(124,92,255,.35); }
.task-tabs button { transition: transform .15s var(--spring), background .15s, border-color .15s, box-shadow .2s; position: relative; overflow: hidden; }
.task-tabs button:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(79,140,255,.6); }
.task-tabs button.on { background: var(--grad); border-color: transparent; box-shadow: 0 8px 20px -8px rgba(79,140,255,.7); }
.seg button.on { box-shadow: 0 2px 8px -2px rgba(79,140,255,.45); }

/* ---- ticket table ---- */
.t tbody tr td { transition: background .15s; }
.t tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.t tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.rows-in tbody tr:not(.grp-row) { animation: rowIn .45s var(--ease) both; }
.rows-in tbody tr:nth-child(1) { animation-delay: .02s } .rows-in tbody tr:nth-child(2) { animation-delay: .04s } .rows-in tbody tr:nth-child(3) { animation-delay: .06s }
.rows-in tbody tr:nth-child(4) { animation-delay: .08s } .rows-in tbody tr:nth-child(5) { animation-delay: .1s } .rows-in tbody tr:nth-child(6) { animation-delay: .12s }
.rows-in tbody tr:nth-child(7) { animation-delay: .14s } .rows-in tbody tr:nth-child(8) { animation-delay: .16s } .rows-in tbody tr:nth-child(9) { animation-delay: .18s }
.rows-in tbody tr:nth-child(n+10) { animation-delay: .2s }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }
/* status / priority signals */
.badge.b-open .dot { animation: dotPulse 1.8s ease-in-out infinite; }
.prio.Critical::before { animation: critGlow 1.6s ease-in-out infinite; }
.badge.b-bad .fa-clock, .c-sla .fa-fire, .badge.b-noc { animation: nudge 3s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 50% { box-shadow: 0 0 0 4px transparent; } }
@keyframes critGlow { 0%, 100% { box-shadow: 0 0 0 3px var(--bad-soft); } 50% { box-shadow: 0 0 0 5px rgba(239,68,68,.05), 0 0 10px rgba(239,68,68,.8); } }
@keyframes nudge { 0%, 86%, 100% { transform: rotate(0); } 89% { transform: rotate(-10deg); } 92% { transform: rotate(9deg); } 95% { transform: rotate(-5deg); } }

/* ---- empty states: a floating icon in a glowing orb ---- */
.empty i { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; font-size: 24px; opacity: 1; color: var(--accent);
  background: radial-gradient(circle at 30% 30%, rgba(124,92,255,.28), rgba(79,140,255,.10) 60%, transparent 70%); box-shadow: inset 0 0 0 1px rgba(124,92,255,.25); animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---- page transition ---- */
.view-in { animation: viewIn .38s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); filter: blur(2px); } }

/* ---- toasts ---- */
.toast { backdrop-filter: blur(14px) saturate(1.3); background: color-mix(in srgb, var(--surface) 86%, transparent); animation: toastIn .45s var(--spring); position: relative; overflow: hidden; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.96); } }

/* ---- ticket window ---- */
.drawer { background: color-mix(in srgb, var(--bg) 94%, transparent); }
.drawer-h { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface) 55%); }
.tv-ic { box-shadow: var(--glow); animation: iconFloat 4s ease-in-out infinite; }
.tv-tile { transition: transform .2s var(--spring), border-color .2s, box-shadow .2s; animation: rise .4s var(--ease) both; }
.tv-tile:nth-child(2) { animation-delay: .03s } .tv-tile:nth-child(3) { animation-delay: .06s } .tv-tile:nth-child(4) { animation-delay: .09s }
.tv-tile:nth-child(5) { animation-delay: .12s } .tv-tile:nth-child(6) { animation-delay: .15s } .tv-tile:nth-child(n+7) { animation-delay: .18s }
.tv-tile:hover { transform: translateY(-2px); border-color: rgba(124,92,255,.35); box-shadow: 0 10px 24px -14px rgba(79,140,255,.6); }
.tv-tile small i { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--grad-soft); opacity: 1; }
.tv-main > section, .tv-aside > section, .tv-main > .stepper { transition: border-color .2s, box-shadow .2s; }
.tv-main > section:hover, .tv-aside > section:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.tv-main .section-title > i, .tv-aside .section-title > i { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--grad-soft); color: var(--accent); font-size: 11px; }
.tv-bill { border-color: color-mix(in srgb, var(--accent) 25%, var(--border)) !important; }
.tv-bill .card-h h3 i { animation: iconFloat 3s ease-in-out infinite; }
.stepper .st.cur .dot { animation: dotPulse 1.6s ease-in-out infinite; color: var(--accent); }
.photos img { transition: transform .35s var(--ease), filter .2s; }
.photos button:hover img { transform: scale(1.05); filter: brightness(1.08); }
.photos button { overflow: hidden; border-radius: 10px; }

/* ---- quick chat & modal polish ---- */
.qc { backdrop-filter: blur(16px) saturate(1.3); background: color-mix(in srgb, var(--surface) 92%, transparent); }
.qc-ic { background: var(--grad); box-shadow: var(--glow); }
.qm.out .qm-b { background: var(--grad); }
.modal { animation: modalIn .35s var(--spring); }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* ---- details ---- */
::selection { background: rgba(124,92,255,.35); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
.input:focus, .select:focus, .textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--accent) 10%, var(--surface-3)) 50%, var(--surface-2) 75%); background-size: 200% 100%; }

/* ---- motion off for people who ask for it (and for print) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .shell::before { animation: none; }
}
@media print { .shell::before { display: none; } }

/* =====================================================================
   v3.6.17 — voice messages
   ===================================================================== */
.btn-mic:hover > i { color: var(--bad); }
.composer, .qc-f { position: relative; }
.vrec { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: inherit;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(6px); animation: rise .2s var(--ease, ease); }
.vrec-x { width: 36px; height: 36px; border-radius: 50%; color: var(--muted); font-size: 15px; flex: none; }
.vrec-x:hover { color: var(--bad); background: var(--bad-soft); }
.vrec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); flex: none; animation: recBlink 1s ease-in-out infinite; box-shadow: 0 0 10px var(--bad); }
@keyframes recBlink { 50% { opacity: .25; } }
.vrec-t { font-family: var(--mono); font-weight: 700; font-size: 14px; min-width: 42px; }
.vrec-lv { flex: 1; min-width: 60px; height: 34px; display: flex; align-items: center; gap: 3px; }
.vrec-lv i { flex: 1; min-width: 2px; height: 4%; border-radius: 2px; background: var(--grad, var(--accent)); transition: height .06s linear; }
.vrec-hint { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.vrec-ok { width: 42px; height: 42px; border-radius: 50%; background: var(--grad, var(--accent)); color: #fff; font-size: 15px; flex: none; box-shadow: 0 6px 18px -6px rgba(79,140,255,.7); transition: transform .12s; }
.vrec-ok:hover { transform: scale(1.06); } .vrec-ok:active { transform: scale(.94); }
@media (max-width: 520px) { .vrec-hint { display: none; } }

.vp { display: flex; align-items: center; gap: 9px; min-width: 230px; max-width: 320px; padding: 2px 0; }
.vp-play { width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--accent); color: #fff; font-size: 13px; display: grid; place-items: center; transition: transform .12s; box-shadow: 0 4px 12px -4px rgba(79,140,255,.6); }
.vp-play:active { transform: scale(.92); }
.vp.mine .vp-play { background: #fff; color: var(--accent); }
.vp-wave { flex: 1; height: 30px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.vp-wave i { flex: 1; min-width: 2px; border-radius: 2px; background: color-mix(in srgb, currentColor 30%, transparent); transition: background .15s; }
.vp-wave i.on { background: var(--accent); }
.vp.mine .vp-wave i { background: rgba(255,255,255,.4); } .vp.mine .vp-wave i.on { background: #fff; }
.vp.playing .vp-play { animation: vpPulse 1.4s ease-in-out infinite; }
@keyframes vpPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent); } }
.vp-t { font-family: var(--mono); font-size: 11.5px; min-width: 34px; opacity: .85; }
.vp-sp { height: 22px; min-width: 32px; padding: 0 6px; border-radius: 11px; font-size: 11px; font-weight: 700; background: color-mix(in srgb, currentColor 12%, transparent); }
.bubble .vp + *, .qm-b .vp + * { margin-top: 6px; }
.recdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: recBlink 1s infinite; }
.qc .vrec-hint { display: none; }
.qc .vrec { gap: 8px; padding: 0 10px; }

/* =====================================================================
   v3.6.19 — emoji, stickers, reactions
   ===================================================================== */
.emo-pop { position: fixed; z-index: 120; width: 340px; max-height: 380px; display: flex; flex-direction: column; background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(16px); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; animation: modalIn .22s var(--spring, ease); }
.emo-tabs { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--border); flex: none; }
.emo-tabs button { flex: 1; height: 30px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.emo-tabs button.on { background: var(--grad-soft, var(--accent-soft)); color: var(--text); }
.emo-tabs button:disabled { opacity: .4; }
.emo-body { overflow-y: auto; padding: 6px 8px 10px; }
.emo-h { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 4px 4px; }
.emo-grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.emo-grid button { height: 36px; font-size: 21px; border-radius: 8px; transition: transform .12s var(--spring, ease), background .12s; }
.emo-grid button:hover { background: var(--surface-2); transform: scale(1.2); }
.stk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-top: 4px; }
.stk-grid button { border-radius: 12px; padding: 4px 0; transition: transform .15s var(--spring, ease), background .15s; }
.stk-grid button:hover { background: var(--surface-2); transform: translateY(-2px) scale(1.04); }
.stk-grid .stk { transform: scale(.72); margin: -8px 0; animation: none; }

/* sticker message: big emoji + label, no bubble */
.stk { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 6px; animation: stkIn .5s cubic-bezier(.3,1.6,.5,1) both; }
.stk-e { font-size: 54px; line-height: 1.05; filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); animation: stkBob 3.2s ease-in-out infinite; }
.stk-l { font-size: 12px; font-weight: 800; letter-spacing: .02em; padding: 3px 10px; border-radius: 12px; color: #fff; background: var(--grad, var(--accent)); box-shadow: 0 4px 12px -4px rgba(79,140,255,.6); white-space: nowrap; }
.stk.s-done .stk-l, .stk.s-party .stk-l, .stk.s-signal .stk-l { background: linear-gradient(135deg, #16a34a, #22c55e); }
.stk.s-urgent .stk-l, .stk.s-nosignal .stk-l, .stk.s-fibercut .stk-l, .stk.s-power .stk-l { background: linear-gradient(135deg, #dc2626, #f97316); }
.stk.s-wait .stk-l, .stk.s-checking .stk-l, .stk.s-question .stk-l, .stk.s-rain .stk-l { background: linear-gradient(135deg, #d97706, #f59e0b); }
.stk.s-love .stk-l, .stk.s-thanks .stk-l { background: linear-gradient(135deg, #db2777, #a855f7); }
.stk.img img { width: 128px; height: 128px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.2)); }
@keyframes stkIn { from { transform: scale(.3) rotate(-12deg); opacity: 0; } }
@keyframes stkBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-3deg); } }
.qm.out .stk { align-self: flex-end; }

/* reactions */
.rx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; min-height: 0; }
.rx:not(:has(.rx-chip)) { margin-top: 0; }
.rx-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 12px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--border); transition: transform .12s var(--spring, ease), background .12s; }
.rx-chip b { font-size: 11px; font-weight: 700; color: var(--text-2); }
.rx-chip.mine { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.rx-chip.mine b { color: var(--accent); }
.rx-chip:hover { transform: scale(1.08); }
.rx-chip.pop { animation: rxPop .5s cubic-bezier(.3,1.8,.5,1); }
@keyframes rxPop { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.rx-add { height: 24px; padding: 0 7px; border-radius: 12px; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 1px; opacity: 0; transition: opacity .15s, background .15s; }
.rx-add .fa-plus { font-size: 8px; margin-top: -6px; }
.rx-add:hover { background: var(--surface-2); color: var(--text); }
.qm:hover .rx-add, .tl:hover .rx-add, .rx:has(.rx-chip) .rx-add { opacity: 1; }
.qm.out .rx { justify-content: flex-end; }
.rx-pop { width: auto; max-height: none; flex-direction: row; padding: 4px; border-radius: 22px; gap: 2px; }
.rx-pop button { width: 36px; height: 36px; font-size: 21px; border-radius: 50%; transition: transform .12s cubic-bezier(.3,1.6,.5,1); }
.rx-pop button:hover { transform: scale(1.35) translateY(-3px); background: var(--surface-2); }
@media (hover: none) { .rx-add { opacity: 1; } }
