:root {
  color-scheme: dark;
  --bg: #080c1a;
  --surface: rgba(17, 24, 48, 0.84);
  --surface-2: rgba(25, 35, 68, 0.82);
  --input-bg: rgba(8, 13, 28, 0.9);
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.22);
  --mint: #22f3a1;
  --cyan: #38bdf8;
  --violet: #8b5cf6;
  --pink: #ff5c93;
  --gold: #ffd93d;
  --radius: 22px;
  --fs: 16px;
  --font-display: 'Space Grotesk', 'Pretendard Variable', 'Pretendard', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--fs); }
body.big-text { --fs: 19px; }

body {
  font-family: 'Pretendard Variable', 'Pretendard', 'Noto Sans KR', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.62;
  overflow-x: hidden;
}

/* 코스믹 네오 아케이드 배경 */
.bg-gradient {
  position: fixed; inset: 0; z-index: -4;
  background:
    radial-gradient(circle at 14% 12%, rgba(34, 243, 161, 0.14), transparent 42%),
    radial-gradient(circle at 86% 18%, rgba(139, 92, 246, 0.22), transparent 45%),
    radial-gradient(circle at 50% 92%, rgba(56, 189, 248, 0.15), transparent 50%),
    linear-gradient(160deg, #070b17 0%, #0d142c 55%, #111333 100%);
}
.bg-grid {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 35%, #000 35%, transparent 88%);
}
.bg-orbs { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .22; animation: orbFloat 18s ease-in-out infinite alternate; }
.bg-orbs span:nth-child(1) { width: 320px; height: 320px; top: -60px; left: -60px; background: var(--mint); }
.bg-orbs span:nth-child(2) { width: 360px; height: 360px; top: 20%; right: -90px; background: var(--violet); animation-delay: -6s; }
.bg-orbs span:nth-child(3) { width: 300px; height: 300px; bottom: -80px; left: 30%; background: var(--pink); animation-delay: -12s; }
@keyframes orbFloat { from { transform: translate(0, 0) scale(1); } to { transform: translate(24px, -24px) scale(1.08); } }

.bg-particles { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.spark {
  position: absolute; border-radius: 999px;
  background: radial-gradient(circle, #fff 0%, var(--cyan) 60%, transparent 100%);
  opacity: .5;
  animation: sparkRise linear infinite;
}
@keyframes sparkRise {
  0% { transform: translateY(108vh) scale(.7); opacity: 0; }
  15% { opacity: .6; }
  85% { opacity: .45; }
  100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

.container { max-width: 920px; margin: 0 auto; padding: 20px 14px 44px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .9em; }

/* 플레이어 HUD 헤더 */
.header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.logo-icon {
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 1.65rem; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(34, 243, 161, 0.2), rgba(56, 189, 248, 0.25));
  border: 1.5px solid rgba(34, 243, 161, 0.55);
  box-shadow: 0 0 22px rgba(34, 243, 161, 0.22);
}
.logo-text { display: flex; flex-direction: column; gap: 1px; }
.brand-chip {
  font-family: var(--font-display); font-size: .68rem; font-weight: 700; letter-spacing: .12em;
  color: var(--mint); align-self: flex-start;
  background: rgba(34, 243, 161, 0.12); border: 1px solid rgba(34, 243, 161, 0.35);
  padding: 1px 8px; border-radius: 999px; margin-bottom: 2px;
}
.logo h1 { font-size: 1.48rem; font-weight: 900; letter-spacing: -0.03em; color: #fff; line-height: 1.2; }
.tagline { font-size: .82rem; color: var(--muted); }
.tagline b { color: var(--mint); }

.header-right { display: flex; align-items: center; gap: 7px; }
.xp-badge {
  font-family: var(--font-display); font-size: .88rem; font-weight: 700; letter-spacing: .02em;
  color: var(--gold); background: rgba(255, 217, 61, 0.12);
  border: 1.5px solid rgba(255, 217, 61, 0.45);
  padding: 6px 13px; border-radius: 999px;
  box-shadow: 0 0 18px rgba(255, 217, 61, 0.16);
  white-space: nowrap;
}
.btn-icon {
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 13px; width: 42px; height: 42px; font-size: 1.15rem; cursor: pointer;
  transition: .16s; display: grid; place-items: center;
}
.btn-icon:hover { border-color: var(--cyan); box-shadow: 0 0 14px rgba(56, 189, 248, 0.28); transform: translateY(-1px); }

/* 퀘스트 스테이지 트랙 */
.progress-bar {
  position: relative; display: flex; gap: 6px; margin-bottom: 16px;
  padding: 4px 2px;
}
.progress-bar::before {
  content: ''; position: absolute; left: 28px; right: 28px; top: 24px; height: 2px;
  background: linear-gradient(90deg, rgba(34,243,161,0.3), rgba(56,189,248,0.3), rgba(139,92,246,0.3));
  z-index: 0; pointer-events: none;
}
.progress-step {
  position: relative; z-index: 1; flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; background: rgba(15, 23, 46, 0.78);
  border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer; transition: .2s;
  backdrop-filter: blur(12px);
}
.progress-step .step-num {
  font-family: var(--font-display); width: 28px; height: 28px; border-radius: 10px;
  background: rgba(148, 163, 184, 0.18); color: var(--muted);
  display: grid; place-items: center; font-weight: 700; font-size: .9rem; transition: .2s;
}
.progress-step .step-label { font-size: .76rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.progress-step.active {
  background: rgba(20, 34, 66, 0.96);
  border-color: var(--mint);
  box-shadow: 0 0 22px rgba(34, 243, 161, 0.25), 0 4px 0 rgba(16, 185, 129, 0.45);
}
.progress-step.active .step-num {
  background: linear-gradient(135deg, var(--mint), var(--cyan));
  color: #04131c;
}
.progress-step.active .step-label { color: #fff; }
.progress-step.done { border-color: rgba(34, 243, 161, 0.4); }
.progress-step.done .step-num { background: rgba(34, 243, 161, 0.2); color: var(--mint); }
.progress-step.done .step-label { color: #cbd5e1; }

/* 메인 글래스 아레나 카드 */
.card {
  background: var(--surface);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: cardIn .32s cubic-bezier(.22, 1, .36, 1);
}
@keyframes cardIn { from { transform: translateY(12px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }

.section-header { display: flex; align-items: center; gap: 9px; margin: 6px 0 12px; flex-wrap: wrap; }
.section-icon { font-size: 1.45rem; }
.section-header h2 { font-size: 1.32rem; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.section-desc { color: var(--muted); margin-bottom: 14px; font-size: .95rem; }

/* 미션 브리핑 히어로 */
.hero {
  position: relative;
  background: linear-gradient(135deg, rgba(34, 243, 161, 0.1), rgba(56, 189, 248, 0.08), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-left: 4px solid var(--mint);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.hero p { color: #dbeafe; font-size: .94rem; }
.hero b { color: #fff; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.hero-badges span {
  font-family: var(--font-display);
  background: rgba(8, 13, 28, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #a7f3d0;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .76rem;
  font-weight: 700;
}

/* 폼 & 입력 */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
label { font-weight: 700; font-size: .9rem; color: #cbd5e1; }
input[type=text], input[type=password], select, textarea {
  width: 100%; font: inherit;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: var(--input-bg);
  color: var(--ink);
  transition: .16s;
}
input::placeholder, textarea::placeholder { color: #64748b; }
select option { background: #131b35; color: #f1f5f9; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(34, 243, 161, 0.22);
}
textarea { resize: vertical; }

/* 티어 클래스 배지 카드 */
.level-info {
  border-radius: 15px; padding: 12px 15px; margin-bottom: 16px; font-size: .92rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-left-width: 5px;
}
.level-info[data-tier="seed"] { background: rgba(34, 243, 161, 0.1); border-color: rgba(34, 243, 161, 0.45); }
.level-info[data-tier="sprout"] { background: rgba(132, 204, 22, 0.1); border-color: rgba(163, 230, 53, 0.45); }
.level-info[data-tier="explorer"] { background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.5); }
.level-info[data-tier="thinker"] { background: rgba(139, 92, 246, 0.13); border-color: rgba(167, 139, 250, 0.5); }
.level-info[data-tier="master"] { background: rgba(255, 217, 61, 0.12); border-color: rgba(255, 217, 61, 0.5); }
.tier-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; font-size: .98rem; color: #fff; }
.stat-pill {
  font-family: var(--font-display); font-size: .76rem; font-weight: 700;
  background: rgba(8, 13, 28, 0.65); border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0; border-radius: 999px; padding: 2px 9px;
}
.tier-desc { color: #cbd5e1; font-size: .88rem; }

/* 칩 & 모드 탭 */
.book-chips, .starter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.starter-chips { margin-bottom: 8px; }
.chip {
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 6px 13px; font: inherit; font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--mint); background: rgba(34, 243, 161, 0.14); color: #fff; transform: translateY(-1px); }

.input-with-mic { display: flex; gap: 6px; align-items: stretch; }

.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 16px; }
.mode-tab {
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--muted);
  border-radius: 14px; padding: 11px 12px; font-weight: 800; font-size: .94rem;
  cursor: pointer; transition: .16s;
}
.mode-tab:hover { border-color: var(--cyan); color: #fff; }
.mode-tab.active {
  background: linear-gradient(135deg, rgba(34, 243, 161, 0.18), rgba(56, 189, 248, 0.16));
  border-color: var(--mint); color: #fff;
  box-shadow: 0 0 18px rgba(34, 243, 161, 0.18), 0 3px 0 rgba(16, 185, 129, 0.5);
}

.interest-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .9rem;
  cursor: pointer; transition: .15s;
}
.tag:hover { border-color: var(--violet); }
.tag.selected {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.32), rgba(56, 189, 248, 0.25));
  border-color: #a78bfa; color: #fff;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.3), 0 3px 0 rgba(109, 40, 217, 0.6);
}

/* 설정 모달 보조 UI */
.status-pill { padding: 9px 13px; border-radius: 12px; font-size: .88rem; font-weight: 700; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.status-pill.ok { background: rgba(34, 243, 161, 0.12); color: #6ee7b7; border-color: rgba(34, 243, 161, 0.45); }
.status-pill.warn { background: rgba(251, 146, 60, 0.14); color: #fdba74; border-color: rgba(251, 146, 60, 0.45); }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.preset-row .chip { font-size: .78rem; padding: 4px 10px; }

/* 3D 게임 버튼 */
button { font-family: inherit; }
.btn-primary {
  background: linear-gradient(135deg, var(--mint) 0%, #06b6d4 100%);
  color: #04141d; border: none; border-radius: 14px; padding: 12px 22px;
  font-weight: 900; font-size: 1rem; cursor: pointer;
  box-shadow: 0 4px 0 #0a7b6e, 0 0 24px rgba(34, 243, 161, 0.25);
  transition: transform .1s, box-shadow .1s, filter .15s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #0a7b6e; }
.btn-primary:disabled {
  background: rgba(148, 163, 184, 0.22); color: #64748b;
  box-shadow: 0 4px 0 rgba(15, 23, 42, 0.6); cursor: not-allowed;
}
.btn-big { font-size: 1.12rem; padding: 15px 30px; }

.btn-secondary {
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 14px; padding: 10px 16px; font-weight: 700; cursor: pointer; transition: .15s;
}
.btn-secondary:hover { border-color: var(--cyan); color: #fff; }

.btn-send {
  background: linear-gradient(135deg, #38bdf8, #6366f1); color: #fff;
  border: none; border-radius: 12px; padding: 0 18px; font-weight: 900;
  cursor: pointer; white-space: nowrap; box-shadow: 0 3px 0 #3730a3;
}
.btn-send:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #3730a3; }
.btn-send:disabled { background: #334155; box-shadow: none; }

.btn-mic {
  background: rgba(255, 92, 147, 0.14); border: 1.5px solid rgba(255, 92, 147, 0.55);
  color: #fff; border-radius: 12px; padding: 0 13px; font-size: 1.15rem; cursor: pointer; transition: .15s;
}
.btn-mic:hover { background: rgba(255, 92, 147, 0.25); }
.btn-mic.small { font-size: .85rem; padding: 4px 10px; }
.btn-mic.listening { background: var(--pink); border-color: #fda4af; color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255, 92, 147, 0.3); } }

.btn-chip {
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .88rem; cursor: pointer; transition: .15s;
}
.btn-chip:hover { border-color: var(--violet); color: #fff; }
.btn-chip-strong { border-color: rgba(34, 243, 161, 0.55); color: var(--mint); background: rgba(34, 243, 161, 0.1); }

.navigation-buttons { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.navigation-buttons:has(> :only-child) { justify-content: center; }

/* 채팅 아레나 */
.chat-box {
  background: rgba(7, 11, 24, 0.8);
  border: 1.5px solid var(--line); border-radius: 18px; padding: 14px;
  height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 11px;
}
.chat-tall { height: 420px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; animation: msgPop .2s ease; }
@keyframes msgPop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.msg .avatar { font-size: 1.5rem; flex-shrink: 0; }
.msg .bubble { padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; position: relative; }
.msg.ai .bubble {
  background: rgba(34, 243, 161, 0.09);
  border: 1.5px solid rgba(34, 243, 161, 0.32);
  color: var(--ink); border-bottom-left-radius: 4px;
}
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble {
  background: linear-gradient(135deg, #4f46e5, #0284c7);
  color: #fff; border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.22);
}
.msg.system .bubble { background: rgba(251, 146, 60, 0.14); border: 1px solid rgba(251, 146, 60, 0.4); color: #fed7aa; font-size: .9em; }
.speak-btn { background: none; border: none; cursor: pointer; font-size: .95rem; opacity: .7; margin-left: 6px; color: inherit; }
.speak-btn:hover { opacity: 1; }
.typing .bubble::after { content: '● ● ●'; letter-spacing: 2px; animation: blink 1s infinite; color: var(--mint); }
@keyframes blink { 50% { opacity: .3; } }
.chat-input { display: flex; gap: 6px; margin-top: 10px; }
.chat-input textarea, .chat-input input { flex: 1; }

/* 주제 & 포지션 */
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.choice {
  text-align: left; background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 15px; padding: 13px 15px; cursor: pointer; font: inherit; transition: .15s;
}
.choice:hover { border-color: var(--cyan); transform: translateX(3px); }
.choice.selected {
  border-color: var(--mint);
  background: linear-gradient(135deg, rgba(34, 243, 161, 0.16), rgba(56, 189, 248, 0.12));
  box-shadow: 0 0 18px rgba(34, 243, 161, 0.18), 0 3px 0 rgba(16, 185, 129, 0.5);
}
.choice b { display: block; color: #fff; }
.choice small { color: var(--muted); }
.topic-choices { margin-top: 16px; }
.topic-choices h3 { font-weight: 800; color: #fff; }
.direct-topic { margin-top: 12px; }
.direct-topic summary { cursor: pointer; color: var(--muted); font-weight: 700; }

.final-topic {
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.14), rgba(255, 92, 147, 0.12));
  border: 1.5px solid rgba(255, 217, 61, 0.45);
  border-radius: 15px; padding: 14px 16px; margin: 12px 0;
}
.topic-label { font-size: .8rem; font-weight: 900; color: var(--gold); letter-spacing: .03em; }
.final-topic h3 { font-size: 1.15rem; margin-top: 2px; color: #fff; }

.position-box { margin-top: 14px; }
.position-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.pos-btn {
  flex: 1; min-width: 140px; padding: 12px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink);
  font: inherit; font-weight: 800; cursor: pointer; transition: .15s;
}
.pos-btn:hover { border-color: var(--violet); }
.pos-btn.selected {
  border-color: #a78bfa; background: rgba(139, 92, 246, 0.25); color: #fff;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.28), 0 3px 0 #6d28d9;
}

/* 히어로 셀렉트 페르소나 카드 */
.persona-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.persona-card {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, rgba(26, 37, 74, 0.92), rgba(13, 19, 40, 0.94));
  border: 1.5px solid var(--line); border-radius: 18px;
  padding: 16px 11px; text-align: center; cursor: pointer; transition: .2s cubic-bezier(.22, 1, .36, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.persona-card::after {
  content: ''; position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: .25s;
  background: linear-gradient(125deg, transparent 35%, rgba(56, 189, 248, 0.14) 50%, transparent 65%);
}
.persona-card:hover {
  transform: translateY(-4px); border-color: var(--cyan);
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.2), 0 0 0 1px rgba(56, 189, 248, 0.35);
}
.persona-card:hover::after { opacity: 1; }
.persona-avatar {
  width: 58px; height: 58px; margin: 0 auto 6px; border-radius: 18px; display: grid; place-items: center;
  font-size: 2.1rem;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.28), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.persona-card h3 { font-size: 1rem; font-weight: 800; color: #fff; margin: 4px 0; }
.persona-card p { font-size: .82rem; color: var(--muted); line-height: 1.4; }
.persona-style {
  display: inline-block; margin-top: 8px; font-size: .74rem; font-weight: 700;
  color: var(--cyan); background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3); padding: 2px 9px; border-radius: 999px;
}

.debate-top { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.debate-info { display: flex; justify-content: space-between; align-items: center; font-weight: 800; gap: 8px; flex-wrap: wrap; color: #fff; }
.round-badge {
  font-family: var(--font-display);
  background: linear-gradient(135deg, var(--violet), #6366f1); color: #fff;
  border-radius: 999px; padding: 3px 12px; font-size: .8rem; font-weight: 700;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.35);
}
.debate-topic-mini { font-size: .88rem; color: var(--muted); }
.debate-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* 실시간 라이브 음성 토론 트리거 & 오버레이 */
.btn-voice-pill {
  margin-left: auto;
  background: linear-gradient(135deg, rgba(34, 243, 161, 0.16), rgba(56, 189, 248, 0.16));
  border: 1.5px solid rgba(34, 243, 161, 0.5); color: var(--mint);
  border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: .84rem;
  cursor: pointer; transition: .15s;
}
.btn-voice-pill:hover { border-color: var(--mint); box-shadow: 0 0 16px rgba(34, 243, 161, 0.28); transform: translateY(-1px); }

.live-start-toggle {
  display: flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(34, 243, 161, 0.1));
  border: 1.5px solid rgba(56, 189, 248, 0.4); border-radius: 14px;
  padding: 10px 14px; margin-bottom: 14px; font-size: .92rem; color: var(--ink); cursor: pointer;
}
.live-start-toggle b { color: var(--mint); }
.live-start-toggle input { width: 18px; height: 18px; accent-color: var(--mint); cursor: pointer; }

.btn-voice-toggle {
  margin-top: 4px; width: 100%; padding: 11px 14px; border-radius: 14px;
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(139, 92, 246, 0.24));
  color: #fff; font-weight: 900; font-size: .95rem; cursor: pointer; transition: .15s;
  box-shadow: 0 3px 0 rgba(59, 130, 246, 0.4), 0 0 20px rgba(56, 189, 248, 0.18);
}
.btn-voice-toggle:hover { filter: brightness(1.1); }

.live-overlay {
  position: fixed; inset: 0; z-index: 55;
  height: 100dvh; width: 100%;
  background:
    radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.18), transparent 55%),
    linear-gradient(160deg, #060916 0%, #0d1d2b 52%, #18133a 100%);
  color: #f8fafc;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 20px 18px calc(22px + env(safe-area-inset-bottom, 0px));
}
.live-top { max-width: 640px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.live-top-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.live-title { font-weight: 900; font-size: 1.05rem; color: #fff; }
.live-badge {
  font-family: var(--font-display);
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  padding: 4px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; color: var(--mint);
}
.live-topic { font-size: .88rem; color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-warn { max-width: 640px; width: 100%; margin: 8px auto 0; background: rgba(251, 146, 60, .18); border: 1.5px solid #fb923c; color: #fed7aa; border-radius: 14px; padding: 10px 14px; font-size: .86rem; }
.live-center { flex: 1; max-width: 640px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 10px 0; min-height: 0; }

.live-orb { position: relative; width: 158px; height: 158px; border-radius: 50%; border: none; background: transparent; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; -webkit-tap-highlight-color: transparent; }
.orb-ring { position: absolute; inset: 0; border-radius: 50%; background: rgba(148, 163, 184, .2); transition: .3s; }
.orb-core { position: relative; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem; background: radial-gradient(circle at 35% 30%, #64748b, #1e293b); box-shadow: 0 0 36px rgba(148, 163, 184, .35); transition: .3s; }
.live-orb:active .orb-core { transform: scale(.94); }

.live-overlay.state-listening .orb-core { background: radial-gradient(circle at 35% 30%, var(--pink), var(--cyan)); box-shadow: 0 0 50px rgba(255, 92, 147, .65); animation: orbBreathe 1.4s ease-in-out infinite; }
.live-overlay.state-listening .orb-ring { background: rgba(255, 92, 147, .28); animation: orbRipple 1.6s ease-out infinite; }
.live-overlay.state-speaking .orb-core { background: radial-gradient(circle at 35% 30%, var(--mint), #0d9488); box-shadow: 0 0 50px rgba(34, 243, 161, .65); animation: orbBreathe 1.1s ease-in-out infinite; }
.live-overlay.state-speaking .orb-ring { background: rgba(34, 243, 161, .28); animation: orbRipple 1.3s ease-out infinite; }
.live-overlay.state-thinking .orb-core { background: radial-gradient(circle at 35% 30%, #a78bfa, #4f46e5); box-shadow: 0 0 44px rgba(167, 139, 250, .6); animation: orbSpin 1.8s linear infinite; }
.live-overlay.state-thinking .orb-ring { background: rgba(167, 139, 250, .2); }
.live-overlay.state-paused .orb-core { background: radial-gradient(circle at 35% 30%, #64748b, #334155); box-shadow: 0 0 24px rgba(148, 163, 184, .25); }

@keyframes orbBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes orbRipple { 0% { transform: scale(.85); opacity: .85; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes orbSpin { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(40deg); } }

.live-status { font-size: 1.05rem; font-weight: 800; color: #e2e8f0; }
.live-caption-box { width: 100%; display: flex; flex-direction: column; gap: 10px; max-height: 30dvh; overflow-y: auto; padding: 0 4px; }
.live-ai-caption { font-size: 1rem; line-height: 1.65; color: #e2e8f0; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 12px 16px; white-space: pre-wrap; }
.live-ai-caption:empty { display: none; }
.live-user-caption { font-size: 1.02rem; line-height: 1.55; color: #fff; font-weight: 700; background: rgba(56, 189, 248, .22); border: 1.5px solid rgba(56, 189, 248, .55); border-radius: 16px; padding: 10px 14px; word-break: break-word; }

.live-controls { max-width: 640px; width: 100%; margin: 0 auto; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.live-ctrl-btn { background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.24); color: #fff; border-radius: 999px; padding: 11px 18px; font-weight: 800; font-size: .94rem; cursor: pointer; transition: .15s; }
.live-ctrl-btn:hover { background: rgba(255,255,255,.22); }
.live-end-btn { background: rgba(239, 68, 68, .85); border-color: #f87171; }
.live-end-btn:hover { background: #dc2626; }
.live-rate-select { width: auto !important; background: rgba(255,255,255,.12) !important; border: 1.5px solid rgba(255,255,255,.24) !important; color: #fff !important; border-radius: 999px !important; padding: 10px 14px !important; font-weight: 700; font-size: .9rem; }

/* 분석 */
.loading-box { text-align: center; padding: 40px 10px; color: var(--muted); }
.spinner { width: 46px; height: 46px; border: 4px solid rgba(34, 243, 161, 0.18); border-top-color: var(--mint); border-radius: 50%; margin: 0 auto 10px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.analysis-section { background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 15px; padding: 13px 16px; margin-bottom: 10px; }
.analysis-section h4 { margin-bottom: 6px; color: #fff; }
.analysis-section ul { padding-left: 20px; }
.analysis-section.mine { border-color: rgba(56, 189, 248, 0.45); }
.analysis-section.other { border-color: rgba(139, 92, 246, 0.45); }
.analysis-section.praise { background: rgba(255, 217, 61, 0.1); border-color: rgba(255, 217, 61, 0.45); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 글쓰기 스튜디오 */
.writing-tips { background: rgba(34, 243, 161, 0.08); border: 1px solid rgba(34, 243, 161, 0.28); border-radius: 14px; padding: 12px 16px; margin-bottom: 10px; font-size: .92rem; }
.writing-tips ul { padding-left: 20px; margin-top: 4px; }
.essay-editor { border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--input-bg); }
.editor-toolbar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--surface-2); border-bottom: 1.5px solid var(--line); flex-wrap: wrap; font-size: .9rem; }
.char-meter { flex: 1; min-width: 80px; height: 10px; background: rgba(148, 163, 184, 0.2); border-radius: 99px; overflow: hidden; }
#char-meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--mint), var(--cyan)); transition: width .2s; }
.essay-editor textarea { border: none; border-radius: 0; min-height: 300px; line-height: 1.9; background: transparent; }
.essay-editor textarea:focus { box-shadow: none; }
.hint-box { margin-top: 10px; background: rgba(139, 92, 246, 0.14); border: 1.5px dashed #a78bfa; border-radius: 14px; padding: 12px 16px; white-space: pre-wrap; color: #ede9fe; }

/* 피드백 & 랭크 결과 */
.score-hero {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(135deg, rgba(34, 243, 161, 0.14), rgba(56, 189, 248, 0.12), rgba(139, 92, 246, 0.16));
  border: 1.5px solid rgba(34, 243, 161, 0.38);
  border-radius: 18px; padding: 16px; margin-bottom: 12px; flex-wrap: wrap;
}
.score-circle {
  width: 98px; height: 98px; border-radius: 50%;
  background: conic-gradient(var(--mint) calc(var(--p) * 1%), rgba(148, 163, 184, 0.2) 0);
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 0 24px rgba(34, 243, 161, 0.28);
}
.score-circle span {
  font-family: var(--font-display);
  width: 78px; height: 78px; background: #0c1226; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.7rem; font-weight: 700; color: var(--mint);
}
.score-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.rank-pill {
  font-family: var(--font-display); font-size: .82rem; font-weight: 700; letter-spacing: .05em;
  padding: 3px 10px; border-radius: 999px; color: #09111e;
}
.rank-s { background: linear-gradient(135deg, #ffd93d, #ff9f1c); box-shadow: 0 0 16px rgba(255, 217, 61, 0.45); }
.rank-a { background: linear-gradient(135deg, #22f3a1, #38bdf8); box-shadow: 0 0 14px rgba(34, 243, 161, 0.35); }
.rank-b { background: linear-gradient(135deg, #60a5fa, #38bdf8); }
.rank-c { background: linear-gradient(135deg, #c4b5fd, #a78bfa); }
.score-badge { font-size: 1.15rem; font-weight: 800; color: #fff; }
.score-diff { font-weight: 900; color: var(--pink); }

.crit { margin-bottom: 10px; }
.crit-head { display: flex; justify-content: space-between; font-weight: 700; font-size: .92rem; color: #e2e8f0; }
.crit-bar { height: 10px; background: rgba(148, 163, 184, 0.18); border-radius: 99px; overflow: hidden; margin: 4px 0; }
.crit-bar div { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 99px; }
.crit p { font-size: .88rem; color: var(--muted); }

.fb-block { background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 15px; padding: 13px 16px; margin-bottom: 10px; }
.fb-block.fb-praise { background: rgba(255, 217, 61, 0.1); border-color: rgba(255, 217, 61, 0.45); }
.fb-block.fb-next { background: rgba(139, 92, 246, 0.12); border-color: rgba(167, 139, 250, 0.45); }
.fb-block h4 { margin-bottom: 5px; color: #fff; }
.fb-block ul { padding-left: 20px; }
.spell { display: inline-block; background: rgba(255, 92, 147, 0.12); border: 1px solid rgba(255, 92, 147, 0.32); border-radius: 8px; padding: 2px 9px; margin: 2px; font-size: .88rem; }
.spell s { color: #fda4af; }
.spell b { color: var(--mint); }
.revision-section { margin-top: 16px; }
.revision-section h3 { font-weight: 800; color: #fff; }
.revision-section textarea { min-height: 240px; margin-top: 8px; line-height: 1.9; }
.raw-text { white-space: pre-wrap; }

/* 트로피 룸 & 포트폴리오 */
.badge-shelf { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.badge-item {
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.14), rgba(255, 159, 28, 0.1));
  border: 1.5px solid rgba(255, 217, 61, 0.55); color: #fef08a;
  border-radius: 12px; padding: 6px 11px; font-size: .84rem; font-weight: 700;
  box-shadow: 0 0 12px rgba(255, 217, 61, 0.14);
}
.badge-item.locked { filter: grayscale(1); opacity: .4; border-color: var(--line); background: var(--surface-2); color: var(--muted); box-shadow: none; }
.records-list { display: flex; flex-direction: column; gap: 10px; }
.record { background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 15px; padding: 13px 16px; }
.record-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.record-head b { font-size: 1.02rem; color: #fff; }
.record details { margin-top: 6px; }
.record summary { cursor: pointer; color: var(--cyan); font-weight: 700; }
.record pre { white-space: pre-wrap; font-family: inherit; background: var(--input-bg); color: var(--ink); padding: 11px; border-radius: 11px; margin-top: 6px; border: 1px solid var(--line); }
.record-actions { display: flex; gap: 6px; margin-top: 8px; }

/* 모달 & 토스트 & 푸터 */
.modal { position: fixed; inset: 0; background: rgba(4, 7, 17, 0.72); backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 50; padding: 14px; }
.modal-content {
  background: rgba(17, 24, 48, 0.96); border: 1.5px solid rgba(148, 163, 184, 0.3);
  border-radius: 20px; padding: 22px; max-width: 520px; width: 100%;
  display: flex; flex-direction: column; gap: 9px; color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
.modal-content h3 { color: #fff; }
.modal-content a { color: var(--cyan); font-weight: 700; text-decoration: none; }
.modal-content a:hover { text-decoration: underline; }
.radio-line { font-weight: 500; display: flex; gap: 8px; align-items: center; cursor: pointer; color: var(--ink); }
.direct-settings { display: flex; flex-direction: column; gap: 5px; padding: 12px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 13px; }
.modal-buttons { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.96); color: #fff;
  border: 1.5px solid rgba(34, 243, 161, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.48);
  padding: 10px 18px; border-radius: 999px; font-weight: 700;
  transition: .3s; z-index: 60; max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.footer { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 22px; }
.footer b { color: #cbd5e1; }
.print-area { display: none; }

/* 5쪽 생각 노트 워크북 (화면 HUD) */
.wb-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-size: .95rem; color: #fff; }
.wb-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.wb-tab {
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--muted);
  border-radius: 13px; padding: 9px 6px; font-size: .82rem; font-weight: 800; cursor: pointer;
  transition: .16s; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-tab:hover { border-color: var(--cyan); color: #fff; }
.wb-tab.active {
  background: linear-gradient(135deg, rgba(34, 243, 161, 0.2), rgba(56, 189, 248, 0.16));
  border-color: var(--mint); color: #fff;
  box-shadow: 0 0 18px rgba(34, 243, 161, 0.2), 0 3px 0 rgba(16, 185, 129, 0.45);
}

.wb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.wb-guide-check { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 700; color: #cbd5e1; cursor: pointer; margin-right: auto; }
.wb-guide-check input { width: 16px; height: 16px; accent-color: var(--mint); cursor: pointer; }

.wb-banner {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(139, 92, 246, 0.14));
  border: 1px solid rgba(56, 189, 248, 0.35); border-left: 4px solid var(--cyan);
  border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; font-size: .92rem; color: #e2e8f0;
}
.wb-banner b { color: #fff; }

.wb-card { background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 16px; padding: 15px 16px; margin-bottom: 12px; }
.wb-card h4 { color: #fff; margin-bottom: 8px; font-size: 1rem; }
.wb-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.wb-card-head h4 { margin-bottom: 0; }
.wb-q { font-weight: 700; color: #e2e8f0; margin-bottom: 8px; font-size: .94rem; }

.wb-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.wb-opt {
  background: var(--input-bg); border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 8px 13px; font-size: .88rem; font-weight: 700; cursor: pointer; transition: .15s; text-align: left;
}
.wb-opt:hover { border-color: var(--cyan); color: #fff; }
.wb-opt.selected { border-color: var(--cyan); background: rgba(56, 189, 248, 0.2); color: #fff; box-shadow: 0 0 12px rgba(56, 189, 248, 0.22); }
.wb-opt.correct { border-color: var(--mint); background: rgba(34, 243, 161, 0.2); color: #a7f3d0; }
.wb-opt.wrong { border-color: var(--pink); background: rgba(255, 92, 147, 0.2); color: #fecdd3; }

.wb-missions { display: flex; flex-direction: column; gap: 8px; }
.wb-mission {
  display: flex; align-items: flex-start; gap: 10px; text-align: left; width: 100%;
  background: var(--input-bg); border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 14px; padding: 11px 14px; cursor: pointer; transition: .15s;
}
.wb-mission:hover { border-color: var(--mint); }
.wb-mission.checked { border-color: var(--mint); background: rgba(34, 243, 161, 0.11); }
.wb-chk { font-size: 1.15rem; line-height: 1.3; }
.wb-mission b { color: #fff; font-size: .94rem; }
.wb-mission p { color: var(--muted); font-size: .86rem; margin-top: 2px; }

.wb-scene-box { background: var(--input-bg); border: 1.5px solid rgba(255, 217, 61, 0.32); border-radius: 14px; padding: 13px 15px; }
.wb-scene-title { font-weight: 800; color: var(--gold); margin-bottom: 5px; font-size: .92rem; }
.wb-scene-text { color: #e2e8f0; line-height: 1.7; font-size: .94rem; }

.wb-table { display: flex; flex-direction: column; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.wb-tr { display: grid; grid-template-columns: 18% 38% 44%; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: center; background: rgba(8, 13, 28, 0.45); }
.wb-tr.wb-th { border-top: none; background: rgba(56, 189, 248, 0.1); font-weight: 800; color: var(--cyan); font-size: .84rem; }
.wb-td-stage b { color: #fff; }

.wb-reallife-list { display: flex; flex-direction: column; gap: 10px; }
.wb-rl-item { background: var(--input-bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.wb-rl-head { font-size: .92rem; color: var(--cyan); margin-bottom: 4px; }
.wb-rl-head b { color: #fff; }
.wb-rl-story { color: #cbd5e1; font-size: .88rem; margin-bottom: 8px; }

.wb-quiz-list { display: flex; flex-direction: column; gap: 12px; }
.wb-quiz-item { background: var(--input-bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }

.wb-vocab-grid { display: flex; flex-direction: column; gap: 10px; }
.wb-vocab-card { background: var(--input-bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.wb-vocab-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.wb-vocab-word { font-size: 1.02rem; color: #fff; }
.wb-vocab-mean { color: #cbd5e1; font-size: .88rem; margin-bottom: 9px; }
.wb-cross-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wb-cross-boxes { display: flex; gap: 5px; flex-shrink: 0; }
.wb-cross-cell {
  position: relative; width: 42px; height: 42px; display: grid; place-items: center;
  border: 1.5px solid rgba(56, 189, 248, 0.55); border-radius: 8px;
  background: rgba(17, 24, 48, 0.85); color: rgba(241, 245, 249, 0.55); font-weight: 800; font-size: 1.1rem;
}
.wb-cross-cell::before { content: ''; position: absolute; left: 50%; top: 3px; bottom: 3px; border-left: 1px dashed rgba(148, 163, 184, 0.35); }
.wb-cross-cell::after { content: ''; position: absolute; top: 50%; left: 3px; right: 3px; border-top: 1px dashed rgba(148, 163, 184, 0.35); }
.wb-cross-cell span { position: relative; z-index: 1; }
.wb-cross-row input { flex: 1; min-width: 160px; }

.wb-procon { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.wb-side { border-radius: 15px; padding: 13px 15px; border: 1.5px solid var(--line); }
.wb-pro { background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.45); }
.wb-con { background: rgba(255, 92, 147, 0.1); border-color: rgba(255, 92, 147, 0.45); }
.wb-side-head { font-weight: 900; color: #fff; margin-bottom: 5px; font-size: .94rem; }
.wb-side p { color: #e2e8f0; font-size: .89rem; }
.wb-voice-bridge { border-color: rgba(34, 243, 161, 0.38); background: linear-gradient(145deg, rgba(34, 243, 161, 0.08), rgba(25, 35, 68, 0.85)); }

.wb-outline-list { display: flex; flex-direction: column; gap: 10px; }
.wb-outline-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px; align-items: start; }
.wb-outline-part b { display: block; color: var(--mint); font-size: .92rem; }
.wb-outline-part small { color: var(--muted); }
.wb-guide-box summary { cursor: pointer; font-weight: 800; color: var(--gold); }
.wb-guide-box ul { padding-left: 20px; margin-top: 8px; color: #cbd5e1; font-size: .89rem; }
.wb-answer-key { margin-top: 10px; padding: 10px 12px; background: var(--input-bg); border-radius: 10px; border: 1px dashed var(--line); font-size: .85rem; color: #cbd5e1; }
.wb-answer-key b { display: block; color: var(--mint); margin-bottom: 3px; }

@media (max-width: 640px) {
  .container { padding: 12px 10px 34px; }
  .header { gap: 8px; margin-bottom: 12px; }
  .logo-icon { width: 40px; height: 40px; font-size: 1.35rem; border-radius: 12px; }
  .logo h1 { font-size: 1.18rem; }
  .tagline { font-size: .76rem; }
  .btn-icon { width: 36px; height: 36px; font-size: 1rem; border-radius: 11px; }
  .xp-badge { padding: 4px 10px; font-size: .78rem; }
  .progress-bar { gap: 4px; margin-bottom: 12px; }
  .progress-bar::before { left: 16px; right: 16px; top: 21px; }
  .progress-step { padding: 6px 2px; border-radius: 12px; }
  .progress-step .step-num { width: 24px; height: 24px; font-size: .8rem; border-radius: 8px; }
  .progress-step .step-label { font-size: .66rem; }
  .hero { padding: 11px 12px; margin-bottom: 14px; font-size: .88rem; }
  .form-row, .two-col, .wb-procon, .wb-outline-row { grid-template-columns: 1fr; }
  .wb-tabs { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .wb-tab { padding: 7px 2px; font-size: .68rem; }
  .wb-tr { grid-template-columns: 1fr; gap: 6px; }
  .wb-tr.wb-th { display: none; }
  .persona-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 15px; border-radius: 18px; }
  .chat-box { height: 290px; }
  .chat-tall { height: 350px; }
  .live-orb { width: 144px; height: 144px; }
  .orb-core { width: 108px; height: 108px; font-size: 2.3rem; }
}

@media print {
  @page { size: A4; margin: 10mm; }
  :root { color-scheme: light; }
  body { background: #fff !important; color: #111 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body > *:not(.print-area) { display: none !important; }
  .bg-gradient, .bg-grid, .bg-orbs, .bg-particles { display: none !important; }
  .print-area { display: block !important; padding: 0; font-size: 10.5pt; color: #111; background: #fff; line-height: 1.5; }
  .print-area h1 { font-size: 20pt; text-align: center; margin-bottom: 4mm; color: #000; }
  .print-area h2 { font-size: 14pt; margin: 5mm 0 2mm; border-bottom: 1px solid #999; color: #000; }
  .print-area .cert { border: 4px double #17a34a; border-radius: 6mm; padding: 8mm; text-align: center; margin-bottom: 8mm; }
  .print-area pre { white-space: pre-wrap; font-family: inherit; line-height: 1.8; color: #000; }

  /* 5쪽 생각 노트 인쇄 스타일 */
  .wb-page {
    position: relative; display: flex; flex-direction: column;
    min-height: 268mm; padding: 4mm 5mm 12mm;
    break-after: page; page-break-after: always;
    font-size: 10pt; color: #1f2937;
  }
  .wb-page:last-child { break-after: auto; page-break-after: auto; }
  .wb-phead { display: flex; align-items: center; gap: 8px; border-bottom: 1.5px solid #cbd5e1; padding-bottom: 3mm; margin-bottom: 4mm; }
  .wb-pribbon { color: #fff; font-weight: 900; padding: 2mm 4mm; border-radius: 3mm; font-size: 9.5pt; white-space: nowrap; }
  .wb-pribbon.p1 { background: #4b8b3b; }
  .wb-pribbon.p2 { background: #d99226; }
  .wb-pribbon.p3 { background: #3f8e9d; }
  .wb-pribbon.p4 { background: #b64d5b; }
  .wb-pribbon.p5 { background: #7c9b3b; }
  .wb-pbanner { font-weight: 800; font-size: 11pt; color: #111; flex: 1; }
  .wb-ptag { font-size: 8.5pt; color: #475569; border: 1px solid #cbd5e1; padding: 1mm 2.5mm; border-radius: 999px; white-space: nowrap; }

  .wb-ptitle-box { display: flex; justify-content: space-between; align-items: center; border: 1.5px solid #9ca3af; border-radius: 3mm; padding: 3mm 4mm; background: #f8fafc; margin-bottom: 4mm; }
  .wb-ptitle-box h2 { margin: 0 0 1mm; border: none; font-size: 14pt; color: #0f5132; }
  .wb-psub { font-size: 8.5pt; color: #4b5563; }
  .wb-pstudent { border: 1px solid #9ca3af; background: #fff; border-radius: 2mm; padding: 2mm 3.5mm; font-size: 9pt; min-width: 38mm; }

  .wb-psec { font-size: 10.5pt; margin: 3.5mm 0 2mm; color: #111; }
  .wb-ppill { border: 1px solid #cbd5e1; border-radius: 2.5mm; padding: 2.5mm 4mm; background: #f8fafc; margin-bottom: 3mm; }
  .circled { border: 1.5px solid #e11d48; border-radius: 999px; padding: 0 2mm; font-weight: 800; color: #9f1239; }

  .wb-pmissions { display: flex; flex-direction: column; gap: 2mm; margin-bottom: 3mm; }
  .wb-pmis { display: flex; gap: 3mm; align-items: flex-start; border: 1px solid #cbd5e1; border-radius: 2.5mm; padding: 2.5mm 3.5mm; }
  .wb-pmis span { font-size: 12pt; font-weight: 900; color: #15803d; }

  .wb-pscene { border: 1px solid #9ca3af; border-radius: 2.5mm; padding: 3mm 4mm; background: #fefce8; margin-bottom: 2.5mm; }
  .wb-pscene p { margin-top: 1.5mm; line-height: 1.6; }
  .wb-pwrite { border: 1px solid #cbd5e1; border-radius: 2.5mm; padding: 2.5mm 3.5mm; }
  .wb-lines div { height: 7.5mm; border-bottom: 1px dashed #9ca3af; }
  .wb-pfilled { margin-top: 1.5mm; font-weight: 600; color: #111; }

  .wb-ptable { width: 100%; border-collapse: collapse; margin-bottom: 3.5mm; font-size: 9.5pt; }
  .wb-ptable th, .wb-ptable td { border: 1px solid #9ca3af; padding: 2.5mm 3mm; vertical-align: middle; text-align: left; }
  .wb-ptable th { background: #f1f5f9; font-weight: 800; text-align: center; }
  .wb-procon-tbl th.pro { background: #e0f2fe; color: #0369a1; }
  .wb-procon-tbl th.con { background: #ffe4e6; color: #be123c; }

  .wb-pquizbox { border: 1px solid #9ca3af; border-radius: 2.5mm; padding: 3mm 4mm; margin-bottom: 3.5mm; background: #f8fafc; }
  .wb-pq { margin-bottom: 2.5mm; }
  .wb-pq:last-child { margin-bottom: 0; }
  .wb-pqopts { margin-left: 4mm; margin-top: 1mm; }

  .wb-print-cross-wrap { display: flex; gap: 1.5mm; justify-content: center; }
  .wb-print-cross-cell { position: relative; display: inline-grid; place-items: center; width: 11mm; height: 11mm; border: 1px solid #475569; font-weight: 800; font-size: 11pt; }
  .wb-print-cross-cell::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 0.7pt dashed #cbd5e1; }
  .wb-print-cross-cell::after { content: ''; position: absolute; top: 50%; left: 0; right: 0; border-top: 0.7pt dashed #cbd5e1; }

  .wb-ptopic { text-align: center; font-weight: 900; font-size: 11.5pt; background: #fef3c7; border: 1px solid #f59e0b; border-radius: 2.5mm; padding: 2.5mm; margin-bottom: 3mm; }
  .wb-pstance { border: 1.5px solid #9ca3af; border-radius: 2.5mm; padding: 3mm 4mm; margin-bottom: 3.5mm; line-height: 1.8; }
  .wb-pvoice { border: 1px solid #9ca3af; border-radius: 2.5mm; padding: 3mm 4mm; background: #f8fafc; }
  .wb-pvoice ol { padding-left: 5mm; margin-top: 1.5mm; }

  .wb-pwongoji-title { font-weight: 800; border-bottom: 1.5px solid #475569; padding-bottom: 1.5mm; margin-bottom: 2mm; }
  .wb-wongoji { display: grid; grid-template-columns: repeat(20, 1fr); border-top: 1px solid #94a3b8; border-left: 1px solid #94a3b8; margin-bottom: 3.5mm; }
  .wb-wongoji span { border-right: 1px solid #94a3b8; border-bottom: 1px solid #94a3b8; height: 7.2mm; display: grid; place-items: center; font-size: 9pt; font-weight: 600; }

  .wb-pcoach { border: 1px solid #84cc16; background: #f7fee7; border-radius: 2.5mm; padding: 2.5mm 3.5mm; font-size: 8.5pt; line-height: 1.45; }
  .wb-pcoach ul { padding-left: 4.5mm; margin: 1mm 0; }
  .wb-pkey { border-top: 1px dashed #a3e635; padding-top: 1mm; margin-top: 1mm; color: #365314; font-weight: 700; }

  .wb-pfoot { position: absolute; left: 5mm; right: 5mm; bottom: 2mm; display: flex; justify-content: space-between; align-items: center; font-size: 8.5pt; color: #64748b; border-top: 1px solid #e2e8f0; padding-top: 1.5mm; }
  .wb-pnum { width: 6mm; height: 6mm; border-radius: 50%; background: #334155; color: #fff; display: grid; place-items: center; font-weight: 800; }
}
