/* 한글 스타일 주석: Inter를 영어에, 한국어는 시스템 폰트에 맡기고 피로가 적은 색상 토큰을 적용해요. */
:root {
  color: #0f172a;
  background: #f8fafc;
  font-family: Inter, Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
}

/* 한글 스타일 주석: 브랜드 전체를 클릭 가능한 홈 버튼으로 보여주고 가벼운 호버/키보드 강조를 제공해요. */
.brand-link {
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: opacity .16s ease, transform .16s ease;
}

.brand-link:hover {
  transform: translateY(-1px);
  opacity: .9;
}

.brand-link:hover .brand-mark {
  box-shadow: 0 10px 22px #5b5ce244;
}

.brand-copy {
  display: grid;
  min-width: 0;
}

/* 한글 스타일 주석: Voca Impulse 이름과 VIP 배지가 작은 화면에서도 또렷하게 보이도록 자간을 맞춰요. */
.brand-name {
  letter-spacing: -.035em;
}

.brand-mark {
  font-size: 12px;
  letter-spacing: -.045em;
}

.brand-link:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 3px;
}

@media (max-width: 650px) {
  .brand-link { align-self: flex-start; }
}

body {
  background: radial-gradient(circle at 82% 0%, #eef2ff 0, transparent 30rem), #f8fafc;
}

/* 한국어 설명: 전체 기억 분포를 한 개의 카드와 단계별 색상 바로 간결하게 보여줘요. */
.retention-panel,
.roadmap-section,
.quick-action-hub {
  margin: 0 0 22px;
}

.retention-panel {
  padding: 22px 24px 17px;
  border: 1px solid #e7eaf1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 28px #22304a0a;
}

.retention-heading,
.roadmap-heading,
.quick-action-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.retention-heading h2,
.roadmap-heading h2,
.quick-action-heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.04em;
}

.retention-heading .eyebrow,
.roadmap-heading .eyebrow,
.quick-action-heading .eyebrow {
  margin-bottom: 5px;
  font-size: 10px;
}

.retention-total {
  margin: 0;
  color: #68758a;
  font-size: 13px;
  font-weight: 700;
}

.retention-bar {
  display: flex;
  height: 13px;
  overflow: hidden;
  margin: 20px 0 17px;
  border-radius: 999px;
  background: #eef1f6;
}

.retention-segment {
  min-width: 0;
  transition: width .4s ease;
}

.retention-segment-new,
.retention-dot-new { background: #cbd5e1; }
.retention-segment-learning,
.retention-dot-learning { background: #f4b35e; }
.retention-segment-reviewing,
.retention-dot-reviewing { background: #6b8bf5; }
.retention-segment-mastered,
.retention-dot-mastered { background: #42b98b; }

.retention-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.retention-tier {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #68758a;
  font-size: 12px;
}

.retention-tier strong {
  color: #1e293b;
  font-size: 13px;
}

.retention-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.retention-footnote {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid #eef0f5;
  color: #68758a;
  font-size: 11px;
}

.retention-footnote strong {
  margin-left: 3px;
  color: #334155;
}

/* 한국어 설명: 데크 수가 늘어나도 카드 크기를 자동 조정하는 로드맵 그리드예요. */
.roadmap-section {
  padding: 3px 0;
}

.roadmap-heading {
  margin-bottom: 14px;
}

.roadmap-heading > div > p:last-child {
  margin: 6px 0 0;
  color: #68758a;
  font-size: 12px;
}

.roadmap-all-button {
  max-width: none;
  flex: 0 0 auto;
}

.chapter-roadmap {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.chapter-card {
  min-width: 0;
  padding: 15px 14px 13px;
  border: 1px solid #e7eaf1;
  border-radius: 15px;
  color: #1e293b;
  background: #fff;
  box-shadow: 0 5px 18px #22304a08;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.chapter-card:hover {
  transform: translateY(-2px);
  border-color: #c4c5ff;
  box-shadow: 0 10px 24px #5b5ce21a;
}

.chapter-card[aria-current="true"] {
  border-color: #5b5ce2;
  background: #f8f8ff;
  box-shadow: 0 0 0 2px #5b5ce21a, 0 8px 22px #5b5ce212;
}

.chapter-card:focus-visible,
.roadmap-all-button:focus-visible {
  outline: 3px solid #a5a6ff;
  outline-offset: 2px;
}

.chapter-card-top,
.chapter-card-progress-copy {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.chapter-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.chapter-card-subtitle {
  display: block;
  margin-top: 4px;
  color: #68758a;
  font-size: 10px;
  line-height: 1.4;
}

.chapter-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: #64748b;
  background: #f1f4f8;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.chapter-status.is-active {
  color: #5b5ce2;
  background: #eeeefe;
}

.chapter-status.is-complete {
  color: #147a54;
  background: #e8f8f0;
}

.chapter-card-progress-copy {
  align-items: baseline;
  margin-top: 16px;
  color: #68758a;
  font-size: 10px;
}

.chapter-card-progress-copy strong {
  color: #263247;
  font-size: 13px;
}

.chapter-progress-track {
  height: 5px;
  overflow: hidden;
  margin-top: 8px;
  border-radius: 999px;
  background: #edf0f6;
}

.chapter-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7778f2, #4d9bea);
  transition: width .35s ease;
}

.chapter-card[aria-current="true"] .chapter-progress-fill {
  background: linear-gradient(90deg, #5b5ce2, #7c68ef);
}

/* 한국어 스타일 주석: 첫 화면에서는 주 학습 CTA와 핵심 훈련을 한 카드에 모아 가장 먼저 보이게 해요. */
.main-panel {
  min-height: 0;
  padding: clamp(18px, 3vw, 28px);
}

.panel-content {
  max-width: none;
}

.study-cta-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 1.2fr);
  align-items: center;
  gap: 26px;
  min-height: 190px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid #dfe4ff;
  border-radius: 20px;
  background: linear-gradient(120deg, #f4f4ff 0%, #fff 56%, #eff6ff 100%);
  box-shadow: 0 10px 30px #4f46e50d;
}

.study-cta-copy .eyebrow {
  margin: 0 0 8px;
  color: #4f46e5;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .12em;
}

.study-cta-copy h2 {
  margin: 0;
  color: #172033;
  font-size: clamp(21px, 3.3vw, 29px);
  font-weight: 850;
  letter-spacing: -.045em;
}

.study-cta-subtitle {
  margin: 9px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
}

.core-training-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* 한국어 스타일 주석: 진한 그라데이션과 그림자로 가장 중요한 시작 버튼을 다른 액션보다 강조해요. */
.button.primary-study-button {
  grid-column: 1 / -1;
  min-height: 58px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(115deg, #4f46e5, #3b82f6);
  box-shadow: 0 9px 20px #4f46e533;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.01em;
}

.button.primary-study-button:hover:not(:disabled) {
  background: linear-gradient(115deg, #4338ca, #2563eb);
  box-shadow: 0 12px 24px #4f46e540;
}

/* 한국어 스타일 주석: 동의어/빈칸과 복습 도구는 흰 바탕의 경계선 카드로 한 단계 낮춰 표현해요. */
.button.secondary.secondary-study-button {
  min-height: 46px;
  border-radius: 13px;
  color: #334155;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
}

.button.secondary.secondary-study-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #c7d2fe;
  color: #4338ca;
  background: #fbfbff;
  box-shadow: 0 6px 15px #4f46e510;
}

/* 한국어 스타일 주석: 도구 허브 안의 Pod는 용도별로 경계와 제목을 분리해 선택 부담을 낮춰요. */
.quick-action-hub {
  padding: 19px 21px;
  border: 1px solid #e7eaf1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 24px #22304a08;
}

.quick-action-heading {
  margin-bottom: 14px;
}

.selected-deck-label {
  padding: 6px 10px;
  border-radius: 999px;
  color: #5052ce;
  background: #f0f0ff;
  font-size: 11px;
  font-weight: 800;
}

.action-pods {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr);
  gap: 13px;
}

.action-pods.review-actions-only {
  grid-template-columns: minmax(0, 1fr);
}

.action-pod {
  min-width: 0;
  padding: 15px;
  border: 1px solid #e8ebf2;
  border-radius: 15px;
  background: #fff;
}

.action-pod-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.action-pod-icon {
  font-size: 15px;
}

.action-pod-heading h3 {
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

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

.pod-actions .button {
  min-width: 0;
  min-height: 42px;
  padding: 8px 11px;
  font-size: 11px;
  line-height: 1.35;
}

.tertiary-actions {
  grid-template-columns: 1fr;
  gap: 5px;
}

/* 한국어 스타일 주석: 백업과 프로필 전환은 얇은 pill 버튼으로 두어 보조 기능의 시각적 무게를 줄여요. */
.button.tertiary-action {
  min-height: 35px !important;
  justify-content: flex-start;
  padding: 0 10px !important;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #64748b;
  background: transparent;
  box-shadow: none;
  font-size: 11px !important;
  font-weight: 650;
}

.button.tertiary-action:hover:not(:disabled) {
  transform: none;
  border-color: #e2e8f0;
  color: #334155;
  background: #f8fafc;
  box-shadow: none;
}

.button.tertiary-action:disabled {
  transform: none;
}

.data-pod .backup-status {
  min-height: 0;
  margin: 4px 0 0;
  font-size: 11px;
}

.data-pod .backup-status:not(:empty) {
  min-height: 20px;
}

.pod-note {
  margin: 7px 0 0;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.5;
}

.analytics-trigger-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #d8d9ff;
  border-radius: 10px;
  color: #4d4ec8;
  background: #f4f4ff;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  transition: background .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.settings-trigger-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #475569;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  transition: border-color .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease;
}

.settings-trigger-button:hover:not(:disabled) {
  border-color: #c7d2fe;
  color: #4338ca;
  background: #f8f8ff;
  box-shadow: 0 5px 14px #5b5ce214;
}

.settings-trigger-button:focus-visible {
  outline: 3px solid #a5a6ff;
  outline-offset: 2px;
}

.analytics-trigger-button:hover:not(:disabled) {
  border-color: #bfc0ff;
  background: #ececff;
  box-shadow: 0 5px 14px #5b5ce21a;
}

.analytics-trigger-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.analytics-trigger-button:focus-visible,
.analytics-close-button:focus-visible,
.analytics-modal-footer .button:focus-visible,
.settings-trigger-button:focus-visible {
  outline: 3px solid #a5a6ff;
  outline-offset: 2px;
}

/* 한국어 설명: 분석 모달은 어두운 흐림 배경 위 중앙에 나타나고 닫힐 때 부드럽게 사라져요. */
.analytics-overlay {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .24s ease, visibility 0s linear .24s;
}

.analytics-overlay[hidden] {
  display: none;
}

body.analytics-open {
  overflow: hidden;
}

body.settings-open {
  overflow: hidden;
}

.analytics-overlay.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.analytics-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #12192dcc;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.analytics-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 980px);
  max-height: min(92vh, 920px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #ffffffa8;
  border-radius: 24px;
  background: #f8f9fd;
  box-shadow: 0 28px 100px #10182866;
  transform: translateY(12px) scale(.985);
  transition: transform .24s ease;
}

.analytics-overlay.is-open .analytics-dialog {
  transform: translateY(0) scale(1);
}

.analytics-modal-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 29px 16px;
}

.analytics-modal-header .eyebrow {
  margin: 0 0 6px;
  color: #6465d9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.analytics-modal-header h2 {
  margin: 0;
  color: #1e293b;
  font-size: clamp(20px, 3vw, 27px);
  letter-spacing: -.045em;
}

.analytics-modal-header > div > p:last-child {
  margin: 7px 0 0;
  color: #68758a;
  font-size: 13px;
}

.analytics-close-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid #e2e6ef;
  border-radius: 12px;
  color: #475569;
  background: #fff;
  font-size: 17px;
  transition: border-color .16s ease, background .16s ease;
}

.analytics-close-button:hover {
  border-color: #c4c5ff;
  background: #f2f2ff;
}

.analytics-modal-content {
  min-height: 0;
  overflow-y: auto;
  padding: 0 29px 5px;
  overscroll-behavior: contain;
}

.analytics-modal-content .retention-panel {
  margin-bottom: 20px;
}

.analytics-modal-content .roadmap-section {
  margin-bottom: 10px;
}

.analytics-modal-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 29px 20px;
  border-top: 1px solid #e8ebf2;
  color: #68758a;
  font-size: 12px;
}

.analytics-modal-footer .button {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 18px;
  font-size: 12px;
}

/* 한글 스타일 주석: 넓은 분석 모달 스타일을 재사용하되 설정은 짧고 스크롤하기 편한 폭으로 제한해요. */
.settings-dialog {
  width: min(100%, 720px);
  max-height: min(90vh, 860px);
}

.settings-modal-content {
  display: grid;
  gap: 12px;
  padding-top: 2px;
  padding-bottom: 16px;
}

.settings-section {
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid #e7eaf1;
  border-radius: 16px;
  background: #fff;
}

.settings-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 13px;
}

.settings-section-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 11px;
  background: #f0f1ff;
  font-size: 16px;
}

.settings-section-heading h3 {
  margin: 0;
  color: #263247;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -.025em;
}

.settings-section-heading p {
  margin: 4px 0 0;
  color: #748096;
  font-size: 11px;
  line-height: 1.5;
}

.settings-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 13px;
  border: 1px solid #edf0f5;
  border-radius: 12px;
  background: #fafbfe;
}

.settings-option-copy {
  display: grid;
  gap: 4px;
}

.settings-option-copy strong,
.settings-session-select > span {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.settings-option-copy span {
  color: #748096;
  font-size: 10px;
  line-height: 1.5;
}

.settings-session-select {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
}

.settings-session-select select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #dfe4ee;
  border-radius: 11px;
  color: #334155;
  background: #fff;
  font-size: 12px;
}

.settings-session-select select:focus-visible,
.feedback-form textarea:focus-visible {
  outline: 3px solid #c7d2fe;
  outline-offset: 2px;
  border-color: #818cf8;
}

.settings-data-pod {
  padding: 0;
  border: 0;
  background: transparent;
}

.settings-data-pod .tertiary-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 12px;
}

.settings-data-pod .button.tertiary-action {
  min-height: 40px !important;
  padding: 0 12px !important;
  border-color: #edf0f5;
  border-radius: 11px;
  background: #fafbfe;
  font-size: 11px !important;
}

.settings-data-pod .button.tertiary-action:hover:not(:disabled) {
  border-color: #c7d2fe;
  color: #4338ca;
  background: #f7f7ff;
}

.settings-data-pod .backup-status:not(:empty) {
  min-height: 20px;
  margin-top: 9px;
}

.feedback-form {
  display: grid;
  gap: 9px;
}

.feedback-form textarea {
  width: 100%;
  min-height: 105px;
  resize: vertical;
  padding: 12px 13px;
  border: 1px solid #dfe4ee;
  border-radius: 12px;
  color: #334155;
  background: #fff;
  font: inherit;
  font-size: 12px;
  line-height: 1.6;
}

.feedback-form textarea::placeholder {
  color: #9aa4b4;
}

.feedback-privacy-note {
  margin: 0;
  color: #8a94a5;
  font-size: 10px;
  line-height: 1.5;
}

.feedback-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feedback-status {
  min-height: 18px;
  margin: 0;
  color: #18794e;
  font-size: 11px;
  line-height: 1.5;
}

.feedback-submit-button {
  min-height: 39px;
  flex: 0 0 auto;
  padding: 0 16px;
  font-size: 12px;
}

.settings-modal-footer {
  justify-content: flex-end;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 900px) {
  .chapter-roadmap {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .study-cta-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .action-pods {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .retention-panel {
    padding: 18px 15px 14px;
  }

  .retention-heading h2,
  .roadmap-heading h2,
  .quick-action-heading h2 {
    font-size: 18px;
  }

  .retention-total {
    max-width: 120px;
    font-size: 11px;
    text-align: right;
  }

  .retention-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 12px;
  }

  .retention-footnote {
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
  }

  .chapter-roadmap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .chapter-card {
    padding: 12px 10px;
  }

  .chapter-card-top {
    flex-direction: column;
  }

  .chapter-card-progress-copy {
    margin-top: 11px;
  }

  .roadmap-heading {
    align-items: flex-end;
  }

  .roadmap-heading > div > p:last-child {
    max-width: 230px;
    line-height: 1.5;
  }

  .quick-action-hub {
    padding: 17px 14px;
  }

  .core-training-actions,
  .pod-actions {
    grid-template-columns: 1fr;
  }

  .primary-study-button {
    grid-column: auto;
  }

  .action-pod {
    padding: 13px;
  }

  .analytics-overlay {
    padding: 10px;
  }

  .analytics-dialog {
    max-height: 95vh;
    border-radius: 19px;
  }

  .settings-dialog {
    max-height: 96vh;
  }

  .analytics-modal-header {
    gap: 12px;
    padding: 20px 17px 14px;
  }

  .analytics-modal-content {
    padding: 0 15px 4px;
  }

  .analytics-modal-content .roadmap-heading {
    align-items: flex-start;
  }

  .analytics-modal-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 17px 16px;
  }

  .analytics-modal-footer .button {
    width: 100%;
  }

  .settings-modal-footer {
    align-items: stretch;
  }

  .settings-data-pod .tertiary-actions {
    grid-template-columns: 1fr;
  }

  .settings-option-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 한국어 스타일 주석: 학습 이탈 확인은 화면 위에 부드러운 블러 배경과 선택이 분명한 모달로 보여줘요. */
.session-exit-overlay {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

/* 한글 스타일 주석: 세션마다 필요한 분량을 고르는 선택 창을 다른 모달과 같은 반응형 레이어로 표시해요. */
.batch-size-overlay {
  position: fixed;
  z-index: 55;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.batch-size-overlay[hidden] {
  display: none;
}

.batch-size-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: #10172acc;
  backdrop-filter: blur(5px);
  cursor: default;
}

.batch-size-dialog {
  position: relative;
  width: min(100%, 440px);
  padding: 25px;
  border: 1px solid #e4e8f2;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px #10172a38;
}

.batch-size-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.batch-size-heading .eyebrow {
  margin: 0 0 7px;
}

.batch-size-heading h2 {
  margin: 0;
  color: #1e293b;
  font-size: 21px;
  letter-spacing: -.03em;
}

.batch-size-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 11px;
  color: #64748b;
  background: #fff;
  font-size: 17px;
  cursor: pointer;
}

.batch-size-close:hover {
  color: #312e81;
  background: #f5f5ff;
}

.batch-size-description {
  margin: 13px 0 17px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.batch-size-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.batch-size-option {
  min-height: 54px;
  border: 1px solid #e1e5ef;
  border-radius: 13px;
  color: #344054;
  background: #fff;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease, transform .16s ease;
}

.batch-size-option:hover {
  transform: translateY(-1px);
  border-color: #a5b4fc;
  color: #4338ca;
  background: #f8f8ff;
}

.batch-size-option.is-selected {
  border-color: #6366f1;
  color: #4338ca;
  background: #eef0ff;
  box-shadow: inset 0 0 0 1px #6366f1;
}

.batch-size-option:focus-visible,
.batch-size-close:focus-visible {
  outline: 3px solid #818cf8;
  outline-offset: 3px;
}

.batch-size-availability {
  min-height: 20px;
  margin: 14px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .batch-size-overlay {
    padding: 14px;
  }

  .batch-size-dialog {
    padding: 21px 17px;
    border-radius: 18px;
  }

  .batch-size-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.session-exit-overlay[hidden] {
  display: none;
}

.session-exit-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111827a8;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: session-exit-fade-in .16s ease-out both;
}

.session-exit-dialog {
  position: relative;
  width: min(100%, 420px);
  padding: clamp(23px, 5vw, 32px);
  border: 1px solid #ffffffb8;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px #0f172a40;
  animation: session-exit-rise-in .2s ease-out both;
}

.session-exit-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 17px;
  border-radius: 15px;
  background: #eef2ff;
  font-size: 23px;
}

.session-exit-dialog h2 {
  margin: 0;
  color: #172033;
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -.04em;
}

.session-exit-dialog p {
  margin: 10px 0 24px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.75;
}

.session-exit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.session-exit-actions .button {
  min-height: 43px;
  padding: 0 16px;
  font-size: 13px;
}

.session-exit-confirm-button {
  background: linear-gradient(115deg, #4f46e5, #3b82f6);
  box-shadow: 0 5px 12px #4f46e526;
}

.session-exit-dialog :focus-visible {
  outline: 3px solid #a5a6ff;
  outline-offset: 3px;
}

@keyframes session-exit-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes session-exit-rise-in {
  from { opacity: 0; transform: translateY(9px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .session-exit-actions {
    flex-direction: column-reverse;
  }

  .session-exit-actions .button {
    width: 100%;
  }
}

/* 한글 스타일 주석: 백업/복원 도구는 분석 모달 아래에서 보조 설정으로 명확히 구분해요. */
.backup-controls {
  display: grid;
  min-width: 0;
  gap: 8px;
}

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

.backup-actions .button {
  min-height: 38px;
  padding: 0 13px;
  font-size: 12px;
}

.backup-controls > span,
.backup-status {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.5;
}

.backup-status:not(:empty) {
  color: #047857;
  font-weight: 700;
}

@media (max-width: 650px) {
  .analytics-modal-footer .backup-controls,
  .backup-actions {
    width: 100%;
  }

  .backup-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-card,
  .chapter-progress-fill,
  .retention-segment,
  .analytics-overlay,
  .analytics-dialog {
    transition: none;
  }
}

/* 한글 스타일 주석: 학습 대상 단어와 한국어 뜻의 크기/색을 분리해 빠르게 읽히도록 해요. */
.word-title,
.english-target-word {
  color: #0f172a;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.korean-meaning,
.word-meaning {
  color: #1e293b;
  font-size: clamp(17px, 3vw, 20px);
  font-weight: 650;
  line-height: 1.7;
}

.question-title:not(.english-target-word):not(.korean-meaning) {
  color: #334155;
  font-weight: 700;
  line-height: 1.55;
}

.level-test-context {
  margin: 14px 0 18px;
  padding: 14px 16px;
  border-left: 3px solid #6366f1;
  border-radius: 5px 12px 12px 5px;
  color: #334155;
  background: #f1f5f9;
  font-size: 15px;
  line-height: 1.75;
  text-align: left;
}

.level-test-context-target {
  padding: 1px 4px;
  border-radius: 5px;
  color: #3730a3;
  background: #e0e7ff;
  font-weight: 800;
}

.word-card,
.question-card,
.typing-card,
.mode-summary,
.level-test-card {
  border-color: #e2e8f0;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 4px 6px -1px #0f172a0d, 0 2px 4px -2px #0f172a0d;
}

.example-box {
  border-left: 3px solid #3b82f6;
  border-radius: 5px 14px 14px 5px;
  background: #f1f5f9;
}

.example-en {
  color: #334155;
  font-size: 14px;
  line-height: 1.75;
}

.example-target {
  padding: 1px 5px 2px;
  border-radius: 6px;
  color: #3730a3;
  background: #e0e7ff;
  font-weight: 750;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.choice,
.level-test-choice,
.match-tile {
  border-color: #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 6px -1px #0f172a0d, 0 2px 4px -2px #0f172a0d;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.choice:hover:not(:disabled),
.level-test-choice:hover:not(:disabled),
.match-tile:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #a5b4fc;
  background: #fafaff;
  box-shadow: 0 8px 14px -5px #4338ca26;
}

.choice.correct {
  border: 2px solid #10b981;
  color: #047857;
  background: #ecfdf5;
  box-shadow: 0 0 0 3px #10b9811a;
}

.choice.incorrect {
  border: 2px solid #ef4444;
  color: #b91c1c;
  background: #fef2f2;
  animation: choice-shake .34s ease-in-out;
}

@keyframes choice-shake {
  20% { transform: translateX(-4px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}

.button {
  border-radius: 14px;
  background: linear-gradient(115deg, #4f46e5, #3b82f6);
  box-shadow: 0 4px 10px #4f46e526;
}

.button:hover:not(:disabled) {
  background: linear-gradient(115deg, #4338ca, #2563eb);
  box-shadow: 0 7px 16px #4f46e533;
  transform: translateY(-2px);
}

.button.secondary {
  border-color: #e2e8f0;
  border-radius: 999px;
  color: #334155;
  background: #fff;
  box-shadow: none;
}

.button.secondary:hover:not(:disabled) {
  border-color: #c7d2fe;
  color: #4338ca;
  background: #f8faff;
}

.deck-trigger-button,
.analytics-trigger-button,
.sound-toggle-button,
.profile-switch-button {
  border-radius: 999px;
}

.analytics-dialog {
  border-radius: 20px;
}

.phase-indicator {
  margin: 4px 0 18px;
}

.phase-dots {
  border-color: #dbe4f0;
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 4px 10px #33415512;
}

.phase-dot.is-complete {
  color: #4f46e5;
  text-shadow: 0 0 8px #4f46e566;
}

.phase-dot.is-current {
  color: #3b82f6;
  text-shadow: 0 0 9px #3b82f277;
}

.phase-label {
  color: #4338ca;
  background: #eef2ff;
}

.choke-points-card {
  margin: 0 0 20px;
  padding: 22px;
  border: 1px solid #e3e7f1;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #f7f8ff);
}

.choke-points-heading h3 {
  margin: 0;
  color: #1e293b;
  font-size: 19px;
}

.choke-points-heading .eyebrow {
  margin: 0 0 5px;
  color: #6465d9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}

.choke-points-heading p:last-child {
  margin: 7px 0 0;
  color: #68758a;
  font-size: 12px;
}

.choke-point-averages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 9px;
}

.choke-point-subheading {
  margin: 18px 0 0;
  color: #334155;
  font-size: 13px;
}

.choke-point-metric {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e7eaf3;
  border-radius: 12px;
  background: #fff;
}

.choke-point-metric span {
  color: #68758a;
  font-size: 11px;
  font-weight: 700;
}

.choke-point-metric strong {
  color: #3730a3;
  font-size: 16px;
}

.choke-point-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.choke-point-detail h4 {
  margin: 0 0 9px;
  color: #334155;
  font-size: 13px;
}

.choke-point-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.choke-point-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: #f1f3f9;
  color: #475569;
  font-size: 12px;
}

.choke-point-word-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.choke-point-word-copy strong {
  color: #1e293b;
}

.choke-point-word-copy small {
  overflow: hidden;
  color: #68758a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choke-point-flag {
  flex: 0 0 auto;
  color: #a04a26;
  font-size: 10px;
  font-weight: 800;
}

.choke-point-list-item > strong {
  flex: 0 0 auto;
  color: #3730a3;
  font-size: 11px;
}

.choke-point-empty {
  padding: 12px;
  border-radius: 10px;
  color: #68758a;
  background: #f1f3f9;
  font-size: 12px;
}

/* 한글 스타일 주석: 플래시카드에는 진행 버튼 하나만 강조해 다음 카드/퀴즈로 이어지는 흐름을 단순하게 해요. */
.flashcard-actions {
  justify-content: center;
}

.flashcard-next-button {
  width: min(100%, 360px);
  min-height: 52px;
}

@media (max-width: 650px) {
  .intro h1 {
    font-size: clamp(26px, 8vw, 34px);
  }

  .question-card,
  .typing-card,
  .word-card {
    border-radius: 16px;
  }

  .phase-indicator {
    flex-wrap: wrap;
    gap: 7px;
  }

  .choke-points-card {
    padding: 16px;
  }

  .choke-point-averages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choke-point-details {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .flashcard-next-button {
    width: 100%;
  }
}

/* 한글 스타일 주석: 집중 학습 중에는 대시보드와 설정을 숨기고 학습 카드만 전체 화면에 가깝게 배치해요. */
body.focus-mode {
  min-height: 100vh;
  min-height: 100dvh;
  background: #f8fafc;
}

body.focus-mode .shell {
  display: flex;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

body.focus-mode .topbar,
body.focus-mode .control-row,
body.focus-mode .quick-action-hub,
body.focus-mode .speech-status,
body.focus-mode .footer-note {
  display: none !important;
}

body.focus-mode #main-container.main-panel {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: clamp(68px, 10vh, 100px) clamp(16px, 4vw, 48px) clamp(28px, 6vh, 56px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.focus-mode #app-content {
  width: min(100%, 900px);
}

/* 한글 스타일 주석: 설치 안내를 학습 CTA 바로 위의 가벼운 배너로 배치하고 핵심 버튼보다 낮은 시각적 무게를 줘요. */
.install-guide-banner {
  margin: 0 0 16px;
  padding: clamp(16px, 2.5vw, 22px);
  border: 1px solid #dfe5ff;
  border-radius: 18px;
  background: linear-gradient(115deg, #f2f3ff 0%, #fff 54%, #eff7ff 100%);
  box-shadow: 0 8px 24px #4f46e50c;
}

.install-guide-banner[hidden] {
  display: none;
}

#install-guide-reopen-button[hidden] {
  display: none !important;
}

.install-guide-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.install-guide-heading h2 {
  margin: 0;
  color: #26325b;
  font-size: clamp(15px, 2.4vw, 19px);
  font-weight: 850;
  letter-spacing: -.035em;
  line-height: 1.5;
}

.install-guide-close {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #e2e6f2;
  border-radius: 999px;
  color: #64748b;
  background: #fff;
  font-size: 11px;
  font-weight: 750;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.install-guide-close:hover {
  border-color: #c7d2fe;
  color: #4338ca;
  background: #f8f8ff;
}

.install-guide-close:focus-visible,
#install-guide-reopen-button:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 2px;
}

.install-guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 15px 0 0;
  padding: 0;
  list-style: none;
}

.install-guide-steps li {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
  padding: 12px;
  border: 1px solid #e7eaf4;
  border-radius: 13px;
  background: #ffffffc9;
}

.install-guide-step-number {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #5b5ce2;
  font-size: 11px;
  font-weight: 850;
}

.install-guide-steps p {
  margin: 1px 0 0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.install-guide-steps strong {
  color: #3438a4;
  font-weight: 850;
}

.install-guide-steps p span {
  color: #748096;
  font-size: 10px;
}

body.focus-mode #install-guide-banner {
  display: none !important;
}

/* 한글 스타일 주석: 집중 도구막대는 음소거와 종료만 제공하는 최소 헤더로 안전 영역에 고정해요. */
.focus-toolbar {
  position: fixed;
  z-index: 5;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 8px;
}

.focus-toolbar[hidden] {
  display: none;
}

/* 한글 스타일 주석: 닫기 버튼은 기존 확인 모달보다 낮은 레이어에 두고 키보드 포커스를 분명히 표시해요. */
.focus-exit-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #dfe4ee;
  border-radius: 14px;
  color: #475569;
  background: #fff;
  box-shadow: 0 5px 18px #1e293b14;
  font-size: 20px;
  line-height: 1;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.focus-exit-button:hover {
  transform: translateY(-1px);
  border-color: #c7d2fe;
  background: #f8f8ff;
}

.focus-exit-button:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 3px;
}

.focus-exit-button[hidden] {
  display: none;
}

@media (max-width: 650px) {
  .install-guide-steps {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 12px;
  }

  .install-guide-steps li {
    padding: 9px 11px;
  }

  .install-guide-steps p {
    font-size: 11px;
  }

  body.focus-mode #main-container.main-panel {
    padding-right: 14px;
    padding-left: 14px;
  }
}
