/* ===== 기본 리셋 & 폰트 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  overflow-x: hidden;   /* 가로 스크롤 원천 차단 */
  max-width: 100%;
}
body {
  font-family: 'Inter','Noto Sans KR', sans-serif;
  background: #f8fafc;
  min-height: 100vh;
  max-width: 100%;       /* 뷰포트 초과 금지 */
  overflow-x: hidden;   /* 가로 삐져나옴 방지 */
  color: #1A2B3C;
  -webkit-tap-highlight-color: transparent;
  selection: bg-teal-100;
}

/* ===== 헤더 ===== */
.app-header {
  background: linear-gradient(135deg, #0d1a28 0%, #1A2B3C 100%);
  color: white;
  box-shadow: 0 2px 20px rgba(13,26,40,0.45);
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .3s, box-shadow .3s;
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-icon-wrap {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
/* 학교 로고 래퍼 (마름모 SVG용) */
.header-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 0 6px rgba(20,184,166,0.35));
  transition: filter .25s;
}
.header-logo-wrap:hover {
  filter: drop-shadow(0 0 10px rgba(20,184,166,0.55));
}
.header-title { font-size: 15px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.header-sub   { font-size: 11px; margin-top: 1px; font-weight: 500; }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* 모드 배지 */
.mode-badge-parent,
.mode-badge-admin {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.mode-badge-parent {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.35);
  color: rgba(255,255,255,.92);
}
.mode-badge-admin {
  background: rgba(20,184,166,.2);
  border: 1px solid rgba(20,184,166,.4);
  color: #2dd4bf;
}

.admin-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 14px; border-radius: 99px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.35);
  color: rgba(255,255,255,.92); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.18s;
  font-family: inherit;
}
.admin-btn:hover { background: rgba(255,255,255,0.22); color: white; }

/* ══════════════════════════════════════════
   히어로 섹션 — 참고 사이트 동일 구조
   (autoplay loop + scroll parallax)
══════════════════════════════════════════ */

/* ── 히어로 섹션 공통 ── */
#hero-section {
  position: relative;
  /* 뷰포트 전체 너비 보장 — 부모 max-width/padding 영향 완전 차단 */
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  margin-left: 0;
  margin-right: 0;
  /* 뷰포트 전체 높이 — svh 지원 기기는 svh, 아니면 vh */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;        /* 비디오 삐져나오기 방지 */
}

/* 히어로 배경색 */
.hero-bg {
  background: linear-gradient(135deg, #0d1a28 0%, #1A2B3C 50%, #1e3a4a 100%);
}

/* 메시 그라디언트 레이어 */
.hero-mesh {
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(20,184,166,.22) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(20,184,166,.12) 0%, transparent 50%);
}

/* 도트 그리드 */
.dot-grid {
  background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ── 히어로 배경 비디오 ── */
#hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  /* 가운데 기준점 — 어느 화면비에서도 전체 커버 */
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  /* 비율 유지하면서 꽉 채움 */
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  will-change: opacity;
  /* GPU 가속 */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
@keyframes heroVideoIn {
  from { opacity: 0; }
  to   { opacity: .42; }
}
#hero-video.loaded {
  animation: heroVideoIn 1.4s cubic-bezier(.22,1,.36,1) forwards;
}

/* 히어로 하단 그라디언트 마스크 */
#hero-section::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 160px;
  background: linear-gradient(to bottom, transparent, rgba(13,26,40,.92));
  pointer-events: none; z-index: 5;
}

/* 링 장식 — absolute 포지션 (인라인 style로 위치 지정) */
.teal-ring {
  position: absolute;
  border: 1px solid rgba(20,184,166,.22);
  border-radius: 50%;
  animation: expandRing 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes expandRing {
  0%,100% { transform: translate(-50%,-50%) scale(1); opacity: .5; }
  50%      { transform: translate(-50%,-50%) scale(1.06); opacity: .2; }
}

/* 콘텐츠 래퍼 */
.hero-content-wrap {
  will-change: opacity, transform;
}

/* ── reveal 스크롤 애니메이션 ── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .65s cubic-bezier(.4,0,.2,1), transform .65s cubic-bezier(.4,0,.2,1);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-l { opacity:0; transform:translateX(-26px); transition:opacity .65s cubic-bezier(.4,0,.2,1),transform .65s cubic-bezier(.4,0,.2,1); }
.reveal-l.visible { opacity:1; transform:none; }
.reveal-r { opacity:0; transform:translateX(26px);  transition:opacity .65s cubic-bezier(.4,0,.2,1),transform .65s cubic-bezier(.4,0,.2,1); }
.reveal-r.visible { opacity:1; transform:none; }
.d1{transition-delay:.1s!important} .d2{transition-delay:.22s!important}
.d3{transition-delay:.34s!important} .d4{transition-delay:.46s!important}

@keyframes fadeInUp {
  from { opacity:0; transform:translateY(14px); }
  to   { opacity:1; transform:none; }
}

/* ── 글래스 유틸리티 ── */
.glass {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── 텍스트 그라디언트 ── */
.text-teal-grad {
  background: linear-gradient(90deg, #14B8A6, #2dd4bf);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── 선택 버튼 ── */
.sel-btn {
  background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 10px;
  padding: 9px 16px; font-size: .875rem; font-family: inherit; font-weight: 500;
  color: #475569; cursor: pointer; transition: all .18s; white-space: nowrap;
}
.sel-btn:hover  { border-color: #14B8A6; color: #14B8A6; background: #f0fdfa; }
.sel-btn.active { background: #1A2B3C; border-color: #1A2B3C; color: white; font-weight: 700; }

/* ── 카드 호버 ── */
.card-hover { transition: box-shadow .2s, transform .2s; }
.card-hover:hover { box-shadow: 0 6px 24px rgba(20,184,166,.12); transform: translateY(-2px); }

/* ── 샤인 애니메이션 ── */
.shine-wrap { position: relative; overflow: hidden; }
.shine-wrap::after {
  content: ''; position: absolute; top: 0; left: -75%; width: 50%; height: 100%;
  background: linear-gradient(90deg,transparent,rgba(255,255,255,.18),transparent);
  transform: skewX(-20deg); animation: shine 3s infinite;
}
@keyframes shine { 0%,100%{left:-75%} 50%{left:125%} }

/* ── 플로트 뱃지 ── */
@keyframes floatUp { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-7px)} }
.float-badge { animation: floatUp 3s ease-in-out infinite; }

/* ── 타임라인 ── */
.tl-line::before {
  content: ''; position: absolute; left: 19px; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(to bottom, #14B8A6, #1A2B3C);
}

/* ── 시간표 그리드 반응형: 작은 모바일은 1열 ── */
@media (max-width: 480px) {
  .timetable-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 모바일 하단 네비게이션 ── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: rgba(13,26,40,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,.08);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 640px) {
  .bottom-nav { display: block; }
}

.bottom-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 100%;
}

/* 탭 아이템 공통 */
.bnav-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  padding: 10px 4px 8px;
  background: none; border: none;
  font-family: inherit; cursor: pointer;
  transition: opacity .15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

/* 아이콘 */
.bnav-icon {
  font-size: 17px;
  color: rgba(255,255,255,.65);
  transition: color .2s, transform .2s;
  display: block;
  margin-bottom: 1px;
}
/* 레이블 */
.bnav-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  transition: color .2s;
  line-height: 1;
}

/* 활성 탭 */
.bnav-item.active .bnav-icon { color: #14B8A6; transform: translateY(-1px); }
.bnav-item.active .bnav-label { color: #14B8A6; font-weight: 700; }
.bnav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 2px;
  background: #14B8A6; border-radius: 0 0 4px 4px;
}

/* 중앙 FAB 버튼 */
.bnav-center { padding-top: 4px; }
.bnav-fab {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #14B8A6, #0f9688);
  display: flex; align-items: center; justify-content: center;
  margin-top: -18px;
  box-shadow: 0 4px 18px rgba(20,184,166,.55);
  transition: transform .18s, box-shadow .18s;
  flex-shrink: 0;
}
.bnav-center.active .bnav-fab {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(20,184,166,.7);
}
.bnav-center .bnav-label { color: #14B8A6; font-weight: 700; }

/* ── 스크롤 바운스 ── */
@keyframes scrollBounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(8px)} }
.scroll-hint { animation: scrollBounce 2s ease-in-out infinite; }

/* ── 로딩 스핀 ── */
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 섹션 공통: 가로 넘침 완전 차단 ── */
#hero-section, #schedule-info-section, #timetable-section,
#search-section, #caution-section,
section, footer, main, nav {
  max-width: 100%;
}
/* 섹션별 가로 클리핑 */
#schedule-info-section,
#timetable-section,
#search-section,
#caution-section,
footer {
  overflow-x: hidden;
}

/* ── 섹션 스크롤 마진 ── */
#hero-section, #schedule-info-section, #timetable-section,
#search-section, #caution-section {
  scroll-margin-top: 60px;
}

/* ===== 메인 컨테이너 ===== */
.app-main {
  max-width: 1200px; margin: 0 auto;
  padding: 0 16px 32px;
  overflow-x: hidden;   /* clip → hidden 으로 강화 */
  width: 100%;
}

/* 모바일 body 하단 패딩 (하단 네비 공간 확보) */
@media (max-width: 640px) {
  body { padding-bottom: 64px; }
}
.app-main > #info-banner {
  margin-top: 28px;
  scroll-margin-top: 80px;
}

/* ===== 배너 ===== */
.info-banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: linear-gradient(135deg, #1A2B3C 0%, #1e3a4a 100%);
  border: 1px solid rgba(20,184,166,.35);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(20,184,166,.10);
}
.admin-banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 14px; padding: 14px 16px; margin-bottom: 18px;
}
.hidden { display: none !important; }

/* ===== 학년 탭 ===== */
.grade-tabs {
  display: flex; gap: 8px; margin-bottom: 12px;
  overflow-x: auto; padding-bottom: 2px;
}
.grade-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 99px;
  border: 1.5px solid #e2e8f0; background: white;
  font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: all 0.18s;
  font-family: inherit; color: #475569;
}
.grade-tab:hover { border-color: #14B8A6; color: #0f9688; background: #f0fdfa; }

.grade-num {
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0;
}

/* 학년 탭 — 틸 단일 액센트로 통일 */
.grade-tab.blue.active,
.grade-tab.purple.active,
.grade-tab.rose.active,
.grade-tab.teal.active {
  background: #1A2B3C; color: white; border-color: #1A2B3C;
}
.grade-tab.blue .grade-num   { background: #f0fdfa; color: #0f9688; }
.grade-tab.purple .grade-num { background: #f0fdfa; color: #0f9688; }
.grade-tab.rose .grade-num   { background: #f0fdfa; color: #0f9688; }
.grade-tab.teal .grade-num   { background: #f0fdfa; color: #0f9688; font-size: 10px; }
.grade-tab.active .grade-num { background: rgba(20,184,166,.22); color: #2dd4bf; }

/* ===== 교시 탭 ===== */
.period-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.period-tab {
  padding: 9px 24px; border-radius: 99px;
  border: 1.5px solid #e2e8f0; background: white;
  cursor: pointer; transition: all 0.18s;
  font-family: inherit; text-align: center;
}
.period-tab-main { font-size: 14px; font-weight: 700; color: #475569; }
.period-tab-sub  { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.period-tab.active .period-tab-main { color: white; }
.period-tab.active .period-tab-sub  { color: rgba(255,255,255,.7); }
.period-tab.active { background: #1A2B3C; border-color: #1A2B3C; }
.period-tab:not(.active):hover { background: #f0fdfa; border-color: #14B8A6; }
.period-tab:not(.active):hover .period-tab-main { color: #0f9688; }

/* ===== 섹션 헤더 ===== */
.section-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.section-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: #1A2B3C;
  display: flex; align-items: center; justify-content: center;
  color: #2dd4bf; font-size: 17px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(26,43,60,.18);
}
.section-title-text {
  font-size: 15px; font-weight: 800;
  color: #1A2B3C; letter-spacing: -.01em;
}
.section-note {
  display: inline-block;
  background: #f0fdfa; color: #0f9688;
  border: 1px solid #99f6e4;
  border-radius: 6px; padding: 2px 8px;
  font-size: 11px; font-weight: 600; margin-left: 6px;
}

/* ===== 그리드 래퍼 ===== */
.grid-scroll-wrap {
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(26,43,60,.08);
  padding: 12px;
  overflow: visible;
}

/* ===== 시간표 그리드 → 1열 그리드 ===== */
.timetable-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* 1열 그리드 — only-child 전체 너비 유지 */
.timetable-grid .timetable-card:only-child {
  grid-column: 1 / -1;
}

/* ===== 컬럼 헤더 셀 (숨김 처리 — 카드 내부에 정보 통합) ===== */
.col-header {
  display: none;
}

/* ===== 수업 카드 — 밝은 배경 ===== */
.timetable-card {
  border-radius: 12px;
  border: 1.5px solid rgba(20,184,166,.25);
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
  overflow: hidden;
  transition: filter .15s, transform .15s, box-shadow .15s;
  cursor: default;
  animation: fadeSlideUp 0.3s ease forwards;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 64px;
  box-shadow: 0 2px 8px rgba(20,184,166,.08);
}
.timetable-card.has-plan {
  cursor: pointer;
}
.timetable-card.has-plan:hover {
  filter: brightness(0.97);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20,184,166,.28);
  border-color: rgba(20,184,166,.55);
}
.timetable-card.no-plan {
  background: linear-gradient(135deg, #f3f4f6 0%, #e9f7f5 100%);
  border-color: rgba(20,184,166,.12);
  opacity: .72;
  box-shadow: none;
}
.timetable-card.no-plan .card-top-bar { background: rgba(20,184,166,.18) !important; }
.timetable-card.admin-add {
  cursor: pointer;
  opacity: .65;
}
.timetable-card.admin-add:hover {
  opacity: 1;
  filter: brightness(0.97);
  box-shadow: 0 6px 20px rgba(20,184,166,.2);
  transform: translateY(-2px);
}

/* 왼쪽 컬러 바 (세로) */
.card-top-bar {
  width: 4px;
  height: auto;
  flex-shrink: 0;
  border-radius: 0;
}

/* 카드 바디 — 2열 가로 레이아웃 */
.card-body {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  min-width: 0;
}

/* 카드 왼쪽 영역: 반 번호/분반명 */
.card-class-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  max-width: 40px;
  margin-right: 10px;
  flex-shrink: 0;
}
.card-class-label {
  font-size: 9px;
  font-weight: 800;
  color: rgba(20,184,166,.75);
  letter-spacing: .04em;
  margin-bottom: 1px;
}
.card-class-value {
  font-size: 15px;
  font-weight: 900;
  color: #1A2B3C;
  line-height: 1;
}

/* 구분선 */
.card-divider {
  width: 1px;
  height: 28px;
  background: rgba(20,184,166,.25);
  flex-shrink: 0;
  margin-right: 10px;
}

/* 카드 중앙 영역: 과목/분반명 + 장소 */
.card-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;  /* 과목↔장소 간격 */
}

.card-split-name {
  font-size: 11.5px; font-weight: 700;
  color: #1A2B3C; line-height: 1.3;
  word-break: keep-all;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 1px;  /* 장소와 살짝 간격 */
}
.card-subject {
  font-size: 15px; font-weight: 800;
  color: #1A2B3C; line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 카드 오른쪽 영역: 선생님 + 뱃지 */
.card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

.card-teacher {
  font-size: 10.5px;
  color: rgba(26,43,60,.50);
  display: flex; align-items: center; gap: 3px;
  white-space: nowrap;
}
.card-teacher i { color: rgba(20,184,166,.55); font-size: 9px; flex-shrink: 0; }
.card-loc {
  font-size: 12px;
  color: #0d9488;
  font-weight: 800;
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* card-center 안에서 왼쪽 정렬 자연스럽게 */
  align-self: flex-start;
}
.card-loc i { color: #14B8A6; font-size: 10px; flex-shrink: 0; }
.card-badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 20px; padding: 2px 8px;
  font-size: 10px; font-weight: 700;
}
.badge-add {
  background: rgba(20,184,166,.15);
  color: #0d9488;
  border: 1px solid rgba(20,184,166,.35);
}
.badge-pending {
  background: rgba(26,43,60,.07);
  color: rgba(26,43,60,.35);
}
.no-plan-text { color: rgba(26,43,60,.30) !important; }

.card-edit-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; margin-top: 8px;
  padding: 5px; border-radius: 8px;
  background: white; border: 1px solid;
  font-size: 11px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
  font-family: inherit;
}
.card-edit-btn:hover { opacity: 0.85; }

/* ===== 폼 ===== */
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: #374151; margin-bottom: 5px;
}
.form-input {
  width: 100%;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 13px; color: #1f2937;
  background: white;
  font-family: 'Noto Sans KR', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.form-input::placeholder { color: #9ca3af; }

/* ===== 별점 ===== */
.star-btn {
  background: none; border: none;
  cursor: pointer; font-size: 28px; line-height: 1;
  color: #d1d5db; padding: 0;
  transition: transform 0.1s;
}
.star-btn:hover { transform: scale(1.15); }
.rating-item {
  padding: 12px 14px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

/* ===== 이미지 업로드 ===== */
.upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center;
}
.upload-area:hover, .upload-area-hover {
  border-color: #3b82f6 !important;
  background: #eff6ff !important;
}

/* 이미지 미리보기 */
.img-preview-wrap {
  position: relative; border-radius: 10px;
  overflow: hidden; aspect-ratio: 1; background: #f3f4f6;
}
.img-preview-wrap img { width: 100%; height: 100%; object-fit: cover; }
.remove-img {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(220,38,38,0.9); color: white;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 10px; border: none; transition: background 0.2s;
}
.remove-img:hover { background: #dc2626; }

/* ===== 모달 ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow-y: auto;
}
.modal-box {
  background: white; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%; padding: 24px;
  margin: auto;
  max-height: 95vh;
  overflow-y: auto;
}
.modal-icon-wrap {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.modal-badge {
  display: inline-block;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.2);
  font-size: 12px; font-weight: 600;
}

/* ===== 버튼 ===== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; border-radius: 10px;
  color: white; font-weight: 700; font-size: 14px;
  border: none; cursor: pointer; transition: opacity 0.2s;
  font-family: inherit;
}
.btn-primary:hover { opacity: 0.88; }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; border-radius: 10px;
  background: white; color: #374151;
  font-weight: 600; font-size: 14px;
  border: 1.5px solid #d1d5db; cursor: pointer;
  transition: background 0.2s; font-family: inherit;
}
.btn-secondary:hover { background: #f3f4f6; }

.btn-footer {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 10px;
  font-weight: 600; font-size: 13px;
  border: none; cursor: pointer; transition: opacity 0.2s;
  font-family: inherit; flex: 1;
}
.btn-footer:hover { opacity: 0.85; }
.btn-gray { background: white; color: #6b7280; border: 1.5px solid #d1d5db; }
.btn-gray:hover { background: #f3f4f6; }
.btn-purple { background: #ede9fe; color: #6d28d9; }
.btn-amber  { background: #f59e0b; color: white; }

/* ===== 수업계획서 상세 (구 레거시 호환) ===== */
.detail-section {
  margin-bottom: 10px; padding: 11px 13px;
  background: #f8fafc; border-radius: 10px;
  border-left: 4px solid #3b82f6;
}
.detail-section h4 {
  font-size: 11px; font-weight: 700; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.detail-section h4 i { color: #3b82f6; }
.detail-section p {
  font-size: 14px; color: #1f2937;
  line-height: 1.75; white-space: pre-line;
}

/* ===== 수업계획서 모바일 카드 뷰 ===== */
.ld-wrap { padding: 0; }

/* 관찰 가이드 박스 (리디자인) */
/* ===== 수업계획서 관찰 가이드 박스 ===== */
.ld-observe-box {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 60%, #fff7ed 100%);
  border: 1.5px solid #fcd34d;
  border-radius: 16px;
  padding: 0 0 16px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(245,158,11,0.12);
}
.ld-observe-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #d97706, #f59e0b);
  padding: 12px 18px;
  margin-bottom: 14px;
}
.ld-observe-header-icon {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; flex-shrink: 0;
}
.ld-observe-header-text {
  font-size: 13px; font-weight: 800; color: white;
  letter-spacing: .06em;
  display: flex; align-items: center; gap: 6px;
}
.ld-observe-deco {
  opacity: 0.7; font-size: 11px;
}
.ld-observe-items { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
.ld-observe-item {
  display: flex; align-items: flex-start; gap: 10px;
}
.ld-observe-icon {
  width: 30px; height: 30px; border-radius: 10px;
  background: #f59e0b; color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; margin-top: 1px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.ld-observe-text { font-size: 12.5px; color: #78350f; line-height: 1.7; padding-top: 3px; }
.ld-observe-text strong { color: #92400e; font-weight: 800; }

/* 수업 기본 정보 카드 */
.ld-info-card {
  background: white;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.ld-info-header {
  padding: 14px 16px 10px;
  display: flex; align-items: flex-start; gap: 12px;
}
.ld-info-subject-wrap { flex: 1; min-width: 0; }
.ld-info-subject {
  font-size: 22px; font-weight: 900; line-height: 1.2;
  color: #111827; word-break: keep-all;
}
.ld-info-class {
  font-size: 13px; color: #6b7280; margin-top: 3px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ld-info-class .badge {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.ld-info-divider { height: 1px; background: #f3f4f6; margin: 0 16px; }
.ld-meta-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 12px 16px; gap: 8px;
}
.ld-meta-item { display: flex; flex-direction: column; gap: 2px; }
.ld-meta-label { font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .06em; }
.ld-meta-value { font-size: 13px; font-weight: 600; color: #374151; }

/* 섹션 카드 */
.ld-section {
  background: white;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.ld-section-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px 10px;
}
.ld-section-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; color: white;
}
.ld-section-title { font-size: 13px; font-weight: 800; color: #1f2937; }
.ld-section-body {
  padding: 0 16px 14px;
  font-size: 14px; color: #374151; line-height: 1.8;
  white-space: pre-line; word-break: keep-all;
}

/* 수업 흐름 타임라인 */
.ld-flow-timeline { padding: 0 16px 14px; }
.ld-flow-item {
  display: flex; gap: 12px; margin-bottom: 12px; position: relative;
}
.ld-flow-item:not(:last-child)::before {
  content: '';
  position: absolute; left: 15px; top: 30px;
  width: 2px; height: calc(100% + 0px);
  background: #e5e7eb; z-index: 0;
}
.ld-flow-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  z-index: 1; position: relative;
}
.ld-flow-dot.intro  { background: #dbeafe; color: #1d4ed8; }
.ld-flow-dot.main   { background: #dcfce7; color: #15803d; }
.ld-flow-dot.outro  { background: #fef9c3; color: #b45309; }
.ld-flow-dot.etc    { background: #f3f4f6; color: #6b7280; }
.ld-flow-content { flex: 1; padding-top: 4px; }
.ld-flow-stage { font-size: 11px; font-weight: 700; color: #9ca3af; margin-bottom: 2px; }
.ld-flow-text  { font-size: 13px; color: #374151; line-height: 1.7; white-space: pre-line; }

/* 이미지 인라인 갤러리 */
.ld-images-wrap { padding: 0 16px 14px; }
.ld-images-scroll {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px;
}
.ld-images-scroll::-webkit-scrollbar { height: 4px; }
.ld-images-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
.ld-img-item {
  flex-shrink: 0; width: 160px; height: 120px;
  border-radius: 10px; overflow: hidden; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.ld-img-item:hover { transform: scale(1.02); }
.ld-img-item img { width: 100%; height: 100%; object-fit: cover; }

/* 칩 뱃지 (재료/준비물) */
.ld-chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 14px; }
.ld-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f3f4f6; color: #374151;
  border-radius: 20px; padding: 4px 12px;
  font-size: 12px; font-weight: 600;
}

/* 특이사항 카드 */
.ld-note-box {
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 10px; padding: 10px 14px;
  font-size: 13px; color: #78350f; line-height: 1.7;
  margin: 0 16px 14px; white-space: pre-line;
}

/* detail-images 레거시 */
.detail-images {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px; margin-top: 8px;
}
.detail-images img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 8px; cursor: pointer; transition: transform 0.2s;
}
.detail-images img:hover { transform: scale(1.05); }

/* ===== 참관록 카드 ===== */
.obs-card {
  border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 14px; margin-bottom: 10px; background: white;
}
.obs-avg-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fef3c7; color: #b45309;
  border-radius: 20px; padding: 4px 12px;
  font-size: 13px; font-weight: 700;
}

/* ===== 라이트박스 ===== */
#lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.92); z-index: 100;
  align-items: center; justify-content: center; cursor: pointer;
}
#lightbox.active { display: flex; }
#lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; object-fit: contain; }

/* ===== 스크롤바 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ===== 애니메이션 ===== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== 교수학습 지도안 표 스타일 ===== */
.jidoan-section {
  padding: 14px 18px 0;
}
.jidoan-table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid #d1d5db;
  font-size: 13px;
  margin-bottom: 0;
}
.jidoan-table th,
.jidoan-table td {
  border: 1px solid #d1d5db;
  padding: 8px 10px;
  vertical-align: middle;
}
.jidoan-table th {
  background: #fef9c3;
  color: #374151;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  font-size: 12px;
}
.jidoan-th-left {
  text-align: left !important;
  padding-left: 12px !important;
}
.jidoan-table td .form-input {
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}

/* ══════════════════════════════════════════════
   참관록 모달 — 전면 리디자인 (Primary 테마)
══════════════════════════════════════════════ */

/* 모달 박스 */
.obs-modal-box {
  max-width: 640px;
  padding: 0;
  overflow: hidden;
}

/* 헤더 */
.obs-modal-header {
  background: linear-gradient(135deg, #0d1a28 0%, #1A2B3C 100%);
  padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 16px 16px 0 0;
}
.obs-modal-header-inner { display: flex; align-items: center; gap: 12px; }
.obs-modal-header-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(20,184,166,.2);
  border: 1px solid rgba(20,184,166,.35);
  display: flex; align-items: center; justify-content: center;
  color: #2dd4bf; font-size: 17px; flex-shrink: 0;
}
.obs-modal-title { font-size: 17px; font-weight: 800; color: white; }
.obs-modal-subtitle { font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: 2px; }
.obs-modal-close {
  background: rgba(255,255,255,.1); border: none; cursor: pointer;
  color: white; font-size: 16px;
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s; flex-shrink: 0;
}
.obs-modal-close:hover { background: rgba(255,255,255,.2); }

/* 스크롤 영역 */
.obs-modal-scroll { overflow-y: auto; max-height: 72vh; }

/* 섹션 공통 */
.obs-section {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.obs-section-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 800;
  color: #14B8A6; letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 12px;
}
.obs-section-label i { font-size: 11px; }

/* 수업 정보 선택 영역 */
.obs-select-grid { display: flex; flex-direction: column; gap: 12px; }
.obs-select-group { display: flex; flex-direction: column; gap: 6px; }
.obs-select-label {
  font-size: 11px; font-weight: 700;
  color: #64748b; letter-spacing: .04em;
}
.obs-btn-row {
  display: flex; flex-wrap: nowrap; gap: 6px;
  overflow-x: auto; padding-bottom: 2px;
}
.obs-btn-row-wrap { flex-wrap: wrap; }
.obs-sel-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 7px 14px; border-radius: 8px;
  border: 1.5px solid #e2e8f0; background: #f8fafc;
  font-size: 13px; font-weight: 600; color: #475569;
  cursor: pointer; transition: all .16s; white-space: nowrap;
  font-family: inherit; flex-shrink: 0;
}
.obs-sel-btn:hover { border-color: #14B8A6; color: #0f9688; background: #f0fdfa; }
.obs-sel-btn.active { background: #1A2B3C; border-color: #1A2B3C; color: white; }
.obs-sel-sub { font-size: 10px; color: #94a3b8; font-weight: 400; }
.obs-sel-btn.active .obs-sel-sub { color: rgba(255,255,255,.6); }

/* 수업 정보 그리드 */
.obs-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 12px;
}
.obs-info-item {
  display: flex; flex-direction: column; gap: 2px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 8px 12px;
}
.obs-info-key {
  font-size: 10px; font-weight: 700;
  color: #94a3b8; text-transform: uppercase; letter-spacing: .06em;
}
.obs-info-val { font-size: 13px; font-weight: 600; color: #374151; }
.obs-info-val-em { color: #1A2B3C; font-weight: 800; }

/* 이름 입력 행 */
.obs-name-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.obs-name-item { display: flex; flex-direction: column; gap: 5px; }

/* 공통 인풋 */
.obs-input {
  width: 100%;
  border: 1.5px solid #e2e8f0; border-radius: 9px;
  padding: 9px 12px; font-size: 13px; color: #1f2937;
  background: white; font-family: 'Noto Sans KR', sans-serif;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.obs-input:focus {
  outline: none; border-color: #14B8A6;
  box-shadow: 0 0 0 3px rgba(20,184,166,.12);
}
.obs-input::placeholder { color: #b0bec5; }

/* 유의사항 박스 (레몬색) */
.obs-notice-box {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid #fde047;
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
  box-shadow: 0 2px 10px rgba(234,179,8,.1);
}
.obs-notice-header {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #ca8a04, #eab308);
  padding: 10px 16px;
}
.obs-notice-header-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 13px; flex-shrink: 0;
}
.obs-notice-title {
  font-size: 13px; font-weight: 800; color: white; letter-spacing: .04em;
}
.obs-notice-list {
  list-style: none; padding: 10px 14px 12px; margin: 0;
  display: flex; flex-direction: column; gap: 7px;
}
.obs-notice-list li {
  font-size: 12.5px; color: #713f12; line-height: 1.65;
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(255,255,255,.6); border-radius: 8px; padding: 7px 10px;
}
.obs-notice-icon-wrap {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #ca8a04, #f59e0b);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 10px; flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(202,138,4,.25);
}

/* 체크리스트 섹션 */
.obs-check-item {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 13px 14px; background: #f8fafc; margin-bottom: 8px;
}
.obs-check-num {
  width: 28px; height: 28px; border-radius: 8px;
  background: #1A2B3C;
  color: #2dd4bf; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: .03em;
}
.obs-check-content { flex: 1; min-width: 0; }
.obs-check-q {
  font-size: 13px; color: #1f2937; line-height: 1.65; font-weight: 600;
}
.obs-check-q-mb { margin-bottom: 8px; }

/* ── 별점 래퍼 ── */
.obs-star-wrap {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* 라벨 + 별 + 결과를 하나의 그리드로 완벽 정렬 */
.obs-star-grid {
  display: grid;
  /* 5칸 균등 분할 */
  grid-template-columns: repeat(5, 1fr);
  width: 100%;
}

/* 레이블 텍스트 — 각 칸 가운데 정렬 */
.obs-scale-labels {
  display: contents; /* 그리드 자식으로 펼침 */
}
.obs-scale-labels span {
  font-size: 9.5px;
  color: #9ca3af;
  text-align: center;
  padding-bottom: 4px;
  line-height: 1.3;
  word-break: keep-all;
}

/* 별 버튼 행 */
.obs-star-row {
  display: contents; /* 그리드 자식으로 펼침 */
}
.obs-star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  color: #d1d5db;
  padding: 4px 0;
  text-align: center;
  transition: transform .1s, color .1s;
  -webkit-tap-highlight-color: transparent;
}
.obs-star-btn:hover { transform: scale(1.18); }

/* 결과 레이블 */
.obs-rating-result {
  grid-column: 1 / -1;   /* 전체 너비 */
  text-align: right;
  margin-top: 6px;
}
.obs-rating-label {
  font-size: 12px; font-weight: 700; color: #1A2B3C;
  background: #f0fdfa; border: 1px solid #99f6e4;
  padding: 2px 10px; border-radius: 20px;
}

/* 서술형 textarea */
.obs-textarea {
  width: 100%; resize: vertical; min-height: 90px;
  font-size: 13px; line-height: 1.7;
}

/* 푸터 */
.obs-modal-footer {
  padding: 12px 16px;
  background: #f8fafc; border-top: 1px solid #e2e8f0;
  display: flex; gap: 10px; border-radius: 0 0 16px 16px;
}
.obs-btn-cancel {
  flex: 1; padding: 12px; border-radius: 10px;
  background: white; border: 1.5px solid #e2e8f0;
  font-size: 13px; font-weight: 600; color: #64748b;
  cursor: pointer; font-family: inherit; transition: background .18s;
}
.obs-btn-cancel:hover { background: #f1f5f9; }
.obs-btn-submit {
  flex: 2; padding: 12px; border-radius: 10px;
  background: linear-gradient(135deg, #1A2B3C, #253548);
  border: none; font-size: 13px; font-weight: 800;
  color: white; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: opacity .18s; box-shadow: 0 4px 14px rgba(26,43,60,.3);
}
.obs-btn-submit:hover { opacity: .88; }
.obs-btn-submit i { color: #2dd4bf; }

/* ===== 참관록 정보 표 ===== */
.obs-info-table th {
  background: #eff6ff !important;
  color: #1e40af !important;
}

/* ===== 작은 폼 인풋 (표 안에서) ===== */
.form-input-sm {
  padding: 5px 8px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
}

/* ===== 지도안 상세 테이블 ===== */
.jidoan-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border: 1.5px solid #d1d5db;
  margin-bottom: 12px;
}
.jidoan-detail-table th,
.jidoan-detail-table td {
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  vertical-align: top;
}
.jidoan-detail-table th {
  background: #fef9c3;
  color: #374151;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  width: 100px;
  font-size: 12px;
}
.jidoan-detail-table td {
  color: #1f2937;
  line-height: 1.75;
  white-space: pre-line;
}
.jidoan-detail-title {
  font-size: 15px;
  font-weight: 800;
  color: #1f2937;
  text-align: center;
  padding: 12px 0 8px;
  letter-spacing: .04em;
  border-bottom: 2px solid #1f2937;
  margin-bottom: 12px;
}
.stage-header-row th {
  background: #fef9c3 !important;
  text-align: center !important;
  font-weight: 700;
  color: #374151;
}

/* ===== 반응형 (태블릿 이하) ===== */
@media (max-width: 640px) {
  .header-title { font-size: 15px; }
  .header-sub   { font-size: 11px; }
  .mode-badge-text { display: none; }   /* 모바일에서 배지 텍스트 숨김 */
  .grade-tab    { padding: 8px 12px; font-size: 13px; }
  .period-tab   { padding: 8px 16px; }
  .modal-box    { padding: 16px; }
  .app-main     { padding: 0 10px 80px; }  /* 히어로 직후 배너가 자연스럽게 이어짐 */
  .obs-star-btn { font-size: 26px; }
  .jidoan-table th, .jidoan-table td { padding: 6px 8px; font-size: 12px; }
  .section-header { margin-bottom: 8px; }
}

/* ===== 히어로 반응형 ===== */
@media (max-width: 768px) {
  #hero-section {
    min-height: 100vh;
    min-height: 100svh;
    /* margin 음수 완전 제거 — width:100vw + left:50% + translateX(-50%) 로 처리 */
  }
  .hero-content-wrap {
    padding: 80px 20px 90px;
  }
  .hero-top-badge { font-size: 11px; padding: 6px 14px; margin-bottom: 20px; }
  .hero-schedule-badges { gap: 6px; }
  .hero-glass-badge { font-size: 11px; padding: 6px 12px; }
}
@media (max-width: 480px) {
  #hero-section {
    min-height: 100vh;
    min-height: 100svh;
  }
  .hero-content-wrap { padding: 72px 16px 80px; }
  .hero-main-title   { font-size: 32px; }
  .hero-main-desc    { font-size: 12.5px; }
  .hero-top-badge    { font-size: 10px; padding: 5px 12px; margin-bottom: 16px; }
  .hero-scroll-hint  { display: none; }
  .hero-schedule-badges { flex-direction: column; align-items: center; gap: 5px; }
}

@media (max-width: 480px) {
  /* 헤더 최소화 */
  .header-inner  { padding: 10px 14px; }
  .header-icon-wrap { width: 38px; height: 38px; font-size: 17px; }
  .header-logo-wrap { width: 40px; height: 40px; }
  .header-logo-wrap svg { width: 40px; height: 40px; }
  .header-title  { font-size: 14px; }
  .admin-btn     { padding: 5px 10px; font-size: 12px; }

  /* 배너 */
  .info-banner   { padding: 12px 13px; border-radius: 10px; }

  /* 학년 탭 - 터치 최적화 */
  .grade-tabs    { gap: 6px; }
  .grade-tab     { padding: 10px 14px; font-size: 13px; min-height: 44px; }
  .grade-num     { width: 26px; height: 26px; font-size: 13px; }

  /* 교시 탭 - 전체 너비 균등분할 */
  .period-tabs   { gap: 6px; }
  .period-tab    { flex: 1; padding: 10px 0; min-height: 52px; }
  .period-tab-main { font-size: 16px; }
  .period-tab-sub  { font-size: 11px; }

  /* 섹션 헤더 */
  .section-icon  { width: 36px; height: 36px; font-size: 17px; }

  /* 그리드 스크롤 래퍼 */
  .grid-scroll-wrap { padding: 10px; border-radius: 12px; }

  /* 시간표 카드 모바일 */
  .timetable-card  { min-width: 130px; border-radius: 10px; }
  .card-subject    { font-size: 18px; }
  .card-teacher, .card-loc { font-size: 11px; }
  .card-body       { padding: 10px; }

  /* 수업계획서 상세 모달 */
  .modal-box       { padding: 0 !important; border-radius: 14px; }

  /* 지도안 섹션 */
  .jidoan-section  { padding: 10px 12px 0; }
  .jidoan-table    { font-size: 12px; }
  .jidoan-table th, .jidoan-table td { padding: 5px 7px; }

  /* 별점 */
  .obs-star-btn  { font-size: 30px; }
  .obs-scale-labels { font-size: 9px; }

  /* 버튼 */
  .btn-primary, .btn-secondary { padding: 11px 16px; font-size: 13px; }
  .btn-footer  { padding: 13px 10px; font-size: 13px; min-height: 48px; }
}

/* ===== QR 필터 칩 버튼 ===== */
.qr-chip-btn {
  padding: 5px 11px;
  border-radius: 20px;
  border: 1.5px solid #d1d5db;
  background: white;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.15s;
  font-family: inherit;
}
.qr-chip-btn:hover { background: #f0fdf4; border-color: #6ee7b7; color: #065f46; }
.qr-chip-btn.active {
  background: #059669; border-color: #059669;
  color: white;
}

/* ===== QR 코드 카드 (반 선택형) ===== */
.qr-card {
  border-radius: 12px;
  overflow: hidden;
  border: 2.5px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  background: white;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  user-select: none;
}
.qr-card:hover {
  border-color: #6ee7b7;
  box-shadow: 0 4px 16px rgba(5,150,105,0.15);
  transform: translateY(-2px);
}
/* 선택됨 */
.qr-card.selected {
  border-color: #059669 !important;
  box-shadow: 0 0 0 3px rgba(5,150,105,0.2), 0 4px 12px rgba(5,150,105,0.15);
}
/* 선택 뱃지 (우상단 체크) */
.qr-card-select-badge {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #e5e7eb; color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; z-index: 2;
  transition: all 0.15s;
  border: 1.5px solid white;
  opacity: 0;
}
.qr-card:hover .qr-card-select-badge { opacity: 0.6; }
.qr-card.selected .qr-card-select-badge {
  background: #059669;
  opacity: 1;
}

/* ═══════════════════════════════════════════════
   학교 안내 — 탭 스위치 + 맵 컨테이너 + 컨트롤 오버레이
   ═══════════════════════════════════════════════ */

/* 탭 바 */
.map-tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 14px;
}
.map-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.map-tab-btn i { font-size: 13px; }
.map-tab-btn:hover { background: rgba(255,255,255,.7); color: #1A2B3C; }
.map-tab-active {
  background: white !important;
  color: #1A2B3C !important;
  box-shadow: 0 2px 10px rgba(26,43,60,.12);
}
.map-tab-active i { color: #14B8A6; }

/* 패널 (탭별 지도 영역) */
.map-panel {
  display: none;
}
.map-panel-active {
  display: block;
}

/* 지도 래퍼 — 핀치줌 컨테이너 */
.map-wrap {
  position: relative;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 2px 14px rgba(26,43,60,.07);
  min-height: 360px;   /* 지도가 충분히 보이도록 */
  max-height: 70vh;    /* 화면 넘침 방지 */
}
.map-wrap:active { cursor: grabbing; }

/* 캔버스 래퍼 */
.map-inner {
  transform-origin: 0 0;
  will-change: transform;
  display: inline-block;
  width: 100%;
}

/* 로딩 인디케이터 */
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #f8fafc;
  z-index: 5;
  border-radius: 16px;
}
.map-loading p {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.map-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid #e2e8f0;
  border-top-color: #14B8A6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 핀치 힌트 오버레이 */
.map-hint {
  position: absolute;
  inset: 0;
  background: rgba(26,43,60,.42);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  transition: opacity .4s;
  z-index: 3;
}
.map-hint p {
  color: white;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
}

/* ★ 맵 컨트롤 버튼 바 (가로형) ★ */
.map-ctrl-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
.map-ctrl-bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  background: #1A2B3C;
  border: 1.5px solid rgba(20,184,166,.45);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .12s, box-shadow .18s;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.map-ctrl-bar-btn i {
  font-size: 12px;
  flex-shrink: 0;
}
.map-ctrl-bar-btn:hover {
  background: #14B8A6;
  border-color: #14B8A6;
  color: white;
  box-shadow: 0 4px 14px rgba(20,184,166,.40);
  transform: translateY(-1px);
}
.map-ctrl-bar-btn:active {
  transform: scale(0.95);
  box-shadow: none;
}
/* 봐를 크기 색상 다르게 */
.map-ctrl-bar-reset {
  background: rgba(255,255,255,.07);
  border-color: rgba(148,163,184,.40);
  color: #94a3b8;
}
.map-ctrl-bar-reset:hover {
  background: #334155;
  border-color: #64748b;
  color: #e2e8f0;
}

/* 모바일 조정 */
@media (max-width: 768px) {
  .map-ctrl-bar { gap: 7px; margin-bottom: 8px; }
  .map-ctrl-bar-btn { height: 38px; padding: 0 14px; font-size: 12px; border-radius: 19px; }
  .map-ctrl-bar-btn i { font-size: 11px; }
  .map-tab-btn { font-size: 12px; padding: 9px 10px; gap: 5px; }
}
@media (max-width: 400px) {
  .map-ctrl-bar { gap: 5px; }
  .map-ctrl-bar-btn { height: 36px; padding: 0 11px; font-size: 11px; }
}

.qr-card-header {
  padding: 10px 12px;
  color: white;
  text-align: center;
}
.qr-card-period {
  font-size: 10px; font-weight: 700;
  opacity: .85; margin-bottom: 2px; letter-spacing: .05em;
}
.qr-card-class {
  font-size: 13px; font-weight: 900;
  line-height: 1.3; word-break: keep-all;
}
.qr-card-subject {
  font-size: 11px; opacity: .85; margin-top: 2px;
}
.qr-code-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 10px; background: white; min-height: 90px;
}
.qr-code-wrap canvas, .qr-code-wrap img {
  width: 120px !important; height: 120px !important;
}
.qr-card-footer {
  background: #f9fafb;
  border-top: 1px solid #f3f4f6;
  padding: 6px 10px;
  text-align: center;
}
.qr-teacher {
  font-size: 11px; color: #6b7280;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}

/* ===== 화면 전환형 풀페이지 패널 ===== */
.fullpage-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #f8fafc;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.fullpage-panel.open {
  transform: translateX(0);
}
/* 패널 상단 헤더 (뒤로가기 포함) */
.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 56px;
  background: #1A2B3C;
  color: white;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(13,26,40,.35);
}
.panel-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: background 0.15s;
}
.panel-back-btn:hover { background: rgba(255,255,255,.2); }
.panel-back-btn i { font-size: 12px; }
.panel-header-title {
  font-size: 15px;
  font-weight: 800;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(20,184,166,.25);
  border: 1px solid rgba(20,184,166,.5);
  color: #2dd4bf;
  flex-shrink: 0;
}
/* 패널 스크롤 영역 */
.panel-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: 80px;
}
/* 패널 하단 버튼 고정 */
.panel-footer {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
}

/* 수업지도안 패널 — teal 헤더 */
#lesson-panel .panel-header {
  background: linear-gradient(135deg, #1A2B3C 0%, #14B8A6 100%);
  min-height: 80px;
  height: auto;
  padding: 14px 16px;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
#lesson-panel .panel-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
#lesson-panel .panel-header-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: 100%;
}

/* 참관록 패널 */
#obs-panel .panel-header {
  background: linear-gradient(135deg, #1A2B3C 0%, #253548 100%);
}

/* 참관록 유의사항 — 기존 CSS가 이미 레몬색으로 정의됨, 여기서는 margin-bottom 추가 */
.obs-notice-box { margin-bottom: 14px; }

/* ===== 참관록 학년/반 선택 드롭다운 ===== */
.obs-dropdown-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.obs-select-native {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1A2B3C;
  background: white;
  cursor: pointer;
  font-family: inherit;
  appearance: auto;
  transition: border-color 0.15s;
}
.obs-select-native:focus {
  outline: none;
  border-color: #14B8A6;
  box-shadow: 0 0 0 3px rgba(20,184,166,.15);
}
/* 과목 자동 표시 박스 */
.obs-auto-subject {
  display: none;
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border: 1.5px solid rgba(20,184,166,.4);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #0f766e;
  font-weight: 700;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.obs-auto-subject.show { display: flex; }
.obs-auto-subject i { color: #14B8A6; font-size: 14px; }

/* ===== 모달 오버레이 (모바일 풀스크린 대응) ===== */
@media (max-width: 480px) {
  .modal-overlay {
    align-items: flex-end;   /* 모달을 화면 하단에서 올라오게 */
    padding: 0;
  }
  .modal-box {
    border-radius: 20px 20px 0 0 !important;
    max-height: 92vh !important;
    max-width: 100% !important;
  }
  /* 참관록·지도안 상세 모달은 90% 높이 */
  #lesson-modal .modal-box,
  #observation-modal .modal-box,
  #obs-list-modal .modal-box { max-height: 92vh !important; }
  /* 작은 확인 모달은 중앙 유지 */
  #admin-modal .modal-box,
  #confirm-modal .modal-box {
    border-radius: 16px !important;
    max-width: 340px !important;
    margin: auto;
  }
  #admin-modal.modal-overlay,
  #confirm-modal.modal-overlay { align-items: center; padding: 16px; }
}
