/* ============================================================
   CLS 용어집 — 디자인 토큰
   코어라인소프트 공식 브랜드 가이드 기준:
   - coreline Green (Pantone 2240C / #00D1A3): 메인 컬러
   - coreline Blue  (Pantone 2727C / #0087D7): 서브 포인트 컬러
   - 컬러 비율: White 70% · Black 5% · Green 15% · Blue 10%
   - 국문 서체: Noto Sans CJK KR (Google Fonts의 Noto Sans KR로 대체 로드)
   - 영문 서체: Gilroy(상용 서체, 라이선스 미보유) → 유사 계열 무료 대체
   ============================================================ */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f9f9;
  --card: #ffffff;
  --ink: #14181c;
  --ink-soft: #3d4a4a;
  --muted: #7c8888;
  --border: #e4eaea;

  --primary: #00d1a3;        /* coreline Green */
  --primary-dark: #009d7a;
  --primary-soft: #e2faf4;
  --accent-blue: #0087d7;    /* coreline Blue */
  --accent-blue-dark: #00659f;
  --accent-blue-soft: #e5f3fc;

  --danger: #e5484d;
  --danger-soft: #fdeceb;
  --warn: #d98c1f;
  --warn-soft: #fdf3e2;

  --study-bg: #ffffff;
  --study-panel: #f6f9f9;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(20, 40, 40, 0.06);
  --font-display: "Noto Sans KR", "Pretendard", -apple-system, "Malgun Gothic", sans-serif;
  --font-body: "Noto Sans KR", "Pretendard", -apple-system, "Malgun Gothic", sans-serif;
  --font-en: "Poppins", "Noto Sans KR", sans-serif; /* Gilroy 대체(라이선스 미보유) */
  --font-mono: "JetBrains Mono", "Roboto Mono", ui-monospace, monospace;

  /* 카테고리 컬러 — 브랜드 그린/블루 패밀리 안에서 명도차로 구분 */
  --cat-1: #0087d7;  /* 개념 — coreline Blue */
  --cat-2: #00d1a3;  /* 기술 — coreline Green */
  --cat-3: #045f9c;  /* 임상 — 딥 블루 */
  --cat-4: #00a89a;  /* 해부학 — 그린블루 블렌드 */
  --cat-5: #4fb3e8;  /* IT — 라이트 블루 */
  --cat-6: #00966f;  /* 인허가 — 딥 그린 */
  --cat-7: #5b7c93;  /* 제품 — 슬레이트 블루 */
  --cat-8: #6b7280;  /* 기관회사명 — 뉴트럴 그레이 */
  --cat-9: #6be0c4;  /* 프로젝트 — 라이트 그린 */
  --cat-10: #a9b8c4; /* 기타 — 라이트 그레이블루 */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-soft);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- 레이아웃 ---------- */
.shell { max-width: 720px; margin: 0 auto; padding: 24px 20px 80px; }
.shell-wide { max-width: 980px; margin: 0 auto; padding: 24px 20px 80px; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 20px; }
.topbar-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.topbar-title .icon-badge {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; letter-spacing: -0.5px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.topbar-actions button.linklike { background: none; border: none; color: var(--muted); font-size: 13px; text-decoration: underline; }

/* ---------- 카드 ---------- */
.card { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px; border: 1px solid var(--border); }
.card + .card { margin-top: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--card); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 18px 16px; text-align: center; border: 1px solid var(--border); }
.stat-card .num { font-size: 28px; font-weight: 800; color: var(--ink); }
.stat-card .num.teal { color: var(--primary-dark); }
.stat-card .label { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* ---------- 폼 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 7px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14.5px; color: var(--ink);
  background: #fff; outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: var(--primary); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 18px; border-radius: var(--radius-sm); border: none;
  font-weight: 700; font-size: 14.5px; transition: filter .15s, transform .05s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-block { width: 100%; }
.btn-outline { background: #fff; border: 1.5px solid var(--border); color: var(--ink-soft); }
.btn-outline-danger { background: #fff; border: 1.5px solid var(--danger); color: var(--danger); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: none; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 9px; }
.btn-chip { padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--bg-soft); color: var(--ink-soft); border: 1.5px solid var(--border); }
.btn-chip:hover { border-color: var(--primary); }
.btn-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 사용자 목록 (관리자) ---------- */
.section-title { font-size: 16px; font-weight: 800; margin: 28px 0 12px; display: flex; align-items: center; justify-content: space-between; }
.user-item { border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 12px; }
.user-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.user-email { font-weight: 700; font-size: 14.5px; }
.user-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.badge { padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge-active { background: var(--primary-soft); color: var(--primary-dark); }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-expired { background: var(--danger-soft); color: var(--danger); }
.badge-disabled { background: #eee; color: #888; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.date-row { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.date-row input[type="date"] { flex: 1; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px; }
.action-row { display: flex; gap: 10px; margin-top: 14px; }
.action-row .btn { flex: 1; }

.progress-mini { height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; margin-top: 4px; }
.progress-mini > div { height: 100%; background: var(--primary); border-radius: 99px; }

.details-panel { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 13.5px; color: var(--ink-soft); display: none; }
.details-panel.open { display: block; }
.details-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.details-grid .mini-stat { background: var(--bg-soft); border-radius: 10px; padding: 10px; text-align: center; }
.details-grid .mini-stat .n { font-weight: 800; font-size: 16px; color: var(--ink); }
.details-grid .mini-stat .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cat-bar-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; }
.cat-bar-row .name { width: 84px; flex-shrink: 0; color: var(--muted); }
.cat-bar-row .track { flex: 1; height: 7px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.cat-bar-row .track > div { height: 100%; background: var(--accent-blue); }
.cat-bar-row .pct { width: 34px; text-align: right; font-weight: 700; color: var(--ink-soft); }

/* ============================================================
   학생 홈 대시보드
   ============================================================ */
.dash-shell { max-width: 720px; margin: 0 auto; padding: 20px 18px 90px; }
.dash-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 18px; }
.dash-top .title { font-size: 19px; font-weight: 800; }
.dash-top .subtitle { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.dash-top .actions { display: flex; gap: 8px; align-items: center; }
.dash-top button.icon-btn { background: #fff; border: 1.5px solid var(--border); width: 36px; height: 36px; border-radius: 11px; font-size: 14px; color: var(--ink-soft); }

.overview-card { text-align: center; }
.overview-card .headline { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.overview-stats { display: flex; justify-content: center; gap: 34px; margin-bottom: 16px; }
.overview-stats .item .n { font-size: 26px; font-weight: 800; }
.overview-stats .item .n.new { color: var(--accent-blue); }
.overview-stats .item .n.learning { color: var(--warn); }
.overview-stats .item .n.known { color: var(--primary-dark); }
.overview-stats .item .l { font-size: 12px; color: var(--muted); margin-top: 2px; }

.overview-bar { height: 9px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; margin-bottom: 8px; }
.overview-bar > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent-blue)); border-radius: 99px; }
.overview-progress-label { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }

.cat-progress-list { text-align: left; margin-bottom: 20px; }
.cat-progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12.5px; }
.cat-progress-row .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cat-progress-row .name { width: 66px; flex-shrink: 0; color: var(--ink-soft); font-weight: 700; }
.cat-progress-row .track { flex: 1; height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.cat-progress-row .track > div { height: 100%; border-radius: 99px; }
.cat-progress-row .pct { width: 38px; text-align: right; font-weight: 800; color: var(--ink-soft); }
.cat-progress-row .count { width: 62px; text-align: right; color: var(--muted); font-size: 11.5px; }

.heatmap-card .heatmap-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.heatmap-card .heatmap-head .label { font-size: 13.5px; font-weight: 800; color: var(--ink-soft); }
.heatmap-nav-wrap { display: flex; align-items: center; gap: 8px; }
.heatmap-nav { background: var(--bg-soft); border: 1px solid var(--border); width: 28px; height: 28px; border-radius: 8px; color: var(--ink-soft); font-size: 11px; flex-shrink: 0; }
.heatmap-nav:hover { border-color: var(--primary); color: var(--primary-dark); }
.heatmap-months { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 4px; flex: 1; justify-content: center; }
.heatmap-month { flex-shrink: 0; }
.heatmap-month .month-label { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-align: center; }
.heatmap-grid { display: grid; grid-template-columns: repeat(7, 13px); grid-auto-rows: 13px; gap: 3px; }
.heatmap-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--bg-soft); }
.heatmap-cell.l1 { background: #bdeee2; }
.heatmap-cell.l2 { background: #6fdcc0; }
.heatmap-cell.l3 { background: #2fd0ab; }
.heatmap-cell.l4 { background: var(--primary-dark); }
.heatmap-cell.today { outline: 2px solid var(--danger); outline-offset: 1px; }
.heatmap-foot { margin-top: 12px; font-size: 12px; color: var(--muted); }
.heatmap-foot strong { color: var(--ink-soft); }

.today-cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 560px) { .today-cat-grid { grid-template-columns: 1fr; } }
.today-cat-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border-radius: var(--radius-md); box-shadow: var(--shadow); background: #fff;
  cursor: pointer; border: 1px solid var(--border); border-left: 4px solid transparent; transition: transform .1s;
}
.today-cat-card:active { transform: scale(0.99); }
.today-cat-card .cat-icon { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11.5px; color: #fff; }
.today-cat-card .cat-body { flex: 1; min-width: 0; }
.today-cat-card .cat-name { font-weight: 800; font-size: 13.5px; }
.today-cat-card .cat-meta { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-cat-card .cat-mini-bar { height: 4px; border-radius: 99px; background: var(--bg-soft); margin-top: 7px; overflow: hidden; }
.today-cat-card .cat-mini-bar > div { height: 100%; border-radius: 99px; }
.today-cat-card .cat-stats { text-align: right; flex-shrink: 0; }
.today-cat-card .cat-stats .n { font-size: 14px; font-weight: 800; }
.today-cat-card .cat-stats .l { font-size: 9.5px; color: var(--muted); }

.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.menu-tile { background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 22px 16px; text-align: center; border: 1px solid var(--border); }
.menu-tile .ico { font-size: 22px; margin-bottom: 8px; }
.menu-tile .label { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }

.log-card .log-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.log-card .log-head .label { font-size: 15px; font-weight: 800; }
.log-card .log-head .today-btn { background: var(--primary); color: #fff; padding: 5px 14px; border-radius: 8px; font-weight: 700; font-size: 12px; border: none; }
.log-date-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; font-size: 14px; font-weight: 700; }
.log-date-nav button { background: var(--bg-soft); border: 1px solid var(--border); width: 28px; height: 28px; border-radius: 8px; color: var(--ink-soft); font-size: 11px; }
.log-date-nav button:hover { border-color: var(--primary); color: var(--primary-dark); }
.log-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 20px 0; }
.log-count { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.log-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.log-item:last-child { border-bottom: none; }
.log-item .term { color: var(--ink-soft); }
.log-item .result-badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.log-item .result-badge.known { background: var(--primary-soft); color: var(--primary-dark); }
.log-item .result-badge.unknown { background: var(--danger-soft); color: var(--danger); }

.browse-search { width: 100%; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 14px; margin-bottom: 14px; background: #fff; }
.browse-item { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 8px; background: #fff; cursor: pointer; }
.browse-item .t { font-weight: 700; font-size: 14px; }
.browse-item .q { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.browse-item .tags { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.browse-item .tags span { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: var(--bg-soft); color: var(--muted); }
.tag-tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tag-tile { background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 18px; border: 1px solid var(--border); border-left: 5px solid; text-align: left; }
.tag-tile .name { font-weight: 800; font-size: 14.5px; }
.tag-tile .count { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ============================================================
   학습 화면 (플래시카드) — 라이트 테마로 통일, 그린 스캔라인 시그니처
   ============================================================ */
.study-shell { background: var(--study-bg); min-height: 100vh; color: var(--ink); padding-bottom: 100px; }
.study-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; max-width: 640px; margin: 0 auto; }
.study-top .dday { font-family: var(--font-mono); font-size: 12.5px; color: var(--primary-dark); font-weight: 700; }
.study-top .brand { font-weight: 800; font-size: 15px; letter-spacing: -.2px; }
.study-top button.icon-btn { background: var(--bg-soft); border: 1.5px solid var(--border); color: var(--ink-soft); width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }

.progress-header { max-width: 640px; margin: 0 auto; padding: 4px 20px 6px; }
.progress-header .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.progress-header .bar { height: 6px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.progress-header .bar > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent-blue)); }

.chip-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 14px 20px; max-width: 640px; margin: 0 auto; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll .chip { flex-shrink: 0; padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--bg-soft); color: var(--ink-soft); border: 1px solid var(--border); }
.chip-scroll .chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.card-stage { max-width: 560px; margin: 10px auto 0; padding: 0 20px; perspective: 1400px; }
.flashcard { position: relative; min-height: 360px; border-radius: 26px; background: #fff; border: 1.5px solid var(--border); box-shadow: var(--shadow); padding: 30px 26px 26px; overflow: hidden; }
.flashcard::before { content: ""; position: absolute; left: 0; right: 0; height: 2px; top: 0; background: linear-gradient(90deg, transparent, var(--primary), transparent); animation: scan 3.2s ease-in-out infinite; opacity: .8; }
@keyframes scan { 0% { top: 0; opacity: 0; } 8% { opacity: .9; } 50% { top: 100%; opacity: .5; } 92% { opacity: .9; } 100% { top: 100%; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .flashcard::before { animation: none; display: none; } }
.flashcard .kicker { font-family: var(--font-mono); font-size: 11px; color: var(--accent-blue); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 14px; }
.flashcard .question-text { font-size: 19px; line-height: 1.55; font-weight: 600; color: var(--ink); }
.flashcard .tags-mini { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.flashcard .tags-mini span { font-size: 11px; padding: 4px 9px; border-radius: 999px; background: var(--bg-soft); color: var(--muted); }

.flashcard.revealed { background: var(--primary-soft); border-color: var(--primary); }
.flashcard.revealed .term { font-size: 24px; font-weight: 800; color: var(--primary-dark); margin-bottom: 10px; }
.flashcard.revealed .explanation { font-size: 14px; line-height: 1.75; color: var(--ink-soft); }
.flashcard.revealed .explanation ul { margin: 0; padding-left: 18px; }
.flashcard.revealed .explanation li { margin-bottom: 8px; }
.flashcard .media-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.flashcard .media-row img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.flashcard .audio-btn { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--accent-blue); color: var(--accent-blue-dark); padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.flashcard .source-link { display: block; margin-top: 14px; font-size: 12.5px; color: var(--accent-blue-dark); text-decoration: underline; }

.tap-hint { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* '답 확인' 버튼과 아래 펼쳐지는 답 영역 (nomu2 스타일) */
.reveal-btn {
  display: block; width: 100%; margin-top: 22px; padding: 15px;
  border-radius: 14px; border: none; background: var(--ink); color: #fff;
  font-weight: 800; font-size: 14.5px;
}
.reveal-btn:hover { filter: brightness(1.15); }
.answer-section { margin-top: 22px; }
.answer-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.answer-divider::before, .answer-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.answer-divider span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 2px; color: var(--primary-dark); font-weight: 700; }
.answer-section .term { font-size: 22px; font-weight: 800; color: var(--primary-dark); margin-bottom: 10px; }
.answer-section .explanation { font-size: 14px; line-height: 1.75; color: var(--ink-soft); }
.answer-section .explanation ul { margin: 0; padding-left: 18px; }
.answer-section .explanation li { margin-bottom: 8px; }
.answer-section .media-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.answer-section .media-row img { max-width: 160px; max-height: 160px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.answer-section .audio-btn { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--accent-blue); color: var(--accent-blue-dark); padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.answer-section .source-link { display: block; margin-top: 14px; font-size: 12.5px; color: var(--accent-blue-dark); text-decoration: underline; }

/* 위로 가기 플로팅 버튼 */
.scroll-top-btn {
  position: fixed; right: 18px; bottom: 24px; width: 44px; height: 44px;
  border-radius: 12px; border: none; background: var(--primary); color: #fff;
  font-size: 18px; font-weight: 800; box-shadow: 0 6px 18px rgba(0, 160, 125, .35);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50;
}
.scroll-top-btn.visible { opacity: 1; pointer-events: auto; }

.study-actions { max-width: 560px; margin: 18px auto 0; padding: 0 20px; display: flex; gap: 12px; }
.study-actions button { flex: 1; padding: 16px; border-radius: 18px; border: none; font-weight: 800; font-size: 15px; }
.btn-unknown { background: var(--danger-soft); color: var(--danger); }
.btn-known { background: var(--primary); color: #fff; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .big { font-size: 40px; margin-bottom: 10px; }

/* ---------- 로그인 화면 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 25% 15%, var(--primary-soft), #ffffff 60%); padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 26px; padding: 34px 30px; box-shadow: 0 20px 50px rgba(20, 40, 40, 0.12); border: 1px solid var(--border); }
.login-logo { text-align: center; margin-bottom: 6px; font-size: 13px; color: var(--primary-dark); letter-spacing: 2px; text-transform: uppercase; font-weight: 700; }
.login-title { text-align: center; font-size: 21px; font-weight: 800; margin-bottom: 26px; }
.login-error { background: var(--danger-soft); color: var(--danger); font-size: 13px; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; display: none; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 20px; }

/* ---------- 유틸 ---------- */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.text-muted { color: var(--muted); font-size: 13px; }
.text-center { text-align: center; }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
