/* AII / Kuwait Intelligence — gold & black design system */
:root {
  --bg: #0a0907;
  --bg-2: #0f0d0a;
  --panel: #15120d;
  --panel-2: #1b1711;
  --panel-3: #232016;
  --line: #2e2718;
  --line-2: #43381f;
  --gold: #d4af37;
  --gold-2: #ecca6b;
  --gold-3: #a8842b;
  --gold-soft: rgba(212, 175, 55, 0.12);
  --gold-glow: rgba(212, 175, 55, 0.28);
  --text: #f4eedd;
  --muted: #b5a88a;
  --faint: #857a62;
  --ink-on-gold: #120f08;
  --critical: #ef5f55;
  --high: #f2a33a;
  --normal: #8fb3da;
  --low: #86bd83;
  --ok: #86bd83;
  --warn: #f2a33a;
  --bad: #ef5f55;
  --info: #8fb3da;
  --hyp: #d6a2c4;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --left-w: 310px;
  --right-w: 300px;
  --font: "Segoe UI", system-ui, -apple-system, "Noto Sans Arabic", "Noto Sans", Tahoma, Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font);
  background-image: radial-gradient(1200px 500px at 50% -200px, rgba(212,175,55,.08), transparent 70%);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; background: var(--gold); color: var(--ink-on-gold); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { top: 8px; }
[hidden] { display: none !important; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ─── buttons & inputs ─── */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--panel-2);
  padding: 7px 12px; border-radius: 9px; cursor: pointer; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--gold-3); background: var(--panel-3); }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink-on-gold); border-color: var(--gold); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #6b2a25; color: #ffb3ad; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--panel-2); cursor: pointer; position: relative; }
.icon-btn:hover { border-color: var(--gold-3); }
.icon-btn .dot { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--gold); color: var(--ink-on-gold); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.input, select.input, textarea.input { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; }
.input:focus { border-color: var(--gold-3); outline: none; box-shadow: 0 0 0 3px var(--gold-soft); }
label.field { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.gold { color: var(--gold-2); }
.stack { display: grid; gap: 10px; }
.stack-s { display: grid; gap: 6px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ─── badges ─── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; border: 1px solid var(--line-2);
  background: var(--panel-3); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.b-critical { color: var(--critical); border-color: rgba(239,95,85,.4); }
.b-high { color: var(--high); border-color: rgba(242,163,58,.4); }
.b-normal { color: var(--normal); border-color: rgba(143,179,218,.4); }
.b-low { color: var(--low); border-color: rgba(134,189,131,.4); }
.s-ready, .s-independently_verified, .s-resolved, .s-succeeded, .s-running_ok { color: var(--ok); border-color: rgba(134,189,131,.4); }
.s-running, .s-scheduled { color: var(--gold-2); border-color: var(--gold-3); }
.s-running::before { animation: pulse 1.2s infinite; }
.s-published_by_source, .s-published_on_company_site { color: var(--info); border-color: rgba(143,179,218,.4); }
.s-needs_review, .s-ambiguous, .s-rate_limited, .s-stale, .s-conflicting, .s-queued { color: var(--warn); border-color: rgba(242,163,58,.4); }
.s-failed, .s-dead, .s-unsupported { color: var(--bad); border-color: rgba(239,95,85,.4); }
.s-not_connected, .s-paused, .s-stopped, .s-unverified, .s-cancelled, .s-no_access, .s-pending { color: var(--faint); }
.b-hyp { color: var(--hyp); border-style: dashed; border-color: rgba(214,162,196,.5); }
.b-demo { color: var(--ink-on-gold); background: repeating-linear-gradient(135deg, var(--gold) 0 6px, var(--gold-2) 6px 12px); border-color: var(--gold); font-weight: 700; }
.b-demo::before { display: none; }
.b-illus { color: var(--faint); border-style: dashed; }
.b-advisory { color: var(--gold-2); border-style: dashed; border-color: var(--gold-3); }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ─── top bar ─── */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 18px; min-height: 60px;
  background: linear-gradient(180deg, #0d0b08, #0a0907); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand svg { flex: none; }
.brand-logo { width: 40px; height: 40px; flex: none; border-radius: 50%; filter: drop-shadow(0 2px 8px rgba(212,175,55,.3)); }
.brand-title { font-size: 21px; font-weight: 600; letter-spacing: .2px; white-space: nowrap; }
.brand-title .aii { color: var(--gold-2); font-weight: 700; }
.brand-title .slash { color: var(--gold-3); margin: 0 6px; }
.brand-tag { color: var(--faint); font-size: 13px; padding-inline-start: 14px; border-inline-start: 1px solid var(--line-2); white-space: nowrap; }
.topbar .search { position: relative; flex: 1; max-width: 420px; margin-inline-start: auto; }
.topbar .search input { padding-inline-start: 34px; background: var(--panel); }
.topbar .search svg { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.loc-select { display: flex; align-items: center; gap: 8px; }
.loc-select select { width: auto; background: var(--panel); }
.clock { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--text); font-variant-numeric: tabular-nums; }
.clock .tz { color: var(--faint); font-size: 11.5px; }
.conn-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 9px; border: 1px solid var(--gold-3);
  color: var(--gold-2); font-size: 12px; letter-spacing: .5px; text-transform: uppercase; font-weight: 600; white-space: nowrap; }
.conn-pill.live { border-color: rgba(134,189,131,.6); color: var(--ok); }
.user-menu { position: relative; }
.menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 240px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 50; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: none; border: 0; cursor: pointer; text-align: start; color: var(--text); }
.menu button:hover, .menu a:hover { background: var(--panel-3); text-decoration: none; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.notif-panel { width: min(380px, 92vw); max-height: 70vh; overflow: auto; }
.notif { padding: 9px 10px; border-radius: 8px; display: grid; gap: 2px; }
.notif.unread { background: var(--gold-soft); }

/* ─── shell grid ─── */
.demo-banner { background: repeating-linear-gradient(135deg, #3a2e10 0 10px, #2a210b 10px 20px); color: var(--gold-2); text-align: center;
  padding: 6px 12px; font-size: 12.5px; border-bottom: 1px solid var(--gold-3); }
.shell { display: grid; grid-template-columns: var(--left-w) 6px minmax(0, 1fr) 6px var(--right-w); height: calc(100vh - 61px - 32px); }
.shell.has-banner { height: calc(100vh - 61px - 32px - 31px); }
.shell.left-collapsed { grid-template-columns: 0 0 minmax(0,1fr) 6px var(--right-w); }
.shell.right-collapsed { grid-template-columns: var(--left-w) 6px minmax(0,1fr) 0 0; }
.shell.left-collapsed.right-collapsed { grid-template-columns: 0 0 minmax(0,1fr) 0 0; }
.shell.left-collapsed .sidebar.left, .shell.left-collapsed .resizer.l,
.shell.right-collapsed .sidebar.right, .shell.right-collapsed .resizer.r { visibility: hidden; overflow: hidden; }
.sidebar { overflow: auto; padding: 16px; background: linear-gradient(180deg, #0e0c09, #0b0a07); position: relative; }
.sidebar.left { border-inline-end: 1px solid var(--line); }
.sidebar.right { border-inline-start: 1px solid var(--line); }
.resizer { cursor: col-resize; background: transparent; position: relative; }
.resizer::after { content: ""; position: absolute; inset: 0 2px; border-radius: 3px; transition: background .15s; }
.resizer:hover::after, .resizer:focus-visible::after, .resizer.dragging::after { background: var(--gold-3); }
.main { overflow: auto; padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.main > *, #tabpanel > * { flex-shrink: 0; }
.footer { height: 32px; display: flex; align-items: center; gap: 12px; padding: 0 18px; border-top: 1px solid var(--line); color: var(--faint);
  font-size: 12px; background: #090806; overflow: hidden; white-space: nowrap; }
.footer .sp { margin-inline-start: auto; }

/* ─── panels ─── */
.panel { background: linear-gradient(180deg, var(--panel), #120f0b); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.panel.tight { padding: 10px 12px; }
.panel-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-h h2, .panel-h h3 { margin: 0; font-size: 16.5px; font-weight: 600; }
.panel-h .ico { color: var(--gold); display: inline-grid; }
.panel-h .meta { margin-inline-start: auto; color: var(--faint); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.side-h { display: flex; align-items: center; gap: 10px; margin: 2px 0 2px; }
.side-h h2 { margin: 0; font-size: 18px; font-weight: 600; }
.side-h .ico { color: var(--gold); }
.side-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; }
.section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.collapse-btn { margin-inline-start: auto; }

/* mailbox cards */
.mb-list { display: grid; gap: 8px; }
.mb-card { display: grid; grid-template-columns: 22px 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 11px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; position: relative; }
.mb-card:hover { border-color: var(--line-2); }
.mb-card[aria-checked="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-3) inset, 0 0 22px rgba(212,175,55,.12); background: linear-gradient(180deg, #1f1a10, #16120c); }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--faint); display: grid; place-items: center; }
[aria-checked="true"] .radio { border-color: var(--gold); }
[aria-checked="true"] .radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.num { width: 28px; height: 28px; border-radius: 7px; background: var(--panel-3); border: 1px solid var(--line-2); display: grid; place-items: center; font-weight: 700; color: var(--gold-2); font-size: 13px; }
.mb-addr { font-weight: 600; font-size: 13px; letter-spacing: -.1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-role { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.mb-side { display: grid; justify-items: end; gap: 4px; }
.unread { min-width: 22px; padding: 0 6px; height: 20px; border-radius: 10px; background: var(--gold); color: var(--ink-on-gold); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.unread.na { background: transparent; color: var(--faint); border: 1px dashed var(--line-2); }
.mb-tools { display: none; gap: 3px; position: absolute; top: 6px; inset-inline-end: 6px; background: var(--panel-2); padding: 2px; border-radius: 8px; border: 1px solid var(--line-2); }
.mb-card:hover .mb-tools, .mb-card:focus-within .mb-tools { display: flex; }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.udot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); display: inline-block; box-shadow: 0 0 0 3px var(--gold-soft); }
.panel-toggles { gap: 6px; }
.mini { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel-2); display: grid; place-items: center; cursor: pointer; padding: 0; }
.mini:hover { border-color: var(--gold-3); }
.role-edit { width: 100%; padding: 3px 6px; font-size: 12.5px; }

.summary-card { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.prio-bars { display: grid; gap: 7px; margin-top: 8px; }
.prio-bar { display: grid; grid-template-columns: 70px 1fr 26px; align-items: center; gap: 8px; font-size: 12.5px; }
.prio-bar .track { height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.prio-bar .fill { height: 100%; border-radius: 3px; }

.skyline { margin-top: 20px; opacity: .8; display: flex; align-items: flex-end; gap: 14px; color: var(--gold-3); }
.skyline .kw { font-size: 12px; letter-spacing: 4px; color: var(--muted); }
.skyline .kw b { display: block; font-size: 14px; letter-spacing: 6px; color: var(--gold-2); font-weight: 600; margin-bottom: 8px; }

/* right sidebar */
.radio-list { display: grid; gap: 2px; margin-top: 8px; }
.radio-item { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; cursor: pointer; }
.radio-item:hover { background: var(--panel-2); }
.legend { display: grid; grid-template-columns: 14px 70px 1fr; gap: 8px 10px; align-items: center; font-size: 13px; }
.legend .dotc { width: 11px; height: 11px; border-radius: 50%; }
.legend .desc { color: var(--muted); font-size: 12px; }
.switch { width: 58px; height: 28px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel-3); position: relative; cursor: pointer; padding: 0; }
.switch::after { content: attr(data-label); position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--muted); font-weight: 600; }
.switch .knob { position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: inset-inline-start .15s; }
.switch[aria-checked="true"] { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold); }
.switch[aria-checked="true"]::after { inset-inline-end: auto; inset-inline-start: 8px; color: var(--ink-on-gold); }
.switch[aria-checked="true"] .knob { inset-inline-start: 33px; background: var(--ink-on-gold); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; font-size: 13px; }
.kv > :nth-child(even) { justify-self: end; text-align: end; }
.src-list { display: grid; gap: 9px; }
.src { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.src .ico { color: var(--gold); }

/* center header */
.agents-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.agents-title { display: flex; align-items: center; gap: 12px; }
.agents-title h1 { margin: 0; font-size: 24px; font-weight: 600; white-space: nowrap; }
.agents-title .sub { color: var(--gold-2); font-size: 13.5px; }
.agent-chips { display: flex; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }
.chip { display: grid; grid-template-columns: 24px auto; gap: 2px 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); min-width: 0; cursor: pointer; text-align: start; }
.chip:hover { border-color: var(--gold-3); }
.chip .ico { grid-row: span 2; color: var(--gold); }
.chip .t { font-size: 12.5px; font-weight: 600; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.tab { background: none; border: 0; padding: 9px 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--gold-2); border-bottom-color: var(--gold); }
.tab .count { font-size: 11px; padding: 0 6px; border-radius: 8px; background: var(--panel-3); color: var(--muted); }

/* lists & tables */
.list { display: grid; }
.li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; text-align: start; background: none; border-inline: 0; border-top: 0; width: 100%; }
.li:hover { background: var(--panel-2); }
.li:last-child { border-bottom: 0; }
.li .t { font-weight: 600; font-size: 14.5px; }
.li .m { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.li .chev { grid-row: span 2; align-self: center; color: var(--faint); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: start; font-weight: 600; color: var(--muted); background: #17140e; padding: 9px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; white-space: nowrap; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { cursor: default; }
table.t tbody tr.clickable { cursor: pointer; }
table.t tbody tr.clickable:hover, table.t tbody tr.selected { background: var(--gold-soft); }
th button.sort { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; font-weight: 600; }
.nf { color: var(--faint); font-style: italic; }
.note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.note svg { flex: none; margin-top: 1px; color: var(--gold-3); }
.empty { display: grid; justify-items: center; gap: 8px; padding: 26px 12px; text-align: center; color: var(--muted); }
.empty svg { color: var(--gold-3); }
.empty .t { color: var(--text); font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); text-align: start; cursor: pointer; }
.stat:hover { border-color: var(--gold-3); }
.stat .v { font-size: 24px; font-weight: 700; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 12.5px; }

/* pipeline strip */
.pipeline { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; flex-wrap: wrap; }
.pipe-step { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-2); font-size: 14px; padding: 4px 8px; border-radius: 8px; }
.pipe-step .ico { color: var(--gold); }
.pipe-step .st { font-size: 11px; color: var(--faint); }
.pipe-arrow { color: var(--gold-3); }

/* map */
.map { height: 420px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; background: #0e0d0a; position: relative; }
.map.small { height: 230px; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }
.map-overlay-btn { position: absolute; inset-inline-end: 10px; bottom: 10px; z-index: 500; }
.leaflet-container { background: #0e0d0a !important; font: inherit !important; }
.leaflet-tile-pane { filter: grayscale(1) invert(1) sepia(.35) brightness(.72) contrast(1.05) hue-rotate(5deg); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel) !important; color: var(--text) !important; border: 1px solid var(--line-2); }
.leaflet-control-attribution { background: rgba(10,9,7,.7) !important; color: var(--faint) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.pin { width: 16px; height: 16px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--gold); border: 2px solid #1a1409; box-shadow: 0 0 0 3px rgba(212,175,55,.25); }
.pin.sel { background: var(--gold-2); box-shadow: 0 0 0 6px rgba(236,202,107,.35); }
.pin.ambiguous { background: var(--warn); }

/* drawer (detail) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(720px, 100vw); background: var(--bg-2); border-inline-start: 1px solid var(--line-2);
  z-index: 61; overflow: auto; padding: 18px 20px 40px; box-shadow: var(--shadow); }
.drawer h2 { margin: 4px 0 8px; font-size: 20px; }
.drawer .close { position: sticky; top: 0; float: inline-end; }
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.bodytext { white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 13px; max-height: 360px; overflow: auto; }
.src-row { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.score-grid { display: grid; grid-template-columns: 1.3fr 90px 2fr; gap: 8px 10px; align-items: center; font-size: 13px; }
.score-grid .h { color: var(--muted); font-size: 12px; }
.meter { height: 7px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); }
.conf { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.conf .meter { width: 56px; }
.warn-box { border: 1px solid rgba(242,163,58,.45); background: rgba(242,163,58,.08); color: #f7d19d; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.info-box { border: 1px dashed var(--gold-3); background: var(--gold-soft); color: var(--muted); padding: 10px 12px; border-radius: 10px; font-size: 12.5px; }
.log { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: #0c0b08; border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 300px; overflow: auto; white-space: pre-wrap; }
.toast-wrap { position: fixed; bottom: 44px; inset-inline-end: 18px; z-index: 90; display: grid; gap: 8px; }
.toast { background: var(--panel-2); border: 1px solid var(--gold-3); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; }
.toast.err { border-color: var(--bad); }

/* settings */
.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.settings-nav .btn[aria-current="page"] { border-color: var(--gold); color: var(--gold-2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(420px, 100%); padding: 28px; border: 1px solid var(--line-2); border-radius: 16px; background: linear-gradient(180deg, var(--panel), #100d09); box-shadow: var(--shadow); display: grid; gap: 14px; }
.login h1 { margin: 0; font-size: 22px; }
.login.gate { justify-items: center; text-align: center; padding: 34px 30px 26px; }
.login.gate > .btn.primary { justify-content: center; }
.login.gate > .btn.primary, .login.gate > input, .login.gate > .field, .login.gate > .warn-box { width: 100%; }
.login.gate input[type=password] { text-align: center; font-size: 16px; padding: 11px 12px; letter-spacing: 1px; }
.gate-logo { width: 180px; height: auto; filter: drop-shadow(0 8px 28px rgba(212,175,55,.28)); }
.gate-title { font-size: 26px !important; font-weight: 600; letter-spacing: .3px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate-links { justify-content: center; }

/* mobile nav */
.mobile-nav { display: none; }

/* ─── responsive ─── */
.show-right-btn, .show-left-btn { display: none !important; }
@media (max-width: 1280px) {
  .brand-tag { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .shell, .shell.left-collapsed, .shell.right-collapsed { grid-template-columns: var(--left-w) 6px minmax(0,1fr) 0 0; }
  .sidebar.right { position: fixed; top: 61px; bottom: 32px; inset-inline-end: 0; width: min(340px, 92vw); z-index: 40; box-shadow: var(--shadow); visibility: visible !important; overflow: auto !important; }
  .sidebar.right:not(.open) { display: none; }
  .resizer.r { display: none; }
  .show-right-btn { display: inline-grid !important; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .brand-title { font-size: 17px; }
  .brand-logo { width: 32px; height: 32px; }
  .topbar .search { order: 10; max-width: none; flex-basis: 100%; }
  .clock .tz, .loc-select .lbl, .conn-pill .txt { display: none; }
  .shell, .shell.left-collapsed, .shell.right-collapsed, .shell.left-collapsed.right-collapsed { grid-template-columns: minmax(0,1fr); height: auto; min-height: calc(100vh - 150px); }
  .sidebar.left { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(330px, 92vw); z-index: 40; box-shadow: var(--shadow); visibility: visible !important; overflow: auto !important; }
  .sidebar.left:not(.open) { display: none; }
  .sidebar.right { top: 0; bottom: 0; }
  .resizer { display: none; }
  .main { padding: 12px 12px 70px; overflow: visible; }
  .agent-chips { margin-inline-start: 0; }
  .chip { min-width: 0; flex: 1 1 45%; }
  .grid-3 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { margin-top: 6px; }
  .footer { display: none; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 35; background: #0c0a07; border-top: 1px solid var(--line-2); justify-content: space-around; padding: 6px; }
  .mobile-nav button { background: none; border: 0; color: var(--muted); display: grid; justify-items: center; font-size: 11px; gap: 2px; padding: 4px 8px; cursor: pointer; }
  .mobile-nav button:hover, .mobile-nav button[aria-current="true"] { color: var(--gold-2); }
  .score-grid { grid-template-columns: 1fr 80px; }
  .score-grid .why { grid-column: 1 / -1; }
}
@media (max-width: 1100px) { .panel-toggles { display: none !important; } }
@media (max-width: 760px) { .show-left-btn { display: inline-grid !important; } }
