@font-face { font-family: 'FD Newsreader'; src: url('https://font.fedu.vn/fonts/FDNewsreader-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'FD Newsreader'; src: url('https://font.fedu.vn/fonts/FDNewsreader-Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'FD Newsreader'; src: url('https://font.fedu.vn/fonts/FDNewsreader-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('https://font.fedu.vn/fonts/BeVietnamPro-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('https://font.fedu.vn/fonts/BeVietnamPro-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('https://font.fedu.vn/fonts/BeVietnamPro-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('https://font.fedu.vn/fonts/BeVietnamPro-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('https://font.fedu.vn/fonts/JetBrainsMono-Variable.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --accent: #047857;
  --accent-bg: #ecfdf5;
  --accent-border: #a7f3d0;
  --warn: #9a3412;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --code-bg: #0f172a;
  --code-ink: #f8fafc;
  --sidebar-w: 300px;
  --font-ui: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-prose: 'FD Newsreader', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; font-size: 16px; max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.6;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-ui); cursor: pointer; }

.app-shell { display: flex; min-height: 100vh; width: 100%; }

/* Sidebar Desktop */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px 16px 32px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.brand-badge {
  width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff;
  font-weight: 700; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; position: relative;
}
.brand-badge::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #10b981;
  position: absolute; top: -2px; right: -2px; border: 2px solid var(--surface);
}
.brand-title { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.brand-sub { font-size: 12px; color: var(--muted); }

.progress-box { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 16px; }
.progress-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.progress-bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; }

.toc-stage { margin-bottom: 14px; }
.toc-stage-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: 0.03em; padding: 6px 8px 4px;
}
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-link {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: var(--ink-2); line-height: 1.4; min-height: 40px;
}
.toc-link:hover { background: var(--surface-2); color: var(--ink); }
.toc-link.active { background: var(--ink); color: #ffffff; font-weight: 600; }
.toc-num { font-family: var(--font-mono); font-size: 12px; opacity: 0.7; flex-shrink: 0; margin-top: 1px; }
.toc-done-dot { margin-left: auto; color: #10b981; font-weight: 700; flex-shrink: 0; }
.toc-link.active .toc-done-dot { color: #6ee7b7; }

/* Main column */
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mobile-topbar {
  display: none; position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); padding: 10px 16px;
  align-items: center; justify-content: space-between; gap: 10px;
}
.content { width: 100%; max-width: 780px; margin: 0 auto; padding: 36px 28px 96px; }

/* Typography */
.kicker { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2);
}
.pill-accent { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-border); }
.pill-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); }
h1.page-title { font-size: clamp(24px, 3.6vw, 34px); font-weight: 700; line-height: 1.25; margin: 0 0 14px; color: var(--ink); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.deliverable-banner {
  background: var(--accent-bg); border: 1px solid var(--accent-border); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 24px; font-size: 15px; color: var(--ink);
}
.deliverable-banner strong { color: var(--accent); }

.section-heading { font-size: 18px; font-weight: 700; margin: 32px 0 12px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.prose { font-family: var(--font-prose); font-size: 18.5px; line-height: 1.78; color: var(--ink); }
.prose p { margin: 0 0 16px; }
.prose-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px;
}

.steps-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 24px; }
.steps-card ol { margin: 8px 0 0; padding-left: 20px; }
.steps-card li { margin-bottom: 8px; font-size: 15px; color: var(--ink-2); }

.video-box { margin-bottom: 24px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #000; aspect-ratio: 16/9; }
.video-box iframe, .video-box video { width: 100%; height: 100%; border: 0; display: block; }

/* Phone to Desktop bridge */
.bridge-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 18px; font-size: 14px; color: var(--ink-2);
}
.bridge-url { font-family: var(--font-mono); font-weight: 700; color: var(--ink); background: var(--surface-2); padding: 2px 7px; border-radius: 6px; }

/* Practice & Prompt */
.practice-card { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; margin-bottom: 20px; }
.practice-goal { font-size: 16px; font-weight: 600; color: var(--ink); margin: 0 0 12px; }
.practice-steps { margin: 0 0 16px; padding-left: 20px; }
.practice-steps li { margin-bottom: 8px; font-size: 15px; color: var(--ink-2); }

.prompt-box { background: var(--code-bg); color: var(--code-ink); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.prompt-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: rgba(255,255,255,0.06); border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 12px; color: #cbd5e1; font-weight: 600;
}
.prompt-box pre {
  margin: 0; padding: 14px 16px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; user-select: all;
}
.btn-copy {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 600;
}
.btn-copy-dark { background: #1e293b; color: #ffffff; border-color: #334155; }
.btn-copy-dark:hover { background: #334155; }

.safety-note {
  background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 10px;
  padding: 12px 14px; font-size: 14px; color: var(--warn);
}

/* Industry tabs */
.ind-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ind-btn {
  min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.ind-btn.active { background: var(--ink); color: #ffffff; border-color: var(--ink); font-weight: 600; }
.ind-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; font-size: 15.5px; color: var(--ink); line-height: 1.65;
}

/* Done + Bottom nav */
.done-row { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-done {
  min-height: 46px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 600;
}
.btn-done.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }
.btn-zip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 10px 16px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 600;
}
.lesson-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border);
}
.nav-card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); min-height: 44px;
}
.nav-card:hover { border-color: #94a3b8; }
.nav-card.next { text-align: right; }
.nav-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.nav-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; }

/* Home cards */
.hero-box { padding-bottom: 24px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.hero-lead { font-family: var(--font-prose); font-size: 19px; line-height: 1.7; color: var(--ink-2); margin: 0 0 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 20px;
  border-radius: 10px; background: var(--ink); color: #ffffff; font-size: 15px; font-weight: 600;
}
.stage-card { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 18px; }
.stage-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.stage-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); }
.stage-desc { margin: 0 0 14px; font-size: 14.5px; color: var(--muted); }
.lesson-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.lesson-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
}
.lesson-item:hover { border-color: #94a3b8; background: var(--bg); }
.lesson-code {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent);
  background: var(--accent-bg); padding: 4px 8px; border-radius: 6px; flex-shrink: 0;
}
.lesson-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.offline-box {
  margin-top: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px;
}

/* Studio page */
.studio-wrap { max-width: 960px; margin: 0 auto; padding: 28px 24px 80px; }
.studio-card { border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; margin-bottom: 24px; background: var(--bg); }
.studio-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.micro-preview { background: #0f172a; color: #fff; border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.micro-l1 { font-weight: 700; font-size: 15px; letter-spacing: 0.03em; color: #6ee7b7; }
.micro-l2 { font-family: var(--font-prose); font-style: italic; font-size: 16px; color: #f8fafc; margin-top: 2px; }
.beat-list { display: grid; gap: 10px; margin-top: 12px; }
.beat-row { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.beat-meta { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 4px; font-family: var(--font-mono); }

/* Mobile Drawer & Responsive */
.mobile-toc-fab { display: none; }
.drawer-backdrop {
  display: none; position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, 0.45);
  align-items: flex-end; justify-content: center;
}
.drawer-backdrop.open { display: flex; }
.drawer-sheet {
  width: 100%; max-height: 82vh; background: var(--bg); border-radius: 18px 18px 0 0;
  padding: 16px 16px 28px; overflow-y: auto;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }

@media (max-width: 1023px) {
  .app-shell { flex-direction: column; }
  .sidebar { display: none; }
  .mobile-topbar { display: flex; width: 100%; }
  .content { padding: 22px 16px 96px; }
  .prose { font-size: 17.5px; }
  .prose-card { padding: 16px 16px; }
  .practice-card { padding: 16px 16px; }
  .lesson-nav { grid-template-columns: 1fr; }
  .nav-card.next { text-align: left; }
  .mobile-toc-fab {
    display: inline-flex; align-items: center; gap: 6px; position: fixed; right: 16px; bottom: 16px; z-index: 50;
    min-height: 46px; padding: 10px 16px; border-radius: 99px; border: 1px solid #334155;
    background: var(--ink); color: #ffffff; font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  }
}
