:root{
  --bg: #0B0E14;
  --panel: #121826;
  --panel-2: #171F30;
  --line: #253048;
  --ink: #E7ECF6;
  --ink-dim: #8B97AE;
  --accent: #FFB454;
  --wired: #6FE3C4;
  --wireless: #4FC7E8;
  --wan: #FF8C4B;
  --danger: #E8607A;
}
*{box-sizing:border-box; margin:0; padding:0;}
html,body{width:100%; height:100%; overflow:hidden; background:var(--bg); font-family:'Manrope',sans-serif; color:var(--ink);}
#scene{position:fixed; inset:0; display:block; touch-action:none;}
#labels{position:fixed; inset:0; pointer-events:none; z-index:5;}
.devlabel{
  position:absolute; transform:translate(-50%,-100%); white-space:nowrap;
  font-size:12px; font-weight:600; padding:3px 9px 3px 7px; border-radius:20px;
  background:rgba(18,24,38,.82); border:1px solid var(--line); color:var(--ink);
  display:flex; align-items:center; gap:6px; backdrop-filter:blur(3px);
}
.devlabel .dot{width:6px; height:6px; border-radius:50%; flex:none;}
.devlabel .ip{font-family:'JetBrains Mono',monospace; font-size:10px; color:var(--ink-dim);}

/* Toolbar */
#toolbar{
  position:fixed; top:12px; left:12px; right:12px; z-index:20;
  display:flex; align-items:center; gap:8px; flex-wrap:nowrap;
  max-width:calc(100vw - 24px);
}
#brand{display:flex; flex-direction:column; margin-right:4px; flex-shrink:0;}
#brand b{font-size:13px; font-weight:800; letter-spacing:.2px; white-space:nowrap;}
#brand span{font-size:9.5px; color:var(--ink-dim); white-space:nowrap;}
#devtray{
  display:flex; gap:4px; background:var(--panel); border:1px solid var(--line);
  padding:4px; border-radius:12px; flex-shrink:0;
}
.devbtn{
  display:flex; flex-direction:column; align-items:center; gap:3px;
  width:50px; padding:5px 3px 4px; border-radius:8px; border:1px solid transparent;
  background:transparent; color:var(--ink-dim); cursor:pointer; transition:.15s; flex-shrink:0;
}
.devbtn svg{width:18px; height:18px; stroke:var(--ink); fill:none; stroke-width:1.6;}
.devbtn span{font-size:9px; font-weight:600; color:var(--ink-dim);}
.devbtn:hover{background:var(--panel-2); border-color:var(--line); transform:translateY(-1px);}
.devbtn:active{transform:translateY(0);}

#actions{
  display:flex; gap:5px; margin-left:auto; align-items:center;
  overflow:visible; max-width:100%;
  padding:2px 0;
}

.actbtn{
  display:flex; align-items:center; gap:5px; padding:6px 10px; border-radius:8px;
  background:var(--panel); border:1px solid var(--line); color:var(--ink);
  font-family:'Manrope',sans-serif; font-size:11px; font-weight:600; cursor:pointer;
  transition:.15s; white-space:nowrap; flex-shrink:0;
}
.actbtn svg{width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:1.8; flex-shrink:0;}
.actbtn:hover{border-color:#3A4763;}
.actbtn.on{background:var(--accent); color:#1A1204; border-color:var(--accent);}
.actbtn.warn:hover{border-color:var(--danger); color:var(--danger);}
.toolbar-sep{width:1px; height:18px; background:var(--line); flex-shrink:0; margin:0 2px;}

/* Responsive Media Queries for LAN 3D Toolbar */
@media (max-width: 1440px) {
  .actbtn { padding: 5px 8px; font-size: 10.5px; gap: 4px; }
  .actbtn svg { width: 13px; height: 13px; }
}

@media (max-width: 1200px) {
  #actions .actbtn .btn-lbl { display: none; }
  #actions .actbtn { padding: 7px 9px; justify-content: center; }
}

@media (max-width: 860px) {
  #brand span { display: none; }
  #devtray { padding: 2px; gap: 2px; }
  .devbtn { width: 42px; padding: 4px 2px; }
  .devbtn span { font-size: 8px; }
}

@media (max-width: 600px) {
  #toolbar { top: 6px; left: 6px; right: 6px; gap: 4px; }
  #brand b { font-size: 11px; }
  .devbtn { width: 34px; padding: 3px 1px; }
  .devbtn span { display: none; }
  .topo-menu { max-width: 90vw; right: 0; }
}

/* Dropdown for Topologies, Rooms, Cables and Export */
.dropdown{position:relative; display:inline-flex; align-items:center;}
.topo-menu{
  display:none; position:absolute; top:calc(100% + 6px); right:0;
  background:var(--panel); border:1px solid var(--line); border-radius:12px;
  padding:8px; min-width:285px; max-height:82vh; overflow-y:auto; box-shadow:0 14px 35px rgba(0,0,0,0.88);
  z-index:100; flex-direction:column; gap:2px;
  backdrop-filter: blur(14px);
}
.topo-menu.show{display:flex;}
.topo-cat-title{
  font-size:9.5px; text-transform:uppercase; letter-spacing:0.8px;
  color:var(--ink-dim); padding:6px 8px 3px 8px; font-weight:800;
  border-top:1px solid rgba(255,255,255,0.06); margin-top:4px;
}
.topo-cat-title:first-child{
  border-top:none; margin-top:0; padding-top:2px;
}
.topo-item{
  display:flex; align-items:center; gap:8px; width:100%; padding:6.5px 10px;
  border-radius:8px; border:none; background:transparent; color:var(--ink);
  font-family:'Manrope',sans-serif; font-size:11px; font-weight:600;
  cursor:pointer; text-align:left; transition:.15s; white-space:nowrap;
}
.topo-item:hover{background:var(--panel-2); color:var(--accent);}

/* Panel, Room Inspector & Cable Inspector Panel */
#panel, #roomPanel, #cablePanel{
  position:fixed; top:12px; right:12px; bottom:12px; width:280px; z-index:22;
  background:var(--panel); border:1px solid var(--line); border-radius:14px;
  padding:16px; display:none; flex-direction:column; gap:12px; overflow-y:auto;
  box-shadow: 0 16px 40px rgba(0,0,0,0.8);
  backdrop-filter: blur(12px);
}
#panel.show, #roomPanel.show, #cablePanel.show{display:flex;}
#panel .ptop, #roomPanel .ptop, #cablePanel .ptop{display:flex; justify-content:space-between; align-items:flex-start;}
#panel h2, #roomPanel h2, #cablePanel h2{font-size:15px; font-weight:800;}
#panel .type, #roomPanel .type, #cablePanel .type{font-size:10px; color:var(--ink-dim); margin-top:2px; text-transform:uppercase; letter-spacing:.6px;}
#panel .xbtn, #roomPanel .xbtn, #cablePanel .xbtn{background:none; border:none; color:var(--ink-dim); cursor:pointer; font-size:17px; line-height:1;}
#panel .xbtn:hover, #roomPanel .xbtn:hover, #cablePanel .xbtn:hover{color:var(--ink);}
#panel label, #roomPanel label, #cablePanel label{font-size:10.5px; color:var(--ink-dim); display:block; margin-bottom:4px;}
#panel input[type=text], #roomPanel input[type=text], #cablePanel input[type=text]{
  width:100%; background:var(--panel-2); border:1px solid var(--line); border-radius:8px;
  padding:8px 9px; color:var(--ink); font-family:'Manrope',sans-serif; font-size:12px;
}
#panel input[type=text]:focus, #roomPanel input[type=text]:focus, #cablePanel input[type=text]:focus{outline:none; border-color:var(--accent);}

/* Room Color Chips */
.room-color-chip{
  width:24px; height:24px; border-radius:50%; border:2px solid rgba(255,255,255,0.25);
  cursor:pointer; transition:transform .15s, border-color .15s; outline:none;
}
.room-color-chip:hover{transform:scale(1.18);}
.room-color-chip.active{border-color:#FFF; box-shadow:0 0 10px rgba(255,255,255,0.85); transform:scale(1.22);}
.mono{font-family:'JetBrains Mono',monospace; font-size:11.5px; color:var(--ink);}
.kv{display:flex; justify-content:space-between; align-items:center; padding:6px 0; border-bottom:1px dashed var(--line);}
.kv:last-child{border-bottom:none;}
.kv .k{font-size:10.5px; color:var(--ink-dim);}
#connlist{display:flex; flex-direction:column; gap:5px;}
.connrow{
  display:flex; justify-content:space-between; align-items:center; gap:6px;
  background:var(--panel-2); border:1px solid var(--line); border-radius:8px; padding:6px 8px;
}
.connrow .lbl{font-size:11px; display:flex; align-items:center; gap:6px;}
.connrow .seg{width:14px; height:2px; border-radius:2px; flex:none;}
.connrow button{background:none; border:none; color:var(--ink-dim); cursor:pointer; font-size:14px;}
.connrow button:hover{color:var(--danger);}
#delDeviceBtn{
  margin-top:auto; display:flex; align-items:center; justify-content:center; gap:6px;
  background:rgba(232,96,122,.12); color:var(--danger); border:1px solid rgba(232,96,122,.35);
  padding:9px; border-radius:8px; font-weight:700; font-size:12px; cursor:pointer;
}
#delDeviceBtn:hover{background:rgba(232,96,122,.2);}
.empty{font-size:11px; color:var(--ink-dim); text-align:center; padding:8px 0;}

/* Legend */
#legend{
  position:fixed; left:12px; bottom:12px; z-index:20; background:var(--panel);
  border:1px solid var(--line); border-radius:10px; padding:6px 12px; display:flex; gap:12px;
}
.lgitem{display:flex; align-items:center; gap:6px; font-size:10px; color:var(--ink-dim);}
.lgline{width:16px; height:0; border-top:2px solid; border-radius:2px;}
.lgline.dashed{border-top-style:dashed;}

/* Hint */
#hint{
  position:fixed; left:50%; bottom:46px; transform:translateX(-50%); z-index:21;
  background:var(--panel); border:1px solid var(--line); padding:6px 14px; border-radius:16px;
  font-size:10.5px; color:var(--ink-dim); max-width:min(85vw,480px); text-align:center;
  transition:opacity .4s;
}
#hint b{color:var(--ink);}
#hint.hide{opacity:0; pointer-events:none;}

#toast{
  position:fixed; left:50%; top:12px; transform:translate(-50%,-140%); z-index:30;
  background:#1B2436; border:1px solid var(--line); color:var(--ink); padding:8px 14px;
  border-radius:18px; font-size:11.5px; font-weight:600; transition:transform .3s ease;
  pointer-events:none;
}
#toast.show{transform:translate(-50%,0);}

/* Panel Action Buttons */
.panel-act-btn{
  display:flex; align-items:center; justify-content:center; gap:7px;
  width:100%; padding:8px 10px; border-radius:8px; font-weight:700; font-size:11.5px;
  cursor:pointer; transition:all .15s ease; text-decoration:none;
}
.panel-act-btn.cli{
  background:rgba(0,230,118,0.12); color:#00FF87; border:1px solid rgba(0,230,118,0.35);
}
.panel-act-btn.cli:hover{ background:rgba(0,230,118,0.25); border-color:#00FF87; }
.panel-act-btn.pdu{
  background:rgba(255,180,84,0.12); color:#FFB454; border:1px solid rgba(255,180,84,0.35);
}
.panel-act-btn.pdu:hover{ background:rgba(255,180,84,0.25); border-color:#FFB454; }

/* Modals */
.sim-modal-overlay, .modal{
  position:fixed; inset:0; background:rgba(4,7,12,0.82); backdrop-filter:blur(6px);
  z-index:50; display:none; align-items:center; justify-content:center; padding:16px;
  overflow-y:auto;
}
.sim-modal-overlay.show, .modal.show{ display:flex; animation:modalFadeIn .2s ease; }
@keyframes modalFadeIn{ from{opacity:0; transform:scale(0.97);} to{opacity:1; transform:scale(1);} }

.sim-modal-box, .modal-box{
  background:var(--panel); border:1px solid var(--line); border-radius:14px;
  width:min(540px, 96vw); max-height:min(88vh, 680px);
  box-shadow:0 20px 50px rgba(0,0,0,0.85);
  display:flex; flex-direction:column; overflow:hidden;
  margin:auto;
}

/* Side Panels (Subnet Calc etc.) */
.side-panel{
  position:fixed; top:12px; right:12px; bottom:12px; width:300px; z-index:25;
  background:var(--panel); border:1px solid var(--line); border-radius:14px;
  padding:16px; display:none; flex-direction:column; gap:12px; overflow-y:auto;
  box-shadow:0 16px 40px rgba(0,0,0,0.8); backdrop-filter:blur(12px);
}
.side-panel.show{ display:flex; }
.side-panel-head{ display:flex; justify-content:space-between; align-items:center; }
.side-panel-body{ display:flex; flex-direction:column; gap:10px; }
.modal-head{
  flex:none;
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 18px; border-bottom:1px solid var(--line); background:var(--panel-2);
}
.modal-title{
  display:flex; align-items:center; gap:8px; font-weight:800; font-size:14px; color:var(--ink);
}
.modal-body{
  padding:16px 18px; display:flex; flex-direction:column; gap:12px; font-size:12px;
  overflow-y:auto; flex:1; min-height:0;
}
.modal-foot{
  flex:none;
  display:flex; justify-content:flex-end; gap:8px; padding:12px 18px;
  border-top:1px solid var(--line); background:var(--panel-2);
}
.form-grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.sim-select, .sim-input{
  width:100%; background:var(--panel-2); border:1px solid var(--line); border-radius:8px;
  padding:8px 10px; color:var(--ink); font-family:'Manrope',sans-serif; font-size:12px;
}
.sim-select:focus, .sim-input:focus{ outline:none; border-color:var(--accent); }

/* Protocol Selection Pills */
.proto-tabs{ display:flex; gap:6px; flex-wrap:wrap; margin-top:4px; }
.proto-btn{
  flex:1; min-width:100px; padding:7px 10px; border-radius:8px; border:1px solid var(--line);
  background:var(--panel-2); color:var(--ink-dim); font-size:11px; font-weight:700;
  cursor:pointer; transition:.15s; text-align:center;
}
.proto-btn:hover{ color:var(--ink); border-color:#3A4763; }
.proto-btn.active{
  background:rgba(255,180,84,0.15); color:var(--accent); border-color:var(--accent);
}

.sim-transfer-preview{
  background:#070B12; border:1px solid var(--line); border-radius:8px; padding:10px;
  font-family:'JetBrains Mono',monospace; font-size:11px; color:#6FE3C4;
  display:flex; flex-direction:column; gap:4px;
}

/* Cisco IOS CLI & PC Terminal Modal */
.cisco-terminal-window{
  background:#060B08; border:1px solid #1C3325; border-top:3px solid #00E676;
  border-radius:10px; width:min(840px, 96vw); height:540px; max-height:min(88vh, 560px);
  box-shadow:0 25px 60px rgba(0,0,0,0.9); display:flex; flex-direction:column;
  overflow:hidden; font-family:'JetBrains Mono',monospace; margin:auto;
}

/* Custom sleek scrollbars */
.modal-body::-webkit-scrollbar, .inbox-list::-webkit-scrollbar, .term-screen::-webkit-scrollbar, #panel::-webkit-scrollbar, .dock-body::-webkit-scrollbar{
  width:6px; height:6px;
}
.modal-body::-webkit-scrollbar-track, .inbox-list::-webkit-scrollbar-track, .term-screen::-webkit-scrollbar-track, #panel::-webkit-scrollbar-track, .dock-body::-webkit-scrollbar-track{
  background:transparent;
}
.modal-body::-webkit-scrollbar-thumb, .inbox-list::-webkit-scrollbar-thumb, .term-screen::-webkit-scrollbar-thumb, #panel::-webkit-scrollbar-thumb, .dock-body::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,0.18); border-radius:3px;
}
.modal-body::-webkit-scrollbar-thumb:hover, .inbox-list::-webkit-scrollbar-thumb:hover, .term-screen::-webkit-scrollbar-thumb:hover, #panel::-webkit-scrollbar-thumb:hover, .dock-body::-webkit-scrollbar-thumb:hover{
  background:rgba(255,255,255,0.35);
}
.term-head{
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 14px; background:#0B160E; border-bottom:1px solid #1C3325;
}
.term-head-left{ display:flex; align-items:center; gap:12px; }
.term-dots{ display:flex; gap:6px; }
.term-dots .dot{ width:10px; height:10px; border-radius:50%; }
.term-dots .dot.red{ background:#EF4444; }
.term-dots .dot.yellow{ background:#F59E0B; }
.term-dots .dot.green{ background:#10B981; }
.term-title{ font-size:12px; font-weight:700; color:#E7ECF6; }
.term-dev-select{
  background:#122317; border:1px solid #1C3325; color:#00FF87;
  font-family:'JetBrains Mono',monospace; font-size:11px; font-weight:700;
  padding:3px 8px; border-radius:4px; cursor:pointer;
}
.term-quick-bar{
  display:flex; gap:4px; padding:6px 12px; background:#08110B; border-bottom:1px solid #14241B;
  overflow-x:auto; -webkit-overflow-scrolling:touch;
}
.tq-btn{
  background:rgba(0,230,118,0.08); border:1px solid rgba(0,230,118,0.2); color:#A7F3D0;
  font-family:'JetBrains Mono',monospace; font-size:10px; font-weight:600;
  padding:3px 8px; border-radius:4px; cursor:pointer; white-space:nowrap; transition:.15s;
}
.tq-btn:hover{ background:rgba(0,230,118,0.22); color:#00FF87; }
.term-screen{
  flex:1; padding:14px; background:#050906; color:#00FF87; font-size:11.5px;
  line-height:1.5; overflow-y:auto; white-space:pre-wrap; word-break:break-word;
}
.term-screen .dim{ color:#52796F; }
.term-screen .err{ color:#F87171; }
.term-screen .warn{ color:#FBBF24; }
.term-screen .info{ color:#38BDF8; }
.term-screen .bold{ font-weight:700; color:#FFFFFF; }
.term-input-row{
  display:flex; align-items:center; gap:8px; padding:8px 14px; background:#0A140E;
  border-top:1px solid #14241B;
}
.term-prompt{ font-size:12px; font-weight:700; color:#00FF87; white-space:nowrap; }
.term-input{
  flex:1; background:transparent; border:none; color:#FFFFFF;
  font-family:'JetBrains Mono',monospace; font-size:12px; outline:none;
}

/* Cisco Packet Tracer Simulation Dock */
.sim-dock{
  position:fixed; left:12px; right:12px; bottom:12px; height:185px; z-index:28;
  background:rgba(14,20,32,0.95); border:1px solid var(--line); border-radius:12px;
  box-shadow:0 12px 35px rgba(0,0,0,0.85); backdrop-filter:blur(10px);
  display:none; flex-direction:column; overflow:hidden;
}
.sim-dock.show{ display:flex; animation:dockSlideUp .25s ease; }
@keyframes dockSlideUp{ from{transform:translateY(100%);} to{transform:translateY(0);} }

.dock-header{
  display:flex; justify-content:space-between; align-items:center; padding:8px 14px;
  background:var(--panel-2); border-bottom:1px solid var(--line); gap:10px; flex-wrap:wrap;
}
.dock-title{ display:flex; align-items:center; gap:8px; font-size:12px; color:var(--ink); }
.dock-title .pulse-dot{
  width:7px; height:7px; border-radius:50%; background:#00E676; box-shadow:0 0 8px #00E676;
}
.dock-status{ font-size:10px; color:var(--ink-dim); font-family:'JetBrains Mono',monospace; }
.dock-controls{ display:flex; align-items:center; gap:8px; margin-left:auto; }
.speed-box{ display:flex; align-items:center; gap:4px; font-size:10.5px; color:var(--ink-dim); }
.sim-mini-select{
  background:var(--panel); border:1px solid var(--line); color:var(--ink);
  padding:3px 6px; border-radius:6px; font-size:10px; font-family:'Manrope',sans-serif;
}
.dock-body{ flex:1; overflow-y:auto; padding:6px 12px; }
.sim-table{
  width:100%; border-collapse:collapse; font-size:11px; font-family:'JetBrains Mono',monospace;
}
.sim-table th{
  text-align:left; padding:5px 8px; color:var(--ink-dim); font-size:10px;
  border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--panel);
}
.sim-table td{ padding:5px 8px; border-bottom:1px solid rgba(37,48,72,0.4); color:var(--ink); }
.sim-table .badge{
  display:inline-block; padding:2px 6px; border-radius:4px; font-size:9.5px; font-weight:700;
}
.badge.icmp{ background:rgba(79,199,232,0.15); color:#4FC7E8; }
.badge.ftp{ background:rgba(255,180,84,0.15); color:#FFB454; }
.badge.http{ background:rgba(236,72,153,0.15); color:#EC4899; }
.badge.arp{ background:rgba(111,227,196,0.15); color:#6FE3C4; }

@media (max-width: 760px){
  #toolbar{top:8px; left:8px; right:8px; gap:6px;}
  #brand b{font-size:11px;}
  #brand span{font-size:8.5px;}
  #devtray{gap:3px; padding:3px; max-width:100%; overflow-x:auto;}
  .devbtn{width:40px; padding:4px 2px;}
  .devbtn svg{width:15px; height:15px;}
  .devbtn span{font-size:8px;}
  #actions{gap:4px; margin-left:auto;}
  .actbtn{padding:5px 8px; font-size:10px; border-radius:7px; gap:4px;}
  .actbtn svg{width:12px; height:12px;}
  #panel{left:8px; right:8px; top:8px; bottom:8px; width:auto; padding:12px;}
  #legend{left:8px; bottom:8px; padding:5px 9px; gap:8px; flex-wrap:wrap;}
  .lgitem{font-size:9px;}
  #hint{bottom:42px; font-size:9.5px; padding:5px 10px; max-width:92vw;}
  .sim-dock{height:140px; left:6px; right:6px; bottom:6px;}
}

/* IP Configuration Card */
.ip-config-card{
  background:var(--panel-2); border:1px solid var(--line); border-radius:10px; padding:10px;
  display:flex; flex-direction:column; gap:6px;
}
.ip-mode-switch{
  display:flex; background:var(--panel); border-radius:6px; padding:2px; border:1px solid var(--line);
}
.ip-mode-btn{
  background:none; border:none; color:var(--ink-dim); font-size:10px; font-weight:700;
  padding:2px 7px; border-radius:4px; cursor:pointer; transition:.15s;
}
.ip-mode-btn.active{
  background:var(--accent); color:#000;
}
.ip-fields{ display:flex; flex-direction:column; gap:5px; }
.field-row{ display:flex; align-items:center; gap:6px; }
.f-lbl{ font-size:10.5px; color:var(--ink-dim); width:45px; font-family:'JetBrains Mono',monospace; }
.ip-field-input{
  flex:1; background:var(--panel); border:1px solid var(--line); border-radius:6px;
  padding:4px 8px; color:var(--ink); font-family:'JetBrains Mono',monospace; font-size:11px;
}
.ip-field-input:focus{ outline:none; border-color:var(--accent); }

.panel-act-btn.msg{
  background:rgba(167,139,250,0.12); color:#A78BFA; border:1px solid rgba(167,139,250,0.35);
}
.panel-act-btn.msg:hover{ background:rgba(167,139,250,0.22); border-color:#A78BFA; }

/* Inbox List */
.inbox-list{
  display:flex; flex-direction:column; gap:4px; max-height:120px; overflow-y:auto;
}
.inbox-item{
  background:var(--panel-2); border:1px solid var(--line); border-radius:6px;
  padding:6px 8px; font-size:10.5px; display:flex; flex-direction:column; gap:2px;
}
.inbox-item b{ color:#A78BFA; }
.inbox-item .time{ font-size:9px; color:var(--ink-dim); }

/* 3D Floating Speech Bubble */
.speech-bubble{
  position:absolute; transform:translate(-50%, -150%);
  background:rgba(18,24,38,0.92); border:1.5px solid #A78BFA; color:#FFF;
  padding:6px 12px; border-radius:14px; font-size:11.5px; font-weight:600;
  box-shadow:0 6px 20px rgba(0,0,0,0.8), 0 0 12px rgba(167,139,250,0.4);
  pointer-events:none; z-index:15; white-space:nowrap;
  animation:bubblePop .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.speech-bubble::after{
  content:''; position:absolute; bottom:-6px; left:50%; transform:translateX(-50%);
  border-width:6px 6px 0; border-style:solid; border-color:rgba(18,24,38,0.92) transparent;
}
@keyframes bubblePop{
  from{ opacity:0; transform:translate(-50%, -120%) scale(0.8); }
  to{ opacity:1; transform:translate(-50%, -150%) scale(1); }
}

.port-select-card{
  background:var(--panel-2); border:1px solid var(--line); border-radius:8px; padding:10px;
  display:flex; flex-direction:column; gap:4px;
}

/* Wi-Fi Management Styles */
.panel-act-btn.wifi{
  background:rgba(56,189,248,0.12); color:#38BDF8; border:1px solid rgba(56,189,248,0.35);
}
.panel-act-btn.wifi:hover{ background:rgba(56,189,248,0.22); border-color:#38BDF8; }

.wifi-net-item{
  background:var(--panel-2); border:1px solid var(--line); border-radius:8px;
  padding:8px 12px; display:flex; align-items:center; justify-content:space-between;
  transition:.15s;
}
.wifi-net-item:hover{
  border-color:rgba(56,189,248,0.5); background:rgba(56,189,248,0.06);
}
.wifi-net-info{
  display:flex; flex-direction:column; gap:2px;
}
.wifi-net-title{
  display:flex; align-items:center; gap:6px; font-weight:700; font-size:12px; color:var(--ink);
}
.wifi-net-meta{
  display:flex; align-items:center; gap:8px; font-size:10px; color:var(--ink-dim);
}
.wifi-signal-bars{
  display:flex; align-items:flex-end; gap:2px; height:12px;
}
.wifi-bar{
  width:3px; background:rgba(255,255,255,0.2); border-radius:1px;
}
.wifi-bar.active{
  background:#38BDF8;
}
.wifi-bar:nth-child(1){ height:3px; }
.wifi-bar:nth-child(2){ height:6px; }
.wifi-bar:nth-child(3){ height:9px; }
.wifi-bar:nth-child(4){ height:12px; }

.switch-lbl input[type=checkbox]{
  accent-color:#38BDF8; cursor:pointer; width:14px; height:14px;
}

/* ==========================================================================
   FPS CROSSHAIR & PROXIMITY TARGET HUD
   ========================================================================== */
#crosshair{
  position:fixed; top:50%; left:50%; transform:translate(-50%, -50%);
  width:32px; height:32px; pointer-events:none; z-index:25;
}
.ch-dot{
  position:absolute; top:50%; left:50%; transform:translate(-50%, -50%);
  width:4px; height:4px; border-radius:50%; background:rgba(255,255,255,0.75);
  transition:all .15s ease;
}
.ch-line{
  position:absolute; background:rgba(255,255,255,0.4); transition:all .15s ease;
}
.ch-top{ top:2px; left:50%; transform:translateX(-50%); width:2px; height:7px; }
.ch-bottom{ bottom:2px; left:50%; transform:translateX(-50%); width:2px; height:7px; }
.ch-left{ left:2px; top:50%; transform:translateY(-50%); width:7px; height:2px; }
.ch-right{ right:2px; top:50%; transform:translateY(-50%); width:7px; height:2px; }

#crosshair.locked .ch-dot{
  background:#00FF87; box-shadow:0 0 8px #00FF87; width:6px; height:6px;
}
#crosshair.locked .ch-line{
  background:#00FF87; box-shadow:0 0 6px rgba(0,255,135,0.6);
}
#crosshair.locked .ch-top{ top:0; }
#crosshair.locked .ch-bottom{ bottom:0; }
#crosshair.locked .ch-left{ left:0; }
#crosshair.locked .ch-right{ right:0; }

#fpsTargetBadge{
  position:absolute; top:calc(100% + 14px); left:50%; transform:translateX(-50%);
  background:rgba(11,15,24,0.92); border:1px solid #00FF87; border-radius:20px;
  padding:5px 14px; font-size:11px; font-weight:700; color:#E7ECF6;
  white-space:nowrap; box-shadow:0 4px 18px rgba(0,0,0,0.8), 0 0 10px rgba(0,255,135,0.3);
  pointer-events:none; animation:fadeInUp .2s ease;
}
#fpsTargetBadge b{ color:#00FF87; margin-right:4px; }

@keyframes fadeInUp{
  from{ opacity:0; transform:translate(-50%, -4px); }
  to{ opacity:1; transform:translate(-50%, 0); }
}

/* FPS Quick Guide Banner */
.fps-hud{
  position:fixed; bottom:22px; left:50%; transform:translateX(-50%); z-index:22;
  background:rgba(14,20,32,0.9); border:1px solid var(--line); border-radius:24px;
  padding:7px 18px; font-size:11px; color:var(--ink-dim); display:none;
  align-items:center; gap:8px; backdrop-filter:blur(6px);
  box-shadow:0 6px 20px rgba(0,0,0,0.6); pointer-events:none; transition:opacity .4s ease;
}
.fps-hud.show{ display:flex; }
.fps-hud b{ color:#00FF87; font-family:'JetBrains Mono',monospace; font-size:10.5px; }

/* Mini Radar / Room Compass */
#miniRadar{
  position:fixed; right:16px; bottom:16px; z-index:22;
  width:105px; height:105px; border-radius:50%;
  background:rgba(11,16,26,0.85); border:1px solid rgba(56,189,248,0.4);
  box-shadow:0 8px 24px rgba(0,0,0,0.7), 0 0 14px rgba(56,189,248,0.2);
  display:none; pointer-events:none; overflow:hidden;
}
#radarCanvas{ display:block; }
.radar-title{
  position:absolute; bottom:6px; left:50%; transform:translateX(-50%);
  font-size:7.5px; font-weight:800; color:#38BDF8; letter-spacing:0.6px;
  text-transform:uppercase; opacity:0.85; pointer-events:none;
}

/* ==========================================================================
     MULTIPLAYER MODAL & COLLAB USER LIST
     ========================================================================== */
.collab-user-item{
  display:flex; align-items:center; gap:8px;
  background:var(--panel-2); border:1px solid var(--line); border-radius:8px;
  padding:6px 10px; font-size:11px; color:var(--ink);
}
.collab-user-item.self{
  border-color:rgba(0,255,135,0.4); background:rgba(0,255,135,0.06);
}
.collab-dot{
  width:8px; height:8px; border-radius:50%; flex:none;
}

/* ==========================================================================
     IN-ROOM COLLABORATIVE TEAM CHAT OVERLAY
     ========================================================================== */
.collab-chat-overlay{
  position:fixed; left:16px; bottom:60px; width:280px; z-index:23;
  background:rgba(18,24,38,0.92); border:1px solid var(--line); border-radius:12px;
  backdrop-filter:blur(8px); box-shadow:0 12px 30px rgba(0,0,0,0.85);
  display:flex; flex-direction:column; overflow:hidden;
}
.collab-chat-head{
  padding:8px 12px; background:var(--panel-2); border-bottom:1px solid var(--line);
  display:flex; justify-content:space-between; align-items:center;
}
.collab-chat-body{
  padding:8px 10px; display:flex; flex-direction:column; gap:5px;
  max-height:140px; overflow-y:auto; font-size:11px;
}
.collab-chat-msg{
  background:rgba(255,255,255,0.03); border-radius:6px; padding:4px 8px;
  display:flex; flex-direction:column; gap:1px; line-height:1.4;
}
.collab-chat-foot{
  display:flex; gap:6px; padding:6px 10px; background:var(--panel-2); border-top:1px solid var(--line);
}
.collab-chat-foot input{
  flex:1; background:var(--panel); border:1px solid var(--line); border-radius:6px;
  padding:5px 8px; color:var(--ink); font-size:11px; font-family:'Manrope',sans-serif;
}
.collab-chat-foot input:focus{ outline:none; border-color:#A78BFA; }
.collab-chat-foot button{
  background:#A78BFA; border:none; color:#0A0D14; font-weight:700;
  font-size:10.5px; border-radius:6px; padding:5px 10px; cursor:pointer;
}
.collab-chat-foot button:hover{ background:#C4B5FD; }

/* ==========================================================================
   MODELLAR KATALOGI (3D HARDWARE & CABLES CATALOG) STYLES
   ========================================================================== */
.models-catalog-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
  gap:10px; padding:4px 2px;
}
.model-card{
  background:var(--panel-2); border:1px solid var(--line); border-radius:10px;
  padding:12px; display:flex; flex-direction:column; transition:all .2s ease;
}
.model-card:hover{
  border-color:rgba(255,180,84,0.5); background:rgba(255,180,84,0.04);
  transform:translateY(-2px); box-shadow:0 6px 18px rgba(0,0,0,0.5);
}
.brand-badge{
  font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px;
  color:#FFB454; background:rgba(255,180,84,0.12); padding:2px 6px; border-radius:4px;
}
.cat-badge{
  font-size:9.5px; font-weight:700; color:var(--ink-dim);
  background:rgba(255,255,255,0.05); padding:2px 6px; border-radius:4px;
}
.port-tag{
  font-family:'JetBrains Mono',monospace; font-size:9.5px; font-weight:600;
  color:#00FF87; background:rgba(0,255,135,0.1); border:1px solid rgba(0,255,135,0.25);
  padding:1px 5px; border-radius:4px;
}
.cable-color-dot{
  width:10px; height:10px; border-radius:50%; flex:none;
}

/* ================================================================
   YANGI KOMPONENTLAR STILLARI
   ================================================================ */

/* Toolbar ajratuvchi chiziq */
.toolbar-sep {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 2px;
  flex: none;
}

/* ── Side Panel (Subnet Kalkulyator) ── */
.side-panel {
  position: fixed;
  top: 80px;
  right: -340px;
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  z-index: 30;
  transition: right 0.28s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 32px rgba(0,0,0,0.5);
  overflow: hidden;
}
.side-panel.show {
  right: 12px;
}
.side-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.side-panel-body {
  padding: 14px;
  max-height: 80vh;
  overflow-y: auto;
}

/* ── Subnet hisob natijalari ── */
.subnet-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.subnet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
}
.subnet-row:last-child { border-bottom: none; }
.subnet-row:hover { background: rgba(255,255,255,0.03); }
.subnet-label {
  color: var(--ink-dim);
  flex: 1;
}
.subnet-val {
  font-weight: 700;
  text-align: right;
}

/* ── Storage Slots ── */
.storage-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: background 0.15s;
}
.storage-slot:hover { background: rgba(255,255,255,0.03); }
.storage-slot.empty { opacity: 0.55; }
.storage-slot-num {
  font-size: 10px;
  color: var(--ink-dim);
  font-family: 'JetBrains Mono', monospace;
}
.storage-slot-name {
  font-size: 13px;
  font-weight: 700;
}
.storage-slot-meta {
  font-size: 10px;
  color: var(--ink-dim);
  margin-top: 2px;
}
.storage-slot-actions {
  display: flex;
  gap: 5px;
  flex: none;
}

/* ── Quiz Kartochkalar ── */
.quiz-task-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.quiz-task-card:hover {
  background: rgba(255,180,84,0.06);
  border-color: rgba(255,180,84,0.4);
  transform: translateX(3px);
}
.quiz-task-card.completed {
  border-color: rgba(0,255,135,0.35);
  background: rgba(0,255,135,0.04);
}
.quiz-description {
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.7;
  padding: 10px;
  background: var(--panel-2);
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  white-space: pre-line;
}

/* ── DHCP Lease Qatorlar ── */
.dhcp-lease-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.dhcp-lease-row:last-child { border-bottom: none; }
.dhcp-lease-row .mono {
  font-family: 'JetBrains Mono', monospace;
  min-width: 100px;
}

/* ── line-bright var mavjud bo'lmasa ── */
:root {
  --line-bright: rgba(255,255,255,0.12);
}

/* ── VLAN Manager & Port Matrix Stillari ── */
.vlan-color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.vlan-port-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 220px;
  overflow-y: auto;
}

.vlan-port-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 46px;
}

.vlan-port-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.vlan-port-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.vlan-port-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
}

.vlan-port-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.vlan-port-body {
  display: flex;
  justify-content: center;
}

.vlan-port-mode-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid transparent;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vlan-port-mode-badge.trunk {
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ── Cable Selection Grid & Inspector Stillari ── */
.cable-select-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 2px;
}

.cable-select-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}

.cable-select-card.compatible:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateX(2px);
}

.cable-select-card.active {
  background: rgba(56, 189, 248, 0.1);
  border-color: #38BDF8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.cable-select-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.05);
}

.cable-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  letter-spacing: 0.2px;
}

.cable-badge.rec {
  background: rgba(251, 191, 36, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.cable-badge.ok {
  background: rgba(0, 230, 118, 0.15);
  color: #00E676;
  border: 1px solid rgba(0, 230, 118, 0.35);
}

.cable-badge.no {
  background: rgba(248, 113, 113, 0.15);
  color: #F87171;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.cable-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Multiplayer & Collab Stillari ── */
.collab-admin-badge {
  background: rgba(251, 191, 36, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(251, 191, 36, 0.45);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.collab-role-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
}
.collab-role-tag.admin {
  background: rgba(251, 191, 36, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.collab-role-tag.guest {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.collab-chat-overlay {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 320px;
  height: 260px;
  background: rgba(11, 15, 24, 0.88);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  z-index: 35;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.collab-chat-head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.collab-chat-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}

.collab-chat-msg {
  line-height: 1.4;
  word-break: break-word;
}

.collab-chat-foot {
  display: flex;
  padding: 6px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  gap: 6px;
}

.collab-chat-foot input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--ink);
  font-size: 11px;
}
.collab-chat-foot input:focus {
  outline: none;
  border-color: #A78BFA;
}

.collab-chat-foot button {
  background: #A78BFA;
  color: #0A0D14;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.collab-user-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 11px;
  margin-bottom: 4px;
}

.collab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Voice Chat & Audio Stillari ── */
.collab-chat-voice-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  background: rgba(0, 255, 135, 0.06);
  border-bottom: 1px solid rgba(0, 255, 135, 0.2);
}

.collab-vu-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.collab-vu-fill {
  height: 100%;
  background: linear-gradient(90deg, #00FF87, #FBBF24, #EF4444);
  width: 0%;
  transition: width 0.08s ease;
  border-radius: 4px;
}

.collab-vol-slider {
  width: 50px;
  height: 4px;
  accent-color: #00FF87;
  cursor: pointer;
}

.collab-speaking-icon {
  color: #00FF87;
  display: inline-block;
  animation: pulseVoice 0.6s infinite alternate;
}

@keyframes pulseVoice {
  from { transform: scale(1.0); opacity: 0.7; }
  to { transform: scale(1.25); opacity: 1.0; }
}

/* ATT-25 Animated Crest */
@keyframes attLogoSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes attCorePulse { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px #00FF87); } 50% { transform: scale(1.18); filter: drop-shadow(0 0 10px #00F0FF); } }
@keyframes attPhotonFlow { 0% { stroke-dashoffset: 24; } 100% { stroke-dashoffset: 0; } }
.att-animated-logo .logo-radar-ring { transform-origin: 32px 36px; animation: attLogoSpin 12s linear infinite; }
.att-animated-logo .logo-core-pulse { transform-origin: 32px 35.5px; animation: attCorePulse 2.4s ease-in-out infinite; }
.att-animated-logo .logo-photon-track { stroke-dasharray: 4 6; animation: attPhotonFlow 1.8s linear infinite; }



