﻿/* ShadowSpeak UI System: Casual Coach */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Noto+Sans+KR:wght@400;500;700;800&display=swap');

:root {
  --font-heading: 'Manrope', 'Noto Sans KR', sans-serif;
  --font-body: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;

  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --secondary: #0f766e;
  --accent: #f97316;
  --yt-red: #ff3b30;
  --yt-red-strong: #d92d24;
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #dc2626;

  --bg-base: #f5f8fd;
  --bg-glow-1: rgba(37, 99, 235, 0.16);
  --bg-glow-2: rgba(249, 115, 22, 0.12);
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-strong: #edf3fb;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #d6e2f0;
  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 18px 44px rgba(15, 23, 42, 0.14);
  --focus-ring: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

[data-theme='dark'] {
  --primary: #5b8dff;
  --primary-strong: #7aa2ff;
  --secondary: #2cb9a3;
  --accent: #ff9e66;
  --yt-red: #ff5f57;
  --yt-red-strong: #ff3b30;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;

  --bg-base: #111827;
  --bg-glow-1: rgba(91, 141, 255, 0.2);
  --bg-glow-2: rgba(255, 158, 102, 0.16);
  --surface: #1b2435;
  --surface-soft: #202c40;
  --surface-strong: #26354f;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #9aa8bd;
  --border: #33465f;
  --shadow-soft: 0 14px 30px rgba(2, 6, 23, 0.35);
  --shadow-strong: 0 22px 48px rgba(2, 6, 23, 0.45);
  --focus-ring: 0 0 0 4px rgba(91, 141, 255, 0.28);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-primary);
  background:
    radial-gradient(1200px 700px at 15% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(900px 540px at 95% 8%, var(--bg-glow-2), transparent 62%),
    var(--bg-base);
  overflow-x: hidden;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 20px 36px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

button,
input,
textarea {
  font: inherit;
}

.view {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.hidden {
  display: none !important;
}

.glass {
  background: linear-gradient(160deg, var(--surface), var(--surface-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

button {
  border: none;
  border-radius: var(--radius-md);
  min-height: 52px;
  padding: 0 var(--space-5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

button:focus-visible,
input[type='text']:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

button:active {
  transform: scale(0.98);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

.btn-secondary {
  color: var(--text-primary);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  transform: translateY(-1px);
}

.btn-icon {
  min-height: 44px;
  width: 44px;
  padding: 0;
  border-radius: 50%;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
}

.header-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header-section h1 {
  font-size: 2.7rem;
  font-weight: 800;
  color: var(--text-primary);
}

.header-section p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

.practice-header {
  position: relative;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.view-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.back-button {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  background: var(--surface-soft);
}

.state-badge--official {
  border-color: rgba(22, 163, 74, 0.35);
  color: var(--success);
  background: rgba(22, 163, 74, 0.12);
}

.state-badge--ai {
  border-color: rgba(202, 138, 4, 0.35);
  color: var(--warning);
  background: rgba(202, 138, 4, 0.14);
}

.state-badge--pending {
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.12);
}

.state-badge--library {
  border-color: rgba(15, 118, 110, 0.35);
  color: var(--secondary);
  background: rgba(15, 118, 110, 0.12);
}

.state-badge--error {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--danger);
  background: rgba(220, 38, 38, 0.12);
}

.status-message {
  margin: 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.status-message.status-warning {
  color: var(--warning);
}

input[type='text'] {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
}

input[type='text']::placeholder {
  color: var(--text-muted);
}

.home-header-row {
  position: relative;
  padding-right: 56px;
}

.home-theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
}

.goal-card {
  padding: var(--space-5) var(--space-6);
  border-color: rgba(37, 99, 235, 0.28);
}

.goal-card.goal-card--done {
  border-color: rgba(22, 163, 74, 0.36);
}

.goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.goal-title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

.goal-count {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.goal-progress {
  width: 100%;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  overflow: hidden;
}

.goal-progress-fill {
  width: 0;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(120deg, var(--primary), var(--secondary));
  transition: width 0.35s ease;
}

.goal-progress-fill.is-done {
  background: linear-gradient(120deg, var(--success), #34d399);
}

.goal-pill-row {
  margin-top: var(--space-3);
  display: flex;
  justify-content: center;
  gap: 6px;
}

.goal-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
}

.goal-pill--done {
  border-color: rgba(22, 163, 74, 0.35);
  color: var(--success);
  background: rgba(22, 163, 74, 0.12);
}

.home-menu {
  display: grid;
  gap: var(--space-4);
}

.hero-extract-card {
  padding: 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 59, 48, 0.28);
  background:
    radial-gradient(120% 160% at 102% -20%, rgba(255, 59, 48, 0.22), transparent 58%),
    linear-gradient(160deg, var(--surface), var(--surface-soft));
}

.hero-extract-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-extract-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.2);
  box-shadow: none;
  flex-shrink: 0;
}

.hero-extract-logo svg {
  display: block;
}

.hero-extract-kicker {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yt-red-strong);
}

.hero-extract-title {
  margin: 2px 0 0;
  font-size: 1.16rem;
  line-height: 1.3;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-primary);
}

.hero-extract-desc {
  margin: 12px 0 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.hero-extract-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.hero-step {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--yt-red-strong);
  border: 1px solid rgba(255, 59, 48, 0.26);
  background: rgba(255, 59, 48, 0.09);
}

.hero-extract-btn {
  width: 100%;
  min-height: 50px;
  font-weight: 800;
}

/* ── Hero Duo Cards (킬러 기능 2열) ── */
.hero-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: var(--space-4);
}

.hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 14px 18px;
  border-radius: 20px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
}
.hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.hero-card:active {
  transform: scale(0.97);
}

.hero-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
}

.hero-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.hero-card__icon svg {
  width: 26px;
  height: 26px;
}

.hero-card__title {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
}

.hero-card__desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255,255,255,0.82);
}

/* YouTube card: red gradient */
.hero-card--youtube {
  background: linear-gradient(145deg, #dc2626, #b91c1c 60%, #991b1b);
  border-color: rgba(255,59,48,0.3);
}
.hero-card--youtube .hero-card__badge {
  background: rgba(255,255,255,0.22);
}
.hero-card--youtube .hero-card__icon {
  background: rgba(255,255,255,0.18);
}

/* KoEn card: blue-purple gradient */
.hero-card--koen {
  background: linear-gradient(145deg, #2563eb, #4f46e5 60%, #7c3aed);
  border-color: rgba(99,102,241,0.3);
}
.hero-card--koen .hero-card__badge {
  background: rgba(255,255,255,0.22);
}
.hero-card--koen .hero-card__icon {
  background: rgba(255,255,255,0.18);
}

/* Goal card action button */
.goal-action-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  font-weight: 700;
  border-radius: var(--radius-md);
}

.action-primary {
  min-height: 104px;
  border-radius: 20px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  text-align: left;
  gap: 2px;
  padding: 16px 20px;
}

.action-primary.btn-secondary {
  background: linear-gradient(160deg, var(--surface), var(--surface-soft));
}

.action-primary__title {
  font-size: 1.18rem;
  font-family: var(--font-heading);
  font-weight: 800;
}

.action-primary__meta {
  font-size: 0.9rem;
  opacity: 0.9;
}

.action-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.home-link-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-align: center;
}

.home-link-note strong {
  color: var(--primary);
}

.action-tile {
  min-height: 120px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  text-align: left;
}

.action-tile--wide {
  width: 100%;
  min-height: 108px;
}

.action-tile__icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.action-tile__title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.action-tile__meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.voice-toggle {
  min-height: 58px;
  justify-content: flex-start;
  padding: 0 14px;
}

.voice-toggle__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
}

.voice-toggle__label {
  font-size: 0.93rem;
  font-weight: 600;
}

.media-tab-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.media-tab {
  min-height: 50px;
  font-size: 0.95rem;
}

.panel-card {
  padding: var(--space-6);
}

.panel-hint {
  margin: 0 0 var(--space-4);
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.panel-subhint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.input-action-wrap {
  position: relative;
}

.input-action-wrap input[type='text'] {
  padding-right: 84px;
}

.inline-action-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.loading-block {
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 8px 0;
}

.source-note {
  display: flex;
  justify-content: center;
  margin-bottom: 2px;
}

.context-note {
  margin: 0 2px 2px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.drop-zone.is-active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

.drop-zone__icon {
  color: var(--primary);
  display: inline-flex;
}

.drop-zone__title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

.drop-zone__meta {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.file-name-wrap {
  margin-top: var(--space-4);
  display: flex;
  justify-content: center;
}

.segment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.segment-card {
  padding: 16px;
  min-height: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.segment-card:hover {
  transform: translateY(-1px);
}

.segment-index {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.segment-main {
  flex: 1;
  min-width: 0;
}

.segment-en {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 4px;
  font-family: var(--font-heading);
  color: var(--text-primary);
}

.segment-ko {
  font-size: 0.93rem;
  color: var(--text-secondary);
}

.segment-meta {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.segment-time,
.segment-source {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  font-weight: 700;
}

.segment-time {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
}

.segment-source--official {
  color: var(--success);
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.35);
}

.segment-source--ai {
  color: var(--warning);
  background: rgba(202, 138, 4, 0.12);
  border-color: rgba(202, 138, 4, 0.35);
}

.segment-source--pending {
  color: var(--text-secondary);
  background: rgba(100, 116, 139, 0.1);
}

.segment-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

.feedback-card {
  padding: 24px;
  text-align: center;
}

.feedback-card__icon {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--primary);
}

.feedback-card__title {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
}

.feedback-card__text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.feedback-card--error {
  border-color: rgba(220, 38, 38, 0.35);
}

.feedback-card--error .feedback-card__icon,
.feedback-card--error .feedback-card__title {
  color: var(--danger);
}

.expression-card {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.practice-stage {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 6px;
}

.en-text {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  line-height: 1.2;
  font-weight: 800;
  text-align: center;
}

.ko-text {
  margin-top: 12px;
  font-size: 1.18rem;
  text-align: center;
  color: var(--text-secondary);
}

.practice-controls {
  display: grid;
  gap: 16px;
}

.favorite-hint {
  margin: 2px 0 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.favorite-hint strong {
  color: var(--primary);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-prev {
  width: 64px;
  min-height: 64px;
  border-radius: 50%;
  padding: 0;
  color: var(--text-primary);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.btn-prev svg {
  width: 22px;
  height: 22px;
  display: block;
}

.btn-main {
  flex: 1;
  min-height: 72px;
  border-radius: 34px;
  font-size: 1.1rem;
  font-weight: 800;
}

.btn-main--record {
  color: #fff;
  background: linear-gradient(120deg, var(--accent), #fb923c);
  box-shadow: 0 10px 22px rgba(249, 115, 22, 0.3);
}

.eval-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.btn-eval {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eval-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.eval-dot--easy {
  background: var(--success);
}

.eval-dot--good {
  background: var(--warning);
}

.eval-dot--hard {
  background: var(--danger);
}

.eval-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.favorite-button {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--warning);
}

.btn-transcribe {
  width: 100%;
  margin-top: 16px;
}

.library-summary {
  text-align: center;
}

.favorite-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(10px);
  min-width: 220px;
  max-width: min(92vw, 420px);
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.3);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(29, 78, 216, 0.92));
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
  opacity: 0;
  pointer-events: none;
  z-index: 1200;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.favorite-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.favorite-toast--warn {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.92), rgba(194, 65, 12, 0.92));
  border-color: rgba(234, 88, 12, 0.3);
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.28);
}

.pulse-primary {
  animation: pulsePrimary 1.8s infinite;
}

@keyframes pulsePrimary {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(249, 115, 22, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
  }
}

.yt-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 16px;
  padding: 0 12px;
  display: none;
  opacity: 1;
  transition: opacity 0.18s ease;
}

.yt-container.yt-container--warmup {
  opacity: 0;
  pointer-events: none;
}

#youtube-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-strong);
}

#youtube-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.practice-player-slot {
  margin-bottom: 6px;
}

.practice-player-slot .yt-container {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.fade-in {
  animation: fadeIn 0.42s ease both;
}

.slide-up {
  animation: slideUp 0.48s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  #app {
    padding: 18px 14px 22px;
  }

  .view {
    gap: 14px;
  }

  .header-section h1 {
    font-size: 2.2rem;
  }

  .goal-card,
  .panel-card,
  .expression-card {
    padding: 16px;
  }

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

  .action-primary__title {
    font-size: 1.05rem;
  }

  .action-tile {
    min-height: 110px;
  }

  .practice-stage {
    min-height: 180px;
  }

  .en-text {
    font-size: 1.65rem;
  }

  .ko-text {
    font-size: 0.98rem;
  }

  .btn-prev {
    width: 54px;
    min-height: 54px;
  }

  .btn-main {
    min-height: 56px;
    font-size: 1rem;
    border-radius: 28px;
  }

  .eval-grid {
    gap: 8px;
  }

  .btn-eval {
    min-height: 64px;
  }

  .segment-card {
    padding: 14px;
    gap: 10px;
  }

  .segment-index {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }

  .segment-en {
    font-size: 0.95rem;
  }

  .segment-ko {
    font-size: 0.85rem;
  }

  .media-tab {
    min-height: 46px;
    font-size: 0.9rem;
  }

  .hero-extract-card {
    padding: 14px;
  }

  .hero-extract-title {
    font-size: 1.02rem;
  }

  .hero-extract-desc {
    margin-top: 10px;
    font-size: 0.84rem;
  }

  .hero-step {
    font-size: 0.74rem;
  }

  .favorite-toast {
    bottom: 18px;
    min-height: 38px;
    font-size: 0.82rem;
  }

  #youtube-player {
    border-radius: 14px;
  }
}

/* ── KoEn View ─────────────────────────────────────────────────── */

.koen-hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

/* ── KoEn 2-level category: top tabs ── */
.koen-top-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: var(--space-3);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.koen-top-tabs::-webkit-scrollbar { display: none; }

.koen-top-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface-strong);
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.koen-top-tab__icon { font-size: 1.3rem; line-height: 1; }
.koen-top-tab__label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}
.koen-top-tab:hover {
  border-color: var(--primary);
}
.koen-top-tab--active {
  background: linear-gradient(120deg, var(--primary), var(--primary-strong, var(--primary)));
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}
.koen-top-tab--active .koen-top-tab__label {
  color: #fff;
}

/* ── KoEn 2-level category: sub chips ── */
.koen-sub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-4);
}
.koen-sub-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-strong);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.18s ease;
}
.koen-sub-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.koen-sub-chip--active {
  color: #fff;
  background: var(--primary);
  border-color: transparent;
}

.koen-input-wrap {
  position: relative;
  margin-bottom: var(--space-3);
}

.koen-textarea {
  width: 100%;
  min-height: 80px;
  padding: 14px 16px 28px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  resize: vertical;
  line-height: 1.5;
  box-sizing: border-box;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.koen-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.koen-textarea::placeholder {
  color: var(--text-muted);
}

.koen-char-count {
  position: absolute;
  right: 12px;
  bottom: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  pointer-events: none;
}

.koen-translate-btn {
  width: 100%;
}

.koen-loading {
  text-align: center;
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.koen-results-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.koen-source-wrap {
  text-align: center;
}

.state-badge--official {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.3);
}
.state-badge--ai {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.koen-expr-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.koen-expr-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.koen-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.koen-card-index {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

.koen-tone-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--border);
}
.koen-tone--formal {
  color: var(--secondary, #0f766e);
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.25);
}
.koen-tone--neutral {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
}
.koen-tone--casual {
  color: var(--accent);
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.25);
}

.koen-card-en {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-primary);
}

.koen-card-ko {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.koen-card-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--surface-strong);
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.koen-tips-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface-strong);
  border-radius: var(--radius-sm);
}
.koen-tips-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 0 2px;
}
.koen-tip-item {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.koen-tip-item strong {
  color: var(--primary);
}
.koen-tip-ipa {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-right: 4px;
}
.koen-tip-text {
  color: var(--text-muted);
}

.koen-speed-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.koen-speed-btn {
  min-height: 32px;
  min-width: 54px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}
.koen-speed-btn:hover {
  border-color: var(--primary);
}
.koen-speed-btn--active {
  color: #fff;
  background: var(--primary);
  border-color: transparent;
}

.koen-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.koen-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 42px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-md);
}
.koen-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.koen-refine-btn {
  width: 100%;
}

@media (max-width: 480px) {
  .hero-duo {
    gap: 8px;
  }
  .hero-card {
    padding: 16px 10px 14px;
    border-radius: 16px;
  }
  .hero-card__title {
    font-size: 0.92rem;
  }
  .hero-card__desc {
    font-size: 0.72rem;
  }
  .hero-card__icon {
    width: 40px;
    height: 40px;
  }
  .koen-card-en {
    font-size: 1.02rem;
  }
  .koen-card-actions {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
