/* 허반장의 한국여행 K-talk — app styles (static, no build) */

    :root {
      --primary: #22C55E;
      --primary-dark: #16A34A;
      --sky: #0EA5E9;
      --sky-dark: #0284C7;
      --orange: #F97316;
      --orange-dark: #EA580C;
      --danger: #EF4444;
      --danger-dark: #DC2626;
      --bg: #F8FAFC;
      --border: #E2E8F0;
      --text: #0F172A;
      --muted: #64748B;
      --radius: 16px;
      --shadow: 0 2px 12px rgba(15,23,42,0.05);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
      -webkit-tap-highlight-color: transparent;
    }

    body {
      background-color: #F1F5F9;
      display: flex;
      flex-direction: column;
      align-items: center;
      min-height: 100vh;
      color: var(--text);
    }
    .site-biz-footer {
      width: 100%;
      max-width: 500px;
      flex-shrink: 0;
      box-sizing: border-box;
    }

    #app-container {
      width: 100%;
      max-width: 500px;
      background: var(--bg);
      height: 100vh;
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: hidden;
      box-shadow: 0 0 40px rgba(15,23,42,0.08);
    }

    /* 헤더 */
    .header-bar {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      padding: 10px 14px 8px;
      background: #ffffff;
      border-bottom: 2px solid var(--border);
      z-index: 10;
      position: relative;
    }

    .header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      width: 100%;
      min-width: 0;
    }

    .brand-box {
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      min-width: 0;
      flex: 1 1 auto;
    }

    .brand-text {
      min-width: 0;
      overflow: hidden;
    }

    .mascot-avatar {
      width: 40px;
      height: 40px;
      position: relative;
      animation: floatAnim 3s ease-in-out infinite;
      flex-shrink: 0;
      border-radius: 50%;
      overflow: hidden;
      background: #FFF7ED;
    }
    .mascot-avatar.cheering { animation: cheerAnim 0.55s ease; }
    .mascot-avatar.sad { animation: sadAnim 0.45s ease; }
    .mascot-avatar svg,
    .mascot-avatar img,
    .mascot-img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
      border-radius: 50%;
    }

    @keyframes floatAnim {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-4px); }
    }
    @keyframes cheerAnim {
      0% { transform: scale(1) translateY(0); }
      40% { transform: scale(1.22) translateY(-8px) rotate(-6deg); }
      70% { transform: scale(1.16) translateY(-3px) rotate(6deg); }
      100% { transform: scale(1) translateY(0); }
    }
    @keyframes sadAnim {
      0%, 100% { transform: rotate(0deg); }
      25% { transform: rotate(-8deg); }
      75% { transform: rotate(8deg); }
    }

    .eye-blink {
      animation: blinkAnim 4s infinite;
      transform-origin: center;
    }
    @keyframes blinkAnim {
      0%, 96%, 100% { transform: scaleY(1); }
      98% { transform: scaleY(0.1); }
    }

    .brand-title {
      font-size: 1rem;
      font-weight: 900;
      color: var(--orange-dark);
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      word-break: keep-all;
    }

    .brand-sub {
      font-size: 0.62rem;
      color: var(--muted);
      font-weight: 700;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .header-controls {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .lang-dropdown {
      padding: 6px 8px;
      font-size: 0.75rem;
      font-weight: 800;
      border-radius: 10px;
      border: 1.5px solid var(--border);
      background: #ffffff;
      color: var(--text);
      cursor: pointer;
      outline: none;
      max-width: 88px;
      min-height: 36px;
    }

    .header-reset-btn {
      min-width: 36px;
      min-height: 36px;
      padding: 4px 8px !important;
      font-size: 0.85rem !important;
      box-shadow: 0 2px 0 var(--border);
    }

    .heart-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      font-weight: 800;
      font-size: 0.88rem;
      background: #F8FAFC;
      padding: 6px 10px;
      border-radius: 10px;
      border: 1px solid var(--border);
      color: var(--danger);
      flex-shrink: 0;
      min-width: 44px;
      min-height: 36px;
      cursor: pointer;
      font-family: inherit;
    }

    .heart-tooltip {
      margin-top: 8px;
      padding: 10px 12px;
      border-radius: 12px;
      background: #0F172A;
      color: #F8FAFC;
      font-size: 0.72rem;
      font-weight: 600;
      line-height: 1.45;
      box-shadow: var(--shadow);
    }
    .heart-tooltip[hidden] { display: none !important; }

    /* 메인 화면 */
    #map-screen {
      flex: 1;
      overflow-y: auto;
      padding: 18px 18px 88px;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .traveler-intro-card {
      width: 100%;
      background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
      border: 2px solid #FED7AA;
      border-radius: var(--radius);
      padding: 16px 14px 14px;
      margin-bottom: 14px;
      box-shadow: var(--shadow);
    }

    #welcomeCard.traveler-intro-card {
      text-align: left;
    }

    #welcomeCard.is-compact {
      padding: 12px 12px 10px;
      margin-bottom: 10px;
    }

    #welcomeCard.is-compact .intro-title {
      font-size: clamp(0.95rem, 3.6vw, 1.12rem);
      margin-bottom: 2px;
    }

    #welcomeCard.is-compact .intro-tagline {
      margin-bottom: 4px;
      font-size: 0.78rem;
    }

    #welcomeCard.is-compact .intro-promo {
      margin: 4px 0 0;
    }

    .intro-more {
      margin-top: 6px;
    }
    .intro-more > summary {
      display: inline-block;
      list-style: none;
      cursor: pointer;
      margin: 0;
      padding: 2px 10px;
      border-radius: 999px;
      background: #fff;
      border: 1.5px solid #FDBA74;
      color: #C2410C;
      font-size: 0.65rem;
      font-weight: 800;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      user-select: none;
    }
    .intro-more > summary::-webkit-details-marker { display: none; }
    .intro-more[open] > summary { margin-bottom: 6px; }
    .intro-more .intro-desc { margin-top: 2px; }

    .theme-filter-bar {
      width: 100%;
      display: flex;
      flex-wrap: nowrap;
      gap: 6px;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      padding: 0 2px 10px;
      margin-bottom: 2px;
      scrollbar-width: none;
    }
    .theme-filter-bar::-webkit-scrollbar { display: none; }

    .theme-chip {
      flex: 0 0 auto;
      border: 1.5px solid var(--border);
      background: #fff;
      color: var(--muted);
      font-size: 0.72rem;
      font-weight: 800;
      padding: 8px 12px;
      border-radius: 999px;
      min-height: 36px;
      cursor: pointer;
      white-space: nowrap;
      font-family: inherit;
    }
    .theme-chip.active {
      background: #FFF7ED;
      border-color: #FDBA74;
      color: #C2410C;
    }


    .intro-welcome {
      display: inline-block;
      margin: 0 0 6px;
      padding: 3px 10px;
      border-radius: 999px;
      background: #fff;
      border: 1.5px solid #FDBA74;
      color: #C2410C;
      font-size: 0.68rem;
      font-weight: 800;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .intro-title {
      font-size: clamp(1.05rem, 4.2vw, 1.28rem);
      font-weight: 900;
      color: #9A3412;
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 6px;
      line-height: 1.25;
      word-break: keep-all;
    }

    .intro-tagline {
      margin: 0 0 8px;
      font-size: clamp(0.78rem, 2.6vw, 0.88rem);
      font-weight: 800;
      color: #EA580C;
      line-height: 1.35;
      word-break: keep-all;
    }

    .intro-desc {
      font-size: clamp(0.72rem, 2.4vw, 0.78rem);
      color: #7C2D12;
      font-weight: 600;
      line-height: 1.45;
      word-break: keep-all;
      margin: 0;
    }

    .intro-promo {
      margin: 10px 0 0;
      font-size: clamp(0.68rem, 2.2vw, 0.75rem);
      font-weight: 800;
      color: #9A3412;
      opacity: 0.9;
      letter-spacing: 0.01em;
    }

    .quick-nav-bar {
      width: 100%;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      margin-bottom: 14px;
    }

    .nav-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: 10px;
      padding: 8px 4px;
      font-size: clamp(0.68rem, 2.2vw, 0.78rem);
      font-weight: 800;
      color: var(--text);
      cursor: pointer;
      box-shadow: 0 3px 0 var(--border);
      transition: all 0.1s ease;
      text-align: center;
      word-break: keep-all;
      line-height: 1.25;
      min-height: 42px;
    }
    .nav-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
    .nav-btn.toc { background: #FEF3C7; border-color: #FDE68A; color: #B45309; box-shadow: 0 3px 0 #FCD34D; }
    .nav-btn.primer { background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; box-shadow: 0 3px 0 #93C5FD; }
    .nav-btn.manual { background: #FAF5FF; border-color: #E9D5FF; color: #7E22CE; box-shadow: 0 3px 0 #D8B4FE; }

    .progress-box {
      width: 100%;
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: var(--radius);
      padding: 10px 14px;
      margin-bottom: 16px;
      box-shadow: var(--shadow);
    }

    .progress-info {
      display: flex;
      justify-content: space-between;
      font-size: 0.78rem;
      font-weight: 800;
      color: var(--muted);
      margin-bottom: 6px;
    }

    .progress-track {
      width: 100%;
      height: 10px;
      background: #E2E8F0;
      border-radius: 6px;
      overflow: hidden;
    }

    .progress-fill {
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, #22C55E, #16A34A);
      transition: width 0.4s ease;
    }

    .game-stats-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
      width: 100%;
    }
    .stat-pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 6px 10px;
      border-radius: 999px;
      font-size: 0.72rem;
      font-weight: 800;
      border: 1.5px solid var(--border);
      background: #F8FAFC;
      color: var(--text);
      flex: 1 1 auto;
      min-width: 0;
      white-space: nowrap;
      justify-content: center;
    }
    .stat-pill strong { font-weight: 900; }
    .stat-pill.streak-pill {
      background: #FFF7ED;
      border-color: #FED7AA;
      color: var(--orange-dark);
    }
    .stat-pill.xp-pill {
      background: #ECFDF5;
      border-color: #A7F3D0;
      color: var(--primary-dark);
    }
    .stat-pill.total-pill {
      background: #EFF6FF;
      border-color: #BFDBFE;
      color: var(--sky-dark);
    }
    .game-toast {
      position: fixed;
      left: 50%;
      bottom: 88px;
      transform: translateX(-50%) translateY(12px);
      background: #0F172A;
      color: #fff;
      font-weight: 800;
      font-size: 0.85rem;
      padding: 10px 16px;
      border-radius: 999px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.2);
      z-index: 9999;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease, transform 0.25s ease;
      max-width: calc(100% - 32px);
      text-align: center;
    }
    .game-toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
    @media (max-width: 420px) {
      .stat-pill { font-size: 0.68rem; padding: 5px 8px; }
    }

    .roadmap-list {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
    }

    .chapter-card-item {
      width: 100%;
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: var(--radius);
      padding: 14px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      box-shadow: var(--shadow);
      transition: all 0.15s ease;
    }
    .chapter-card-item:hover, .chapter-card-item:active {
      transform: translateY(-2px);
      border-color: var(--sky);
      box-shadow: 0 6px 16px rgba(14,165,233,0.15);
    }

    .chapter-card-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .chap-icon-circle {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.4rem;
      background: #F1F5F9;
      flex-shrink: 0;
    }

    .chap-title-text {
      font-size: clamp(0.86rem, 2.8vw, 0.94rem);
      font-weight: 800;
      color: var(--text);
    }

    .chap-sub-text {
      font-size: 0.72rem;
      color: var(--muted);
      font-weight: 600;
    }

    .chap-badge {
      background: #EFF6FF;
      color: #2563EB;
      font-size: 0.7rem;
      font-weight: 800;
      padding: 4px 8px;
      border-radius: 8px;
      border: 1px solid #DBEAFE;
      flex-shrink: 0;
    }
    .chap-badge.done {
      background: #DCFCE7;
      color: #16A34A;
      border-color: #BBF7D0;
    }

    /* 퀴즈 영역 */
    #quiz-screen {
      flex: 1;
      display: none;
      flex-direction: column;
      background: #ffffff;
    }

    .quiz-top-bar {
      display: flex;
      align-items: center;
      padding: 10px 16px;
      gap: 12px;
    }

    .close-btn {
      background: none;
      border: none;
      font-size: 1.4rem;
      color: var(--muted);
      cursor: pointer;
      font-weight: bold;
      min-width: 36px;
      min-height: 36px;
    }

    .quiz-progress-track {
      flex: 1;
      height: 12px;
      background: #EDF2F7;
      border-radius: 8px;
      overflow: hidden;
    }

    .quiz-progress-fill {
      width: 0%;
      height: 100%;
      background: var(--primary);
      transition: width 0.3s ease;
    }

    .tab-switch-row {
      display: flex;
      gap: 6px;
      margin: 2px 16px 8px;
      background: #F1F5F9;
      padding: 4px;
      border-radius: 12px;
    }

    .tab-btn {
      flex: 1;
      padding: 8px 4px;
      border: none;
      background: transparent;
      border-radius: 8px;
      font-size: clamp(0.72rem, 2.4vw, 0.82rem);
      font-weight: 800;
      color: var(--muted);
      cursor: pointer;
      text-align: center;
      word-break: keep-all;
      line-height: 1.2;
    }
    .tab-btn.active {
      background: #ffffff;
      color: var(--orange-dark);
      box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    }

    .quiz-content {
      flex: 1;
      padding: 10px 18px 18px;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
    }

    .coach-box {
      display: flex;
      align-items: center;
      gap: 10px;
      background: #FFFBEB;
      border: 2px solid #FDE68A;
      border-radius: 12px;
      padding: 8px 12px;
      margin-bottom: 10px;
    }
    .coach-bubble {
      font-size: clamp(0.75rem, 2.5vw, 0.82rem);
      font-weight: 800;
      color: #B45309;
      line-height: 1.35;
      word-break: keep-all;
    }

    .category-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 6px;
    }

    .category-pill {
      background: #E0F2FE;
      color: #0369A1;
      font-size: 0.75rem;
      font-weight: 800;
      padding: 3px 8px;
      border-radius: 6px;
    }
    .counter-pill { font-size: 0.74rem; font-weight: 800; color: var(--muted); }

    .prompt-ko-title {
      font-size: clamp(1rem, 3.2vw, 1.1rem);
      font-weight: 900;
      color: var(--text);
      margin-bottom: 2px;
    }

    .prompt-ko-title, .prompt-en-sub, .target-phrase-text, .feedback-tip-box, .coach-bubble {
      user-select: text;
      -webkit-user-select: text;
    }

    .prompt-en-sub {
      font-size: clamp(0.82rem, 2.6vw, 0.9rem);
      color: var(--muted);
      margin-bottom: 10px;
      font-weight: 600;
      word-break: keep-all;
    }

    .audio-btn {
      align-self: flex-start;
      background: #ffffff;
      border: 2px solid #BAE6FD;
      border-radius: 10px;
      padding: 6px 12px;
      display: flex;
      align-items: center;
      gap: 6px;
      font-weight: 800;
      font-size: clamp(0.74rem, 2.4vw, 0.82rem);
      color: #0284C7;
      cursor: pointer;
      margin-bottom: 14px;
      box-shadow: 0 3px 0 #BAE6FD;
    }
    .audio-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #BAE6FD; }

    #scrambleContainer { display: flex; flex-direction: column; flex: 1; }

    .slot-box {
      min-height: 56px;
      border-bottom: 2px solid var(--border);
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
      padding-bottom: 8px;
      margin-bottom: 14px;
    }

    .word-pool {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: center;
    }

    .word-btn {
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: 12px;
      padding: 8px 12px;
      font-size: clamp(0.86rem, 3vw, 0.98rem);
      font-weight: 800;
      color: var(--text);
      cursor: pointer;
      box-shadow: 0 3px 0 var(--border);
      transition: all 0.1s ease;
      min-height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      word-break: keep-all;
      white-space: normal;
      text-align: center;
    }
    .word-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
    .word-btn.used {
      background: #E2E8F0;
      color: transparent;
      border-color: #E2E8F0;
      box-shadow: none;
      cursor: default;
    }

    #speakingContainer {
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      flex: 1;
      text-align: center;
    }

    .target-box {
      width: 100%;
      background: #F8FAFC;
      border: 2px dashed #CBD5E1;
      border-radius: 14px;
      padding: 12px;
      margin-bottom: 14px;
    }
    .target-guide-text { font-size: 0.72rem; color: var(--muted); font-weight: 800; margin-bottom: 4px; }
    .target-phrase-text { font-size: clamp(1.05rem, 3.4vw, 1.2rem); font-weight: 900; color: #0369A1; line-height: 1.35; }

    .mic-btn {
      width: 74px;
      height: 74px;
      border-radius: 50%;
      border: none;
      background: var(--sky);
      color: #ffffff;
      font-size: 2rem;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 5px 0 var(--sky-dark);
      cursor: pointer;
      margin-bottom: 10px;
      transition: all 0.15s ease;
    }
    .mic-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--sky-dark); }
    .mic-btn.listening {
      background: var(--danger);
      box-shadow: 0 5px 0 var(--danger-dark);
      animation: micPulse 1.2s infinite;
    }

    @keyframes micPulse {
      0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
      70% { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
      100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    }

    .mic-status { font-size: 0.82rem; font-weight: 800; color: var(--muted); margin-bottom: 10px; }
    .mic-status.active { color: var(--danger); }

    .score-box {
      width: 100%;
      background: #ffffff;
      border: 1.5px solid var(--border);
      border-radius: 12px;
      padding: 10px 12px;
      text-align: left;
    }
    .score-heard { font-size: 0.8rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
    .score-heard span { font-weight: 800; color: var(--text); }

    .accuracy-bar { display: flex; align-items: center; gap: 8px; }
    .accuracy-track { flex: 1; height: 8px; background: #E2E8F0; border-radius: 6px; overflow: hidden; }
    .accuracy-fill { width: 0%; height: 100%; background: var(--primary); transition: width 0.3s ease; }
    .accuracy-num { font-size: 0.82rem; font-weight: 900; color: var(--primary-dark); min-width: 38px; text-align: right; }

    .bottom-action-bar {
      padding: 12px 16px 14px;
      border-top: 2px solid var(--border);
      background: #ffffff;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .lesson-nav {
      display: flex;
      gap: 10px;
      width: 100%;
    }

    .lesson-nav-btn {
      flex: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      min-height: 46px;
      padding: 10px 12px;
      border-radius: 14px;
      font-size: 0.92rem;
      font-weight: 900;
      cursor: pointer;
      font-family: inherit;
      transition: transform 0.08s ease, box-shadow 0.08s ease;
    }
    .lesson-nav-arrow {
      font-size: 1.05rem;
      line-height: 1;
    }
    .lesson-nav-prev {
      background: #ffffff;
      color: #0F172A;
      border: 2px solid #CBD5E1;
      box-shadow: 0 3px 0 #94A3B8;
    }
    .lesson-nav-next {
      background: linear-gradient(180deg, #FB923C, #F97316);
      color: #ffffff;
      border: none;
      box-shadow: 0 3px 0 #C2410C;
    }
    .lesson-nav-btn:disabled {
      opacity: 0.38;
      cursor: not-allowed;
      box-shadow: none;
      transform: none;
    }
    .lesson-nav-btn:not(:disabled):active {
      transform: translateY(2px);
      box-shadow: 0 1px 0 transparent;
    }
    .lesson-nav-in-sheet {
      margin-top: 2px;
    }

    .confirm-btn {
      width: 100%;
      padding: 13px;
      font-size: 1rem;
      font-weight: 900;
      color: #ffffff;
      background: var(--primary);
      border: none;
      border-radius: 12px;
      box-shadow: 0 4px 0 var(--primary-dark);
      cursor: pointer;
    }
    .confirm-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--primary-dark); }
    .confirm-btn:disabled { background: #CBD5E1; box-shadow: none; color: #94A3B8; cursor: not-allowed; }

    .feedback-sheet {
      position: absolute;
      bottom: 0; left: 0; right: 0;
      padding: 16px;
      display: none;
      flex-direction: column;
      gap: 10px;
      z-index: 20;
    }
    .feedback-sheet.correct { background-color: #DCFCE7; border-top: 2px solid var(--primary); display: flex; }
    .feedback-sheet.wrong { background-color: #FEE2E2; border-top: 2px solid var(--danger); display: flex; }

    .feedback-title { font-size: 1.08rem; font-weight: 900; }
    .correct .feedback-title { color: var(--primary-dark); }
    .wrong .feedback-title { color: var(--danger-dark); }

    .feedback-tip-box {
      background: rgba(255,255,255,0.95);
      border-radius: 10px;
      padding: 9px 12px;
      font-size: clamp(0.76rem, 2.4vw, 0.82rem);
      color: var(--text);
      line-height: 1.45;
      border-left: 4px solid var(--primary);
      word-break: keep-all;
    }
    .wrong .feedback-tip-box { border-left-color: var(--danger); }

    /* 모달 공통 */
    .modal-overlay {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(15, 23, 42, 0.65);
      backdrop-filter: blur(4px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 50;
      padding: 16px;
    }

    .modal-card {
      background: #ffffff;
      width: 100%;
      max-width: 440px;
      max-height: 85vh;
      border-radius: 20px;
      padding: 18px 16px;
      display: flex;
      flex-direction: column;
      box-shadow: var(--shadow);
      overflow-y: auto;
    }

    .modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 14px;
      border-bottom: 2px solid var(--border);
      padding-bottom: 8px;
    }

    .modal-title-text {
      font-size: 1.05rem;
      font-weight: 900;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .modal-close-btn {
      background: none;
      border: none;
      font-size: 1.3rem;
      color: var(--muted);
      cursor: pointer;
    }

    .toc-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .toc-card {
      background: #F8FAFC;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 8px 10px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.76rem;
      font-weight: 800;
      color: var(--text);
      word-break: keep-all;
    }
    .toc-card:hover, .toc-card:active {
      background: #EFF6FF;
      border-color: #3B82F6;
      color: #1D4ED8;
    }

    .section-title {
      font-size: 0.86rem;
      font-weight: 900;
      color: #1D4ED8;
      margin: 12px 0 6px;
    }

    .hangul-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 6px;
      margin-bottom: 10px;
    }

    .hangul-card {
      background: #F8FAFC;
      border: 1.5px solid var(--border);
      border-radius: 8px;
      padding: 6px 2px;
      text-align: center;
      cursor: pointer;
      transition: all 0.1s ease;
    }
    .hangul-card:active {
      transform: scale(0.95);
      background: #EFF6FF;
      border-color: #3B82F6;
    }
    .hangul-card .ko { font-size: 1.1rem; font-weight: 900; }
    .hangul-card .name { font-size: 0.66rem; color: #2563EB; font-weight: 800; }
    .hangul-card .rom { font-size: 0.6rem; color: var(--muted); font-weight: 700; }

    .formula-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 6px;
      margin-bottom: 10px;
    }
    .formula-card {
      background: #F1F5F9;
      border: 1px solid #CBD5E1;
      border-radius: 8px;
      padding: 8px 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
    }
    .formula-card .expr { font-size: 0.76rem; font-weight: 700; color: var(--muted); }
    .formula-card .res { font-size: 1rem; font-weight: 900; color: #0284C7; }

    .info-card {
      background: #F0FDF4;
      border: 1px solid #BBF7D0;
      border-radius: 10px;
      padding: 10px 12px;
      margin-bottom: 10px;
      font-size: 0.78rem;
      line-height: 1.45;
      color: #166534;
      word-break: keep-all;
    }

    .step-card {
      display: flex;
      gap: 10px;
      padding: 8px 10px;
      border-radius: 12px;
      background: #F8FAFC;
      border: 1px solid var(--border);
      margin-bottom: 8px;
    }
    .step-num {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: var(--orange-dark);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 900;
      font-size: 0.8rem;
      flex-shrink: 0;
    }
    .step-text h4 { font-size: 0.85rem; font-weight: 800; margin-bottom: 2px; }
    .step-text p { font-size: 0.75rem; color: var(--muted); line-height: 1.35; word-break: keep-all; }

    /* 설문 양식 */
    .survey-group { margin-bottom: 14px; text-align: left; }
    .survey-label { font-size: 0.84rem; font-weight: 800; margin-bottom: 6px; display: block; }
    .star-row { display: flex; gap: 8px; justify-content: center; font-size: 1.8rem; cursor: pointer; }
    .survey-chk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 0.78rem; font-weight: 700; }
    .survey-chk-grid label { display: flex; align-items: center; gap: 4px; background: #F1F5F9; padding: 6px 8px; border-radius: 8px; }
    .survey-input { width: 100%; height: 70px; border-radius: 8px; border: 1.5px solid var(--border); padding: 8px; font-size: 0.8rem; outline: none; resize: none; }


    /* ===== Theme-clear celebration overlay ===== */
    .celebrate-overlay {
      z-index: 80;
      background: rgba(15, 23, 42, 0.78);
      backdrop-filter: blur(6px);
      padding: 12px;
      overflow: hidden;
    }
    .celebrate-overlay.is-active {
      display: flex !important;
    }
    .celebrate-fx {
      position: absolute;
      inset: 0;
      pointer-events: none;
      overflow: hidden;
      z-index: 0;
    }
    .celebrate-piece {
      position: absolute;
      top: -12px;
      width: 8px;
      height: 10px;
      border-radius: 2px;
      opacity: 0.95;
      animation: celebrateFall linear forwards;
    }
    .celebrate-piece.star {
      width: 0;
      height: 0;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-bottom: 9px solid #FBBF24;
      background: transparent;
      border-radius: 0;
    }
    .celebrate-card {
      position: relative;
      z-index: 1;
      background: linear-gradient(180deg, #FFF7ED 0%, #ffffff 42%);
      width: 100%;
      max-width: 420px;
      max-height: 92vh;
      border-radius: 24px;
      padding: 22px 18px 18px;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
      border: 2px solid #FED7AA;
      overflow-y: auto;
      animation: celebrateCardIn 0.45s ease-out;
    }
    .celebrate-mascot-lg {
      width: 108px !important;
      height: 108px !important;
      margin-bottom: 8px;
      animation: celebrateMascotBounce 0.9s ease-in-out infinite;
    }
    .celebrate-badge-wrap {
      perspective: 800px;
      margin: 4px 0 10px;
      min-height: 72px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .celebrate-badge {
      width: 88px;
      height: 88px;
      border-radius: 50%;
      background: radial-gradient(circle at 35% 30%, #FDE68A, #F59E0B 55%, #B45309);
      box-shadow: 0 8px 0 #92400E, 0 12px 24px rgba(180, 83, 9, 0.35);
      display: flex;
      align-items: center;
      justify-content: center;
      transform: rotateY(90deg) scale(0.6);
      opacity: 0;
    }
    .celebrate-badge.is-flipped {
      animation: celebrateBadgeFlip 0.7s cubic-bezier(0.2, 0.8, 0.2, 1.2) forwards;
    }
    .celebrate-badge-face {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      color: #78350F;
    }
    .celebrate-badge-icon { font-size: 1.6rem; line-height: 1; }
    .celebrate-badge-label {
      font-size: 0.72rem;
      font-weight: 900;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .celebrate-kicker {
      font-size: 0.78rem;
      font-weight: 800;
      color: var(--orange-dark);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin-bottom: 4px;
    }
    .celebrate-title {
      font-size: 1.28rem;
      font-weight: 900;
      color: var(--orange-dark);
      margin-bottom: 4px;
      line-height: 1.25;
    }
    .celebrate-theme-name {
      font-size: 0.95rem;
      font-weight: 800;
      color: var(--text);
      margin-bottom: 6px;
    }
    .celebrate-desc {
      font-size: 0.84rem;
      color: var(--muted);
      font-weight: 600;
      margin-bottom: 14px;
      line-height: 1.4;
    }
    .celebrate-stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      width: 100%;
      margin-bottom: 12px;
    }
    .celebrate-stat {
      background: #F8FAFC;
      border: 1.5px solid var(--border);
      border-radius: 14px;
      padding: 10px 6px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
    }
    .celebrate-stat-icon { font-size: 1.05rem; }
    .celebrate-stat-val {
      font-size: 1.15rem;
      font-weight: 900;
      color: var(--text);
      font-variant-numeric: tabular-nums;
    }
    .celebrate-stat-label {
      font-size: 0.68rem;
      font-weight: 700;
      color: var(--muted);
    }
    .celebrate-unlock {
      font-size: 0.82rem;
      font-weight: 800;
      color: var(--sky-dark);
      background: #E0F2FE;
      border: 1.5px solid #BAE6FD;
      border-radius: 999px;
      padding: 8px 12px;
      margin-bottom: 12px;
      max-width: 100%;
      line-height: 1.35;
    }
    .celebrate-actions {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 8px;
      opacity: 1;
      transform: translateY(0);
      transition: opacity 0.35s ease, transform 0.35s ease;
    }
    .celebrate-actions.is-hidden {
      opacity: 0;
      transform: translateY(10px);
      pointer-events: none;
      max-height: 0;
      overflow: hidden;
      margin: 0;
      padding: 0;
    }
    .celebrate-secondary-btn {
      width: 100%;
      padding: 12px 14px;
      border-radius: 14px;
      border: 2px solid var(--border);
      background: #ffffff;
      color: var(--text);
      font-weight: 800;
      font-size: 0.9rem;
      cursor: pointer;
    }
    .celebrate-secondary-btn:active { transform: translateY(1px); }

    @keyframes celebrateFall {
      0% { transform: translate3d(0, -10px, 0) rotate(0deg); opacity: 1; }
      100% { transform: translate3d(18px, 110vh, 0) rotate(720deg); opacity: 0.15; }
    }
    @keyframes celebrateCardIn {
      from { opacity: 0; transform: scale(0.92) translateY(16px); }
      to { opacity: 1; transform: scale(1) translateY(0); }
    }
    @keyframes celebrateMascotBounce {
      0%, 100% { transform: translateY(0) scale(1); }
      40% { transform: translateY(-10px) scale(1.06); }
      70% { transform: translateY(-4px) scale(1.02); }
    }
    @keyframes celebrateBadgeFlip {
      0% { transform: rotateY(90deg) scale(0.6); opacity: 0; }
      55% { transform: rotateY(-12deg) scale(1.08); opacity: 1; }
      100% { transform: rotateY(0deg) scale(1); opacity: 1; }
    }

    @media (prefers-reduced-motion: reduce) {
      .celebrate-card { animation: none; }
      .celebrate-mascot-lg { animation: none !important; }
      .celebrate-badge {
        transform: none;
        opacity: 1;
      }
      .celebrate-badge.is-flipped { animation: none; }
      .celebrate-piece { display: none !important; }
      .celebrate-actions {
        transition: none;
      }
      .celebrate-actions.is-hidden {
        opacity: 1;
        transform: none;
        pointer-events: auto;
        max-height: none;
      }
    }


    /* Chat entry (chat.html) */
    .nav-btn.chat-cta { width: 100%; margin: -6px 0 14px; padding: 11px 10px; background: #ECFDF5; border-color: #A7F3D0; color: #047857; box-shadow: 0 3px 0 #6EE7B7; text-decoration: none; font-size: 0.82rem; }
    .chat-cta-tag { font-size: 0.62rem; background: #047857; color: #fff; border-radius: 999px; padding: 2px 7px; margin-left: 4px; }

    /* Meet Heo Ban-jang card */
    .heo-intro-card {
      background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
      border-color: #BAE6FD;
      padding: 12px 12px 10px;
      margin-bottom: 10px;
      text-align: left;
    }
    .heo-intro-head { display: flex; align-items: center; gap: 10px; }
    .heo-intro-avatar { width: 52px; height: 52px; background: #fff; box-shadow: 0 0 0 2px #7DD3FC; }
    .heo-intro-text { min-width: 0; }
    .heo-intro-title { font-size: clamp(0.95rem, 3.6vw, 1.1rem); color: #075985; margin-bottom: 2px; }
    .heo-intro-tagline { margin: 0; font-size: 0.76rem; color: #0284C7; }
    .heo-intro-more > summary { border-color: #7DD3FC; color: #0369A1; }
    .heo-intro-more .intro-desc { color: #0C4A6E; font-size: 0.8rem; line-height: 1.55; }
