/* ==========================================
   기본
   ========================================== */
:root {
    --blue: #3498db;
    --blue-dark: #2980b9;
    --navy: #2c3e50;
    --red: #e74c3c;
    --orange: #f39c12;
    --green: #27ae60;
    --gray: #7f8c8d;
    --line: #e2e8f0;
    --soft: #f8fafc;
    --bg: #f4f7f6;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    font-family: 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    background: var(--bg);
    color: var(--navy);
    margin: 0;
    padding: 0 0 150px;     /* 오른쪽 아래 'Powered by Netlify' 표시에 가리지 않도록 */
    word-break: keep-all;
    -webkit-text-size-adjust: 100%;
}
.container {
    background: #fff;
    max-width: 960px;
    width: calc(100% - 24px);
    margin: 16px auto;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(149, 157, 165, 0.12);
}
h1, h2 { text-align: center; margin-top: 0; }
h1 { font-size: 28px; }
h2 { color: var(--blue); margin-bottom: 20px; font-size: 24px; }
h3 { margin: 0 0 10px; }
.lead { text-align: center; color: var(--gray); margin: 0 0 24px; line-height: 1.6; }
.hint { color: var(--gray); font-size: 14px; line-height: 1.6; margin: 0 0 12px; }
.center { text-align: center; }
.muted { color: var(--gray); }
.section-title { margin-top: 36px; font-size: 19px; }

/* 화면 전환 */
.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 폼 요소 */
select, input[type="text"], input[type="number"], input[type="email"], input[type="password"], textarea {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    width: 100%;
    background: #fff;
    color: var(--navy);
}
select:focus, input:focus, textarea:focus { outline: 2px solid rgba(52, 152, 219, 0.4); border-color: var(--blue); }
select:disabled, input:disabled, textarea:disabled { background: #f1f5f9; color: #64748b; }
textarea { resize: vertical; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-weight: 700; font-size: 14px; }
.field-title { font-size: 15px !important; }

/* 버튼 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; border-radius: 30px; cursor: pointer;
    font-family: inherit; font-size: 16px; font-weight: 700;
    padding: 14px 24px; transition: 0.2s; color: #fff; background: var(--blue);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(0.95); }
.btn:disabled { background: #bdc3c7 !important; box-shadow: none; cursor: not-allowed; opacity: 0.8; transform: none; }
.btn-block { width: 100%; margin-top: 20px; }
.btn-primary { background: var(--blue); }
.btn-orange { background: var(--orange); border-radius: 12px; font-size: 18px; padding: 18px; box-shadow: 0 4px 12px rgba(243, 156, 18, 0.25); }
.btn-orange.done:disabled { background: var(--green) !important; color: #fff; opacity: 1; }
.btn-green { background: var(--green); box-shadow: 0 4px 12px rgba(39, 174, 96, 0.25); }
.btn-dark { background: var(--navy); box-shadow: none; }
.btn-ghost { background: #fff; color: var(--navy); border: 1px solid #cbd5e1; box-shadow: none; }
.btn-small { padding: 6px 14px; font-size: 13px; }
.btn-round { border-radius: 30px; }
.link-btn { background: none; border: none; color: var(--gray); cursor: pointer; font-family: inherit; font-size: 13px; text-decoration: underline; padding: 4px; }
.icon-btn { background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; padding: 4px 8px; }
.action-row { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-top: 24px; }
.action-row .btn-primary { flex: 1; min-width: 240px; }
.next-step-container { border-top: 1px dashed #bdc3c7; margin-top: 36px; padding-top: 22px; display: flex; justify-content: flex-end; }

.card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-top: 18px; }
.card.soft { background: var(--soft); }

/* 알림 */
.notice { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; line-height: 1.6; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice-lock { background: #eef2ff; color: #3730a3; }
.notice-warn { background: #fff7ed; color: #9a3412; }

/* ==========================================
   상단 바 · 단계 표시
   ========================================== */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(6px);
    padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.topbar-team { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
#team-badge { font-weight: 800; font-size: 16px; }
.topbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 20px; background: #f1f5f9; color: #475569; white-space: nowrap; }
.pill-saved { background: #ecfdf5; color: #047857; }
.pill-saving { background: #eff6ff; color: #1d4ed8; }
.pill-error { background: #fef2f2; color: #b91c1c; font-weight: 700; }

.stepper { display: flex; gap: 6px; max-width: 960px; width: calc(100% - 24px); margin: 14px auto 0; overflow-x: auto; }
.step {
    flex: 1; min-width: 92px; display: flex; align-items: center; gap: 6px; justify-content: center;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 8px;
    font-family: inherit; font-size: 13px; color: var(--navy); cursor: pointer;
}
.step-no { width: 22px; height: 22px; border-radius: 50%; background: #e2e8f0; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.step.done .step-no { background: var(--green); color: #fff; }
.step.current { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25); font-weight: 800; }
.step.current .step-no { background: var(--blue); color: #fff; }
.step.locked { opacity: 0.45; cursor: not-allowed; }

/* ==========================================
   입장 · 테마 선택
   ========================================== */
.intro-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 560px; margin: 0 auto; }
.intro-form select { padding: 14px; font-size: 16px; }
.intro-msg { text-align: center; min-height: 22px; color: var(--gray); font-size: 14px; }
.intro-msg.error { color: var(--red); font-weight: 700; }
.code-box { display: flex; gap: 10px; align-items: flex-end; max-width: 420px; margin: 0 auto; }
.code-box .field { flex: 1; margin: 0; }
.code-box input { font-size: 20px; letter-spacing: 4px; text-align: center; text-transform: uppercase; padding: 12px; }
.code-box .btn { padding: 13px 22px; border-radius: 10px; }
.teacher-line { text-align: center; margin: 0 0 16px; font-size: 15px; }
#intro-screen .btn-block { max-width: 560px; display: flex; margin: 10px auto 12px; }

.theme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 20px; }
.theme-card {
    display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left;
    padding: 20px; border-radius: 16px; border: 2px solid var(--line); background: #fff;
    cursor: pointer; font-family: inherit; color: var(--navy); transition: 0.2s;
}
.theme-card:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(52, 152, 219, 0.15); }
.theme-card.current { border-color: var(--blue); background: #ebf5fb; }
.theme-icon { font-size: 34px; }
.theme-card b { font-size: 17px; }
.theme-card small { color: var(--gray); font-size: 13px; }

/* ==========================================
   1. 문제 인식
   ========================================== */
.story-box { background: #f9fbff; padding: 22px; border-radius: 14px; border: 1px solid var(--line); text-align: center; }
.story-box h3 { color: var(--blue); font-size: 22px; }
.story-text { font-size: 17px; line-height: 1.75; text-align: left; margin: 18px 0 0; }
.story-image { width: 100%; border-radius: 10px; margin-top: 10px; }
.comic { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.comic-panel { position: relative; background: #fff; border: 2px solid var(--navy); border-radius: 6px; padding: 18px 10px 12px; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.comic-no { position: absolute; top: 6px; left: 8px; font-size: 12px; font-weight: 800; color: var(--gray); }
.comic-emoji { font-size: 44px; }
.comic-panel p { margin: 0; font-size: 13px; line-height: 1.45; }

/* ==========================================
   2. 탐구 설계
   ========================================== */
.variable-table { background: var(--soft); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.var-header, .var-row { display: grid; grid-template-columns: 1fr 1.4fr 2fr; gap: 12px; align-items: center; padding: 14px 16px; }
.var-header { background: #e2e8f0; font-weight: 700; color: #4a5568; text-align: center; font-size: 14px; }
.var-row { border-top: 1px solid var(--line); transition: background 0.2s; }
.var-row.manipulated { background: #fff5f4; }
.var-name { font-weight: 800; }
.var-mode { display: flex; gap: 6px; }
.mode-opt { flex: 1; cursor: pointer; }
.mode-opt input { position: absolute; opacity: 0; pointer-events: none; }
.mode-opt span { display: block; text-align: center; padding: 9px 4px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
.mode-opt input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.mode-opt input[value="manipulated"]:checked + span { background: var(--red); border-color: var(--red); }
.mode-opt input:disabled + span { opacity: 0.6; cursor: not-allowed; }
.mode-opt input:focus-visible + span { outline: 2px solid var(--blue); }
.var-values { display: flex; flex-direction: column; gap: 8px; }
.var-field { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 8px; }
.var-field-label { font-size: 13px; font-weight: 700; }
.var-field.exp .var-field-label { color: var(--red); }

.design-check { margin-top: 12px; padding: 12px 16px; border-radius: 10px; font-size: 14px; line-height: 1.6; }
.design-check.ok { background: #ecfdf5; color: #065f46; }
.design-check.warn { background: #fff7ed; color: #9a3412; }
.design-check.error { background: #fef2f2; color: #991b1b; }

.hypothesis-box { background: var(--soft); padding: 24px; border-radius: 16px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.hypo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; }
.hypo-label { font-weight: 800; }
.hypo-row input { width: 170px; flex: 0 1 auto; }
.hypo-row input.hypo-wide { width: 300px; }
.hypo-row:has(.hypo-field) { align-items: flex-end; }
.hypo-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; max-width: 280px; }
.hypo-field input { width: 100%; }
.hypo-tag { align-self: flex-start; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.hypo-tag.cause { background: #fdecea; color: #c0392b; }
.hypo-tag.effect { background: #e8f1fb; color: #1f5f99; }
.hypo-join { padding-bottom: 12px; white-space: nowrap; }

/* ==========================================
   3. 실험 · 기록표 · 그래프
   ========================================== */
.sim-conditions { background: #eef2f5; padding: 14px 16px; border-radius: 12px; margin-bottom: 24px; display: flex; flex-direction: column; gap: 10px; }
.cond-row { display: flex; gap: 12px; align-items: flex-start; }
.cond-row > b { flex-shrink: 0; width: 52px; padding-top: 6px; }
.cond-row.exp > b { color: var(--red); }
.cond-items { display: flex; flex-wrap: wrap; gap: 6px; }
.cond { background: #fff; border-radius: 8px; padding: 4px 10px; font-size: 14px; display: inline-flex; flex-direction: column; line-height: 1.3; }
.cond small { font-size: 11px; color: var(--gray); }
.cond.manip { background: #fdecea; color: #c0392b; font-weight: 800; }

.measure-container { text-align: center; margin-bottom: 30px; }
.measure-target { margin-bottom: 16px; font-weight: 700; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.measure-target label { cursor: pointer; }
.measure-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
#measure-btn { min-width: 260px; }
#measure-btn.busy:disabled { background: var(--gray) !important; opacity: 1; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; min-width: 520px; }
.data-table th, .data-table td { border: 1px solid var(--line); padding: 10px 8px; text-align: center; }
.data-table th { background: var(--soft); color: #4a5568; font-size: 14px; }
.data-input { text-align: center; min-width: 64px; }
.row-ctrl { font-weight: 800; color: var(--navy); background: var(--soft); }
.row-exp { font-weight: 800; color: var(--red); background: #fdf2e9; }
.summary-table { max-width: 560px; margin: 0 auto 20px; min-width: 0; }
.summary-table th input { text-align: center; font-weight: 700; }

.chart-section { margin-top: 36px; border-top: 2px dashed #bdc3c7; padding-top: 10px; }
.chart-type-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.chart-btn { padding: 14px 8px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--navy); font-family: inherit; font-weight: 800; font-size: 15px; cursor: pointer; transition: 0.2s; }
.chart-btn:hover, .chart-btn.active { border-color: var(--blue); background: #ebf5fb; }
.chart-btn.active { box-shadow: 0 4px 10px rgba(52, 152, 219, 0.2); }
.canvas-container { background: #fff; padding: 16px; border-radius: 16px; border: 1px solid var(--line); height: 380px; position: relative; }
.canvas-container.small { height: 260px; margin-top: 10px; }
.chart-note { color: var(--gray); font-size: 13px; margin: 8px 0 0; min-height: 0; }
.reason-box { background: var(--soft); padding: 18px; border-radius: 10px; margin-top: 16px; }
.reason-q { font-weight: 800; margin: 0 0 8px; }
.reason-sentence { line-height: 2.4; font-size: 15px; }
.reason-sentence select { width: auto; max-width: 100%; display: inline-block; padding: 6px 8px; font-size: 14px; }

/* ==========================================
   4. 분석 · AI · 검증
   ========================================== */
.ref-chart summary { cursor: pointer; font-weight: 800; }
.ai-section { margin-top: 24px; background: #eef2f5; border-radius: 14px; padding: 22px; border: 1px solid #dcdde1; }
.ai-prompts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ai-prompt-btn { background: #fff; border: 1px solid var(--blue); color: var(--blue); padding: 8px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; font-family: inherit; font-weight: 700; }
.ai-prompt-btn:hover { background: #ebf5fb; }
.chat-box { background: #fff; border-radius: 10px; height: 280px; overflow-y: auto; padding: 14px; border: 1px solid #bdc3c7; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.bubble { padding: 10px 14px; border-radius: 15px; font-size: 14px; max-width: 85%; line-height: 1.6; white-space: pre-line; }
.bubble.ai { align-self: flex-start; background: #f1f2f6; border-top-left-radius: 2px; }
.bubble.me { align-self: flex-end; background: var(--blue); color: #fff; border-top-right-radius: 2px; }
.bubble.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: #95a5a6; animation: typing 1s infinite; }
.bubble.typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.ai-input-row { display: flex; gap: 8px; }
.ai-input-row .btn { border-radius: 8px; padding: 10px 18px; flex-shrink: 0; }

.validation-box { margin-top: 36px; border: 2px solid var(--blue); padding: 24px; border-radius: 14px; }
.validation-box h3 { color: var(--blue); }
.hypo-recall { background: var(--soft); border-left: 4px solid var(--blue); padding: 10px 14px; font-size: 14px; line-height: 1.6; }
.hypo-recall:empty { display: none; }
.val-buttons { display: flex; gap: 12px; margin: 16px 0 20px; }
.val-btn { flex: 1; padding: 15px; font-size: 16px; font-weight: 800; border-radius: 30px; border: 2px solid #cbd5e1; background: #fff; color: var(--navy); cursor: pointer; font-family: inherit; transition: 0.2s; }
#btn-accept.selected { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
#btn-reject.selected { background: #c0392b; border-color: #c0392b; color: #fff; }

/* ==========================================
   축하 화면 · 피드백 · 토스트
   ========================================== */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.tada-content { background: #fff; border-radius: 24px; padding: 48px 28px; text-align: center; max-width: 560px; }
.tada-emoji { font-size: 72px; margin-bottom: 10px; }
.tada-content h1 { color: var(--orange); font-size: 28px; animation: pop 1s infinite alternate; }
@keyframes pop { from { transform: scale(1); } to { transform: scale(1.05); } }

.feedback-fab {
    position: fixed; right: 16px; bottom: 76px; z-index: 120;   /* Netlify 표시(아래 약 60px) 위로 */
    background: var(--navy); color: #fff; border: none; border-radius: 30px;
    padding: 13px 20px; font-family: inherit; font-weight: 800; font-size: 15px; cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
.feedback-fab.has-unread { background: var(--orange); animation: nudge 1.4s infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.badge { background: var(--red); color: #fff; border-radius: 12px; padding: 1px 8px; font-size: 12px; margin-left: 4px; }
.feedback-panel {
    position: fixed; right: 16px; bottom: 138px; z-index: 130;
    width: 360px; max-width: calc(100% - 32px); max-height: 60vh;
    background: #fff; border-radius: 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    display: flex; flex-direction: column; overflow: hidden;
}
.feedback-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--navy); color: #fff; }
.feedback-list { overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.fb-item { background: #fff7e6; border: 1px solid #fde3b0; border-radius: 12px; padding: 10px 12px; }
.fb-meta { font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.fb-text { font-size: 15px; line-height: 1.55; white-space: pre-line; }

.toast-area { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); transition: opacity 0.5s, transform 0.5s; white-space: pre-line; }
.toast.hide { opacity: 0; transform: translateY(-8px); }
.toast-success { background: var(--green); }
.toast-error { background: #c0392b; }
.toast-warn { background: #d35400; }
.toast-feedback { background: #fff7e6; color: var(--navy); border: 2px solid var(--orange); font-size: 15px; }
.toast.clickable { cursor: pointer; }

/* ==========================================
   휴대폰 · 태블릿
   ========================================== */
@media (max-width: 760px) {
    .container { width: 100%; margin: 0; border-radius: 0; padding: 20px 16px; box-shadow: none; }
    .stepper { width: 100%; padding: 0 16px; margin-top: 10px; }
    .step { min-width: 64px; flex-direction: column; gap: 2px; padding: 7px 4px; font-size: 11px; }
    h1 { font-size: 23px; }
    h2 { font-size: 20px; }
    .intro-form { grid-template-columns: 1fr; }
    .comic { grid-template-columns: repeat(2, 1fr); }
    .var-header { display: none; }
    .var-row { grid-template-columns: 1fr; gap: 8px; }
    .var-field { grid-template-columns: 92px 1fr; }
    .hypo-row input, .hypo-row input.hypo-wide { width: 100%; }
    .hypo-field { max-width: none; flex-basis: 100%; }
    .hypo-join { padding-bottom: 0; }
    .chart-type-container { grid-template-columns: repeat(2, 1fr); }
    .canvas-container { height: 300px; padding: 10px; }
    .val-buttons { flex-direction: column; }
    #measure-btn { min-width: 0; width: 100%; }
    .action-row .btn { width: 100%; }
    .topbar { padding: 8px 12px; }
    .data-table { min-width: 440px; }
    .data-table th, .data-table td { padding: 6px 4px; }
    .data-input { min-width: 52px; padding: 8px 4px; }
}

/* ==========================================
   가설·예측 · 그래프 설명 · 가설 검증 · 역할
   ========================================== */
.example-note { font-size: 13px; color: #7c5e10; background: #fff8e1; border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; }
.prediction-box { background: #fdf7ff; border-color: #e9d5ff; }
.dep-mirror { font-weight: 800; color: var(--blue-dark); background: #ebf5fb; border-radius: 6px; padding: 6px 10px; }
.dep-mirror.empty { color: #94a3b8; background: #f1f5f9; font-weight: 600; }
.hypo-row select { width: auto; }
.var-row.undecided .var-name::after { content: ' · 미정'; color: #d35400; font-size: 12px; font-weight: 700; }
.role-note { color: #9a3412; font-size: 13px; margin: 10px 0 0; text-align: right; }
.role-note:empty { display: none; }

.chart-type-container.described .chart-btn { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.chart-name { font-size: 15px; font-weight: 800; }
.chart-desc { font-size: 12px; font-weight: 500; color: #64748b; line-height: 1.4; word-break: keep-all; }
.reason-box textarea { margin-top: 4px; }

.recall-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
.recall-card { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.recall-card.result { grid-column: 1 / -1; background: #f0fdf4; border-color: #bbf7d0; }
.recall-tag { display: inline-block; font-size: 12px; font-weight: 800; color: var(--blue-dark); margin-bottom: 6px; }
.recall-card p { margin: 0; font-size: 15px; line-height: 1.6; font-weight: 600; }
.field-title small { font-weight: 500; color: var(--gray); font-size: 12px; margin-left: 4px; }

/* 이름·역할 */
.member-form { margin-top: 4px; grid-template-columns: 1fr 1fr; }
.me-badge { border: 1px solid #cbd5e1; background: #f8fafc; border-radius: 16px; padding: 3px 10px; font-family: inherit; font-size: 13px; cursor: pointer; color: var(--navy); }
.me-badge:disabled { cursor: default; }
.pill-btn { border: none; cursor: pointer; font-family: inherit; }
.members-pop { position: fixed; top: 52px; right: 16px; z-index: 140; width: 290px; max-width: calc(100% - 32px); background: #fff; border-radius: 14px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2); padding: 12px 14px; }
.members-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; margin-bottom: 6px; }
.members-pop ul { list-style: none; margin: 0 0 6px; padding: 0; }
.members-pop li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.members-pop li.empty span { color: #b0b8c1; }
.member-modal { background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 380px; }
.member-modal h3 { margin-bottom: 14px; }

.teacher-banner { background: #4c1d95; color: #fff; text-align: center; font-size: 13px; font-weight: 700; padding: 8px 12px; }

@media (max-width: 760px) {
    .recall-grid { grid-template-columns: 1fr; }
    .member-form { grid-template-columns: 1fr; }
    .chart-desc { font-size: 11px; }
}

/* 2차 그래프: 핵심 가공 데이터 고르기 */
.metric-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.metric-group-name { font-size: 13px; font-weight: 800; color: var(--gray); margin-bottom: 6px; }
.metric-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.metric-group-name { grid-column: 1 / -1; margin-bottom: 0; }
.metric-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: 0.15s; }
.metric-card:hover { border-color: #9cc9ea; }
.metric-card.selected { border-color: var(--blue); background: #ebf5fb; box-shadow: 0 3px 10px rgba(52, 152, 219, 0.18); }
.metric-card input { position: absolute; opacity: 0; pointer-events: none; }
.metric-name { font-weight: 800; font-size: 14px; }
.metric-desc { font-size: 12px; color: #64748b; line-height: 1.45; }
.metric-chosen { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.6; margin: 0 0 10px; }
#summary-table { max-width: none; }
.data-input.mismatch { border-color: #e74c3c; background: #fdecea; }
.data-input.match { border-color: #2ecc71; }
.summary-check { font-size: 13px; color: var(--gray); margin: 0 0 12px; }
.summary-check.warn { color: #b03a2e; font-weight: 700; }
.summary-check.ok { color: #1e8449; font-weight: 700; }

/* 예측: 자동으로 채워지는 값 + 방향 고르기 */
.auto-chip { font-weight: 800; border-radius: 8px; padding: 6px 10px; font-size: 15px; }
.auto-chip.ctrl { background: #eaf0f6; color: var(--navy); }
.auto-chip.exp { background: #fdecea; color: #c0392b; }
.auto-chip.empty { background: #f1f5f9; color: #94a3b8; font-weight: 600; font-size: 13px; }
.dir-choices { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dir-opt { cursor: pointer; }
.dir-opt input { position: absolute; opacity: 0; pointer-events: none; }
.dir-opt span { display: inline-block; padding: 10px 16px; border-radius: 10px; border: 2px solid #d8c4f0; background: #fff; font-weight: 800; font-size: 15px; }
.dir-opt input:checked + span { background: #7d3c98; border-color: #7d3c98; color: #fff; }
.dir-opt input:disabled + span { opacity: 0.6; cursor: not-allowed; }
.dir-tail { font-size: 16px; }
.pred-preview { margin: 4px 0 0; background: #fff; border: 1px dashed #d8c4f0; border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.6; color: #4a235a; }
.custom-fields { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 10px; margin-bottom: 8px; }
.metric-card.custom { border-style: dashed; }
.ai-custom-hint { margin: 0 0 8px; font-size: 13px; }
@media (max-width: 760px) { .custom-fields { grid-template-columns: 1fr; } }

/* 6. 평가 */
.eval-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.eval-tab { padding: 12px 8px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-family: inherit; font-weight: 800; font-size: 15px; cursor: pointer; color: var(--navy); }
.eval-tab.active { border-color: var(--blue); background: #ebf5fb; }
.eval-panel { display: flex; flex-direction: column; gap: 14px; }
.eval-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fff; }
.eval-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 16px; }
.star-row { display: grid; grid-template-columns: 1fr auto 110px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.star-q { font-size: 14px; line-height: 1.5; }
.eval-std { color: #94a3b8; font-size: 11px; }
.stars { display: flex; gap: 2px; }
.star-btn { border: none; background: none; font-size: 28px; line-height: 1; color: #d5dbdb; cursor: pointer; padding: 0 2px; }
.star-btn.on { color: #f5b301; }
.star-label { font-size: 12px; color: var(--gray); font-weight: 700; }
.eval-field { margin-top: 10px; }
@media (max-width: 760px) {
    .star-row { grid-template-columns: 1fr auto; }
    .star-label { grid-column: 1 / -1; }
    .eval-tabs { grid-template-columns: 1fr; }
}

/* 스토리 만화 (컷 그림) */
.comic.with-images { grid-template-columns: repeat(2, 1fr); gap: 8px; max-width: 760px; margin: 12px auto 0; }
.comic-img-panel { padding: 0; border: none; background: none; cursor: zoom-in; display: block; }
.comic-img-panel img { width: 100%; display: block; border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
.comic-zoom-box { background: #fff; border-radius: 14px; padding: 12px; max-width: min(720px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 10px; }
.comic-zoom-box img { width: 100%; max-height: 75vh; object-fit: contain; border-radius: 6px; }
.comic-zoom-nav { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; font-weight: 700; }
.panel-choice .np-panel img { border-radius: 2px; }
@media (max-width: 760px) { .comic.with-images { grid-template-columns: repeat(2, 1fr); gap: 5px; } }

/* 다른 모둠원이 입력 중인 칸 */
.editing-layer { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 90; pointer-events: none; }
.editing-tag { position: absolute; color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px 6px 6px 0; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }
.being-edited { outline: 2px solid var(--edit-color, #8e44ad) !important; outline-offset: 1px; border-radius: 6px; }
.step-title { display: flex; align-items: center; gap: 8px; }
.step-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 15px; }
#hypothesis-screen .section-title:first-of-type { margin-top: 10px; }

/* 테마 지정 대기 */
.theme-wait { text-align: center; padding: 20px 0; }
.theme-wait-icon { font-size: 56px; animation: pop 1.2s infinite alternate; }
.theme-card.preview { cursor: default; opacity: 0.75; }
.theme-card.preview:hover { transform: none; border-color: var(--line); box-shadow: none; }

/* 평가 문항 미리 보기 (교사) */
.eval-panel.preview .star-btn { cursor: default; opacity: .55; }
.eval-panel.preview textarea { background: #f8fafc; cursor: default; }
.eq-wrap { display: grid; gap: 14px; }
.eq-block { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.eq-block h4 { margin: 0 0 4px; font-size: 16px; }
.eq-when { margin: 0 0 10px; font-size: 13px; }
.eq-sub { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: #475569; }
.eq-list { margin: 0 0 10px; padding-left: 22px; line-height: 1.8; }
.eq-text { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.eq-text small { font-size: 12px; }
.eq-details { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; background: #fff; }
.eq-details summary { cursor: pointer; font-weight: 800; }
.eq-details[open] summary { margin-bottom: 12px; }
#eval-questions { margin-top: 12px; }
