:root {
  --bg: #04060d;
  --bg2: #070b18;
  --panel: rgba(13, 19, 38, 0.62);
  --panel-solid: #0c1328;
  --panel-hi: rgba(22, 32, 62, 0.75);
  --line: rgba(120, 160, 255, 0.13);
  --line-hi: rgba(140, 190, 255, 0.32);
  --text: #e8eefc;
  --muted: #8a97b8;
  --dim: #5a6684;
  --gold: #f5c46b;
  --cyan: #4cc9f0;
  --violet: #b388ff;
  --green: #2ee6a6;
  --red: #ff5d73;
  --amber: #ffb547;
  --blue: #5aa9ff;
  --radius: 16px;
  --mono: "JetBrains Mono", "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", monospace;
  --sans: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.nebula {
  position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 35% at 18% 20%, rgba(179, 136, 255, 0.16), transparent 70%),
    radial-gradient(35% 30% at 85% 15%, rgba(76, 201, 240, 0.12), transparent 70%),
    radial-gradient(45% 40% at 70% 90%, rgba(245, 196, 107, 0.08), transparent 70%);
  animation: drift 40s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) scale(1.05); } }

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

/* ---------- shell ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); height: 100vh; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 0 20px; min-width: 0; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 12, 26, 0.92), rgba(8, 12, 26, 0.6));
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.brand svg { width: 38px; height: 38px; filter: drop-shadow(0 0 10px rgba(245, 196, 107, 0.5)); }
.brand .name { font-weight: 800; letter-spacing: 0.32em; font-size: 17px;
  background: linear-gradient(90deg, #ffe2a6, var(--gold) 40%, #ff9f5a);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .sub { font-size: 10px; letter-spacing: 0.25em; color: var(--muted); text-transform: uppercase; }
.top-metrics { display: flex; gap: 26px; margin-left: 10px; }
.metric .label { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.metric .value { font: 600 18px var(--mono); }
.metric .value small { font-size: 12px; margin-left: 6px; }
.spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-hi);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.pill.paper { color: var(--cyan); }
.pill.practice { color: var(--violet); }
.pill.live, .pill.mixed { color: var(--red); border-color: rgba(255, 93, 115, 0.6); animation: livepulse 1.6s infinite; }
@keyframes livepulse { 50% { box-shadow: 0 0 22px rgba(255, 93, 115, 0.45); } }
.pill.ai-on { color: var(--violet); }
.pill.ai-off { color: var(--dim); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line-hi); background: rgba(90, 169, 255, 0.08); transition: all 0.18s ease; font-weight: 600; white-space: nowrap; }
.btn:hover { background: rgba(90, 169, 255, 0.18); border-color: var(--cyan); box-shadow: 0 0 18px rgba(76, 201, 240, 0.25); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.small { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
.btn.gold { border-color: rgba(245, 196, 107, 0.6); background: rgba(245, 196, 107, 0.12); color: #ffe2a6; }
.btn.gold:hover { box-shadow: 0 0 22px rgba(245, 196, 107, 0.35); border-color: var(--gold); }
.btn.danger { border-color: rgba(255, 93, 115, 0.55); background: rgba(255, 93, 115, 0.1); color: #ffc2cb; }
.btn.danger:hover { box-shadow: 0 0 22px rgba(255, 93, 115, 0.4); border-color: var(--red); }
.btn.live { border: 1px solid rgba(255, 93, 115, 0.7); color: #fff; letter-spacing: 0.18em; font-weight: 800;
  background: linear-gradient(135deg, rgba(255, 93, 115, 0.35), rgba(179, 136, 255, 0.25)); }
.btn.live:hover { box-shadow: 0 0 30px rgba(255, 93, 115, 0.55); }
.btn.ghost { background: transparent; }

.nav { border-right: 1px solid var(--line); background: rgba(6, 9, 20, 0.7); backdrop-filter: blur(12px);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0;
  position: relative; z-index: 30; /* tooltips must float above the page content */ }
.nav a { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; color: var(--muted); position: relative;
  transition: all 0.2s; text-decoration: none; }
.nav a svg { width: 23px; height: 23px; }
.nav a:hover { color: var(--text); background: rgba(90, 169, 255, 0.09); }
.nav a.active { color: var(--gold); background: rgba(245, 196, 107, 0.1); box-shadow: inset 0 0 0 1px rgba(245, 196, 107, 0.35), 0 0 22px rgba(245, 196, 107, 0.12); }
.nav a .tip { position: absolute; left: 64px; background: var(--panel-solid); border: 1px solid var(--line-hi); padding: 4px 10px; border-radius: 8px;
  font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 50; color: var(--text); }
.nav a:hover .tip { opacity: 1; }

main { overflow: auto; padding: 22px 24px 40px; scrollbar-width: thin; scrollbar-color: #24304f transparent; }
.page-title { display: flex; align-items: baseline; gap: 14px; margin: 0 0 16px; }
.page-title h1 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: 0.02em; }
.page-title .hint { color: var(--muted); font-size: 13px; }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(16px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.03); padding: 16px; position: relative; }
.panel h2 { margin: 0 0 12px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 700;
  display: flex; align-items: center; gap: 10px; }
.panel h2 .count { color: var(--dim); letter-spacing: 0; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; border-radius: 14px; background: linear-gradient(160deg, rgba(25, 36, 70, 0.7), rgba(12, 18, 36, 0.6));
  border: 1px solid var(--line); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow, rgba(76, 201, 240, 0.25)), transparent 70%); }
.kpi .label { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.kpi .value { font: 650 22px var(--mono); margin-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- city ---------- */
.city-wrap { position: relative; height: 560px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(80% 70% at 50% 45%, rgba(30, 44, 90, 0.55), rgba(4, 6, 13, 0.9)); }
#city { width: 100%; height: 100%; display: block; cursor: grab; }
.city-overlay { position: absolute; left: 18px; top: 16px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.city-legend { position: absolute; right: 16px; bottom: 14px; display: flex; gap: 14px; font-size: 11px; color: var(--muted);
  background: rgba(6, 9, 20, 0.65); padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); }
.city-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; box-shadow: 0 0 8px currentColor; background: currentColor; }
.agent-card { position: absolute; right: 16px; top: 16px; width: 320px; max-height: calc(100% - 70px); overflow: auto;
  background: rgba(8, 12, 26, 0.88); border: 1px solid var(--line-hi); border-radius: 16px; padding: 16px; backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.agent-card .head { display: flex; align-items: center; gap: 12px; }
.agent-card .avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800;
  color: #050816; box-shadow: 0 0 22px var(--c); background: var(--c); font-size: 16px; }
.agent-card .close { margin-left: auto; cursor: pointer; color: var(--muted); background: none; border: 0; font-size: 18px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status.working { color: var(--green); }
.status.idle { color: var(--muted); }
.status.alert { color: var(--red); }

.agents-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.agent-mini { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(12, 18, 36, 0.55); cursor: pointer; transition: all 0.2s; min-width: 0; }
.agent-mini:hover { border-color: var(--line-hi); background: rgba(20, 30, 60, 0.6); }
.agent-mini .avatar { width: 32px; height: 32px; border-radius: 10px; flex: 0 0 32px; display: grid; place-items: center; font-weight: 800; color: #050816; font-size: 12px; }
.agent-mini .avatar.working { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 18px var(--c); transform: scale(1.06); } }
.agent-mini .meta { min-width: 0; }
.agent-mini .n { font-weight: 700; font-size: 12px; letter-spacing: 0.08em; }
.agent-mini .t { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow: auto; scrollbar-width: thin; }
.feed .item { display: grid; grid-template-columns: 54px 64px 1fr; gap: 10px; font-size: 12.5px; padding: 7px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.02); border-left: 2px solid var(--c, var(--line-hi)); animation: slidein 0.35s ease; }
@keyframes slidein { from { opacity: 0; transform: translateY(-4px); } }
.feed .item .who { font-weight: 800; letter-spacing: 0.06em; color: var(--c); font-size: 11px; }
.feed .item .when { color: var(--dim); font-family: var(--mono); font-size: 11px; }
.feed .item.win { background: rgba(46, 230, 166, 0.06); }
.feed .item.loss, .feed .item.error { background: rgba(255, 93, 115, 0.07); }
.feed .item.alert { background: rgba(255, 93, 115, 0.12); }
.feed .item.ai { background: rgba(179, 136, 255, 0.07); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 700;
  padding: 8px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(10, 15, 30, 0.95); }
td { padding: 9px 10px; border-bottom: 1px solid rgba(120, 160, 255, 0.06); vertical-align: middle; }
tr:hover td { background: rgba(90, 169, 255, 0.04); }
td.r, th.r { text-align: right; }
.table-wrap { overflow: auto; max-height: 520px; scrollbar-width: thin; }
.empty { color: var(--dim); text-align: center; padding: 26px 10px; font-size: 13px; }

.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; border: 1px solid var(--line-hi); color: var(--muted); white-space: nowrap; }
.tag.champion { color: var(--gold); border-color: rgba(245, 196, 107, 0.5); background: rgba(245, 196, 107, 0.08); }
.tag.challenger { color: var(--cyan); border-color: rgba(76, 201, 240, 0.45); }
.tag.probation, .tag.retired { color: var(--dim); }
.tag.live { color: var(--red); border-color: rgba(255, 93, 115, 0.5); }
.tag.paper { color: var(--cyan); }
.tag.practice { color: var(--violet); border-color: rgba(179, 136, 255, 0.45); }
.tag.crypto { color: #ffb547; } .tag.meme { color: #ff7ab6; } .tag.stock { color: #5aa9ff; } .tag.etf { color: #7cf29a; } .tag.forex { color: #b388ff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- markets ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(10, 15, 30, 0.7); border: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.active { background: rgba(245, 196, 107, 0.14); color: var(--gold); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(170deg, rgba(20, 30, 60, 0.6), rgba(10, 15, 30, 0.55));
  cursor: pointer; transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s; position: relative; overflow: hidden; }
.tile:hover { transform: translateY(-2px); border-color: var(--line-hi); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4); }
.tile .row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile .sym { font-weight: 800; font-size: 15px; letter-spacing: 0.03em; }
.tile .nm { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .px { font: 600 17px var(--mono); margin-top: 8px; }
.tile .chg { font: 600 12px var(--mono); }
.tile svg.spark { width: 100%; height: 44px; margin-top: 6px; display: block; }
.tile .badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; min-height: 18px; }
.livedot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); display: inline-block; animation: blink 1.6s infinite; }
.livedot.off { background: var(--dim); box-shadow: none; animation: none; }
@keyframes blink { 50% { opacity: 0.35; } }

.drawer { position: fixed; inset: 0; z-index: 60; display: none; }
.drawer.open { display: block; }
.drawer .shade { position: absolute; inset: 0; background: rgba(2, 4, 10, 0.6); backdrop-filter: blur(4px); }
.drawer .sheet { position: absolute; right: 0; top: 0; bottom: 0; width: min(980px, 96vw); background: linear-gradient(180deg, #0a1022, #060a16);
  border-left: 1px solid var(--line-hi); padding: 22px; overflow: auto; animation: slideleft 0.25s ease; }
@keyframes slideleft { from { transform: translateX(40px); opacity: 0; } }
.chart-box { position: relative; height: 420px; border-radius: 14px; border: 1px solid var(--line); background: rgba(5, 8, 18, 0.7); }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.chart-box .tv { position: absolute; inset: 6px 4px 4px 4px; }
.chart-sm { height: 240px; }
.chart-tip { position: absolute; pointer-events: none; background: rgba(8, 12, 26, 0.92); border: 1px solid var(--line-hi); border-radius: 10px;
  padding: 7px 10px; font: 12px var(--mono); display: none; white-space: nowrap; z-index: 5; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.field input, .field select, textarea { background: rgba(4, 7, 16, 0.85); border: 1px solid var(--line-hi); border-radius: 10px; padding: 9px 12px; outline: none; }
.field input:focus, .field select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.15); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line-hi); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 7px 12px; cursor: pointer; color: var(--muted); font-weight: 650; font-size: 12px; }
.seg button.on { background: rgba(76, 201, 240, 0.16); color: var(--text); }
.seg button.on.live { background: rgba(255, 93, 115, 0.25); color: #fff; }
.seg button.on.practice { background: rgba(179, 136, 255, 0.2); }
.venue { display: flex; flex-direction: column; gap: 10px; }
.venue .vh { display: flex; align-items: center; gap: 12px; }
.venue .logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #050816; }
.checkline { font-size: 12px; color: var(--muted); }
.checkline.ok { color: var(--green); }
.checkline.bad { color: var(--red); }
.switch { position: relative; width: 44px; height: 24px; border-radius: 999px; background: #1a2340; border: 1px solid var(--line-hi); cursor: pointer; flex: 0 0 44px; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: all 0.2s; }
.switch.on { background: rgba(46, 230, 166, 0.25); border-color: var(--green); }
.switch.on::after { left: 22px; background: var(--green); box-shadow: 0 0 10px var(--green); }
.secret { font: 12px var(--mono); word-break: break-all; background: rgba(255, 93, 115, 0.08); border: 1px dashed rgba(255, 93, 115, 0.5); padding: 10px; border-radius: 10px; }
.addr { font: 12px var(--mono); word-break: break-all; color: var(--gold); }

/* ---------- brain ---------- */
.chat { display: flex; flex-direction: column; height: 560px; }
.chat .log { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 6px; scrollbar-width: thin; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 14px; white-space: pre-wrap; font-size: 13.5px; }
.msg.user { align-self: flex-end; background: rgba(90, 169, 255, 0.14); border: 1px solid rgba(90, 169, 255, 0.3); }
.msg.bot { align-self: flex-start; background: rgba(179, 136, 255, 0.1); border: 1px solid rgba(179, 136, 255, 0.28); }
.msg.bot b { color: var(--violet); letter-spacing: 0.1em; font-size: 11px; display: block; margin-bottom: 4px; }
.chat form { display: flex; gap: 10px; margin-top: 12px; }
.chat textarea { flex: 1; resize: none; height: 48px; }
.mem { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow: auto; scrollbar-width: thin; }
.mem .m { padding: 9px 11px; border-radius: 10px; background: rgba(255, 255, 255, 0.025); border-left: 2px solid var(--c, var(--violet)); font-size: 12.5px; }
.mem .m .h { display: flex; gap: 8px; align-items: center; font-size: 10.5px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 3px; }

/* ---------- news ---------- */
.news { display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow: auto; scrollbar-width: thin; }
.news .n { display: grid; grid-template-columns: 4px 1fr; gap: 12px; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.02); }
.news .bar { border-radius: 4px; }
.news .title { font-size: 13.5px; }
.news .meta { font-size: 11px; color: var(--dim); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.critical { border: 1px solid rgba(255, 93, 115, 0.5); background: rgba(255, 93, 115, 0.08) !important; }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; background: rgba(2, 4, 10, 0.7); backdrop-filter: blur(6px); }
.modal.open { display: grid; }
.modal .box { width: min(620px, 94vw); background: linear-gradient(180deg, #0c1328, #070b18); border: 1px solid rgba(255, 93, 115, 0.45);
  border-radius: 20px; padding: 24px; box-shadow: 0 0 80px rgba(255, 93, 115, 0.18); }
.modal h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: 0.1em; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 14px; border-radius: 12px; background: rgba(10, 15, 30, 0.95); border: 1px solid var(--line-hi); max-width: 380px;
  font-size: 13px; animation: slidein 0.3s ease; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.toast.error { border-color: rgba(255, 93, 115, 0.6); }
.toast.ok { border-color: rgba(46, 230, 166, 0.6); }
.progress { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 999px; transition: width 0.4s; }
.banner { padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(76, 201, 240, 0.35); background: rgba(76, 201, 240, 0.06); margin-bottom: 16px; font-size: 13px; }
.banner.warn { border-color: rgba(255, 181, 71, 0.45); background: rgba(255, 181, 71, 0.06); }

@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agents-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .top-metrics .metric:nth-child(n+3) { display: none; }
  .pill.ai-on, .pill.ai-off { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr) 64px; }
  .topbar { gap: 10px; padding: 0 12px; }
  .brand { min-width: 0; }
  .brand .name { font-size: 14px; letter-spacing: 0.2em; }
  .pill { padding: 5px 9px; font-size: 10px; }
  .nav { grid-row: 3; flex-direction: row; justify-content: space-around; padding: 4px; border-right: 0; border-top: 1px solid var(--line); }
  .nav a .tip { display: none; } /* no hover on phones; a side tooltip would fall off screen */
  .nav a { width: 46px; height: 46px; }
  .top-metrics .metric:nth-child(n+2) { display: none; }
  .brand .sub { display: none; }
  main { padding: 16px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agents-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .city-wrap { height: 420px; }
  .agent-card { left: 10px; right: 10px; width: auto; }
}
