/* Inblaj HQ — Ahmed's command center. Dark premium, Inblaj gold on deep ink; phone + laptop; Arabic/RTL inside chats. */
:root {
  color-scheme: dark;
  --font: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --brand: "Alexandria", "IBM Plex Sans Arabic", "Inter", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --gold-1: #ffe7b0; --gold-2: #ffc45a; --gold-3: #f2932a;
  --grad: linear-gradient(135deg, var(--gold-1), var(--gold-2) 45%, var(--gold-3));
  --bg: #08070b; --bg-2: #0d0b12; --panel: rgba(24, 20, 31, .72); --panel-solid: #15121b; --panel-2: #1c1824; --panel-3: #262031;
  --line: rgba(255, 228, 190, .07); --line-2: rgba(255, 228, 190, .13); --line-3: rgba(255, 228, 190, .2);
  --text: #f6f0e8; --text-2: #d2c8bb; --muted: #968c80; --faint: #645c53;
  --acc: #ffb547; --acc-ink: #1b1206; --acc-soft: rgba(255, 181, 71, .12); --acc-line: rgba(255, 181, 71, .34);
  --ok: #5fd39a; --ok-soft: rgba(95, 211, 154, .12); --warn: #ffc45a; --bad: #ff7a6b; --bad-soft: rgba(255, 122, 107, .12);
  --info: #8fb4ff; --info-soft: rgba(143, 180, 255, .12); --violet: #c3a6ff; --violet-soft: rgba(195, 166, 255, .13);
  --user: #2a2233; --r-s: 9px; --r-m: 13px; --r-l: 18px; --r-xl: 24px;
  --ease: cubic-bezier(.2, .8, .2, 1); --side: 236px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --shadow: 0 18px 50px rgba(0, 0, 0, .5), 0 2px 10px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
#app { height: 100%; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 500px at 85% -10%, rgba(255, 166, 61, .10), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(140, 110, 255, .07), transparent 60%); }
a { color: var(--acc); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
[hidden] { display: none !important; }
::selection { background: rgba(255, 181, 71, .3); }
::-webkit-scrollbar { width: 9px; height: 9px; } ::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }

/* ── login ─────────────────────────────────────────────────────────── */
.login { position: relative; z-index: 1; min-height: 100%; display: grid; place-items: center; padding: 24px; overflow: auto; }
.login .card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 34px 28px 28px; box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.login .mark { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login .mark img { width: 46px; height: 46px; filter: drop-shadow(0 6px 22px rgba(255, 170, 60, .45)); }
.login h1 { font: 600 22px/1.1 var(--brand); margin: 0; letter-spacing: .2px; }
.login h1 small { display: block; font: 400 12.5px var(--font); color: var(--muted); margin-top: 5px; letter-spacing: .3px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; }
.input, .field input, .field select, .field textarea { width: 100%; background: rgba(0, 0, 0, .25); border: 1px solid var(--line-2); border-radius: var(--r-m); padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; min-height: 90px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--acc-line); box-shadow: 0 0 0 3px var(--acc-soft); }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* ── buttons & chips ───────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); border-radius: 11px; padding: 8px 13px; font-weight: 500; font-size: 13px; transition: transform .1s, background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { border-color: var(--line-3); background: var(--panel-3); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--grad); color: var(--acc-ink); border-color: transparent; font-weight: 600; box-shadow: 0 6px 20px rgba(255, 160, 50, .22); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: rgba(255, 122, 107, .3); background: var(--bad-soft); }
.btn.ok { color: var(--ok); border-color: rgba(95, 211, 154, .3); background: var(--ok-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; padding: 12px; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2); }
.iconbtn:hover { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; border: 1px solid var(--line-2); color: var(--text-2); background: rgba(255, 255, 255, .02); white-space: nowrap; line-height: 18px; }
.chip.gold { color: var(--acc); border-color: var(--acc-line); background: var(--acc-soft); }
.chip.ok { color: var(--ok); border-color: rgba(95, 211, 154, .3); background: var(--ok-soft); }
.chip.bad { color: var(--bad); border-color: rgba(255, 122, 107, .3); background: var(--bad-soft); }
.chip.info { color: var(--info); border-color: rgba(143, 180, 255, .3); background: var(--info-soft); }
.chip.violet { color: var(--violet); border-color: rgba(195, 166, 255, .3); background: var(--violet-soft); }
.chip.warn { color: var(--warn); border-color: rgba(255, 196, 90, .3); background: rgba(255, 196, 90, .1); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(95, 211, 154, .18); animation: pulse 2.2s infinite; }
.dot.idle { background: var(--warn); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(95, 211, 154, 0); } }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 5px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 500; }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 0 var(--line-2) inset; }

/* ── shell ─────────────────────────────────────────────────────────── */
.hq { position: relative; z-index: 1; display: grid; grid-template-columns: var(--side) 1fr; height: 100%; }
.side { display: flex; flex-direction: column; gap: 4px; padding: calc(16px + var(--safe-t)) 12px 14px; border-right: 1px solid var(--line); background: rgba(10, 8, 14, .6); backdrop-filter: blur(14px); min-height: 0; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.side .brand img { width: 32px; height: 32px; filter: drop-shadow(0 4px 14px rgba(255, 170, 60, .4)); }
.side .brand b { font: 600 16px/1 var(--brand); letter-spacing: .3px; }
.side .brand small { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: 1.6px; text-transform: uppercase; margin-top: 4px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; color: var(--text-2); font-weight: 500; position: relative; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.on { background: linear-gradient(90deg, var(--acc-soft), transparent); color: var(--text); }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--grad); }
.nav a .badge { margin-left: auto; }
.badge { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px; background: var(--grad); color: var(--acc-ink); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.badge.live { background: var(--ok); }
.side .foot { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.switch { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); cursor: pointer; font-size: 12.5px; width: 100%; text-align: left; }
.switch .tg { width: 34px; height: 20px; border-radius: 20px; background: var(--panel-3); position: relative; flex: none; transition: background .2s; }
.switch .tg::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform .2s var(--ease); }
.switch.on .tg { background: var(--warn); } .switch.on .tg::after { transform: translateX(14px); background: #1b1206; }
.switch.on { border-color: rgba(255, 196, 90, .35); background: rgba(255, 196, 90, .07); }
.switch b { display: block; font-weight: 600; } .switch small { color: var(--muted); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: 13px; }
.av { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font: 600 14px var(--brand); background: var(--panel-3); color: var(--text); flex: none; position: relative; overflow: hidden; }
.av.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.av img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.av .st { position: absolute; right: -1px; bottom: -1px; }
.av.partner { background: linear-gradient(135deg, #3a2c19, #2a1f12); color: var(--gold-2); }
.av.client { background: linear-gradient(135deg, #2a2240, #1d1830); color: var(--violet); }
.av.admin { background: var(--grad); color: var(--acc-ink); }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--safe-t)) 22px 12px; border-bottom: 1px solid var(--line); background: rgba(8, 7, 11, .55); backdrop-filter: blur(14px); position: relative; z-index: 5; }
.top h2 { margin: 0; font: 600 18px/1.2 var(--brand); letter-spacing: .2px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.top h2 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .tmark { display: none; width: 26px; height: 26px; }
.top .grow { flex: 1; }
.searchbtn { display: flex; align-items: center; gap: 9px; min-width: 240px; padding: 7px 10px 7px 12px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); color: var(--muted); font-size: 13px; }
.searchbtn kbd { margin-left: auto; font: 11px var(--mono); color: var(--faint); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; }
.livepill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); }
.livepill.on { color: var(--ok); border-color: rgba(95, 211, 154, .25); }
.testbar { display: none; align-items: center; justify-content: center; gap: 8px; padding: 6px 12px; font-size: 12.5px; background: rgba(255, 196, 90, .1); color: var(--warn); border-bottom: 1px solid rgba(255, 196, 90, .25); }
.testbar.on { display: flex; }
.view { flex: 1; min-height: 0; overflow: auto; padding: 22px; scroll-behavior: smooth; }
.view.flush { padding: 0; overflow: hidden; display: flex; }
.tabs { display: none; }

/* ── panels / cockpit ─────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); padding: 15px 16px 14px; backdrop-filter: blur(10px); }
.kpi::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 100% 0%, rgba(255, 181, 71, .07), transparent 55%); pointer-events: none; }
.kpi .k { font-size: 11px; color: var(--muted); letter-spacing: 1.1px; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.kpi .v { font: 600 28px/1.15 var(--brand); margin-top: 7px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.kpi .v small { font: 500 13px var(--font); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kpi.hot .v { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); backdrop-filter: blur(10px); min-width: 0; }
.panel > header { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.panel > header h3 { margin: 0; font: 600 13.5px var(--brand); letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.panel > header .grow { flex: 1; }
.panel .pb { padding: 14px 16px; }
.panel .empty { padding: 22px 16px; color: var(--faint); font-size: 13px; text-align: center; }
.panel + .panel { margin-top: 16px; }
.stack { min-width: 0; } .stack > * + * { margin-top: 16px; }

.turn { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.turn:last-child { border-bottom: 0; }
.turn:hover { background: rgba(255, 255, 255, .02); }
.turn .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn .m { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.turn .pv { margin-top: 7px; font-size: 12.5px; color: var(--text-2); background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; max-height: 58px; overflow: hidden; mask-image: linear-gradient(180deg, #000 50%, transparent); }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--acc-soft); border-top-color: var(--acc); animation: spin 1s linear infinite; flex: none; }
.spin.sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.qd { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px dashed var(--line-3); color: var(--muted); font-size: 12px; }

.ppl { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 5px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .2); font-size: 13px; cursor: pointer; }
.pchip .av { width: 26px; height: 26px; border-radius: 50%; font-size: 12px; }
.pchip small { color: var(--muted); }

.appr { padding: 13px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.appr:last-child { border-bottom: 0; }
.appr .h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appr .tag { font: 700 12px var(--mono); color: var(--acc); }
.appr p { margin: 0; font-size: 13.5px; }
.appr .acts { display: flex; gap: 8px; flex-wrap: wrap; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: .9px; text-transform: uppercase; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: rgba(255, 255, 255, .02); }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .who { display: flex; align-items: center; gap: 9px; }
.tbl .who .av { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
.tscroll { overflow-x: auto; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.meter { display: grid; gap: 4px; min-width: 90px; }
.meter .bar { height: 5px; border-radius: 9px; background: var(--panel-3); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 9px; background: var(--grad); }
.meter.full .bar i { background: var(--bad); }
.meter small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.chart { padding: 14px 16px 10px; }
.chart .bars { display: flex; align-items: flex-end; gap: 6px; height: 132px; padding-top: 6px; border-bottom: 1px solid var(--line-2); position: relative; }
.chart .b { flex: 1; display: flex; align-items: flex-end; height: 100%; position: relative; cursor: default; }
.chart .b i { display: block; width: 100%; max-width: 26px; margin: 0 auto; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); min-height: 2px; opacity: .9; transition: opacity .15s; }
.chart .b.zero i { background: var(--panel-3); }
.chart .b:hover i { opacity: 1; filter: brightness(1.12); }
.chart .b .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 9px; font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 3; box-shadow: var(--shadow); }
.chart .b:hover .tip { opacity: 1; }
.chart .xl { display: flex; gap: 6px; margin-top: 6px; } .chart .xl span { flex: 1; text-align: center; font-size: 10.5px; color: var(--faint); }

.feed .it { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.feed .it:hover { background: rgba(255, 255, 255, .02); }
.feed .it:last-child { border-bottom: 0; }
.feed .it .av { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.feed .it .l1 { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.feed .it .l1 b { color: var(--text-2); font-weight: 600; }
.feed .it .l2 { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 10px; overflow-x: auto; padding: 14px 16px; scroll-snap-type: x mandatory; }
.strip > * { scroll-snap-align: start; }

/* ── work tiles ───────────────────────────────────────────────────── */
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { position: relative; border-radius: var(--r-m); overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; text-align: left; padding: 0; display: block; transition: transform .2s var(--ease), border-color .2s; }
.tile:hover { transform: translateY(-2px); border-color: var(--acc-line); }
.tile .th { aspect-ratio: 4 / 5; background: #000 center / cover no-repeat; display: grid; place-items: center; position: relative; overflow: hidden; }
.tile .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .th .ph { color: var(--faint); display: grid; place-items: center; gap: 6px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.tile .th .ph .i { width: 30px; height: 30px; }
.tile .kind { position: absolute; top: 8px; left: 8px; }
.tile .play { position: absolute; inset: 0; display: grid; place-items: center; }
.tile .play span { width: 44px; height: 44px; border-radius: 50%; background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .2); }
.tile .cap { padding: 9px 11px 10px; display: grid; gap: 2px; }
.tile .cap b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .cap small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .pk { position: absolute; top: 8px; right: 8px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select, .filters input { background: rgba(0, 0, 0, .25); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 10px; font-size: 13px; outline: none; max-width: 100%; }
.filters select:focus, .filters input:focus { border-color: var(--acc-line); }

/* ── people ───────────────────────────────────────────────────────── */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; cursor: pointer; transition: border-color .2s, transform .2s var(--ease); display: grid; gap: 12px; text-align: left; }
.pcard:hover { border-color: var(--acc-line); transform: translateY(-1px); }
.pcard.off { opacity: .55; }
.pcard .hd { display: flex; gap: 12px; align-items: center; }
.pcard .hd .n { min-width: 0; flex: 1; }
.pcard .hd b { font: 600 15px var(--brand); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .hd small { color: var(--muted); font-size: 12px; }
.pcard .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pcard .stats div { background: rgba(0, 0, 0, .2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; }
.pcard .stats b { display: block; font: 600 15px var(--brand); font-variant-numeric: tabular-nums; }
.pcard .stats small { font-size: 10.5px; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }
.pcard .ft { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.phead { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.phead .n { flex: 1; min-width: 200px; }
.phead h1 { margin: 0; font: 600 24px/1.2 var(--brand); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.phead .sub { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches span { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line-2); }
.brandhero { display: flex; gap: 14px; align-items: center; }
.brandhero img.logo { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; background: #fff; padding: 6px; }
.brandtext { font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.sells { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 10px; }
.sells div { background: rgba(0, 0, 0, .2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 12px; }
.sells img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #fff; }
.sells span { display: block; padding: 6px 8px; }
.limrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.limrow .field { margin: 0; }

/* ── conversations ────────────────────────────────────────────────── */
.chats { display: grid; grid-template-columns: 370px 1fr; width: 100%; height: 100%; min-height: 0; }
.clist { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; background: rgba(8, 7, 11, .35); }
.clist .cf > *, .clist .cf .row > * { min-width: 0; }
.clist .cf { padding: 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.clist .cf .row { display: flex; gap: 8px; }
.clist .cf select { flex: 1; min-width: 0; background: rgba(0, 0, 0, .25); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 8px; font-size: 12.5px; }
.clist .items { overflow: auto; flex: 1; }
.citem { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.citem:hover { background: rgba(255, 255, 255, .02); }
.citem.on { background: linear-gradient(90deg, var(--acc-soft), transparent 80%); }
.citem.on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--grad); }
.citem .av { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.citem .l1 { display: flex; gap: 6px; align-items: center; min-width: 0; }
.citem .l1 b { flex: 1; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.citem .l1 time { font-size: 11px; color: var(--faint); flex: none; }
.citem .l2 { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 1px; }
.citem .l3 { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.citem.arch { opacity: .6; }
.conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.conv .ch { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); background: rgba(8, 7, 11, .5); flex-wrap: wrap; }
.conv .ch .tt { flex: 1; min-width: 180px; }
.conv .ch h3 { margin: 0; font: 600 16px/1.3 var(--brand); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .ch .m { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; align-items: center; }
.conv .stats { display: flex; gap: 14px; padding: 9px 18px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); overflow-x: auto; white-space: nowrap; }
.conv .stats b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.steps-bar { display: flex; gap: 4px; align-items: center; }
.steps-bar span { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--faint); border: 1px solid var(--line); }
.steps-bar span.done { color: var(--text-2); } .steps-bar span.cur { color: var(--acc-ink); background: var(--grad); border-color: transparent; font-weight: 600; }
.scroll { flex: 1; overflow: auto; min-height: 0; }
.thread { max-width: 860px; margin: 0 auto; padding: 22px 18px 30px; display: grid; gap: 18px; }
.daysep { text-align: center; font-size: 11px; color: var(--faint); letter-spacing: 1px; text-transform: uppercase; display: flex; align-items: center; gap: 12px; }
.daysep::before, .daysep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { display: grid; gap: 6px; min-width: 0; }
.msg .who { font-size: 11.5px; color: var(--muted); display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.msg .who b { color: var(--text-2); font-weight: 600; }
.msg.user { justify-items: end; }
.msg.user .who { justify-content: flex-end; }
.msg.user .bubble { background: var(--user); border: 1px solid var(--line-2); border-radius: 18px 18px 6px 18px; padding: 10px 14px; max-width: min(620px, 92%); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.65; }
.msg.user.admin .bubble { border-color: rgba(195, 166, 255, .45); box-shadow: 0 0 0 3px rgba(195, 166, 255, .07); }
.msg.user.pick .bubble { background: linear-gradient(135deg, #3a2a14, #2a2233); border-color: var(--acc-line); }
.msg.ai { grid-template-columns: 30px 1fr; column-gap: 11px; }
.msg.ai .ava { width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 181, 71, .1); display: grid; place-items: center; border: 1px solid var(--acc-line); grid-row: span 2; }
.msg.ai .ava img { width: 18px; height: 18px; }
.msg.ai .body { min-width: 0; display: grid; gap: 10px; }
.md { font-size: 14.5px; line-height: 1.7; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .7em; } .md ul, .md ol { margin: .3em 0 .8em; padding-inline-start: 1.4em; } .md li { margin: .2em 0; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--brand); font-weight: 600; margin: 1em 0 .4em; line-height: 1.3; } .md h1 { font-size: 1.25em; } .md h2 { font-size: 1.15em; } .md h3 { font-size: 1.05em; }
.md code { font: 12.5px var(--mono); background: rgba(0, 0, 0, .35); padding: 1px 5px; border-radius: 5px; }
.md pre { background: rgba(0, 0, 0, .4); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow: auto; direction: ltr; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: .6em 0; padding: .2em 0 .2em .9em; border-inline-start: 3px solid var(--acc-line); color: var(--text-2); }
.md table { border-collapse: collapse; font-size: 13px; display: block; overflow-x: auto; max-width: 100%; }
.md th, .md td { border: 1px solid var(--line-2); padding: 5px 9px; }
.md a { text-decoration: underline; text-underline-offset: 2px; }
.md hr { border: 0; height: 1px; background: var(--line-2); margin: 1em 0; }
.turnmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--faint); }
.turnmeta .sep { opacity: .5; }
details.steps { font-size: 12px; color: var(--muted); }
details.steps summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); }
details.steps summary::-webkit-details-marker { display: none; }
details.steps ol { margin: 8px 0 0; padding: 0 0 0 4px; list-style: none; display: grid; gap: 3px; border-left: 1px solid var(--line-2); }
details.steps li { padding-left: 12px; position: relative; overflow-wrap: anywhere; }
details.steps li::before { content: ""; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--panel-3); border: 1px solid var(--line-3); }
details.steps li b { color: var(--text-2); font-weight: 600; margin-right: 6px; }
.sysnote { border: 1px dashed var(--line-2); border-radius: 12px; padding: 8px 12px; font-size: 12.5px; color: var(--muted); background: rgba(0, 0, 0, .18); white-space: pre-wrap; overflow-wrap: anywhere; }
.sysnote.hq { border-color: rgba(195, 166, 255, .4); color: var(--text-2); background: var(--violet-soft); }
.sysnote b { color: var(--text-2); }
.evt { display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 13px; padding: 9px 14px; border-radius: 12px; background: rgba(0, 0, 0, .2); border: 1px solid var(--line); margin: 0 auto; max-width: 600px; flex-wrap: wrap; text-align: center; }
.evt.pending { border-color: rgba(255, 196, 90, .3); } .evt.approved { border-color: rgba(95, 211, 154, .3); } .evt.declined { border-color: rgba(255, 122, 107, .3); }
.errbox { color: var(--bad); background: var(--bad-soft); border: 1px solid rgba(255, 122, 107, .25); border-radius: 10px; padding: 8px 12px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-width: 620px; width: 100%; }
.msg.user .files { justify-self: end; }
.files .thumb { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 1; }
.files .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.files.one { grid-template-columns: minmax(0, 360px); }
.files.one .thumb { aspect-ratio: auto; } .files.one .thumb img { height: auto; max-height: 460px; object-fit: contain; }
.fcard { display: flex; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .2); color: var(--text); min-width: 0; }
.fcard .fi { width: 36px; height: 36px; border-radius: 9px; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; font: 700 10px var(--mono); flex: none; }
.fcard .fn { min-width: 0; display: grid; } .fcard .fn b { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .fcard .fn small { color: var(--muted); font-size: 11px; }
.aud { grid-column: 1 / -1; display: grid; gap: 6px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .2); }
.aud .nm { font-size: 12.5px; } .aud audio, .voice audio { width: 100%; height: 36px; }
.voice { grid-column: 1 / -1; display: grid; gap: 6px; } .voice .tr { font-size: 13px; color: var(--text-2); font-style: italic; }
.card { border: 1px solid var(--line-2); border-radius: 16px; background: rgba(0, 0, 0, .2); padding: 12px; display: grid; gap: 10px; }
.card .ctitle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; flex-wrap: wrap; }
.opts { display: grid; gap: 8px; }
.opt { border: 1px solid var(--line-2); border-radius: 13px; padding: 11px 12px; display: grid; gap: 6px; background: var(--panel-2); position: relative; }
.opt.picked { border-color: var(--acc); background: linear-gradient(135deg, rgba(255, 181, 71, .14), rgba(255, 181, 71, .03)); box-shadow: 0 0 0 3px var(--acc-soft); }
.opt .oh { display: flex; gap: 9px; align-items: center; }
.opt .on { width: 24px; height: 24px; border-radius: 7px; background: var(--panel-3); display: grid; place-items: center; font: 600 12px var(--brand); flex: none; }
.opt.picked .on { background: var(--grad); color: var(--acc-ink); }
.opt .oh b { flex: 1; font-weight: 600; }
.opt .hook { margin: 0; font-size: 13px; color: var(--text-2); }
.opt details summary { cursor: pointer; font-size: 12px; color: var(--acc); }
.opt .otext { white-space: pre-wrap; font-size: 13.5px; line-height: 1.7; margin-top: 6px; }
.opt .onotes { font-size: 12px; color: var(--muted); margin-top: 6px; white-space: pre-wrap; }
.opt .oa { display: flex; justify-content: flex-end; }
.ribbon { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--acc-ink); background: var(--grad); padding: 2px 9px; border-radius: 99px; }
.vlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.vc { border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 11px; display: grid; gap: 6px; background: var(--panel-2); }
.vc.picked { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.vc .vh { display: flex; align-items: center; gap: 8px; } .vc .vh b { flex: 1; } .vc small { color: var(--muted); font-size: 11.5px; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dit { display: grid; gap: 6px; border-radius: 12px; padding: 4px; border: 1px solid transparent; }
.dit.picked { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.dit .dimg { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: var(--ar, 4 / 5); position: relative; }
.dit .dimg img, .dimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dit .dn { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 7px; background: rgba(0, 0, 0, .6); display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.dv { position: relative; width: min(420px, 100%); aspect-ratio: var(--ar, 9 / 16); max-height: 70vh; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line-2); }
.dv img, .dv iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.dv .playb { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .5); backdrop-filter: blur(8px); display: grid; place-items: center; color: #fff; }
.dv .playb .i { width: 26px; height: 26px; fill: #fff; }
.drivecards { display: flex; flex-wrap: wrap; gap: 8px; }
.drivecard { display: flex; gap: 10px; align-items: center; padding: 6px 10px 6px 6px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(0, 0, 0, .2); max-width: 320px; cursor: pointer; text-align: left; }
.drivecard img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; background: #111; flex: none; }
.drivecard span { font-size: 12px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.live { border: 1px solid var(--acc-line); border-radius: 16px; padding: 12px 14px; background: linear-gradient(180deg, rgba(255, 181, 71, .06), transparent); display: grid; gap: 10px; }
.live .lh { display: flex; gap: 10px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.live .lh b { color: var(--acc); }
.live .lsteps { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11.5px; }
.live .lsteps span { padding: 2px 8px; border-radius: 99px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live .lsteps span:last-child { color: var(--text); border-color: var(--acc-line); }
.caret::after { content: "▍"; color: var(--acc); animation: blink 1s steps(2) infinite; margin-inline-start: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.hl { animation: hl 2.4s var(--ease); border-radius: 14px; }
@keyframes hl { 0%, 40% { box-shadow: 0 0 0 4px var(--acc-line); background: var(--acc-soft); } }

.composer { border-top: 1px solid var(--line); padding: 10px 14px calc(12px + var(--safe-b)); background: rgba(8, 7, 11, .7); backdrop-filter: blur(14px); }
.composer .cw { max-width: 860px; margin: 0 auto; display: grid; gap: 8px; }
.composer .mode { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.composer .box { display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--line-2); border-radius: 16px; background: rgba(0, 0, 0, .3); padding: 6px 6px 6px 8px; transition: border-color .15s, box-shadow .15s; }
.composer.as .box { border-color: rgba(195, 166, 255, .45); box-shadow: 0 0 0 3px rgba(195, 166, 255, .08); }
.composer.note .box { border-color: rgba(143, 180, 255, .45); border-style: dashed; }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; outline: none; padding: 8px 4px; max-height: 200px; min-height: 38px; font-size: 14.5px; line-height: 1.5; }
.composer .send { width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--grad); color: var(--acc-ink); display: grid; place-items: center; flex: none; }
.composer .send:disabled { opacity: .4; }
.composer .pend { display: flex; gap: 6px; flex-wrap: wrap; }
.composer .pend span { font-size: 12px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-2); display: inline-flex; gap: 6px; align-items: center; }
.composer .hint { font-size: 11.5px; color: var(--faint); }
.composer.locked { text-align: center; color: var(--muted); font-size: 13px; }
.noconv { flex: 1; display: grid; place-items: center; color: var(--faint); text-align: center; padding: 30px; }
.noconv img { width: 64px; opacity: .5; margin-bottom: 12px; }
.back { display: none; }
@media (min-width: 861px) { .hide-desk { display: none !important; } }

/* ── overlays ─────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(4, 3, 7, .7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 18px; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100% - 20px); overflow: auto; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 22px; animation: pop .22s var(--ease); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal h3 { margin: 0 0 4px; font: 600 18px var(--brand); }
.modal .sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.modal .acts { justify-content: flex-end; margin-top: 16px; }
.secret { font: 600 18px var(--mono); padding: 14px; border-radius: 12px; background: rgba(0, 0, 0, .4); border: 1px dashed var(--acc-line); color: var(--acc); text-align: center; letter-spacing: .5px; user-select: all; overflow-wrap: anywhere; }
.welcome { white-space: pre-wrap; font-size: 12.5px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 12px; padding: 12px; max-height: 220px; overflow: auto; margin-top: 10px; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: 20px; animation: fade .18s; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.lightbox iframe { width: min(1100px, 100%); height: min(80vh, 100%); border: 0; border-radius: 12px; background: #000; }
.lightbox .lx { position: absolute; top: calc(14px + var(--safe-t)); right: 14px; }
.lightbox .lcap { position: absolute; bottom: calc(18px + var(--safe-b)); left: 0; right: 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 0 14px; }
.search { position: fixed; inset: 0; z-index: 55; background: rgba(4, 3, 7, .75); backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: flex-start; padding: calc(70px + var(--safe-t)) 16px 16px; animation: fade .15s; }
.search .sbox { width: min(720px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow); overflow: hidden; }
.search .sin { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search .sin input { flex: 1; background: transparent; border: 0; outline: none; font-size: 16px; }
.search .res { overflow: auto; padding: 6px 0; }
.search .grp { font-size: 11px; color: var(--faint); letter-spacing: 1px; text-transform: uppercase; padding: 10px 16px 4px; }
.search .r { padding: 9px 16px; cursor: pointer; display: grid; gap: 2px; }
.search .r:hover, .search .r.sel { background: var(--acc-soft); }
.search .r .l1 { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.search .r .l2 { font-size: 13.5px; overflow-wrap: anywhere; }
.search mark { background: rgba(255, 181, 71, .3); color: var(--text); border-radius: 3px; padding: 0 1px; }
.viewas { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column; animation: fade .2s; }
.viewas .vb { display: flex; gap: 10px; align-items: center; padding: calc(8px + var(--safe-t)) 14px 8px; background: linear-gradient(90deg, rgba(195, 166, 255, .16), rgba(255, 181, 71, .12)); border-bottom: 1px solid var(--line-2); font-size: 13px; flex-wrap: wrap; }
.viewas .vb b { font-weight: 600; } .viewas .vb .grow { flex: 1; }
.viewas .frames { flex: 1; display: flex; justify-content: center; gap: 16px; padding: 0; min-height: 0; background: #050407; }
.viewas iframe { border: 0; width: 100%; height: 100%; background: var(--bg); }
.viewas.phone .frames { padding: 16px; }
.viewas.phone iframe { width: 400px; max-width: 100%; border-radius: 28px; border: 1px solid var(--line-3); box-shadow: var(--shadow); }
.toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(20px + var(--safe-b)); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--panel-solid); border: 1px solid var(--line-3); border-radius: 12px; padding: 10px 16px; font-size: 13px; box-shadow: var(--shadow); animation: pop .2s var(--ease); max-width: 90vw; }
.toast.bad { border-color: rgba(255, 122, 107, .45); color: var(--bad); }
.menu { position: fixed; z-index: 80; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); min-width: 210px; animation: pop .15s var(--ease); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 11px; border: 0; background: transparent; border-radius: 9px; text-align: left; font-size: 13.5px; }
.menu button:hover { background: var(--panel-3); }
.menu button.danger { color: var(--bad); }
.menu hr { border: 0; height: 1px; background: var(--line); margin: 5px 4px; }
.loading { display: grid; place-items: center; padding: 60px; color: var(--faint); }
.sec-title { font: 600 12px var(--brand); color: var(--muted); letter-spacing: 1.2px; text-transform: uppercase; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.audit td.d { white-space: normal; color: var(--muted); font-size: 12px; max-width: 460px; overflow-wrap: anywhere; }

/* ── phone ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) { .cols { grid-template-columns: minmax(0, 1fr); } .chats { grid-template-columns: 320px 1fr; } }
@media (max-width: 860px) {
  .hq { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: calc(10px + var(--safe-t)) 14px 10px; gap: 8px; }
  .top .tmark { display: block; }
  .top h2 { font-size: 17px; }
  .searchbtn { min-width: 0; padding: 7px; } .searchbtn span, .searchbtn kbd { display: none; }
  .livepill span { display: none; }
  .view { padding: 14px 14px calc(84px + var(--safe-b)); }
  .view.flush { padding: 0 0 calc(64px + var(--safe-b)); }
  .tabs { display: flex; position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + var(--safe-b)); background: rgba(10, 8, 14, .88); backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
  .tabs a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); font-size: 10.5px; font-weight: 500; position: relative; border-radius: 10px; }
  .tabs a.on { color: var(--acc); }
  .tabs a .badge { position: absolute; top: 0; left: calc(50% + 6px); height: 17px; min-width: 17px; font-size: 10px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi .v { font-size: 23px; }
  .chats { grid-template-columns: 1fr; }
  .chats.open .clist { display: none; } .chats:not(.open) .conv { display: none; }
  .back { display: inline-grid; }
  .hq.inconv .tabs { display: none; } .hq.inconv .view.flush { padding-bottom: 0; }
  .conv .ch h3 { display: none; } .conv .ch .tt { min-width: 0; }
  .conv .ch { padding: 10px 12px; } .thread { padding: 16px 12px 24px; }
  .conv .stats { padding: 8px 12px; }
  .composer { padding-bottom: 10px; }
  .pgrid { grid-template-columns: 1fr; }
  .wgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dt { margin-top: 8px; }
  .limrow { grid-template-columns: 1fr 1fr 1fr; }
  .modal { padding: 18px; }
  .viewas.phone .frames { padding: 0; } .viewas.phone iframe { width: 100%; border-radius: 0; border: 0; }
  .search { padding-top: calc(12px + var(--safe-t)); }
  .hide-phone { display: none !important; }
}
