/* ============================================================================
   SHORTHAND 공부방 — 전면 리디자인 v1 (20260704)
   컨셉: 계측기(measurement instrument).
   - 숫자(속도·정확도)는 Space Grotesk 탭룰러로 세워 계기판처럼 읽히게 한다.
   - 시그니처: 진도 사다리(goal-ladder). 110→170 단계가 페이지의 정신 모델이므로
     통과/현재/잠김 상태 언어를 사다리에서 파생시켜 전체에 일관 적용한다.
   - 강조 규율: 채운 보라 버튼은 화면당 1개(주 CTA). 완료 상태의 목표 CTA는
     잉크색 채움으로 구분해 강조 충돌을 없앤다.
   ========================================================================== */

/* 1. 토큰 ------------------------------------------------------------------ */
:root {
  --ink: #171a2b;
  --text: #3a3f55;
  --muted: #767b92;
  --faint: #a2a7bb;
  --line: #e7e9f1;
  --line-strong: #d7dae6;
  --paper: #f4f5f9;
  --card: #ffffff;
  --wash: #fafafd;
  --violet: #5b3df0;
  --violet-deep: #4529ce;
  --violet-tint: #efecfe;
  --violet-wash: #f8f7ff;
  --green: #0e8a63;
  --green-tint: #e6f5ef;
  --amber: #b45309;
  --amber-tint: #fdf3e7;
  --red: #c2453f;
  --red-tint: #fdecea;
  --r-ctl: 10px;
  --r-card: 16px;
  --shadow-card: 0 10px 30px rgba(23, 26, 43, .05);
  --shadow-pop: 0 22px 60px rgba(23, 26, 43, .22);
  --sidebar-width: 240px;
  --font-sans: Pretendard, "Apple SD Gothic Neo", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  --font-num: "Space Grotesk", Pretendard, sans-serif;
  /* 구버전 변수 호환 (다른 스크립트/페이지 조각이 참조할 수 있음) */
  --sr-primary: var(--violet);
  --sr-primary-strong: var(--violet-deep);
  --sr-ink: var(--ink);
  --sr-line: var(--line);
}

/* 2. 리셋 · 공통 ------------------------------------------------------------ */
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body.ui-intermediate {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  letter-spacing: -0.02em;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(91, 61, 240, .28);
  outline-offset: 2px;
}
a { color: inherit; text-decoration: none; }
svg { display: block; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important;
  white-space: nowrap !important;
}
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.material-select-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* 공용 버튼 */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 16px;
  border-radius: var(--r-ctl);
  font-size: 0.8125rem; font-weight: 600;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { color: #fff; background: var(--violet); }
.btn-primary:hover { background: var(--violet-deep); }
.btn-secondary { color: var(--text); background: var(--card); border: 1px solid var(--line-strong); }
.btn-secondary:hover { border-color: var(--faint); background: var(--wash); }

.count-badge {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 24px; padding: 2px 9px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); background: var(--wash);
  font-size: 0.6875rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 3. 앱 셸 ------------------------------------------------------------------ */
#app-wrapper { display: flex; min-height: 100vh; }
.main-content {
  flex: 1; min-width: 0;
  padding: 34px clamp(20px, 3.2vw, 44px) 48px;
}

/* 4. 사이드바 ---------------------------------------------------------------- */
.sidebar {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 14px;
  width: var(--sidebar-width); height: 100vh;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--card);
  overflow-y: auto;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 1rem; font-weight: 800; letter-spacing: -0.03em; }
.logo-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #fff; background: var(--violet); font-size: 0.9375rem; }
.sidebar-close-btn, .mobile-menu-btn { display: none; color: var(--ink); }

.sidebar-study-time-card {
  display: grid; gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--wash);
}
.sidebar-study-time-card.is-active { border-color: #c9befb; background: var(--violet-wash); }
.study-time-card-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 0.6875rem; font-weight: 600; }
.study-time-card-head em { font-style: normal; color: var(--faint); }
.sidebar-study-time-card.is-active .study-time-card-head em { color: var(--violet); }
.sidebar-study-time-card strong { font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--ink); font-size: 1.3125rem; font-weight: 600; line-height: 1.1; }
.sidebar-study-time-card small { color: var(--faint); font-size: 0.625rem; }
.sidebar-study-time-card small b { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

.nav-groups { display: grid; gap: 4px; align-content: start; flex: 1; }
.nav-section { border: 0; }
.nav-section-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 8px 5px;
  color: var(--faint);
  font-size: 0.6562rem; font-weight: 800; letter-spacing: .08em;
  list-style: none; cursor: pointer;
}
.nav-section-title::-webkit-details-marker { display: none; }
.nav-section-arrow { transition: transform .18s ease; font-size: 0.75rem; }
.nav-section[open] .nav-section-arrow { transform: rotate(180deg); }
.nav-section-list { display: grid; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  min-height: 36px; padding: 6px 10px;
  border-radius: 9px;
  color: var(--text); font-size: 0.8125rem; font-weight: 500;
  transition: background-color .13s ease, color .13s ease;
}
.nav-item:hover { background: var(--wash); color: var(--ink); }
.nav-item.active { color: var(--violet-deep); background: var(--violet-tint); font-weight: 700; }
.nav-icon { width: 18px; text-align: center; font-size: 0.875rem; filter: grayscale(.25); }
.nav-item.active .nav-icon { filter: none; }
.ai-nav-highlight .nav-text { background: linear-gradient(90deg, var(--violet), #8a6cf8); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }

.sidebar-footer { display: grid; gap: 8px; }
.profile-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); cursor: pointer;
  transition: border-color .15s ease;
}
.profile-card:hover { border-color: var(--line-strong); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--violet-deep); background: var(--violet-tint); font-weight: 800; font-size: 0.8125rem; }
.profile-name { color: var(--ink); font-size: 0.8125rem; font-weight: 700; }
.profile-action { color: var(--faint); font-size: 0.6875rem; }
.admin-trigger { min-height: 34px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 0.75rem; }
.sidebar-overlay { display: none; }

/* 5. 헤더 + 요약 스트립 ------------------------------------------------------- */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 26px;
}
.page-eyebrow {
  display: inline-block; margin-bottom: 8px;
  color: var(--violet); font-size: 0.6875rem; font-weight: 800; letter-spacing: .14em;
}
.page-title h2 { margin: 0; color: var(--ink); font-size: clamp(26px, 2.4vw, 34px); font-weight: 800; letter-spacing: -0.045em; line-height: 1.12; }
.page-title p { margin: 8px 0 0; color: var(--muted); font-size: 0.875rem; }

/* 카드 3개 대신, 헤어라인으로 나뉜 하나의 계기 스트립 */
.learning-summary {
  display: grid; grid-template-columns: repeat(3, auto);
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.summary-card {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px;
}
.summary-card + .summary-card { border-left: 1px solid var(--line); }
.summary-icon {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 10px;
  color: var(--violet); background: var(--violet-tint);
  font-size: 1.0625rem;
}
.summary-icon.target { color: var(--green); background: var(--green-tint); }
.summary-card div { display: grid; gap: 1px; min-width: 0; }
.summary-card div > span { color: var(--faint); font-size: 0.6875rem; font-weight: 600; white-space: nowrap; }
.summary-card strong { color: var(--ink); font-size: 1.3125rem; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; white-space: nowrap; }
.summary-card small { color: var(--muted); font-size: 0.6875rem; white-space: nowrap; }
.summary-card small.summary-hint-up { color: var(--green); font-weight: 600; }
.summary-card small.summary-hint-down { color: var(--amber); font-weight: 600; }

/* 6. 히어로: 오늘의 추천 연습 + 다음 목표 --------------------------------------- */
.recommendation-card {
  display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr);
  margin-bottom: 22px;
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.recommendation-main {
  display: grid; gap: 14px; align-content: start;
  padding: 30px 34px 28px;
  min-width: 0;
}
.recommendation-labels { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recommendation-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 0.9375rem; font-weight: 800; letter-spacing: -0.02em; }
.recommendation-symbol { color: var(--violet); font-size: 1.0625rem; }
.recommendation-reason-label { color: var(--faint); font-size: 0.75rem; cursor: help; }
.recommendation-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.selected-tag {
  display: inline-flex; align-items: center;
  min-height: 26px; padding: 2px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); background: var(--wash);
  font-size: 0.75rem; font-weight: 600;
}
.selected-tag.level { border-color: transparent; color: var(--violet-deep); background: var(--violet-tint); font-family: var(--font-num); font-weight: 600; }
.selected-tag.real { color: var(--amber); background: var(--amber-tint); border-color: transparent; }
.recommendation-main > strong { color: var(--ink); font-size: clamp(21px, 1.9vw, 27px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.25; }
#recommendationReasonText { margin: -6px 0 0; max-width: 560px; color: var(--muted); font-size: 0.8438rem; line-height: 1.65; }
.recommendation-accuracy {
  display: inline-flex; align-items: center; gap: 8px; width: max-content;
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--muted); background: var(--wash); border: 1px solid var(--line);
  font-size: 0.75rem; font-weight: 600;
}
.recommendation-accuracy b { color: var(--green); font-family: var(--font-num); font-size: 0.875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.recommendation-card.is-empty .recommendation-accuracy { display: none; }

.recommendation-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.start-practice-btn {
  display: grid; gap: 2px; justify-items: center;
  min-width: 210px; min-height: 56px; padding: 10px 22px;
  border-radius: 12px;
  transition: background-color .15s ease, border-color .15s ease, transform .12s ease;
}
.start-practice-btn:active { transform: scale(.985); }
.start-practice-btn .btn-main { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9375rem; font-weight: 700; }
.start-practice-btn .btn-main svg { font-size: 0.9375rem; }
.start-practice-btn .btn-sub { font-size: 0.6875rem; opacity: .78; }
.start-practice-btn.primary { color: #fff; background: var(--violet); }
.start-practice-btn.primary:hover { background: var(--violet-deep); }
.start-practice-btn.secondary { color: var(--text); background: var(--card); border: 1px solid var(--line-strong); }
.start-practice-btn.secondary:hover { border-color: var(--faint); background: var(--wash); }

.recommendation-empty-actions { display: grid; gap: 12px; }
.empty-state-copy { display: grid; gap: 4px; }
.empty-state-copy strong { color: var(--ink); font-size: 0.9375rem; font-weight: 700; }
.empty-state-copy span { color: var(--muted); font-size: 0.8125rem; }
.suggestion-button-list { display: flex; gap: 8px; flex-wrap: wrap; }
.suggestion-condition-btn {
  min-height: 34px; padding: 0 13px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--text); background: var(--card);
  font-size: 0.75rem; font-weight: 600;
}
.suggestion-condition-btn:hover { border-color: var(--violet); color: var(--violet); }
.empty-state-change-btn {
  width: max-content; min-height: 38px; padding: 0 16px;
  border-radius: var(--r-ctl);
  color: #fff; background: var(--ink);
  font-size: 0.8125rem; font-weight: 600;
}
.no-suggestion-copy { color: var(--faint); font-size: 0.75rem; }

/* 다음 목표: 보조 레일. 톤을 낮춘 워시 배경 + 진도 사다리 */
.recommendation-goal {
  display: grid; gap: 12px; align-content: start;
  padding: 28px 26px;
  border-left: 1px solid var(--line);
  background: var(--violet-wash);
  min-width: 0;
}
.goal-kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.75rem; font-weight: 800; letter-spacing: .06em; }
.goal-kicker span { color: var(--violet); }
.recommendation-goal > strong { color: var(--ink); font-size: 1.3125rem; font-weight: 800; letter-spacing: -0.035em; line-height: 1.25; }
#recommendationGoalText { margin: 0; color: var(--muted); font-size: 0.8125rem; line-height: 1.65; }

/* 시그니처: 진도 사다리 */
.goal-ladder { display: flex; align-items: center; margin: 2px 0 4px; }
.ladder-step {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--card);
}
.ladder-step i {
  font-style: normal;
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: 0.6875rem; font-weight: 600; color: var(--muted);
}
.ladder-step.is-passed { border-color: transparent; background: var(--green-tint); }
.ladder-step.is-passed i { color: var(--green); font-weight: 700; }
.ladder-step.is-current { border-color: transparent; background: var(--violet); box-shadow: 0 4px 12px rgba(91, 61, 240, .3); }
.ladder-step.is-current i { color: #fff; font-weight: 700; }
.ladder-step.is-locked { border-style: dashed; border-color: var(--line); background: transparent; }
.ladder-step.is-locked i { color: var(--faint); }
.ladder-link { flex: 1; height: 1px; min-width: 4px; background: var(--line-strong); }

.goal-progress-track { position: relative; overflow: hidden; height: 6px; margin-top: 4px; border-radius: 999px; background: #e5e2f8; }
#recommendationGoalProgress { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--violet); transition: width .25s ease; }
.goal-progress-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.goal-progress-info b { color: var(--ink); font-family: var(--font-num); font-size: 0.875rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.goal-action-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 46px; margin-top: 6px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  color: var(--text); background: var(--card);
  font-size: 0.8438rem; font-weight: 700;
}
.goal-action-btn::after { content: '›'; font-size: 1.125rem; color: var(--faint); }
.goal-action-btn:hover { border-color: var(--faint); }
.goal-action-btn[hidden] { display: none !important; }

/* 완료 상태: 진행률 바 대신 확정 표시, CTA는 잉크색 채움으로 승격(보라 CTA와 충돌 없음) */
.recommendation-goal.goal-complete .goal-progress-track { display: none; }
.recommendation-goal.goal-complete .goal-progress-info {
  padding: 10px 13px; border-radius: var(--r-ctl);
  background: var(--green-tint);
}
.recommendation-goal.goal-complete .goal-progress-info b { color: var(--green); }
.recommendation-goal.goal-complete .goal-progress-info b::before { content: '✓'; margin-right: 5px; }
.recommendation-goal.goal-complete .goal-action-btn { border-color: transparent; color: #fff; background: var(--ink); }
.recommendation-goal.goal-complete .goal-action-btn::after { color: rgba(255, 255, 255, .6); }
.recommendation-goal.goal-complete .goal-action-btn:hover { background: #23273e; }

/* 7. 라이브러리: 직접 자료 고르기 + 최근 기록 ------------------------------------ */
.library-layout {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  gap: 20px; align-items: start;
}
.material-browser-card, .recent-history-panel {
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.material-browser-head, .recent-history-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px; padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.material-browser-head strong, .recent-history-head strong { color: var(--ink); font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.03em; }
.filter-toggle-btn, .history-all-btn { min-height: 34px; padding: 0 13px; font-size: 0.75rem; }

.current-condition-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}
.current-condition-row > span { color: var(--faint); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.current-condition-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.current-condition-chips b {
  display: inline-flex; align-items: center;
  min-height: 27px; padding: 2px 12px;
  border-radius: 999px;
  color: var(--violet-deep); background: var(--violet-tint);
  font-size: 0.75rem; font-weight: 700;
}

/* 필터 패널 */
.material-filter-panel { border-bottom: 1px solid var(--line); background: var(--wash); }
.filter-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 12px; padding: 13px 24px; }
.filter-row + .filter-row { border-top: 1px solid var(--line); }
.filter-label strong { color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.filter-row-combined { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.filter-control-group { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; }

.level-list { display: grid; grid-template-columns: repeat(var(--level-count, 7), minmax(0, 1fr)); gap: 7px; width: 100%; }
.type-list, .difficulty-list { display: flex; gap: 7px; }
.type-filter-btn, .difficulty-filter-btn { flex: 1; min-width: 0; }

/* 필터 버튼: 사다리와 같은 상태 언어. 선택=보라채움+✓ / 가능=흰배경 / 통과=초록✓ / 잠김=점선+🔒 */
.level-btn, .type-filter-btn, .difficulty-filter-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 6px 8px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  color: var(--text); background: var(--card);
  font-size: 0.7812rem; font-weight: 600;
  transition: border-color .14s ease, background-color .14s ease, color .14s ease;
}
.level-btn { width: 100%; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.level-btn strong { font: inherit; display: inline-flex; align-items: center; }
.level-btn small { display: none; }
.level-btn:hover, .type-filter-btn:hover, .difficulty-filter-btn:hover { border-color: var(--violet); color: var(--violet); }
.level-btn.active, .type-filter-btn.active, .difficulty-filter-btn.active {
  border-color: transparent; color: #fff; background: var(--violet); font-weight: 700;
}
.level-btn .level-ico { display: inline-flex; margin-right: 4px; font-size: 0.625rem; line-height: 1; }
.level-btn .level-ico-lock { font-size: 0.5625rem; filter: grayscale(1); opacity: .8; }
.level-btn .level-ico-passed { color: var(--green); font-weight: 700; }
.level-btn.passed:not(.active) { border-color: var(--line-strong); color: var(--text); background: var(--card); }
.level-btn.locked, .level-btn.locked:hover {
  border-style: dashed; border-color: var(--line);
  color: var(--faint); background: transparent;
  cursor: not-allowed;
}

.search-filter-row { grid-template-columns: minmax(0, 1fr) auto; }
.material-search-wrap { position: relative; min-width: 0; }
.search-icon { position: absolute; top: 50%; left: 13px; transform: translateY(-50%); color: var(--faint); font-size: 1rem; pointer-events: none; }
#materialSearchInput {
  width: 100%; height: 40px; padding: 0 14px 0 38px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  color: var(--ink); background: var(--card);
}
#materialSearchInput::placeholder { color: var(--faint); }
#materialSearchInput:focus { border-color: var(--violet); outline: 0; box-shadow: 0 0 0 4px rgba(91, 61, 240, .1); }
.search-clear-btn { min-height: 40px; }

/* 자료 목록: 테이블 대신 행 카드 (가로 스크롤 제거) */
.material-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.material-list-title-wrap { display: flex; align-items: center; gap: 8px; }
.material-list-head strong { color: var(--ink); font-size: 0.875rem; font-weight: 700; }
.material-list-tools { display: flex; align-items: center; gap: 12px; }
.material-page-indicator { color: var(--faint); font-size: 0.75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.material-page-indicator:empty { display: none; }
.material-sort select {
  height: 32px; padding: 0 30px 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  color: var(--text); background: var(--card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23767b92' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  font-size: 0.7812rem; font-weight: 600; cursor: pointer; appearance: none;
}
.material-sort select:hover { border-color: var(--faint); }
.material-sort select:focus { border-color: var(--violet); outline: 0; box-shadow: 0 0 0 3px rgba(91, 61, 240, .1); }
.material-rows-wrap { min-height: 120px; }
.material-rows { display: grid; }
.material-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center; gap: 16px;
  min-height: 62px; padding: 12px 24px;
  cursor: pointer;
  transition: background-color .13s ease;
}
.material-row + .material-row { border-top: 1px solid var(--line); }
.material-row:hover { background: var(--wash); }
.material-row.active { background: var(--violet-wash); box-shadow: inset 3px 0 0 var(--violet); }
.material-row-level {
  display: grid; place-items: center; flex: none;
  min-width: 46px; height: 30px; padding: 0 8px;
  border-radius: 9px;
  color: var(--violet-deep); background: var(--violet-tint);
  font-size: 0.75rem; font-weight: 700;
}
.material-row-main { display: grid; gap: 5px; min-width: 0; }
.material-title-button { display: block; max-width: 100%; overflow: hidden; color: var(--ink); font-size: 0.8438rem; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.material-title-button:hover { color: var(--violet); }
.material-row-tags { display: flex; align-items: center; gap: 6px; }
.material-type-badge, .material-difficulty-badge {
  display: inline-flex; align-items: center;
  min-height: 20px; padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.6562rem; font-weight: 600;
  color: var(--muted); background: var(--paper);
}
.material-difficulty-badge.real { color: var(--amber); background: var(--amber-tint); }
.material-row-length { color: var(--faint); font-size: 0.6875rem; }
.material-row-stats { display: flex; gap: 18px; }
.material-row-stat { display: grid; gap: 1px; justify-items: end; }
.material-row-stat small { color: var(--faint); font-size: 0.625rem; }
.material-row-stat b { color: var(--ink); font-size: 0.8125rem; font-weight: 600; }
.select-material-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 62px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--text); background: var(--card);
  font-size: 0.75rem; font-weight: 600;
}
.select-material-btn:hover { border-color: var(--violet); color: var(--violet); }
.select-material-btn.is-selected { border-color: transparent; color: var(--violet-deep); background: var(--violet-tint); font-weight: 700; }
.material-empty-row { padding: 34px 24px; color: var(--muted); font-size: 0.8125rem; text-align: center; }
.library-empty-state { display: grid; gap: 10px; justify-items: center; }
.library-empty-state strong { color: var(--ink); font-size: 0.875rem; }
.library-empty-state span { color: var(--muted); font-size: 0.7812rem; }

.material-pager { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 14px; border-top: 1px solid var(--line); }
.material-pager:empty { display: none; }
.material-pager button {
  display: grid; place-items: center;
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); background: var(--card);
  font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.material-pager button:hover:not(:disabled) { border-color: var(--violet); color: var(--violet); }
.material-pager button.active { border-color: transparent; color: #fff; background: var(--violet); }
.material-pager span { color: var(--faint); font-size: 0.75rem; }

/* 최근 학습 기록 */
.recent-history-list { display: grid; }
.recent-history-item { display: grid; gap: 7px; padding: 16px 24px; }
.recent-history-item + .recent-history-item { border-top: 1px solid var(--line); }
.recent-history-item-top { display: flex; align-items: center; gap: 8px; }
.recent-history-item-top strong { color: var(--ink); font-size: 0.8438rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.history-mode-pill {
  display: inline-flex; align-items: center;
  min-height: 21px; padding: 1px 9px;
  border-radius: 999px;
  color: var(--violet-deep); background: var(--violet-tint);
  font-size: 0.6562rem; font-weight: 700;
}
.history-chevron { margin-left: auto; color: var(--faint); font-size: 0.9375rem; }
.recent-history-item-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; }
.recent-history-item-bottom > span:first-child { overflow: hidden; color: var(--muted); font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.recent-history-item-bottom > span:last-child { flex: none; color: var(--faint); font-size: 0.7188rem; }
.recent-history-item-bottom b { color: var(--green); font-family: var(--font-num); font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.recent-history-item-bottom em { margin-left: 8px; color: var(--violet); font-style: normal; font-family: var(--font-num); font-weight: 600; font-variant-numeric: tabular-nums; }
.recent-history-empty { padding: 34px 24px; color: var(--muted); font-size: 0.8125rem; text-align: center; }
.recent-history-footnote { margin: 0; padding: 11px 24px; border-top: 1px solid var(--line); color: var(--faint); font-size: 0.6875rem; text-align: center; }
@media (min-width: 1241px) {
  .recent-history-panel { position: sticky; top: 20px; }
}

/* 전체 기록 테이블 */
.detailed-history-card {
  margin-top: 20px;
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--card); box-shadow: var(--shadow-card);
  overflow: hidden;
}
.history-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.history-title { color: var(--ink); font-size: 1rem; font-weight: 800; }
.history-clear-btn { min-height: 32px; font-size: 0.75rem; }
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: 0.7812rem; }
.history-table th { padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--faint); background: var(--wash); font-size: 0.6875rem; font-weight: 700; text-align: left; white-space: nowrap; }
.history-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--text); font-variant-numeric: tabular-nums; }
.history-empty-row { padding: 28px !important; color: var(--muted); text-align: center; }

/* 8. 연습 화면 ---------------------------------------------------------------- */
.practice-preflight {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 12px 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card);
}
.practice-preflight strong { color: var(--ink); font-size: 0.8125rem; font-weight: 700; margin-right: 4px; }
.practice-preflight span {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 26px; padding: 2px 11px;
  border-radius: 999px;
  color: var(--muted); background: var(--wash); border: 1px solid var(--line);
  font-size: 0.7188rem; font-weight: 600;
}
.practice-preflight span::before { content: '✓'; color: var(--green); font-weight: 700; }

.practice-current-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 14px; padding: 16px 22px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card);
}
.practice-current-main { display: grid; gap: 3px; min-width: 0; }
.practice-current-main span { color: var(--faint); font-size: 0.7188rem; font-weight: 600; }
.practice-current-main strong { overflow: hidden; color: var(--ink); font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.03em; text-overflow: ellipsis; white-space: nowrap; }

.mode-card { margin-bottom: 14px; padding: 16px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.mode-title { margin-bottom: 10px; color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.mode-button-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 440px; }
.mode-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  color: var(--text); background: var(--card);
  font-size: 0.8438rem; font-weight: 600;
}
.mode-btn-ico { display: inline-flex; font-size: 1.125rem; }
.mode-btn:hover:not(:disabled) { border-color: var(--violet); color: var(--violet); }
.mode-btn.active { border-color: transparent; color: #fff; background: var(--violet); font-weight: 700; }

.paragraph-card { margin-bottom: 14px; padding: 16px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.paragraph-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.paragraph-head strong { color: var(--ink); font-size: 0.8438rem; font-weight: 700; }
.paragraph-head span { margin-left: 8px; color: var(--faint); font-size: 0.7188rem; }
.paragraph-rule { color: var(--faint); font-size: 0.6875rem; font-weight: 600; }
.paragraph-buttons { display: flex; gap: 7px; flex-wrap: wrap; }
.paragraph-btn {
  display: inline-flex; align-items: baseline; gap: 4px;
  min-height: 32px; padding: 4px 13px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--text); background: var(--card);
  font-size: 0.75rem; font-weight: 600;
}
.paragraph-btn small { color: var(--faint); font-size: 0.625rem; font-variant-numeric: tabular-nums; }
.paragraph-btn:hover { border-color: var(--violet); color: var(--violet); }
.paragraph-btn.active { border-color: transparent; color: #fff; background: var(--violet); }
.paragraph-btn.active small { color: rgba(255, 255, 255, .75); }
.paragraph-empty { color: var(--faint); font-size: 0.75rem; }

.study-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.source-panel, .practice-card { display: flex; flex-direction: column; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-card); }
.panel-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.panel-title { color: var(--ink); font-size: 0.9375rem; font-weight: 800; }
.practice-subtitle { margin-top: 3px; color: var(--faint); font-size: 0.7188rem; }
.source-tools, .practice-top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.source-material-badge { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abbr-switch {
  display: flex; align-items: center; gap: 12px;
  width: 100%; margin: 12px 0 0; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--wash);
  text-align: left;
  transition: border-color .15s ease, background-color .15s ease;
}
.abbr-switch.on { border-color: #d8cffb; background: var(--violet-wash); }
.abbr-switch:hover { border-color: var(--line-strong); }
.abbr-switch.on:hover { border-color: #c4b7f8; }
.abbr-switch-track {
  position: relative; flex: none;
  width: 42px; height: 24px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background-color .18s ease;
}
.abbr-switch.on .abbr-switch-track { background: var(--violet); }
.abbr-switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(23, 26, 43, .25);
  transition: transform .18s ease;
}
.abbr-switch.on .abbr-switch-thumb { transform: translateX(18px); }
.abbr-switch-copy { display: grid; gap: 1px; min-width: 0; flex: 1; }
.abbr-switch-copy b { color: var(--ink); font-size: 0.8438rem; font-weight: 700; }
.abbr-switch-copy em { color: var(--muted); font-size: 0.7188rem; font-style: normal; }
.abbr-switch.on .abbr-switch-copy em { color: var(--violet-deep); }

.pace-status-line {
  display: flex; align-items: center; gap: 6px;
  min-height: 36px; margin: 12px 0; padding: 8px 12px;
  border: 1px solid #e2ddf9; border-radius: var(--r-ctl);
  color: var(--violet-deep); background: var(--violet-wash);
  font-size: 0.7188rem; font-weight: 600;
}
.pace-status-line b { color: var(--violet); font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.pace-status-line em { overflow: hidden; color: var(--muted); font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.pace-empty { color: var(--faint); font-size: 0.75rem; }

.source-readonly, #typingArea, .listen-mask { flex: none; height: clamp(380px, 52vh, 580px); min-height: 380px; max-height: 580px; border-radius: 12px; }
.source-readonly {
  overflow: auto; padding: 18px;
  border: 1px solid var(--line);
  color: var(--text); background: var(--wash);
  font-size: 0.9375rem; line-height: 2; white-space: pre-wrap; word-break: break-all;
}
.source-readonly span { transition: color .12s ease, background-color .12s ease; }
.source-readonly .pace-passed { color: var(--text); }
.source-readonly .abbr-highlight { color: #7a4c12; background: #fef3c7; border-radius: 3px; box-shadow: 0 0 0 1px #fef3c7; cursor: help; }
.source-readonly .abbr-highlight:hover { background: #fde68a; box-shadow: 0 0 0 1px #f2c94c; }
.abbr-tooltip { position: absolute; z-index: 2400; display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: #1f2430; color: #fff; border-radius: 10px; font-size: 0.8125rem; font-weight: 700; box-shadow: 0 8px 22px rgba(15, 23, 42, 0.28); pointer-events: none; white-space: nowrap; max-width: min(90vw, 420px); }
.abbr-tooltip b { color: #fde68a; font-weight: 900; }
.abbr-tooltip .abbr-tooltip-code { font-family: 'Pretendard', monospace; letter-spacing: 0.06em; color: #dbe2f0; font-weight: 800; }
.source-readonly .pace-current { color: var(--ink); background: #d9cffb; border-radius: 3px; box-shadow: 0 0 0 1px #d9cffb; }
.source-readonly .abbr-highlight.pace-current { color: var(--ink); background: #d9cffb; box-shadow: 0 0 0 1px #d9cffb; }

.listen-mask {
  display: none; place-items: center; padding: 24px;
  border: 1px dashed var(--line-strong);
  color: var(--muted); background: var(--wash);
  text-align: center; line-height: 1.75;
}
.listen-mask strong { color: var(--ink); font-size: 1rem; }
body.listen-mode .source-readonly, body.listen-mode .pace-status-line, body.listen-mode .paragraph-card { display: none; }
body.listen-mode .listen-mask { display: grid; }
body.listen-mode .study-layout { grid-template-columns: minmax(0, 1fr); }
body.listen-mode .source-panel { display: none; }
body.listen-mode .audio-panel { display: block; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
body:not(.listen-mode) .practice-card > .stats-grid { margin-bottom: 36px; }
.stat-card { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--wash); }
.stat-label { display: block; color: var(--faint); font-size: 0.6562rem; font-weight: 600; }
.stat-readout { display: flex; align-items: baseline; gap: 2px; margin-top: 3px; }
.stat-value {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em;
  text-overflow: ellipsis; white-space: nowrap;
}
.stat-unit { color: var(--faint); font-size: 0.6562rem; }

.audio-panel { display: none; margin: 14px 0; padding: 14px; border: 1px solid #e2ddf9; border-radius: 12px; background: var(--violet-wash); }
.audio-top, .audio-seek, .audio-controls, .smart-pause-line { display: flex; align-items: center; gap: 9px; }
.audio-top { justify-content: space-between; }
.audio-title { color: var(--violet-deep); font-size: 0.7812rem; font-weight: 700; }
.audio-seek { margin-top: 10px; }
.audio-seek input[type="range"] { width: 100%; accent-color: var(--violet); }
.time-info { color: var(--muted); font-size: 0.6875rem; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.audio-controls { justify-content: center; margin-top: 10px; }
.audio-controls .btn-secondary, .audio-controls .btn-primary { min-height: 32px; padding: 0 11px; font-size: 0.7188rem; }
.speed-control { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); }
.speed-control button { width: 27px; height: 30px; color: var(--muted); font-weight: 800; }
.speed-control button:hover { color: var(--violet); background: var(--wash); }
.speed-display { display: inline-grid; width: 34px; place-items: center; color: var(--violet-deep); font-family: var(--font-num); font-size: 0.7188rem; font-weight: 700; }
.smart-pause-line { flex-wrap: wrap; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: 0.6875rem; }
.smart-pause-label-wrap { display: inline-flex; align-items: center; gap: 5px; }
.smart-pause-line input[type="number"] { width: 48px; height: 26px; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--card); text-align: center; font-variant-numeric: tabular-nums; }
.smart-pause-line b { font-variant-numeric: tabular-nums; }
.info-tooltip {
  position: relative;
  display: inline-grid; place-items: center;
  width: 15px; height: 15px;
  border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--faint); font-size: 0.5625rem; font-weight: 700;
  cursor: help;
}
.info-tooltip:hover::after, .info-tooltip:focus::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  z-index: 20;
  width: 230px; padding: 9px 11px;
  border-radius: 8px;
  color: #fff; background: var(--ink);
  font-size: 0.6875rem; font-weight: 500; line-height: 1.5; text-align: left;
  box-shadow: var(--shadow-pop);
}

#typingArea {
  display: block; width: 100%; resize: vertical; padding: 18px;
  border: 1px solid var(--line-strong);
  color: var(--ink); background: var(--card);
  font-size: 0.9375rem; line-height: 2; outline: 0;
}
#typingArea::placeholder { color: var(--faint); }
#typingArea:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(91, 61, 240, .09); }
#typingArea.paused-warning { border-color: #ecb576; background: #fffaf3; }
.smart-pause-alert { display: none; margin-top: 10px; padding: 10px 13px; border: 1px solid #f0cf9f; border-radius: var(--r-ctl); color: var(--amber); background: var(--amber-tint); font-size: 0.7188rem; }
#typingArea.paused-warning + .smart-pause-alert { display: grid; gap: 2px; }

.practice-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.tip-text { color: var(--faint); font-size: 0.7188rem; }
.btn-row { display: flex; gap: 8px; }

/* 9. 채점 모달 --------------------------------------------------------------- */
.modal-overlay { position: fixed; z-index: 1000; inset: 0; display: none; overflow: auto; padding: 28px 16px; background: rgba(18, 19, 36, .45); }
.modal-content { position: relative; width: min(700px, 100%); margin: 4vh auto; padding: 30px; border-radius: var(--r-card); color: var(--text); background: var(--card); box-shadow: var(--shadow-pop); }
.close-btn { position: absolute; top: 12px; right: 16px; color: var(--faint); font-size: 1.625rem; line-height: 1; cursor: pointer; }
.close-btn:hover { color: var(--ink); }
.score-circle { display: grid; width: 132px; height: 132px; margin: 18px auto; place-content: center; border: 7px solid var(--violet-tint); border-radius: 50%; color: var(--violet); text-align: center; }
.score-number { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.875rem; font-weight: 700; letter-spacing: -0.02em; }
.score-label { color: var(--faint); font-size: 0.6875rem; font-weight: 600; }
.score-grade { color: var(--ink); font-size: 0.875rem; font-weight: 700; text-align: center; }
.score-detail { margin: 14px 0; padding: 11px; border-radius: var(--r-ctl); color: var(--muted); background: var(--wash); font-size: 0.7812rem; text-align: center; }
.diff-view { max-height: min(330px, 42vh); overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); color: var(--text); background: var(--wash); line-height: 1.9; white-space: pre-wrap; word-break: break-all; }
.d-wrong { color: var(--amber); background: var(--amber-tint); font-weight: 700; }
.d-wrong .correction { color: var(--violet-deep); font-size: .78em; }
.d-missing { color: #fff; background: var(--red); text-decoration: underline; font-weight: 700; }
.d-added { color: #fff; background: #a04252; text-decoration: line-through; font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* 10. 과정 잠금 · 승급 요약 잔여 훅 -------------------------------------------- */
.course-locked-card { width: min(720px, 100%); margin: 60px auto; padding: 36px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-card); text-align: center; }
/* 잠긴 반: 본문을 블라인드처럼 흐리게 하고 잠금 안내 오버레이를 표시 */
.course-entry-locked .main-content { position: relative; overflow: hidden; }
.course-entry-locked .main-content > *:not(.course-locked-overlay) { filter: blur(7px) saturate(.85); pointer-events: none; user-select: none; }
.course-locked-overlay { position: absolute; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 24px; background: rgba(248, 250, 252, .55); backdrop-filter: blur(2px); overflow-y: auto; }
.course-locked-overlay .course-locked-card { margin: min(12vh, 120px) auto 40px; animation: course-lock-in .3s ease; }
@keyframes course-lock-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.course-locked-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 14px; place-items: center; border-radius: 14px; background: var(--violet-tint); font-size: 1.5rem; }
.course-locked-card h2 { margin: 0; color: var(--ink); font-size: 1.3125rem; font-weight: 800; letter-spacing: -0.04em; }
.course-locked-card p { color: var(--muted); }
.course-locked-rule { margin: 18px 0; padding: 14px; border-radius: var(--r-ctl); color: var(--muted); background: var(--wash); font-size: 0.7812rem; text-align: left; }
.course-locked-rule b { display: block; margin-bottom: 4px; color: var(--violet); }
.progress-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--wash); font-size: 0.75rem; }
.progress-pill span { color: var(--faint); }
.progress-pill b { color: var(--ink); font-weight: 700; }

/* 11. 반응형 ----------------------------------------------------------------- */
@media (max-width: 1240px) {
  .page-header { flex-direction: column; align-items: stretch; gap: 18px; }
  .learning-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .recommendation-card { grid-template-columns: minmax(0, 1fr); }
  .recommendation-goal { border-left: 0; border-top: 1px solid var(--line); }
  .library-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .main-content { width: 100%; padding: 76px clamp(14px, 3vw, 24px) 32px; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-pop);
  }
  .sidebar.active { transform: translateX(0); }
  .sidebar-close-btn { display: grid; place-items: center; width: 32px; height: 32px; font-size: 1.25rem; color: var(--muted); }
  .sidebar-overlay { position: fixed; z-index: 40; inset: 0; display: block; visibility: hidden; background: rgba(18, 19, 36, .35); opacity: 0; transition: opacity .2s ease, visibility .2s ease; }
  .sidebar-overlay.active { visibility: visible; opacity: 1; }
  body.sidebar-open { overflow: hidden; }
  .mobile-menu-btn {
    position: fixed; z-index: 35; top: 14px; left: 14px;
    display: grid; place-items: center; width: 42px; height: 42px;
    border: 1px solid var(--line); border-radius: 12px;
    color: var(--violet); background: var(--card);
    box-shadow: var(--shadow-card);
    font-size: 1.1875rem;
  }
  .filter-row, .filter-control-group { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .filter-row-combined { grid-template-columns: minmax(0, 1fr); }
  .level-list { grid-template-columns: repeat(var(--mobile-level-count, 4), minmax(0, 1fr)); }
  .study-layout { grid-template-columns: minmax(0, 1fr); }
  .source-readonly, #typingArea, .listen-mask { height: 400px; min-height: 400px; max-height: 400px; }
}
@media (max-width: 640px) {
  .learning-summary { grid-template-columns: minmax(0, 1fr); }
  .summary-card + .summary-card { border-left: 0; border-top: 1px solid var(--line); }
  .summary-card { padding: 13px 18px; }
  .recommendation-main { padding: 22px 20px; }
  .recommendation-goal { padding: 22px 20px; }
  .start-practice-btn { width: 100%; min-width: 0; }
  .material-browser-head, .recent-history-head, .current-condition-row, .filter-row, .material-list-head { padding-left: 18px; padding-right: 18px; }
  .material-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main action" "stats action"; row-gap: 8px; padding: 14px 18px; }
  .material-row-level { display: none; }
  .material-row-main { grid-area: main; }
  .material-row-stats { grid-area: stats; justify-content: flex-start; }
  .material-row-stat { justify-items: start; }
  .action-cell { grid-area: action; align-self: center; }
  .recent-history-item { padding: 14px 18px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-actions { flex-direction: column; align-items: stretch; }
  .btn-row { justify-content: stretch; }
  .btn-row button { flex: 1; }
  .goal-ladder { flex-wrap: wrap; gap: 6px; }
  .ladder-link { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --------------------------------------------------------------------------
   Practice screen fixes 20260704-v2
   -------------------------------------------------------------------------- */
/* ① 리셋/채점 버튼 수축 방지: 팁이 공간을 양보하고 버튼은 절대 줄바꿈하지 않는다 */
.practice-actions .tip-text { flex: 1 1 auto; min-width: 0; }
.btn-row { flex: none; }
.btn-row button { flex: none; white-space: nowrap; }

/* ② 듣고치기: "위에 테이프덱, 아래에 종이" — 전사 도구의 검증된 세로 흐름.
   오디오는 입력창 바로 위의 가로 트랜스포트 바, 재생이 이 화면의 주 액션이다. */
body.listen-mode .practice-card { display: block; }
body.listen-mode #typingArea { height: clamp(320px, 44vh, 460px); min-height: 320px; }

/* 오디오 패널 = 트랜스포트 바: [◀ ▶재생 ▶] ———시크——— / 스마트 일시정지 */
body.listen-mode .audio-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "top      top"
    "controls seek"
    "pause    pause";
  align-items: center;
  column-gap: 18px;
  margin: 14px 0 12px;
  padding: 14px 18px;
}
body.listen-mode .audio-top { grid-area: top; margin-bottom: 10px; }
body.listen-mode .audio-controls { grid-area: controls; justify-content: flex-start; margin-top: 0; }
body.listen-mode .audio-seek { grid-area: seek; margin-top: 0; }
body.listen-mode .smart-pause-line { grid-area: pause; margin-top: 12px; padding-top: 10px; border-top: 1px solid #e6e1fb; }

/* 재생은 듣고치기의 주 액션: 채움 보라로 복권, 크기도 키운다 */
.audio-play-btn, .audio-play-btn:hover { border-color: transparent; color: #fff; }
.audio-play-btn { min-height: 40px; padding: 0 26px; background: var(--violet); font-size: 0.875rem; font-weight: 700; letter-spacing: -0.01em; }
.audio-play-btn:hover { background: var(--violet-deep); }
.audio-controls .btn-secondary { min-height: 34px; }

@media (max-width: 980px) {
  body.listen-mode .audio-panel { display: block; }
  body.listen-mode .audio-seek { margin-top: 10px; }
  body.listen-mode .audio-controls { justify-content: center; margin-top: 10px; }
  body.listen-mode .practice-card #typingArea { height: 400px; }
}

/* ③ 연습 화면 헤더 밀도: 현재 자료와 연습 방식을 한 줄에 나란히 */
.practice-screen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.practice-screen > .practice-preflight,
.practice-screen > .paragraph-card,
.practice-screen > .study-layout { grid-column: 1 / -1; }
.practice-preflight, .practice-current-card, .mode-card, .paragraph-card { margin-bottom: 0; }
.practice-current-card, .mode-card { padding: 14px 20px; }
.mode-title { margin-bottom: 8px; }
.mode-button-grid { max-width: none; }
@media (max-width: 980px) {
  .practice-screen { grid-template-columns: minmax(0, 1fr); }
}

/* ⑤ 페이스메이커 줄: flex gap이 문장 사이에 끼지 않게 정리 */
.pace-status-line { gap: 0; }
.pace-status-line > span:first-child { margin-right: 8px; }
.pace-status-line em { margin-left: 6px; }

/* ⑤ 준비사항: 완료 체크가 아니라 리마인더이므로 중립 불릿으로 */
.practice-preflight span::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }

/* --------------------------------------------------------------------------
   오디오 재생 영역 글자 크기 +20% (20260704-v8)
   패널 안의 모든 텍스트를 한 단계 키워 가독성을 높인다. 통계·입력창 등
   다른 영역은 그대로 두기 위해 .audio-panel 범위로만 한정한다.
   -------------------------------------------------------------------------- */
.audio-panel .audio-title { font-size: 0.9375rem; }
.audio-panel .count-badge { font-size: 0.8125rem; }
.audio-panel .time-info { font-size: 0.8125rem; }
.audio-panel .audio-controls .btn-secondary,
.audio-panel .audio-controls .btn-primary { font-size: 0.875rem; }
.audio-panel .audio-play-btn { font-size: 1.0312rem; }
.audio-panel .speed-display { width: 40px; font-size: 0.875rem; }
.audio-panel .speed-control button { font-size: 1rem; }
.audio-panel .smart-pause-line { font-size: 0.8125rem; }
