/* ============ tokens ============ */
:root {
  --bg: #0d0e11;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, rgba(201,164,106,.07), transparent 60%), radial-gradient(900px 500px at 0% 110%, rgba(184,122,75,.05), transparent 60%);
  --surface: #15161b;
  --surface-2: #1b1d23;
  --surface-3: #22242b;
  --line: rgba(255,255,255,.07);
  --line-2: rgba(255,255,255,.12);
  --text: #ece8e1;
  --text-2: #c4bfb6;
  --muted: #8f8a81;
  --gold: #c9a46a;
  --gold-2: #e2c48f;
  --gold-soft: rgba(201,164,106,.12);
  --copper: #b87a4b;
  --on-gold: #1a1408;
  --ok: #7fb89a;   --ok-soft: rgba(127,184,154,.13);
  --info: #86a9d6; --info-soft: rgba(134,169,214,.13);
  --warn: #d9b26a; --warn-soft: rgba(217,178,106,.14);
  --err: #d9826f;  --err-soft: rgba(217,130,111,.14);
  --idle: #8b8984; --idle-soft: rgba(139,137,132,.14);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --num: "IBM Plex Sans Arabic", ui-monospace, monospace;
  --pad: 24px;
  --row: 14px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f2ec;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, rgba(201,164,106,.14), transparent 60%);
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --surface-3: #f1ede6;
  --line: rgba(30,25,15,.08);
  --line-2: rgba(30,25,15,.15);
  --text: #1f1c17;
  --text-2: #3d3830;
  --muted: #7a7366;
  --gold: #9a7438;
  --gold-2: #7d5c27;
  --gold-soft: rgba(154,116,56,.1);
  --on-gold: #fff;
  --ok: #3e8a64; --info: #3f6fa8; --warn: #a77a20; --err: #b5523c; --idle: #77746d;
  --shadow: 0 10px 30px rgba(60,45,20,.08);
  color-scheme: light;
}
:root[data-density="compact"] { --pad: 16px; --row: 9px; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.6; color: var(--text);
  background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.005em; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ============ shell ============ */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 22px 16px; border-inline-end: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 17px;
  color: var(--on-gold); background: linear-gradient(140deg, var(--gold-2), var(--copper));
  box-shadow: 0 6px 18px rgba(201,164,106,.25), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand b { display: block; font-size: 15px; }
.brand span { font-size: 11.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-2);
  transition: background .15s, color .15s; position: relative;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--gold-soft); color: var(--gold-2); font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; inset-inline-start: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--gold); }
.nav .count { margin-inline-start: auto; font-size: 11px; padding: 0 7px; border-radius: 999px; background: var(--err-soft); color: var(--err); font-family: var(--num); }
.side-sep { height: 1px; background: var(--line); margin: 14px 8px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.me b { display: block; font-size: 13px; }
.me span { font-size: 11.5px; color: var(--muted); }
.me button { margin-inline-start: auto; }

.main { min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.topbar h1 { font-size: 24px; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mobile-bar, .bottom-nav { display: none; }

/* ============ primitives ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-gold { background: linear-gradient(140deg, var(--gold-2), var(--gold)); border-color: transparent; color: var(--on-gold); font-weight: 600; box-shadow: 0 6px 18px rgba(201,164,106,.18); }
.btn-gold:hover { background: linear-gradient(140deg, var(--gold-2), var(--gold-2)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); background: transparent; }
.btn-danger:hover { background: var(--err-soft); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.btn .spin { width: 15px; height: 15px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--pad); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; }
.card-head a { color: var(--gold); font-size: 13px; }
.grid { display: grid; gap: 18px; align-content: start; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--err); min-height: 0; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 96px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.field.invalid .input, .field.invalid .textarea, .field.invalid .select, .field.invalid .agent-picker { border-color: var(--err); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: 14px 50%, 19px 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-start: 30px; }
.select option { background: var(--surface); }
input[type="date"].input { min-height: 42px; }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.seg button.on[data-tone] { color: var(--tone); }

.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); cursor: pointer; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + span { background: var(--gold-soft); border-color: var(--gold); }
.switch input:checked + span::after { background: var(--gold); transform: translateX(-18px); }
:root[dir="ltr"] .switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--gold-soft); }

/* badges / pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--tone-soft, var(--surface-3)); color: var(--tone, var(--text-2)); }
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live .d { box-shadow: 0 0 0 0 currentColor; animation: ping 1.8s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
.t-ok { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.t-info { --tone: var(--info); --tone-soft: var(--info-soft); }
.t-warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.t-err { --tone: var(--err); --tone-soft: var(--err-soft); }
.t-idle { --tone: var(--idle); --tone-soft: var(--idle-soft); }
.t-gold { --tone: var(--gold-2); --tone-soft: var(--gold-soft); }
.demo-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 6px; border: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent); color: var(--warn); white-space: nowrap; font-weight: 500; }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--tone); white-space: nowrap; }
.prio i { display: inline-flex; gap: 2px; }
.prio i b { width: 3px; height: 10px; border-radius: 2px; background: currentColor; opacity: .25; }
.prio i b.f { opacity: 1; }

.avatar {
  --s: 34px; width: var(--s); height: var(--s); border-radius: 30%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: calc(var(--s) * .42); color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); position: relative;
}
.avatar .st { position: absolute; bottom: -2px; inset-inline-start: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--tone); border: 2px solid var(--surface); }
.avatars { display: inline-flex; }
.avatars .avatar { --s: 26px; margin-inline-start: -7px; border: 2px solid var(--surface); }
.avatars .avatar:first-child { margin-inline-start: 0; }

.bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 6px; background: var(--tone, var(--gold)); transition: width .4s; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }

/* banners */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 13.5px; background: var(--tone-soft); border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent); color: var(--text); flex-wrap: wrap; }
.banner > svg { color: var(--tone); }
.banner a { color: var(--tone); font-weight: 600; margin-inline-start: auto; }

/* empty / loading */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .ico { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.empty .ico svg { width: 24px; height: 24px; }
.empty h4 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty p { margin: 0 0 14px; font-size: 13px; }
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.error-box { text-align: center; padding: 40px 20px; }
.error-box .ico { background: var(--err-soft); color: var(--err); }

/* ============ dashboard ============ */
.hello { margin-bottom: 22px; }
.hello h1 { font-size: 26px; }
.hello h1 em { font-style: normal; color: var(--gold-2); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat { position: relative; overflow: hidden; }
.stat .lbl { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.stat .lbl svg { color: var(--tone, var(--gold)); }
.stat .val { font-size: 34px; font-weight: 600; line-height: 1.2; margin: 8px 0 4px; font-family: var(--num); }
.stat .foot { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.stat .foot b { color: var(--text-2); font-weight: 500; }
.stat::after { content: ""; position: absolute; inset-inline-end: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tone, var(--gold)) 16%, transparent), transparent 70%); }
.dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.kpi { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.kpi .v { font-size: 22px; font-weight: 600; font-family: var(--num); }
.kpi .v small { font-size: 13px; color: var(--muted); font-weight: 400; margin-inline-start: 3px; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi .bar { margin-top: 8px; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 8px; }
.chart .ccol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.chart .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.chart .bars span { width: min(14px, 40%); border-radius: 4px 4px 2px 2px; min-height: 2px; }
.chart .bars .c { background: color-mix(in srgb, var(--gold) 40%, transparent); }
.chart .bars .d { background: var(--ok); }
.chart .day { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 5px; vertical-align: middle; }
.agent-mix { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 6px 0 12px; }
.agent-mix span { background: var(--tone); }
.mix-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13px; }
.mix-legend div { display: flex; align-items: center; gap: 8px; }
.mix-legend b { margin-inline-start: auto; font-family: var(--num); }

/* rows (task / activity) */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: var(--row) 4px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; transition: background .12s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row .main-col { flex: 1; min-width: 0; }
.row .title { font-weight: 500; }
.row .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.due-late { color: var(--err); }

/* timeline */
.timeline { position: relative; }
.tl-day { font-size: 12px; color: var(--muted); font-weight: 600; margin: 18px 0 8px; display: flex; align-items: center; gap: 10px; }
.tl-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tl-day:first-child { margin-top: 0; }
.tl-item { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 10px 0; position: relative; }
.tl-item::before { content: ""; position: absolute; inset-inline-start: 15px; top: 42px; bottom: -10px; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--tone-soft); color: var(--tone); }
.tl-ico svg { width: 16px; height: 16px; }
.tl-item.t-err .tl-body, .tl-item.t-warn .tl-body { background: var(--tone-soft); border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent); padding: 10px 12px; border-radius: 10px; }
.tl-msg { font-weight: 500; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin-top: 3px; align-items: center; }
.tl-meta a { color: var(--gold); }
.tl-meta .who { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
.tl-meta .who i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
details.tl-details { margin-top: 6px; }
details.tl-details summary { cursor: pointer; font-size: 12px; color: var(--text-2); list-style: none; display: inline-flex; gap: 4px; align-items: center; }
details.tl-details summary::-webkit-details-marker { display: none; }
details.tl-details summary::before { content: "◂"; font-size: 10px; transition: transform .15s; }
details.tl-details[open] summary::before { transform: rotate(-90deg); }
details.tl-details pre { margin: 8px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; white-space: pre-wrap; word-break: break-word; direction: auto; font-family: ui-monospace, Menlo, monospace; max-height: 260px; overflow: auto; }

/* ============ agents ============ */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .search { position: relative; flex: 1 1 240px; max-width: 360px; }
.toolbar .search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search .input { padding-inline-start: 38px; }
.toolbar .select, .toolbar .input[type="date"] { width: auto; min-width: 140px; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.agent-card { display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: border-color .15s, transform .15s; }
.agent-card:hover { border-color: color-mix(in srgb, var(--gold) 40%, transparent); transform: translateY(-2px); }
.agent-card .top { display: flex; gap: 12px; align-items: flex-start; }
.agent-card .avatar { --s: 46px; }
.agent-card h3 { font-size: 15.5px; }
.agent-card .role { color: var(--muted); font-size: 13px; }
.agent-card .top .pill { margin-inline-start: auto; }
.agent-card .avail { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.agent-card .avail div:first-child { display: flex; justify-content: space-between; color: var(--muted); }
.agent-card .foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.agent-card .foot b { color: var(--text); font-family: var(--num); }
.agent-card .last { font-size: 12.5px; color: var(--text-2); }

.profile { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile .avatar { --s: 72px; border-radius: 22px; }
.profile h1 { font-size: 24px; }
.profile .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 18px; margin-top: 20px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mini-stats div { padding: 12px; border-radius: 10px; background: var(--surface-2); text-align: center; }
.mini-stats b { display: block; font-size: 22px; font-family: var(--num); }
.mini-stats span { font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.back:hover { color: var(--gold); }

/* ============ tasks ============ */
.table-wrap { overflow-x: auto; }
table.tasks { width: 100%; border-collapse: collapse; }
table.tasks th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 500; padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tasks td { padding: var(--row) 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tasks tr:last-child td { border-bottom: 0; }
table.tasks tbody tr { cursor: pointer; transition: background .12s; }
table.tasks tbody tr:hover { background: var(--surface-2); }
table.tasks .t-title { font-weight: 500; }
table.tasks .t-desc { font-size: 12.5px; color: var(--muted); max-width: 420px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 200px; transition: border-color .15s, background .15s; }
.col.drop { border-color: var(--gold); background: var(--gold-soft); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 12px; font-weight: 600; font-size: 13.5px; }
.col-head .n { margin-inline-start: auto; font-family: var(--num); color: var(--muted); font-weight: 400; }
.col-head .d { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.col-list { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.kcard { padding: 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); cursor: grab; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, opacity .15s; }
.kcard:hover { border-color: var(--line-2); }
.kcard.dragging { opacity: .4; }
.kcard .title { font-weight: 500; font-size: 13.5px; }
.kcard .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.col-empty { text-align: center; font-size: 12.5px; color: var(--muted); padding: 18px 0; border: 1px dashed var(--line-2); border-radius: 10px; }

/* ============ modal / drawer ============ */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5,5,8,.6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: pop .2s ease; }
.modal.sm { width: min(420px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-start; border-top: 1px solid var(--line); }
.modal-foot .spacer { flex: 1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.overlay.drawer-wrap { place-items: stretch; justify-items: start; padding: 0; }
.drawer { width: min(520px, 100%); height: 100%; overflow-y: auto; background: var(--surface); border-inline-end: 1px solid var(--line-2); animation: slide .25s ease; display: flex; flex-direction: column; }
@keyframes slide { from { transform: translateX(-30px); opacity: 0; } }
.drawer .modal-body { flex: 1; }
.drawer h2 { font-size: 19px; line-height: 1.45; }
.status-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.status-steps button { padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.status-steps button.on { background: var(--tone-soft); color: var(--tone); border-color: color-mix(in srgb, var(--tone) 45%, transparent); font-weight: 600; }
.result-box { white-space: pre-wrap; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }

.agent-picker { border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); padding: 8px; }
.agent-picker .input { margin-bottom: 8px; padding: 8px 10px; }
.agent-picker .opts { max-height: 210px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.agent-opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.agent-opt:hover { background: var(--surface-3); }
.agent-opt input { accent-color: var(--gold); width: 16px; height: 16px; }
.agent-opt .avatar { --s: 28px; }
.agent-opt .nm { font-size: 13.5px; font-weight: 500; }
.agent-opt .rl { font-size: 12px; color: var(--muted); }
.agent-opt .pill { margin-inline-start: auto; }
.agent-opt.disabled { opacity: .55; }

/* toasts */
.toasts { position: fixed; z-index: 80; bottom: 20px; inset-inline-start: 20px; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop .2s ease; font-size: 13.5px; }
.toast svg { color: var(--tone); margin-top: 2px; }
.toast .x { margin-inline-start: auto; cursor: pointer; color: var(--muted); background: none; border: 0; padding: 0; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(400px, 100%); padding: 32px; }
.login .brand { padding: 0 0 22px; justify-content: center; }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login .form-err { color: var(--err); font-size: 13px; min-height: 18px; }

/* settings */
.settings { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px; align-items: start; }
.settings-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 9px 12px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; }
.settings-nav a:hover { background: var(--surface-2); }
.settings-nav a.on { background: var(--gold-soft); color: var(--gold-2); }
.settings section { scroll-margin-top: 20px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .t { font-weight: 500; }
.set-row .d { font-size: 12.5px; color: var(--muted); }
.conn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.conn { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.conn .l { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.code { direction: ltr; text-align: left; font-family: ui-monospace, Menlo, monospace; font-size: 12px; padding: 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-all; }
.token-box { display: flex; gap: 8px; align-items: center; }
.token-box .code { flex: 1; padding: 9px 12px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }

/* ============ responsive ============ */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash, .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 14px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .mobile-bar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; margin: -14px -16px 14px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .mobile-bar .brand { padding: 0; }
  .mobile-bar .brand-mark { width: 32px; height: 32px; font-size: 15px; }
  .mobile-bar .spacer { flex: 1; }
  .bottom-nav { display: flex; position: fixed; z-index: 30; bottom: 0; inset-inline: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11px; color: var(--muted); border-radius: 10px; position: relative; }
  .bottom-nav a.on { color: var(--gold-2); }
  .bottom-nav a.on::before { content: ""; position: absolute; top: -6px; width: 26px; height: 3px; border-radius: 3px; background: var(--gold); }
  .bottom-nav .count { position: absolute; top: 2px; inset-inline-end: calc(50% - 20px); font-size: 9.5px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--err); color: #fff; display: grid; place-items: center; font-family: var(--num); }
  .topbar h1 { font-size: 20px; }
  .topbar .top-actions .btn-gold { display: none; }
  .stats { gap: 10px; }
  .stat .val { font-size: 28px; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
  .conn-grid { grid-template-columns: 1fr; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .toolbar .select, .toolbar .input[type="date"] { flex: 1 1 140px; }
  table.tasks thead { display: none; }
  table.tasks, table.tasks tbody, table.tasks tr, table.tasks td { display: block; width: 100%; }
  table.tasks tr { padding: 12px 4px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
  table.tasks td { padding: 0; border: 0; }
  table.tasks td.c-title { grid-column: 1 / -1; }
  table.tasks td.c-updated { display: none; }
  .two { grid-template-columns: 1fr; }
  .overlay { place-items: end stretch; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .drawer { width: 100%; }
  .toasts { inset-inline: 16px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: auto; }
  .profile .actions { margin-inline-start: 0; width: 100%; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .val { font-size: 24px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .mix-legend { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* sticky modal chrome + RTL drawer entrance */
.modal .modal-head, .drawer .modal-head { position: sticky; top: 0; z-index: 2; background: var(--surface); padding-bottom: 12px; }
.modal .modal-foot, .drawer .modal-foot { position: sticky; bottom: 0; z-index: 2; background: var(--surface); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.i-sm { width: 13px; height: 13px; vertical-align: -2px; }

/* =====================================================================
   v3 shell: top app bar + office
   ===================================================================== */
:root { --appbar-h: 62px; --bnav-h: 0px; --glass-bg: rgba(18, 18, 23, .78); --glass-line: rgba(255, 255, 255, .09); }
:root[data-theme="light"] { --glass-bg: rgba(255, 255, 255, .86); --glass-line: rgba(30, 25, 15, .1); }
:root[dir="ltr"] .i.flip { transform: scaleX(-1); }
:root[dir="ltr"] .switch input:checked + span::after { transform: translateX(18px); }
.sidebar, .mobile-bar { display: none !important; }

.appbar {
  position: sticky; top: 0; z-index: 40; height: calc(var(--appbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) clamp(12px, 2vw, 24px) 0; display: flex; align-items: center; gap: 18px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.appbar .brand { padding: 0; flex: none; }
.appbar .brand-mark { width: 36px; height: 36px; font-size: 16px; }
.brand-text b { display: block; font-size: 14.5px; line-height: 1.2; }
.brand-text span { font-size: 11px; color: var(--muted); }
.topnav { display: flex; gap: 2px; margin-inline: auto; }
.topnav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 10px; color: var(--text-2); font-size: 13.5px; position: relative; white-space: nowrap; }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a.on { background: var(--gold-soft); color: var(--gold-2); font-weight: 600; }
.topnav a.on::after { content: ""; position: absolute; inset-inline: 14px; bottom: -11px; height: 2px; border-radius: 2px; background: var(--gold); }
.topnav .count { font-size: 10.5px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--err-soft); color: var(--err); font-family: var(--num); text-align: center; }
.appbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.appbar-actions .short { display: none; }
.lang-btn { font-weight: 600; letter-spacing: .01em; border: 1px solid var(--line-2); }
.me { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
:root[dir="rtl"] .me { padding: 4px 10px 4px 4px; }
.me .avatar { --s: 30px; }
.me-text { max-width: 120px; line-height: 1.25; }
.me-text b { display: block; font-size: 12.5px; }
.me-text span { font-size: 11px; color: var(--muted); }
.me button { margin: 0; width: 32px; height: 32px; }

.main { padding: 26px clamp(16px, 3vw, 40px) 60px; max-width: 1480px; margin: 0 auto; min-height: calc(100vh - var(--appbar-h)); }
body.route-office .main { padding: 0; max-width: none; }
body.route-office { overflow: hidden; }
.page { padding: 0; }

/* ---------- office ---------- */
.office { position: relative; height: calc(100dvh - var(--appbar-h) - var(--bnav-h) - env(safe-area-inset-top, 0px)); overflow: hidden; background: #0b0b0e; color: var(--text); isolation: isolate; }
.office-stage { position: absolute; inset: 0; }
.office-stage canvas { display: block; outline: none; touch-action: none; }
.glass { background: var(--glass-bg); border: 1px solid var(--glass-line); backdrop-filter: blur(12px); }
.of-top { position: absolute; z-index: 5; top: 14px; inset-inline-start: 14px; inset-inline-end: 380px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; pointer-events: none; }
.of-top > * { pointer-events: auto; }
.of-kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.kchip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 12px; background: var(--glass-bg); border: 1px solid var(--glass-line); backdrop-filter: blur(12px); font-size: 12.5px; color: var(--text-2); min-height: 38px; transition: border-color .15s; }
.kchip:hover { border-color: color-mix(in srgb, var(--tone, var(--gold)) 50%, transparent); }
.kchip svg { color: var(--tone, var(--gold)); width: 16px; height: 16px; }
.kchip b { font-size: 17px; color: var(--text); font-weight: 600; }
.kchip.skel { height: 38px; }
.of-sync .pill { background: var(--glass-bg); border: 1px solid var(--glass-line); backdrop-filter: blur(10px); padding: 4px 10px; }
.of-notes { display: flex; flex-direction: column; gap: 6px; max-width: min(620px, 100%); }
.note { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; font-size: 12px; background: var(--glass-bg); border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent); backdrop-filter: blur(10px); color: var(--text-2); }
.note > svg { color: var(--tone); width: 15px; height: 15px; }
.note span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.note a { color: var(--tone); font-weight: 600; white-space: nowrap; margin-inline-start: auto; }

.of-panel { position: absolute; z-index: 6; top: 14px; inset-inline-end: 14px; width: 350px; max-height: calc(100% - 28px); display: flex; flex-direction: column; border-radius: 16px; background: var(--glass-bg); border: 1px solid var(--glass-line); backdrop-filter: blur(14px); box-shadow: 0 18px 50px rgba(0,0,0,.35); overflow: hidden; }
.of-panel:not(.open) { width: auto; }
.of-panel:not(.open) .of-panel-body { display: none; }
.of-panel-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; background: none; border: 0; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--text); }
.of-panel-toggle svg { color: var(--gold); }
.of-panel-toggle .count { margin-inline-start: auto; font-size: 11px; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--err-soft); color: var(--err); font-family: var(--num); }
.of-panel-body { overflow-y: auto; padding: 0 14px 14px; display: flex; flex-direction: column; gap: 16px; border-top: 1px solid var(--glass-line); }
.of-panel-body section { padding-top: 12px; }
.ph { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.ph h3 { font-size: 13px; }
.ph a { font-size: 12px; color: var(--gold); }
.of-panel .row { padding: 8px 4px; }
.timeline.compact .tl-item { padding: 6px 0; grid-template-columns: 26px 1fr; gap: 9px; }
.timeline.compact .tl-ico { width: 26px; height: 26px; border-radius: 8px; }
.timeline.compact .tl-item::before { inset-inline-start: 12px; top: 34px; }
.timeline.compact .tl-msg { font-size: 12.5px; }
.timeline.compact .tl-meta { font-size: 11px; }
.timeline.compact .tl-item.t-err .tl-body, .timeline.compact .tl-item.t-warn .tl-body { padding: 7px 9px; }

.of-controls { position: absolute; z-index: 5; bottom: 14px; inset-inline-start: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: calc(100% - 400px); }
.of-controls .seg { background: var(--glass-bg); border-color: var(--glass-line); backdrop-filter: blur(12px); }
.of-btns { display: flex; gap: 6px; }
.ctl { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; cursor: pointer; color: var(--text-2); background: var(--glass-bg); border: 1px solid var(--glass-line); backdrop-filter: blur(12px); transition: border-color .15s, color .15s; }
.ctl:hover { border-color: var(--gold); color: var(--text); }
.ctl.on { color: var(--gold-2); border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.of-legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border-radius: 11px; background: var(--glass-bg); border: 1px solid var(--glass-line); backdrop-filter: blur(12px); font-size: 11.5px; color: var(--text-2); }
.of-legend span { display: inline-flex; align-items: center; gap: 6px; cursor: help; }
.of-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.of-hint { position: absolute; z-index: 4; bottom: 18px; inset-inline-end: 380px; pointer-events: none; text-shadow: 0 1px 2px #000; }
.of-loading { position: absolute; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 14px; background: #0b0b0e; color: var(--muted); transition: opacity .6s; }
.of-loading.off { opacity: 0; pointer-events: none; }
.of-loading .error-box { color: var(--text); }
.loader-orb { width: 48px; height: 48px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4dc, #e2c48f 40%, #b87a4b); box-shadow: 0 0 40px rgba(226,196,143,.6); animation: orbPulse 1.4s ease-in-out infinite; }
@keyframes orbPulse { 50% { transform: scale(.88); opacity: .7; } }

/* 3D labels */
.zone-label { pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 12px 7px; border-radius: 10px; background: rgba(14,14,18,.82); border: 1px solid color-mix(in srgb, var(--zc) 45%, transparent); border-top: 3px solid var(--zc); color: #ece8e1; font-family: var(--font); white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,.4); transition: transform .15s, border-color .15s; transform: translateY(-50%); }
.zone-label:hover, .zone-label.sel { border-color: var(--zc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--zc) 25%, transparent), 0 6px 20px rgba(0,0,0,.4); }
.zone-label b { font-size: 13px; color: color-mix(in srgb, var(--zc) 70%, #fff); }
.zone-label span { font-size: 10.5px; color: #b9b3a8; }
.zone-label em { font-style: normal; font-size: 10.5px; color: #f0a08c; display: inline-flex; align-items: center; gap: 3px; }
.zone-label.hub { border-top-width: 1px; border-radius: 999px; padding: 5px 14px; }
.agent-tag { pointer-events: auto; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 3px; border-radius: 999px; background: rgba(14,14,18,.85); border: 1px solid rgba(255,255,255,.12); color: #ece8e1; font: 500 11px var(--font); white-space: nowrap; transform: translateY(-50%); transition: padding .15s; }
.agent-tag .st { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--sc); color: #111; font-size: 10px; font-weight: 700; position: relative; }
.agent-tag .nm { display: none; padding-inline-end: 6px; }
.agent-tag.named .nm { display: inline; }
.agent-tag.named { padding-inline-start: 3px; }
.agent-tag.s-available { --sc: #7fb89a; } .agent-tag.s-working { --sc: #86a9d6; } .agent-tag.s-waiting { --sc: #d9b26a; } .agent-tag.s-paused { --sc: #8b8984; } .agent-tag.s-attention { --sc: #e08872; }
.agent-tag.s-working .st::after { content: "•••"; font-size: 8px; letter-spacing: -1px; color: #0e1b2c; animation: typing 1.2s infinite; }
.agent-tag.s-waiting .st::after { content: "⏳"; font-size: 9px; }
.agent-tag.s-paused .st::after { content: "❚❚"; font-size: 6.5px; color: #222; }
.agent-tag.s-attention .st::after { content: "!"; color: #2a0b05; }
.agent-tag.s-attention .st { animation: alertPulse 1.4s infinite; }
.agent-tag.s-available .st::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #0f2a1d; }
.agent-tag.meeting { border-color: rgba(201,164,106,.6); }
@keyframes typing { 50% { opacity: .35; } }
@keyframes alertPulse { 0% { box-shadow: 0 0 0 0 rgba(224,136,114,.7); } 70%, 100% { box-shadow: 0 0 0 7px rgba(224,136,114,0); } }
.fx-float { font: 700 22px var(--font); padding: 2px 10px; border-radius: 999px; pointer-events: none; }
.fx-float.ok { color: #0f2a1d; background: #7fb89a; box-shadow: 0 0 22px rgba(127,184,154,.8); }
.fx-float.err { color: #2a0b05; background: #e08872; box-shadow: 0 0 22px rgba(224,136,114,.8); }
.meeting-label { font: 500 11.5px var(--font); color: #f3e3c4; padding: 4px 10px; border-radius: 8px; background: rgba(14,14,18,.85); border: 1px solid rgba(201,164,106,.5); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .agent-tag .st, .agent-tag .st::after { animation: none !important; } }

/* agent card */
.ag-pop { position: absolute; z-index: 8; width: 300px; padding: 14px; border-radius: 16px; background: var(--glass-bg); border: 1px solid var(--glass-line); border-top: 3px solid var(--zc); backdrop-filter: blur(16px); box-shadow: 0 20px 50px rgba(0,0,0,.5); animation: pop .18s ease; }
.ag-pop.sheet { position: absolute; left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; }
.ag-pop .close, .zone-card .close { position: absolute; top: 8px; inset-inline-end: 8px; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.ag-pop .close:hover, .zone-card .close:hover { background: var(--surface-3); color: var(--text); }
.ac-head { display: flex; gap: 10px; align-items: center; padding-inline-end: 26px; }
.ac-head .avatar { --s: 42px; }
.ac-head h3 { font-size: 15px; }
.ac-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.zone-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--zc) 16%, transparent); color: color-mix(in srgb, var(--zc) 75%, var(--text)); }
.zone-tag i { width: 7px; height: 7px; border-radius: 2px; background: var(--zc); }
.ac-hint { margin: 8px 0 0; }
.ac-task { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.ac-task-link { font-weight: 500; color: var(--text); }
.ac-task-link:hover { color: var(--gold-2); }
.ac-actions { display: flex; gap: 8px; margin-top: 12px; }
.ac-actions > * { flex: 1; }

/* zone card */
.zone-card { position: absolute; z-index: 7; top: 132px; inset-inline-start: 14px; width: 330px; max-height: calc(100% - 210px); overflow-y: auto; padding: 14px; border-radius: 16px; background: var(--glass-bg); border: 1px solid var(--glass-line); border-top: 3px solid var(--zc); backdrop-filter: blur(16px); box-shadow: 0 20px 50px rgba(0,0,0,.45); animation: pop .18s ease; }
.zc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-inline-end: 28px; margin-bottom: 8px; }
.zc-head i { width: 12px; height: 12px; border-radius: 4px; background: var(--zc); box-shadow: 0 0 12px var(--zc); }
.zc-head h3 { font-size: 16px; }
.zc-head .muted { flex-basis: 100%; }
.zc-sec { font-size: 12px; color: var(--muted); margin: 12px 0 6px; font-weight: 600; }
.zc-members { display: flex; flex-direction: column; gap: 2px; }
.zl-agent { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 6px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; text-align: start; }
.zl-agent:hover { background: var(--surface-2); }
.zl-agent .avatar { --s: 30px; }
.zl-agent .main-col { flex: 1; min-width: 0; }
.zl-agent .title { font-size: 13px; font-weight: 500; }
.zl-agent .meta { font-size: 11.5px; color: var(--muted); }

/* list view */
.office-list { position: absolute; inset: 0; overflow-y: auto; padding: 150px 16px 90px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-content: start; background: var(--bg); }
body.route-office .office-list { padding-inline-end: 380px; }
.zl { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--zc); overflow: hidden; }
.zl header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 14px; }
.zl header i { width: 10px; height: 10px; border-radius: 3px; background: var(--zc); }
.zl header h3 { font-size: 14.5px; }
.zl header button { margin-inline-start: auto; }
.zl header .muted { flex-basis: 100%; order: 3; }
.zl .zl-agent { padding: 9px 14px; border-radius: 0; border-top: 1px solid var(--line); }
.zone-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.zone-opt { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-size: 13.5px; }
.zone-opt::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--zc); }
.zone-opt input { position: absolute; opacity: 0; pointer-events: none; }
.zone-opt small { margin-inline-start: auto; color: var(--muted); font-family: var(--num); }
.zone-opt:has(input:checked) { border-color: var(--zc); background: color-mix(in srgb, var(--zc) 14%, var(--surface-2)); }
.zone-opt:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--gold-soft); }

@media (max-width: 1100px) {
  .topnav a span { display: none; }
  .topnav a { padding: 8px 11px; }
  .me-text { display: none; }
}
@media (max-width: 860px) {
  :root { --appbar-h: 56px; --bnav-h: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .topnav { display: none; }
  .appbar { gap: 8px; }
  .brand-text span { display: none; }
  .appbar-actions { margin-inline-start: auto; }
  .appbar-actions .full { display: none; }
  .appbar-actions .short { display: inline; }
  .me { padding: 0 !important; background: none; border: 0; }
  .me .avatar { display: none; }
  .main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav { display: flex; position: fixed; z-index: 30; bottom: 0; inset-inline: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .of-top { inset-inline-end: 14px; top: 10px; inset-inline-start: 10px; }
  .of-kpis { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .kchip { padding: 6px 10px; min-height: 34px; flex: none; }
  .kchip span { font-size: 11px; }
  .note span { -webkit-line-clamp: 1; }
  .of-panel { top: auto; bottom: 10px; inset-inline: 10px; width: auto; max-height: 60%; }
  .of-panel:not(.open) { inset-inline-start: auto; }
  .of-controls { bottom: 66px; inset-inline-start: 10px; max-width: calc(100% - 20px); gap: 6px; }
  .of-legend { display: none; }
  .zone-card { top: auto; bottom: 66px; inset-inline: 10px; width: auto; max-height: 55%; }
  .ag-pop.sheet { bottom: 66px; }
  .office-list, body.route-office .office-list { padding: 120px 12px 130px; grid-template-columns: 1fr; }
  .of-controls .seg button span { display: none; }
}
@media (max-width: 420px) {
  .brand-text { display: none; }
}

/* v3 fixes */
.office-stage { z-index: 0; }
.of-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.of-notes { flex-direction: row; flex-wrap: wrap; max-width: none; }
.note { padding: 4px 10px; font-size: 11.5px; border-radius: 999px; }
.note span { -webkit-line-clamp: 1; }
a.note:hover { border-color: var(--tone); color: var(--text); }
.zone-label { transform: translate(0, -100%); }
:root[dir="rtl"] .zone-label, :root[dir="ltr"] .zone-label { transform: translateY(-100%); }
.of-hint { bottom: 62px; inset-inline-end: auto; inset-inline-start: 16px; }
.office-list { grid-auto-rows: max-content; }
[dir="auto"] { text-align: match-parent; }
.select { padding-inline-start: 12px; padding-inline-end: 30px; }
:root[dir="ltr"] .select { background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; }
@media (max-width: 860px) {
  .zone-label { padding: 3px 8px; }
  .zone-label span, .zone-label em { display: none; }
  .zone-label b { font-size: 11px; }
  .of-hint { display: none; }
}

/* =====================================================================
   v4: jobs, applications, CV, decks, skill forms
   ===================================================================== */
.jb-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
.jb-tabs button { white-space: nowrap; padding: 8px 14px; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; padding: 6px 4px; }
.chk input { accent-color: var(--gold); width: 16px; height: 16px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.job-list { display: flex; flex-direction: column; gap: 12px; }
.job { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: start; padding: 18px; }
.job.dismissed { opacity: .6; }
.job.saved { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.job-score { width: 58px; height: 58px; border-radius: 50%; display: grid; place-content: center; grid-auto-flow: column; align-items: baseline;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; }
.job-score::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.job-score b, .job-score span { position: relative; }
.job-score b { font-size: 17px; }
.job-score span { font-size: 10px; color: var(--muted); }
.job h3 { font-size: 15.5px; margin-bottom: 4px; }
.job-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); align-items: center; }
.job-ex { font-size: 13px; color: var(--text-2); margin: 10px 0; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job .chips { margin-bottom: 8px; }
.job-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 6px; }
.job-foot .src { font-size: 12.5px; color: var(--gold); display: inline-flex; align-items: center; gap: 5px; }
.job-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 150px; }
.job-actions .on { color: var(--gold-2); }

.app-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.app-row:last-child { border-bottom: 0; }
.app-row .main-col { flex: 1 1 260px; min-width: 0; }
.app-row .title { font-weight: 600; }
.app-row .meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.app-status { width: auto; min-width: 150px; color: var(--tone, var(--text)); }
.app-actions { display: flex; gap: 6px; }

.pf-item { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 12px; }
.pf-item .pf-del { justify-self: start; color: var(--err); }
.sticky-save { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(8px); }
.banner.t-gold { --tone: var(--gold-2); --tone-soft: var(--gold-soft); }

/* skill section in task form */
.skill-box { border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); background: var(--gold-soft); border-radius: 14px; padding: 14px; display: grid; gap: 12px; }
.skill-box h4 { font-size: 13.5px; color: var(--gold-2); display: flex; align-items: center; gap: 6px; }
.skill-box .banner { margin: 0; }
.upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.up-prev { display: inline-flex; align-items: center; gap: 8px; }
.up-prev img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-2); }

/* outputs in task drawer */
.out-box { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.out-list { margin: 0 0 10px; padding-inline-start: 18px; font-size: 13px; color: var(--text-2); display: grid; gap: 4px; }
.out-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.result-box.post { line-height: 1.8; }

/* CV page */
.cv-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cv-toolbar .back { margin: 0; }
.cv-info { max-width: 820px; margin: 0 auto 18px; display: grid; gap: 12px; }
.cv-notes { margin: 4px 0 0; padding-inline-start: 18px; font-size: 13px; color: var(--text-2); }
.cv-sheet { max-width: 820px; margin: 0 auto 18px; background: #fff; color: #1d1d1f; border-radius: 6px; padding: 48px 54px; box-shadow: 0 20px 60px rgba(0,0,0,.35); font-size: 13.5px; line-height: 1.6; }
.cv-sheet[lang="en"] { font-family: "IBM Plex Sans Arabic", "Segoe UI", Helvetica, Arial, sans-serif; }
.cv-head { border-bottom: 2px solid #1d1d1f; padding-bottom: 12px; margin-bottom: 16px; }
.cv-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.cv-headline { font-size: 14px; color: #8a6a35; font-weight: 600; margin-top: 2px; }
.cv-contact { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: #555; margin-top: 8px; }
.cv-sheet h2 { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: #8a6a35; border-bottom: 1px solid #e3ddd2; padding-bottom: 4px; margin: 16px 0 8px; }
.cv-sheet[lang="ar"] h2 { letter-spacing: 0; font-size: 14px; }
.cv-sheet p { margin: 0; }
.cv-role { margin-bottom: 10px; }
.cv-role-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cv-muted { color: #6b6b70; font-size: 12px; }
.cv-sheet ul { margin: 4px 0 0; padding-inline-start: 18px; }
.cv-sheet li { margin-bottom: 2px; }
.cv-letter { max-width: 820px; margin: 0 auto; }
.cl-text { min-height: 300px; line-height: 1.8; }
.cl-print { display: none; white-space: pre-wrap; }

/* decks */
.deck-title { text-align: center; font-size: 20px; margin-bottom: 14px; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.deck-stage { max-width: 1000px; margin: 0 auto; position: relative; outline: none; }
.deck-stage:fullscreen { max-width: none; background: #000; display: grid; place-items: center; }
.deck-stage:fullscreen .slide-wrap { width: min(100vw, 177.78vh); }
.slide-wrap { container-type: inline-size; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.deck-nav { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 12px; color: var(--muted); }
.deck-stage:fullscreen .deck-nav { position: fixed; bottom: 16px; inset-inline: 0; }
.deck-notes { max-width: 1000px; margin: 14px auto 0; }
.deck-notes p { margin: 6px 0 0; color: var(--text-2); }
.deck-thumbs { max-width: 1000px; margin: 14px auto 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.deck-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.deck-thumbs button.on { border-color: var(--gold); }
.thumb-inner { container-type: inline-size; pointer-events: none; }
.deck-print { display: none; }
.slide { --bg: #14151a; --fg: #f1ece3; --muted: #a39d92; --accent: #c9a46a; --panel: #1e2027;
  aspect-ratio: 16 / 9; background: var(--bg); color: var(--fg); padding: 6cqw 7cqw; position: relative; display: flex; flex-direction: column; font-family: var(--font); overflow: hidden; }
.slide.th-light { --bg: #faf7f2; --fg: #1f1c17; --muted: #6e675c; --accent: #9a7438; --panel: #efe9df; }
.slide.th-bold { --bg: #0f2a43; --fg: #fff; --muted: #b7c7d8; --accent: #f2a541; --panel: #173a5b; }
.slide h2 { font-size: 3.6cqw; line-height: 1.25; font-weight: 700; padding-inline-start: 2cqw; border-inline-start: .7cqw solid var(--accent); margin-bottom: 2.4cqw; }
.slide h3 { font-size: 2.2cqw; color: var(--accent); margin-bottom: 1.2cqw; }
.slide .sl-sub { font-size: 2cqw; color: var(--muted); margin: 0 0 1.5cqw; }
.slide .sl-list { margin: 0; padding-inline-start: 3cqw; display: grid; gap: 1.3cqw; font-size: 2.35cqw; line-height: 1.45; }
.slide .sl-list li::marker { color: var(--accent); }
.slide .sl-center { margin: auto; text-align: center; display: grid; justify-items: center; gap: 1.5cqw; }
.slide .sl-big { font-size: 5cqw; border: 0; padding: 0; margin: 0; }
.slide .sl-rule { width: 8cqw; height: .5cqw; background: var(--accent); border-radius: 1cqw; }
.slide .sl-num { font-size: 3cqw; color: var(--accent); font-weight: 700; }
.slide .sl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; flex: 1; }
.slide .sl-cols > div { background: var(--panel); border-radius: 1.5cqw; padding: 2.5cqw; }
.slide .sl-cols .sl-list { font-size: 2cqw; }
.slide .sl-stat b { display: block; font-size: 9cqw; color: var(--accent); line-height: 1.1; }
.slide .sl-stat span { font-size: 2.4cqw; color: var(--muted); }
.slide blockquote { margin: 0; font-size: 3.6cqw; font-style: italic; line-height: 1.4; max-width: 80cqw; }
.slide .sl-foot { position: absolute; bottom: 2.4cqw; inset-inline-start: 7cqw; font-size: 1.3cqw; color: var(--muted); }

@media (max-width: 860px) {
  .job { grid-template-columns: 52px 1fr; }
  .job-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .three { grid-template-columns: 1fr; }
  .cv-sheet { padding: 28px 22px; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  @page deck { size: 297mm 167mm; margin: 0; }
  body { background: #fff !important; color: #000; }
  .appbar, .bottom-nav, .no-print, .toasts, .overlay { display: none !important; }
  .main, .page { padding: 0 !important; max-width: none !important; margin: 0 !important; }
  .cv-sheet { box-shadow: none; padding: 0; max-width: none; border-radius: 0; }
  .cv-letter { border: 0; box-shadow: none; padding: 0; break-before: page; background: none; color: #000; }
  .cl-text { display: none; }
  .cl-print { display: block; font-size: 13.5px; line-height: 1.8; }
  .deck-page > *:not(.deck-print) { display: none !important; }
  .deck-print { display: block; }
  .deck-print .slide { page: deck; width: 297mm; height: 167mm; aspect-ratio: auto; break-after: page; container-type: inline-size; padding: 17mm 21mm; }
  .deck-print { container-type: inline-size; width: 297mm; }
}
.ai-pane { display: grid; gap: 0; }

/* =====================================================================
   v5: agent chat popup
   ===================================================================== */
.chat-fab { position: absolute; z-index: 9; bottom: 14px; inset-inline-end: 380px; display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 600; color: var(--on-gold); background: linear-gradient(140deg, var(--gold-2), var(--gold)); box-shadow: 0 10px 30px rgba(201,164,106,.35); }
.chat-fab:hover { transform: translateY(-1px); }
.chatpop { position: fixed; z-index: 45; bottom: 18px; inset-inline-end: 18px; width: min(400px, calc(100vw - 24px)); height: min(620px, calc(100dvh - 100px));
  display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .18s, transform .18s; overflow: hidden; }
.chatpop.open { opacity: 1; transform: none; }
.cp-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--gold-soft), transparent); }
:root[dir="rtl"] .cp-head { padding: 12px 14px 12px 12px; }
.cp-title { display: flex; align-items: center; gap: 8px; flex: 1; color: var(--gold-2); }
.cp-title b { color: var(--text); }
.cp-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cp-head .avatar { --s: 34px; }
.cp-x, .cp-back { width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none; }
.cp-x:hover, .cp-back:hover { background: var(--surface-3); color: var(--text); }
.cp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cp-list { padding: 12px; overflow-y: auto; }
.cp-search { position: relative; }
.cp-search svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.cp-search .input { padding-inline-start: 36px; }
.cp-pick { margin: 12px 4px 8px; }
.cp-agents { display: flex; flex-direction: column; gap: 2px; }
.cp-agent { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border-radius: 11px; border: 0; background: transparent; cursor: pointer; text-align: start; }
.cp-agent:hover { background: var(--surface-2); }
.cp-agent .avatar { --s: 36px; }
.cp-a-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.cp-note { margin: 10px 12px 0; padding: 8px 10px; border-radius: 9px; font-size: 12px; background: var(--idle-soft); color: var(--text-2); }
.cp-msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.cp-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.cp-msg .avatar { --s: 26px; }
.cp-msg.me { align-self: flex-end; }
.cp-msg.them { align-self: flex-start; }
.cp-bubble { padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.65; display: flex; flex-direction: column; gap: 6px; }
.cp-msg.them .cp-bubble { background: var(--surface-2); border: 1px solid var(--line); border-end-start-radius: 4px; }
.cp-msg.me .cp-bubble { background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); border-end-end-radius: 4px; }
.cp-text { white-space: pre-wrap; word-break: break-word; }
.cp-bubble time { font-size: 10.5px; align-self: flex-end; }
.cp-action { margin-top: 2px; padding: 10px; border-radius: 11px; background: var(--surface); border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent); display: grid; gap: 6px; font-size: 13px; }
.cp-a-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--gold-2); font-size: 12px; font-weight: 600; }
.cp-action p { margin: 0; color: var(--text-2); }
.cp-action ul { margin: 0; padding-inline-start: 16px; font-size: 12.5px; }
.cp-action .btn { justify-self: start; }
.cp-done { color: var(--ok); font-size: 12.5px; display: flex; align-items: center; gap: 5px; }
.cp-done a { color: var(--gold); }
.cp-typing .cp-bubble { flex-direction: row; align-items: center; gap: 8px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.cp-error { align-self: center; font-size: 12.5px; color: var(--err); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cp-empty { margin: auto; text-align: center; display: grid; justify-items: center; gap: 10px; padding: 10px; color: var(--text-2); font-size: 13px; }
.cp-empty .avatar { --s: 52px; }
.cp-empty p { margin: 0; }
.cp-sugg { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cp-sugg .chip { cursor: pointer; }
.cp-sugg .chip:hover { border-color: var(--gold); color: var(--text); }
.cp-compose { display: flex; gap: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--line); align-items: flex-end; }
.cp-compose textarea { resize: none; min-height: 42px; max-height: 140px; line-height: 1.5; }
.cp-send { width: 44px; height: 42px; padding: 0; flex: none; }
.cp-hint { font-size: 10.5px; padding: 0 14px 8px; }
@media (max-width: 860px) {
  .chat-fab { bottom: 66px; inset-inline-end: 10px; padding: 10px 14px; }
  .chat-fab span { display: none; }
  .chatpop { inset: 0; width: auto; height: auto; border-radius: 0; bottom: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .cp-hint { display: none; }
}
.tl-msg { unicode-bidi: isolate; }
.apps-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cv-ins { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.cv-revise { max-width: 820px; margin: 0 auto 18px; border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
.cv-revise h3 { display: flex; align-items: center; gap: 6px; font-size: 14.5px; }

/* =====================================================================
   v6: hall of achievements
   ===================================================================== */
.zone-label.hall b { display: inline-flex; align-items: center; gap: 5px; }
.hall-gallery { position: absolute; z-index: 9; top: 14px; bottom: 74px; inset-inline-start: 50%; transform: translateX(-50%); width: min(980px, calc(100% - 28px));
  display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); backdrop-filter: blur(16px); box-shadow: 0 30px 80px rgba(0,0,0,.55); animation: pop .2s ease; overflow: hidden; }
:root[dir="rtl"] .hall-gallery { transform: translateX(50%); }
.hall-gallery .close { position: absolute; top: 12px; inset-inline-end: 12px; width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.hall-gallery .close:hover { background: var(--surface-3); color: var(--text); }
.hg-head h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--gold-2); }
.hg-head p { margin: 4px 0 0; }
.hg-filter { align-self: flex-start; }
.hg-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; padding: 2px; }
.hg-card { border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.hg-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--ac) 60%, transparent); }
.hg-art { position: relative; aspect-ratio: 200 / 120; background: #1b1a20; }
.hg-art svg { width: 100%; height: 100%; display: block; }
.hg-kind, .hg-state { position: absolute; top: 8px; font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: rgba(10,10,14,.65); color: #f3e3c4; backdrop-filter: blur(4px); }
.hg-kind { inset-inline-start: 8px; } .hg-state { inset-inline-end: 8px; color: #ffcf85; }
.hg-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.hg-body h4 { font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hg-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.hg-meta .avatar { --s: 22px; }
.hg-meta .muted { margin-inline-start: auto; }
.hg-actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
@media (max-width: 860px) {
  .hall-gallery { inset: 8px 8px 70px; width: auto; transform: none !important; }
  .hg-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
