/* =========================================================================
 * styles.css — 햄스터로봇S 사용법 · 스크래치 기초 과정
 * ========================================================================= */
:root {
  --navy: #1c2541; --navy2: #2b3a67; --ink: #1f2933; --muted: #66707a;
  --line: #e3e8ef; --bg: #f5f7fb; --card: #fff;
  --scratch: #f59f00; --robot: #37b24d; --blue: #4c97ff; --purple: #9966ff;
  --radius: 16px; --shadow: 0 6px 22px rgba(28,37,65,.08); --shadow-lg: 0 14px 40px rgba(28,37,65,.16);
  --topbar-h: 58px; /* 실제 값은 app.js의 ResizeObserver가 갱신 (모바일에서 헤더가 여러 줄로 접힘) */
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Pretendard","Apple SD Gothic Neo","Segoe UI","Malgun Gothic",system-ui,sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1,h2,h3 { line-height: 1.25; margin: 0; }
code { font-family: "Consolas","D2Coding",monospace; }

/* 상단바 */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 10px clamp(16px,4vw,40px); background: rgba(28,37,65,.96); backdrop-filter: blur(8px); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 16px; }
.brand-text small { font-size: 11px; opacity: .7; }
.topnav { display: flex; gap: 6px; flex-wrap: wrap; }
.topnav a { padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: #d7def0; transition: .15s; }
.topnav a:hover { background: rgba(255,255,255,.12); color: #fff; }

.app { max-width: 940px; margin: 0 auto; padding: clamp(20px,4vw,38px) clamp(16px,4vw,24px) 56px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.crumbs a:hover { color: var(--navy); text-decoration: underline; }
.page-title { font-size: clamp(24px,4vw,32px); margin-bottom: 8px; }
.page-sub { color: var(--muted); margin: 0 0 22px; }

/* 버튼 */
.btn { display: inline-block; padding: 12px 22px; border-radius: 12px; font-weight: 700; font-size: 15px; transition: .15s; }
.btn-primary { background: var(--robot); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.26); }

/* 히어로 */
.hero { display: flex; align-items: center; gap: 24px; border-radius: 24px; padding: clamp(26px,5vw,48px);
  background: radial-gradient(120% 140% at 0 0, #2b3a67 0%, #1c2541 60%, #161c30 100%); color: #fff;
  box-shadow: var(--shadow-lg); margin-bottom: 26px; }
.hero-copy { flex: 1; }
.hero-eyebrow { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; opacity: .7; margin: 0 0 10px; }
.hero-title { font-size: clamp(26px,5vw,40px); font-weight: 800; margin: 0 0 14px; }
.hero-desc { color: #cdd6ee; max-width: 540px; margin: 0 0 22px; }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-art { width: clamp(110px,18vw,170px); height: auto; border-radius: 24px; flex: none; }

/* 홈 카드 */
.home-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 16px; }
.home-card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; border-top: 4px solid var(--robot); transition: .12s; }
.home-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.home-card-icon { font-size: 34px; }
.home-card strong { font-size: 18px; }
.home-card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.home-card-go { font-weight: 700; color: var(--robot); font-size: 14px; }
.home-progress { margin-top: 22px; background: var(--card); border-radius: 14px; padding: 16px 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px; }
.home-progress em { font-style: normal; font-size: 13px; color: var(--muted); font-weight: 600; }

.bar { flex: 1; height: 10px; background: #eef1f6; border-radius: 999px; overflow: hidden; min-width: 120px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg,var(--scratch),var(--robot)); border-radius: 999px; transition: width .4s; }

/* 패널(사용법) */
.panel { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel h2 { font-size: 19px; margin-bottom: 14px; }
.panel-intro { color: var(--muted); margin: 0 0 16px; }
.spec-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 12px; }
.spec-item { background: #f3f6fd; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.spec-item strong { color: var(--navy2); font-size: 13px; }
.spec-item span { font-size: 14px; }
.part-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 12px; }
.part-card { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.part-icon { font-size: 28px; line-height: 1.1; }
.part-card strong { display: block; }
.part-card p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* 단계 리스트 */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.step-no { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--robot); color: #fff; font-weight: 800; display: grid; place-items: center; }
.steps strong { display: block; }
.steps p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.tipbox { background: #e7f5ff; border-radius: 12px; padding: 14px 16px; margin-top: 16px; font-size: 14px; color: #1864ab; }
.tipbox strong { margin-right: 4px; }
.tipbox ul { margin: 8px 0 0; padding-left: 18px; }
.page-next { text-align: center; margin-top: 24px; }

/* 블록사전 */
.blk-group { margin: 22px 0; }
.blk-title { font-size: 18px; margin-bottom: 12px; border-left: 5px solid var(--c); padding-left: 10px; }
.blk-table { display: grid; gap: 8px; }
.blk-row { display: grid; grid-template-columns: minmax(190px,1.4fr) minmax(120px,1fr) 1.8fr; gap: 14px; align-items: center;
  background: var(--card); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); border-left: 4px solid var(--c); }
.blk-name { display: flex; align-items: center; }
.blk-val { font-size: 13px; font-weight: 700; color: var(--c); }

/* 스크래치 스타일 블록 */
.sb { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px;
  background: var(--c); color: #fff; font-weight: 700; font-size: 12.5px; line-height: 1.1; border-radius: 7px;
  box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.sb-label { white-space: nowrap; }
.sb-in { background: #fff; color: #2a2f3a; border-radius: 999px; min-width: 20px; height: 17px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.07); white-space: nowrap; }
.sb-bool { background: rgba(0,0,0,.22); color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 13px; white-space: nowrap;
  display: inline-flex; align-items: center; clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 9px 100%, 0 50%); }
/* 명령형: 위 홈 + 아래 돌기 */
.sb-command::before { content: ""; position: absolute; top: 0; left: 15px; width: 15px; height: 4px; background: var(--card); border-radius: 0 0 4px 4px; }
.sb-command::after { content: ""; position: absolute; bottom: -4px; left: 15px; width: 15px; height: 4px; background: var(--c); border-radius: 0 0 4px 4px; }
/* 리포터형(센서 값): 알약 모양 */
.sb-reporter { border-radius: 999px; }
/* 모자형(이벤트): 위가 둥글게 */
.sb-hat { border-radius: 16px 16px 7px 7px; }
.sb-hat::after { content: ""; position: absolute; bottom: -4px; left: 15px; width: 15px; height: 4px; background: var(--c); border-radius: 0 0 4px 4px; }
.blk-desc { font-size: 13.5px; color: var(--muted); }

/* 기초 과정 목록 */
.course-head { margin-bottom: 18px; }
.course-progress { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.course-progress em { font-style: normal; font-size: 13px; color: var(--muted); }
.lesson-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lesson-item a { display: flex; align-items: center; gap: 16px; background: var(--card); padding: 16px 18px; border-radius: 14px;
  box-shadow: var(--shadow); border: 1px solid transparent; transition: .12s; }
.lesson-item a:hover { transform: translateY(-1px); border-color: var(--robot); }
.lesson-no { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #eef1f6; color: var(--navy2); font-weight: 800; display: grid; place-items: center; }
.is-done .lesson-no { background: var(--robot); color: #fff; }
.lesson-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lesson-title { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lesson-goal { font-size: 13.5px; color: var(--muted); }
.lesson-dur { font-size: 12.5px; color: var(--muted); flex: none; }
.lv { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fff4e6; color: #e8590c; }

/* 강의 상세 */
.lesson { background: var(--card); border-radius: var(--radius); padding: clamp(22px,4vw,34px); box-shadow: var(--shadow); border-top: 5px solid var(--robot); }
.lesson-head h1 { font-size: clamp(22px,4vw,28px); }
.lesson-meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.goalbox { background: #eef9f1; border-left: 4px solid var(--robot); padding: 14px 16px; border-radius: 10px; margin: 18px 0 26px; }
.goalbox strong { color: var(--robot); margin-right: 6px; }
.lsec { margin: 24px 0; }
.lsec h2 { font-size: 17px; margin-bottom: 12px; }
.dot-list, .check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.dot-list li, .check-list li { padding-left: 26px; position: relative; }
.dot-list li::before { content: "🎯"; position: absolute; left: 0; }
.check-list li::before { content: "☑"; position: absolute; left: 2px; color: var(--robot); font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.block-chips { gap: 12px 10px; align-items: center; }
.chip { background: var(--c); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 9px; }
.mission { background: #fff9db; border: 1px dashed #f2c94c; border-radius: 12px; padding: 16px 18px; }
.mission h2 { margin-bottom: 6px; }
.mission p { margin: 0; }
.complete { text-align: center; margin: 28px 0 8px; }
.complete button { border: none; cursor: pointer; font-size: 15px; font-weight: 700; padding: 13px 26px; border-radius: 12px; background: var(--robot); color: #fff; transition: .15s; }
.complete button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.complete button.is-done { background: #fff; color: var(--robot); border: 2px solid var(--robot); }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.ln { padding: 12px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 14px; max-width: 48%; }
.ln:hover:not(.dis) { border-color: var(--robot); color: var(--robot); }
.ln.dis { color: var(--muted); opacity: .6; }
.ln.next { margin-left: auto; text-align: right; }

/* 푸터 */
.footer { text-align: center; padding: 26px 20px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.footer-sub { font-size: 11.5px; opacity: .85; margin-top: 6px; }
.footer-sub a { color: var(--robot); }

@media (max-width: 600px) {
  .hero { flex-direction: column-reverse; text-align: center; }
  .hero-desc { margin-inline: auto; }
  .hero-btns { justify-content: center; }
  .blk-row { grid-template-columns: 1fr; gap: 6px; }
  .blk-val::before { content: "값: "; color: var(--muted); font-weight: 400; }
  .lesson-nav { flex-direction: column; }
  .ln, .ln.next { max-width: 100%; text-align: center; }
}

/* =========================================================================
 * 🧱 실습 플레이그라운드 & 스플릿 뷰(Split View) 추가 스타일
 * ========================================================================= */

/* 실습하기 내비게이션 특별 하이라이트 */
.topnav .nav-playground {
  background: linear-gradient(135deg, var(--scratch) 0%, var(--robot) 100%);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(245, 159, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: pulse-border 2s infinite alternate;
}
.topnav .nav-playground:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 159, 0, 0.35);
}

@keyframes pulse-border {
  0% { box-shadow: 0 4px 12px rgba(245, 159, 0, 0.2); }
  100% { box-shadow: 0 4px 16px rgba(55, 178, 77, 0.4); }
}

/* 전체 화면 플레이그라운드 레이아웃 */
body.playground-active {
  overflow: hidden !important; /* 메인 윈도우 스크롤 방지 */
  height: 100vh;
  height: 100dvh; /* 모바일 주소창을 제외한 실제 표시 영역 */
}
.full-viewport {
  max-width: 100% !important;
  width: 100% !important;
  height: calc(100vh - var(--topbar-h)); /* 헤더를 제외한 창 전체를 가득 채움 */
  height: calc(100dvh - var(--topbar-h));
  margin: 0 !important;
  padding: 0 !important;
}
.playground-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #fff;
}
.playground-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy2) 100%);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 10;
}
.playground-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.playground-title {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.3px;
}
.playground-status-info {
  font-size: 12px;
  color: #cdd6ee;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.playground-frame {
  flex: 1;
  border: none;
  width: 100%;
  height: 100%;
  background: #fff;
}

/* 스플릿 뷰(Split View) 레이아웃 */
.app:has(.split-layout) {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  height: calc(100vh - var(--topbar-h)); /* 헤더 높이를 제외한 화면 가득 채움 */
  height: calc(100dvh - var(--topbar-h));
  overflow: hidden;
}

.split-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.lesson-pane {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: clamp(20px, 4vw, 38px) clamp(16px, 4vw, 24px) 56px;
  background: var(--bg);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lesson-pane-inner {
  max-width: 940px;
  margin: 0 auto;
}

.sidebar-pane {
  width: 0;
  height: 100%;
  border-left: 0px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 5;
}

/* 스플릿 뷰 활성화 상태 (기본 50:50, --split 변수로 드래그 조절) */
.split-layout.split-active .lesson-pane {
  flex: 0 0 calc(var(--split, 50%) - 4px);
}
.split-layout.split-active .sidebar-pane {
  flex: 1;
  width: auto;
  border-left: 2px solid var(--line);
  box-shadow: -8px 0 24px rgba(28, 37, 65, 0.08);
}

/* 드래그 크기 조절 핸들 */
.split-resizer {
  display: none;
  flex: 0 0 8px;
  cursor: col-resize;
  background: var(--line);
  position: relative;
  touch-action: none;
  transition: background 0.15s;
  z-index: 6;
}
.split-resizer::after {
  content: "⋮";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}
.split-resizer:hover, .split-resizer:active {
  background: var(--robot);
}
.split-resizer:hover::after, .split-resizer:active::after {
  color: #fff;
}
.split-layout.split-active .split-resizer {
  display: block;
}

/* 드래그 중에는 부드러운 전환 애니메이션 비활성화 */
.split-layout.no-anim .lesson-pane,
.split-layout.no-anim .sidebar-pane {
  transition: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}
.sidebar-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #fff;
}
.sidebar-frame {
  flex: 1;
  border: none;
  width: 100%;
  height: 100%;
  background: #fff;
}

/* 전역 실습창(iframe) — body에 고정 배치되어 페이지 이동에도 살아있음(로봇 연결 유지) */
.pg-global {
  position: fixed;
  left: 0;
  top: 0;
  border: none;
  background: #fff;
  z-index: 15;
}
.pg-global.pg-hidden {
  visibility: hidden;
  pointer-events: none;
}

/* 실습창이 겹쳐질 슬롯 영역 */
.pg-slot {
  flex: 1;
  min-height: 0;
  background: #f0f2f8;
}
.pg-full-slot {
  height: 100%;
}

/* 스플릿 내 크럼브 및 토글 버튼 */
.split-crumbs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  background: var(--card);
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.crumbs-left {
  font-size: 13px;
  color: var(--muted);
}
.crumbs-left a {
  font-weight: 600;
  color: var(--navy2);
}
.crumbs-left a:hover {
  color: var(--scratch);
}

.btn-toggle-split {
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(55, 178, 77, 0.15);
  font-weight: 700;
}
.btn-toggle-split.btn-ghost {
  background: #fff;
  color: var(--robot);
  border: 1px solid var(--robot);
  box-shadow: none;
}
.btn-toggle-split.btn-ghost:hover {
  background: rgba(55, 178, 77, 0.05);
}

/* 추가 소형 버튼 스타일 및 헤더 리페어 */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

@media (max-width: 950px) {
  /* 태블릿 및 모바일에서는 50:50 스플릿 대신 세로 정렬 */
  .split-layout.split-active {
    flex-direction: column;
  }
  .split-layout.split-active .split-resizer {
    display: none; /* 모바일 세로 배치에서는 드래그 조절 비활성화 */
  }
  .split-layout.split-active .lesson-pane {
    flex: 0 0 45%;
  }
  .split-layout.split-active .sidebar-pane {
    width: 100%;
    height: 55%;
    border-left: none;
    border-top: 2px solid var(--line);
    box-shadow: 0 -8px 24px rgba(28, 37, 65, 0.08);
  }
  .split-crumbs {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .btn-toggle-split {
    width: 100%;
    text-align: center;
  }
}

/* 교구 선택 스위치 (Robot Selector) */
.robot-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  padding: 3px;
  margin: 0 10px;
}
.selector-btn {
  background: none;
  border: none;
  color: #cdd6ee;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.selector-btn:hover {
  color: #fff;
}
.selector-btn.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 언어 스위치 (교구 스위치와 동일 톤, 약간 컴팩트) */
.lang-selector {
  margin: 0 4px;
}
.lang-selector .selector-btn {
  padding: 6px 10px;
  font-size: 12px;
}

/* 라쿤 로봇 히어로 이미지 최적화 */
.hero-art.hero-racoon {
  background: white;
  padding: 8px;
  object-fit: contain;
}

/* 예제 코드 프리뷰어 스타일링 */
.code-preview-section {
  margin: 24px 0;
}
.code-preview-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.code-preview-block {
  background: #1f2937;
  color: #f3f4f6;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: auto;
  border-left: 6px solid var(--scratch);
  box-shadow: var(--shadow);
  margin: 0;
}
.code-preview-block code {
  font-family: "Consolas", "D2Coding", monospace;
  white-space: pre-wrap;
}

/* 예제 파일(.sb3) 다운로드 링크 */
.file-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
}
.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.file-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f3f6fd;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy2);
  transition: .15s;
}
.file-link:hover {
  background: var(--navy2);
  color: #fff;
  border-color: var(--navy2);
  transform: translateY(-1px);
}

/* 기초 과정 하단 예제 자료실 패널 */
.example-archive {
  margin-top: 26px;
}
.example-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  margin-top: 10px;
  background: #fafbfe;
}
.example-group summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  padding: 12px 0;
  color: var(--navy2);
  list-style-position: inside;
}
.example-group summary:hover {
  color: var(--scratch);
}
.example-group .file-list {
  padding: 4px 0 14px;
}
.example-count {
  font-weight: 500;
  font-size: 12.5px;
  color: var(--muted);
}

/* =========================================================================
 * 📱 모바일 최적화 — 상단바 재배치 · 실습창 헤더 컴팩트화
 * ========================================================================= */

/* 태블릿 이하: 상단바를 두 줄로 접고, 메뉴는 가로 스크롤 한 줄로 */
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .brand { margin-right: auto; }
  .robot-selector { margin: 0; }
  .topnav {
    order: 5; width: 100%;
    flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none; -ms-overflow-style: none;
    padding-bottom: 2px;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { flex: none; white-space: nowrap; padding: 8px 13px; }
}

/* 스마트폰: 브랜드·스위치를 더 컴팩트하게 */
@media (max-width: 480px) {
  .brand-logo { width: 32px; height: 32px; }
  .brand-text strong { font-size: 15px; }
  .brand-text small { display: none; }
  .selector-btn { padding: 5px 10px; font-size: 12px; }
  .lang-selector .selector-btn { padding: 5px 8px; font-size: 11.5px; }
  .panel { padding: 18px 16px; }
  .home-progress { padding: 14px 16px; }
  .lesson-item a { padding: 14px 14px; gap: 12px; }
  .lesson-dur { display: none; }
}

/* 초소형 화면: 로고만 남기고 텍스트 숨김 */
@media (max-width: 380px) {
  .brand-text { display: none; }
}

/* 실습창 상단 헤더 — 좁은 화면에서는 안내 문구를 숨겨 한 줄 유지 */
@media (max-width: 600px) {
  .playground-header { padding: 8px 12px; gap: 8px; }
  .playground-status-info { display: none; }
  .playground-title { font-size: 13.5px; }
  .sidebar-header { padding: 8px 12px; }
}


