:root {
  --ink: #173c45;
  --muted: #668086;
  --paper: #fffdf8;
  --cream: #fff7e9;
  --line: #e7ece8;
  --coral: #ff7657;
  --coral-dark: #e6533b;
  --yellow: #ffd66b;
  --mint: #76d8ca;
  --mint-dark: #178f82;
  --blue: #6c8cff;
  --purple: #a56ae8;
  --pink: #ef6f9a;
  --shadow: 0 16px 45px rgba(33, 74, 72, 0.12);
  --shadow-soft: 0 8px 24px rgba(33, 74, 72, 0.08);
  color-scheme: light;
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; overflow-x: hidden; background: var(--cream); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 8%, rgba(255, 214, 107, .4), transparent 24rem),
    radial-gradient(circle at 95% 18%, rgba(118, 216, 202, .28), transparent 25rem),
    var(--cream);
}

button, input, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"], label[for] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 4px solid rgba(108, 140, 255, .32);
  outline-offset: 2px;
}

img { display: block; max-width: 100%; }

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  background: var(--coral);
  box-shadow: 0 8px 0 rgba(181, 65, 43, .15);
  font-size: 25px;
  transform: rotate(-3deg);
}
.brand-mark--large { width: 76px; height: 76px; border-radius: 24px; font-size: 40px; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 90px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 13px 20px;
  border-radius: 999px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: .25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.audio-dock {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 24px;
  display: none;
  width: min(620px, calc(100vw - 28px));
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(23, 60, 69, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}
.audio-dock.is-visible { display: flex; }
.audio-dock > span { white-space: nowrap; font-size: 12px; font-weight: 900; }
.audio-dock audio { width: 100%; min-width: 120px; height: 38px; }
.audio-dock button { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 10px; background: #edf2ef; font-size: 20px; cursor: pointer; }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, .95fr);
  align-items: center;
  gap: clamp(32px, 6vw, 100px);
  max-width: 1180px;
  margin: auto;
  padding: 52px 34px;
  overflow: hidden;
}

.auth-intro h1 {
  margin: 22px 0 12px;
  font-size: clamp(48px, 7vw, 84px);
  letter-spacing: -.07em;
  line-height: .96;
}
.auth-intro h1 em { color: var(--coral); font-style: normal; }
.auth-intro > p { max-width: 480px; margin: 0; color: var(--muted); font-size: 19px; line-height: 1.7; }
.auth-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.auth-badges span { padding: 9px 13px; border: 1px solid rgba(23, 60, 69, .08); border-radius: 999px; background: rgba(255, 255, 255, .7); font-size: 14px; font-weight: 800; }

.laptop { position: relative; width: min(100%, 570px); margin: 0 auto 50px; }
.laptop-screen {
  position: relative;
  z-index: 2;
  min-height: 540px;
  padding: 18px;
  border: 12px solid #284750;
  border-bottom-width: 20px;
  border-radius: 30px 30px 18px 18px;
  background: linear-gradient(155deg, #fffdf8, #fff8e9);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.laptop-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(125deg, rgba(255,255,255,.8), transparent 35%);
  pointer-events: none;
}
.laptop-base {
  position: absolute;
  z-index: 1;
  left: -8%;
  right: -8%;
  bottom: -34px;
  height: 56px;
  border-radius: 8px 8px 30px 30px;
  background: linear-gradient(#dce8e5, #a8bdbd);
  box-shadow: 0 18px 28px rgba(23, 60, 69, .17);
}
.laptop-base::after { content: ""; position: absolute; top: 0; left: 40%; width: 20%; height: 13px; border-radius: 0 0 12px 12px; background: #91a9a9; }

.auth-card { min-height: 496px; padding: clamp(18px, 4vw, 34px); }
.auth-card__eyebrow, .eyebrow { color: var(--coral-dark); font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.auth-card h2 { margin: 8px 0 6px; font-size: clamp(26px, 4vw, 36px); letter-spacing: -.04em; }
.auth-card > p { margin: 0 0 22px; color: var(--muted); line-height: 1.55; }

.profile-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.profile-choice {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 2px solid transparent;
  border-radius: 18px;
  background: white;
  box-shadow: 0 4px 14px rgba(33, 74, 72, .06);
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.profile-choice > span:last-child { min-width: 0; }
.profile-choice:hover { transform: translateY(-2px); }
.profile-choice.is-selected { border-color: var(--coral); box-shadow: 0 7px 18px rgba(255, 118, 87, .16); }
.profile-choice strong { display: block; font-size: 15px; }
.profile-choice small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.avatar {
  flex: 0 0 auto;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 3px solid white;
  border-radius: 18px;
  background: #ffb39e;
  box-shadow: 0 4px 10px rgba(23, 60, 69, .12);
  font-size: 27px;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--small { width: 42px; height: 42px; border-radius: 14px; font-size: 22px; }
.avatar--mini { width: 28px; height: 28px; border-width: 2px; border-radius: 9px; font-size: 15px; }
.avatar--large { width: 104px; height: 104px; border-radius: 32px; font-size: 52px; }
.tone-0 { background: #ffb39e; }
.tone-1 { background: #aebdff; }
.tone-2 { background: #96e5d9; }
.tone-3 { background: #d0a9ef; }
.tone-4 { background: #ffe08d; }
.tone-5 { background: #f5a9c2; }

.field { display: grid; gap: 7px; margin: 14px 0; }
.field > span { font-size: 13px; font-weight: 900; }
.input {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border: 2px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: white;
  transition: border-color .18s, box-shadow .18s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(108, 140, 255, .12); outline: 0; }
textarea.input { min-height: 140px; resize: vertical; line-height: 1.6; }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 0;
  border-radius: 15px;
  background: var(--coral);
  color: white;
  box-shadow: 0 7px 0 #d94f37;
  font-weight: 900;
  cursor: pointer;
  transform: translateY(-2px);
  transition: filter .15s, transform .15s, box-shadow .15s;
}
.button:hover { filter: brightness(1.03); }
.button:active { transform: translateY(4px); box-shadow: 0 1px 0 #d94f37; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button--wide { width: 100%; }
.button--secondary { background: var(--ink); box-shadow: 0 7px 0 #09272e; }
.button--mint { background: var(--mint-dark); box-shadow: 0 7px 0 #0b6f65; }
.button--soft { background: white; color: var(--ink); border: 2px solid var(--line); box-shadow: 0 5px 0 #d8e1dc; }
.button--small { min-height: 40px; padding: 8px 13px; border-radius: 12px; font-size: 13px; box-shadow: none; transform: none; }
.text-button { padding: 8px; border: 0; color: var(--muted); background: transparent; font-weight: 800; cursor: pointer; }

.setup-members { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.setup-note { padding: 12px 14px; border-radius: 13px; background: #fff3c7; color: #785e12; font-size: 12px; line-height: 1.5; }
.error-message { min-height: 20px; margin: 8px 0; color: #c73e2a; font-size: 13px; font-weight: 800; }

.app-shell { min-height: 100vh; padding-bottom: 32px; }
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(23, 60, 69, .07);
  background: rgba(255, 253, 248, .88);
  backdrop-filter: blur(18px);
}
.topbar__inner { display: flex; max-width: 1180px; height: 78px; align-items: center; gap: 32px; margin: auto; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand strong { display: block; font-size: 20px; letter-spacing: -.04em; }
.brand small { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.desktop-nav { display: flex; gap: 8px; margin-left: auto; }
.nav-link { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border: 0; border-radius: 13px; color: var(--muted); background: transparent; font-weight: 900; cursor: pointer; }
.nav-link.is-active { color: var(--coral-dark); background: #fff0eb; }
.profile-chip { display: flex; align-items: center; gap: 9px; margin-left: 10px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 17px; background: white; cursor: pointer; }
.profile-chip strong { display: block; font-size: 13px; }
.profile-chip small { display: block; color: var(--muted); font-size: 10px; }

.page { max-width: 1180px; margin: auto; padding: 34px 24px 60px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
.page-heading h1, .page-heading h2 { margin: 5px 0 0; font-size: clamp(28px, 5vw, 42px); letter-spacing: -.05em; }
.page-heading p { max-width: 520px; margin: 6px 0 0; color: var(--muted); line-height: 1.6; }

.welcome-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  min-height: 330px;
  align-items: center;
  margin-bottom: 36px;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 34px;
  background: linear-gradient(135deg, #173c45, #285c62);
  box-shadow: var(--shadow);
  color: white;
  overflow: hidden;
}
.welcome-hero::before { content: ""; position: absolute; width: 260px; height: 260px; right: -40px; top: -80px; border-radius: 50%; background: rgba(118, 216, 202, .23); }
.welcome-hero::after { content: ""; position: absolute; width: 180px; height: 180px; left: 48%; bottom: -120px; border-radius: 50%; background: rgba(255, 214, 107, .18); }
.welcome-copy { position: relative; z-index: 2; }
.welcome-copy .eyebrow { color: var(--yellow); }
.welcome-copy h1 { max-width: 650px; margin: 10px 0 14px; font-size: clamp(37px, 5vw, 62px); line-height: 1.06; letter-spacing: -.06em; }
.welcome-copy p { max-width: 550px; margin: 0 0 25px; color: #d6e5e5; font-size: 17px; line-height: 1.65; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.welcome-visual { position: relative; z-index: 2; display: grid; place-items: center; }
.newspaper-mascot { position: relative; width: 230px; height: 230px; border-radius: 42% 58% 55% 45%; background: var(--yellow); transform: rotate(4deg); box-shadow: 0 18px 0 rgba(5, 32, 38, .22); }
.newspaper-mascot::before { content: "📰"; position: absolute; left: 50%; top: 46%; font-size: 118px; transform: translate(-50%, -50%) rotate(-5deg); filter: drop-shadow(0 8px 0 rgba(134, 92, 14, .15)); }
.newspaper-mascot::after { content: "오늘도 멋진 기자!"; position: absolute; right: -28px; bottom: -13px; padding: 10px 14px; border-radius: 14px 14px 3px 14px; background: white; color: var(--ink); font-size: 13px; font-weight: 900; transform: rotate(-3deg); }

.quick-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 36px; }
.stat-card { display: flex; align-items: center; gap: 15px; padding: 18px; border: 1px solid rgba(23, 60, 69, .06); border-radius: 21px; background: rgba(255,255,255,.76); box-shadow: var(--shadow-soft); }
.stat-icon { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 16px; background: #fff0eb; font-size: 24px; }
.stat-card:nth-child(2) .stat-icon { background: #e3f8f3; }
.stat-card:nth-child(3) .stat-icon { background: #fff4ce; }
.stat-card strong { display: block; font-size: 23px; letter-spacing: -.04em; }
.stat-card span { color: var(--muted); font-size: 12px; font-weight: 800; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 2px 17px; }
.section-head h2 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.section-head button { white-space: nowrap; }

.lesson-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lesson-card { position: relative; min-width: 0; border: 0; border-radius: 24px; background: white; box-shadow: var(--shadow-soft); overflow: hidden; text-align: left; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.lesson-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.lesson-image { position: relative; height: 185px; background: #eaf5f0; overflow: hidden; }
.lesson-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.lesson-card:hover .lesson-image img { transform: scale(1.035); }
.lesson-level { position: absolute; left: 13px; top: 13px; padding: 6px 9px; border-radius: 9px; background: rgba(255,255,255,.92); box-shadow: 0 3px 10px rgba(23,60,69,.1); font-size: 11px; font-weight: 900; }
.completed-badge { position: absolute; right: 13px; top: 13px; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--mint-dark); color: white; font-weight: 900; }
.lesson-body { padding: 18px; }
.lesson-category { color: var(--coral-dark); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.lesson-body h3 { margin: 7px 0 8px; font-size: 21px; letter-spacing: -.035em; }
.lesson-body p { display: -webkit-box; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.lesson-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; color: var(--muted); font-size: 12px; font-weight: 800; }
.progress-track { width: 76px; height: 7px; border-radius: 99px; background: #edf1ef; overflow: hidden; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--mint-dark); }
.progress-0 i { width: 0; }.progress-1 i { width: 33%; }.progress-2 i { width: 66%; }.progress-3 i { width: 100%; }

.back-button { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px; padding: 8px 0; border: 0; color: var(--muted); background: transparent; font-weight: 900; cursor: pointer; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); align-items: start; gap: 25px; }
.article-card, .quiz-card, .panel { border: 1px solid rgba(23, 60, 69, .06); border-radius: 28px; background: white; box-shadow: var(--shadow-soft); overflow: hidden; }
.article-cover { position: relative; height: clamp(230px, 36vw, 430px); background: #edf3f0; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-cover__shade { position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(6,31,38,.75)); }
.article-cover__title { position: absolute; left: clamp(20px, 5vw, 42px); right: 24px; bottom: 28px; color: white; }
.article-cover__title span { padding: 6px 9px; border-radius: 8px; background: var(--coral); font-size: 11px; font-weight: 900; }
.article-cover__title h1 { max-width: 680px; margin: 9px 0 0; font-size: clamp(29px, 5vw, 51px); line-height: 1.07; letter-spacing: -.05em; }
.article-content { padding: clamp(24px, 5vw, 45px); }
.article-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 27px; }
.article-lede { margin: 0 0 23px; color: var(--ink); font-size: clamp(19px, 2.7vw, 24px); line-height: 1.65; font-weight: 800; }
.article-text { color: #36575e; font-family: ui-serif, Georgia, serif; font-size: 19px; line-height: 1.9; }
.article-text p { margin: 0 0 18px; }
.translation-box { margin-top: 25px; padding: 21px; border-radius: 18px; background: #f1faf7; color: #36575e; line-height: 1.75; }
.translation-box strong { display: block; margin-bottom: 7px; color: var(--mint-dark); }
.is-hidden { display: none !important; }
.vocab { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.vocab span { padding: 8px 11px; border: 1px solid #dce7e2; border-radius: 10px; background: var(--paper); font-size: 13px; }
.vocab b { color: var(--coral-dark); }

.quiz-card { position: sticky; top: 100px; padding: 24px; }
.quiz-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.quiz-card h2 { margin: 3px 0 0; font-size: 25px; letter-spacing: -.04em; }
.quiz-count { padding: 7px 10px; border-radius: 10px; color: #755900; background: #fff3c7; font-size: 12px; font-weight: 900; }
.question { padding: 19px 0; border-top: 1px solid var(--line); }
.question:first-of-type { border-top: 0; }
.question-title { margin: 0 0 13px; font-size: 15px; line-height: 1.45; }
.question-title b { color: var(--coral-dark); }
.options { display: grid; gap: 8px; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span { display: flex; min-height: 43px; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 13px; color: #4e696f; font-size: 13px; font-weight: 800; cursor: pointer; }
.option span::before { content: ""; width: 15px; height: 15px; flex: 0 0 auto; border: 2px solid #c8d5d1; border-radius: 50%; background: white; }
.option input:checked + span { border-color: var(--blue); color: #304eae; background: #f1f4ff; }
.option input:checked + span::before { border: 5px solid var(--blue); }
.option.is-correct span { border-color: var(--mint-dark); color: #126e65; background: #eaf9f6; }
.option.is-wrong span { border-color: var(--coral); color: #ae3d28; background: #fff0eb; }
.answer-note { margin-top: 10px; padding: 11px; border-radius: 11px; background: #f3f6f5; color: var(--muted); font-size: 12px; line-height: 1.55; }
.score-celebration { padding: 20px; margin-bottom: 17px; border-radius: 18px; background: linear-gradient(135deg, #fff2c6, #ffe0a5); text-align: center; }
.score-celebration strong { display: block; font-size: 37px; }
.score-celebration span { font-size: 13px; font-weight: 900; }

.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .82fr); gap: 22px; align-items: start; }
.panel { padding: clamp(20px, 4vw, 30px); }
.panel h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.04em; }
.panel > p { margin: 0 0 20px; color: var(--muted); line-height: 1.55; }
.scene-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 10px 0 18px; }
.scene-choice { display: grid; min-height: 76px; place-items: center; border: 2px solid var(--line); border-radius: 17px; background: var(--paper); font-size: 30px; cursor: pointer; }
.scene-choice.is-selected { border-color: var(--coral); background: #fff1ec; }
.upload-drop { display: grid; min-height: 110px; place-items: center; padding: 15px; border: 2px dashed #cddbd6; border-radius: 18px; background: #f9fbfa; color: var(--muted); text-align: center; cursor: pointer; }
.upload-drop:hover { border-color: var(--mint-dark); }
.upload-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.upload-drop strong { display: block; margin-top: 4px; color: var(--ink); }
.upload-drop.is-analyzing { border-color: var(--blue); background: #f0f4ff; cursor: wait; animation: ai-pulse 1.35s ease-in-out infinite; }
.analyze-again { display: block; margin: 8px auto 0; color: var(--blue); }
.ai-privacy-note { margin: 12px 0 20px; padding: 11px 13px; border-radius: 13px; background: #eef8f5; color: #42625d; font-size: 11px; line-height: 1.55; }
.button--translate { margin: 4px 0 12px; background: var(--blue); box-shadow: 0 7px 0 #4967cc; }
.translation-setup-note { margin: 0 0 16px; padding: 12px 13px; border-radius: 13px; background: #fff3c7; color: #715a17; font-size: 12px; line-height: 1.5; }
.translation-result { margin-top: 18px; padding: 15px; border-radius: 17px; background: #eff5ff; }
.translation-result .input { border-color: #cad5ff; }
.generated-quiz-note { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; margin: 16px 0; padding: 14px; border: 1px solid #cde7dd; border-radius: 15px; background: #effbf7; }
.generated-quiz-note > span { grid-row: 1 / 3; align-self: center; font-size: 25px; }
.generated-quiz-note strong { color: #216c5d; font-size: 14px; }
.generated-quiz-note small { margin-top: 2px; color: var(--muted); line-height: 1.45; }
.visibility-picker { display: grid; gap: 9px; margin: 20px 0; padding: 0; border: 0; }
.visibility-picker legend { margin-bottom: 9px; font-size: 13px; font-weight: 900; }
.visibility-choice { position: relative; }
.visibility-choice input { position: absolute; opacity: 0; pointer-events: none; }
.visibility-choice > span { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border: 2px solid var(--line); border-radius: 15px; background: white; cursor: pointer; }
.visibility-choice b { display: block; font-size: 13px; }
.visibility-choice small { color: var(--muted); font-size: 11px; text-align: right; }
.visibility-choice input:checked + span { border-color: var(--mint-dark); background: #effaf7; }
.story-preview { position: sticky; top: 100px; min-height: 510px; padding: 0; }
.preview-photo { display: grid; height: 245px; place-items: center; background: linear-gradient(135deg, #b9e9df, #fff0be); font-size: 95px; overflow: hidden; }
.preview-photo img { width: 100%; height: 100%; object-fit: cover; }
.preview-copy { padding: 25px; }
.preview-copy small { color: var(--coral-dark); font-weight: 900; }
.preview-copy h2 { margin: 8px 0 12px; font-size: 29px; }
.preview-copy p { margin: 0; color: #4c676d; font-family: ui-serif, Georgia, serif; line-height: 1.75; white-space: pre-wrap; }

.family-news-section { margin-top: 38px; }
.story-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.story-mini { display: grid; grid-template-columns: 100px 1fr; min-width: 0; border-radius: 18px; background: white; box-shadow: var(--shadow-soft); overflow: hidden; }
.story-mini__image { display: grid; min-height: 130px; padding: 0; place-items: center; border: 0; background: #e4f6f2; font-size: 38px; cursor: pointer; }
.story-mini__image img { width: 100%; height: 100%; object-fit: cover; }
.story-mini__copy { min-width: 0; padding: 14px; }
.story-mini h3 { margin: 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-korean-title { display: block; margin: -3px 0 5px; color: var(--mint-dark); font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-mini p { display: -webkit-box; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.story-byline { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 900; }
.story-author { display: flex; min-width: 0; align-items: center; gap: 6px; }
.story-author b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.story-actions .text-button { padding: 7px 0; font-size: 11px; }
.family-story { max-width: 820px; margin: auto; padding: 0; }
.family-story__photo { display: grid; height: clamp(280px, 48vw, 480px); place-items: center; background: linear-gradient(135deg, #b9e9df, #fff0be); font-size: 130px; overflow: hidden; }
.family-story__photo img { width: 100%; height: 100%; object-fit: cover; }
.family-story__content { padding: clamp(24px, 6vw, 52px); }
.family-story__content h1 { margin: 12px 0 20px; font-size: clamp(32px, 6vw, 54px); line-height: 1.08; letter-spacing: -.055em; }
.family-story__korean-title { margin: -13px 0 20px; color: var(--muted); font-size: 16px; font-weight: 900; }
.family-story__article { margin-top: 28px; color: #36575e; font-family: ui-serif, Georgia, serif; font-size: clamp(18px, 3vw, 22px); line-height: 1.9; white-space: pre-wrap; }
.story-learning-layout .family-story { width: 100%; max-width: none; }
.story-quiz-card { max-height: calc(100vh - 120px); overflow-y: auto; }

@keyframes ai-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108, 140, 255, 0); }
  50% { box-shadow: 0 0 0 7px rgba(108, 140, 255, .12); }
}

.family-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 22px; align-items: start; }
.profile-panel { text-align: center; }
.profile-panel .avatar { margin: 5px auto 16px; }
.profile-panel h2 { margin-bottom: 3px; }
.profile-panel .role { margin: 0 0 20px; color: var(--muted); }
.photo-label { display: inline-flex; cursor: pointer; }
.photo-label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.privacy-note { margin-top: 18px; padding: 13px; border-radius: 13px; color: #5c6968; background: #f3f6f5; font-size: 11px; line-height: 1.5; text-align: left; }
.report-list { display: grid; gap: 11px; margin-top: 20px; }
.family-profile-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0 26px; }
.family-profile-card { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.family-profile-card span:last-child { min-width: 0; }
.family-profile-card strong, .family-profile-card small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.family-profile-card small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.report-heading { margin-top: 6px !important; padding-top: 24px; border-top: 1px solid var(--line); }
.report-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.report-row:first-child { border-top: 0; }
.report-row strong { display: block; }
.report-row small { color: var(--muted); }
.score-pill { padding: 8px 11px; border-radius: 11px; background: #eaf9f6; color: var(--mint-dark); font-size: 13px; font-weight: 900; }
.empty-state { padding: 40px 20px; border: 2px dashed #dce5e1; border-radius: 20px; color: var(--muted); text-align: center; }
.empty-state span { display: block; margin-bottom: 9px; font-size: 36px; }

.bottom-nav { display: none; }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; max-width: 620px; padding-top: 35px; }
  .auth-intro { text-align: center; }
  .auth-intro > p { margin-inline: auto; }
  .auth-badges { justify-content: center; }
  .laptop-screen { min-height: auto; }
  .desktop-nav { display: none; }
  .topbar__inner { height: 68px; }
  .profile-chip { margin-left: auto; }
  .welcome-hero { grid-template-columns: 1fr; }
  .welcome-visual { display: none; }
  .lesson-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout, .create-layout { grid-template-columns: 1fr; }
  .quiz-card, .story-preview { position: static; }
  .story-quiz-card { max-height: none; overflow: visible; }
  .family-grid { grid-template-columns: 1fr; }
  .bottom-nav {
    position: fixed;
    z-index: 30;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 7px;
    border: 1px solid rgba(23,60,69,.08);
    border-radius: 22px;
    background: rgba(255,255,255,.93);
    box-shadow: 0 10px 35px rgba(23,60,69,.18);
    backdrop-filter: blur(18px);
  }
  .bottom-nav .nav-link { min-width: 0; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 10px; }
  .bottom-nav .nav-link span { font-size: 20px; }
  .app-shell { padding-bottom: 88px; }
  .audio-dock { bottom: 92px; }
}

@media (max-width: 620px) {
  .auth-page { display: block; width: 100%; padding: 23px 14px 65px; }
  .auth-intro { margin-bottom: 27px; }
  .auth-intro h1 { font-size: 48px; }
  .auth-intro > p { font-size: 15px; }
  .auth-badges span { font-size: 11px; }
  .laptop { width: calc(100vw - 28px); max-width: calc(100vw - 28px); min-width: 0; margin-bottom: 38px; }
  .laptop-screen { padding: 8px; border-width: 8px; border-bottom-width: 13px; border-radius: 24px 24px 14px 14px; }
  .laptop-base { left: -3%; right: -3%; bottom: -25px; height: 40px; border-radius: 6px 6px 22px 22px; }
  .auth-card { min-height: auto; padding: 19px 15px; }
  .profile-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-choice { padding: 8px; overflow: hidden; }
  .profile-choice small { display: none; }
  .avatar { width: 45px; height: 45px; border-radius: 14px; font-size: 23px; }
  .setup-members { grid-template-columns: 1fr; }
  .topbar__inner { padding: 0 15px; }
  .brand small, .profile-chip small { display: none; }
  .profile-chip { padding-right: 7px; }
  .page { padding: 23px 15px 44px; }
  .page-heading { align-items: start; flex-direction: column; }
  .welcome-hero { min-height: 0; padding: 28px 23px; border-radius: 27px; }
  .welcome-copy h1 { font-size: 38px; }
  .welcome-copy p { font-size: 14px; }
  .welcome-actions .button { width: 100%; }
  .quick-stats { grid-template-columns: 1fr; gap: 9px; }
  .stat-card { padding: 13px 15px; }
  .lesson-grid { grid-template-columns: 1fr; gap: 14px; }
  .lesson-card { display: grid; grid-template-columns: 128px 1fr; min-height: 145px; }
  .lesson-image { height: 100%; }
  .lesson-body { align-self: center; padding: 14px; }
  .lesson-body h3 { font-size: 18px; }
  .lesson-body p { -webkit-line-clamp: 2; }
  .lesson-meta { margin-top: 10px; }
  .progress-track { display: none; }
  .article-cover { height: 290px; }
  .article-cover__title { left: 20px; bottom: 20px; }
  .article-content { padding: 23px 18px; }
  .article-text { font-size: 17px; }
  .quiz-card, .panel { border-radius: 22px; padding: 20px 17px; }
  .scene-picker { grid-template-columns: repeat(4, 1fr); }
  .scene-choice { min-height: 63px; font-size: 26px; }
  .visibility-choice > span { align-items: flex-start; flex-direction: column; gap: 4px; }
  .visibility-choice small { text-align: left; }
  .story-preview { padding: 0; }
  .story-list { grid-template-columns: 1fr; }
  .audio-dock > span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
