:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-alt: #eef4f1;
  --text: #1a221f;
  --muted: #5f6b66;
  --line: #d5ddd7;
  --accent: #0f766e;
  --accent-dark: #0c5c56;
  --gold: #b7791f;
  --hot: #ff5a36;
  --hot-soft: #ff9f1c;
  --red: #b83b3b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 28px rgba(26, 34, 31, 0.07);
  --shadow-hover: 0 16px 36px rgba(26, 34, 31, 0.12);
  --focus-ring: 0 0 0 3px rgba(15, 118, 110, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(15, 118, 110, 0.06), transparent 32%),
    radial-gradient(circle at 92% 8%, rgba(255, 159, 28, 0.07), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 44px min(5vw, 56px) 30px;
  background:
    radial-gradient(circle at 18% 20%, rgba(15, 118, 110, 0.35), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(255, 159, 28, 0.18), transparent 36%),
    linear-gradient(145deg, #1a2825 0%, #22312e 48%, #1b221f 100%);
  color: #fff;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.header-top .eyebrow {
  margin-bottom: 0;
}

.lang-toggle {
  display: inline-flex;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.lang-toggle button {
  appearance: none;
  margin: 0;
  border: 0;
  background: transparent;
  color: #d9e7e2;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.lang-toggle button.active,
.lang-toggle button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.vocab-gloss-label {
  margin: 0 0 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 10px;
  color: #b6ddd5;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.intro {
  max-width: 720px;
  margin-bottom: 0;
  color: #d9e7e2;
  font-size: 1.05rem;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 10px;
  min-width: 420px;
}

.summary div {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.summary strong {
  display: block;
  font-size: 1.8rem;
}

.summary span {
  color: #d9e7e2;
  font-size: 0.9rem;
}

main {
  padding: 28px min(5vw, 56px) 40px;
}

.toolbar,
.panel,
.nudge-panel,
.session-flow,
.prefs-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  padding: 18px;
  margin-bottom: 20px;
}

.prefs-panel {
  display: grid;
  grid-template-columns: minmax(200px, 0.4fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.prefs-panel h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.prefs-panel p {
  margin: 0 0 6px;
  color: var(--muted);
}

.prefs-controls {
  display: grid;
  gap: 14px;
}

.prefs-group {
  display: grid;
  gap: 8px;
}

.prefs-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.prefs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pref-chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.pref-chip.active {
  border-color: var(--accent);
  background: #e7f6f2;
  color: var(--accent-dark);
  font-weight: 700;
}

.pref-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.pref-chip:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.nudge-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  padding: 18px;
  border-color: rgba(15, 118, 110, 0.28);
  background: #f4fbf8;
}

.nudge-panel h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.nudge-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.session-flow {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  padding: 18px;
}

.session-flow h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.session-flow p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-steps li {
  position: relative;
}

.flow-steps button {
  display: grid;
  width: 100%;
  min-height: 70px;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 8px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-alt);
}

.flow-steps span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.flow-steps li.done button {
  border-color: rgba(15, 118, 110, 0.35);
  background: #f4fbf8;
  color: var(--accent-dark);
}

.flow-steps li.current button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.flow-steps li.current span {
  color: var(--accent);
}

.nudge-actions,
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.cta-note {
  color: var(--muted);
  font-size: 0.86rem;
}

.primary-action {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent) 0%, #14968c 100%);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 16px;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.primary-action:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.28);
}

.primary-action:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), 0 8px 18px rgba(15, 118, 110, 0.22);
}

.search-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.panel {
  padding: 18px;
}

.collapsible-panel > summary {
  cursor: pointer;
  list-style: none;
}

.collapsible-panel > summary::-webkit-details-marker,
.detail-block > summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel > summary::after {
  content: "펼치기";
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--accent-dark);
  background: var(--surface-alt);
  font-size: 0.78rem;
  font-weight: 700;
}

.collapsible-panel[open] > summary::after {
  content: "접기";
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  margin-bottom: 16px;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 14px;
}

.section-title h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.vocab-card {
  display: grid;
  gap: 10px;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 15px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.vocab-card:hover,
.vocab-card.selected {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.vocab-card.selected {
  background: linear-gradient(180deg, #f3fbf9 0%, #fff 50%);
}

.vocab-card.complete {
  background: #fbfffd;
  border-color: rgba(15, 118, 110, 0.28);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface-alt);
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.tag.success {
  background: #e7f7ef;
  color: #11613c;
}

.tag.progress {
  background: #e8f1ff;
  color: #1f4f86;
}

.tag.danger {
  background: #fff1f1;
  color: var(--red);
}

.word {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

.romanization {
  margin: 2px 0 0;
  color: var(--gold);
  font-family: "Segoe UI", Consolas, monospace;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.detail-hero .romanization {
  font-size: 1rem;
}

.search-box {
  display: grid;
  gap: 6px;
}

.search-hint {
  margin: 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.85rem;
}

.mission-phrase-list li strong {
  color: var(--accent-dark);
}

.quote-grid,
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.quote-card,
.chart-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quote-card.compact,
.chart-card.inline {
  box-shadow: none;
  background: var(--surface-alt);
}

.quote-card.complete,
.chart-card.complete {
  border-color: rgba(15, 118, 110, 0.35);
}

.quote-card blockquote {
  margin: 0;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-size: 0.95rem;
}

.quote-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 8px 0 4px;
}

.inline-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

#quote-rating-filter {
  min-height: 40px;
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  background: #fff;
  color: var(--text);
}

.danger-action {
  border-color: rgba(184, 59, 59, 0.35);
  background: #fff7f7;
  color: var(--red);
}

.danger-action:hover {
  background: #ffecec;
}

.panel-actions-note {
  margin: 0;
  flex: 1 1 100%;
}

.review-card .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.quiz-card.retry-pending {
  border-color: rgba(183, 121, 31, 0.45);
  box-shadow: 0 0 0 1px rgba(183, 121, 31, 0.12);
}

.badge[data-review-word] {
  cursor: pointer;
}

.badge[data-review-word]:hover {
  outline: 2px solid var(--accent);
}

.spotlight-card {
  border-color: rgba(183, 121, 31, 0.45);
  background: linear-gradient(165deg, #fff7e6 0%, #ffffff 55%);
  box-shadow: 0 14px 36px rgba(183, 121, 31, 0.12);
}

.featured-spotlight {
  border-width: 2px;
  border-color: rgba(255, 90, 54, 0.4);
  transform: none;
  min-height: 100%;
}

.featured-spotlight h3 {
  font-size: 1.32rem;
  letter-spacing: -0.01em;
}

.hot-badge,
.hot-tag {
  display: inline-block;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5a36, #ff9f1c);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hot-badge.pulse {
  animation: hotPulse 1.6s ease-in-out infinite;
}

@keyframes hotPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 90, 54, 0.45);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 90, 54, 0);
  }
}

.hot-chip.active {
  border-color: #ff5a36;
  background: #fff1ea;
  color: #b83b00;
}

.domain-filter-row {
  margin: 10px 0 6px;
}

.now-trending {
  margin: 0 0 14px;
  padding: 0;
}

.trending-hero {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 159, 28, 0.4), transparent 40%),
    radial-gradient(circle at 88% 10%, rgba(15, 118, 110, 0.38), transparent 42%),
    linear-gradient(135deg, #1a2421 0%, #0f3d38 55%, #1b1712 100%);
  color: #fff;
  box-shadow: 0 22px 48px rgba(15, 23, 20, 0.32);
}

.trending-copy h2 {
  margin: 8px 0 8px;
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  line-height: 1.12;
}

.trending-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  max-width: 52rem;
  font-size: 1.02rem;
}

.trending-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
}

.trending-card {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.trending-card:hover,
.trending-card:focus-visible {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  outline: none;
}

.trending-rank {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffd28a;
}

.trending-title {
  font-weight: 800;
  font-size: 1.08rem;
}

.trending-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.3;
}

.trending-cta {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #9ef0d7;
}

.spotlight-panel {
  margin: 0 0 16px;
  padding: 20px;
  border: 2px solid rgba(255, 90, 54, 0.32);
  background: linear-gradient(180deg, #fff8f1 0%, #ffffff 42%);
  box-shadow: 0 12px 32px rgba(255, 90, 54, 0.08);
}

.spotlight-title-row h2 {
  margin: 6px 0 4px;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
}

.spotlight-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.spotlight-grid > .meta {
  grid-column: 1 / -1;
}

.spotlight-sub {
  font-weight: 700;
  color: #b7791f;
}

/* Side-by-side latest K-pop + K-movie under spotlight */
.latest-media-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 0 22px;
  align-items: start;
}

.latest-media-row > .media-panel {
  margin: 0;
  min-width: 0;
}

.media-panel .chart-grid,
.media-panel .quote-grid {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

@media (max-width: 920px) {
  .latest-media-row {
    grid-template-columns: 1fr;
  }
}

.meta,
.body-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.detail {
  display: grid;
  gap: 16px;
}

.detail-hero {
  display: grid;
  gap: 12px;
}

.session-hint {
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 12px;
  background: linear-gradient(90deg, #eef9f6 0%, #f7fbfa 100%);
  color: var(--accent-dark);
  font-size: 0.92rem;
}

.detail h3 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.detail-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

#culture-step {
  margin-top: 4px;
  padding: 14px 14px 16px;
  border: 1px solid rgba(255, 90, 54, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffaf5 0%, #ffffff 55%);
  box-shadow: 0 10px 24px rgba(183, 121, 31, 0.06);
}

#culture-step > summary {
  font-weight: 800;
  color: #9a4b12;
}

.detail-block > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 800;
}

.detail-block > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--accent-dark);
}

.detail-block[open] > summary::after {
  content: "-";
}

.detail-block h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.phrase-list,
.plain-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.phrase-list li,
.plain-list li {
  border-radius: 6px;
  background: var(--surface-alt);
  padding: 10px;
}

.signal {
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  background: #fff8e8;
  color: #4b3820;
}

.risk {
  border-left-color: var(--red);
  background: #fff1f1;
}

.api-panel {
  margin-top: 20px;
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.api-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.api-status div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-alt);
}

.api-status strong {
  display: block;
  font-size: 1.1rem;
}

.api-status span {
  color: var(--muted);
  font-size: 0.84rem;
}

.target-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.target-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.target-card p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.place-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.place-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.story-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.activity-card,
.quiz-card,
.review-card,
.reading-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.activity-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.quiz-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.quiz-card.answered-correct {
  border-color: rgba(15, 118, 110, 0.45);
  background: #fbfffd;
}

.quiz-card.answered-incorrect {
  border-color: rgba(184, 59, 59, 0.35);
  background: #fffafa;
}

.review-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.reading-card {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  background: #f9fbfa;
}

.reading-card.complete {
  border-color: rgba(15, 118, 110, 0.35);
  background: #fbfffd;
}

.place-card img,
.story-card img,
.image-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface-alt);
}

.image-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.place-card div:last-child {
  padding: 14px;
}

.story-card div:last-child {
  padding: 14px;
}

.place-card h3 {
  margin: 8px 0 6px;
  font-size: 1.08rem;
}

.story-card h3,
.story-card h5 {
  margin: 8px 0;
  font-size: 1.02rem;
}

.story-card h5 {
  font-size: 0.98rem;
}

.place-card p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.story-card p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.activity-card h3,
.quiz-card h5,
.review-card h3 {
  margin: 0;
  font-size: 1rem;
}

.quiz-card p,
.review-card p,
.reading-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 999px;
  padding: 7px 10px;
  background: #e7f7ef;
  color: #11613c;
  font-size: 0.88rem;
  font-weight: 700;
}

.expression-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.expression-list li {
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 9px 10px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.9rem;
}

.expression-list span {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quiz-options button.correct {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.quiz-options button.incorrect {
  border-color: var(--red);
  background: #fff1f1;
  color: var(--red);
}

.quiz-feedback {
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff8e8;
  color: #4b3820;
}

audio {
  width: 100%;
  min-height: 36px;
  margin: 6px 0 8px;
}

.story-stack {
  display: grid;
  gap: 10px;
}

.story-card.compact {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0;
}

.story-card.compact img {
  height: 100%;
  min-height: 132px;
  aspect-ratio: auto;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: var(--surface-alt);
}

.representative img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}

.representative h4 {
  font-size: 1rem;
}

.overview {
  margin: 10px 0;
  color: var(--text);
  font-size: 0.92rem;
}

footer {
  padding: 0 min(5vw, 56px) 34px;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 920px) {
  .app-header,
  .toolbar,
  .prefs-panel,
  .nudge-panel,
  .session-flow,
  .layout {
    grid-template-columns: 1fr;
  }

  .now-trending {
    padding: 0 18px;
  }

  .summary {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .app-header {
    padding-top: 34px;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .api-status {
    grid-template-columns: 1fr;
  }

  .flow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-title {
    display: block;
  }
}

/* —— Quiz Focus Mode —— */
body.quiz-focus-open {
  overflow: hidden;
}

.quiz-focus {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 20, 0.72);
  backdrop-filter: blur(6px);
}

.quiz-focus[hidden] {
  display: none !important;
}

.quiz-focus-shell {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
  width: min(640px, 100%);
  max-height: min(92vh, 900px);
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.35);
  overflow: auto;
}

.quiz-focus-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.quiz-focus-bar h2 {
  margin: 4px 0 6px;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  line-height: 1.2;
}

.quiz-focus-close {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.quiz-focus-close:hover,
.quiz-focus-close:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.quiz-focus-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
}

.quiz-focus-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #1ea89a);
  transition: width 0.25s ease;
}

.quiz-focus-body .quiz-card {
  padding: 18px;
  border-radius: 14px;
  border-width: 2px;
  box-shadow: var(--shadow);
}

.quiz-focus-body .quiz-card h5 {
  font-size: 1.15rem;
}

.quiz-focus-body .quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-focus-body .quiz-options button {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  font-size: 1.02rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.quiz-focus-body .quiz-options button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #f3faf8;
}

.quiz-focus-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.quiz-focus-nav button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.quiz-focus-nav button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quiz-focus-complete {
  display: grid;
  gap: 14px;
  text-align: center;
  padding: 12px 4px 4px;
}

.quiz-focus-complete h2 {
  margin: 0;
  font-size: 1.55rem;
}

.quiz-focus-complete .hot-badge {
  justify-self: center;
}

.quiz-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

@media (max-width: 560px) {
  .quiz-focus {
    padding: 0;
    place-items: stretch;
  }

  .quiz-focus-shell {
    width: 100%;
    max-height: 100%;
    min-height: 100%;
    border-radius: 0;
  }
}

/* —— Culture Lexeme cards (P2 + visual polish) —— */
.culture-lexeme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 12px 0 4px;
}

.culture-lexeme-card {
  display: grid;
  gap: 9px;
  align-content: start;
  padding: 16px;
  border: 1px solid rgba(255, 90, 54, 0.24);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 159, 28, 0.12), transparent 42%),
    linear-gradient(165deg, #fff8f1 0%, #ffffff 58%);
  box-shadow: 0 10px 24px rgba(183, 121, 31, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.culture-lexeme-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 90, 54, 0.42);
}

.culture-lexeme-card.complete {
  border-color: rgba(15, 118, 110, 0.42);
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 118, 110, 0.1), transparent 42%),
    linear-gradient(165deg, #f0faf7 0%, #ffffff 58%);
}

.culture-lemma {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.culture-practice {
  margin: 0;
  padding: 12px 13px;
  border-left: 3px solid var(--hot-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 159, 28, 0.08);
}

.culture-lexeme-card .primary-action {
  justify-self: start;
  margin-top: 2px;
}

/* —— Culture axis filter + Sejong anchors (P3) —— */
.culture-axis-row {
  margin: 8px 0 12px;
}

.axis-chip.active {
  border-color: #ff9f1c;
  background: #fff7e6;
  color: #9a5b00;
}

.axis-tag {
  font-weight: 700;
}

.axis-tag.axis-culture {
  background: #fff1ea;
  color: #b83b00;
}

.axis-tag.axis-context {
  background: #e8f5f3;
  color: #0f766e;
}

.axis-tag.axis-wordplay {
  background: #f3e8ff;
  color: #6b21a8;
}

.axis-tag.axis-slang {
  background: #f3f4f6;
  color: #4b5563;
}

.culture-practice mark.sejeong-anchor {
  padding: 0 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, #fef08a 0%, #fde047 100%);
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  box-decoration-break: clone;
}

.culture-practice mark.sejeong-anchor.is-current,
.culture-practice mark.sejeong-anchor:hover {
  outline: 2px solid #0f766e;
  background: #bbf7d0;
}

.sejeong-anchor-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.sejeong-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.35);
  background: #ecfdf8;
  color: #0f766e;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.sejeong-chip.is-current,
.sejeong-chip:hover {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
}

.sejeong-empty {
  font-size: 0.82rem;
}

.culture-gloss {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed rgba(183, 121, 31, 0.28);
}

.culture-gloss p {
  margin: 0;
  font-size: 0.92rem;
}

.culture-romaja {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* —— Visual polish: media row, mobile, a11y motion —— */
.latest-media-row > .media-panel {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.latest-media-row > .media-panel:hover {
  box-shadow: var(--shadow-hover);
}

.spotlight-card,
.featured-spotlight {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.featured-spotlight:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.chart-card,
.quote-card {
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.section-title h2 {
  letter-spacing: -0.02em;
}

@media (max-width: 720px) {
  main {
    padding: 18px 14px 32px;
  }

  .app-header {
    padding: 28px 16px 22px;
    gap: 18px;
  }

  h1 {
    font-size: clamp(1.55rem, 7vw, 2.2rem);
  }

  .intro {
    font-size: 0.98rem;
  }

  .trending-hero {
    padding: 16px;
    border-radius: 14px;
  }

  .trending-rail {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .trending-card {
    padding: 12px;
  }

  .spotlight-panel,
  .panel,
  .toolbar,
  .nudge-panel,
  .session-flow,
  .prefs-panel {
    border-radius: 12px;
  }

  .culture-lexeme-grid {
    grid-template-columns: 1fr;
  }

  .culture-lemma {
    font-size: 1.18rem;
  }

  #culture-step {
    padding: 12px;
  }

  .summary {
    min-width: 0;
  }

  .primary-action {
    min-height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hot-badge.pulse {
    animation: none;
  }

  .vocab-card:hover,
  .vocab-card.selected,
  .culture-lexeme-card:hover,
  .trending-card:hover,
  .featured-spotlight:hover,
  .pref-chip:hover,
  .primary-action:hover {
    transform: none;
  }
}
