/* =============================================
   REMESYS AI LAB — lab.css
   Brand: #002a75 (navy) · #f90395 (magenta) · #00e6ff (cyan)
   Theme: Dark tech-academia
   ============================================= */

:root {
  --navy:    #002a75;
  --magenta: #f90395;
  --cyan:    #00e6ff;
  --bg:      #07071a;
  --bg2:     #0d0d24;
  --bg3:     #12122e;
  --surface: #1a1a38;
  --border:  rgba(255,255,255,0.07);
  --text:    #e8eaf6;
  --text-sub:#9ca3c8;
  --grad:    linear-gradient(135deg, #00e6ff 0%, #886ac5 50%, #f90395 100%);
  --grad-h:  linear-gradient(90deg, #00e6ff, #f90395);
  --font-display: 'Syne', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --font-code:    'Space Mono', monospace;
  --radius:  12px;
  --radius-lg: 20px;
  --shadow:  0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(0,230,255,0.12);
  --trans:   0.25s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
  --bg:      #f0f2ff;
  --bg2:     #e8eaf6;
  --bg3:     #ffffff;
  --surface: #ffffff;
  --border:  rgba(0,0,0,0.08);
  --text:    #0d0d24;
  --text-sub:#4a5080;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--navy); border-radius: 4px; }

/* ── SPLASH SCREEN ── */
#splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: #07071a;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#splash-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { text-align: center; }
.spinning-icon img {
  animation: spin 1.2s linear infinite;
  filter: drop-shadow(0 0 20px #00e6ff);
}
@keyframes spin { to { transform: rotate(360deg); } }
.splash-text {
  margin-top: 24px;
  font-family: var(--font-code);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
}
.splash-text .s1 { color: var(--text-sub); }
.splash-text .s2 {
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.splash-text .s3 { color: var(--cyan); animation: blink 0.8s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.splash-bar {
  width: 200px; height: 2px;
  background: var(--surface);
  margin: 20px auto 0;
  border-radius: 2px; overflow: hidden;
}
.splash-fill {
  height: 100%;
  background: var(--grad-h);
  animation: bar-fill 1.8s ease forwards;
}
@keyframes bar-fill { from { width: 0; } to { width: 100%; } }

/* ── HEADER ── */
#main-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(7,7,26,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 64px;
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0 24px;
  height: 100%; display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 34px; }
.brand-badge {
  background: var(--grad);
  color: white; font-size: 0.7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  letter-spacing: 0.05em;
}
.main-nav {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}
.nav-link {
  color: var(--text-sub);
  text-decoration: none; font-size: 0.88rem; font-weight: 600;
  padding: 6px 14px; border-radius: 8px;
  transition: all var(--trans);
  letter-spacing: 0.02em;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--surface);
}
.nav-link.active { color: var(--cyan); }
.nav-link.ext { color: var(--text-sub); font-size: 0.82rem; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: 16px; }
.btn-theme-toggle {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 7px 10px; border-radius: 8px;
  cursor: pointer; font-size: 1rem; transition: all var(--trans);
}
.btn-theme-toggle:hover { border-color: var(--cyan); }
.btn-enroll {
  background: var(--magenta); color: white;
  padding: 8px 18px; border-radius: 8px;
  text-decoration: none; font-size: 0.85rem; font-weight: 700;
  transition: all var(--trans);
  box-shadow: 0 0 20px rgba(249,3,149,0.3);
}
.btn-enroll:hover { transform: translateY(-1px); box-shadow: 0 4px 24px rgba(249,3,149,0.5); }
.hamburger {
  display: none; background: none; border: none; color: var(--text);
  font-size: 1.4rem; cursor: pointer; padding: 6px; margin-left: auto;
}

/* ── MOBILE NAV ── */
.mobile-nav {
  position: fixed; top: 0; right: -100%; z-index: 200;
  width: 260px; height: 100vh;
  background: var(--bg2); border-left: 1px solid var(--border);
  padding: 70px 24px 24px;
  display: flex; flex-direction: column; gap: 8px;
  transition: right 0.3s ease;
}
.mobile-nav.open { right: 0; }
.mobile-nav a {
  color: var(--text); text-decoration: none;
  padding: 12px 16px; border-radius: 10px; font-weight: 600;
  transition: all var(--trans);
}
.mobile-nav a:hover { background: var(--surface); color: var(--cyan); }
.mobile-nav-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text-sub);
  font-size: 1.3rem; cursor: pointer; padding: 6px;
}

/* ── HERO ── */
.hero {
  min-height: 100vh; padding: 120px 24px 80px;
  position: relative; overflow: hidden;
  display: flex; align-items: center;
  max-width: 1400px; margin: 0 auto;
  gap: 60px;
}
.hero-bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,230,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,230,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
.hero-particles {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.particle {
  position: absolute; border-radius: 50%;
  background: var(--cyan); opacity: 0.15;
  animation: float-particle var(--dur, 8s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes float-particle {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.15; }
  50% { transform: translateY(-40px) scale(1.2); opacity: 0.3; }
}
.hero-content { flex: 1; position: relative; z-index: 1; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,230,255,0.08); border: 1px solid rgba(0,230,255,0.2);
  color: var(--cyan); font-size: 0.8rem; font-weight: 600;
  padding: 6px 16px; border-radius: 30px; letter-spacing: 0.05em;
  margin-bottom: 24px;
  animation: fade-up 0.6s ease both;
}
.hero-title {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -0.02em;
  animation: fade-up 0.7s 0.1s ease both;
}
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  margin-top: 20px; font-size: 1.1rem; color: var(--text-sub);
  max-width: 540px; font-family: var(--font-mono); font-weight: 300;
  line-height: 1.7;
  animation: fade-up 0.7s 0.2s ease both;
}
.hero-btns {
  display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap;
  animation: fade-up 0.7s 0.3s ease both;
}
.btn-primary {
  background: var(--grad);
  color: white; font-weight: 700; font-size: 0.95rem;
  padding: 14px 28px; border-radius: 10px;
  text-decoration: none; transition: all var(--trans);
  box-shadow: 0 4px 20px rgba(249,3,149,0.3);
  letter-spacing: 0.02em;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(249,3,149,0.45); }
.btn-secondary {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-weight: 700; font-size: 0.95rem;
  padding: 14px 28px; border-radius: 10px;
  text-decoration: none; transition: all var(--trans);
}
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }
.hero-langs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px;
  animation: fade-up 0.7s 0.4s ease both;
}
.lang-chip {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-sub); font-size: 0.75rem; font-family: var(--font-mono);
  padding: 4px 12px; border-radius: 20px;
  transition: all var(--trans);
}
.lang-chip:hover { border-color: var(--cyan); color: var(--cyan); }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── CODE PREVIEW ── */
.hero-visual { flex: 0 0 460px; position: relative; z-index: 1; animation: fade-up 0.9s 0.3s ease both; }
.code-preview {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow), var(--shadow-glow);
}
.code-preview-bar {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.code-preview-bar span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border);
}
.code-preview-bar span:nth-child(1) { background: #ff5f57; }
.code-preview-bar span:nth-child(2) { background: #febc2e; }
.code-preview-bar span:nth-child(3) { background: #28c840; }
.cp-title { margin-left: auto; font-size: 0.75rem; color: var(--text-sub); font-family: var(--font-mono); }
.code-preview-body {
  padding: 20px; font-family: var(--font-mono); font-size: 0.82rem;
  line-height: 1.7; white-space: pre-wrap; color: var(--text);
}
.c-import { color: #bb9af7; }
.c-comment { color: #565f89; }
.c-str { color: #9ece6a; }
.c-num { color: #ff9e64; }
.c-fn { color: #7dcfff; }
.code-preview-output {
  background: rgba(0,230,255,0.05); border-top: 1px solid var(--border);
  padding: 12px 20px; display: flex; align-items: center; gap: 12px;
}
.out-label {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700;
  color: var(--cyan); letter-spacing: 0.1em;
  background: rgba(0,230,255,0.1); padding: 2px 8px; border-radius: 4px;
}
.out-text { font-family: var(--font-mono); font-size: 0.85rem; color: #9ece6a; }

/* ── SECTIONS ── */
section { padding: 80px 24px; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-tag {
  display: inline-block;
  background: rgba(0,230,255,0.08); border: 1px solid rgba(0,230,255,0.2);
  color: var(--cyan); font-size: 0.75rem; font-weight: 700;
  padding: 4px 14px; border-radius: 20px; letter-spacing: 0.1em;
  margin-bottom: 12px; text-transform: uppercase;
}
.section-header h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800; letter-spacing: -0.02em;
}
.section-header p { color: var(--text-sub); margin-top: 12px; font-family: var(--font-mono); font-weight: 300; }

/* ── FEATURE CARDS ── */
.features { background: var(--bg2); }
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px; max-width: 1200px; margin: 0 auto;
}
.feature-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  text-decoration: none; color: var(--text);
  transition: all var(--trans); position: relative; overflow: hidden;
  display: block;
}
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad); opacity: 0; transition: opacity var(--trans);
}
.feature-card:hover::before { opacity: 1; }
.feature-card:hover {
  border-color: rgba(0,230,255,0.2);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3), 0 0 30px rgba(0,230,255,0.06);
}
.fc-icon { font-size: 2rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.feature-card p { color: var(--text-sub); font-size: 0.9rem; font-family: var(--font-mono); font-weight: 300; line-height: 1.6; }
.fc-langs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.fc-langs span {
  background: var(--surface); font-size: 0.7rem; font-family: var(--font-mono);
  padding: 3px 10px; border-radius: 12px; color: var(--text-sub);
}
.fc-arrow {
  position: absolute; bottom: 24px; right: 24px;
  color: var(--text-sub); font-size: 1.1rem; transition: all var(--trans);
}
.feature-card:hover .fc-arrow { color: var(--cyan); transform: translateX(4px); }

/* ── QUICK START ── */
.quickstart { max-width: 1000px; margin: 0 auto; }
.qs-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; margin-bottom: 0;
}
.qs-tab {
  background: none; border: none; color: var(--text-sub);
  padding: 8px 18px; border-radius: 8px; cursor: pointer;
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 600;
  transition: all var(--trans);
}
.qs-tab.active, .qs-tab:hover { background: var(--surface); color: var(--text); }
.qs-tab.active { color: var(--cyan); }
.qs-content { position: relative; }
.qs-panel { display: none; }
.qs-panel.active { display: block; }
.qs-code-wrap {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-top: none; overflow: hidden;
}
.qs-editor {
  width: 100%; background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--font-mono); font-size: 0.85rem;
  padding: 20px; resize: none; min-height: 220px;
  line-height: 1.7; white-space: pre; overflow-x: auto;
}
.qs-output {
  border-top: 1px solid var(--border);
  padding: 16px 20px; min-height: 60px;
  font-family: var(--font-mono); font-size: 0.82rem;
  background: rgba(0,0,0,0.3); color: #9ece6a;
  white-space: pre-wrap; line-height: 1.6;
}
.qs-output.html-preview { min-height: 200px; }
.qs-output iframe { width: 100%; height: 200px; border: none; }
.out-placeholder { color: var(--text-sub); font-style: italic; }
.qs-actions {
  display: flex; gap: 12px; align-items: center;
  padding: 16px 0;
}
.btn-run {
  background: var(--grad); color: white; border: none;
  padding: 10px 24px; border-radius: 8px; cursor: pointer;
  font-family: var(--font-display); font-size: 0.9rem; font-weight: 700;
  transition: all var(--trans);
}
.btn-run:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(249,3,149,0.35); }
.btn-run:disabled { opacity: 0.6; cursor: wait; }
.btn-open-lab {
  color: var(--cyan); text-decoration: none;
  font-size: 0.88rem; font-weight: 600;
  transition: all var(--trans);
}
.btn-open-lab:hover { opacity: 0.75; }

/* ── TOOLS ── */
.tools-overview { background: var(--bg2); }
.tools-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; max-width: 1200px; margin: 0 auto;
}
.tool-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  text-decoration: none; color: var(--text);
  transition: all var(--trans);
  border-left: 3px solid var(--tc, var(--cyan));
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  border-color: var(--tc, var(--cyan));
}
.tc-icon { font-size: 1.8rem; margin-bottom: 12px; display: block; }
.tool-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.tool-card p { color: var(--text-sub); font-size: 0.82rem; font-family: var(--font-mono); font-weight: 300; }

/* ── STATS ── */
.stats-banner {
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  gap: 0; padding: 50px 24px; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.stat-item { text-align: center; padding: 20px 40px; }
.stat-num {
  display: block; font-size: 3rem; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; line-height: 1;
}
.stat-suf { font-size: 2rem; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { color: rgba(255,255,255,0.5); font-size: 0.8rem; letter-spacing: 0.1em; margin-top: 6px; display: block; }
.stat-divider { width: 1px; height: 60px; background: rgba(255,255,255,0.1); }

/* ── FOOTER ── */
.main-footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 60px 24px 0; }
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 2fr;
  gap: 60px; padding-bottom: 40px;
}
.footer-brand p { color: var(--text-sub); font-size: 0.85rem; font-family: var(--font-mono); margin-top: 12px; max-width: 280px; line-height: 1.6; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-links h5 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); margin-bottom: 12px; }
.footer-links a { display: block; color: var(--text-sub); text-decoration: none; font-size: 0.85rem; margin-bottom: 8px; transition: color var(--trans); }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  color: var(--text-sub); font-size: 0.8rem;
}

/* ── CODE LAB (lab.php) ── */
.lab-layout {
  display: flex; height: calc(100vh - 64px);
  margin-top: 64px; overflow: hidden;
}
.lab-sidebar {
  width: 220px; min-width: 220px;
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto;
  padding: 16px 0;
}
.sidebar-section { padding: 0 12px 16px; }
.sidebar-section h6 {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-sub);
  padding: 0 8px; margin-bottom: 6px;
}
.lang-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px; border-radius: 8px;
  background: none; border: none; color: var(--text-sub);
  cursor: pointer; font-family: var(--font-display);
  font-size: 0.85rem; font-weight: 600;
  transition: all var(--trans); text-align: left;
}
.lang-btn:hover { background: var(--surface); color: var(--text); }
.lang-btn.active { background: rgba(0,230,255,0.1); color: var(--cyan); }
.lang-btn .lbadge {
  margin-left: auto; font-size: 0.65rem;
  background: var(--surface); padding: 2px 6px; border-radius: 4px;
  color: var(--text-sub);
}
.lang-btn.active .lbadge { background: rgba(0,230,255,0.15); color: var(--cyan); }

.lab-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.lab-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg3); flex-wrap: wrap;
}
.lab-toolbar .toolbar-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.lab-toolbar .toolbar-right { display: flex; align-items: center; gap: 8px; }
.lab-lang-label {
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--cyan); background: rgba(0,230,255,0.08);
  padding: 4px 12px; border-radius: 6px;
}
.select-theme {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 6px 10px; border-radius: 6px;
  font-size: 0.8rem; font-family: var(--font-mono); cursor: pointer;
}
.btn-clear, .btn-copy, .btn-share {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-sub); padding: 6px 14px; border-radius: 6px;
  cursor: pointer; font-size: 0.8rem; transition: all var(--trans);
}
.btn-clear:hover { color: var(--magenta); border-color: var(--magenta); }
.btn-copy:hover, .btn-share:hover { color: var(--cyan); border-color: var(--cyan); }
.btn-run-lab {
  background: var(--grad); color: white; border: none;
  padding: 8px 20px; border-radius: 8px; cursor: pointer;
  font-family: var(--font-display); font-size: 0.88rem; font-weight: 700;
  transition: all var(--trans); display: flex; align-items: center; gap: 6px;
}
.btn-run-lab:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(249,3,149,0.4); }
.btn-run-lab:disabled { opacity: 0.5; cursor: wait; }
.run-spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.6s linear infinite; display: none;
}

.editor-output-split {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.editor-pane {
  flex: 1; overflow: hidden; position: relative;
}
.editor-pane .CodeMirror {
  height: 100%; font-family: var(--font-mono) !important;
  font-size: 0.88rem !important; line-height: 1.7 !important;
}
.output-pane {
  height: 220px; min-height: 80px; max-height: 50%;
  border-top: 1px solid var(--border);
  background: #0a0a18; display: flex; flex-direction: column;
  resize: vertical; overflow: auto;
}
.output-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; background: var(--bg2);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.output-header span { font-size: 0.75rem; font-weight: 700; color: var(--text-sub); letter-spacing: 0.08em; }
.output-status {
  font-family: var(--font-mono); font-size: 0.72rem;
  padding: 2px 8px; border-radius: 4px; margin-left: auto;
}
.output-status.ok { background: rgba(40,200,64,0.15); color: #28c840; }
.output-status.err { background: rgba(255,95,87,0.15); color: #ff5f57; }
.output-status.running { background: rgba(0,230,255,0.12); color: var(--cyan); }
#lab-output {
  flex: 1; overflow-y: auto;
  padding: 12px 16px; font-family: var(--font-mono); font-size: 0.82rem;
  color: #9ece6a; white-space: pre-wrap; line-height: 1.6;
}
#lab-output .err-line { color: #ff5f57; }
#lab-output .info-line { color: var(--cyan); }
#lab-output.html-mode { padding: 0; }
#lab-output.html-mode iframe { width: 100%; height: 100%; border: none; }

/* ── ML STUDIO ── */
.ml-layout { padding: 84px 24px 40px; max-width: 1200px; margin: 0 auto; }
.ml-header { margin-bottom: 32px; }
.ml-header h1 { font-size: 2rem; font-weight: 800; }
.ml-tabs-bar {
  display: flex; gap: 4px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px; margin-bottom: 28px; flex-wrap: wrap;
}
.ml-tab {
  flex: 1; min-width: 120px; text-align: center;
  background: none; border: none; color: var(--text-sub);
  padding: 9px 16px; border-radius: 7px; cursor: pointer;
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 600;
  transition: all var(--trans);
}
.ml-tab.active { background: var(--surface); color: var(--cyan); }
.ml-tab:hover:not(.active) { background: rgba(255,255,255,0.04); color: var(--text); }
.ml-panel { display: none; }
.ml-panel.active { display: block; }

.notebook-cell {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px; overflow: hidden;
}
.cell-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.cell-num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-sub); min-width: 50px; }
.cell-type-badge {
  font-size: 0.68rem; padding: 2px 8px; border-radius: 4px;
  font-weight: 700; letter-spacing: 0.05em;
}
.cell-type-badge.code { background: rgba(0,230,255,0.1); color: var(--cyan); }
.cell-type-badge.md { background: rgba(249,3,149,0.1); color: var(--magenta); }
.cell-run-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-sub); font-size: 1rem; padding: 2px 6px;
  transition: color var(--trans);
}
.cell-run-btn:hover { color: var(--cyan); }
.cell-code textarea {
  width: 100%; background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--font-mono); font-size: 0.82rem;
  padding: 14px 16px; resize: none; min-height: 100px; line-height: 1.7;
}
.cell-output {
  border-top: 1px solid var(--border);
  padding: 12px 16px; font-family: var(--font-mono); font-size: 0.82rem;
  background: rgba(0,0,0,0.25); color: #9ece6a; white-space: pre-wrap;
  line-height: 1.6; display: none;
}
.cell-output.visible { display: block; }
.cell-output.error { color: #ff5f57; }

/* ── TOOLS PAGE ── */
.tools-layout { padding: 84px 24px 40px; max-width: 1400px; margin: 0 auto; }
.tool-panel-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px;
}
.tool-panel-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.tool-panel-header h3 { font-size: 1rem; font-weight: 700; flex: 1; }
.tool-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #28c840; box-shadow: 0 0 8px rgba(40,200,64,0.5);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}
.tool-panel-body { padding: 0; }
.tool-iframe-wrap {
  width: 100%; height: 520px; position: relative;
}
.tool-iframe-wrap iframe {
  width: 100%; height: 100%; border: none;
  background: var(--bg);
}
.tool-iframe-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg3); gap: 16px;
}
.tool-iframe-placeholder p { color: var(--text-sub); font-family: var(--font-mono); }
.tool-config-form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-row label { font-size: 0.85rem; font-weight: 600; min-width: 120px; }
.form-row input, .form-row select {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 8px 14px; border-radius: 8px;
  font-family: var(--font-mono); font-size: 0.85rem; flex: 1;
  transition: border-color var(--trans);
}
.form-row input:focus, .form-row select:focus {
  outline: none; border-color: var(--cyan);
}
.btn-connect {
  background: var(--grad); color: white; border: none;
  padding: 10px 24px; border-radius: 8px; cursor: pointer;
  font-family: var(--font-display); font-size: 0.9rem; font-weight: 700;
  transition: all var(--trans);
}
.btn-connect:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,230,255,0.3); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero { flex-direction: column; padding-top: 100px; min-height: auto; }
  .hero-visual { flex: none; width: 100%; }
  .main-nav { display: none; }
  .hamburger { display: block; }
  .header-actions .btn-enroll { display: none; }
  .lab-sidebar { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
  .stat-divider { display: none; }
  .stats-banner { gap: 0; }
  .stat-item { padding: 16px 24px; }
}
@media (max-width: 600px) {
  .features-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 2.2rem; }
  .qs-tabs { flex-direction: column; }
  .footer-links { grid-template-columns: 1fr; }
}
