:root {
  --bg: #06111d;
  --panel: rgba(10, 24, 41, .78);
  --panel-2: rgba(15, 34, 56, .92);
  --text: #e9f7ff;
  --muted: #8da4b8;
  --line: rgba(142, 213, 255, .16);
  --cyan: #30dfff;
  --blue: #3478ff;
  --green: #29f29a;
  --danger: #ff5f7a;
  --shadow: 0 26px 70px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 75% 15%, rgba(48, 223, 255, .18), transparent 30%),
    radial-gradient(circle at 15% 80%, rgba(52, 120, 255, .18), transparent 36%),
    linear-gradient(135deg, #050b13 0%, #06111d 45%, #0b1728 100%);
  color: var(--text);
  overflow-x: hidden;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 78%);
  pointer-events: none;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  padding: 22px;
}
.side-panel, .hero-card, .chat-card, .setup-card, .access-box, .install-warning {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 30, 51, .84), rgba(8, 19, 32, .84));
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.side-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-row h1 { margin: 0; font-size: 30px; letter-spacing: .5px; }
.logo-row span, .muted, .hero-card p, .hint-row, .access-box p, .setup-card p { color: var(--muted); }
.logo-pulse, .brand-orb {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: conic-gradient(from 180deg, var(--cyan), var(--blue), #8f66ff, var(--cyan));
  box-shadow: 0 0 34px rgba(48, 223, 255, .45);
  position: relative;
}
.logo-pulse:after, .brand-orb:after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 12px;
  background: #071421;
}
.status-stack { display: grid; gap: 12px; }
.mini-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
}
.mini-card b { display: block; font-size: 15px; }
.mini-card small { color: var(--muted); }
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 16px var(--danger);
  flex: 0 0 auto;
}
.dot.ok { background: var(--green); box-shadow: 0 0 16px var(--green); }
.dot.blue { background: var(--blue); box-shadow: 0 0 16px var(--blue); }
.dot.cyan { background: var(--cyan); box-shadow: 0 0 16px var(--cyan); }
.command-list { margin-top: auto; }
.command-list h3 { margin: 0 0 12px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.command-list button, .ghost-btn, .send-btn, .access-box button, .setup-form button, .primary-link, .install-warning a {
  border: 0;
  border-radius: 16px;
  color: #e9f7ff;
  background: linear-gradient(135deg, rgba(48, 223, 255, .22), rgba(52, 120, 255, .28));
  border: 1px solid rgba(100, 210, 255, .22);
  padding: 13px 14px;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
  text-decoration: none;
  text-align: center;
  font-weight: 700;
}
.command-list { display: grid; gap: 10px; }
.command-list button:hover, .ghost-btn:hover, .send-btn:hover, .access-box button:hover, .setup-form button:hover, .primary-link:hover, .install-warning a:hover { transform: translateY(-1px); border-color: rgba(48, 223, 255, .6); }
.ghost-btn { background: rgba(255,255,255,.04); }
.main-panel { display: grid; grid-template-rows: auto 1fr; gap: 22px; min-width: 0; }
.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  min-height: 190px;
  overflow: hidden;
  position: relative;
}
.eyebrow { color: var(--cyan); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; }
.hero-card h2 { font-size: clamp(28px, 4vw, 48px); margin: 10px 0; line-height: 1.02; max-width: 860px; }
.hero-card p { max-width: 760px; line-height: 1.6; }
.voice-orb {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
}
.voice-orb span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(48,223,255,.34);
  border-radius: 50%;
  animation: spin 9s linear infinite;
}
.voice-orb span:nth-child(2) { inset: 18px; animation-direction: reverse; animation-duration: 7s; border-color: rgba(52,120,255,.42); }
.voice-orb span:nth-child(3) { inset: 36px; animation-duration: 5s; border-style: dashed; }
.voice-orb b {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #03101d;
  font-size: 34px;
  box-shadow: 0 0 40px rgba(48,223,255,.44);
}
.voice-orb.listening b { animation: pulse 1s ease infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.08); filter: brightness(1.25); } }
.chat-card { padding: 18px; min-height: 0; display: grid; grid-template-rows: 1fr auto auto; }
.chat-log { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 14px; min-height: 380px; max-height: calc(100vh - 360px); }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg.user { justify-content: flex-end; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(48,223,255,.18);
  color: var(--cyan);
  font-weight: 900;
  flex: 0 0 auto;
}
.msg.user .avatar { order: 2; background: rgba(52,120,255,.18); color: #8ab0ff; }
.bubble {
  max-width: min(860px, 82%);
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  white-space: pre-wrap;
  line-height: 1.55;
}
.msg.user .bubble { background: rgba(52,120,255,.14); }
.input-row { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
textarea, input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(5, 12, 21, .86);
  color: var(--text);
  border-radius: 16px;
  padding: 15px 16px;
  outline: none;
  font: inherit;
}
textarea:focus, input:focus { border-color: rgba(48,223,255,.55); box-shadow: 0 0 0 4px rgba(48,223,255,.08); }
.mic-btn {
  border: 0;
  border-radius: 18px;
  font-size: 22px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  cursor: pointer;
  box-shadow: 0 0 26px rgba(48,223,255,.22);
}
.mic-btn.listening { animation: pulse 1s ease infinite; }
.hint-row { display: flex; justify-content: space-between; padding: 10px 2px 0; font-size: 13px; }
.access-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1, 8, 16, .72);
  backdrop-filter: blur(12px);
  z-index: 20;
}
.access-modal.hidden { display: none; }
.access-box { width: min(460px, 96vw); padding: 28px; text-align: center; }
.access-box h2 { margin: 18px 0 8px; }
.access-box input { margin: 16px 0 12px; }
.access-box button { width: 100%; }
.brand-orb.small { width: 44px; height: 44px; margin: 0 auto; border-radius: 16px; }
.install-warning { padding: 24px; }
.install-warning a, .primary-link { display: inline-block; margin-top: 12px; }
.setup-body { display: grid; place-items: center; padding: 30px; }
.setup-card { width: min(740px, 96vw); padding: 30px; }
.setup-card h1 { margin-bottom: 8px; }
.setup-form { display: grid; gap: 14px; }
.setup-form h2 { margin: 18px 0 0; color: var(--cyan); font-size: 16px; }
.setup-form label { color: var(--muted); display: grid; gap: 8px; }
.alert { padding: 14px 16px; border-radius: 16px; margin: 16px 0; border: 1px solid var(--line); }
.alert.success { background: rgba(41,242,154,.1); border-color: rgba(41,242,154,.28); }
.alert.danger { background: rgba(255,95,122,.1); border-color: rgba(255,95,122,.28); }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; padding: 14px; }
  .side-panel { order: 2; }
  .hero-card { flex-direction: column; }
  .voice-orb { width: 130px; height: 130px; }
  .chat-log { max-height: 56vh; }
}
@media (max-width: 560px) {
  .input-row { grid-template-columns: 50px 1fr; }
  .send-btn { grid-column: 1 / -1; }
  .bubble { max-width: 100%; }
}
.dot.violet { background: #a78bfa; box-shadow: 0 0 16px #a78bfa; }
.mode-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.mode-pills span {
  border: 1px solid rgba(48,223,255,.2);
  background: rgba(255,255,255,.04);
  color: #c9efff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}
.tools-stack { display: grid; gap: 10px; }
.tools-stack h3 { margin: 0 0 2px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.tool-btn, .tool-link, .secondary-action {
  border: 0;
  border-radius: 16px;
  color: #e9f7ff;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(100, 210, 255, .18);
  padding: 12px 13px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-weight: 800;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.tool-btn:hover, .tool-link:hover, .secondary-action:hover { transform: translateY(-1px); border-color: rgba(48,223,255,.58); background: rgba(48,223,255,.09); }
.tool-btn.active { background: rgba(41,242,154,.12); border-color: rgba(41,242,154,.36); }
.remember-line { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.remember-line input { width: auto; }
.secondary-action { width: 100%; margin-top: 10px; background: rgba(255,255,255,.04) !important; }
.training-layout { min-height: 100vh; display: grid; place-items: start center; padding: 24px; }
.training-card { width: min(980px, 96vw); padding: 26px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(14,30,51,.86), rgba(8,19,32,.86)); border-radius: 28px; box-shadow: var(--shadow); }
.training-card textarea { min-height: 220px; resize: vertical; }
.training-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.training-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.training-actions button, .back-link { border: 1px solid rgba(100,210,255,.25); background: linear-gradient(135deg, rgba(48,223,255,.18), rgba(52,120,255,.25)); color: var(--text); border-radius: 14px; padding: 12px 14px; font-weight: 800; text-decoration: none; cursor: pointer; }
@media (max-width: 760px) { .training-grid { grid-template-columns: 1fr; } }
