html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}


:root {
  --pad: 16px;
  --radius: 16px;
  --maxw: 640px;
  --mobile-width: 420px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Apple SD Gothic Neo, sans-serif;
  --navbar-height: 56px;
  --safe-area-bottom-base: env(safe-area-inset-bottom, 0px);
  --safe-area-bottom: var(--safe-area-bottom-base);

  /* ✅ [추가] 라이트(일반) 모드 색상 변수 */
  --brand: #2563eb;
  --brand-light: #cfe0ff;
  --text: #0f172a;
  --muted: #6b7280;
  --bg: #f5f6fb;
  --card: #ffffff;
  --card-alt: #f2f4fb;
  --border: #d9deeb;
  --card-radius: 14px;
  --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --surface-border: 1px solid var(--border);
  --danger: #ef4444;
}

html {
  font-size: 16px;
}

html, body {
  height:100%;
  overscroll-behavior: none;
  overflow: hidden;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  box-sizing: border-box; 
  user-select: none;
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 입력 요소 등은 선택 가능하도록 예외 처리 */
input, textarea, button, select {
  user-select: text;
}

body.mobile-body {
  background: radial-gradient(circle at top, rgba(37,99,235,0.08), rgba(2,6,23,0)) no-repeat, var(--bg);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 0 32px;
  overscroll-behavior: none;
}

.quiz-fullscreen {
  overflow: hidden;
}

body.mobile-body.menu-open {
  overflow: hidden;
}

body.quiz-no-scroll {
  overflow: hidden;
}

.mobile-shell {
  width: min(100%, var(--mobile-width));
  max-width: var(--mobile-width);
  margin: 0 12px;
  height: 100vh;
  background: var(--bg);
  border-radius: 36px;
  border: none;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-area-bottom);
}

.mobile-scroll {
  flex: 1;
  height: auto;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  padding-top: 56px;
  padding-bottom: var(--safe-area-bottom);
}

.quiz-no-scroll .mobile-scroll {
  overflow-y: hidden;
  max-height: calc(100dvh - 56px);
}

.quiz-no-scroll .mobile-shell {
  height: 100dvh;
}


.mobile-content {
  padding: 5px;
  margin-top: 0;
}

.quiz-fullscreen .navbar,
.quiz-fullscreen .mobile-menu,
.quiz-fullscreen .menu-profile,
.quiz-fullscreen .menu-profile-card {
  display:none !important;
}
.quiz-fullscreen .mobile-shell {
  width:100%;
  max-width:100%;
  margin:0;
  border-radius:0;
  box-shadow:none;
  height:auto;
  min-height:100vh;
}
.quiz-fullscreen .mobile-scroll {
  max-height:none;
  height:auto;
  overflow-y:visible;
  padding-top:0;
}
.quiz-fullscreen .mobile-content {
  padding:0;
}
.quiz-fullscreen .quiz-info-header,
.quiz-fullscreen .quiz-info-header.card {
  display:none !important;
}
.quiz-fullscreen main.card.quiz-main-card {
  width:100%;
  max-width:100%;
  min-height: calc(100vh - var(--navbar-height, 56px));
  margin: var(--navbar-height, 56px) 0 10px;
  border-radius:0;
  box-shadow:none;
  padding: 12px 10px 10px;
  background: var(--card);
  position:relative;
}

.quiz-fullscreen #multiple-choice-area {
  margin-top:20px !important;
}

.quiz-fullscreen .support-controls-wrapper {
  margin-top:10px !important;
}

.quiz-fullscreen-actions {
  display:none;
}

.quiz-fullscreen .quiz-fullscreen-actions {
  display:flex;
  justify-content:space-between;
  gap:8px;
  position:fixed;
  top:8px;
  left:50%;
  transform: translateX(-50%);
  width: min(100%, var(--mobile-width));
  max-width: var(--mobile-width);
  padding: 0 8px;
  z-index:1200;
}

.quiz-fullscreen-grade {
  flex:1;
  text-align:center;
  align-self:center;
  font-weight:700;
  font-size:0.9rem;
  color: var(--text);
  padding: 0 8px;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.quiz-fullscreen-exit,
.quiz-fullscreen-home {
  padding:6px 12px;
  font-weight:600;
  font-size:0.85rem;
}

@media (max-width: 540px){
  body.mobile-body{
    padding: 0;
    background: var(--bg);
  }
  .mobile-shell{
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    width: min(100%, var(--mobile-width));
    min-height: 100vh;
  }
  .mobile-content{
    padding: 5px;
    margin-top: 0;
  }
}


.card {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 18px 16px;
}

:is(.card,
    .menu-card,
    .menu-profile-card,
    .registered-card,
    .home-registered-card,
    .resume-card,
    .foreign-mode-panel,
    .home-modal,
    .modal-content) {
  background: var(--card);
  border: var(--surface-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.quiz-main-card {
  padding: 14px;
  margin-bottom: 10px;
}

main.card.quiz-main-card {
  padding: 14px !important;
  margin-bottom: 10px !important;
}

.quiz-main-card .container {
  padding: 5px 0;
}

.card .btn-primary {
  width: 100%;
  box-sizing: border-box; /* 패딩 포함해서 카드 영역 유지 */
}



/* 사용자 영역 */
.user{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.user-info{ display:flex; align-items:center; gap:10px; min-width:0; }
.avatar{ width:40px; height:40px; border-radius:50%; object-fit:cover; }
.name{ font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.link, .btn{ display:inline-block; padding:12px 14px; border-radius:10px; text-decoration:none; text-align:center; cursor:pointer; user-select:none; }
.btn-primary{ background:var(--brand); color:#fff; width:100%; font-weight:700; }
.btn-outline{ border:1px solid var(--border); color:var(--text); background:transparent; }
.btn-danger{ background:var(--danger); color:#fff; }
.btn.btn-small {
  padding-top: 4px;
  padding-bottom: 4px;
}

.text-link {
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

#index-page,
#index-page * {
  font-size: 1rem !important;
}

#index-page .hero-tagline {
  font-size: 2rem !important;
}

#index-page .hero-english {
  font-size: 1.2rem !important;
}

#home-page,
#home-page * {
  font-size: 1rem !important;
}

#home-page .home-cta-heading h2,
#home-page .home-notice-label,
#home-page .home-study-card-heading h3 {
  font-size: 1.2rem !important;
}

#study-register-page,
#study-register-page * {
  font-size: 1rem !important;
}

#study-register-page .panel h2 {
  font-size: 1.2rem !important;
}

#study-dashboard-page,
#study-dashboard-page * {
  font-size: 1rem !important;
}

#study-dashboard-page .section-heading h2 {
  font-size: 1.2rem !important;
}



h2{ margin:6px 0 2px; font-size:20px; }
p.muted{ color:var(--muted); margin:6px 0 0; font-size:14px; }

img.hero-logo {
  width: min(56%, 179px);
  max-width: 179px;
  height: auto;
  border-radius: 12px;
  margin-bottom: 12px;
  display: block;
}

img.hero-welcome {
  width: min(47vw, 210px);
  max-width: 210px;
  height: auto;
  border-radius: 12px;
  margin-bottom: 6px;
  display: block;
}

.hero-tagline,
.hero-english {
  font-weight: 600;
  margin: 0;
  text-align: center;
  letter-spacing: -0.01em;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.hero-tagline {
  font-size: 1.8rem !important;
  color: var(--text);
  margin-bottom: 4px;
  font-weight: 700;
  text-align: center;
  display: block;
}

.hero-english {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.button-row {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: nowrap;
}

.button-row .btn {
  flex: 0 0 auto;
}

.button-note {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.button-stack {
  flex-direction: column;
  align-items: center;
}

.button-note--stacked {
  white-space: normal;
  margin-top: 6px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.button-stack .btn {
  width: auto;
  min-width: 140px;
  padding: 0 18px;
}

.hero-google-scale {
  min-height: 52px;
  padding: 10px 26px;
  font-size: 1.05rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}


.hero-google-scale.hero-google-btn {
  background: #4285f4;
  color: #fff;
  border-color: #4285f4;
}

.hero-google-scale.hero-google-btn:hover,
.hero-google-scale.hero-google-btn:focus-visible {
  background: #357ae8;
  border-color: #357ae8;
  color: #fff;
}

hr{ border:none; border-top:1px solid var(--border); margin:16px 0; }

/* 퀴즈 영역 */
.q-title{ font-size:1.125rem; margin:0 0 12px; line-height:1.4; }

#question {
  margin: 0 auto 0 !important;
  text-align: center;
  font-size: 1.875rem;
  padding-left: 0;
  padding-right: 0;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.question-wrapper.example-mode #question {
  margin: 0 0 0 !important;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

#question.spelling-mode {
  font-size: 1.625rem;
}

.options{ display:flex; flex-direction:column; gap:10px; }
.options#multiple-choice-area{
  min-height: 0;
  justify-content: flex-start;
  padding: 8px 8px 12px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 10px;
  margin-bottom: 10px;
}
.opt{ display:flex; align-items:center; gap:10px; border:1px solid var(--border); border-radius:12px; padding:14px 12px; background:#fff0; }
.opt input{ appearance:none; width:18px; height:18px; border:2px solid var(--brand); border-radius:50%; }
.opt input:checked{ background:radial-gradient(circle at 50% 50%, var(--brand) 45%, transparent 47%); }
.opt label{ flex:1; cursor:pointer; }

.row{ display:grid; grid-template-columns:1fr; gap:10px; margin-top:12px; }
.input{ width:100%; padding:12px; border:1px solid var(--border); border-radius:10px; background:transparent; color:var(--text); }

@media (min-width:640px){
  .user .btn{ margin-left:12px; }
  .btn + .btn{ margin-top:0; margin-left:8px; }
  .row-2{ grid-template-columns:2fr 1fr; }
}

.notice{ background:rgba(49,130,206,0.08); border:1px dashed var(--brand); color:var(--text); border-radius:10px; padding:12px; margin:12px 0 0; text-align:center; }

.email-login-form {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  text-align: left;
}

.email-login-form input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.email-login-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.alert {
  width: 100%;
  max-width: 320px;
  margin: 12px auto 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.divider {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 20px 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

/* 오른쪽 상단 프로필 + 로그아웃 버튼 */
.top-right {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
}

.avatar-small {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.avatar-small:hover {
  transform: scale(1.05);
}

.logout-btn {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background-color: var(--brand);
  color: white;
  border-color: var(--brand);
}


/* ───────────────────────────────────────────────
   상단 네비게이션 바
─────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, var(--mobile-width));
  max-width: var(--mobile-width);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  z-index: 12000;
  border-radius: 0;
  box-sizing: border-box;
}

@media (min-width: 541px) {
.navbar {
    padding: 0 12px;
  }
}

body.mobile-body .navbar {
  border-radius: 0;
}

.logo {
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}
.logo:hover,
.logo:focus {
  text-decoration: none;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-hamburger {
  justify-content: flex-start;
  position: relative;
  z-index: 11000;
}

.nav-pill {
  flex: 1;
  justify-content: center;
  align-items: center;
  min-width: 0;
  margin: 0 5px;
  padding: 0 5px;
}

.nav-logo {
  justify-content: flex-end;
  gap: 12px;
  position: relative;
}

.nav-study {
  margin-left: 10px;
}

.nav-logo .logo {
  font-weight: 600;
  font-size: 1.2rem;
  padding: 10px;
  border: none;
  border-radius: 10px;
  line-height: 1;
}

.nav-study-link {
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  border: 1px solid transparent;
  line-height: 1;
}

.nav-grade-info {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100%;
  line-height: 1.1;
}

.hamburger {
  font-size: 1.5rem;
  cursor: pointer;
  user-select: none;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  width: auto;
  height: auto;
  transition: background 0.2s ease;
  order: -1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hamburger:hover {
  background: rgba(255,255,255,0.1);
}

body.mobile-body.menu-open #hamburger-btn {
  color: transparent;
}

body.mobile-body.menu-open #hamburger-btn::after {
  content: '✕';
  position: absolute;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
}

/* ───────────────────────────────────────────────
   햄버거 메뉴 패널
─────────────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  top: var(--navbar-height, 56px);
  bottom: 0;
  left: 50%;
  width: min(100%, var(--mobile-width));
  height: 100%;
  max-height: calc(100vh - var(--navbar-height, 56px));
  background: rgba(248, 250, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 28px 24px 36px;
  overflow-y: auto;
  color: var(--text);
  transform: translateY(-100%);
  transform: translate(-50%, -100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
  z-index: 20000;
}

.mobile-menu.open {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
  padding: 5px;
}

.mobile-menu a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 12px 8px;
  border-radius: 10px;
  transition: background 0.2s ease;
  width: 100%;
}
.mobile-menu a:hover {
  background: rgba(37,99,235,0.12);
  color: var(--text);
}

.mobile-menu-content {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 540px){
  .mobile-menu {
    left: 0;
    width: 100%;
    transform: translateY(-100%);
  }
  .mobile-menu.open {
    transform: translateY(0);
  }
}

.mobile-menu > .menu-profile,
.mobile-menu > div,
.mobile-menu > p {
  margin-bottom: 12px;
  width: 100%;
  text-align: left;
}

.menu-card {
  width: 100%;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
  margin-bottom: 14px;
}

.menu-card.menu-profile-card {
  padding: 10px;
}

.menu-profile-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-profile-info {
  display:flex;
  flex-direction:column;
  gap:4px;
  width:100%;
}

.menu-profile-name-line {
  display:flex;
  gap:4px;
  align-items:center;
  flex-wrap: wrap;
  margin: 4px 0 0;
  padding:4px 12px !important;
  background: rgba(59,130,246,0.15);
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
  white-space: nowrap;
  width: fit-content !important;
  align-self: flex-start;
}

.menu-profile-name {
  font-size: 1rem !important;
  line-height: 1.2 !important;
  vertical-align: middle;
  margin: 0;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.menu-profile-email {
  font-size: 1rem !important;
  line-height: 1.2 !important;
  vertical-align: middle;
  font-weight: 700;
  color: var(--text);
}

.menu-avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.6rem;
  aspect-ratio: 1 / 1;
}

.menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: 50%;
}

.menu-profile-sub {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
}

.modal-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  margin-top: 10px;
}
.modal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.modal-input-row .modal-input {
  margin-top: 0;
}
.consent-hidden {
  display: none;
}
.consent-cancel-link {
  color: var(--muted);
  text-align: center;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
}
.consent-cancel-link:hover {
  text-decoration: underline;
}
.consent-page {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.consent-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card-alt);
  box-shadow: none;
  color: var(--text);
}

.consent-page,
.consent-page * {
  font-size: 1rem !important;
}
.consent-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.consent-subtext {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.consent-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.6;
}
.consent-list--scroll {
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 6px;
}
.consent-list p {
  margin: 0;
  font-size: 0.9rem;
}
.consent-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.consent-actions--row {
  flex-direction: row;
  align-items: stretch;
}
.consent-actions--row .btn,
.consent-actions--row .consent-cancel-link {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}

.consent-actions--row .btn.btn-primary {
  flex: 1 1 auto;
  width: 100%;
}
.consent-actions .btn {
  font-size: 1rem;
}
.consent-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}
.consent-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.consent-nickname-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.consent-nickname-row .consent-input {
  flex: 1 1 auto;
}

#consent-nickname-check {
  white-space: nowrap;
  padding: 8px 12px;
}
.consent-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.consent-help {
  margin: 6px 0 0;
  font-size: 0.85rem;
}
.consent-warning {
  color: #f87171;
}
.consent-error {
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f87171;
}
.consent-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.85rem;
}
.modal-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.nickname-feedback {
  min-height: 18px;
}
.nickname-feedback.success {
  color: #34d399;
}
.nickname-feedback.error {
  color: #f87171;
}

.menu-login-btn,
button.menu-login-btn {
  align-self: flex-start;
  background: transparent;
  color: var(--brand);
  padding: 4px 4px 4px 12px;
  border-radius: 0;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.menu-login-btn:hover,
button.menu-login-btn:hover {
  color: rgba(37,99,235,0.8);
}

.menu-profile-actions {
  display:flex;
  width:100%;
  gap:8px;
  justify-content:flex-start;
  margin-top:4px;
  padding-left:10px;
  padding-right:10px;
}
 .menu-profile-actions .menu-login-btn {
  flex:0 0 auto;
  min-width: auto;
  padding:4px;
  border-radius:999px;
  text-align:center;
  font-size:1rem;
  line-height:1.2;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:auto;
  width:auto;
  white-space: nowrap;
}

.menu-profile-name-line {
  font-size: 1rem !important;
}

.menu-login-btn--danger {
  background: transparent;
  color: var(--danger);
}

.menu-login-btn--danger:hover,
.menu-login-btn--danger:focus-visible {
  color: rgb(190, 29, 29);
}



.grade-select-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.grade-selected-hint {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

.settings-select.full {
  width: 100%;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
}

.voice-card .small-text {
  color: var(--muted);
}

.menu-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.menu-links a {
  flex: 1 1 calc(50% - 10px);
  text-align: center;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 0;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.menu-links a:hover {
  background: rgba(255,255,255,0.18);
}

.toggle-card {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.toggle-row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-row strong {
  display: block;
  color: var(--text);
}

.toggle-row.toggle-row--double {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row.toggle-row--double .toggle-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-bottom: none;
}

.toggle-row.toggle-row--double .toggle-block:not(:last-child) {
  border-right: 1px solid var(--border);
}

.menu-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.settings-card .settings-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-card-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 4px;
}

.settings-card-arrow::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--muted);
  transition: transform 0.3s ease, border-left-color 0.3s;
  transform-origin: center 0;
}

.settings-card--collapsed .settings-card-arrow::before {
  transform: rotate(90deg);
  border-left-color: var(--brand);
}

.settings-card--collapsed .settings-group {
  display: none;
}

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

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

.settings-row.settings-row--voice-select .settings-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.settings-row.settings-row--voice-select .settings-control-group select {
  flex: 1;
  min-width: 200px;
  height: 40px;
}

.settings-control-group .menu-toggle-pill {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 10px 16px;
  height: 40px;
}

.menu-toggle-pill--small {
  width: auto;
}

.settings-group .menu-toggle-pill {
  padding: 4px;
  font-size: calc(var(--settings-toggle-font-size, 1rem) * 0.9);
}

.settings-row.settings-row--font-size .settings-font-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-row.settings-row--font-size .settings-font-controls span {
  min-width: 32px;
  text-align: center;
  margin: 0 4px;
}

.settings-row.settings-row--font-size .settings-label,
.settings-row.settings-row--font-size .settings-font-controls .menu-toggle-pill--small {
  font-size: 1rem;
}

.settings-row.settings-row--font-size .settings-font-controls span {
  font-size: 1rem;
}

.settings-row.settings-row--label-toggle,
.settings-row.sound-row.settings-row--voice-select {
  border: 1px solid var(--border, rgba(255, 255, 255, 0.25));
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
}

.settings-row.sound-row.settings-row--voice-select {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.settings-row.sound-row.settings-row--voice-select .settings-label {
  flex: 0;
}

.settings-row.settings-row--label-toggle {
  justify-content: space-between;
}

.settings-row .settings-label {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  min-width: 0;
}

#settings-card-group {
  font-size: 1rem;
}

#settings-card-group button {
  border-radius: 999px;
}

.settings-row.settings-row--label-toggle .menu-toggle-pill {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 10px 4px;
}

#quiz-view-mode .menu-toggle-pill {
  padding-left: 10px;
  padding-right: 10px;
}

.settings-row.sound-row select {
  flex: 1;
  min-width: 120px;
}

#voice-select {
  font-size: 1rem;
  margin-right: 5px;
}

.toggle-pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.settings-pill-group {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.menu-toggle-pill {
  flex: 1;
  min-width: 130px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 0;
  font-weight: 600;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease;
}

.menu-toggle-pill--full {
  width: 100%;
}

.home-registered-list,
.registered-list {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:8px;
  max-height:none;
  overflow:visible;
  padding-right:0;
}
.home-registered-card,
.registered-card {
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:8px;
  border-radius:10px;
  padding:8px 10px;
  box-shadow:0 6px 16px rgba(0,0,0,0); 
  min-height:48px;
  overflow:hidden;
  width:100%;
  max-width:100%;
  border:1px solid #bbb !important;
}
.home-registered-card .del-btn {
  margin-left:8px;
  flex-shrink:0;
  padding:1px;
  background:#fee2e2;
  border-color:#fecaca;
  color:#b91c1c;
}
.home-registered-header {
  display:flex;
  align-items:center;
  gap:8px;
  padding-left:4px;
}
.home-registered-info {
  display:flex;
  align-items:flex-start;
  width:100%;
}
.home-registered-line,
.registered-line {
  display:flex !important;
  align-items:center;
  width:100%;
  font-weight:700;
  color:var(--text);
  white-space:nowrap;
  flex-wrap:nowrap;
  gap:8px;
  min-width:0;
}
.home-registered-line .line-text,
.registered-line .line-text {
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  display:inline;
}
.progress-badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 8px;
  border-radius:999px;
  background: rgba(59,130,246,0.12);
  margin-right:0 !important;
  transform: scale(0.8);
  transform-origin: right center;
}
.line-end {
  display:flex;
  align-items:center;
  margin-left:auto;
  flex-shrink:0;
  white-space:nowrap;
  gap:0;
}
.home-registered-card .progress-pill {
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:10px;
  color:var(--text);
  font-size:1rem !important;
  font-weight:700;
  min-height:30px;
}
.home-section {
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-bottom:0;
}
.action-grid-wrap {
  width:100%;
  max-width:100%;
  padding:8px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--card-alt);
  box-sizing:border-box;
  overflow:hidden;
}
.action-grid {
  display:flex !important;
  flex-wrap:wrap !important;
  gap:8px;
  width:100%;
}
.action-grid button {
  border:1px solid rgba(255,255,255,0.25);
  border-radius:12px;
  padding:calc(5px * 0.95);
  background:rgba(255,255,255,0.08);
  color:var(--text);
  font-weight:700;
  font-size:0.9rem;
  cursor:pointer;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 16px rgba(15,23,42,0.12);
  flex:1 1 auto;
  min-width:0;
  min-height:calc(2.2rem * 0.95);
}
.action-grid button:nth-child(1),
.action-grid button:nth-child(2),
.action-grid button:nth-child(3) {
  width:calc(33.33% - 6px);
  flex:0 0 auto;
}
.action-grid button:nth-child(4),
.action-grid button:nth-child(5) {
  width:calc(50% - 4px);
  flex:1 0 auto;
}
.action-grid button:hover {
  transform:translateY(-2px);
  background:linear-gradient(135deg, rgba(37,99,235,0.25), rgba(37,99,235,0.08));
  box-shadow:0 12px 24px rgba(15,23,42,0.18);
}
.action-grid button:active {
  transform:translateY(0);
  box-shadow:0 6px 12px rgba(15,23,42,0.14);
}
.action-grid button.action-quiz {
  border:1px solid rgba(37,99,235,0.25);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.action-grid button:nth-child(4) {
  grid-column:1;
}
.action-grid button:nth-child(5) {
  grid-column:3;
}

/* 델리트 버튼을 더 작게 유지 */
.btn.btn-small.del-btn {
  padding: 4px 8px !important;
  min-height: auto !important;
  line-height: 1;
  font-size: 0.75rem !important;
  border-radius: 6px !important;
  background-color: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #ef4444 !important;
}
.btn.btn-small.del-btn:hover {
  background-color: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
}
.hero-quote {
  margin:0;
  font-size:1.152rem;
  line-height:1.4;
  font-weight:600;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.hero-text {
  display:flex;
  flex-direction:column;
  justify-content:center;
  width:100%;
}
.hero-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
}
.hero-source {
  margin:6px 0 0;
  font-size:0.8rem;
  color:var(--muted);
  text-align:right;
  display:block;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.hero-quote-english {
  font-size: 1.152rem;
  color: var(--text);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.hero-translation {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.home-quote-card {
  padding:16px;
  height:auto;
  border-radius:18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid #ccc !important;
  color: var(--text);
  box-shadow: none !important;
  text-shadow: none;
  display:block;
  margin-bottom:12px;
}
.hero-quote,
.hero-translation {
  color: inherit;
}
.hero-source {
  display:-webkit-box;
  -webkit-line-clamp:1;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
#home-page .hero-source {
  font-size: 0.8rem !important;
}
.hero-action-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  gap:16px;
}
.hero-action-buttons {
  display:flex;
  gap:8px;
  margin-left:auto;
}
.actions-note {
  margin:6px 0 0;
  width:100%;
  font-size: 0.85rem;
}

.muted.small-text.actions-note {
  font-size: 0.85rem;
}

.home-notice-section {
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-bottom:12px;
}

.home-notice-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--card-alt);
  color: var(--text);
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
}

.home-notice-heading {
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:6px;
}

.home-notice-label {
  font-size: 1.5rem !important;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: none;
  color: var(--text);
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}
#home-motivational-card .home-notice-label {
  font-size: 1.2rem !important;
}

.home-notice-card p {
  margin: 0;
  line-height: 1.5;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.home-card-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.home-cta-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(14, 165, 233, 0.3);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(14, 165, 233, 0));
  color: var(--text);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
  display:flex;
  flex-direction:column;
  gap:10px;
}

.home-cta-card-link {
  text-decoration:none;
  color: inherit;
}

.home-cta-card,
.home-cta-card-link,
.home-notice-card,
.home-quote-card,
.menu-card.home-study-card {
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  background: var(--card-alt) !important;
  box-shadow: none !important;
}

#home-page .home-shield-banner {
  position: fixed;
  top: calc(var(--navbar-height, 56px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--mobile-width), calc(100% - 24px));
  max-width: var(--mobile-width);
  background: rgba(16, 185, 129, 1);
  border: 1px solid rgba(16, 185, 129, 0.6);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  z-index: 4000;
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.28);
}
#home-page .home-shield-banner__text {
  flex: 1;
  font-size: 1rem;
  color: #ffffff;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.45;
}
#home-page .home-shield-banner__actions .btn {
  background: #0ea5e9 !important;
  border: 2px solid #0284c7 !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(2, 132, 199, 0.3);
}
#home-page #attendance-shield-confirm {
  background: #0ea5e9 !important;
  border-color: #0284c7 !important;
}
#home-page #attendance-shield-close {
  background: #94a3b8 !important;
  border-color: #64748b !important;
}
#home-page .home-shield-banner__actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-shrink: 0;
}
#home-page .home-shield-banner__actions .btn.btn-small {
  padding: 4px 8px !important;
  min-width: 0;
}
#home-page .home-shield-banner .btn {
  white-space: nowrap;
  width: auto;
}

.home-cta-heading h2 {
  margin:0;
  font-size:1.5rem !important;
  font-weight:700;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.home-cta-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.home-study-card-heading h3 {
  margin: 0;
  font-size: 1.5rem !important;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.home-cta-subtext {
  margin:0;
  color: rgba(15, 23, 42, 0.7);
}

.home-cta-label {
  display:inline-flex;
  padding:8px 16px;
  border-radius:999px;
  background: rgba(14, 165, 233, 0.2);
  color:#0ea5e9;
  font-weight:600;
  align-self:flex-start;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.home-study-card-section {
  display:flex;
  flex-direction:column;
  gap:12px;
}

.home-study-card {
  padding: 16px;
}

.home-study-card-buttons {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
  margin-top:12px;
}

.home-study-card-buttons .btn {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.home-study-card-meta {
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.home-study-card-meta-row {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  justify-content:flex-start;
}

@media (max-width:640px){
  .hero-action-row {
    flex-direction:column;
    align-items:flex-start;
  }
  .hero-action-buttons {
    width:100%;
    justify-content:flex-end;
    flex-wrap:wrap;
  }
}
.hero-btn-primary {
  background:#0ea5e9;
  border:none;
  color:#fff;
  border-radius:10px;
  padding:8px 14px;
  font-weight:700;
  font-size:0.85rem;
}
.hero-btn-outline {
  border:1px solid rgba(255,255,255,0.8);
  background:transparent;
  color:#fff;
  border-radius:10px;
  padding:8px 14px;
  font-weight:700;
}
.hero-btn-secondary {
  border:none;
  border-radius:10px;
  padding:8px 14px;
  font-weight:700;
  font-size:0.85rem;
  background:var(--card);
  color:var(--text);
  border:1px solid rgba(15,23,42,0.1);
}
.hero-btn-compact {
  font-size:0.85rem;
  padding:6px 10px;
}

.home-registered-panel .section-heading {
  display:flex;
  flex-direction:column;
  gap:4px;
}
@media (prefers-color-scheme: light) {
  .home-quote-card {
    background: linear-gradient(135deg, rgba(37,99,235,0.18), rgba(15,23,42,0.04));
    color: var(--text);
    box-shadow: 0 12px 32px rgba(15,23,42,0.12);
    text-shadow: none;
  }
  .hero-quote,
  .hero-translation {
    color: inherit;
    text-shadow: none;
  }
}
.home-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.home-modal {
  color: var(--text, #111);
  padding: 10px;
  max-width: 420px;
  width: min(420px, 90vw);
  box-shadow: 0 16px 40px rgba(15,23,42,0.28);
}

#delete-account-modal .home-modal {
  max-width: 420px;
  width: min(420px, 90vw);
}
.home-modal p { margin: 0 0 10px; line-height: 1.5; }
.home-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding-left: 10px;
  padding-right: 10px;
}
.home-modal .modal-actions { display:flex; justify-content:flex-end; margin-top: 8px; }
.home-modal .modal-actions.review-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.home-modal .modal-actions.review-type-grid .btn {
  width: 100%;
}
.home-modal .modal-actions.review-type-grid .btn.btn-primary {
  background: #0ea5e9;
  border: none;
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
}
.home-modal .modal-actions #review-start-btn.is-active {
  background: #0ea5e9;
  border: none;
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
}
.home-modal .modal-actions.review-scope-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
}
.home-modal .modal-actions.review-scope-grid .btn {
  flex: 1 1 calc(33.333% - 6px);
}
.home-modal .modal-actions.review-scope-grid .btn.btn-primary {
  background: #0ea5e9;
  border: none;
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
}
.home-modal .review-section-label {
  font-size: 1.02rem;
  font-weight: 700;
}
.home-modal .modal-actions .btn {
  min-width: auto;
  width: auto;
  flex: 0 0 auto;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 7px 12px;
  font-size: 0.95rem;
}

.menu-toggle-pill:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.menu-toggle-pill--active {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: #fff;
  font-weight: 700;
}
.settings-row.settings-row--label-toggle .menu-toggle-pill--active {
  background: #0ea5e9 !important;
  border-color: #0ea5e9 !important;
  color: #fff !important;
  font-weight: 700;
}

.study-mode-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 16px;
}

.mode-button-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-stack-btn {
  width: 100%;
}

.menu-close {
  align-self: flex-end;
  background: rgba(15,23,42,0.08);
  border: 1px solid rgba(15,23,42,0.15);
  color: var(--text);
  font-size: 1.4rem;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  z-index: 1;
}

.menu-close:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
}

.mobile-menu hr {
  width: 100%;
  border-color: rgba(255,255,255,0.15);
}


/* ───────────────────────────────────────────────
   메인 콘텐츠 영역
─────────────────────────────────────────────── */
main.card {
  margin-bottom: 16px; /* 페이지 하단과의 여백 */
}
/* ───────────────────────────────────────────────
   퀴즈 영역 (공통)
─────────────────────────────────────────────── */
.option-box {
  border: 1px solid #bbb;
  border-radius: 6px;
  padding: 6px;
  margin: 2px 0;
  text-align: center;
  cursor: pointer;
  background-color: #fafafa;
  color: #111; /* 기본 글자색 (밝은 테마용) */
  transition: background-color 0.2s, color 0.2s, transform 0.1s ease;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  line-height: 1.25;
  white-space: normal;
  overflow: hidden;
}
.option-box .option-text {
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}
@media (hover: hover) and (pointer: fine) {
  .option-box:hover {
    background-color: #eee;
    transform: translateY(-1px);
  }
}

@media (hover: none) and (pointer: coarse) {
  #multiple-choice-area .quiz-option {
    -webkit-tap-highlight-color: transparent;
  }
  #multiple-choice-area .btn,
  #multiple-choice-area .btn-outline {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}
#multiple-choice-area .quiz-option:focus,
#multiple-choice-area .quiz-option:focus-visible {
  outline: none;
  box-shadow: none;
}
#multiple-choice-area .quiz-option:active {
  background: transparent;
}

#multiple-choice-area .btn:focus,
#multiple-choice-area .btn:focus-visible,
#multiple-choice-area .btn-outline:focus,
#multiple-choice-area .btn-outline:focus-visible {
  outline: none;
  box-shadow: none;
}
#multiple-choice-area .btn:active,
#multiple-choice-area .btn-outline:active {
  background: transparent;
}

.correct {
  background-color: #b2f2bb;
  color: #000;
}
.incorrect {
  background-color: #ffa8a8;
  color: #000;
}

.result {
  font-weight: bold;
  margin-top: 10px;
}

.explanation {
  margin-top: 6px;
  font-size: 0.9rem;
  color: #555;
}

/* ───────────────────────────────────────────────
   다크 모드 대응
─────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root{
    --brand:#60a5fa;
    --bg:#0b1120;
    --card:#111827;
    --card-alt:#0d1628;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --border:#1f2937;
  }
  body {
    background-color: #101014;
    color: #e0e0e0;
  }

  .option-box {
    background-color: #1f1f23;
    border-color: #444;
    color: #f5f5f5;
  }
  .option-box:hover {
    background-color: #2a2a30;
  }

  .correct {
    background-color: #2f6e3b;
    color: #fff;
  }
  .incorrect {
    background-color: #732e2e;
    color: #fff;
  }
  #multiple-choice-area .quiz-option,
  #multiple-choice-area .option-box {
    background-color: #1f1f23 !important;
    border-color: #444 !important;
    color: #f5f5f5 !important;
    -webkit-appearance: none;
    appearance: none;
  }
  #multiple-choice-area .quiz-option.correct,
  #multiple-choice-area .option-box.correct {
    background-color: #2f6e3b !important;
    color: #fff !important;
  }
  #multiple-choice-area .quiz-option.incorrect,
  #multiple-choice-area .option-box.incorrect {
    background-color: #732e2e !important;
    color: #fff !important;
  }
  #multiple-choice-area .option-box.feedback-reset,
  #multiple-choice-area .quiz-option.feedback-reset {
    background-color: #1f1f23 !important;
    color: #f5f5f5 !important;
  }

  .explanation {
    color: #aaa;
  }

  .result {
    color: #fff;
  }

  .menu-card,
  .subject-card,
  .collapse-section,
  .subject-detail {
    background: var(--card);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  }

  .menu-login-btn {
    color: #fff;
  }

  .toggle-row {
    border-color: rgba(255,255,255,0.1);
  }

  .mobile-menu {
    background: rgba(2, 6, 23, 0.92);
    color: #fff;
  }

  .mobile-menu a {
    color: #fff;
  }

  .menu-close {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
  }

  .action-grid button {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #f8fbff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7);
  }

  .action-grid button:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8);
    transform: translateY(-1px);
  }

  .action-grid button:focus-visible {
    outline: 2px solid rgba(59,130,246,0.9);
    outline-offset: 2px;
  }
}

body.small-height {
  --safe-area-bottom: calc(var(--safe-area-bottom-base) * 0.5);
}

body.small-height .quiz-main-card {
  padding: 8px;
}

body.small-height main.card.quiz-main-card {
  padding: 8px !important;
}

body.small-height .quiz-info-header,
body.small-height .quiz-info-header.card {
  padding: 8px !important;
}

body.small-height .question-wrapper.quiz-emphasis {
  padding: 6px;
}

body.small-height .word-status-box {
  margin: 4px 0;
  padding: 0 6px;
}

body.small-height .support-controls-wrapper {
  margin: 4px 0;
}

body.typing-quiz .support-controls-wrapper {
  margin: 10px 0;
}
body.typing-quiz.small-height .support-controls-wrapper {
  margin: 10px 0;
}

body.small-height #multiple-choice-area {
  margin-top: 4px;
  margin-bottom: 4px;
}

body.small-height #multiple-choice-area.quiz-emphasis {
  gap: 6px;
}

body.small-height .option-box {
  padding: 4px;
}

body.small-height .support-controls #example-btn,
body.small-height .support-controls #hint-btn,
body.small-height .support-controls #mark-known-btn {
  height: 36px;
  min-height: 36px;
}

body.small-height .question-wrapper.quiz-emphasis:not(.example-mode) #question {
  font-size: calc(1.875rem - 2px);
}

body.small-height .question-wrapper.example-mode #question {
  font-size: calc(1.4rem - 3px);
}

body.small-height #multiple-choice-area.spelling-mode .option-box,
body.small-height #multiple-choice-area:not(.spelling-mode) .option-box {
  font-size: calc(1.5rem - 2px);
}

body.small-height #multiple-choice-area.spelling-mode .option-box {
  font-size: calc(1.75rem - 2px);
}

@media (max-height: 700px) {
  :root {
    --safe-area-bottom: calc(var(--safe-area-bottom-base) * 0.5);
  }

  .quiz-main-card {
    padding: 8px;
  }

  main.card.quiz-main-card {
    padding: 8px !important;
  }

  .quiz-info-header,
  .quiz-info-header.card {
    padding: 8px !important;
  }

  .question-wrapper.quiz-emphasis {
    padding: 6px;
  }

  .word-status-box {
    margin: 4px 0;
    padding: 0 6px;
  }

  .support-controls-wrapper {
    margin: 4px 0;
  }

  #multiple-choice-area {
    margin-top: 4px;
    margin-bottom: 4px;
  }

  #multiple-choice-area.quiz-emphasis {
    gap: 6px;
  }

  .option-box {
    padding: 4px;
  }

  .support-controls #example-btn,
  .support-controls #hint-btn,
  .support-controls #mark-known-btn {
    height: 36px;
    min-height: 36px;
  }

  .question-wrapper.quiz-emphasis:not(.example-mode) #question {
    font-size: calc(1.875rem - 2px);
  }

  #multiple-choice-area.spelling-mode .option-box,
  #multiple-choice-area:not(.spelling-mode) .option-box {
    font-size: calc(1.5rem - 2px);
  }

  #multiple-choice-area.spelling-mode .option-box {
    font-size: calc(1.75rem - 2px);
  }
}

  .home-registered-card,
  .registered-card {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: var(--card-alt) !important;
    box-shadow: none !important;
  }

.home-quote-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}


/* ---------------------------------- */
/* 팝업 (모달) 스타일 */
/* ---------------------------------- */
.modal {
  display: none; /* 기본적으로 숨김 */
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6); /* 반투명 배경 */
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.modal-content {
  margin: 15% auto;
  padding: 10px;
  width: 90%;
  max-width: 400px;
  position: relative;
  text-align: center;
}

.close-button {
  color: var(--muted);
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.75rem;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: var(--text);
}

#grade-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* ---------------------------------- */
/* 퀴즈 화면 단어장 정보 스타일 */
/* ---------------------------------- */
.quiz-info-header {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 3px 0;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 14px;
}

.quiz-info-header.card {
  padding: 14px;
  margin: 3px 0;
}

.badge-hidden {
  display: none !important;
}

.summary-text {
  width: 100%;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  padding: 6px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}



.session-progress-badge {
  font-size: 0.9em;
  font-weight: bold;
  color: var(--muted);
}
.word-status-box {
  font-size: 0.8em;
  color: var(--muted);
  background-color: rgba(255, 255, 255, 0.03);
  padding: 0 10px;
  border-radius: 8px;
  margin: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.word-status-overlay {
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  background: transparent;
  border: none;
  margin: 0;
  padding: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.word-status-text {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex: 1;
  font-size: 0.9rem;
}

.word-status-box .grade-label {
  background-color: rgba(59, 130, 246, 0.2);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 600;
}
.word-status-box .mastered-pill {
  background-color: rgba(34, 197, 94, 0.2);
  color: #15803d;
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
}

.progress-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.progress-row {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
  padding: 0;
}
.progress-row.single-line {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
  align-items: center;
}
.progress-item {
  display: flex;
  align-items: center;
  gap: 1px;
  width: 100%;
  min-width: 0;
  padding: 1px;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 3px;
}
.progress-item.hidden-typing {
  visibility: hidden;
}
.progress-title {
  flex: 0 0 auto;
  font-weight: 800;
  color: var(--text);
  font-size: 0.8rem;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.progress-label {
  color: var(--text);
  font-weight: 800;
  font-size: 0.82rem;
  white-space: nowrap;
  margin-right: 4px;
}
.dot-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  align-items: center;
  margin-top: 2px;
  min-width: 50px;
}
.progress-block-cell {
  width: 100%;
  height: 10px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.progress-block-cell.block-active {
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}
.dot-mastered {
  margin-left: 6px;
  color: #34d399;
  font-weight: 800;
  font-size: 0.9rem;
}
.mastered-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.known-pill {
  background-color: rgba(234, 179, 8, 0.2);
  color: #a16207;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.stage-pill {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85em !important;
}

.btn-known-word {
  font-size: 0.75em;
  padding: 6px 12px;
  white-space: nowrap;
  min-width: 92px;
  transition: opacity 0.2s ease;
}

.support-controls {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  margin-top: 0;
  width: 100%;
  align-items: center;
  min-height: auto; /* 버튼 위치 고정 */
}

.support-controls-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  font-size: 1rem;
  margin: 10px 0;
}
.support-controls-wrapper .support-controls-box {
  width: min(100%, 400px);
  margin: 0 auto;
  display: flex;
  align-items: stretch;
}
.support-controls-wrapper .support-controls {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  padding: 0;
}

.support-controls .btn {
  width: 100%;
  padding: 6px 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  line-height: 1;
  font-size: 1rem !important;
  font-weight: 700;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #bbb !important;
  color: var(--text);
}
.support-controls #hint-btn,
.support-controls #mark-known-btn,
.support-controls #example-btn {
  font-size: 1rem !important;
}
.support-controls-wrapper .btn {
  font-size: 1rem !important;
}
.support-controls .btn.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.support-controls .btn:not(.btn-disabled):hover,
.support-controls .btn:not(.btn-disabled):focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: #888 !important;
  color: var(--text);
}

.support-controls #example-btn,
.support-controls #hint-btn,
.support-controls #mark-known-btn {
  height: 46px;
  min-height: 46px;
  font-size: 0.8125rem !important;
  font-weight: 700;
}

.hint-area {
  width: 100%;
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9em;
  text-align: center;
  display: none;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}

.hint-area.show {
  display: flex;
}





.quiz-info-header.card {
  margin-top: 3px !important;
  margin-bottom: 3px !important;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px !important;
  gap: 6px;
  row-gap: 4px;
}

.header-group {
  display: flex !important;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap !important;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  transition: font-size 0.2s ease;
  font-size: 1rem;
}

.header-group > span {
  flex-shrink: 1;
  display: inline-block;
}

.header-group::-webkit-scrollbar,
.quiz-info-header::-webkit-scrollbar {
  display: none;
}
.quiz-info-header,
.header-group {
  scrollbar-width: none;
}


.typing-question-word {
  display:flex;
  justify-content:center;
  align-items:center;
  gap:2px !important;
  font-size: 1.875rem !important;
  letter-spacing:-0.04em !important;
  font-weight:600;
  font-family: 'Pretendard', 'Inter', 'Segoe UI', system-ui, monospace;
  flex-wrap:nowrap;
  white-space:nowrap;
  overflow:hidden;
  text-transform: lowercase;
  min-height: 50px;
}
.typing-question-word span {
  display:inline-flex;
  justify-content:center;
  align-items:center;
  min-width:0.58em !important;
}
.typing-mode {
  text-align:center;
}
.typing-question-meaning {
  margin:0;
  font-size:0.95rem;
  line-height:1.4;
  color:var(--muted);
}
.letter-buttons-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px;
  margin-top: 5px;
  margin-bottom: 10px;
}
.letter-buttons-grid.keyboard-layout {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.letter-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-bottom: 6px;
}
.letter-btn.special-key {
  background: rgba(59, 130, 246, 0.15);
  font-weight: 600;
}
/* animation removed; letter buttons shown/hidden instantly */
.letter-btn {
  width: 100% !important;
  margin: 0 !important;
  padding: 10px 5px;
  font-size: 1.44em;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background-color: var(--card);
  min-height: calc(40px * 1.2);
  color: var(--text);
  transition: background-color 0.2s;
}
.letter-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.letter-btn,
.typing-controls .btn {
  min-height: 52px !important;
  margin: 0 !important;
  padding: 8px 4px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  touch-action: manipulation;
}


#check-typing-btn {
  background-color: rgba(37, 99, 235, 0.12) !important;
  border: 1px solid var(--brand) !important;
  color: var(--brand) !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.12) !important;
}

#check-typing-btn:not(:disabled):active {
  background-color: rgba(37, 99, 235, 0.25) !important;
  transform: translateY(1px);
}

#check-typing-btn:disabled {
  background-color: rgba(15, 23, 42, 0.05) !important;
  border-color: var(--border) !important;
  color: var(--muted) !important;
  opacity: 0.6;
}

#check-typing-btn.active {
  background-color: rgba(37, 99, 235, 0.9) !important;
  color: #fff !important;
}



  .typing-controls {
    display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px;
  margin-top: 0;
  align-items: stretch;
  width: 100%;
}
.typing-controls .btn-primary {
  background: rgba(59, 130, 246, 0.85);
  border-color: rgba(59, 130, 246, 0.85);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.settings-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

.settings-card {
  background: var(--card);
  border: var(--surface-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.myscore-wrap {
  display:flex;
  flex-direction:column;
  gap:16px;
  padding-bottom:20px;
}
.myscore-header h1 {
  margin:0;
  font-size:1.1rem;
  font-weight:700;
}
.myscore-header .muted {
  margin-top:6px;
  color: var(--muted);
}
.myscore-header__title {
  display:flex;
  align-items:center;
  gap:12px;
}
.tag-button {
  padding:4px 10px;
  font-size:0.85rem;
  border-radius:999px;
  border:1px solid rgba(148,163,184,0.7);
  background: rgba(59,130,246,0.08);
  color: var(--text);
  cursor:pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.tag-button:hover {
  background: rgba(59,130,246,0.15);
}
.score-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
  gap:10px;
}
.score-list {
  display:flex;
  flex-direction:column;
  gap:10px;
}
.score-card--toggle {
  cursor:pointer;
  position:relative;
  padding-right:38px;
}
.score-card--toggle::after {
  content: "∨";
  font-size:0.9rem;
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  transition: transform 0.2s ease;
}
.score-card--toggle.expanded::after {
  transform:translateY(-50%) rotate(180deg);
}
.score-period {
  display:inline;
  font-size:0.9rem;
  color: var(--muted);
  margin-left:6px;
}
.score-system-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 12px;
}
.score-system-panel {
  width: min(520px, calc(100% - 32px));
  background: var(--card);
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:18px;
}
.score-system-panel header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:8px;
}
.score-system-panel header button {
  border:none;
  background:none;
  font-size:1.5rem;
  line-height:1;
  padding:0;
  cursor:pointer;
  color: var(--muted);
}
.score-system-panel header button:hover {
  color: var(--text);
}
.score-system-panel .muted {
  margin:0;
}
.score-system-body {
  display:flex;
  flex-direction:column;
  gap:12px;
}
.score-system-body section h4 {
  margin:0;
  font-size:1rem;
  font-weight:600;
}
.score-system-body section p {
  margin:6px 0 0;
  color: var(--text);
  line-height:1.4;
}
.score-detail-panel {
  max-height:0;
  overflow:hidden;
  transition:max-height 0.25s ease, padding 0.25s ease;
  background: var(--card-alt);
  border-radius: var(--card-radius);
  margin-top:-6px;
  margin-bottom:10px;
  padding:0 14px;
}
.score-detail-panel.open {
  padding:10px 14px;
  max-height:999px;
  min-height:120px;
}
.score-detail-panel__content {
  max-height: 320px;
  overflow-y: auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  font-size: 0.8rem;
}
.score-detail-panel__content * {
  font-size: 0.8rem !important;
}
.score-detail-panel__content::-webkit-scrollbar {
  width: 6px;
}
.score-detail-panel__content::-webkit-scrollbar-track {
  background: transparent;
}
.score-detail-panel__content::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}
.score-detail-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:6px 0;
  border-bottom:1px solid var(--border);
}
.score-detail-row:last-child {
  border-bottom:none;
}
.score-detail-row span {
  color: var(--muted);
}
.total-detail-group {
  border: 1px solid rgba(148, 163, 184, 0.4);
  margin-bottom: 2px;
  border-radius: 12px;
  padding: 12px;
  background: var(--card-alt);
}
.total-detail-group__header strong {
  display:block;
  font-size:1rem;
  margin-bottom:4px;
}
.total-detail-group__header .muted-card {
  margin:0;
  font-size:0.85rem;
}
.total-detail-list {
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.total-detail-list li {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:0.9rem;
}
.total-detail-list li strong {
  text-align:right;
  margin-left:auto;
}
.total-detail-list strong.negative {
  color:#dc2626;
}
.score-card {
  border: var(--surface-border);
  border-radius: var(--card-radius);
  background: var(--card);
  padding:14px;
  box-shadow: var(--card-shadow);
  display:flex;
  flex-direction:column;
  gap:4px;
  min-height:86px;
}
.score-card .score-label {
  margin:0;
  font-weight:600;
  color: var(--muted);
  font-size:1.1rem;
}
.score-card--inline .score-label {
  font-size:1.1rem;
}
.score-card .score-value {
  margin:0;
  font-size:1.25rem;
  font-weight:700;
  color: var(--text);
}
.score-card--inline {
  align-items:baseline;
  justify-content:space-between;
  flex-direction:row;
  min-height:auto;
}
.score-card--inline .score-card__header {
  margin-right:auto;
}

.score-summary-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap:6px;
}
.score-card--summary {
  display:flex;
  flex-direction:column;
  gap:6px;
  position:relative;
}
.score-card__header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  width:100%;
  font-size: 1.2rem;
}
.score-card__header-info {
  display:flex;
  align-items:center;
  gap:4px;
  flex:1;
  white-space:nowrap;
  flex-wrap: nowrap;
  overflow: visible;
  min-width: max-content;
}
.score-period {
  font-size:0.9rem;
  color: var(--muted);
  margin-left:0;
  white-space:nowrap;
  text-align:left;
}
.score-card__header .score-badge {
  margin-left:auto;
}
.score-card__header-meta {
  display:flex;
  align-items:center;
  gap:6px;
  margin-left:auto;
  justify-content:flex-end;
}
.score-card__value-side {
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:0;
  width:100%;
  justify-content:space-between;
}
.score-card__header .score-label {
  flex:1;
  min-width:0;
}
.score-card--toggle::after,
.score-card--toggle.expanded::after {
  display: none !important;
}

.score-card__value-wrap {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  position: relative;
  padding-right: 18px;
  width: 100%;
  justify-content: flex-start;
}

.score-card__value-wrap::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 5px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--muted);
  transition: transform 0.3s ease, border-left-color 0.3s;
  transform-origin: center 0;
}

.score-card--toggle.expanded .score-card__value-wrap::after {
  transform: rotate(90deg);
  border-left-color: var(--brand);
}
.score-hero-delta {
  font-size:0.9rem;
  color: var(--muted);
}
.score-badge {
  margin: 10px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(59,130,246,0.3);
  font-size:0.9rem;
  color: var(--brand);
}
.score-card--summary.score-card--inline {
  align-items:flex-start;
}

/* 주요 텍스트 영역: 단어 단위 줄바꿈 */
.score-card .score-label,
.score-detail-row span,
.score-system-body section p,
.study-heading h1,
.study-heading .muted,
.home-study-card-heading h3,
.study-status-wrap {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.score-card__value {
  font-size:1.1rem;
  font-weight:800;
  color: var(--text);
  line-height:1.1;
  position:relative;
  display:inline-block;
  padding-bottom:2px;
}
.myscore-hero {
  background: var(--card);
  border: var(--surface-border);
  border-radius: var(--card-radius);
  padding: 12px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  box-shadow: var(--card-shadow);
}
.score-hero-value {
  font-size:2.4rem;
  font-weight:700;
  display:block;
}
.score-hero-meta {
  text-align:right;
}
.hero-badge {
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px 10px;
  border-radius:999px;
  background: rgba(37,99,235,0.15);
  color: var(--brand);
  font-weight:600;
  font-size:0.8rem;
}
.hero-change {
  margin:6px 0 0;
  font-size:0.9rem;
  color: var(--muted);
}
.score-category-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap:12px;
}
.category-card {
  border-radius: var(--card-radius);
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--surface-border);
  display:flex;
  flex-direction:column;
  gap:10px;
  box-shadow: var(--card-shadow);
}
.category-card__header {
  display:flex;
  align-items:center;
  gap:6px;
  font-size:0.9rem;
  color: var(--muted);
}
.category-card__value {
  font-size:1.4rem;
  font-weight:700;
}
.category-card__progress {
  width:100%;
  height:6px;
  border-radius:999px;
  background: rgba(148,163,184,0.25);
  overflow:hidden;
}
.category-card__progress-bar {
  display:block;
  height:100%;
  background: linear-gradient(90deg, rgba(59,130,246,0.8), rgba(37,99,235,0.8));
  border-radius:999px;
}
.category-card__details {
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:0.85rem;
  color: var(--text);
}
.category-card--challenge .category-card__progress-bar {
  background: linear-gradient(90deg, rgba(249,115,22,0.8), rgba(234,88,12,0.8));
}
.category-card--mission .category-card__progress-bar {
  background: linear-gradient(90deg, rgba(139,92,246,0.8), rgba(129,140,248,0.8));
}
.category-card--consistency .category-card__progress-bar {
  background: linear-gradient(90deg, rgba(16,185,129,0.8), rgba(34,197,94,0.8));
}
.recent-activity {
  background: var(--card);
  border: var(--surface-border);
  border-radius: var(--card-radius);
  padding: 16px;
  box-shadow: var(--card-shadow);
}
.recent-activity__header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom: 8px;
}
.recent-activity__header h3 {
  margin:0;
  font-size:1rem;
}
.recent-activity__tag {
  font-size:0.75rem;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,0.5);
  color: var(--muted);
}
.recent-activity ul {
  margin:0;
  padding:0;
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.recent-activity li {
  padding-left:12px;
  position:relative;
  font-size:0.9rem;
}
.recent-activity li::before {
  content:'•';
  position:absolute;
  left:0;
  color: var(--brand);
}
.score-section {
  display:flex;
  flex-direction:column;
  gap:6px;
}
.score-section h3 {
  margin:0;
  font-size:1rem;
  font-weight:600;
}
.grade-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap:8px;
}
.grade-card {
  border: var(--surface-border);
  border-radius:12px;
  background: var(--card-alt);
  padding:10px 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.grade-card .score-label {
  margin:0;
}
.grade-card .score-value {
  margin:0;
}
.muted-note {
  text-align:center;
  color:var(--muted);
  margin-top:6px;
}

.study-status-wrap {
  display:flex;
  flex-direction:column;
  gap:24px;
  padding-bottom:30px;
  color: var(--text);
  font-size: 1rem;
}
#study-status-page,
#study-status-page * {
  font-size: 1rem !important;
}
#myscore-page,
#myscore-page * {
  font-size: 1rem !important;
}
#myscore-page .myscore-header__title h1 {
  font-size: 1.2rem !important;
}
#myscore-page .score-detail-panel__content,
#myscore-page .score-detail-panel__content * {
  font-size: 0.8rem !important;
}
#myscore-page .score-label {
  font-size: 1.2rem !important;
  display: inline;
  margin: 0;
}
#myscore-page .score-period {
  font-size: 0.9rem !important;
  margin-left: 4px !important;
  display: inline-block;
  vertical-align: baseline;
}
#myscore-page .score-badge {
  font-size: 0.9rem !important;
}
#myscore-page .score-hero-delta {
  font-size: 0.9rem !important;
}
#myscore-page .simple-modal-body,
#myscore-page .simple-modal-body * {
  font-size: 0.9rem !important;
}
#attendance-page,
#attendance-page * {
  font-size: 1rem !important;
}
#ranking-page,
#ranking-page * {
  font-size: 1rem !important;
}
#ranking-page h1 {
  font-size: 1.2rem !important;
}
#ranking-page .rank-title {
  font-size: 1.2rem !important;
}
#ranking-page .rank-modal-title {
  font-size: 1.2rem !important;
}
#attendance-page .attendance-tier-table,
#attendance-page .attendance-tier-table th,
#attendance-page .attendance-tier-table td {
  font-size: 0.8rem !important;
}
#attendance-page .attendance-page-header h2,
#attendance-page .attendance-tier-header h3 {
  font-size: 1.2rem !important;
}
#study-status-page .study-heading h1 {
  font-size: 1.2rem !important;
}
.study-heading {
  text-align:left;
}
.study-heading h1 {
  margin:0;
  font-size: calc(var(--study-font-size, 16px) * 1.6);
  font-weight:700;
}
.study-heading .muted {
  margin-top:6px;
  color: var(--muted);
  font-size: calc(var(--study-font-size, 16px) * 0.9);
}
#study-status-page .study-heading .muted {
  font-size: 0.8rem !important;
}
.subject-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
  gap:14px;
}
.subject-card {
  border: var(--surface-border);
  border-radius: var(--card-radius);
  padding:18px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  color: var(--text);
  display:flex;
  flex-direction:column;
  gap:10px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  text-align:left;
}
.subject-card:hover {
  transform: translateY(-2px);
}
.subject-card.active {
  border-color: var(--brand);
  box-shadow: 0 20px 40px rgba(37,99,235,0.18);
}
.subject-card header {
  display:flex;
  align-items:center;
  gap:10px;
}
.subject-card strong {
  font-size: calc(var(--study-font-size, 16px) * 1.1);
  display:block;
}
.subject-card .muted {
  color: var(--muted);
  margin:4px 0 0;
  font-size: calc(var(--study-font-size, 16px) * 0.85);
}
.subject-grade-detail {
  display:none;
  border: var(--surface-border);
  border-radius: 14px;
  padding: 16px;
  background: var(--card-alt);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
  color: var(--text);
}
.grade-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}
.grade-progress {
  width:100%;
  height:10px;
  border-radius:999px;
  background:rgba(15,23,42,0.08);
  overflow:hidden;
  margin-top:6px;
}
.grade-progress span {
  display:block;
  height:100%;
  background:linear-gradient(90deg,var(--brand),#38bdf8);
}
.collapse-section {
  border:var(--surface-border);
  border-radius:16px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  padding:12px;
  margin-top:16px;
}
.collapse-toggle {
  width:100%;
  text-align:left;
  border:none;
  background:transparent;
  padding:12px;
  font-weight:600;
  cursor:pointer;
  display:flex;
  justify-content:space-between;
  align-items:center;
  color: var(--text);
  font-size: calc(var(--study-font-size, 16px) * 0.95);
}
.collapse-panel {
  max-height:0;
  overflow:hidden;
  transition:max-height 0.3s ease;
}
.collapse-panel.open {
  max-height:320px;
}
.word-list {
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.word-badge {
  font-size:0.65rem;
  color: var(--muted);
  margin-left:6px;
}
.word-list li {
  border-bottom:1px solid var(--border);
  padding:6px 0;
  font-size: calc(var(--study-font-size, 16px) * 0.95);
  color: var(--text);
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  align-items:center;
}
.word-main {
  display:block;
  overflow-wrap:break-word;
}
.mastery-pill {
  background: var(--card-alt);
  border: var(--surface-border);
  border-radius:999px;
  padding:6px 14px;
  font-weight:600;
  font-size: calc(var(--study-font-size, 16px) * 0.9);
  color: var(--text);
}
.modal-trigger-row {
  display:flex;
  flex-direction:column;
  gap:8px;
}
#score-system-modal.simple-modal {
  padding-top: 66px;
}
.modal-backdrop.simple-modal { display:none; }
#modal-overlay.simple-modal {
  width:100%;
  top:0;
  bottom:0;
  padding:12px 8px;
  align-items:stretch;
  justify-content:center;
  margin-top:0;
  height: 100svh;
  max-height: 100svh;
  padding-top: calc(var(--navbar-height, 56px) + 12px);
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  overflow: hidden;
}
#modal-overlay.simple-modal .modal-content {
  height: auto;
  max-height: calc(100vh - var(--navbar-height, 56px) - 24px - max(0px, env(safe-area-inset-bottom, 0px)));
  max-height: calc(100dvh - var(--navbar-height, 56px) - 24px - max(0px, env(safe-area-inset-bottom, 0px)));
  max-height: calc(100svh - var(--navbar-height, 56px) - 24px - max(0px, env(safe-area-inset-bottom, 0px)));
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
#modal-overlay.simple-modal .simple-modal-body {
  flex:1;
  overflow-y:auto;
}
.simple-modal .modal-content {
  max-width: calc(var(--mobile-width) - 32px);
  width: min(calc(var(--mobile-width) - 32px), 92vw);
  margin:0;
  border-radius:18px;
  padding:10px;
  border:var(--surface-border);
  background:var(--card);
}
.simple-modal-body {
  padding:24px 10px;
  color: var(--text);
  text-align:left;
  font-size: calc(var(--study-font-size, 16px) * 0.85);
}
.simple-modal-body .word-list {
  padding-left:0;
  margin:0;
}
.word-list li .word-badge {
  font-size: calc(var(--study-font-size, 16px) * 0.65);
}
body.modal-open { overflow:hidden; }

.settings-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.settings-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.95rem;
}

.settings-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-status {
  min-height: 20px;
  font-size: 0.85rem;
  color: var(--text);
}

.small-text {
  font-size: 0.8rem;
  margin: 0;
}

.home-modal .modal-body .muted.small-text {
  font-size: 0.96rem;
}

.grade-pill-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.grade-pill {
  border: 1px solid rgba(59,130,246,0.4);
  background: rgba(59,130,246,0.08);
  color: var(--text);
  padding: 12px 10px;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.grade-pill:hover {
  background: rgba(59,130,246,0.2);
  transform: translateY(-1px);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(148, 163, 184, 0.6);
  transition: 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: \"\";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: var(--brand);
}

.switch input:checked + .slider:before {
  transform: translateX(24px);
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -100%); /* top 기준 위쪽에 자리 */
  margin: 0;
  background: rgba(248, 250, 255, 0.95);
  color: #0f172a;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  font-weight: 600;
  min-width: auto;
  max-width: min(90vw, 720px);
  text-align: center;
  z-index: 3000;
  transition: opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
}

.toast,
.toast.hint-toast {
  margin: 0;
  padding: 10px 15px !important;
  font-size: 1rem !important;
  white-space: nowrap !important;
  height: auto !important;
  line-height: 1.4 !important;
  text-overflow: unset !important;
}

.toast.show {
  opacity: 1;
}

.toast.hint-toast {
  top: 16px;
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translate(-50%, -100%);
  min-width: auto;
  max-width: min(90vw, 624px);
  padding: 14px 24px;
  text-align: center;
  background: rgba(254, 243, 199, 0.98);
  color: #7c2d12;
  border-color: rgba(180, 83, 9, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.toast.hint-toast.show {
  transform: translate(-50%, -100%);
}

.toast.success {
  background: rgba(16, 185, 129, 0.92);
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.6);
}

.toast[data-toast-type="success"] {
  background: rgba(16, 185, 129, 0.92) !important;
  color: #ffffff !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
}

.toast.error {
  background: rgba(239, 68, 68, 0.92);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.6);
}

.toast[data-toast-type="error"] {
  background: rgba(239, 68, 68, 0.92) !important;
  color: #ffffff !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
}

.reward-toast {
  background: rgba(16, 185, 129, 0.92) !important;
  color: #ffffff !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
}

.error-toast {
  background: rgba(239, 68, 68, 0.92) !important;
  color: #ffffff !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
}

#fireworks-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 3500;
}

.modal-backdrop {
  position: fixed;
  top: var(--navbar-height, 56px);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 3000;
  padding: 16px;
  overflow: auto;
}
.modal-content {
  background: var(--card, #fff);
  color: var(--text, #111);
  border-radius: 14px;
  width: min(480px, 100%);
  max-height: 90vh;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.modal-header,
.modal-footer {
  padding: 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border, #ddd);
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
}
.modal-header.example-header {
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-bottom: none !important;
}
.example-actions {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: center;
  flex: 1;
  width: 100%;
  align-items: stretch;
}
.example-actions .btn.small,
.modal-header.example-header .btn.small {
  min-width: 90px;
  padding: 8px 12px;
  text-align: center;
}
.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}
.score-system-panel .modal-close-btn {
  position: static;
}
.modal-footer {
  border-top: 1px solid var(--border, #ddd);
  border-bottom: none;
}
.modal-body {
  padding: 16px 10px;
  overflow: auto;
}
.modal-title {
  font-weight: 700;
  font-size: 1rem;
}
.example-text {
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.example-text.muted {
  color: var(--muted, #666);
}

.example-underline {
  text-decoration: underline;
  font-weight: 800;
}

/* ------------------------------- */
/* Quiz page specific styles       */
/* ------------------------------- */
#example-modal .example-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 0 !important;
}
#example-modal .example-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: 100%;
  padding: 8px 0;
}
#example-modal.modal-backdrop {
  align-items: flex-start; /* 질문 영역 아래에서 시작하도록 정렬 */
  justify-content: center;
}
#example-modal .example-actions .btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  font-size: 1rem;
  border-radius: 999px;
  background: var(--card, #fff);
  border: 1px solid rgba(15, 23, 42, 0.15);
  color: var(--text, #111);
  transition: background 0.2s ease, border-color 0.2s ease;
  height: 100%;
  white-space: nowrap;
}
#example-modal .modal-content {
  width: min(380px, 64vw); /* PC에서 가로폭 더 축소 */
  max-width: 72vw;
  margin: 0 auto;
  max-height: 78vh;
  padding: 10px 14px 5px;
  padding-bottom: 5px !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#example-modal .modal-body {
  padding: 10px;
  flex: 1;
}
#example-modal .modal-body {
  border: 1px solid var(--border, rgba(15, 23, 42, 0.25));
  border-radius: 12px;
}

#example-modal .modal-body .example-text {
  font-size: 1.2rem;
  line-height: 1.6;
  word-break: keep-all;
  text-align: left;
  border: none;
  padding: 8px 0;
}
#example-modal .modal-body .example-text.muted {
  font-size: 1rem;
  text-align: left;
  color: var(--text, #111);
  font-weight: 600;
}

#example-modal .modal-footer {
  position: static;
  top: auto;
  border-top: none !important;
  border-bottom: none;
  padding: 8px 12px 12px;
  justify-content: flex-end;
  background: inherit;
}

#example-modal .example-footer {
  width: 100%;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 0;
}

#example-modal .example-footer .btn {
  min-width: 88px;
  padding: 8px 14px;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  font-size: 1rem;
}

@media (max-width: 540px) {
  #example-modal .modal-content {
    width: 92vw;      /* 작은 화면에서는 여백을 조금 더 확보 */
    max-width: 92vw;
    padding: 12px 14px 16px;
    padding-bottom: 5px !important;
  }
}

.quiz-emphasis {
  border: 3px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: none;
  padding: 14px 16px;
}
.question-wrapper h1 {
  margin: 0;
  margin-bottom: 5px;
  font-size: clamp(1.4rem, 4vw + 0.6rem, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.012em;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  text-align: center;
  line-height: 1.2;
}
.typing-mode {
  margin: 0;
}
.question-wrapper.example-mode h1 {
  display: block;
  text-align: left;
  line-height: 1.26;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow: visible;
  max-height: none;
}
.question-wrapper.session-complete #question {
  font-size: calc(1.875rem - 4px);
}
.question-wrapper.quiz-emphasis {
  min-height: 80px !important;
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 10px;
  box-sizing: border-box;
}

.question-wrapper.quiz-emphasis #question {
  align-self: stretch;
}
.question-wrapper.quiz-emphasis:not(.example-mode) {
  /* 의미/스펠링 모드에서 높이 기준을 맞추고, 스펠링모드가 너무 낮아 보이지 않게 합니다 */
  min-height: 0;
}
.question-wrapper.quiz-emphasis.example-mode {
  min-height: 0;              /* 예문 모드에서는 높이 최소화 */
  max-height: none;
  overflow: visible;
  justify-content: center;
  gap: 0;
}
#question {
  font-size: 1.875rem;
}
#multiple-choice-area.quiz-emphasis {
  gap: 12px;
}
#multiple-choice-area .option-box {
  height: var(--mc-option-height, auto);
  min-height: 0;
  border-width: 2px;
  border-color: var(--border);
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.2s, color 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  line-height: 1.3;
}
@media (hover: none) and (pointer: coarse) {
  #multiple-choice-area .option-box {
    -webkit-tap-highlight-color: transparent;
  }
}
#multiple-choice-area .option-box:focus,
#multiple-choice-area .option-box:focus-visible {
  outline: none;
}
@media (hover: hover) and (pointer: fine) {
  #multiple-choice-area .option-box:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
  }
}
.question-wrapper.example-mode ~ #multiple-choice-area .option-box {
  padding: 6px; /* 모든 모드에서 동일한 패딩 유지 */
}
.example-translation {
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 한글 해석 2줄 제한 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
  align-self: stretch;
}
.example-translation.small-text {
  font-size: 1rem;
  line-height: 1.28;
}

#multiple-choice-area.spelling-mode .option-box,
#multiple-choice-area.typing-mode .option-box {
  font-size: 1.75rem;
}

#multiple-choice-area:not(.spelling-mode) .option-box {
  font-size: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  .quiz-emphasis {
    border-color: var(--text);
  }
  #multiple-choice-area .option-box {
    border-color: #bbb;
  }
  #example-modal .example-actions .btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: #f8fafc;
  }
  #example-modal .example-footer .btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.35);
    color: #f8fafc;
  }
}

.combo-banner {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: rgb(59, 130, 246);
  color: #e5f0ff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.35);
  opacity: 0;
  transition: opacity 0.18s ease;
  max-width: 80vw;
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: 28px;
  max-height: 32px;
  overflow: hidden;
  z-index: 3600;
  pointer-events: none;
}

.combo-banner.show {
  opacity: 0.9;
}

.firework-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: firework-pop 1.1s ease-out forwards;
}

@keyframes firework-pop {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.6);
  }
  80% {
    opacity: 1;
    transform: translate(var(--tx), var(--ty)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), calc(var(--ty) + 30px)) scale(0.9);
  }
}

@media (max-width: 480px) {
  body {
    padding: 64px 12px 16px;
  }

  .card {
    max-width: 100%;
    padding: 16px 14px;
    border-radius: 12px;
  }

  .quiz-info-header.card {
    min-height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header-group {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }

  .grade-badge,
  .mastery-badge {
    font-size: 0.85em;
  }

  #combo-banner {
    left: 50%;
    top: 96px;
    transform: translateX(-50%);
  }

  #question {
    font-size: 1.4rem;
    line-height: 1.35;
  }

  .option-box {
    font-size: 1.26rem;
    padding: 6px;
  }

  .word-status-box {
    font-size: 0.85em;
    gap: 4px;
  }

  .support-controls {
    margin-top: 0 !important;
    gap: 6px;
  }

  .hint-area {
    min-height: 36px;
    font-size: 0.85em;
    padding: 6px 10px;
  }

.typing-controls .btn {
  padding: 5px 5px;
  font-size: 0.95rem;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
  width: 100% !important;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
}

.keyboard-typing-active,
.keyboard-typing-active body {
  height: 100vh !important;
  overflow: hidden !important;
}

.typing-controls .btn span {
  display: block;
}

#typing-area {
  border: 2px solid var(--border, #ddd);
  padding: 5px;
  border-radius: 16px;
}

.settings-card {
  padding: 16px;
}

  .settings-buttons {
    flex-direction: column;
  }

.toast {
    top: 50%;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translate(-50%, -100%);
    font-size: 1rem;
    padding: 10px 16px;
  }
}
.question-wrapper {
  position: relative;
  padding-left: 8px;
  overflow: visible;
}

.feedback-cluster {
  /* ✅ [수정 반영] 문제 영역 하단 중앙에 위치 */
  position: absolute;
  left: 50%; /* 부모의 중앙에 시작점을 설정 */
  bottom: -50px; /* 부모 요소의 하단보다 50px 아래 */
  transform: translate(-50%, 0); /* 요소 자체 너비의 50%만큼 왼쪽으로 이동하여 중앙 정렬 */
  
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  z-index: 10; /* 다른 요소에 가려지지 않도록 z-index 추가 */
}

.feedback-overlay {
  opacity: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.35);
  white-space: nowrap;
  transition: opacity 0.18s ease;
}

.feedback-overlay.show {
  opacity: 1;
}

.feedback-overlay.success {
  background: rgba(34, 197, 94, 0.9);
  color: #0b3d16;
}

.feedback-overlay.fail {
  background: rgba(248, 113, 113, 0.95);
  color: #4c0519;
}

.attendance-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.attendance-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  width: min(calc(var(--mobile-width) - 32px), 520px);
  max-width: calc(var(--mobile-width) - 32px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.attendance-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text);
}
.attendance-page-header h1 {
  margin: 0;
}
.attendance-page-header h2 {
  margin: 0;
  font-size: 1.2rem;
}
.attendance-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.attendance-tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.attendance-tier-table.hidden {
  display: none;
}
.attendance-panel.card,
.attendance-tier-section.card {
  padding: 10px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}
.attendance-summary-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.attendance-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.attendance-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.attendance-summary-card .muted.small-text {
  font-size: 1rem;
}
.attendance-summary-card strong {
  font-size: 1rem;
}
.attendance-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.calendar-cell {
  padding: 10px 8px;
  text-align: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  position: relative;
}
.calendar-cell.attended {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.7);
  font-weight: 700;
}
.calendar-cell.shielded {
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.8);
  font-weight: 700;
}
.attendance-legend {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  align-items: center;
}
.attendance-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.attendance-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}
.attendance-legend__dot--attended {
  background: rgba(59, 130, 246, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.8);
}
.attendance-legend__dot--shielded {
  background: rgba(245, 158, 11, 0.55);
  border: 1px solid rgba(245, 158, 11, 0.85);
}
.calendar-cell.attended::after {
  content: none;
}
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.calendar-header button {
  padding: 4px 8px;
}

.attendance-tier-section {
  margin-top: 8px;
}
.attendance-tier-section h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
}
.attendance-tier-table-wrapper {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  width: 100%;
  max-width: 100%;
}
.attendance-tier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 0;
}
.attendance-tier-table th,
.attendance-tier-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  text-align: left;
  font-size: 0.8rem;
}
.attendance-tier-table th {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.attendance-tier-table td:last-child {
  white-space: normal;
  word-break: break-word;
}

.modal-trigger-row{display:flex;flex-direction:column;gap:8px;}
.modal-trigger-row.dual{flex-direction:row; gap:10px;}
.modal-trigger-row.dual .btn{
  flex:1;
  border:1px solid var(--brand);
  background: rgba(59,130,246,0.12);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(59,130,246,0.25);
}
/* remove remaining shadows on quiz page */
.quiz-emphasis,
.support-controls-wrapper .support-controls,
.support-controls .btn,
.action-grid button,
#multiple-choice-area .option-box,
.word-status-box,
#toast,
#combo-banner {
  box-shadow: none !important;
}
.home-quote-card,
.registered-card,
.home-registered-card,
.hero-action-row,
.hero-action-buttons,
.modal-trigger-row,
.modal-trigger-row.dual .btn {
  box-shadow: none !important;
}
