/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #1a1a1a; background: #fff; min-height: 100vh; display: flex; flex-direction: column; }
button { cursor: pointer; border: none; background: none; font: inherit; }
a { color: #c23f15; text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* ── Header ─────────────────────────────────────────────── */
#header { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid #f3f4f6; }
.header-left { display: flex; align-items: center; gap: 8px; }
.logo { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; color: #333; }
.logo-green { color: #e85d2a; }
.tagline { font-size: 12px; color: #9ca3af; }
.header-nav { display: flex; align-items: center; gap: 10px; }
.nav-btn { font-size: 13px; font-weight: 500; color: #333; border: 1px solid #e5e7eb; padding: 7px 14px; border-radius: 12px; transition: all .2s; }
.nav-btn:hover { border-color: #e85d2a; color: #c23f15; background: #fff7ed; }

/* Tier toggle */
.tier-toggle { font-family: monospace; font-size: 11px; padding: 5px 10px; border-radius: 8px; }
.tier-toggle.t-free { color: #9ca3af; background: #f9fafb; border-color: #e5e7eb; }
.tier-toggle.t-pro { color: #b45309; background: #fff7ed; border-color: #fcd34d; }
.tier-toggle.t-max { color: #d97706; background: #fffbeb; border-color: #fcd34d; }

/* ── Main Layout ────────────────────────────────────────── */
#main { flex: 1; display: flex; gap: 24px; max-width: 1280px; width: 100%; margin: 0 auto; padding: 32px 16px; align-items: flex-start; }
#left-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
footer { text-align: center; color: #d1d5db; font-size: 12px; padding: 20px; border-top: 1px solid #f3f4f6; }

/* ── Hero ───────────────────────────────────────────────── */
#hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#hero h1 { font-size: 24px; font-weight: 700; color: #333; }
.search-bar { position: relative; width: 100%; max-width: 600px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #d1d5db; pointer-events: none; }
#search-input { width: 100%; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px 100px 12px 40px; font-size: 14px; color: #333; outline: none; transition: border-color .2s; }
#search-input::placeholder { color: #d1d5db; }
#search-input:focus { border-color: #e85d2a; }
#search-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: #e85d2a; color: #fff; font-size: 12px; font-weight: 600; padding: 7px 16px; border-radius: 8px; transition: background .2s; }
#search-btn:hover { background: #c23f15; }
#no-results { font-size: 12px; color: #9ca3af; }

/* ── In-feed Banner ────────────────────────────────────── */
.infeed-banner { display: block; width: 100%; max-width: 600px; margin: 0 auto; text-decoration: none; border-radius: 14px; transition: transform .2s, box-shadow .2s; border: 1px solid #e5e7eb; }
.infeed-banner:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(74,222,128,.15); text-decoration: none; border-color: #fcd34d; }
.infeed-inner { background: linear-gradient(135deg, #fff7ed 0%, #ffffff 50%, #fff4e6 100%); border-radius: 14px; padding: 18px 24px; display: flex; align-items: center; justify-content: center; }
.infeed-text { text-align: center; }
.infeed-main { font-size: 14px; font-weight: 600; color: #333; line-height: 1.5; }
.infeed-sub { font-size: 13px; font-weight: 600; color: #c23f15; margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.infeed-arrow { display: inline-block; transition: transform .2s; }
.infeed-banner:hover .infeed-arrow { transform: translateX(4px); }

/* ── Guide ──────────────────────────────────────────────── */
#guide { padding: 16px 0; }
#guide h2 { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 20px; color: #333; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.guide-card { background: #fff; border: 1px solid #f3f4f6; border-radius: 16px; overflow: hidden; text-align: center; }
.guide-img { width: 100%; aspect-ratio: 4/3; position: relative; overflow: hidden; }
.guide-img img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.guide-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.guide-img-green .guide-fallback { background: linear-gradient(135deg, #fff7ed, #ffe8d3); }
.guide-img-rose .guide-fallback { background: linear-gradient(135deg, #fef2f2, #fecaca); }
.guide-img-blue .guide-fallback { background: linear-gradient(135deg, #eff6ff, #bfdbfe); }
.guide-img img + .guide-fallback { display: none; }
.guide-card h3 { font-size: 13px; font-weight: 700; color: #333; margin-top: 12px; }
.guide-card p { font-size: 11px; color: #9ca3af; line-height: 1.5; padding: 4px 16px 16px; }

/* ── Ad Box ─────────────────────────────────────────────── */
.ad-box { width: 100%; max-width: 600px; margin: 0 auto; height: 72px; background: #f9fafb; border: 1px dashed #e5e7eb; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #d1d5db; letter-spacing: 1px; }

/* ── Scene Nav ──────────────────────────────────────────── */
.scene-nav-bar { display: flex; align-items: center; justify-content: space-between; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 16px; padding: 10px 20px; }
.scene-btn { font-size: 13px; font-weight: 500; padding: 8px 16px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; transition: all .2s; }
.scene-btn:hover:not(:disabled) { border-color: #e85d2a; color: #c23f15; }
.scene-btn:disabled { opacity: .3; cursor: not-allowed; }
.scene-btn-green { background: #e85d2a; color: #fff; border-color: #e85d2a; }
.scene-btn-green:hover:not(:disabled) { background: #c23f15; color: #fff; }
.scene-counter { text-align: center; font-size: 13px; font-weight: 600; color: #333; }
.scene-counter .green { color: #c23f15; }
.scene-counter .dim { color: #d1d5db; margin: 0 4px; }
.scene-info { font-size: 11px; color: #9ca3af; margin-top: 2px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.free-limit { font-size: 11px; color: #9ca3af; text-align: center; margin-top: 8px; }

/* ── Player ─────────────────────────────────────────────── */
.player-section { display: flex; flex-direction: column; }
#player-container { width: 100%; aspect-ratio: 16/9; border-radius: 16px 16px 0 0; overflow: hidden; border: 1px solid #e5e7eb; border-bottom: none; background: #000; position: relative; }
#player-container iframe, #player-container > div { width: 100% !important; height: 100% !important; position: absolute; inset: 0; }
.player-hidden { opacity: 0; pointer-events: none; z-index: 0; }

/* ── Speed Control ─────────────────────────────────────── */
#speed-bar { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: #111; border-left: 1px solid #e5e7eb; border-right: 1px solid #e5e7eb; }
.speed-label { font-size: 11px; color: #9ca3af; margin-right: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.speed-btn { font-size: 12px; font-weight: 500; color: #9ca3af; background: #222; border: 1px solid #333; padding: 4px 10px; border-radius: 6px; transition: all .2s; }
.speed-btn:hover { color: #fff; border-color: #e85d2a; }
.speed-btn.active { background: #e85d2a; color: #fff; border-color: #e85d2a; }
.sync-sep { color: #4b5563; margin: 0 8px; }
.sync-btn { font-size: 11px; font-weight: 500; color: #9ca3af; background: #222; border: 1px solid #333; padding: 3px 8px; border-radius: 6px; transition: all .2s; font-family: monospace; cursor: pointer; }
.sync-btn:hover { color: #fcd34d; border-color: #fcd34d; }
.sync-tap { font-family: inherit; font-weight: 600; background: #7c2d12; color: #fff; border-color: #e85d2a; padding: 3px 12px; }
.sync-tap:hover { background: #e85d2a; color: #fff; border-color: #fcd34d; }
.sync-current { font-size: 11px; font-family: monospace; color: #fcd34d; min-width: 44px; text-align: center; font-weight: 600; }
/* Translation language selector: main button + tiny caret dropdown trigger */
.translate-selector { position: relative; display: inline-flex; align-items: stretch; gap: 2px; }
.translate-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: #92400e;
  background: #fffbeb; border: 2px solid #fcd34d;
  padding: 8px 16px; border-radius: 10px 2px 2px 10px; cursor: pointer;
  transition: all .2s;
  box-shadow: 0 1px 2px rgba(120,53,15,.08);
}
.translate-toggle:hover { background: #fef3c7; border-color: #f59e0b; box-shadow: 0 2px 6px rgba(120,53,15,.15); }
.translate-toggle .translate-flag { font-size: 18px; line-height: 1; }
.translate-toggle.active { background: #fcd34d; color: #78350f; border-color: #f59e0b; box-shadow: 0 2px 8px rgba(245,158,11,.25); }
.translate-toggle.active:hover { background: #f59e0b; color: #fff; border-color: #d97706; }
.translate-caret-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: #92400e;
  background: #fffbeb; border: 2px solid #fcd34d; border-left: none;
  padding: 0 8px; border-radius: 2px 10px 10px 2px; cursor: pointer;
  transition: all .2s; min-width: 28px;
}
.translate-caret-btn:hover { background: #fef3c7; border-color: #f59e0b; }
.translate-toggle.active + .translate-caret-btn { background: #fcd34d; color: #78350f; border-color: #f59e0b; }
.translate-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; z-index: 100;
  min-width: 180px; display: flex; flex-direction: column; gap: 2px;
}
.translate-menu button {
  display: flex; align-items: center; gap: 10px;
  text-align: left; padding: 8px 12px; border: none; background: transparent;
  border-radius: 8px; cursor: pointer; font-size: 13px; color: #333; font-weight: 500;
  font-family: inherit;
}
.translate-menu button:hover { background: #fff7ed; color: #c23f15; }
.translate-menu button.active { background: #fef3c7; color: #92400e; font-weight: 700; }
.translate-menu button span:first-child { font-size: 18px; width: 22px; text-align: center; }
/* Translation line: wrapped in parentheses via ::before/::after pseudos so the
   JS doesn't have to mutate text. Italic serif for the hand-written feel. */
.sub-translation {
  font-size: 16px; color: #9ca3af;
  font-style: italic; font-family: "Georgia", "Cambria", "Times New Roman", serif;
  line-height: 1.5; margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed #f3f4f6; text-align: center; min-height: 1.5em;
}
.sub-translation:not(:empty)::before { content: "("; margin-right: 2px; }
.sub-translation:not(:empty)::after  { content: ")"; margin-left: 2px; }
/* The lazy-fetch "…" placeholder shouldn't get parentheses — use a data flag. */
.sub-translation[data-state="loading"]::before,
.sub-translation[data-state="loading"]::after { content: ""; }

/* ── Subtitle Panel ─────────────────────────────────────── */
#subtitle-panel { background: #f9fafb; border: 1px solid #e5e7eb; border-top: none; border-radius: 0 0 16px 16px; padding: 20px 24px 16px; display: flex; flex-direction: column; gap: 12px; }
.sub-line { min-height: 1.4em; }
.sub-dim { font-size: 13px; color: #9ca3af; opacity: .5; }
.sub-main { font-size: 22px; font-weight: 700; color: #000; line-height: 1.4; }
.sub-placeholder { font-size: 14px; font-weight: 400; color: #d1d5db; }
.sub-hint { font-size: 11px; color: #d1d5db; text-align: center; margin-top: -6px; }
.sub-divider { height: 1px; background: #e5e7eb; }
.sub-controls { display: flex; align-items: center; justify-content: space-between; }
.sub-controls-left { display: flex; align-items: center; gap: 10px; }
.ctrl-btn { font-size: 12px; font-weight: 500; color: #333; background: #fff; border: 1px solid #e5e7eb; padding: 6px 12px; border-radius: 8px; transition: all .2s; }
.ctrl-btn:hover { border-color: #e85d2a; color: #c23f15; }
.ctrl-btn-sm { font-size: 12px; color: #9ca3af; transition: color .2s; }
.ctrl-btn-sm:hover { color: #333; }
.word { cursor: pointer; padding: 0 2px; margin: 0 -2px; border-radius: 3px; transition: all .15s; }
.word:hover { background: #e0f2fe; color: #0369a1; }
.word.highlight { color: #c23f15; font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ── Replay ─────────────────────────────────────────────── */
#replay-row { text-align: center; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.replay-btn { font-size: 16px; font-weight: 600; padding: 12px 32px; border: 2px solid #e85d2a; color: #c23f15; background: #fff7ed; border-radius: 16px; transition: all .2s; cursor: pointer; }
.replay-btn:hover { background: #e85d2a; color: #fff; box-shadow: 0 4px 12px rgba(232,93,42,.3); }
.continue-btn { border-color: #78350f; color: #78350f; background: #fef3c7; }
.continue-btn:hover { background: #78350f; color: #fff; box-shadow: 0 4px 12px rgba(120,53,15,.3); }

/* ── Shadowing ──────────────────────────────────────────── */
#shadowing-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; overflow: hidden; }
.shadow-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: #f9fafb; border-bottom: 1px solid #f3f4f6; font-size: 13px; font-weight: 700; color: #333; }
.shadow-reset { font-size: 11px; color: #9ca3af; }
#shadow-body { padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.shadow-sub { font-size: 12px; color: #9ca3af; font-style: italic; text-align: center; max-width: 400px; }
.shadow-record-btn { font-size: 16px; font-weight: 600; padding: 14px 32px; border-radius: 16px; background: linear-gradient(135deg, #ef4444, #f43f5e); color: #fff; transition: all .2s; }
.shadow-record-btn:hover { box-shadow: 0 4px 16px rgba(239,68,68,.3); }
.shadow-pro-note { font-size: 11px; color: #d1d5db; }
.shadow-timer { font-size: 28px; font-weight: 700; font-family: monospace; color: #ef4444; display: flex; align-items: center; gap: 10px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #ef4444; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.shadow-stop-btn { font-size: 14px; font-weight: 600; padding: 10px 24px; border-radius: 12px; background: #333; color: #fff; }
.shadow-stop-btn:hover { background: #000; }
.shadow-compare { display: flex; gap: 12px; width: 100%; max-width: 360px; }
.shadow-compare button { flex: 1; padding: 12px; border-radius: 12px; border: 2px solid; font-size: 13px; font-weight: 600; transition: all .2s; }
.shadow-compare .btn-original { border-color: #e85d2a; color: #c23f15; }
.shadow-compare .btn-original:hover { background: #fff7ed; }
.shadow-compare .btn-myvoice { border-color: #93c5fd; color: #3b82f6; }
.shadow-compare .btn-myvoice:hover { background: #eff6ff; }
.shadow-compare .btn-myvoice.playing { background: #eff6ff; border-color: #60a5fa; }
.shadow-again { font-size: 12px; color: #9ca3af; }
.shadow-again:hover { color: #c23f15; }

/* ── AI Analysis (Max) ──────────────────────────────────── */
.ai-analysis { border-top: 1px solid #f3f4f6; }
.ai-analysis-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: #fffbeb; font-size: 13px; font-weight: 700; color: #92400e; }
.max-badge { font-size: 11px; font-weight: 700; color: #d97706; background: #fef3c7; padding: 3px 8px; border-radius: 6px; border: 1px solid #fcd34d; }
.ai-analysis-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.ai-score { display: flex; align-items: center; gap: 12px; }
.ai-score-circle { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 900; }
.ai-score-high { background: #fff7ed; color: #b45309; border: 3px solid #e85d2a; }
.ai-score-mid { background: #fffbeb; color: #d97706; border: 3px solid #fbbf24; }
.ai-score-low { background: #fef2f2; color: #dc2626; border: 3px solid #f87171; }
.ai-score-text { flex: 1; }
.ai-score-label { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: 1px; }
.ai-score-value { font-size: 14px; font-weight: 600; color: #333; margin-top: 2px; }
.ai-transcript { font-size: 13px; color: #333; background: #f9fafb; padding: 10px 14px; border-radius: 10px; border: 1px solid #f3f4f6; line-height: 1.5; }
.ai-transcript-label { font-size: 11px; color: #9ca3af; margin-bottom: 4px; font-weight: 600; }
.ai-feedback { font-size: 13px; color: #6b7280; background: #fff7ed; padding: 10px 14px; border-radius: 10px; border: 1px solid #ffe8d3; line-height: 1.5; }
.ai-feedback-label { font-size: 11px; color: #c23f15; margin-bottom: 4px; font-weight: 600; }
.ai-quota { font-size: 11px; color: #9ca3af; text-align: center; padding-top: 8px; margin-top: 4px; border-top: 1px dashed #f3f4f6; }

/* Azure 4-score bars */
.az-scores { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.az-score-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.az-score-emoji { font-size: 14px; flex-shrink: 0; }
.az-score-name { width: 90px; color: #6b7280; font-weight: 500; flex-shrink: 0; }
.az-bar { flex: 1; height: 8px; background: #f3f4f6; border-radius: 99px; overflow: hidden; }
.az-bar-fill { height: 100%; border-radius: 99px; transition: width .6s; }
.bar-high { background: linear-gradient(90deg, #e85d2a, #c23f15); }
.bar-mid { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.bar-low { background: linear-gradient(90deg, #f87171, #ef4444); }
.az-score-num { width: 28px; text-align: right; font-weight: 700; color: #333; font-size: 13px; }

/* Phoneme / IPA annotations under words */
.w-ipa { display: block; font-size: 9px; font-weight: 500; line-height: 1.2; margin-top: 1px; }

/* History entry */
.history-entry { background: #f9fafb; border: 1px solid #f3f4f6; border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; transition: border-color .2s; }
.history-entry:hover { border-color: #e5e7eb; }
.history-word { font-weight: 700; font-size: 14px; color: #333; cursor: pointer; }
.history-word:hover { color: #c23f15; }
.history-time { font-size: 10px; color: #d1d5db; }
.history-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.history-actions button { font-size: 11px; padding: 4px 8px; border-radius: 6px; border: 1px solid #e5e7eb; background: #fff; color: #6b7280; transition: all .2s; }
.history-actions button:hover { border-color: #e85d2a; color: #c23f15; }
.history-actions .hdel:hover { border-color: #f87171; color: #ef4444; }

/* ── Reference vs Your-attempt comparison block ─────────────── */
.ai-compare { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; margin-bottom: 12px; }
.ai-line { padding: 14px 18px; border-radius: 12px; }
.ai-line-ref  { background: #fff7ed; border: 1px solid #bbf7d0; }
.ai-line-user { background: #fffbeb; border: 1px solid #fde68a; }
.ai-line-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.ai-line-ref .ai-line-label  { color: #b45309; }
.ai-line-user .ai-line-label { color: #b45309; }
.ai-line-text { font-size: 17px; line-height: 1.7; color: #1f2937; font-weight: 500; }

/* ── Word-level color coding (Your attempt line) ────────────── */
.ai-transcript .w-ok      { color: #b45309; }
.ai-transcript .w-unclear { color: #d97706; text-decoration: underline wavy #fbbf24; text-underline-offset: 3px; }
.ai-transcript .w-poor    { color: #dc2626; font-weight: 800; }  /* red + bold, no wavy */
.ai-transcript .w-missed  { color: #9ca3af; text-decoration: line-through; }
.ai-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 10px; padding: 6px 0; justify-content: center; }
.ai-legend .w-ok, .ai-legend .w-unclear, .ai-legend .w-poor, .ai-legend .w-missed { font-weight: 500; }
/* ── Stress indicator — dot (·) above the syllable that SHOULD
   carry stress. Distinct from arrow (which would conflate stress
   with intonation direction). ─────────────────────────────────── */
.ai-transcript { padding-top: 18px; /* room for the stress dot */ }
.syl-stress { position: relative; display: inline-block; }
.syl-stress::before {
  content: "\00B7"; /* · */
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 32px;
  font-weight: 900;
  color: #f97316;
  line-height: 1;
  pointer-events: none;
}
/* Legend entry for the stress dot */
.ai-legend .w-stress-legend { color: #f97316; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.ai-legend .w-stress-legend .legend-dot { font-size: 22px; line-height: 0; position: relative; top: -3px; font-weight: 900; }

/* ── Pronunciation Tips — minimal one-line entries ─────── */
.ai-tips { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.tip-line { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #f3f4f6; }
.tip-line:last-child { border-bottom: none; }
.tip-word { font-size: 15px; font-weight: 800; color: #dc2626; min-width: 90px; }
.tip-msg  { font-size: 13px; color: #6b7280; }

/* Header upgrade buttons (Pro & Max) */
.upgrade-nav-pro { background: #fff7ed; color: #b45309; border: 1px solid #fcd34d; font-weight: 600; }
.upgrade-nav-pro:hover { background: #ffe8d3; border-color: #e85d2a; }
.upgrade-nav-max { background: linear-gradient(90deg, #fef3c7, #fde68a); color: #b45309; border: 1px solid #fcd34d; font-weight: 700; }
.upgrade-nav-max:hover { background: linear-gradient(90deg, #fde68a, #fcd34d); }

/* Paywall reason message inside upgrade modal */
.upgrade-reason { background: #fffbeb; color: #b45309; border: 1px solid #fcd34d; border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 600; text-align: center; margin: 0 0 12px; }

/* Study by Level ─────────────────────────────────── */
#study-level { background: #fff; border: 1px solid #f3f4f6; border-radius: 20px; padding: 24px; margin-bottom: 24px; }
#study-level h2 { font-size: 18px; font-weight: 700; color: #333; margin: 0 0 4px; }
.study-level-sub { font-size: 12px; color: #9ca3af; margin: 0 0 16px; }
.level-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.level-tab { flex: 1; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 12px; background: #f9fafb; font-size: 13px; font-weight: 600; color: #6b7280; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.level-tab:hover { border-color: #e85d2a; color: #c23f15; background: #fff7ed; }
.level-tab.active { background: #c23f15; color: #fff; border-color: #c23f15; }
.level-tab .lvl-count { background: rgba(255,255,255,0.25); color: inherit; font-size: 10px; padding: 2px 6px; border-radius: 999px; font-weight: 700; }
.level-tab:not(.active) .lvl-count { background: #e5e7eb; color: #6b7280; }
.level-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; max-height: 480px; overflow-y: auto; padding-right: 4px; }
.level-item { background: #f9fafb; border: 1px solid #f3f4f6; border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: all .2s; }
.level-item:hover { border-color: #e85d2a; background: #fff7ed; transform: translateY(-1px); }
.level-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.level-item-num { font-size: 10px; font-weight: 700; color: #d1d5db; min-width: 18px; }
.level-item-phrase { font-size: 14px; font-weight: 700; color: #333; flex: 1; }
.level-item-count { font-size: 10px; color: #c23f15; background: #ffe8d3; padding: 2px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.level-item-preview { font-size: 11px; color: #6b7280; line-height: 1.4; font-style: italic; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.level-empty { text-align: center; color: #9ca3af; font-size: 13px; padding: 32px; grid-column: 1 / -1; }

/* ── Auth Gate (full-screen) ──────────────────────────────── */
body.auth-locked { overflow: hidden; }
body.auth-locked #header, body.auth-locked #main { filter: blur(4px); pointer-events: none; user-select: none; }
.auth-gate { position: fixed; inset: 0; z-index: 9999; background: linear-gradient(135deg, #fff7ed 0%, #ffffff 50%, #eff6ff 100%); display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.auth-gate.hidden { display: none; }
.auth-card { background: #fff; border-radius: 24px; box-shadow: 0 24px 64px rgba(0,0,0,0.12); padding: 32px 28px; width: 100%; max-width: 400px; border: 1px solid #f3f4f6; }
.auth-header { text-align: center; margin-bottom: 20px; }
.auth-header .logo { font-size: 26px; font-weight: 800; color: #333; }
.auth-sub { font-size: 13px; color: #6b7280; margin: 6px 0 0; }
/* Google Sign-In button */
.google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; background: #fff; color: #333; border: 1px solid #e5e7eb; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s; margin-top: 4px; }
.google-btn:hover { background: #f9fafb; border-color: #d1d5db; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.google-btn .google-icon { flex-shrink: 0; }

/* Profile Setup (shown once after first Google sign-in) */
.profile-setup { position: fixed; inset: 0; z-index: 10000; background: linear-gradient(135deg, #fff7ed 0%, #ffffff 50%, #eff6ff 100%); display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.profile-setup.hidden { display: none; }
.profile-setup .auth-card { max-width: 420px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-field { display: flex; flex-direction: column; gap: 4px; }
.auth-field label { font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }
.auth-field input, .auth-field select { padding: 11px 14px; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 14px; background: #fff; transition: border-color .2s; }
.auth-field input:focus, .auth-field select:focus { outline: none; border-color: #e85d2a; box-shadow: 0 0 0 3px #ffe8d3; }
body[data-auth-mode="login"] .signup-only { display: none; }
.auth-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; border-radius: 10px; padding: 10px 14px; font-size: 12px; margin: 0; }
.auth-error.hidden { display: none; }
.auth-submit { padding: 14px; background: #c23f15; color: #fff; border: none; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .2s; margin-top: 4px; }
.auth-submit:hover { background: #b45309; }
.auth-note { text-align: center; font-size: 11px; color: #9ca3af; margin: 16px 0 0; }

/* ── Account Modal ────────────────────────────────────────── */
.account-info { background: #f9fafb; border-radius: 12px; padding: 12px 16px; margin: 12px 0; border: 1px solid #f3f4f6; }
.acct-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.acct-row + .acct-row { border-top: 1px solid #f3f4f6; }
.acct-key { color: #9ca3af; font-weight: 500; }
.acct-val { color: #333; font-weight: 600; }
.plan-pill { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.plan-pill.plan-free { background: #f3f4f6; color: #6b7280; }
.plan-pill.plan-pro  { background: #ffe8d3; color: #b45309; }
.plan-pill.plan-max  { background: linear-gradient(90deg, #fef3c7, #fde68a); color: #b45309; }
.account-section { margin: 16px 0; text-align: left; }
.account-label { display: block; font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
#promo-input { width: 100%; padding: 11px 14px; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 14px; margin-bottom: 10px; }
#promo-input:focus { outline: none; border-color: #e85d2a; box-shadow: 0 0 0 3px #ffe8d3; }
.promo-msg { font-size: 12px; margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; }
.promo-msg.ok  { background: #fff7ed; color: #b45309; border: 1px solid #fcd34d; }
.promo-msg.err { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.promo-msg.hidden { display: none; }
.account-btn { background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; }
.account-btn:hover { background: #e0f2fe; }
#btn-logout { margin-top: 8px; }
.ai-loading { text-align: center; color: #9ca3af; font-size: 13px; padding: 16px; }
.ai-lock { text-align: center; padding: 20px; }
.ai-lock-icon { font-size: 28px; margin-bottom: 8px; }
.ai-lock-text { font-size: 13px; color: #9ca3af; margin-bottom: 10px; }
.ai-lock-btn { font-size: 12px; font-weight: 600; color: #d97706; background: #fffbeb; border: 1px solid #fcd34d; padding: 6px 16px; border-radius: 8px; transition: all .2s; }
.ai-lock-btn:hover { background: #fef3c7; }

/* ── Pro Space ──────────────────────────────────────────── */
#pro-space { width: 300px; flex-shrink: 0; border-radius: 16px; border: 1px solid #e5e7eb; overflow: hidden; }
.pro-space-header { padding: 28px 24px; color: #fff; display: flex; flex-direction: column; gap: 10px; }
.pro-space-header.free { background: linear-gradient(135deg, #111827, #1f2937); }
.pro-space-header.active { background: linear-gradient(135deg, #7c2d12, #92400e); }
.pro-space-header.max-active { background: linear-gradient(135deg, #78350f, #92400e); }
.pro-badge { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #e85d2a; display: flex; align-items: center; gap: 6px; }
.pro-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #e85d2a; animation: pulse 2s infinite; }
.pro-badge-max { color: #fbbf24; }
.pro-badge-max .dot { background: #fbbf24; }
.pro-space-header h3 { font-size: 17px; font-weight: 700; }
.pro-space-header p { font-size: 13px; color: #9ca3af; }
.pro-space-header.active p { color: rgba(167,243,208,.7); }
.pro-space-header.max-active p { color: rgba(253,230,138,.7); }
.pro-features { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; background: #f9fafb; }
.pro-features.active-bg { background: #fff7ed; }
.pro-features.max-bg { background: #fffbeb; }
.pro-feat { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: #333; }
.pro-feat span:first-child { font-size: 16px; flex-shrink: 0; }
.pro-cta-area { padding: 20px 24px; background: #fff; border-top: 1px solid #f3f4f6; }
.cta-btn { display: block; width: 100%; text-align: center; padding: 12px; border-radius: 12px; font-size: 14px; font-weight: 600; background: linear-gradient(135deg, #e85d2a, #c23f15); color: #fff; transition: all .2s; border: none; cursor: pointer; }
.cta-btn:hover { box-shadow: 0 4px 16px rgba(74,222,128,.3); }
.pro-note { font-size: 11px; color: #9ca3af; text-align: center; margin-top: 10px; }
.plan-mini-list { padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fafafa; }
.plan-mini { position: relative; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.plan-mini-max { border-color: #fcd34d; background: linear-gradient(135deg, #fffdf5, #fef9e7); }
.plan-mini-badge { position: absolute; top: -8px; right: 12px; font-size: 9px; font-weight: 700; letter-spacing: .5px; background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; padding: 2px 8px; border-radius: 99px; }
.plan-mini-top { display: flex; align-items: baseline; justify-content: space-between; }
.plan-mini-name { font-size: 14px; font-weight: 800; }
.plan-mini-name-pro { color: #c23f15; }
.plan-mini-name-max { color: #d97706; }
.plan-mini-price { font-size: 16px; font-weight: 800; color: #333; }
.plan-mini-price span { font-size: 11px; font-weight: 500; color: #9ca3af; }
.plan-mini-desc { font-size: 11px; color: #6b7280; line-height: 1.4; }
.plan-mini-btn { margin-top: 6px; padding: 8px; border-radius: 8px; font-size: 12px; font-weight: 600; border: none; cursor: pointer; transition: all .2s; }
.plan-mini-btn-pro { background: #c23f15; color: #fff; }
.plan-mini-btn-pro:hover { background: #b45309; }
.plan-mini-btn-max { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.plan-mini-btn-max:hover { box-shadow: 0 4px 10px rgba(245,158,11,.3); }
.plan-mini-note { font-size: 11px; color: #9ca3af; text-align: center; padding: 12px 16px 16px; background: #fafafa; }
.vocab-shortcut { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.vocab-shortcut span { font-size: 13px; font-weight: 500; color: #333; display: flex; align-items: center; gap: 6px; }
.vocab-badge { font-size: 11px; color: #c23f15; font-weight: 600; background: #fff; padding: 2px 8px; border-radius: 99px; border: 1px solid #fcd34d; }
.vocab-open-btn { width: 100%; padding: 10px; border-radius: 12px; border: 1px solid #fcd34d; color: #c23f15; font-weight: 600; font-size: 13px; background: #fff; transition: all .2s; }
.vocab-open-btn:hover { background: #fff7ed; }

/* ── Modals ─────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.35); backdrop-filter: blur(4px); }
.modal-card { background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.15); max-width: 420px; width: calc(100% - 32px); overflow: hidden; }
.modal-accent { height: 5px; background: linear-gradient(90deg, #e85d2a, #fbbf24); }
.modal-body { padding: 32px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.modal-body h2 { font-size: 20px; font-weight: 700; color: #333; }
.modal-body p { font-size: 13px; color: #6b7280; line-height: 1.6; }
.modal-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.green-circle { background: linear-gradient(135deg, #e85d2a, #c23f15); box-shadow: 0 8px 24px rgba(74,222,128,.3); color: #fff; }
.modal-desc { font-size: 13px; color: #6b7280; }
.trial-note { font-size: 11px; color: #9ca3af; }
.dismiss-btn { font-size: 12px; color: #9ca3af; transition: color .2s; }
.dismiss-btn:hover { color: #6b7280; }
.close-btn { font-size: 22px; color: #d1d5db; line-height: 1; transition: color .2s; }
.close-btn:hover { color: #6b7280; }

/* ── Upgrade Modal (Pro vs Max) ─────────────────────────── */
.upgrade-card { max-width: 640px; }
.upgrade-body { padding: 28px; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; margin: 8px 0; }
.plan-card { border: 2px solid #e5e7eb; border-radius: 16px; padding: 24px 20px; display: flex; flex-direction: column; gap: 16px; position: relative; transition: border-color .2s; }
.plan-card:hover { border-color: #d1d5db; }
.plan-card-max { border-color: #fbbf24; background: #fffdf5; }
.plan-card-max:hover { border-color: #f59e0b; }
.plan-popular { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; padding: 3px 12px; border-radius: 99px; }
.plan-header-pro, .plan-header-max { text-align: center; }
.plan-badge-pro { font-size: 14px; font-weight: 800; color: #c23f15; }
.plan-badge-max { font-size: 14px; font-weight: 800; color: #d97706; }
.plan-price { margin-top: 4px; }
.plan-price .price { font-size: 28px; font-weight: 900; color: #333; }
.plan-price .price-period { font-size: 13px; color: #9ca3af; }
.plan-features { display: flex; flex-direction: column; gap: 6px; }
.plan-feat { font-size: 12px; color: #333; display: flex; align-items: center; gap: 6px; }
.plan-feat-locked { color: #d1d5db; }
.plan-cta { width: 100%; padding: 10px; border-radius: 10px; font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: all .2s; }
.plan-cta-pro { background: #c23f15; color: #fff; }
.plan-cta-pro:hover { background: #b45309; box-shadow: 0 4px 12px rgba(34,197,94,.3); }
.plan-cta-max { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.plan-cta-max:hover { box-shadow: 0 4px 12px rgba(245,158,11,.3); }

/* ── Slide Panel ────────────────────────────────────────── */
.slide-panel { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; background: rgba(0,0,0,.25); backdrop-filter: blur(4px); }
.slide-panel-inner { width: 100%; max-width: 400px; height: 100%; background: #fff; box-shadow: -8px 0 30px rgba(0,0,0,.1); display: flex; flex-direction: column; }
.panel-header { padding: 20px 24px; border-bottom: 1px solid #f3f4f6; display: flex; align-items: center; justify-content: space-between; }
.panel-header h2 { font-size: 17px; font-weight: 700; color: #333; }
.panel-header p { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.vocab-list { flex: 1; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.vocab-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #9ca3af; font-size: 13px; text-align: center; padding: 40px; }
.vocab-entry { background: #f9fafb; border: 1px solid #f3f4f6; border-radius: 12px; padding: 12px 16px; position: relative; transition: border-color .2s; }
.vocab-entry:hover { border-color: #e5e7eb; }
.vocab-entry .vw { font-weight: 700; font-size: 13px; color: #333; }
.vocab-entry .vd { font-size: 12px; color: #6b7280; margin-top: 4px; }
.vocab-entry .vs { font-size: 11px; color: #9ca3af; font-style: italic; margin-top: 6px; padding-left: 8px; border-left: 2px solid #e5e7eb; }
.vocab-entry .vdel { position: absolute; top: 12px; right: 12px; font-size: 14px; color: #d1d5db; opacity: 0; transition: all .2s; }
.vocab-entry:hover .vdel { opacity: 1; }
.vocab-entry .vdel:hover { color: #ef4444; }

/* ── Word Tooltip ───────────────────────────────────────── */
.tooltip-card { background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.15); max-width: 480px; width: calc(100% - 32px); overflow: hidden; max-height: 80vh; overflow-y: auto; }
.tooltip-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 20px 10px; gap: 8px; }
.tooltip-header-right { display: flex; align-items: center; gap: 8px; }
.def-lang-select { font-size: 11px; font-weight: 500; color: #0369a1; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 4px 8px; cursor: pointer; font-family: inherit; max-width: 140px; }
.def-lang-select:hover { border-color: #0284c7; background: #e0f2fe; }

/* Native-language dictionary block (below English definition) */
.tt-native { padding: 12px 20px; background: #f0f9ff; border-top: 1px solid #bae6fd; border-bottom: 1px solid #bae6fd; margin: 8px 0 0; }
.tt-native.hidden { display: none; }
.nd-header { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: #0284c7; margin-bottom: 10px; }
.nd-loading, .nd-empty { font-size: 12px; color: #64748b; font-style: italic; }
.nd-block { margin-bottom: 12px; }
.nd-block:last-child { margin-bottom: 0; }
.nd-pos { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #0284c7; background: #e0f2fe; padding: 2px 8px; border-radius: 4px; margin-bottom: 4px; }
.nd-subpos { display: block; font-size: 11px; font-style: italic; color: #64748b; margin: 2px 0 4px; }
.nd-def { font-size: 13px; color: #1a1a1a; line-height: 1.5; margin: 2px 0; padding-left: 2px; }
.nd-def .nd-num { color: #0284c7; font-weight: 600; margin-right: 4px; }
.nd-example { font-size: 12px; color: #64748b; font-style: italic; border-left: 2px solid #bae6fd; padding-left: 10px; margin-top: 6px; }

/* Vocab panel — show native dict content too */
.vn-wrap { margin: 6px 0; padding: 8px 10px; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; }
.vn-lang { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.1px; color: #0284c7; margin-bottom: 4px; }
.vn-block { margin-bottom: 4px; }
.vn-block:last-child { margin-bottom: 0; }
.vn-pos { display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: #0284c7; background: #e0f2fe; padding: 1px 6px; border-radius: 3px; margin-right: 4px; }
.vn-subpos { font-size: 10px; font-style: italic; color: #64748b; margin-right: 4px; }
.vn-def { font-size: 11px; color: #1a1a1a; line-height: 1.4; margin: 1px 0; padding-left: 2px; }

.tooltip-header h3 { font-size: 20px; font-weight: 700; color: #333; }
.tt-phonetic { font-size: 13px; color: #9ca3af; margin-top: 2px; }
.tt-body { padding: 0 20px 12px; }
.tt-pos { display: inline-block; font-size: 11px; font-weight: 600; color: #c23f15; background: #fff7ed; padding: 2px 8px; border-radius: 4px; margin-bottom: 6px; }
.tt-def { font-size: 13px; color: #333; line-height: 1.5; }
.tt-example { font-size: 12px; color: #9ca3af; font-style: italic; border-left: 2px solid #e5e7eb; padding-left: 10px; margin-top: 6px; }
.tt-def-secondary { font-size: 12px; color: #6b7280; line-height: 1.4; margin-top: 6px; padding-top: 6px; border-top: 1px dashed #f3f4f6; }
.tt-pos-small { display: inline-block; font-size: 10px; font-weight: 600; color: #9ca3af; background: #f9fafb; padding: 1px 6px; border-radius: 3px; margin-right: 6px; }
.tt-idiom { padding: 12px 20px; background: #fffbeb; border-top: 1px solid #fef3c7; border-bottom: 1px solid #fef3c7; }
.tt-idiom-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #d97706; margin-bottom: 6px; }
.tt-idiom-phrase { font-size: 15px; font-weight: 700; color: #92400e; }
.tt-idiom-used { font-size: 11px; color: #a16207; margin-top: 2px; font-style: italic; }
.tt-idiom-used span { font-weight: 600; }
.tt-idiom-def { font-size: 13px; color: #78350f; margin-top: 6px; line-height: 1.5; }
.tt-context { padding: 10px 20px; border-top: 1px solid #f3f4f6; font-size: 11px; color: #9ca3af; }
.tt-save-row { display: flex; gap: 8px; padding: 12px 20px 20px; }
.tt-save-row .cta-btn { flex: 1; font-size: 13px; padding: 10px; }
.tt-save.saved { background: #fff7ed; color: #c23f15; border: 1px solid #fcd34d; }
.tt-save-idiom { background: linear-gradient(135deg, #f59e0b, #d97706); }
.tt-save-idiom:hover { box-shadow: 0 4px 16px rgba(245,158,11,.3); }

/* ── Quiz ───────────────────────────────────────────────── */
.quiz-card { max-width: 480px; }
.quiz-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #f3f4f6; }
.quiz-header-left { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: #333; }
.quiz-counter { font-size: 12px; color: #9ca3af; font-family: monospace; }
.quiz-progress { height: 3px; background: #f3f4f6; }
.quiz-progress-bar { height: 100%; background: #e85d2a; transition: width .4s; }
.quiz-body { padding: 32px; text-align: center; }
.quiz-prompt { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
.quiz-word { font-size: 30px; font-weight: 900; color: #333; margin-bottom: 24px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.quiz-opt { width: 100%; padding: 14px 20px; border: 2px solid #e5e7eb; border-radius: 12px; font-size: 13px; font-weight: 500; color: #333; background: #fff; transition: all .2s; }
.quiz-opt:hover:not(:disabled) { border-color: #e85d2a; background: #fff7ed; }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.correct { background: #fff7ed; border-color: #e85d2a; color: #b45309; }
.quiz-opt.wrong { background: #fef2f2; border-color: #fca5a5; color: #ef4444; }
.quiz-opt.faded { background: #f9fafb; border-color: #f3f4f6; color: #d1d5db; }
.quiz-opt .opt-label { font-size: 11px; color: #d1d5db; font-family: monospace; margin-right: 6px; }
.quiz-result { padding: 48px 32px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.quiz-score { font-size: 40px; font-weight: 900; color: #c23f15; }
.quiz-result h2 { font-size: 20px; font-weight: 700; color: #333; }
.quiz-result p { font-size: 13px; color: #6b7280; }
.quiz-actions { display: flex; gap: 10px; margin-top: 8px; }
.quiz-actions .cta-btn { padding: 10px 24px; font-size: 13px; width: auto; }
.btn-outline { background: #fff; color: #333; border: 1px solid #e5e7eb; padding: 10px 24px; border-radius: 12px; font-size: 13px; font-weight: 600; transition: all .2s; }
.btn-outline:hover { background: #f9fafb; }

/* ── Legal Modals ───────────────────────────────────────── */
.legal-card { max-width: 600px; max-height: 85vh; display: flex; flex-direction: column; }
.legal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid #f3f4f6; flex-shrink: 0; }
.legal-header h2 { font-size: 18px; font-weight: 700; color: #333; }
.legal-body { padding: 20px 24px; overflow-y: auto; font-size: 13px; color: #4b5563; line-height: 1.7; }
.legal-body h3 { font-size: 14px; font-weight: 700; color: #333; margin: 16px 0 6px; }
.legal-body p { margin-bottom: 8px; }
.legal-body ul { margin: 6px 0 10px 20px; }
.legal-body li { margin-bottom: 4px; }
footer a { color: #9ca3af; text-decoration: none; transition: color .2s; }
footer a:hover { color: #c23f15; text-decoration: underline; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  #main { flex-direction: column; }
  #pro-space { width: 100%; }
  .guide-grid { grid-template-columns: 1fr; }
  .tagline { display: none; }
  .infeed-inner { padding: 14px 16px; }
  .infeed-main { font-size: 13px; }
  .plan-grid { grid-template-columns: 1fr; }
}
