/* 주차별 객관식 평가(600문항)와 평가 대시보드 전용 스타일.
   색은 design.css 의 토큰만 쓴다. 직접 적으면 다크 모드에서 깨진다. */

:root {
  --exam-gap: 20px;
  --exam-radius: 16px;
}

/* ── 공통 조각 ───────────────────────────────────────────── */
.exam-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.exam-note.warn {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red-text);
}

.exam-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.exam-chip.is-strong { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.exam-chip.is-weak { border-color: var(--red); background: var(--red-soft); color: var(--red-text); }
.exam-chip.is-live { border-color: var(--red); color: var(--red-text); }
.exam-chip.is-muted { opacity: .72; }

.exam-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.exam-input,
.exam-field select,
.exam-field input,
.exam-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
}

.exam-field textarea { resize: vertical; min-height: 96px; line-height: 1.6; }

.exam-input:focus,
.exam-field select:focus,
.exam-field input:focus,
.exam-field textarea:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.exam-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.exam-toolbar .exam-field { min-width: 150px; flex: 1 1 150px; }

.exam-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.exam-bar-track > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--red);
  transition: width .3s ease;
}

.exam-bar-track.is-strong > span { background: var(--green); }
.exam-bar-track.is-weak > span { background: var(--red); }
.exam-bar-track.is-muted > span { background: var(--strong-line); }

.exam-empty {
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ── 구글 로그인 ─────────────────────────────────────────── */
.google-signin-slot { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 4px; min-height: 44px; }
.google-signin-slot code { padding: 1px 5px; border-radius: 5px; background: var(--surface-2); font-size: 12px; }

.admin-pw-fallback { width: 100%; margin-top: 4px; text-align: left; }
.admin-pw-fallback > summary { cursor: pointer; color: var(--muted); font-size: 13px; text-align: center; list-style: none; }
.admin-pw-fallback > summary::-webkit-details-marker { display: none; }
.admin-pw-fallback > summary:hover { color: var(--text); }
.admin-pw-fallback[open] > summary { margin-bottom: 10px; }

/* ── 주차 선택 ───────────────────────────────────────────── */
.exam-week-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.exam-week-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--exam-radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.exam-week-card header { display: flex; align-items: flex-start; gap: 10px; }
.exam-week-card h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.exam-week-card .exam-week-no { font-size: 12px; font-weight: 700; color: var(--red-text); }
.exam-week-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.exam-week-card .exam-week-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; }
.exam-week-card .exam-week-foot .btn { flex: 1; }

.exam-week-meta { display: flex; flex-wrap: wrap; gap: 6px; }

.exam-week-score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.exam-week-score small { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ── 응시 화면 ───────────────────────────────────────────── */
.exam-run-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: var(--exam-gap);
  align-items: start;
}

.exam-main-column { display: flex; flex-direction: column; gap: var(--exam-gap); min-width: 0; }

.exam-overall-progress { display: flex; flex-direction: column; gap: 6px; min-width: 190px; }
.exam-overall-progress .meta { font-size: 12px; color: var(--muted); }

.exam-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }

.exam-sheet-panel { padding: 16px; display: flex; flex-direction: column; gap: 10px; }

.exam-timer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--exam-radius);
  background: var(--surface);
}

.exam-timer strong {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  transition: font-size .25s ease, color .25s ease;
}

.exam-timer .exam-timer-label { font-size: 11.5px; font-weight: 600; color: var(--faint); letter-spacing: .02em; }
.exam-timer .exam-timer-note { font-size: 12px; color: var(--muted); }

.exam-timer-total strong { font-size: 20px; color: var(--muted); }
.exam-timer-total.is-urgent { border-color: var(--red); }
.exam-timer-total.is-urgent strong { color: var(--red-text); }

/* 문항 타이머 — 남은 시간에 따라 색·크기·흔들림이 단계로 올라간다. */
.exam-timer-question strong { font-size: 34px; }

.exam-timer-track {
  height: 6px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.exam-timer-track > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--green);
  transition: width 1s linear, background .3s ease;
}

.exam-timer-question.is-warn { border-color: var(--strong-line); }
.exam-timer-question.is-warn strong { color: var(--text); font-size: 38px; }
.exam-timer-question.is-warn .exam-timer-track > span { background: var(--red-text); }

.exam-timer-question.is-urgent {
  border-color: var(--red);
  background: var(--red-soft);
  animation: exam-timer-shake .8s ease-in-out infinite;
}

.exam-timer-question.is-urgent strong { color: var(--red-text); font-size: 44px; }
.exam-timer-question.is-urgent .exam-timer-label,
.exam-timer-question.is-urgent .exam-timer-note { color: var(--red-text); }
.exam-timer-question.is-urgent .exam-timer-track > span { background: var(--red); }

.exam-timer-question.is-over {
  border-color: var(--strong-line);
  background: var(--surface-2);
  animation: none;
}

.exam-timer-question.is-over strong { font-size: 28px; color: var(--muted); }

@keyframes exam-timer-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-3px) rotate(-.4deg); }
  30% { transform: translateX(3px) rotate(.4deg); }
  45% { transform: translateX(-2px); }
  60% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
}

@media (prefers-reduced-motion: reduce) {
  .exam-timer-question.is-urgent { animation: none; }
  .exam-timer strong { transition: none; }
}

/* ── 카카오톡 대화 ───────────────────────────────────────── */
.exam-chat .conversation-body { min-height: 268px; display: flex; flex-direction: column; }
.exam-chat .chat-row:last-child { margin-bottom: 0; }
.exam-chat .chat-bubble { max-width: min(100%, 460px); }

.exam-chat-waiting {
  margin: auto auto 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: #ffffff3d;
  color: var(--chat-meta, #425568);
  font-size: 12.5px;
}

.exam-chat .chat-row.is-new { animation: exam-bubble-in .28s ease-out; }

@keyframes exam-bubble-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .exam-chat .chat-row.is-new { animation: none; }
}

.exam-question-sub { margin: -8px 0 0; font-size: 13px; color: var(--muted); }

/* 복습·리포트 안의 작은 대화 조각 */
.exam-review-chat {
  --chat-bg: #b2c7d9;
  --chat-meta: #425568;
  --chat-divider: #7893ab55;
  margin: 0 0 14px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  background: var(--chat-bg);
}

.exam-review-chat .chat-row { margin-bottom: 0; }
.exam-review-chat .scenario-context { margin-top: 14px; padding-top: 12px; }

:root[data-theme="dark"] .exam-review-chat {
  --chat-bg: #293d50;
  --chat-meta: #c0cfdb;
  --chat-divider: #ffffff26;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .exam-review-chat {
    --chat-bg: #293d50;
    --chat-meta: #c0cfdb;
    --chat-divider: #ffffff26;
  }
}

.exam-sheet {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.exam-sheet button {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.exam-sheet button:hover { border-color: var(--strong-line); }
.exam-sheet button.is-answered { background: var(--surface-2); color: var(--text); border-color: var(--strong-line); }
.exam-sheet button.is-current { border-color: var(--red); color: var(--red-text); box-shadow: inset 0 0 0 1px var(--red); }

.exam-sheet button.is-flagged::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}

.exam-sheet button.is-locked { opacity: .55; text-decoration: line-through; }

.exam-sheet-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--muted); }
.exam-sheet-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--line); margin-right: 4px; vertical-align: -1px; }
.exam-sheet-legend i.answered { background: var(--surface-2); border-color: var(--strong-line); }
.exam-sheet-legend i.flagged { background: var(--red); border-color: var(--red); }
.exam-sheet-legend i.locked { background: var(--strong-line); border-color: var(--strong-line); opacity: .55; }

.exam-question-card { display: flex; flex-direction: column; gap: 18px; }

.exam-question-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.exam-question-head .exam-count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.exam-scenario {
  margin: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--red);
  border-radius: 0 12px 12px 0;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.exam-prompt { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.5; letter-spacing: -.01em; }

.exam-options { display: flex; flex-direction: column; gap: 10px; }

.exam-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.exam-option:hover { border-color: var(--strong-line); background: var(--surface-2); }

.exam-option .exam-option-key {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.exam-option.is-selected { border-color: var(--red); background: var(--red-soft); }
.exam-option.is-selected .exam-option-key { border-color: var(--red); background: var(--red); color: #fff; }
.exam-option.is-correct { border-color: var(--green); background: var(--green-soft); }
.exam-option.is-correct .exam-option-key { border-color: var(--green); background: var(--green); color: #fff; }
.exam-option.is-wrong { border-color: var(--red); background: var(--red-soft); }
.exam-option.is-wrong .exam-option-key { border-color: var(--red); background: var(--red); color: #fff; }
.exam-option[disabled] { cursor: default; }
.exam-option[disabled]:hover { border-color: var(--line); background: var(--surface); }
.exam-option.is-correct[disabled]:hover { border-color: var(--green); background: var(--green-soft); }
.exam-option.is-wrong[disabled]:hover { border-color: var(--red); background: var(--red-soft); }

.exam-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.exam-actions .exam-actions-right { margin-left: auto; display: flex; gap: 10px; }
.exam-save-state { font-size: 12px; color: var(--muted); }

/* ── 결과 ────────────────────────────────────────────────── */
.exam-result-head {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--exam-radius);
  background: var(--surface);
}

.exam-result-score { display: flex; align-items: baseline; gap: 4px; font-size: 44px; font-weight: 800; letter-spacing: -.04em; }
.exam-result-score small { font-size: 16px; font-weight: 600; color: var(--muted); }
.exam-result-head .exam-result-copy { flex: 1 1 220px; }
.exam-result-head h2 { margin: 0 0 4px; font-size: 18px; }
.exam-result-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.exam-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--exam-gap); }

.exam-breakdown { display: flex; flex-direction: column; gap: 14px; }
.exam-breakdown-row { display: flex; flex-direction: column; gap: 6px; }
.exam-breakdown-row .exam-breakdown-top { display: flex; gap: 10px; align-items: baseline; }
.exam-breakdown-row strong { font-size: 14px; }
.exam-breakdown-row .exam-breakdown-num { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.exam-review { display: flex; flex-direction: column; gap: 14px; }

.exam-review-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--exam-radius);
  background: var(--surface);
}

.exam-review-item.is-wrong { border-color: var(--red); }
.exam-review-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.exam-review-item .exam-prompt { font-size: 16px; margin-bottom: 12px; }

.exam-explain {
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.7;
}

.exam-explain strong { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); }

.exam-source {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.exam-source b { color: var(--text); font-weight: 600; }
.exam-source blockquote { margin: 4px 0 0; font-style: normal; }

/* ── 대시보드 ────────────────────────────────────────────── */
.exam-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }

.exam-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--exam-radius);
  background: var(--surface);
}

.exam-kpi span { font-size: 12px; color: var(--muted); }
.exam-kpi strong { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.exam-kpi strong small { font-size: 14px; font-weight: 600; color: var(--muted); }
.exam-kpi em { font-style: normal; font-size: 11.5px; color: var(--faint); }

.exam-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.exam-matrix th, .exam-matrix td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.exam-matrix th { font-size: 12px; color: var(--muted); font-weight: 600; }
.exam-matrix th:first-child, .exam-matrix td:first-child { text-align: left; }
.exam-matrix tbody tr:hover { background: var(--surface-2); }

.exam-person-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.exam-person-btn:hover { color: var(--red-text); }
.exam-person-btn small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }

.exam-cell {
  display: inline-flex;
  min-width: 46px;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.exam-cell.is-pass { background: var(--green-soft); color: var(--green); }
.exam-cell.is-fail { background: var(--red-soft); color: var(--red-text); }
.exam-cell.is-doing { border-color: var(--strong-line); color: var(--muted); font-weight: 600; }
.exam-cell.is-none { color: var(--faint); cursor: default; font-weight: 500; }

.exam-drawer-section { margin-bottom: 22px; }
.exam-drawer-section > h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: -.01em; }

.exam-history { display: flex; flex-direction: column; gap: 8px; }

.exam-history-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 13px;
}

.exam-history-row .exam-history-score { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.exam-history-row time { color: var(--muted); font-size: 12px; }

.exam-bank-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
}

.exam-bank-item .exam-bank-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.exam-bank-item h4 { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.exam-bank-option { display: flex; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; line-height: 1.55; }
.exam-bank-option.is-answer { background: var(--green-soft); color: var(--green); font-weight: 600; }

.exam-pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ── 보강 리포트 ─────────────────────────────────────────── */
.exam-report-headline {
  padding: 16px 18px;
  border-left: 3px solid var(--red);
  border-radius: 0 14px 14px 0;
  background: var(--red-soft);
  color: var(--red-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}

.exam-action-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.exam-action-list li { padding-left: 4px; }
.exam-action-list li .row { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.exam-action-list li p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--muted); }

.exam-report-group { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.exam-report-group > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.exam-report-group > summary::-webkit-details-marker { display: none; }
.exam-report-group > summary::before { content: "▸"; color: var(--faint); font-size: 12px; }
.exam-report-group[open] > summary::before { content: "▾"; }

.exam-report-answers { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.exam-report-answers p { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 14px; line-height: 1.6; }
.exam-report-answers .exam-chip { flex: none; }

.exam-config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }

.exam-config-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--exam-radius);
  background: var(--surface);
}

.exam-config-card header { display: flex; gap: 8px; align-items: center; }
.exam-config-card h3 { margin: 0; font-size: 15px; }
.exam-config-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.exam-switch { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); font-weight: 600; }

/* ── 좁은 화면 ───────────────────────────────────────────── */
@media (max-width: 1080px) {
  .exam-run-layout { grid-template-columns: minmax(0, 1fr); }
  .exam-side { position: static; order: -1; }
  .exam-sheet { grid-template-columns: repeat(10, 1fr); }
  .exam-side > .exam-timer { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .exam-side > .exam-timer .exam-timer-track { flex: 1 1 100%; margin-top: 0; }
}

@media (max-width: 640px) {
  .exam-sheet { grid-template-columns: repeat(8, 1fr); }
  .exam-result-score { font-size: 36px; }
  .exam-config-row { grid-template-columns: 1fr; }
  .exam-actions .exam-actions-right { margin-left: 0; width: 100%; }
  .exam-actions .exam-actions-right .btn { flex: 1; }
}

/* 머리줄 오른쪽. 대시보드는 들어올 때 한 번 읽고 그 값을 계속 쓴다 —
   화면을 열어 둔 채로 새 제출이 들어오면 눌러서 다시 읽는다. */
.topline-actions { display: flex; align-items: center; gap: 10px; }

/* ── 주차별 배지 ──────────────────────────────────────────
   100점을 연달아 받으면 등급이 오른다. 못 받은 배지는 지우지 않고 회색
   그림자로 둔다 — 무엇을 향해 가는지 보여야 목표가 된다. */
/* ── 배지 획득 축하 창 ─────────────────────────────────── */
.badge-backdrop .badge-card {
  max-width: 420px;
  padding: 30px 28px 24px;
  text-align: center;
}
.badge-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--red-text);
}
.badge-art {
  position: relative;
  margin: 14px auto 6px;
  width: 200px;
  height: 200px;
  display: grid;
  place-items: center;
}
.badge-art::after {
  content: "";
  position: absolute;
  inset: -6% ;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--red) 18%, transparent) 0%, transparent 68%);
  z-index: 0;
}
.badge-art img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px #0b122033);
}
.badge-backdrop.is-open .badge-art img { animation: badge-pop .62s cubic-bezier(.16, 1.14, .35, 1) 1; }
.badge-backdrop.is-open .badge-art::after { animation: badge-halo 1.6s ease-out infinite; }
.badge-card h2 { margin: 6px 0 4px; font-size: 24px; }
.badge-tier {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}
.badge-note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.badge-actions { justify-content: center; margin-top: 20px; }
.badge-actions .btn { min-width: 140px; }

@keyframes badge-pop {
  0%   { transform: scale(.4) rotate(-9deg); opacity: 0; }
  55%  { transform: scale(1.09) rotate(2deg); opacity: 1; }
  78%  { transform: scale(.97) rotate(-1deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes badge-halo {
  0%, 100% { opacity: .55; transform: scale(.94); }
  50%      { opacity: 1;   transform: scale(1.06); }
}

/* ── 주차 카드 + 달성 내용 상자 ───────────────────────────
   한 줄에 상자 둘. 왼쪽은 그 주차의 평가, 오른쪽은 등급 세 칸이다.
   머리글도 같은 너비로 나눠, 어느 상자를 가리키는 제목인지 눈에 맞춘다. */
.week-layout-head,
.week-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 14px;
  align-items: stretch;
}
.week-layout-head { margin-bottom: 4px; }
.week-layout-head .section-head { margin: 28px 0 17px; }
.badge-head h2 { font-size: 19px; }
.badge-head .meta { margin-top: 4px; }

.week-badge-card {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 6px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.week-badge-card.is-empty { border-style: dashed; }

.badge-chip {
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  padding: 6px 2px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  text-align: center;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.badge-chip:hover { transform: translateY(-2px); border-color: var(--line); background: var(--surface-2); }
.badge-chip:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.badge-chip img { width: 54px; height: 54px; object-fit: contain; }
.badge-chip-tier { font-size: 11px; font-weight: 650; color: var(--text); }
.badge-chip-date { font-size: 10px; color: var(--muted); letter-spacing: -.2px; }
.badge-chip.is-locked img { filter: grayscale(1) brightness(.62) opacity(.3); }
.badge-chip.is-locked .badge-chip-tier { color: var(--muted); font-weight: 600; }
.badge-chip.is-locked .badge-chip-date { color: var(--faint); opacity: .85; }

/* ── 축포 ─────────────────────────────────────────────── */
/* 축포는 창 안이 아니라 화면 전체에 뿌린다 — 카드 안에 가두면 종이 조각이
   손바닥만 한 상자에서만 떨어져 축하로 보이지 않는다. */
.badge-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.confetti-piece {
  position: absolute;
  top: -5%;
  left: var(--x);
  width: 9px;
  height: 15px;
  background: var(--c);
  opacity: 0;
  animation: confetti-fall var(--t) cubic-bezier(.3, .6, .5, 1) var(--d) 1 forwards;
}
.confetti-piece.is-round { width: 9px; height: 9px; border-radius: 50%; }
@keyframes confetti-fall {
  0%   { opacity: 0; transform: translate3d(0, -20px, 0) rotate(0); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift), 92vh, 0) rotate(var(--spin)); }
}

.badge-card { position: relative; overflow: hidden; }
/* 아직 못 받은 배지를 크게 볼 때도 회색으로 둔다 — 받은 것과 헷갈리지 않게. */
#badge-dialog.is-locked-view .badge-art img { filter: grayscale(1) brightness(.62) opacity(.42); }
#badge-dialog.is-locked-view .badge-art::after { display: none; }

/* ── 숫자와 이름을 가운데로 ───────────────────────────── */
.curriculum-snapshot > div { text-align: center; }
.curriculum-snapshot dt, .curriculum-snapshot dd { text-align: center; }
.curriculum-week-metrics { text-align: center; }
.curriculum-week-metrics dt, .curriculum-week-metrics dd { text-align: center; }


@media (max-width: 640px) { .badge-art { width: 160px; height: 160px; } }
@media (prefers-reduced-motion: reduce) {
  .badge-backdrop.is-open .badge-art img,
  .badge-backdrop.is-open .badge-art::after { animation: none; }
}

@media (max-width: 1100px) {
  .week-layout-head,
  .week-row { grid-template-columns: minmax(0, 1fr) 244px; }
  .badge-chip { width: 74px; }
  .badge-chip img { width: 48px; height: 48px; }
}
@media (max-width: 900px) {
  .week-layout-head { grid-template-columns: 1fr; gap: 0; }
  .week-layout-head .badge-head { display: none; }
  .week-row { grid-template-columns: 1fr; gap: 8px; }
  .week-badge-card { justify-content: space-around; }
  .week-badge-card.is-empty { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .confetti-piece { display: none; }
  .badge-chip { transition: none; }
  .badge-chip:hover { transform: none; }
}

/* ── 신입 초대 ────────────────────────────────────────────
   명단은 한 번에 붙여넣는 일이 많다(인사팀에서 받은 목록). 한 줄에 하나씩
   적게 두고, 등록과 링크 복사를 나란히 둔다. */
.exam-invite-form { display: flex; flex-direction: column; gap: 10px; }
.exam-invite-form textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}
.exam-invite-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.exam-invite-form code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 12px;
}

/* ── 사람별 주차 잠금 ─────────────────────────────────── */
.exam-lock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.exam-lock-reason {
  min-width: 0;
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.exam-lock-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.exam-lock-form input { flex: 1; min-width: 180px; }
/* 현황표의 자물쇠는 셀 옆에 작게 둔다 — 조작은 개인 상세에서 한다. */
.exam-cell-lock {
  display: inline-flex;
  margin-left: 4px;
  color: var(--muted);
  vertical-align: middle;
}

/* ── 점검에서 나온 것 ──────────────────────────────────── */
/* 1100px 구간에서 배지 세 칸이 상자를 넘쳤다. 이 구간만 한 단계 줄인다. */
@media (max-width: 1100px) {
  .badge-chip { width: 70px; }
  .badge-chip img { width: 44px; height: 44px; }
}
/* KPI 카드 6장이 5+1 로 갈라지던 폭에서 3장씩 두 줄로 세운다. */
@media (min-width: 1020px) and (max-width: 1330px) {
  .exam-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
