/* ============================================================
   2026-08-06 메인페이지 통합 — index.html <style> 블록(마케팅 랜딩)과
   같은 문서에서 함께 로드된다. body 배경·폰트·footer 레이아웃 등
   전역 규칙은 마케팅 스타일이 이미 정의하므로 여기서는 중복·충돌 규칙을
   두지 않고, 이 앱(학생/교사 화면) 전용 컴포넌트 스타일만 유지한다.
   :root 변수 값은 마케팅 <style>의 --brand(#1B4332)/--coral(#FF6B4A)와
   동일값으로 맞춰뒀다(변수명만 다름, alias 아님 — 두 블록 다 유효).
   ============================================================ */
:root {
  --jaim-green: #1B4332;
  --jaim-coral: #FF6B4A;
  --bg-neutral: #F5F7F3;
}
* { box-sizing: border-box; }

/* entry.min.css가 html/body에 overflow:hidden + height:100%를 강제로 걸어둠
   (entry.js가 "화면 전체를 혼자 차지하는 앱"이라고 가정하고 만들어진 라이브러리라서 그렇다).
   이 사이트는 스크롤형 랜딩 페이지라 세로 스크롤이 필요한데, entry.min.css가 이 링크 태그보다
   먼저 로드되면서 페이지 전체 스크롤을 막아버리는 문제가 있었다(2026-08-01 사용자 리포트).
   app.css를 entry.min.css 뒤에 로드해 여기서 명시적으로 되돌린다. */
html, body {
  overflow-y: auto !important;
  height: auto !important;
  min-height: 100%;
}

/* ---- 체험(학생/교사 화면) 섹션을 감싸는 카드 셸 ---- */
.demo-shell {
  background: var(--card, #fff);
  border: 1px solid var(--edge, #E2E7DF);
  border-radius: 16px;
  padding: 20px 24px 24px;
  box-shadow: 0 24px 60px -30px rgba(27,67,50,0.25);
  /* entry.js가 자기 내부 레이아웃 폭을 실제 컨테이너 실측값보다 넓게(약 1024px)
     계산하는 경우가 있어(2026-08-06 발견 — 마케팅 통합으로 컨테이너가 기존보다
     좁아지며 카드 오른쪽 경계를 살짝 벗어나 보임), 잘라내는 대신 카드 자체를
     가로 스크롤 가능한 안전 컨테이너로 만들어 경계 밖으로 새지 않게 한다. */
  overflow-x: auto;
}
.demo-shell .tabs { margin-bottom: 16px; }
.demo-footnote { margin-top: 14px; text-align: center; color: var(--sub, #5E6B62); font-size: 11px; }

.tabs { display: flex; gap: 8px; }
.tab-btn { padding: 8px 16px; border: 1px solid #D5DED8; background: white; border-radius: 999px; cursor: pointer; font-size: 13px; }
.tab-btn.active { background: var(--jaim-green); color: white; border-color: var(--jaim-green); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hint { color: #5D6B62; font-size: 13px; margin: 4px 0 12px; }
.sim-buttons { display: flex; gap: 8px; margin-bottom: 12px; }
.sim-buttons button, .draft-controls button, #genDraftBtn {
  padding: 8px 14px; border-radius: 8px; border: none; background: var(--jaim-green); color: white; cursor: pointer; font-size: 13px;
}
.sim-buttons button:hover, #genDraftBtn:hover { opacity: 0.9; }

.kpi-bar { display: flex; gap: 16px; }
.kpi { background: white; border-radius: 10px; padding: 8px 14px; font-size: 12px; border: 1px solid #E0E6E2; }
.kpi span { display: block; color: #7A8A80; }
.kpi b { font-size: 16px; }

.action-center { background: white; border-radius: 12px; padding: 12px 16px; margin: 12px 0; border: 1px solid #E0E6E2; }
.ac-title { font-size: 12px; font-weight: 700; color: #7A8A80; margin-bottom: 8px; }
.ac-card { font-size: 13px; padding: 4px 0; }
.ac-empty { color: var(--jaim-green); font-size: 13px; }
.ac-overflow { font-size: 12px; color: #7A8A80; margin-top: 4px; }

.heatmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 20px; }
.student-card { background: white; border-radius: 10px; padding: 10px; border: 2px solid #E0E6E2; }
.sc-name { font-weight: 700; font-size: 13px; }
.sc-tier { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin: 4px 0; }
.sc-count { font-size: 11px; color: #7A8A80; }

.draft-panel { background: white; border-radius: 12px; padding: 16px; border: 1px solid #E0E6E2; }
.draft-controls { display: flex; gap: 8px; margin: 8px 0; }
.draft-controls select { padding: 6px; border-radius: 6px; border: 1px solid #D5DED8; }
.draft-result { margin-top: 10px; font-size: 13px; }
.draft-text { background: var(--bg-neutral); padding: 10px; border-radius: 8px; line-height: 1.6; }
.draft-evidence { color: #7A8A80; font-size: 11px; margin-top: 6px; }

/* ============================================================
   Phase 9 재설계 (2026-07-31, TECH-10) — 관찰 코멘트 입력 + 검토 게이트
   ============================================================ */
.obs-note-field { margin: 12px 0; }
.obs-note-field label { display: block; font-size: 13px; font-weight: 700; color: var(--jaim-green); margin-bottom: 4px; }
.required-mark { color: var(--jaim-coral); }
.obs-note-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  border: 1px solid #D5DED8;
  border-radius: 8px;
  resize: vertical;
  background: white;
}
.obs-note-field textarea:focus { outline: 2px solid var(--jaim-green); outline-offset: 1px; }
.obs-note-hint { font-size: 11px; color: #7A8A80; margin-top: 4px; }

#genDraftBtn:disabled,
#saveVersionBtn:disabled {
  background: #C7CFC9;
  cursor: not-allowed;
  opacity: 1;
}

.draft-loading { color: #7A8A80; font-size: 13px; padding: 8px 0; }
.draft-error { color: var(--jaim-coral); font-size: 13px; padding: 8px 0; }

.draft-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-neutral);
  color: var(--jaim-green);
  margin-bottom: 8px;
}
.draft-warning {
  font-size: 12px;
  color: #8A3A24;
  background: #FBE4DF;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.draft-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid #D5DED8;
  border-radius: 8px;
  resize: vertical;
  background: var(--bg-neutral);
}
.draft-textarea:focus { outline: 2px solid var(--jaim-green); outline-offset: 1px; }

.draft-confirm { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 8px 0 4px; cursor: pointer; }
.draft-gate-hint { font-size: 11px; color: #B2791E; margin-bottom: 8px; }

#saveVersionBtn {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: var(--jaim-green);
  color: white;
  cursor: pointer;
  font-size: 13px;
}
#saveVersionBtn:hover:not(:disabled) { opacity: 0.9; }

.save-status { font-size: 12px; color: var(--jaim-green); margin-top: 6px; }

#workspace { border: 1px solid #E0E6E2; border-radius: 8px; overflow: hidden; }

.student-picker select { padding: 6px; border-radius: 6px; border: 1px solid #D5DED8; }

/* ============================================================
   Phase 6(로그인) → 2026-08-06 메인페이지 통합에서 모달로 재설계
   ============================================================ */
.hidden { display: none; }

/* 비로그인 방문자에게 보이는 데모 배지·로그인 유도 버튼 */
.teacher-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.demo-badge {
  font-size: 11px; font-weight: 700; color: #8A5A15;
  background: #FBEEDA; border: 1px solid #EBD3A6;
  padding: 4px 10px; border-radius: 999px;
}
.login-trigger-btn {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--jaim-green);
  background: white; color: var(--jaim-green); cursor: pointer; font-size: 12px; font-weight: 700;
}
.login-trigger-btn:hover { background: var(--bg-neutral); }

/* 인터랙티브 요소(관찰 코멘트·초안 생성) 위에 얹는 투명 클릭 차단막 —
   화면은 정상 색상으로 그대로 보이되, 클릭하면 실제 입력 대신 로그인 모달이 뜬다.
   KB-18 §10 "정상 색상 노출 + 클릭 시 모달" 결정 반영. */
.gate-wrap { position: relative; }
.gate-overlay {
  position: absolute; inset: 0; z-index: 5;
  cursor: pointer; background: transparent;
}
.gate-overlay.hidden { display: none; }

/* 로그인 모달 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(18, 46, 34, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 28px 24px 24px;
  border: 1px solid #E0E6E2;
  max-width: 360px;
  width: 100%;
}
.modal-box h3 { margin-top: 0; font-size: 15px; color: var(--jaim-green); }
.modal-hint { font-size: 12.5px; color: #5D6B62; margin: -4px 0 14px; line-height: 1.5; }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  border: none; background: none; cursor: pointer;
  font-size: 15px; color: #7A8A80; line-height: 1;
}
.modal-close:hover { color: var(--jaim-green); }
.modal-box input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 6px;
  border: 1px solid #D5DED8;
  font-size: 13px;
}
.modal-box #loginBtn {
  width: 100%;
  padding: 9px 0;
  border: none;
  border-radius: 8px;
  background: var(--jaim-green);
  color: white;
  cursor: pointer;
  font-size: 13px;
}
.modal-box #loginBtn:hover { opacity: 0.9; }
.login-error { color: var(--jaim-coral); font-size: 12px; margin-top: 8px; min-height: 16px; }

.teacher-name-tag { font-size: 13px; font-weight: 700; color: var(--jaim-green); }
.logout-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #D5DED8;
  background: white;
  color: #5D6B62;
  cursor: pointer;
  font-size: 12px;
}
.logout-btn:hover { background: #F3F6F4; }
