/* ─────────────────────────────────────────────
   씬짜오! 회화카드 — 여행 스티커북 스타일
   저사양 폰 대상: 프레임워크 없음, CSS 효과만 사용
   ───────────────────────────────────────────── */
@font-face {
  font-family: 'Jua';
  src: url('fonts/Jua-Regular.woff2') format('woff2');
  font-display: swap;
}

:root {
  --paper: #FFF6E4;
  --ink: #21304F;
  --red: #E8503A;
  --red-deep: #C93A26;
  --yellow: #FFC531;
  --blue: #2E63E7;
  --mint: #3FBF8F;
  --muted: #8A7F6C;
  --card: #FFFFFF;
  --radius: 18px;
  --shadow: 4px 4px 0 var(--ink);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* hidden 속성은 display를 준 요소에서도 항상 숨김 (flex 등에 덮이지 않게) */
[hidden] { display: none !important; }

html { font-size: 16px; }

body {
  font-family: 'Jua', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(232, 80, 58, .10) 2.5px, transparent 2.5px);
  background-size: 26px 26px;
  color: var(--ink);
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: 24px;
}

/* ── 헤더 ─────────────────────────── */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 3px solid var(--ink);
  box-shadow: 0 3px 0 rgba(33, 48, 79, .12);
}

.brand h1 {
  font-size: 1.7rem;
  letter-spacing: -.5px;
  line-height: 1.1;
}
.brand-vi {
  color: var(--red);
  text-shadow: 2.5px 2.5px 0 var(--yellow);
}
.brand-sub {
  font-size: .82rem;
  color: var(--muted);
  margin-top: 3px;
}
.arrow { color: var(--blue); }

.search-wrap { margin-top: 10px; }
#search {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  box-shadow: 3px 3px 0 var(--ink);
}
#search:focus { border-color: var(--blue); box-shadow: 3px 3px 0 var(--blue); }
#search::placeholder { color: #B4A98F; }

/* ── 카테고리 칩 ───────────────────── */
.chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  font: inherit;
  font-size: .95rem;
  padding: 8px 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, background-color .08s ease;
}
.chip:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.chip.on {
  background: var(--yellow);
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink);
}

/* ── 카드 목록 ─────────────────────── */
.cards {
  padding: 16px 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-title {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 8px 2px 0;
}

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  font: inherit;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px 14px 16px;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
  animation: pop .3s ease backwards;
}
.card:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }

@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card-text { flex: 1; min-width: 0; }
.card-ko { font-size: 1.18rem; line-height: 1.25; }
.card-vi {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--red);
  margin-top: 4px;
}
.card-pr { font-size: .85rem; color: var(--muted); margin-top: 2px; }

.card-speak {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--yellow);
  box-shadow: 2.5px 2.5px 0 var(--ink);
  font-size: 1.35rem;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.card-speak:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.card-speak.playing { background: var(--mint); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0 20px;
  font-size: 1.05rem;
}

.foot-tip {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.5;
  padding: 18px 16px calc(10px + env(safe-area-inset-bottom));
}
.foot-tip strong { color: var(--red); }

/* ── 크게 보여주기 (베트남 국기 무드) ── */
.show {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--red);
  display: flex;
  flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  animation: show-in .22s ease;
  overflow: hidden;
}
.show[hidden] { display: none; }
@keyframes show-in {
  from { opacity: 0; transform: scale(1.03); }
  to   { opacity: 1; transform: scale(1); }
}

.show-star {
  position: absolute;
  top: -70px;
  right: -60px;
  font-size: 260px;
  line-height: 1;
  color: rgba(255, 197, 49, .22);
  pointer-events: none;
  user-select: none;
}

.show-close {
  align-self: flex-end;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: transparent;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.show-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 10px;
  position: relative;
}
.show-label {
  color: rgba(255, 255, 255, .85);
  font-size: .9rem;
  letter-spacing: .5px;
}
.show-vi {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-weight: 900;
  color: #fff;
  font-size: clamp(2rem, 9.5vw, 3.2rem);
  line-height: 1.2;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, .18);
}
.show-pr {
  color: var(--yellow);
  font-size: 1.3rem;
}
.show-ko {
  color: rgba(255, 255, 255, .92);
  font-size: 1.15rem;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 2px dashed rgba(255, 255, 255, .4);
}

.show-actions {
  display: flex;
  gap: 10px;
}
.btn-speak {
  font: inherit;
  font-size: 1.05rem;
  padding: 15px 10px;
  border-radius: 16px;
  border: 3px solid var(--ink);
  cursor: pointer;
  transition: transform .08s ease;
}
.btn-speak:active { transform: scale(.96); }
.btn-speak--vi {
  flex: 1.6;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-speak--ko {
  flex: 1;
  background: #fff;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

/* ── 하단 탭바 ─────────────────────── */
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  z-index: 20;
  display: flex;
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 3px solid var(--ink);
}
.tab {
  flex: 1;
  font: inherit;
  font-size: 1.05rem;
  padding: 12px 8px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.tab:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.tab.on { background: var(--yellow); transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }

/* 카드 탭이 아닐 때는 검색·카테고리 숨김 */
body:not([data-view="cards"]) .search-wrap,
body:not([data-view="cards"]) .chips { display: none; }

/* ── 말로 통역 ─────────────────────── */
.talk {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.talk-status {
  width: 100%;
  text-align: center;
  font-size: .95rem;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
}
.talk-status[data-kind="on"] { background: #E4F7EE; }
.talk-status[data-kind="off"] { background: #FBE9E5; }

.seg {
  display: flex;
  gap: 6px;
  width: 100%;
}
.seg-btn {
  flex: 1;
  font: inherit;
  font-size: .82rem;
  padding: 8px 4px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.seg-btn.on { background: var(--blue); color: #fff; }

.mic {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: var(--red);
  color: #fff;
  font: inherit;
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  margin-top: 6px;
  transition: transform .08s ease, box-shadow .08s ease, background-color .15s ease;
}
.mic:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.mic:disabled { background: #C9BFA9; cursor: default; }
.mic-icon { font-size: 3rem; }
.mic-label { font-size: .88rem; padding: 0 14px; text-align: center; line-height: 1.3; }
.mic.rec {
  background: var(--mint);
  animation: breathe 1.1s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.typed-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
#typed-text {
  flex: 1;
  font: inherit;
  font-size: .95rem;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  min-width: 0;
}
#typed-text:focus { border-color: var(--blue); }
#typed-text::placeholder { color: #B4A98F; }
#typed-send {
  font: inherit;
  padding: 10px 18px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}
#typed-send:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.talk-result {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.talk-item {
  font: inherit;
  text-align: left;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  cursor: pointer;
  animation: pop .25s ease backwards;
}
.talk-item:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.talk-src { display: block; font-size: .9rem; color: var(--muted); }
.talk-dst {
  display: block;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--red);
  margin-top: 4px;
}

.talk-settings {
  width: 100%;
  font-size: .9rem;
  color: var(--muted);
}
.talk-settings summary { cursor: pointer; padding: 6px 2px; }
.talk-settings-row { display: flex; gap: 8px; margin-top: 8px; }
#server-url {
  flex: 1;
  font: inherit;
  font-size: .9rem;
  padding: 9px 12px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
}
#server-save {
  font: inherit;
  padding: 9px 16px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--yellow);
  cursor: pointer;
}
.talk-settings-tip { margin-top: 6px; font-size: .8rem; }

/* ── 📷 사진 번역 ──────────────────── */
.cam-row { width: 100%; }
.cam-btn {
  display: block;
  width: 100%;
  text-align: center;
  font-size: .95rem;
  padding: 12px 14px;
  border: 3px dashed var(--ink);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.cam-btn:active { background: var(--yellow); }
.cam-item { cursor: default; }
.cam-text {
  display: block;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-size: .95rem;
  line-height: 1.55;
  color: var(--ink);
  margin-top: 6px;
  white-space: pre-wrap;
}

/* ── 🧳 여행 도구 ──────────────────── */
.tools {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tool-card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tool-card h2 { font-size: 1.15rem; }
.tool-tip { font-size: .85rem; color: var(--muted); }
.tool-tip b { color: var(--red); }

.tool-set { font-size: .9rem; color: var(--muted); }
.tool-set summary { cursor: pointer; padding: 2px 0; }
.tool-set input {
  width: 100%;
  font: inherit;
  font-size: .9rem;
  padding: 9px 12px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  margin-top: 8px;
}
.tool-set button {
  font: inherit;
  margin-top: 8px;
  padding: 8px 16px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--yellow);
  cursor: pointer;
}

.sos-open {
  font: inherit;
  font-size: 1.25rem;
  line-height: 1.35;
  padding: 18px 14px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--red);
  color: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
}
.sos-open small { font-size: .8rem; opacity: .9; }
.sos-open:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.sos-view .show-vi { font-size: clamp(1.5rem, 7vw, 2.2rem); }
.sos-line {
  color: #fff;
  font-size: 1.05rem;
  margin-top: 10px;
  line-height: 1.4;
}
.sos-line b { color: var(--yellow); font-size: 1.3rem; word-break: break-all; }

.fx-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fx-row input {
  flex: 1;
  font: inherit;
  font-size: 1.3rem;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  min-width: 0;
}
.fx-unit { font-size: 1.05rem; width: 52px; }
.fx-eq { text-align: center; font-size: 1.2rem; color: var(--muted); }
.fx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-chip {
  font: inherit;
  font-size: .82rem;
  padding: 6px 10px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
}
.fx-chip:active { background: var(--yellow); }
.fx-rate-row input { width: 90px; display: inline-block; margin: 0 4px; }

/* 공지·일정 */
.board-time { font-size: .78rem; color: var(--muted); }
.board-notices { display: flex; flex-direction: column; gap: 8px; }
.board-notice {
  border: 2.5px solid var(--ink);
  border-left: 8px solid var(--red);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--card);
}
.bn-text {
  display: block;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-size: .93rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.bn-time { display: block; font-size: .75rem; color: var(--muted); margin-top: 4px; }
.board-sub { font-size: 1rem; margin-top: 4px; }
.board-schedule {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-size: .92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  border: 2.5px dashed var(--ink);
  border-radius: 12px;
  padding: 12px;
  background: #FFFDF6;
}

.board-places { display: flex; flex-wrap: wrap; gap: 8px; }
.place-btn {
  font: inherit;
  font-size: .92rem;
  padding: 9px 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 2.5px 2.5px 0 var(--ink);
}
.place-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }

/* 준비 체크 */
.prep summary { cursor: pointer; list-style: none; }
.prep summary::-webkit-details-marker { display: none; }
.prep-title { display: inline; }
.prep-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.prep-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
}
.prep-item.ok { background: #E4F7EE; }
.prep-mark { font-size: 1.05rem; flex: 0 0 auto; }
.prep-body { flex: 1; min-width: 0; }
.prep-body b { display: block; font-size: .95rem; }
.prep-body small {
  display: block;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-size: .78rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.35;
}
.prep-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.prep-btn {
  font: inherit;
  font-size: .8rem;
  padding: 6px 10px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: var(--yellow);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

/* 통역 결과 발음 표기 */
.talk-pr { display: block; font-size: .85rem; color: var(--muted); margin-top: 2px; }

/* 방향 버튼 5개 줄바꿈 */
.seg { flex-wrap: wrap; }
.seg-btn { flex: 1 1 30%; }

.mission-count { color: var(--blue); font-size: 1rem; }
.mission-done { color: var(--mint); font-size: 1.05rem; }
.mission-list { display: flex; flex-direction: column; gap: 8px; }
.mission {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font: inherit;
  text-align: left;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
}
.mission.ok { background: #E4F7EE; }
.mission-check { font-size: 1.2rem; flex: 0 0 auto; }
.mission-body b { display: block; font-size: .98rem; }
.mission-body small {
  display: block;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-size: .82rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* ── 업데이트 배너 ─────────────────── */
.update-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--blue);
  color: #fff;
  text-align: center;
  padding: 9px 12px;
  font-size: .92rem;
  border-bottom: 3px solid var(--ink);
}
.update-banner[hidden] { display: none; }
.update-banner button {
  font: inherit;
  margin-left: 8px;
  padding: 5px 14px;
  border: 2.5px solid #fff;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  cursor: pointer;
}

/* ── 즐겨찾기 별 ───────────────────── */
.card-star {
  flex: 0 0 auto;
  align-self: center;
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px 2px;
  color: #C9BFA9;
  cursor: pointer;
  user-select: none;
}
.card-star.on { color: #E0A400; }

/* ── 4탭 레이아웃 (카드/학습/통역/여행) ── */
.tabbar { gap: 7px; padding-left: 10px; padding-right: 10px; }
.tab { font-size: .95rem; padding: 12px 3px; }

/* ── 📚 학습(퀴즈) ─────────────────── */
.quiz { padding: 18px 16px; }
.quiz-home { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.quiz-title { font-size: 1.6rem; text-align: center; }
.quiz-sub { text-align: center; color: var(--muted); margin-top: -8px; }
.quiz-modes { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.quiz-mode-btn {
  font: inherit;
  font-size: 1.25rem;
  padding: 20px 16px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}
.quiz-mode-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.quiz-mode-btn small { font-size: .85rem; color: var(--muted); }
.quiz-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: .95rem;
  color: var(--muted);
  margin-top: 4px;
}
.quiz-scope select {
  font: inherit;
  font-size: .95rem;
  padding: 8px 12px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}
.quiz-best { text-align: center; color: var(--mint); font-size: 1rem; min-height: 1.2em; }

/* 배움 허브: 베트남 알기·배움 일기 타일 */
.learn-tiles { display: flex; flex-direction: column; gap: 12px; }
.learn-tile {
  font: inherit; font-size: 1.25rem;
  padding: 20px 16px; text-align: center;
  border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
}
.learn-tile[data-open="culture"] { background: #FDEBD6; }
.learn-tile[data-open="journal"] { background: #E4F0FB; }
.learn-tile:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.learn-tile small { font-size: .85rem; color: var(--muted); font-weight: normal; }
.learn-quiz {
  margin-top: 6px; padding-top: 14px;
  border-top: 3px dashed var(--border-strong, #C9BFA9);
  display: flex; flex-direction: column; gap: 12px;
}
.learn-quiz-h { text-align: center; font-size: 1.05rem; color: var(--muted); }

/* 하위 화면 공통 바 */
.sub-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sub-back {
  font: inherit; padding: 8px 14px; border: 3px solid var(--ink);
  border-radius: 999px; background: var(--card); cursor: pointer;
}
.sub-title { font-size: 1.2rem; }

/* 🇻🇳 베트남 알기 */
.culture-list { display: flex; flex-direction: column; gap: 12px; }
.culture-card {
  border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); background: var(--card); padding: 16px;
}
.culture-h { font-size: 1.1rem; margin-bottom: 8px; }
.culture-b {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-size: .95rem; line-height: 1.7; color: var(--ink);
}

/* 📔 배움 일기 */
.journal-form {
  display: flex; flex-direction: column; gap: 10px;
  border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); background: var(--card); padding: 14px;
}
.journal-form input, .journal-form textarea {
  width: 100%; font: inherit; font-size: .95rem;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  padding: 10px 12px; border: 3px solid var(--ink); border-radius: 12px; background: #FFFDF6;
}
.journal-form textarea { min-height: 70px; resize: vertical; }
.journal-form #j-save {
  font-family: 'Jua', sans-serif; font-size: 1.05rem; padding: 12px;
  border: 3px solid var(--ink); border-radius: 14px;
  background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); cursor: pointer;
}
.journal-tools { display: flex; align-items: center; justify-content: space-between; margin: 12px 2px; }
.journal-count { color: var(--muted); font-size: .9rem; }
.j-copy {
  font: inherit; font-size: .9rem; padding: 8px 14px;
  border: 3px solid var(--ink); border-radius: 12px; background: var(--blue); color: #fff; cursor: pointer;
}
.journal-list { display: flex; flex-direction: column; gap: 10px; }
.journal-card {
  border: 3px solid var(--ink); border-radius: 14px; background: var(--card); padding: 12px 14px;
}
.jc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.jc-date { font-size: 1.05rem; color: var(--red); }
.jc-del { font: inherit; border: none; background: none; cursor: pointer; font-size: 1.05rem; }
.journal-card p {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-size: .92rem; line-height: 1.55; margin-top: 3px;
}
.jc-word { color: var(--red); }

/* 🙋 친구가 소개하는 엄마 나라 */
.friend-card { background: #FFF3E0; border-color: var(--red); }
.friend-card .culture-h { color: var(--red-deep); }
.friend-phrases {
  margin-top: 10px; border-top: 2px dashed var(--red);
  padding-top: 10px; display: flex; flex-direction: column; gap: 6px;
}
.fp-h { font-size: .95rem; color: var(--muted); }
.fp-row {
  display: flex; align-items: center; gap: 8px;
  font: inherit; text-align: left;
  border: 2.5px solid var(--ink); border-radius: 12px; background: var(--card);
  padding: 8px 10px; cursor: pointer;
}
.fp-ko { flex: 0 0 auto; font-size: .9rem; }
.fp-vi { flex: 1; font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif; font-weight: 800; color: var(--red); }
.fp-spk { flex: 0 0 auto; font-size: 1.1rem; }
.friend-msg {
  margin-top: 10px; font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-size: 1rem; color: var(--red-deep); font-weight: 800;
}

/* 📝 나의 배움 발표 */
.report-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.report-tools input {
  flex: 1 1 100%; font: inherit; font-size: .95rem; padding: 10px 12px;
  border: 3px solid var(--ink); border-radius: 12px; background: var(--card);
}
.report-print, .report-share {
  font: inherit; font-size: .95rem; padding: 10px 16px; flex: 1;
  border: 3px solid var(--ink); border-radius: 12px; cursor: pointer; box-shadow: 3px 3px 0 var(--ink);
}
.report-print { background: var(--yellow); }
.report-share { background: var(--blue); color: #fff; }
.report-paper {
  background: #fff; border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 18px;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
}
.rp-title { font-family: 'Jua', sans-serif; font-size: 1.5rem; text-align: center; color: var(--red); }
.rp-sub { text-align: center; color: var(--muted); font-size: .95rem; margin: 4px 0 16px; }
.rp-sec { margin-bottom: 16px; }
.rp-h { font-family: 'Jua', sans-serif; font-size: 1.1rem; border-bottom: 2px solid var(--ink); padding-bottom: 4px; margin-bottom: 8px; }
.rp-item { font-size: .95rem; line-height: 1.7; }
.rp-jrn { border-left: 4px solid var(--yellow); padding-left: 10px; margin-bottom: 10px; }
.rp-jdate { font-weight: 800; color: var(--red); }
.rp-empty { color: var(--muted); font-size: .9rem; }

/* 🩺 알레르기·의료 */
.med-open {
  font: inherit; font-size: 1.05rem; width: 100%;
  padding: 14px; border: 3px solid var(--ink); border-radius: 14px;
  background: #FFE9A8; box-shadow: 3px 3px 0 var(--ink); cursor: pointer;
}
.med-open[hidden] { display: none; }
.med-view { background: #1C7C54; }
.med-big {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-weight: 900; color: #fff; font-size: clamp(1.8rem, 8vw, 2.6rem);
  line-height: 1.35; text-align: center; padding: 0 8px; white-space: pre-wrap;
}

/* 📔 일기 유실 방지 알림 */
.journal-nudge {
  background: #FFF3CD; border: 3px solid var(--ink); border-radius: 14px;
  padding: 10px 12px; margin: 12px 0; font-size: .9rem; line-height: 1.5;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
}
.journal-nudge b { color: var(--red); }

/* 👀 화면 설정 (접근성) */
.a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.a11y-btns { display: flex; gap: 6px; }
.a11y-btns button {
  font: inherit; font-size: .9rem; padding: 8px 12px;
  border: 3px solid var(--ink); border-radius: 999px; background: var(--card); cursor: pointer;
}
.a11y-btns button.on { background: var(--yellow); }
.a11y-contrast { display: flex; align-items: center; gap: 8px; font-size: .95rem; cursor: pointer; }
.a11y-contrast input { width: 20px; height: 20px; }

/* 고대비 모드 */
body.contrast {
  --muted: #4A4033;
  --card: #FFFFFF;
}
body.contrast .card-pr, body.contrast .talk-pr, body.contrast .card-vi { font-weight: 800; }
body.contrast .card, body.contrast .chip, body.contrast .tab,
body.contrast .tool-card, body.contrast .talk-item { border-width: 4px; }
body.contrast .brand-sub, body.contrast .foot-tip { color: #3A3226; }

/* 인쇄 — 발표 자료만 깔끔하게 */
@media print {
  .top, .tabbar, .update-banner, .no-print { display: none !important; }
  body { background: #fff; padding: 0; }
  .quiz { padding: 0; }
  .report-paper { border: none; box-shadow: none; padding: 0; }
  .rp-item, .rp-sub { color: #000 !important; }
}

.quiz-play { display: flex; flex-direction: column; gap: 16px; }
.quiz-bar { display: flex; align-items: center; justify-content: space-between; }
.quiz-exit {
  font: inherit; width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--card); cursor: pointer;
}
.quiz-progress { font-size: 1rem; color: var(--muted); }
.quiz-score { font-size: 1.15rem; }
.quiz-card {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--card);
  padding: 28px 20px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.quiz-card.flash { cursor: pointer; background: #FFFDF6; }
.q-label { font-size: .9rem; color: var(--muted); }
.q-ko { font-size: 1.7rem; line-height: 1.25; }
.q-vi {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  font-weight: 800; font-size: 1.7rem; color: var(--red); line-height: 1.25;
}
.q-pr { font-size: 1.15rem; color: var(--muted); }
.q-flip-hint, .q-speak { font-size: .85rem; color: var(--blue); }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.q-opt {
  font: inherit; font-size: 1.15rem;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans', sans-serif;
  padding: 15px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}
.q-opt:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.q-opt.done { cursor: default; }
.q-opt.right { background: #C8F0DC; }
.q-opt.wrong { background: #FBD5CC; }
.quiz-next {
  font: inherit; font-size: 1.1rem; padding: 14px;
  border: 3px solid var(--ink); border-radius: 16px;
  background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); cursor: pointer;
}
.quiz-next[hidden] { display: none; }

.quiz-done {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 40px 20px; text-align: center;
}
.quiz-done-emoji { font-size: 4rem; }
.quiz-done-score { font-size: 1.4rem; }
.quiz-done-msg { font-size: 1.1rem; color: var(--muted); }
.quiz-again, .quiz-home-btn {
  font: inherit; font-size: 1.1rem; width: 100%; max-width: 320px; padding: 14px;
  border: 3px solid var(--ink); border-radius: 16px; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}
.quiz-again { background: var(--yellow); }
.quiz-home-btn { background: var(--card); }

@media (prefers-reduced-motion: reduce) {
  .card, .show, .mic.rec { animation: none; }
}
