:root{
  --bg:#060816;
  --panel: rgba(14, 20, 44, .70);
  --panel2: rgba(10, 14, 34, .66);
  --border: rgba(255,255,255,.10);
  --text: #eaf0ff;
  --muted:#a9b7d8;
  --accent:#22d3ee;
  --accent2:#6ea8fe;
  --good:#34d399;
  --warn:#fbbf24;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  background: var(--bg);
}
.bg{position:fixed; inset:0; z-index:-1; overflow:hidden;}
.bg-grid{
  position:absolute; inset:-200px;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 42px 42px;
  transform: rotate(12deg);
  opacity:.28;
}
.bg-glow{position:absolute; width:900px; height:900px; border-radius:999px; filter: blur(80px); opacity:.18;}
.bg-glow-1{left:-240px; top:-240px; background: radial-gradient(circle at 30% 30%, var(--accent), transparent 60%);} 
.bg-glow-2{right:-260px; bottom:-260px; background: radial-gradient(circle at 30% 30%, var(--accent2), transparent 60%);} 

.app{display:grid; grid-template-columns: 280px 1fr; min-height:100vh;}

.sidebar{
  position:sticky; top:0; height:100vh;
  padding:18px;
  background: linear-gradient(180deg, rgba(8,10,22,.85), rgba(8,10,22,.55));
  border-right: 1px solid var(--border);
  backdrop-filter: blur(10px);
  display:flex; flex-direction:column; gap:16px;
}
.brand{display:flex; gap:12px; align-items:center; padding:10px 10px; border:1px solid var(--border); border-radius:14px; background:rgba(255,255,255,.03)}
.brand-title{font-weight:700; letter-spacing:.2px}
.brand-sub{font-size:12px; color:var(--muted)}
.brand-mark{width:44px; height:44px; display:grid; place-items:center; border-radius:12px; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08)}

.nav{display:flex; flex-direction:column; gap:8px}
.nav-item{
  width:100%; text-align:left; padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color:var(--text);
  cursor:pointer;
  display:flex; align-items:center; gap:10px;
}
.nav-item .dot{width:10px; height:10px; border-radius:999px; background:rgba(255,255,255,.18)}
.nav-item.active{border-color: rgba(34,211,238,.45); background: rgba(34,211,238,.10)}
.nav-item.active .dot{background: var(--accent); box-shadow:0 0 18px rgba(34,211,238,.55)}
.nav-item.disabled{opacity:.5; cursor:not-allowed}
.pill{margin-left:auto; font-size:12px; padding:3px 8px; border-radius:999px; border:1px solid rgba(255,255,255,.12); color:var(--muted)}
.pill.muted{opacity:.8}

.sidebar-foot{margin-top:auto; display:grid; gap:10px}
.mini{padding:10px 10px; border:1px solid rgba(255,255,255,.08); border-radius:14px; background:rgba(255,255,255,.02)}
.mini-label{font-size:12px; color:var(--muted)}
.mini-value{margin-top:4px; font-size:13px}
.led{display:inline-block; width:8px; height:8px; border-radius:999px; background:var(--good); box-shadow:0 0 16px rgba(52,211,153,.5)}

.main{padding:22px 22px 18px;}
.topbar{display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px}
.topbar h1{margin:0; font-size:26px; letter-spacing:.2px}
.sub{margin:6px 0 0; color:var(--muted); max-width:760px; line-height:1.6}
.top-actions{display:flex; gap:10px; align-items:center}

.btn{border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.05); color:var(--text); padding:10px 12px; border-radius:12px; cursor:pointer; text-decoration:none; font-weight:600}
.btn:hover{border-color: rgba(34,211,238,.45)}
.btn.ghost{background:transparent}

/* ChatGPT-style main chat layout */
.chatgpt{
  margin-top: 14px;
  border:1px solid var(--border);
  border-radius:16px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  overflow:hidden;
  min-height: 70vh;
  display:flex;
  flex-direction:column;
}
.chat-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  padding:14px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
}
.chat-title{font-weight:800; letter-spacing:.2px}
.chat-meta{font-size:12px; color:var(--muted); margin-top:4px}
.chat-head-actions{display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end}

.chat{
  flex: 1;
  overflow:auto;
  padding:14px;
  background:rgba(0,0,0,.18);
}
.msg{display:flex; margin:12px 0}
.msg .bubble{max-width: 920px; width:100%; padding:12px 12px; border-radius:14px; border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.03); line-height:1.6}
.msg.jarvis{justify-content:flex-start}
.msg.user{justify-content:flex-start}
.msg.user .bubble{background: rgba(110,168,254,.12); border-color: rgba(110,168,254,.35)}
.msg.sys .bubble{background: rgba(34,211,238,.10); border-color: rgba(34,211,238,.30)}

.composer{
  position: sticky;
  bottom: 0;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(8,10,22,.4), rgba(8,10,22,.75));
  backdrop-filter: blur(10px);
}
.composer-wrap{display:flex; gap:10px; align-items:center}
input[type="text"]{
  flex:1;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.22);
  color:var(--text);
}
input[type="file"]{display:none}
.chip{border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.04); color:var(--text); padding:8px 10px; border-radius:999px; cursor:pointer; font-size:13px}
.chip:hover{border-color: rgba(34,211,238,.45)}
.composer-hint{margin-top:8px; font-size:12px; color:var(--muted)}

.footer{margin-top:14px; color:rgba(169,183,216,.9); font-size:12px; display:flex; gap:10px; align-items:center}
.footer .sep{opacity:.6}

@media (max-width: 980px){
  .app{grid-template-columns: 1fr}
  .sidebar{position:relative; height:auto}
}

/* High contrast toggle */
body.hicontrast{--panel: rgba(10, 14, 34, .92); --panel2: rgba(10, 14, 34, .92); --border: rgba(255,255,255,.16)}
