:root {
  --bg: #05070d;
  --bg-2: #0b1220;
  --panel: rgba(9, 15, 27, .74);
  --panel-strong: rgba(12, 20, 34, .92);
  --glass: rgba(255, 255, 255, .075);
  --border: rgba(196, 213, 238, .16);
  --border-strong: rgba(79, 214, 255, .42);
  --text: #f7fbff;
  --muted: #96a7bd;
  --soft: #d7e3f0;
  --cyan: #42d9ff;
  --blue: #74a7ff;
  --green: #48e6a3;
  --amber: #f5c45c;
  --red: #ff6d8a;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(120deg, rgba(72, 230, 163, .08), transparent 24%),
    radial-gradient(circle at 16% 8%, rgba(66, 217, 255, .28), transparent 24%),
    radial-gradient(circle at 84% 12%, rgba(245, 196, 92, .13), transparent 20%),
    radial-gradient(circle at 72% 88%, rgba(116, 167, 255, .18), transparent 28%),
    linear-gradient(145deg, #05070d 0%, #08101d 58%, #05070d 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.65), transparent 75%);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.aurora {
  position: fixed;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 25%, rgba(66, 217, 255, .18), transparent 18%),
    radial-gradient(circle at 68% 22%, rgba(72, 230, 163, .13), transparent 17%),
    radial-gradient(circle at 54% 72%, rgba(116, 167, 255, .16), transparent 24%);
  filter: blur(20px);
  animation: auroraDrift 16s ease-in-out infinite alternate;
}

@keyframes auroraDrift {
  from { transform: translate3d(-2%, -1%, 0) rotate(-2deg); }
  to { transform: translate3d(2%, 1.5%, 0) rotate(2deg); }
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  width: min(1500px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 0 36px;
}

.sidebar {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.045));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px;
}

.brand-mark,
.tool-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(66, 217, 255, .34);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(66,217,255,.22), rgba(72,230,163,.1));
  color: #e9fbff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 14px 30px rgba(66,217,255,.12);
}

.brand strong,
.brain-link strong { display: block; font-size: 16px; }
.brand small,
.brain-link small,
.brain-card small { display: block; color: var(--muted); line-height: 1.35; }

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.tab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 11px 12px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font-weight: 850;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.tab::before {
  content: attr(data-icon);
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  color: #bfefff;
  font-size: 11px;
}

.tab:hover,
.tab.active {
  transform: translateX(2px);
  color: var(--text);
  border-color: rgba(66, 217, 255, .26);
  background: linear-gradient(135deg, rgba(66,217,255,.16), rgba(255,255,255,.055));
}

.brain-link {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(72,230,163,.28);
  border-radius: 18px;
  padding: 13px;
  background: linear-gradient(145deg, rgba(72,230,163,.13), rgba(66,217,255,.08));
  transition: transform .18s ease, border-color .18s ease;
}

.brain-link:hover,
.brain-card:hover,
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(66,217,255,.38);
}

.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(72,230,163,.11), 0 0 28px rgba(72,230,163,.8);
  flex: 0 0 auto;
}

.workspace {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px 16px;
  background: rgba(9, 15, 27, .62);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 54px rgba(0,0,0,.24);
}

.eyebrow,
.status-pill,
.card-kicker,
.section-head span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cbf5ff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin: 0; }

h1 {
  margin-top: 3px;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.top-actions a,
button,
.brain-card {
  border: 1px solid rgba(116,167,255,.28);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(116,167,255,.18), rgba(66,217,255,.08));
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.top-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 11px;
  color: var(--soft);
}

button {
  min-height: 40px;
  padding: 9px 12px;
}

button:hover,
.top-actions a:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: linear-gradient(135deg, rgba(66,217,255,.22), rgba(72,230,163,.08));
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .42fr);
  gap: 12px;
}

.hero-copy,
.brain-card,
.card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.045));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(66,217,255,.22), transparent 62%);
}

.hero-copy h2 {
  max-width: 820px;
  margin-top: 8px;
  font-size: clamp(26px, 4vw, 48px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 70ch;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.brain-card {
  display: grid;
  align-content: end;
  min-height: 180px;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 10%, rgba(72,230,163,.24), transparent 28%),
    linear-gradient(145deg, rgba(66,217,255,.16), rgba(255,255,255,.045));
}

.brain-card strong {
  margin: 8px 0 6px;
  font-size: 27px;
  line-height: 1.05;
}

.mobile-tabs { display: none; }

.section {
  display: none;
  animation: rise .26s ease both;
}

.section.active { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 2px 10px;
}

.section-head h2 {
  margin-top: 3px;
  font-size: 26px;
}

.section-head p {
  color: var(--muted);
  text-align: right;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 12px;
}

.grid.two { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
.grid.scripts { grid-template-columns: repeat(4, minmax(190px, 1fr)); }
.wide { grid-column: 1 / -1; }

.card {
  padding: 15px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.tool-card {
  min-height: 100%;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.card-title h3 {
  font-size: 18px;
  line-height: 1.15;
}

.mini-card {
  display: grid;
  gap: 10px;
  align-content: space-between;
  min-height: 170px;
}

.mini-card p {
  color: var(--muted);
  line-height: 1.45;
}

label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin: 9px 0 6px;
  font-weight: 850;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(2, 7, 16, .58);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(66,217,255,.55);
  box-shadow: 0 0 0 4px rgba(66,217,255,.1);
}

textarea {
  min-height: 118px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 11px;
}

.row.compact button { padding-inline: 10px; }

.ghost {
  background: rgba(255,255,255,.055);
  border-color: var(--border);
  color: var(--soft);
}

pre {
  margin: 11px 0 0;
  background: linear-gradient(180deg, rgba(0,0,0,.34), rgba(0,0,0,.22));
  border: 1px solid rgba(196,213,238,.14);
  border-radius: 15px;
  padding: 12px;
  min-height: 64px;
  max-height: 320px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #e9eef8;
  overflow: auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  z-index: 50;
  padding: 12px 15px;
  border: 1px solid rgba(72,230,163,.34);
  border-radius: 16px;
  background: rgba(8, 14, 24, .94);
  color: var(--text);
  box-shadow: 0 18px 52px rgba(0,0,0,.36), 0 0 30px rgba(72,230,163,.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    backdrop-filter: blur(18px);
  }
  .mobile-tabs .tab {
    flex: 0 0 auto;
    width: auto;
    background: rgba(9,15,27,.78);
    border-color: var(--border);
    white-space: nowrap;
  }
  .topbar,
  .hero-panel,
  .grid,
  .grid.two,
  .grid.scripts { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100%, calc(100% - 16px));
    padding-top: 8px;
    gap: 10px;
  }
  .topbar {
    align-items: start;
    flex-direction: column;
    min-height: 0;
    padding: 13px;
    border-radius: 18px;
  }
  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .top-actions a {
    justify-content: center;
    min-width: 0;
    padding-inline: 7px;
    font-size: 13px;
  }
  .hero-copy,
  .brain-card,
  .card { border-radius: 18px; }
  .hero-copy { padding: 16px; }
  .hero-copy h2 { font-size: 29px; }
  .section-head {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }
  .section-head p { text-align: left; }
  .card { padding: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

/* Dense product cockpit pass */
body::before { background-size: 28px 28px; mask-image: linear-gradient(to bottom, rgba(0,0,0,.78), transparent 84%); }

.app-shell {
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 10px;
  width: min(1580px, calc(100% - 18px));
  padding: 9px 0 24px;
}

.sidebar {
  top: 9px;
  height: calc(100vh - 18px);
  gap: 10px;
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 18px 48px rgba(0,0,0,.34);
}

.brand { gap: 9px; padding: 6px; }
.brand-mark, .tool-icon { width: 34px; height: 34px; border-radius: 11px; }
.brand strong, .brain-link strong { font-size: 14px; }
.brand small, .brain-link small, .brain-card small { font-size: 12px; }
.side-nav { gap: 6px; margin-top: 4px; }
.tab { border-radius: 11px; padding: 8px 9px; }
.tab::before { width: 24px; height: 24px; border-radius: 8px; }
.brain-link { border-radius: 14px; padding: 10px; }

.workspace { gap: 8px; }
.topbar { min-height: 58px; border-radius: 16px; padding: 10px 12px; }
h1 { font-size: clamp(22px, 3vw, 32px); }
.top-actions { gap: 6px; }
.top-actions a { min-height: 32px; padding: 7px 9px; }
button { min-height: 34px; padding: 7px 10px; border-radius: 10px; }

.hero-panel {
  grid-template-columns: minmax(0, 1fr) minmax(260px, .34fr);
  gap: 8px;
}

.hero-copy, .brain-card, .card {
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0,0,0,.34);
}

.hero-copy {
  display: grid;
  align-content: center;
  padding: 12px;
}

.hero-copy h2 {
  max-width: 760px;
  margin-top: 8px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.03;
}

.hero-copy p { display: none; }

.command-line,
.signal-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.command-line {
  width: min(720px, 100%);
  min-height: 40px;
  border: 1px solid rgba(196,213,238,.14);
  border-radius: 12px;
  padding: 7px 9px;
  background: rgba(2,7,16,.45);
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.command-line strong {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-size: 11px;
}

.signal-strip { margin-top: 9px; }
.signal-strip span {
  border: 1px solid rgba(196,213,238,.12);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255,255,255,.045);
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.brain-card { min-height: 132px; padding: 13px; }
.brain-card strong { margin: 6px 0 5px; font-size: 22px; }

.section-head { gap: 10px; margin: 2px 2px 7px; }
.section-head h2 { font-size: 22px; }
.section-head p { font-size: 13px; }
.grid { gap: 8px; }
.grid.two { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
.grid.scripts { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.card { padding: 11px; }
.card-title { gap: 9px; margin-bottom: 8px; }
.card-title h3 { font-size: 16px; }
.mini-card { min-height: 132px; gap: 8px; }
label { margin: 7px 0 5px; font-size: 11px; }
input, textarea, select { border-radius: 10px; padding: 8px 10px; }
textarea { min-height: 92px; }
.row { gap: 6px; margin-top: 8px; }
pre { margin: 8px 0 0; border-radius: 12px; padding: 9px; min-height: 54px; max-height: 240px; font-size: 12px; }

.card,
.topbar,
.sidebar,
.hero-copy,
.brain-card {
  position: relative;
  overflow: hidden;
}

.card::before,
.topbar::before,
.sidebar::before,
.hero-copy::before,
.brain-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(66,217,255,.14), transparent 24%, transparent 74%, rgba(72,230,163,.1));
  opacity: .55;
}

@media (max-width: 1120px) {
  .app-shell { width: min(100%, calc(100% - 12px)); padding-top: 6px; }
  .workspace { gap: 7px; }
  .hero-panel, .grid, .grid.two, .grid.scripts { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar, .hero-copy, .brain-card, .card { border-radius: 14px; }
  .hero-copy { padding: 12px; }
  .hero-copy h2 { font-size: 25px; }
  .top-actions a { font-size: 12px; }
  .command-line { font-size: 12px; }
  .signal-strip span { font-size: 11px; }
}
