* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; background: #10161d; color: #e8eef5; overflow: hidden; }

#cv { position: fixed; inset: 0; display: block; cursor: grab; }
#cv:active { cursor: grabbing; }

#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 46px;
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
  background: linear-gradient(180deg, rgba(10,14,20,.92), rgba(10,14,20,.55));
  border-bottom: 1px solid rgba(255,255,255,.08);
  z-index: 10; backdrop-filter: blur(6px);
}
.t-title { font-weight: 800; font-size: 15px; letter-spacing: .5px; color: #9fe8a8; white-space: nowrap; }
.t-status { font-size: 12px; color: #9fb4c8; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-btns { display: flex; gap: 6px; }

.b {
  background: #223041; color: #e8eef5; border: 1px solid #3a4d63;
  border-radius: 8px; padding: 7px 12px; font-size: 12.5px; cursor: pointer;
  transition: background .15s, transform .1s;
}
.b:hover { background: #2e4258; }
.b:active { transform: scale(.97); }
.b.small { padding: 5px 9px; font-size: 12px; }
.b.danger { background: #4a1f1f; border-color: #7a3a3a; }

#side {
  position: fixed; right: 10px; top: 56px; bottom: 10px; width: 330px;
  background: rgba(13,18,26,.86); border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px; display: flex; flex-direction: column; z-index: 9;
  backdrop-filter: blur(6px); overflow: hidden;
}
.tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,.08); }
.tabbtn {
  flex: 1; padding: 9px 4px; background: transparent; border: none; color: #8fa3b8;
  font-size: 12px; cursor: pointer; border-bottom: 2px solid transparent;
}
.tabbtn.on { color: #fff; border-bottom-color: #7fd0ff; background: rgba(127,208,255,.07); }
.feed-wrap { flex: 1; overflow-y: auto; }
.feed { padding: 6px; font-size: 12px; }
.fei {
  padding: 5px 7px; border-radius: 7px; margin-bottom: 4px; cursor: pointer;
  border-left: 3px solid transparent; line-height: 1.35; word-break: break-word;
}
.fei:hover { background: rgba(255,255,255,.05); border-left-color: #7fd0ff; }
.f-th { color: #ffd76a; }
.f-ms { color: #9fe8a8; }
.dim { opacity: .62; font-weight: 400; }

#agentPanel {
  position: fixed; left: 12px; bottom: 12px; width: 300px; max-height: 72vh; overflow-y: auto;
  background: rgba(13,18,26,.93); border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 12px; z-index: 11; backdrop-filter: blur(6px);
}
.ap-head { margin-bottom: 8px; }
.ap-name { font-size: 17px; font-weight: 800; }
.ap-sub { font-size: 12px; color: #9fb4c8; }
.ap-row { font-size: 12.5px; margin: 4px 0; line-height: 1.4; }
.ap-meters { margin: 8px 0; }
.meter { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: 11px; color: #9fb4c8; }
.meter span { width: 62px; }
.meter .bar { flex: 1; height: 6px; background: #223041; border-radius: 3px; overflow: hidden; }
.meter .bar div { height: 100%; background: linear-gradient(90deg, #4c9ae2, #7fd0ff); }
.ap-th { font-size: 11px; color: #ffd76a; margin-top: 8px; }
.ap-thought { font-size: 12px; font-style: italic; color: #cfe0ef; margin: 3px 0 8px; line-height: 1.4; }
.ap-status { color: #9fe8a8; }
.ap-btns { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.mchip { font-family: monospace; }
.sel {
  background: #1a2533; color: #e8eef5; border: 1px solid #3a4d63;
  border-radius: 7px; padding: 5px 7px; font-size: 12px;
}
.sel.small { font-size: 12px; }

#modalBack {
  position: fixed; inset: 0; background: rgba(5,8,12,.72); z-index: 20;
  align-items: center; justify-content: center;
}
#modal {
  width: min(640px, 94vw); max-height: 88vh; overflow-y: auto;
  background: #141c26; border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
}
.m-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.1);
  position: sticky; top: 0; background: #141c26;
}
.m-title { font-weight: 800; letter-spacing: .5px; }
.m-body { padding: 14px 16px; }
.m-sec { font-size: 12px; font-weight: 700; color: #7fd0ff; margin: 16px 0 6px; text-transform: uppercase; letter-spacing: .4px; }
.adm-box { background: #0f1620; border: 1px solid rgba(255,255,255,.07); border-radius: 9px; padding: 8px 10px; margin-bottom: 8px; }
.adm-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; margin: 4px 0; }
.adm-status { font-size: 13px; color: #9fe8a8; padding: 8px 10px; background: #0f1620; border-radius: 9px; border: 1px solid rgba(159,232,168,.2); }

#toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: rgba(10,14,20,.95); border: 1px solid rgba(255,255,255,.15);
  color: #fff; padding: 9px 18px; border-radius: 999px; font-size: 13px;
  opacity: 0; transition: opacity .3s; z-index: 30; max-width: 80vw; text-align: center;
  pointer-events: none;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #2e4258; border-radius: 4px; }
