:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: rgba(16, 23, 35, .86);
  --line: rgba(255, 255, 255, .09);
  --text: #f5f7fb;
  --muted: #8f9bad;
  --cyan: #40e0d0;
  --pink: #ff4d9a;
  --gold: #ffd166;
  --red: #ff5d68;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, rgba(64,224,208,.14), transparent 31rem),
    radial-gradient(circle at 90% 10%, rgba(255,77,154,.13), transparent 35rem),
    var(--bg);
}
button, select, textarea { font: inherit; }
button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
  background: #182234;
  cursor: pointer;
}
button:hover { border-color: rgba(64,224,208,.5); }
button.primary { color: #021412; background: var(--cyan); font-weight: 800; }
button.ghost { background: transparent; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(7,11,18,.84);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.brand img { width: 43px; height: 43px; object-fit: cover; border-radius: 50%; border: 1px solid rgba(255,77,154,.7); box-shadow: 0 0 24px rgba(255,77,154,.24); }
.topbar nav { display: flex; align-self: stretch; gap: 4px; }
.topbar nav button { border: 0; border-radius: 0; padding: 0 17px; color: var(--muted); background: transparent; }
.topbar nav button.active { color: #ff7ab4; border-bottom: 2px solid var(--pink); box-shadow: inset 0 -12px 22px rgba(255,77,154,.06); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(22px, 3vw, 34px); }
h2 { margin-bottom: 0; font-size: clamp(19px, 2vw, 27px); }
.eyebrow {
  margin-bottom: 5px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
}
.status { color: var(--muted); font-size: 13px; }
.status span {
  display: inline-block;
  width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #ffd166;
}
.vault-open .status span { background: #52e08f; box-shadow: 0 0 14px #52e08f; }
.workspace-shell {
  width: min(1920px, 100%);
  margin: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: 235px minmax(600px, 1fr) 255px;
  gap: 12px;
  align-items: start;
}
.workspace-main { min-width: 0; }
.bot-command { display: grid; grid-template-columns: minmax(260px,1fr) 180px minmax(260px,1fr); align-items: center; gap: 10px; margin-bottom: 12px; }
.bot-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  min-height: 84px; padding: 14px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(135deg,rgba(17,27,42,.96),rgba(10,15,25,.96));
}
.bot-card.query { border-color: rgba(64,224,208,.3); box-shadow: inset 0 0 28px rgba(64,224,208,.035); }
.bot-card.review { border-color: rgba(255,77,154,.35); box-shadow: inset 0 0 28px rgba(255,77,154,.04); }
.bot-id { padding: 7px; border-radius: 8px; color: var(--cyan); background: rgba(64,224,208,.08); font-size: 9px; font-weight: 900; }
.bot-card.review .bot-id { color: #ff88bd; background: rgba(255,77,154,.09); }
.bot-card strong { font-size: 17px; }.bot-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.bot-card b { color: #65e5a5; font-size: 8px; letter-spacing: .12em; }
.bot-card.review b { color: var(--gold); }
.bot-route { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8px; text-align: center; }
.bot-route i { flex: 1; height: 1px; background: linear-gradient(90deg,var(--cyan),var(--pink)); }
.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(16px, 2.4vw, 28px);
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
}
.provider-rail, .inspector { position: sticky; top: 85px; padding: 13px; border-radius: 14px; }
.rail-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: #ff8cbc; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.rail-title button { padding: 4px 8px; }
.provider-node {
  position: relative;
  display: grid;
  grid-template-columns: 31px 1fr auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
}
.provider-node::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.provider-node:nth-child(even)::before { background: var(--pink); box-shadow: 0 0 12px var(--pink); }
.provider-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #172438; color: var(--cyan); font-weight: 900; }
.provider-node strong, .provider-node small { display: block; }
.provider-node strong { font-size: 12px; }.provider-node small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.provider-node b { width: 7px; height: 7px; border-radius: 50%; background: #53e39a; }
.rail-note { margin-top: 18px; padding: 12px; border: 1px solid rgba(255,77,154,.18); border-radius: 10px; background: rgba(255,77,154,.035); }
.rail-note strong { font-size: 11px; color: #ff8cbc; }.rail-note p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.online { color: #63e8a4; font-size: 9px; }
.health-ring {
  width: 118px; height: 118px; margin: 18px auto;
  border-radius: 50%; display: grid; place-content: center; text-align: center;
  border: 7px solid #1e3f36;
  box-shadow: inset 0 0 0 2px #50e399, 0 0 25px rgba(80,227,153,.14);
}
.health-ring strong { font-size: 26px; }.health-ring span { color: var(--muted); font-size: 9px; }
.vault-control { display: grid; gap: 9px; padding: 12px; border: 1px solid rgba(255,77,154,.22); border-radius: 10px; background: rgba(255,77,154,.04); }
.vault-control input { width: 100%; padding: 10px; color: var(--text); border: 1px solid var(--line); border-radius: 9px; background: #0c1320; }
.vault-control div { display: flex; gap: 7px; }.vault-control div button { flex: 1; padding: 8px 5px; font-size: 10px; }
.vault-control small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.inspect-block { display: flex; justify-content: space-between; gap: 10px; padding: 11px 4px; border-top: 1px solid var(--line); }
.inspect-block span { color: var(--muted); font-size: 10px; }.inspect-block strong { font-size: 10px; color: #dce5f1; }
.route-map { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.route-map > div { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; color: #cbd5e2; font-size: 8px; }
.route-map i { flex: 1; height: 1px; margin: 0 4px; background: linear-gradient(90deg,var(--cyan),var(--pink)); }
.full { width: 100%; margin-top: 12px; }
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
textarea, select {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px;
  background: #0c1320;
  resize: vertical;
}
textarea:focus, select:focus { outline: 2px solid rgba(64,224,208,.35); border-color: var(--cyan); }
.composer textarea { min-height: 105px; font-size: 17px; }
.security-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(64,224,208,.2); border-radius: 10px; background: rgba(64,224,208,.05); }
.security-strip label { display: flex; align-items: center; gap: 8px; margin: 0; color: #bdf8f2; }
.composer-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-top: 13px; }
.composer-actions label { min-width: 130px; }
label { display: grid; gap: 7px; margin-top: 13px; color: var(--muted); font-size: 13px; }
.hint { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.wall-section { margin-top: 34px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot.ready { background: #52e08f; } .dot.review { background: var(--gold); }
.wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 12px;
}
.screen {
  min-height: 205px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(22,32,48,.95), rgba(11,17,28,.95));
}
.screen.asked { border-color: rgba(255,209,102,.55); }
.screen-top { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.provider-badge { margin-left: auto; padding: 5px 8px; border-radius: 99px; color: var(--cyan); background: rgba(64,224,208,.08); }
.provider-name { margin-bottom: 6px; font-size: 21px; }
.provider-role { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.screen-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.screen-actions button { padding: 9px 8px; font-size: 12px; }
.check input { display: none; }
.check span { width: 16px; height: 16px; border: 1px solid #526078; border-radius: 5px; display: block; }
.check input:checked + span { background: var(--cyan); box-shadow: inset 0 0 0 3px #12202b; }
.review-grid { display: grid; grid-template-columns: minmax(310px,.8fr) minmax(380px,1.2fr); gap: 16px; margin-top: 34px; }
.scan-result { margin-top: 14px; padding: 12px; border-radius: 12px; font-size: 13px; }
.scan-result.neutral { background: #101827; color: var(--muted); }
.scan-result.safe { background: rgba(82,224,143,.1); color: #8bf0b4; }
.scan-result.warn { background: rgba(255,209,102,.1); color: var(--gold); }
.scan-result.danger { background: rgba(255,93,104,.1); color: #ff8f97; }
.tray-stats { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; }
.tray-stats div { padding: 12px 8px; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.tray-stats strong, .tray-stats span { display: block; }
.tray-stats strong { font-size: 22px; }.tray-stats span { color: var(--muted); font-size: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0; }
.filters button { padding: 7px 10px; font-size: 11px; }
.filters button.active { border-color: var(--cyan); color: var(--cyan); }
.logs { max-height: 500px; overflow: auto; display: grid; gap: 9px; }
.logs.empty { min-height: 170px; place-items: center; color: var(--muted); }
.log-item { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #0c1320; }
.log-head { display: flex; justify-content: space-between; gap: 10px; }
.log-head span { color: var(--cyan); font-size: 11px; }
.log-item p { margin: 8px 0; color: #c9d1dd; font-size: 12px; line-height: 1.45; white-space: pre-wrap; }
.classify { display: flex; flex-wrap: wrap; gap: 6px; }
.classify button { padding: 5px 8px; font-size: 10px; }
.classify button.selected { background: var(--cyan); color: #031716; }
@media (min-width: 1450px) {
  .wall[data-count="30"], .wall[data-count="40"], .wall[data-count="50"] { grid-template-columns: repeat(5, 1fr); }
  .wall[data-count="50"] .screen { min-height: 170px; }
}
@media (max-width: 820px) {
  .topbar { align-items: flex-start; }
  .status { display: none; }
  .review-grid { grid-template-columns: 1fr; }
  .tray-stats { grid-template-columns: repeat(3,1fr); }
  .screen-actions { grid-template-columns: 1fr; }
}
@media (max-width: 1220px) {
  .workspace-shell { grid-template-columns: 210px minmax(540px,1fr); }
  .inspector { display: none; }
  .topbar nav { display: none; }
}
@media (max-width: 860px) {
  .workspace-shell { display: block; }
  .provider-rail { position: static; margin-bottom: 12px; }
  #providerRail { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; }
  .bot-command { grid-template-columns: 1fr; }
  .bot-route { padding: 0 30px; }
}
