@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

:root {
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --panel: #ffffff;
  --line: #e2e8f0;
  --line-light: #f1f5f9;
  --text: #1e293b;
  --text-secondary: #475569;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --navy: #0f172a;
  --navy-2: #1e293b;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-border: #c7d2fe;
  --green: #ecfdf5;
  --green-text: #065f46;
  --green-border: #a7f3d0;
  --blue: #eff6ff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -4px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.07), 0 8px 10px -6px rgba(0,0,0,.04);
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-2xl: 28px;
  --session-accent: #6366f1;
  --session-accent-soft: #eef2ff;
  --session-accent-deep: #312e81;
  --session-tag: #818cf8;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Noto Sans KR', 'Pretendard', 'Apple SD Gothic Neo', system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ─── GATE ─── */
.gate {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px;
}
.gate.active { display: flex; }

.gate-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: var(--radius-2xl);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--line);
}

.gate-mark {
  width: 60px; height: 60px;
  border-radius: var(--radius);
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: #fff;
  display: grid; place-items: center;
  font-size: 24px; font-weight: 900;
}

.gate-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.gate-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.gate-row {
  display: flex; gap: 8px;
  margin: 20px 0 8px;
}

.gate-row input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--bg);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.gate-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

.gate-message {
  min-height: 20px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 500;
}

/* ─── MOBILE BAR ─── */
.mobile-bar {
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 50;
  padding: 12px 16px;
  background: rgba(248, 250, 252, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.mobile-brand {
  display: flex; flex-direction: column; line-height: 1.2;
}

.mobile-brand strong {
  font-size: 14px;
  font-weight: 900;
  color: var(--navy);
}

.mobile-brand span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--text);
  font-size: 16px;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--bg-alt);
  border-color: #cbd5e1;
}

/* ─── LAYOUT ─── */
.shell {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow: hidden;
  z-index: 40;
  border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 999px; }

.brand {
  display: flex; gap: 14px; align-items: center;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.brand-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 20px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 4px 0 0;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.side-section {
  padding: 0 16px;
  margin-top: 20px;
}

.side-section:last-child {
  padding-bottom: 20px;
}

.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.section-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px;
  font-weight: 900;
  color: #64748b;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 0 4px;
  margin-bottom: 8px;
}

.section-note {
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
}

.route-list, .side-downloads { display: grid; gap: 4px; }

.route-btn, .side-file {
  width: 100%; text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.route-btn:hover {
  background: rgba(99, 102, 241, .15);
  color: #e0e7ff;
}

.route-btn.active {
  background: rgba(99, 102, 241, .2);
  color: #fff;
  font-weight: 700;
}

.side-file {
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
}

.side-file:hover {
  background: rgba(99, 102, 241, .15);
  border-color: rgba(99, 102, 241, .3);
  color: #e0e7ff;
}

.side-file.ghost {
  background: transparent;
}

/* Session Nav in sidebar */
.session-nav {
  display: grid; gap: 4px;
  overflow-y: auto;
  max-height: calc(100vh - 420px);
  padding-right: 4px;
}

.session-link {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  color: #cbd5e1;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: var(--transition);
}

.session-link:hover {
  background: rgba(99, 102, 241, .12);
  color: #e0e7ff;
}

.session-link.active {
  background: rgba(99, 102, 241, .2);
  color: #fff;
}

.session-link .num {
  font-size: 9px;
  color: #818cf8;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.session-link strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.session-link span:last-child {
  display: block;
  font-size: 10px;
  color: #64748b;
  margin-top: 1px;
}

/* ─── MAIN ─── */
.main {
  flex: 1;
  min-width: 0;
  margin-left: 260px;
}

/* ─── TOP TOOLS ─── */
.top-tools {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 30;
}

.route-pills { display: flex; gap: 6px; flex-wrap: wrap; }

.top-pill {
  padding: 8px 16px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  transition: var(--transition);
}

.top-pill:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.top-pill.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid transparent;
  transition: var(--transition);
}

.btn:disabled { opacity: .4; cursor: default; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(99, 102, 241, .3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, .25);
}

.btn-soft {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
}

.btn-soft:hover {
  background: var(--bg-alt);
  border-color: #cbd5e1;
}

.btn-line {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 13px;
}

.btn-line:hover:not(:disabled) {
  background: var(--bg-alt);
  border-color: #cbd5e1;
}

/* ─── VIEWS ─── */
.view { display: none; }
.view.active { display: block; }

/* ─── SESSION VIEW ─── */
#sessionsView.active {
  padding: 28px;
}

/* ─── HERO ─── */
.session-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #4338ca 0%, var(--accent) 50%, #818cf8 100%);
  color: #fff;
  padding: 36px 32px;
  min-height: 200px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 20px;
  align-items: center;
  box-shadow: var(--shadow-xl);
}

.session-hero::before {
  content: "";
  position: absolute;
  right: -40px; bottom: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.12) 0%, transparent 70%);
}

.session-hero::after {
  content: "";
  position: absolute;
  left: -60px; top: -60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.05) 0%, transparent 70%);
}

.hero-copy { position: relative; z-index: 2; }

.hero-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.session-hero h1 {
  margin: 14px 0 6px;
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 900;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 700;
  color: rgba(255,255,255,.85);
  margin: 0 0 10px;
}

.hero-intro {
  max-width: 680px;
  margin: 0;
  color: rgba(255,255,255,.65);
  line-height: 1.7;
  font-size: 13px;
  font-weight: 400;
}

.hero-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 14px;
}

.hero-meta span {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  font-size: 11px;
  font-weight: 700;
}

.hero-visual {
  position: relative; z-index: 2;
  display: grid; place-items: center;
}

.visual-orb {
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
  display: grid; place-items: center;
  font-size: 52px;
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(4px);
  box-shadow: inset 0 0 0 12px rgba(255,255,255,.03);
}

.hero-cta {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 16px;
}

.hero-cta .btn-soft {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.2);
  color: #fff;
  font-size: 12px;
  backdrop-filter: blur(4px);
}

.hero-cta .btn-soft:hover {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.3);
}

/* ─── ACTIVITY TABS ─── */
.activity-tabs {
  display: flex; gap: 8px;
  overflow: auto; padding: 20px 2px 6px;
  scrollbar-width: none;
  margin-bottom: 16px;
}

.activity-tabs::-webkit-scrollbar { display: none; }

.activity-tab {
  flex: 0 0 auto;
  min-width: 180px;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: grid; gap: 4px;
  transition: var(--transition);
}

.activity-tab:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.activity-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-border);
}

.activity-tab .top {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
}

.activity-tab strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.activity-tab span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
}

.activity-tab em {
  font-style: normal;
  color: var(--accent);
  font-weight: 900;
  font-size: 11px;
  background: rgba(99,102,241,.08);
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ─── SESSION LAYOUT ─── */
.session-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
}

.session-main { display: grid; gap: 16px; }

/* ─── SPOTLIGHT CARD ─── */
.spotlight-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.spotlight-card:hover {
  box-shadow: var(--shadow-md);
}

.spotlight-card::before {
  content: "";
  position: absolute;
  right: -20px; top: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(99,102,241,.05);
}

.spotlight-card .head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.spotlight-card h2 {
  margin: 10px 0 8px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 900;
  color: var(--navy);
}

.spotlight-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 13px;
}

.spotlight-note {
  margin-top: 14px;
  background: var(--bg);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.75;
  white-space: pre-line;
}

/* ─── FEATURE GRID ─── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-card:nth-child(1) { border-top: 3px solid #818cf8; }
.feature-card:nth-child(2) { border-top: 3px solid #34d399; }
.feature-card:nth-child(3) { border-top: 3px solid #fb923c; }

.feature-index {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 900;
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  margin-bottom: 12px;
}

.feature-card:nth-child(2) .feature-index {
  background: #ecfdf5; color: #059669;
}

.feature-card:nth-child(3) .feature-index {
  background: #fff7ed; color: #ea580c;
}

.feature-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.feature-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.feature-mini {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.6;
  font-weight: 500;
}

.feature-card.good .feature-mini {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.feature-card.warn .feature-mini {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.feature-card.info .feature-mini {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

/* ─── DETAIL AREA ─── */
.detail-area {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.detail-card:hover {
  box-shadow: var(--shadow);
}

.detail-card.wide { grid-column: 1 / -1; }

.card-head {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
  margin-bottom: 12px;
}

.card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.tiny-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  background: var(--session-accent-soft);
  color: var(--session-accent);
  letter-spacing: -0.01em;
}

.info-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 13px;
}

.info-list li::marker { color: var(--session-accent); }

.info-list.ordered { padding-left: 22px; }

.example-card {
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--line-light);
  padding: 16px;
  white-space: pre-line;
  line-height: 1.75;
  color: var(--text-secondary);
  font-size: 13px;
}

.action-pills {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 10px;
}

.action-pills span {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line-light);
}

/* ─── SESSION SIDE PANEL ─── */
.session-side-panel {
  display: grid; gap: 12px;
  align-content: start;
}

.side-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.side-card:hover {
  box-shadow: var(--shadow);
}

/* ─── TIMELINE ─── */
.timeline-box { display: grid; gap: 0; }

.timeline-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-light);
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-time {
  font-size: 11px;
  font-weight: 900;
  color: var(--session-accent);
  background: var(--session-accent-soft);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}

.timeline-item strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.timeline-item p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

/* ─── DOWNLOADS ─── */
.download-list { display: grid; gap: 10px; }

.download-card {
  background: var(--bg);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  padding: 14px;
  transition: var(--transition);
}

.download-card:hover {
  border-color: var(--line);
  background: #fff;
}

.download-card h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.download-card p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 11px;
}

.download-card a {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  transition: var(--transition);
}

.download-card a:hover {
  background: var(--accent-hover);
}

/* ─── NAVIGATION BAR ─── */
.navigation-bar {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.nav-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── PAGE CARD (prompts, projects, code views) ─── */
.page-card {
  background: transparent;
  display: grid; gap: 16px;
  padding: 28px;
}

.page-head {
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.page-head h2 {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--navy);
}

/* ─── LIBRARY GRID ─── */
.library-grid { display: grid; gap: 12px; }
.library-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.library-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.library-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: grid; gap: 10px;
  align-content: start;
  transition: var(--transition);
}

.library-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.label {
  display: inline-flex;
  width: max-content;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.library-card h3,
.library-card h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.library-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.card-actions a,
.card-actions button,
.copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.card-actions a:hover,
.card-actions button:hover,
.copy-btn:hover {
  background: var(--bg-alt);
  border-color: #cbd5e1;
}

.copy-btn { width: max-content; }

.soft-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

/* ─── PLAYGROUND ─── */
.playground-tools {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
}

.playground-choice,
.playground-info {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.playground-choice h3,
.playground-info h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

.lab-list { display: grid; gap: 6px; }

.lab-btn {
  width: 100%; text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid; gap: 3px;
  transition: var(--transition);
}

.lab-btn:hover {
  border-color: #cbd5e1;
  background: var(--bg-alt);
}

.lab-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.lab-btn strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.lab-btn span {
  font-size: 11px;
  color: var(--muted);
}

.prompt-box {
  margin-top: 14px;
  background: var(--bg);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  padding: 14px;
}

.prompt-box strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.prompt-box pre {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.75;
  font-family: inherit;
  color: var(--text-secondary);
  font-size: 13px;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.editor-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.code-editor {
  width: 100%;
  min-height: 420px;
  border: none;
  background: var(--navy);
  color: #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.preview-frame {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.playground-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

/* ─── TO TOP ─── */
.to-top {
  position: fixed; right: 24px; bottom: 24px;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-lg);
  display: grid; place-items: center;
  border: none;
  font-size: 16px;
  transition: var(--transition);
  z-index: 50;
}

.to-top:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  background: var(--accent);
}

/* ─── RESPONSIVE: TABLET ─── */
@media (max-width: 1180px) {
  .mobile-bar { display: flex; }

  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 60px; left: 0; right: 0;
    bottom: 0;
    width: 100%;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 60;
    border-radius: 0;
    border-right: none;
  }

  .sidebar.open { transform: translateX(0); }

  .main {
    margin-left: 0;
  }

  #sessionsView.active {
    padding: 16px;
  }

  .session-layout,
  .playground-tools,
  .editor-grid,
  .playground-foot {
    grid-template-columns: 1fr;
  }

  .library-grid.two,
  .library-grid.three,
  .feature-grid,
  .detail-area {
    grid-template-columns: 1fr;
  }

  .session-hero {
    grid-template-columns: 1fr;
    min-height: unset;
  }

  .hero-visual { justify-content: start; }
  .top-tools { padding: 12px 16px; }
  .page-card { padding: 16px; }

  .session-nav {
    max-height: none;
  }
}

/* ─── RESPONSIVE: MOBILE ─── */
@media (max-width: 760px) {
  .main { padding-bottom: 70px; }

  .top-tools { gap: 8px; }

  .route-pills {
    flex-wrap: nowrap;
    overflow: auto;
    width: 100%;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .route-pills::-webkit-scrollbar { display: none; }

  .quick-actions { width: 100%; }
  .quick-actions .btn { flex: 1; }

  .session-hero {
    padding: 24px 20px;
    border-radius: var(--radius-lg);
  }

  .session-hero h1 { font-size: 28px; }
  .hero-subtitle { font-size: 18px; }

  .activity-tab { min-width: 200px; }

  .spotlight-card h2 { font-size: 20px; }

  .navigation-bar { padding: 12px; }
  .nav-group { width: 100%; }
  .nav-group .btn { flex: 1; }

  .page-head h2 { font-size: 20px; }

  .library-card h3,
  .library-card h4 { font-size: 16px; }

  .code-editor,
  .preview-frame { min-height: 280px; }

  .to-top { right: 14px; bottom: 14px; }

  #sessionsView.active { padding: 12px; }
}

/* ─── ANIMATIONS ─── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.session-hero {
  animation: fadeInUp 0.4s ease-out;
}

.spotlight-card,
.feature-card,
.detail-card,
.side-card {
  animation: fadeInUp 0.35s ease-out backwards;
}

.feature-card:nth-child(1) { animation-delay: 0.05s; }
.feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-card:nth-child(3) { animation-delay: 0.15s; }

.detail-card:nth-child(1) { animation-delay: 0.05s; }
.detail-card:nth-child(2) { animation-delay: 0.1s; }
.detail-card:nth-child(3) { animation-delay: 0.15s; }
.detail-card:nth-child(4) { animation-delay: 0.2s; }
.detail-card:nth-child(5) { animation-delay: 0.25s; }
