:root {
  --bg: #04070c;
  --panel: rgba(7, 15, 23, 0.82);
  --panel-solid: #070f17;
  --cyan: #00e5ff;
  --cyan-2: #43f3ff;
  --cyan-dim: rgba(0, 229, 255, 0.32);
  --cyan-faint: rgba(0, 229, 255, 0.1);
  --gold: #ffb347;
  --gold-dim: rgba(255, 179, 71, 0.35);
  --green: #3dff9e;
  --red: #ff5370;
  --violet: #b388ff;
  --text: #cfe8f2;
  --dim: #6d8894;
  --line: rgba(0, 229, 255, 0.18);
  --mono: "Orbitron", sans-serif;
  --body: "Rajdhani", "Segoe UI", sans-serif;
  --log: ui-monospace, "JetBrains Mono", Consolas, monospace;
  --topbar: 62px;
  --nav: 88px;
  --rail: 296px;
  --cut: polygon(0 14px, 14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -12%, rgba(0, 229, 255, 0.12), transparent),
    radial-gradient(ellipse 60% 45% at 85% 115%, rgba(255, 179, 71, 0.07), transparent),
    radial-gradient(ellipse 45% 35% at 8% 100%, rgba(179, 136, 255, 0.05), transparent);
}

::selection { background: rgba(0, 229, 255, 0.3); }

/* ---------- backdrop ---------- */

.grid-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 95% 85% at 50% 35%, black 25%, transparent 100%);
}
.scanline {
  position: fixed; left: 0; right: 0; top: 0; height: 140px; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0, 229, 255, 0.04), transparent);
  animation: scan 10s linear infinite;
  will-change: transform;
}
/* transform se animate karo (top se layout har frame recalc hota tha) */
@keyframes scan { 0% { transform: translateY(-140px); } 100% { transform: translateY(100vh); } }

/* ---------- topbar ---------- */

#topbar {
  position: relative; z-index: 20;
  height: var(--topbar);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 18px;
  gap: 14px;
  background: rgba(5, 11, 18, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
}

.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; color: inherit; justify-self: start; }

.reactor { position: relative; width: 40px; height: 40px; flex: 0 0 40px; }
.reactor .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; }
.reactor .r1 { border-top-color: var(--cyan); border-bottom-color: var(--cyan); animation: spin 3.2s linear infinite; }
.reactor .r2 { inset: 6px; border-left-color: var(--gold); border-right-color: var(--gold); animation: spin 2s linear infinite reverse; }
.reactor .r3 { inset: 12px; border-color: rgba(0,229,255,.25); border-top-color: var(--cyan-2); animation: spin 4.5s linear infinite; }
.reactor .core {
  position: absolute; inset: 13px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--cyan) 45%, #0088aa);
  box-shadow: 0 0 12px var(--cyan), 0 0 30px rgba(0, 229, 255, 0.55);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 6px var(--cyan), 0 0 16px rgba(0, 229, 255, 0.35); } }
body.busy .reactor .core {
  background: radial-gradient(circle at 35% 35%, #fff, var(--gold) 45%, #aa6600);
  box-shadow: 0 0 14px var(--gold), 0 0 36px rgba(255, 179, 71, 0.7);
}
body.busy .reactor .r1 { border-top-color: var(--gold); border-bottom-color: var(--gold); }

.title {
  font-family: var(--mono); font-weight: 800; font-size: 19px;
  letter-spacing: 5px; color: #eafcff;
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.55);
  white-space: nowrap;
}
.title .sub {
  display: block; font-family: var(--body); font-weight: 600; font-size: 10px;
  letter-spacing: 4px; color: var(--dim); text-shadow: none; text-transform: uppercase;
}

.clock { text-align: center; line-height: 1.1; user-select: none; }
.clock .c-time {
  display: block; font-family: var(--mono); font-weight: 700; font-size: 30px;
  letter-spacing: 6px; color: var(--cyan-2);
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.6);
  font-variant-numeric: tabular-nums;
}
.clock .c-date {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: 3.5px;
  color: var(--dim); text-transform: uppercase; margin-top: 2px;
}

.top-right { display: flex; align-items: center; gap: 10px; justify-self: end; }

#wave { opacity: 0.9; }

.status {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px;
  color: var(--dim); text-transform: uppercase;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 8px var(--red);
}
.status.ok .dot { background: var(--green); box-shadow: 0 0 8px var(--green); animation: blinkg 2.2s ease-in-out infinite; }
.status.ok { color: #9fe8c4; }
@keyframes blinkg { 50% { opacity: 0.45; } }

.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  background: rgba(0, 229, 255, 0.06);
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  cursor: pointer;
  transition: 0.15s;
}
.icon-btn:hover { background: rgba(0, 229, 255, 0.16); box-shadow: 0 0 16px rgba(0, 229, 255, 0.35); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .ic-stop { display: none; }
.icon-btn.listening {
  color: #fff; background: rgba(255, 83, 112, 0.3);
  border-color: var(--red); box-shadow: 0 0 18px rgba(255, 83, 112, 0.65);
  animation: glowr 1.2s ease-in-out infinite;
}
.icon-btn.listening .ic-mic { display: none; }
.icon-btn.listening .ic-stop { display: block; }
@keyframes glowr { 50% { box-shadow: 0 0 28px rgba(255, 83, 112, 0.95); } }

/* ---------- shell ---------- */

#shell {
  position: relative; z-index: 5;
  flex: 1;
  display: grid;
  grid-template-columns: var(--nav) 1fr var(--rail);
  min-height: 0;
}

/* sidebar */

#sidebar {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 14px 0;
  background: rgba(5, 11, 18, 0.85);
  border-right: 1px solid var(--line);
}
#sidebar a {
  position: relative;
  width: 66px; padding: 10px 0 7px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--dim); text-decoration: none;
  font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase;
  border: 1px solid transparent;
  transition: 0.15s;
}
#sidebar a svg { width: 22px; height: 22px; }
#sidebar a:hover { color: var(--cyan); background: rgba(0, 229, 255, 0.06); }
#sidebar a.active {
  color: var(--cyan);
  border-color: var(--cyan-dim);
  background: rgba(0, 229, 255, 0.1);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.7);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
#sidebar a.active::before {
  content: ""; position: absolute; left: -1px; top: 15%; bottom: 15%;
  width: 3px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
}
.nav-spacer { flex: 1; }
.nav-ver {
  font-family: var(--mono); font-size: 8px; letter-spacing: 2px;
  color: rgba(109, 136, 148, 0.5); text-align: center; line-height: 1.7;
}

/* main view */

#view {
  min-width: 0; min-height: 0;
  overflow-y: auto;
  padding: 22px 26px 30px;
  scroll-behavior: smooth;
}
#view::-webkit-scrollbar { width: 8px; height: 8px; }
#view::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.25); border-radius: 4px; }
#view::-webkit-scrollbar-track { background: transparent; }

.view-enter { animation: vin 0.28s ease-out; }
@keyframes vin { from { opacity: 0; transform: translateY(10px); } }

/* rail */

#rail {
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px 14px;
  border-left: 1px solid var(--line);
  background: rgba(5, 11, 18, 0.72);
  overflow-y: auto;
}
#rail::-webkit-scrollbar { width: 6px; }
#rail::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.2); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--cut);
  position: relative;
}
.panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(0, 229, 255, 0.05) 45%, transparent 60%);
  background-size: 250% 100%;
  animation: sheen 7s linear infinite;
}
@keyframes sheen { 0% { background-position: 130% 0; } 100% { background-position: -130% 0; } }

.panel-h {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--cyan); padding: 11px 14px 9px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.12);
}
.panel-h i {
  width: 7px; height: 7px; background: var(--cyan);
  transform: rotate(45deg); box-shadow: 0 0 8px var(--cyan);
  flex: 0 0 7px;
}

.rail-block { display: flex; flex-direction: column; min-height: 0; }
.rail-block.grow { flex: 1; min-height: 160px; }

.mini-vitals { padding: 12px 14px; display: flex; flex-direction: column; gap: 11px; }
.mv { display: grid; grid-template-columns: 42px 1fr 44px; align-items: center; gap: 9px; }
.mv label { font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px; color: var(--dim); }
.mv b { font-family: var(--mono); font-size: 12px; color: var(--cyan-2); text-align: right; font-variant-numeric: tabular-nums; }
.mv-bar { height: 7px; background: rgba(255, 255, 255, 0.06); overflow: hidden; clip-path: polygon(3px 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%, 0 3px); }
.mv-bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #00778a, var(--cyan));
  box-shadow: 0 0 8px var(--cyan);
  transition: width 0.7s ease;
}
.mv.hot .mv-bar span { background: linear-gradient(90deg, #8a5500, var(--gold)); box-shadow: 0 0 8px var(--gold); }
.mv.hot b { color: var(--gold); }

.rail-missions { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.rail-missions .dim { color: var(--dim); font-size: 14px; padding: 4px 4px; }
.rail-m {
  display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center;
  padding: 8px 10px;
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.14);
  cursor: pointer; text-decoration: none; color: inherit;
  transition: 0.15s;
}
.rail-m:hover { background: rgba(0, 229, 255, 0.12); border-color: var(--cyan-dim); }
.rail-m .st { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px var(--green); }
.rail-m.busy .st { background: var(--gold); box-shadow: 0 0 7px var(--gold); animation: blinkg 1s ease-in-out infinite; }
.rail-m .t { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-m .t small { display: block; font-size: 11px; color: var(--dim); font-weight: 500; letter-spacing: 0.5px; }
.rail-m .ag { font-family: var(--mono); font-size: 8.5px; letter-spacing: 1px; color: var(--gold); text-transform: uppercase; }

.link-info { padding: 11px 14px; display: flex; flex-direction: column; gap: 8px; }
.link-info div { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.link-info label { font-size: 12px; letter-spacing: 1.5px; color: var(--dim); text-transform: uppercase; font-weight: 600; }
.link-info b { font-family: var(--mono); font-size: 11px; color: var(--cyan-2); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- shared components ---------- */

.page-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-h h1 {
  font-family: var(--mono); font-size: 21px; font-weight: 700;
  letter-spacing: 5px; color: #eafcff; text-transform: uppercase;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.4);
  display: flex; align-items: center; gap: 12px;
}
.page-h h1::before {
  content: ""; width: 10px; height: 10px;
  background: var(--cyan); transform: rotate(45deg);
  box-shadow: 0 0 12px var(--cyan);
}
.page-h .ph-sub { font-size: 13px; color: var(--dim); letter-spacing: 1.5px; font-weight: 600; text-transform: uppercase; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.07);
  border: 1px solid var(--cyan-dim);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  cursor: pointer;
  transition: 0.15s;
  text-decoration: none;
}
.btn:hover { background: rgba(0, 229, 255, 0.18); box-shadow: 0 0 18px rgba(0, 229, 255, 0.35); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 14px; height: 14px; }
.btn.primary { color: #031018; background: var(--cyan); border-color: var(--cyan); font-weight: 700; }
.btn.primary:hover { background: var(--cyan-2); box-shadow: 0 0 24px rgba(0, 229, 255, 0.6); }
.btn.gold { color: #170d00; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.btn.gold:hover { box-shadow: 0 0 22px rgba(255, 179, 71, 0.55); }
.btn.danger { color: var(--red); border-color: rgba(255, 83, 112, 0.45); background: rgba(255, 83, 112, 0.08); }
.btn.danger:hover { background: rgba(255, 83, 112, 0.2); box-shadow: 0 0 16px rgba(255, 83, 112, 0.4); }
.btn.ghost { color: var(--dim); border-color: rgba(255, 255, 255, 0.12); background: transparent; }
.btn.ghost:hover { color: var(--text); border-color: var(--cyan-dim); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn.sm { padding: 6px 12px; font-size: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 3px 9px;
  border: 1px solid var(--cyan-dim); color: var(--cyan);
  background: rgba(0, 229, 255, 0.07);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  white-space: nowrap;
}
.badge.gold { color: var(--gold); border-color: var(--gold-dim); background: rgba(255, 179, 71, 0.08); }
.badge.green { color: var(--green); border-color: rgba(61, 255, 158, 0.4); background: rgba(61, 255, 158, 0.07); }
.badge.red { color: var(--red); border-color: rgba(255, 83, 112, 0.4); background: rgba(255, 83, 112, 0.08); }
.badge.violet { color: var(--violet); border-color: rgba(179, 136, 255, 0.4); background: rgba(179, 136, 255, 0.08); }
.badge.dim { color: var(--dim); border-color: rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.03); }

.dim { color: var(--dim); }

/* forms */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px;
  color: var(--dim); text-transform: uppercase;
}
.field input[type="text"], .field textarea, .field select {
  background: rgba(0, 14, 22, 0.9);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-family: var(--body); font-size: 16px; font-weight: 500;
  outline: none;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  transition: 0.15s;
  width: 100%;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; font-size: 15px; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 229, 255, 0.25);
}
.field .hint { font-size: 13px; color: var(--dim); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* folder picker */
.folder-row { display: flex; gap: 8px; align-items: center; }
.folder-row input { flex: 1 1 auto; min-width: 0; width: auto; }
.folder-row .btn { flex: 0 0 auto; align-self: stretch; }
.fp-path { display: flex; gap: 8px; margin-bottom: 10px; }
.fp-path input {
  flex: 1 1 auto; min-width: 0;
  background: rgba(0, 14, 22, 0.9);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 9px 11px;
  font-family: var(--mono); font-size: 13px;
  outline: none;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.fp-path input:focus { border-color: var(--cyan); box-shadow: 0 0 12px rgba(0, 229, 255, 0.2); }
.fp-path .btn { flex: 0 0 auto; }
.fp-quick { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.fp-list {
  max-height: 300px; overflow-y: auto;
  border: 1px solid var(--line);
  background: rgba(0, 14, 22, 0.9);
}
.fp-item {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 12px;
  font-family: var(--mono); font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: 0.12s;
}
.fp-item:last-child { border-bottom: none; }
.fp-item i { color: var(--cyan); font-style: normal; flex: 0 0 auto; }
.fp-item span { flex: 0 0 auto; font-weight: 600; }
.fp-item small {
  flex: 1 1 auto; min-width: 0;
  color: var(--dim); font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fp-item:hover { background: rgba(0, 229, 255, 0.1); }
.fp-item.parent { color: var(--dim); }
.fp-status { margin-top: 8px; font-size: 12px; color: var(--dim); }
.check {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 600; color: var(--text);
  cursor: pointer; user-select: none; letter-spacing: 0.5px;
}
.check input { accent-color: var(--cyan); width: 16px; height: 16px; cursor: pointer; }

select { cursor: pointer; }
option { background: #06121a; }

/* modal */

#modalRoot:empty { display: none; }
.modal-back {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(2, 5, 9, 0.78);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  animation: fadein 0.18s ease-out;
  padding: 20px;
}
@keyframes fadein { from { opacity: 0; } }
.modal {
  width: min(620px, 100%);
  max-height: min(86vh, 900px);
  overflow-y: auto;
  background: var(--panel-solid);
  border: 1px solid var(--cyan-dim);
  clip-path: polygon(0 18px, 18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  box-shadow: 0 0 60px rgba(0, 229, 255, 0.18), 0 30px 80px rgba(0, 0, 0, 0.7);
  animation: mup 0.22s ease-out;
}
@keyframes mup { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
.modal-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-h h2 {
  font-family: var(--mono); font-size: 14px; letter-spacing: 4px;
  color: var(--cyan); text-transform: uppercase;
}
.modal-x {
  background: none; border: none; color: var(--dim);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 4px;
}
.modal-x:hover { color: var(--red); }
.modal-b { padding: 20px; }
.modal-f {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--line);
}

/* toasts */

#toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 9px;
  pointer-events: none;
}
.toast {
  min-width: 240px; max-width: 380px;
  padding: 12px 16px;
  background: var(--panel-solid);
  border: 1px solid var(--cyan-dim);
  border-left: 3px solid var(--cyan);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  font-size: 15px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  animation: tin 0.25s ease-out;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--gold); }
.toast.out { animation: tout 0.3s ease-in forwards; }
@keyframes tin { from { opacity: 0; transform: translateX(40px); } }
@keyframes tout { to { opacity: 0; transform: translateX(40px); } }

/* ---------- dashboard ---------- */

.hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 26px; align-items: center;
  padding: 26px 28px;
  margin-bottom: 18px;
}

.holo { position: relative; width: 150px; height: 150px; flex: 0 0 150px; }
.holo .hring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.35);
}
.holo .hring.a { inset: 0; border-top: 3px solid var(--cyan); border-right: 3px solid transparent; animation: spin 5s linear infinite; }
.holo .hring.b { inset: 14px; border-bottom: 3px solid var(--gold); border-left: 3px solid transparent; animation: spin 3.4s linear infinite reverse; }
.holo .hring.c { inset: 30px; border: 2px dashed rgba(0, 229, 255, 0.4); animation: spin 12s linear infinite; }
.holo .hring.d { inset: 46px; border: 1px solid rgba(255, 179, 71, 0.5); border-top-color: transparent; animation: spin 6s linear infinite reverse; }
.holo .hcore {
  position: absolute; inset: 56px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #ffffff, var(--cyan) 40%, #00556d 90%);
  box-shadow: 0 0 26px var(--cyan), 0 0 70px rgba(0, 229, 255, 0.55), inset 0 0 18px rgba(255, 255, 255, 0.4);
  animation: pulse 2.6s ease-in-out infinite;
}
.holo .sat {
  position: absolute; inset: 0; animation: spin 7s linear infinite;
}
.holo .sat::before {
  content: ""; position: absolute; top: -4px; left: 50%;
  width: 9px; height: 9px; margin-left: -4px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 12px var(--gold);
}
.holo .sat.s2 { animation: spin 11s linear infinite reverse; inset: 10px; }
.holo .sat.s2::before { background: var(--cyan-2); box-shadow: 0 0 12px var(--cyan); width: 7px; height: 7px; }

.hero-text .greet {
  font-family: var(--mono); font-size: 26px; font-weight: 700;
  letter-spacing: 2px; color: #eafcff;
  text-shadow: 0 0 22px rgba(0, 229, 255, 0.45);
  margin-bottom: 6px;
}
.hero-text .greet b { color: var(--gold); text-shadow: 0 0 18px rgba(255, 179, 71, 0.5); }
.hero-text .tag { color: var(--dim); font-size: 15.5px; font-weight: 600; letter-spacing: 1px; line-height: 1.5; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; }

.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 18px;
}
.stat {
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--cut);
  position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.stat.g::before { background: linear-gradient(90deg, var(--gold), transparent); }
.stat.v::before { background: linear-gradient(90deg, var(--violet), transparent); }
.stat.gr::before { background: linear-gradient(90deg, var(--green), transparent); }
.stat label {
  display: block; font-family: var(--mono); font-size: 9px;
  letter-spacing: 2.5px; color: var(--dim); text-transform: uppercase; margin-bottom: 7px;
}
.stat b {
  font-family: var(--mono); font-size: 30px; font-weight: 700;
  color: var(--cyan-2); text-shadow: 0 0 16px rgba(0, 229, 255, 0.45);
  font-variant-numeric: tabular-nums;
}
.stat.g b { color: var(--gold); text-shadow: 0 0 16px rgba(255, 179, 71, 0.45); }
.stat.v b { color: var(--violet); text-shadow: 0 0 16px rgba(179, 136, 255, 0.45); }
.stat.gr b { color: var(--green); text-shadow: 0 0 16px rgba(61, 255, 158, 0.4); }
.stat small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--dim); font-weight: 600; letter-spacing: 0.8px; }

.gauges-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 18px;
}
.gauge-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--cut);
}
.gauge-card svg { width: 118px; height: 118px; transform: rotate(-90deg); }
.gauge-card .g-bg { fill: none; stroke: rgba(255, 255, 255, 0.06); stroke-width: 9; }
.gauge-card .g-val {
  fill: none; stroke: var(--cyan); stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.9s ease;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.8));
}
.gauge-card.hot .g-val { stroke: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 179, 71, 0.8)); }
.gauge-card .g-num {
  margin-top: -74px; margin-bottom: 40px;
  font-family: var(--mono); font-size: 26px; font-weight: 700;
  color: var(--cyan-2); text-shadow: 0 0 14px rgba(0, 229, 255, 0.5);
  font-variant-numeric: tabular-nums;
}
.gauge-card.hot .g-num { color: var(--gold); text-shadow: 0 0 14px rgba(255, 179, 71, 0.5); }
.gauge-card label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 3px;
  color: var(--dim); text-transform: uppercase;
}

.dash-bottom { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; }

.feed { padding: 8px 0; overflow-y: auto; max-height: 320px; min-height: 220px; }
.feed::-webkit-scrollbar { width: 6px; }
.feed::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.2); }
.feed-row {
  display: grid; grid-template-columns: 62px 8px 1fr;
  gap: 10px; align-items: baseline;
  padding: 7px 14px;
  font-size: 14.5px; font-weight: 500;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  animation: vin 0.25s ease-out;
}
.feed-row time { font-family: var(--log); font-size: 11px; color: var(--dim); }
.feed-row i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); align-self: center; }
.feed-row.ok i { background: var(--green); box-shadow: 0 0 7px var(--green); }
.feed-row.warn i { background: var(--gold); box-shadow: 0 0 7px var(--gold); }
.feed-row.err i { background: var(--red); box-shadow: 0 0 7px var(--red); }
.feed-row.task i { background: var(--violet); box-shadow: 0 0 7px var(--violet); }
.feed-row.agent i { background: var(--gold); box-shadow: 0 0 7px var(--gold); }
.feed-row span { color: var(--text); }

.voice-card { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 18px; text-align: center; }
.voice-card .big-mic {
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--cyan);
  background: radial-gradient(circle, rgba(0, 229, 255, 0.16), transparent 70%);
  border: 2px solid var(--cyan-dim);
  cursor: pointer; transition: 0.2s;
  position: relative;
}
.voice-card .big-mic svg { width: 36px; height: 36px; }
.voice-card .big-mic::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.35);
  animation: ripple 2s ease-out infinite;
}
@keyframes ripple { 0% { transform: scale(0.85); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.voice-card .big-mic:hover { box-shadow: 0 0 30px rgba(0, 229, 255, 0.5); }
.voice-card .big-mic.listening {
  color: #fff; background: radial-gradient(circle, rgba(255, 83, 112, 0.35), transparent 70%);
  border-color: var(--red);
  animation: glowr 1.2s ease-in-out infinite;
}
.voice-card .big-mic.listening::after { border-color: rgba(255, 83, 112, 0.6); }
.voice-card h4 { font-family: var(--mono); font-size: 13px; letter-spacing: 3px; color: var(--cyan); text-transform: uppercase; }
.voice-card p { font-size: 14.5px; color: var(--dim); line-height: 1.55; font-weight: 500; max-width: 300px; }
.voice-card p b { color: var(--gold); }

/* ---------- chat ---------- */

.chat-shell {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--topbar) - 52px);
  min-height: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--cut);
}
.chat-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.chat-h .ct {
  font-family: var(--mono); font-size: 13px; letter-spacing: 4px;
  color: var(--cyan); text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.chat-h .ct i {
  width: 8px; height: 8px; background: var(--cyan); transform: rotate(45deg);
  box-shadow: 0 0 9px var(--cyan);
}
.chat-h .tools { display: flex; gap: 9px; align-items: center; }
.chat-h select { max-width: 240px; padding: 6px 9px; font-size: 13px; }

.msgs { flex: 1; overflow-y: auto; padding: 20px 18px; }
.msgs::-webkit-scrollbar { width: 7px; }
.msgs::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.22); }
.msg { max-width: 760px; margin-bottom: 16px; animation: vin 0.22s ease-out; }
.msg.user { margin-left: auto; text-align: right; }
.msg .who {
  font-family: var(--mono); font-size: 9px; letter-spacing: 3px;
  text-transform: uppercase; margin-bottom: 5px; color: var(--dim);
}
.msg.user .who { color: var(--cyan); }
.msg.personal .who { color: var(--gold); }
.msg .bubble {
  position: relative;
  display: inline-block;
  text-align: left;
  padding: 11px 15px;
  line-height: 1.55;
  background: rgba(10, 18, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.07);
  max-width: 100%;
  overflow-wrap: break-word;
}
.msg.personal .bubble { border-color: var(--gold-dim); }
.msg.personal .bubble::before {
  content: ""; position: absolute; top: -1px; left: -1px;
  width: 13px; height: 13px;
  border-top: 2px solid var(--gold); border-left: 2px solid var(--gold);
}
.msg.user .bubble {
  background: rgba(0, 60, 80, 0.3); border-color: var(--cyan-dim);
}
.msg.user .bubble::before {
  content: ""; position: absolute; top: -1px; right: -1px;
  width: 13px; height: 13px;
  border-top: 2px solid var(--cyan); border-right: 2px solid var(--cyan);
  border-left: none;
}
.msg .bubble code {
  font-family: var(--log); font-size: 0.87em;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.22);
  padding: 1px 5px; border-radius: 3px; color: #9ff5ff;
}
.msg .bubble pre {
  background: #050d14;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-left: 3px solid var(--cyan);
  padding: 10px 12px; margin: 8px 0;
  overflow-x: auto; border-radius: 3px;
}
.msg .bubble pre code { background: none; border: none; padding: 0; color: #b8e6f2; font-size: 13px; line-height: 1.5; }
.msg .bubble strong { color: #fff; }
.msg .bubble .tool-line {
  display: block; color: var(--gold); font-family: var(--log);
  font-size: 13px; font-weight: 600; letter-spacing: 0.3px; opacity: 0.92;
}
.msg .bubble .error-line { display: block; color: var(--red); font-weight: 600; }
.cursor {
  display: inline-block; width: 9px; height: 17px;
  background: var(--cyan); vertical-align: text-bottom;
  animation: blink 0.9s steps(1) infinite; margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.thinking { display: inline-flex; gap: 5px; padding: 4px 0; }
.thinking i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); animation: bnc 1s ease-in-out infinite;
}
.thinking i:nth-child(2) { animation-delay: 0.15s; }
.thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bnc { 40% { transform: translateY(-6px); opacity: 1; } 80% { opacity: 0.4; } }

.chat-input {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: rgba(0, 10, 17, 0.6);
}
.chat-input input[type="text"] {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: #eafcff; font-family: var(--body); font-size: 17px; font-weight: 500;
  letter-spacing: 0.4px;
}
.chat-input input::placeholder { color: rgba(109, 136, 148, 0.7); }
.send-round {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 229, 255, 0.1);
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  cursor: pointer; transition: 0.15s;
}
.send-round:hover { background: rgba(0, 229, 255, 0.25); box-shadow: 0 0 16px rgba(0, 229, 255, 0.45); }
.send-round svg { width: 17px; height: 17px; }
.send-round .ic-abort { display: none; }
.send-round.streaming { color: var(--red); border-color: var(--red); }
.send-round.streaming .ic-send { display: none; }
.send-round.streaming .ic-abort { display: block; }

/* status pill (shared — mission cards, console header) */

.st-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid rgba(61, 255, 158, 0.4); color: var(--green);
  background: rgba(61, 255, 158, 0.07);
}
.st-pill i {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 7px currentColor;
}

/* ---------- tasks ---------- */

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}
.task-card {
  position: relative;
  padding: 17px 18px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--cut);
  transition: 0.18s;
  overflow: hidden;
}
.task-card:hover {
  border-color: var(--cyan-dim);
  box-shadow: 0 0 26px rgba(0, 229, 255, 0.16);
  transform: translateY(-2px);
}
.task-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--cyan), transparent 75%);
}
.task-card.busy::before { background: linear-gradient(90deg, var(--gold), transparent 75%); }
.task-card .tc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 9px; }
.task-card h3 {
  font-size: 18px; font-weight: 700; letter-spacing: 0.4px;
  color: #eafcff; line-height: 1.3;
}
.task-card .st-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px;
  padding: 4px 9px; text-transform: uppercase;
  border: 1px solid rgba(61, 255, 158, 0.4); color: var(--green);
  background: rgba(61, 255, 158, 0.07);
}
.task-card.busy .st-pill {
  border-color: var(--gold-dim); color: var(--gold);
  background: rgba(255, 179, 71, 0.08);
  animation: blinkg 1.1s ease-in-out infinite;
}
.task-card .st-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.task-card .tc-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.task-card .tc-time { font-size: 12.5px; color: var(--dim); font-weight: 600; letter-spacing: 0.5px; margin-bottom: 12px; }
.task-card .tc-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.empty-state {
  padding: 60px 20px; text-align: center;
  border: 1px dashed rgba(0, 229, 255, 0.25);
  clip-path: var(--cut);
}
.empty-state h3 {
  font-family: var(--mono); font-size: 15px; letter-spacing: 4px;
  color: var(--cyan); text-transform: uppercase; margin-bottom: 8px;
}
.empty-state p { color: var(--dim); font-size: 15.5px; margin-bottom: 18px; }

/* task console */

.console-shell {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--topbar) - 52px);
  min-height: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--cut);
}
.console-log {
  flex: 1; overflow-y: auto;
  padding: 16px 18px;
  font-family: var(--log); font-size: 13.5px; line-height: 1.65;
  color: #b9d9e6;
  background:
    linear-gradient(rgba(0, 229, 255, 0.02) 1px, transparent 1px) 0 0 / 100% 26px;
}
.console-log::-webkit-scrollbar { width: 7px; }
.console-log::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.22); }
.console-log .sys { color: var(--dim); }
.console-log .usr { color: var(--cyan); }
.console-log .usr::before { content: "» "; color: var(--cyan); }
.console-log .ai { color: #d7eef7; white-space: pre-wrap; word-break: break-word; }
.console-log .ai::before { content: "◂ "; color: var(--gold); }
.console-log .tool { color: var(--gold); }
.console-log .err { color: var(--red); }
.console-log .rea { color: rgba(109, 136, 148, 0.75); font-style: italic; }

/* ---------- agents ---------- */

.agent-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 15px;
  margin-bottom: 26px;
}
.agent-section .sec-h,
.agent-section > .agent-grid,
.agent-section > .empty-state { grid-column: 1 / -1; }

.sec-h {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 2px;
}
.sec-h i {
  width: 7px; height: 7px; background: var(--cyan);
  transform: rotate(45deg); box-shadow: 0 0 8px var(--cyan);
  flex: 0 0 7px;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 15px;
}
.agent-card {
  position: relative;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--cut);
  transition: 0.18s;
  overflow: hidden;
}
.agent-card:hover { border-color: var(--cyan-dim); box-shadow: 0 0 26px rgba(0, 229, 255, 0.15); }
.agent-card .ag-top { display: flex; gap: 13px; align-items: center; margin-bottom: 11px; }
.agent-card .ag-avatar {
  width: 46px; height: 52px; flex: 0 0 46px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 20px; font-weight: 800;
  color: #04121a;
  background: linear-gradient(160deg, var(--cyan-2), var(--cyan));
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  text-transform: uppercase;
}
.agent-card.builtin .ag-avatar {
  background: linear-gradient(160deg, #55666f, #2b3942);
  color: var(--text);
}
.agent-card .ag-top > div { flex: 1; min-width: 0; }
.agent-card .ag-top .badge { margin-left: auto; flex: 0 0 auto; }
.agent-card h3 { font-size: 18px; font-weight: 700; color: #eafcff; letter-spacing: 0.5px; }
.agent-card .ag-mode {
  display: block; font-family: var(--log); font-size: 11px;
  color: var(--dim); letter-spacing: 1px; margin-top: 3px; text-transform: lowercase;
}
.agent-card .ag-desc {
  font-size: 14.5px; color: var(--dim); line-height: 1.5; font-weight: 500;
  min-height: 44px; margin-bottom: 13px;
}
.agent-card.builtin { border-style: dashed; background: rgba(7, 15, 23, 0.55); }
.agent-card.builtin .ag-desc { min-height: 0; margin-bottom: 0; }
.agent-card .ag-actions { display: flex; gap: 8px; }

/* agent create modal — preset chips */

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 7px 13px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  cursor: pointer;
  transition: 0.15s;
}
.preset:hover { color: var(--text); border-color: var(--cyan-dim); background: rgba(0, 229, 255, 0.08); }
.preset.active {
  color: #031018; background: var(--cyan); border-color: var(--cyan);
  font-weight: 700; box-shadow: 0 0 16px rgba(0, 229, 255, 0.35);
}

/* ---------- models ---------- */

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 14px;
}
.model-card {
  position: relative;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--cut);
  cursor: pointer;
  transition: 0.16s;
}
.model-card:hover { border-color: var(--cyan-dim); box-shadow: 0 0 22px rgba(0, 229, 255, 0.15); transform: translateY(-2px); }
.model-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 26px rgba(255, 179, 71, 0.25);
}
.model-card .mc-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 5px;
}
.model-card h3 { font-size: 16.5px; font-weight: 700; color: #eafcff; min-width: 0; }
.model-card .mc-dot {
  width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 10px var(--gold);
}
.model-card .mc-id {
  display: block; font-family: var(--log); font-size: 11px;
  color: var(--cyan); margin-bottom: 9px; word-break: break-all;
}
.model-card .mc-desc {
  font-size: 13.5px; color: var(--dim); line-height: 1.45; font-weight: 500;
  min-height: 38px; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.model-card .mc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- responsive ---------- */

@media (max-width: 1240px) {
  #shell { grid-template-columns: var(--nav) 1fr; }
  #rail { display: none; }
}
@media (max-width: 900px) {
  .stats-row, .gauges-row { grid-template-columns: repeat(2, 1fr); }
  .dash-bottom { grid-template-columns: 1fr; }
  .hero { grid-template-columns: auto 1fr; }
  .hero-actions { grid-column: 1 / -1; flex-direction: row; }
  .clock .c-time { font-size: 22px; letter-spacing: 3px; }
  #wave { display: none; }
}
@media (max-width: 760px) {
  :root { --nav: 0px; }
  #shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  #sidebar {
    flex-direction: row; order: 2;
    border-right: none; border-top: 1px solid var(--line);
    padding: 6px 8px; gap: 4px;
    overflow-x: auto;
  }
  #sidebar a { width: auto; flex: 1; padding: 7px 6px; min-width: 58px; }
  #sidebar .nav-spacer, #sidebar .nav-ver { display: none; }
  #sidebar a.active::before { left: 15%; right: 15%; top: -1px; bottom: auto; width: auto; height: 3px; }
  #view { order: 1; padding: 16px 14px 20px; }
  .hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .holo { width: 120px; height: 120px; }
  .holo .hcore { inset: 46px; }
  .page-h h1 { font-size: 16px; letter-spacing: 3px; }
  #status .lbl { display: none; }
  .field-row { grid-template-columns: 1fr; }
}

/* ---------- calculator ---------- */

.calc-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) { .calc-wrap { grid-template-columns: 1fr; } }

.calc {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: var(--cut);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.calc::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(0, 229, 255, 0.05) 45%, transparent 60%);
  background-size: 250% 100%;
  animation: sheen 7s linear infinite;
}

.calc-display {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 22, 30, 0.92), rgba(0, 10, 16, 0.96));
  border: 1px solid rgba(0, 229, 255, 0.3);
  box-shadow: inset 0 0 34px rgba(0, 229, 255, 0.08), 0 0 22px rgba(0, 229, 255, 0.1);
  padding: 10px 16px 14px;
  min-height: 142px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  overflow: hidden;
}
.calc-display::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 229, 255, 0.05) 0 1px, transparent 1px 3px);
}
.calc-dbar {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-bottom: auto;
}
.calc-dbar-r { display: flex; gap: 6px; }

.calc-chip {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--cyan); background: rgba(0, 229, 255, 0.08);
  border: 1px solid var(--cyan-dim);
  padding: 4px 9px; cursor: pointer;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
  transition: 0.15s;
}
.calc-chip:hover { background: rgba(0, 229, 255, 0.2); box-shadow: 0 0 12px rgba(0, 229, 255, 0.3); }
.calc-chip.on {
  color: #170d00; background: var(--gold); border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.5);
}
.calc-chip.on:hover { box-shadow: 0 0 18px rgba(255, 179, 71, 0.7); }

.calc-expr {
  position: relative; z-index: 1;
  font-family: var(--log); font-size: 15px; color: var(--dim);
  text-align: right; word-break: break-all; min-height: 19px;
}
.calc-expr.calc-err-line { color: var(--red); }
.calc-result {
  position: relative; z-index: 1;
  font-family: var(--mono); font-weight: 700; color: var(--cyan-2);
  text-align: right; line-height: 1.1; letter-spacing: 2px;
  text-shadow: 0 0 22px rgba(0, 229, 255, 0.55);
  word-break: break-all;
  transition: color 0.15s;
}
.calc-result.calc-err { color: var(--red); text-shadow: 0 0 22px rgba(255, 83, 112, 0.6); }

.calc-sci, .calc-pad { display: grid; gap: 9px; position: relative; z-index: 1; }
.calc-sci { grid-template-columns: repeat(6, 1fr); }
.calc-pad { grid-template-columns: repeat(4, 1fr); }

.calc-key {
  font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: 1px;
  color: var(--text);
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.16);
  padding: 13px 6px;
  cursor: pointer;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.06s;
  user-select: none;
  -webkit-user-select: none;
}
.calc-key:hover {
  background: rgba(0, 229, 255, 0.14);
  border-color: var(--cyan-dim);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.22);
}
.calc-key:active, .calc-key.hit {
  transform: translateY(1px);
  background: rgba(0, 229, 255, 0.3);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.45);
}
.calc-key.sci {
  font-size: 12px; padding: 10px 4px;
  color: var(--cyan); background: rgba(0, 229, 255, 0.04);
}
.calc-key.op {
  color: var(--gold); background: rgba(255, 179, 71, 0.07);
  border-color: rgba(255, 179, 71, 0.28); font-size: 19px;
}
.calc-key.op:hover {
  background: rgba(255, 179, 71, 0.18);
  border-color: var(--gold-dim);
  box-shadow: 0 0 14px rgba(255, 179, 71, 0.3);
}
.calc-key.op.hit { background: rgba(255, 179, 71, 0.36); }
.calc-key.util {
  color: var(--red); background: rgba(255, 83, 112, 0.06);
  border-color: rgba(255, 83, 112, 0.3); font-size: 14px;
}
.calc-key.util:hover {
  background: rgba(255, 83, 112, 0.18);
  box-shadow: 0 0 14px rgba(255, 83, 112, 0.3);
}
.calc-key.util.hit { background: rgba(255, 83, 112, 0.36); }
.calc-key.eq {
  color: #031018;
  background: linear-gradient(180deg, var(--cyan), #00b8d0);
  border-color: var(--cyan);
  font-size: 20px; font-weight: 700;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.35);
}
.calc-key.eq:hover { background: var(--cyan-2); box-shadow: 0 0 26px rgba(0, 229, 255, 0.65); }

.calc-tape { display: flex; flex-direction: column; }
.calc-tape-list {
  overflow-y: auto;
  padding: 8px;
  display: flex; flex-direction: column; gap: 7px;
  min-height: 170px; max-height: 520px;
}
.calc-tape-item {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  background: rgba(0, 229, 255, 0.04);
  border: 1px solid rgba(0, 229, 255, 0.12);
  padding: 8px 10px;
  cursor: pointer; text-align: right;
  transition: 0.14s;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.calc-tape-item:hover { background: rgba(0, 229, 255, 0.12); border-color: var(--cyan-dim); }
.calc-tape-item span {
  font-family: var(--log); font-size: 12.5px; color: var(--dim);
  word-break: break-all;
}
.calc-tape-item b {
  font-family: var(--mono); font-size: 15px; color: var(--cyan-2);
  word-break: break-all;
}
.calc-tape-empty { padding: 26px 10px; text-align: center; }
.calc-tape-empty h3 { font-size: 13px; letter-spacing: 3px; }
.calc-tape-empty p { font-size: 13.5px; margin-bottom: 0; }

@media (max-width: 760px) {
  .calc-sci { grid-template-columns: repeat(4, 1fr); }
  .calc-key { padding: 12px 4px; font-size: 15px; }
  .calc-key.sci { font-size: 11.5px; }
  .calc-display { min-height: 122px; padding: 9px 12px 12px; }
}

.calc.shake { animation: calcshake 0.4s ease; }
@keyframes calcshake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

/* ============================================================
   PERSONAL Coder — additions (v3)
   ============================================================ */

#shell { grid-template-columns: var(--nav) 1fr; }
#topbar { grid-template-columns: 1fr auto; }

.user-chip {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.15; padding: 5px 12px;
  border: 1px solid var(--line);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.user-chip .u-name { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--cyan-2); }
.user-chip .u-role { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); }

.st-pill.ok { color: var(--green); border-color: rgba(61, 255, 158, 0.4); }
.st-pill.ok i { background: var(--green); box-shadow: 0 0 7px var(--green); animation: blinkg 2s ease-in-out infinite; }

.panel-b { padding: 16px 16px 18px; }
.panel-b > .field:last-child { margin-bottom: 0; }

/* login */
.login-body { overflow-y: auto; }
.login-wrap { position: relative; z-index: 5; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 400px; text-align: center;
  background: var(--panel); border: 1px solid var(--line);
  clip-path: var(--cut); padding: 38px 32px 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.login-card .reactor.big { width: 64px; height: 64px; margin: 0 auto 22px; }
.login-card .reactor.big .r2 { inset: 10px; }
.login-card .reactor.big .r3 { inset: 20px; }
.login-card .reactor.big .core { inset: 22px; }
.login-card h1 {
  font-family: var(--mono); font-size: 26px; letter-spacing: 6px;
  color: #eafcff; text-shadow: 0 0 18px rgba(0, 229, 255, 0.55); margin-bottom: 4px;
}
.login-card h1 span { color: var(--cyan); }
.login-sub { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); margin-bottom: 26px; }
.login-card .field { text-align: left; }
.login-btn { width: 100%; margin-top: 6px; }
.login-error {
  text-align: left; margin-bottom: 14px; padding: 9px 12px;
  font-size: 14px; color: var(--red);
  border: 1px solid rgba(255, 83, 112, 0.35); background: rgba(255, 83, 112, 0.08);
}
.login-foot { margin-top: 18px; font-size: 12px; color: var(--dim); letter-spacing: 1px; }

/* permission dialog */
.perm-box { font-size: 16px; line-height: 1.55; }
.perm-lead { margin-bottom: 12px; }
.perm-lead b { color: var(--gold); font-family: var(--mono); letter-spacing: 1px; }
.perm-patterns {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 220px; overflow-y: auto; padding: 10px;
  border: 1px solid var(--line); background: rgba(0, 14, 22, 0.9);
}
.perm-patterns code { font-family: var(--log); font-size: 13px; color: var(--cyan-2); white-space: pre-wrap; word-break: break-all; }

/* users */
.users-list { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.user-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); clip-path: var(--cut);
}
.ur-main { display: flex; flex-direction: column; gap: 7px; }
.ur-name { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: var(--text); }
.ur-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ur-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* machine */
.cmd-box {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: rgba(0, 14, 22, 0.9);
  padding: 10px 12px; margin-top: 6px;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.cmd-box code { flex: 1 1 auto; min-width: 0; font-family: var(--log); font-size: 13px; color: var(--cyan-2); overflow-x: auto; white-space: nowrap; }
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.5; color: var(--text); }
.steps code { font-family: var(--log); font-size: 13px; color: var(--gold); }

/* task grid spacing */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

@media (max-width: 720px) {
  #topbar { grid-template-columns: 1fr auto; gap: 8px; }
  .user-chip { display: none; }
}

/* kamzor machine / user preference par saari continuous animation band */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .scanline { display: none; }
}
