/* base.css 는 GPT 시제품에서 그대로 가져온 디자인이다.
   이 파일에는 우리가 새로 만든 부분(편집기·검증 표시·토스트 등)만 넣는다. */

:root {
  --ex-primary: #5252e0;
  --ex-line: #e2e2ec;
  --ex-muted: #5b5b70;   /* 옅은 회색이라 잘 안 보였다. 진하게 */
  --ex-danger: #d7534b;
  --ex-warn: #c98a1f;
  --ex-ok: #299c91;
}

/* ---------- 없는 변형 채우기 ---------- */
.pill.coral { color: #d76c65; background: #fff0ef; }
.pill.gray { color: #5d5d6f; background: #f2f2f7; }
.difficulty.none { color: #696979; background: #f4f4f8; }

.analysis-head,
.analysis-table > button {
  grid-template-columns: 75px 108px 1fr 1fr 60px 81px;
  min-width: 840px;
}
/* 아직 안 채운 문항은 번호를 붉게 표시한다 (칸을 하나 더 쓰지 않는다) */
.analysis-table > button.todo .question-no { color: #d76c65; font-weight: 800; }
.analysis-table > button.todo .question-no::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: #d76c65;
  vertical-align: middle;
}

/* ---------- 저장 표시 ---------- */
.autosave.is-saving i { background: #c98a1f; box-shadow: 0 0 0 6px #c98a1f1a; }
.autosave.is-error i { background: var(--ex-danger); box-shadow: 0 0 0 6px #d7534b1a; }

/* ---------- 필수 표시 / 미입력 ---------- */
b.req {
  color: var(--ex-danger);
  background: #fff0ef;
  border-radius: 6px;
  margin-left: 7.5px;
  padding: 3px 7.5px;
  font-size: 12px;
  font-weight: 700;
}
em.blank { color: #6a6a7a; font-style: normal; }
.blank-note { color: var(--ex-muted); margin-top: 12px; font-size: 15px; }
.empty-note { color: var(--ex-muted); padding: 60px 0; font-size: 16.5px; text-align: center; }

/* ---------- 공통 입력 ---------- */
label.field { display: block; margin-top: 21px; color: #4a4a5d; font-size: 15px; font-weight: 700; }
label.field input,
label.field textarea {
  border: 1px solid var(--ex-line);
  border-radius: 12px;
  width: 100%;
  margin-top: 9px;
  padding: 15px 16.5px;
  color: #33334a;
  font-size: 16.5px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
}
label.field input:focus,
label.field textarea:focus { border-color: var(--ex-primary); outline: none; }
label.field small { display: block; margin-top: 7.5px; color: var(--ex-muted); font-weight: 500; }

/* ---------- 올린 파일 목록 ---------- */
.file-list { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.file-list li {
  display: grid;
  grid-template-columns: 1fr auto 36px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--ex-line);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 15px;
  color: #55556b;
}
.file-list small { color: var(--ex-muted); }
.file-list button { color: #676777; font-size: 18px; }
.file-list button:hover { color: var(--ex-danger); }

/* ---------- 3단계 : 정답 미제공 ---------- */
.answer-verification-grid .no-answer {
  border: 1px solid var(--ex-line);
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 12px;
  color: var(--ex-muted);
}
.answer-verification-grid .no-answer.on { border-color: var(--ex-primary); color: var(--ex-primary); background: #eef; }
.recognition-note.warn { color: var(--ex-warn); background: #fff8ea; }
.recognition-note.warn span { color: var(--ex-warn); }

/* ---------- 4단계 : 문항 편집기 ---------- */
.editor-top .editor-move { display: flex; gap: 7.5px; }
.editor-top .editor-move button {
  border: 1px solid var(--ex-line);
  border-radius: 9px;
  width: 33px;
  height: 33px;
  color: #4a4a5d;
}
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 21px 0; }
.editor-grid label { color: #4a4a5d; font-size: 15px; font-weight: 700; }
.editor-grid input {
  border: 1px solid var(--ex-line);
  border-radius: 12px;
  width: 100%;
  margin-top: 9px;
  padding: 13.5px 15px;
  font-size: 16.5px;
  font-weight: 600;
  color: #33334a;
}
.editor-grid input:focus { border-color: var(--ex-primary); outline: none; }
.editor-choice { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.editor-choice > span { color: #4a4a5d; font-size: 15px; font-weight: 700; min-width: 111px; }
.editor-choice > div { display: flex; gap: 7.5px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--ex-line);
  border-radius: 10.5px;
  padding: 9px 16.5px;
  font-size: 15px;
  font-weight: 700;
  color: #4f4f62;
  background: #fff;
}
.chip.on { border-color: var(--ex-primary); color: var(--ex-primary); background: #eef; }
.chip.on.high { border-color: #db6f68; color: #db6f68; background: #fff0ef; }
.chip.on.mid { border-color: #ce9533; color: #ce9533; background: #fff5e4; }
.chip.on.low { border-color: #269e97; color: #269e97; background: #e9f8f4; }
.premium-analysis-list textarea {
  border: 1px solid var(--ex-line);
  border-radius: 10.5px;
  width: 100%;
  margin-top: 7.5px;
  padding: 12px 13.5px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.65;
  color: #4a4a60;
  resize: vertical;
  background: #fff;
}
.premium-analysis-list textarea:focus { border-color: var(--ex-primary); outline: none; }

/* ---------- 5단계 : 결과지 ---------- */
/* ---------- A4 리포트 본문 ----------
   원본의 .teacher-review-report 는 '선생님 한마디' 용 flex 블록이라 그대로 쓰면 글자가 세로로 눕는다.
   결과지 본문은 우리 전용 클래스로 그린다. */
.ex-report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(450px, .72fr);
  align-items: start;
  gap: 27px;
  margin-top: 12px;
}
.ex-report {
  position: relative;
  display: block;
  border: 1px solid var(--ex-line);
  border-radius: 22.5px;
  background: #fff;
  padding: 39px 42px;
  overflow: hidden;
}
.ex-report > .eyebrow { display: block; }
.ex-report > h2 { font-size: 28.5px; font-weight: 800; color: #22223a; letter-spacing: -.04em; margin: 12px 0 9px; line-height: 1.35; padding-right: 90px; }
.ex-report > p { color: #545467; font-size: 15px; margin: 0; }
.ex-report .report-subject { position: absolute; top: 36px; right: 39px; }
@media (width <= 1500px) {
  .ex-report-layout { grid-template-columns: 1fr; }
  .ex-report .report-subject { display: none; }
}

.report-complete { text-align: center; padding: 39px 0 9px; }
.report-complete .done-mark {
  display: inline-grid;
  place-items: center;
  width: 69px;
  height: 69px;
  border-radius: 50%;
  background: #2fae9d;
  color: #fff;
  font-size: 30px;
  margin-bottom: 21px;
}
.report-complete h2 { font-size: 30px; font-weight: 800; color: #22223a; margin: 9px 0; }
.report-complete p { color: var(--ex-muted); font-size: 16.5px; }

.incomplete-banner {
  border: 1px solid #f2d9a8;
  background: #fffaf0;
  border-radius: 18px;
  padding: 21px 24px;
  margin: 24px 0;
}
.incomplete-banner strong { color: #a9741a; font-size: 18px; }
.incomplete-banner p { color: #97824f; font-size: 15px; margin: 6px 0 12px; }
.incomplete-banner li { color: #8a7440; font-size: 15px; line-height: 1.8; }

.report-summary.five { grid-template-columns: repeat(5, 1fr); }
.report-summary small { color: var(--ex-muted); font-size: 12px; font-weight: 700; }
.report-summary strong { font-size: 30px; font-weight: 800; color: #23233c; margin: 6px 0 3px; }
.report-summary strong small { display: inline; font-size: 13.5px; color: #56566a; margin-left: 3px; }
.report-summary span { color: var(--ex-muted); font-size: 12px; }

.report-section blockquote {
  border-left: 4.5px solid var(--ex-primary);
  margin: 12px 0;
  padding: 6px 0 6px 18px;
  color: #44445c;
  font-size: 16.5px;
  line-height: 1.8;
}
.report-section cite { color: var(--ex-muted); font-size: 15px; font-style: normal; font-weight: 700; }
.report-section > small { color: var(--ex-muted); font-weight: 600; margin-left: 7.5px; }

.difficulty-bars { display: flex; flex-direction: column; gap: 10.5px; margin-top: 12px; }
.difficulty-bars > div { display: grid; grid-template-columns: 33px 1fr 72px; align-items: center; gap: 13.5px; }
.difficulty-bars b { color: #4a4a5d; font-size: 13.5px; }
.difficulty-bars i { display: block; height: 10.5px; border-radius: 6px; background: var(--ex-primary); }
.difficulty-bars i[style*="width:0%"] { background: none; } /* 0문항이면 막대를 그리지 않는다 */
.difficulty-bars span { color: var(--ex-muted); font-size: 13.5px; text-align: right; }

.report-question-table { display: flex; flex-direction: column; margin-top: 12px; }
.report-question-table > div {
  display: grid;
  grid-template-columns: 66px 1fr 1fr 51px 63px;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #f2f2f6;
  padding: 12px 3px;
  font-size: 15px;
  color: #404055;
}
.report-question-table b { color: var(--ex-primary); font-size: 13.5px; }

.hit-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.hit-list > div {
  border: 1px solid var(--ex-line);
  border-radius: 13.5px;
  padding: 13.5px 16.5px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}
.hit-list strong { font-size: 15px; color: #3c3c55; }
.hit-list small { grid-column: 2; color: var(--ex-muted); font-size: 13.5px; }

.report-foot {
  border-top: 1px solid var(--ex-line);
  margin-top: 30px;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.report-foot strong { font-size: 13.5px; letter-spacing: .12em; color: #4a4a63; }
.report-foot span { font-size: 13.5px; color: var(--ex-muted); }

.output-panel .complete-box { border-top: 1px solid var(--ex-line); margin-top: 21px; padding-top: 21px; }
.output-panel .complete-box .btn { width: 100%; }
.output-panel .complete-box small { display: block; margin-top: 10.5px; color: var(--ex-muted); font-size: 13.5px; line-height: 1.6; }

/* ---------- 홍보 카드 ----------
   원본 CSS 의 .insta-card / .poster-heading 은 !important 로 55.5px 빨강 제목을 강제한다.
   그 규칙에 끌려가지 않도록 카드는 우리 전용 클래스(ex-*)로 그린다. */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 27px; margin-top: 24px; }
.ex-card {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--ex-line);
  border-radius: 21px;
  padding: 27px;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
  color: #23233c;
}
.ex-card[data-style="premium"] { background: linear-gradient(160deg, #f7f7ff, #fff); }
.ex-card[data-style="impact"] { background: linear-gradient(160deg, #eeeeff, #fff); }
.ex-card-top { display: flex; justify-content: space-between; align-items: center; flex: 0 0 auto; }
.ex-card-top img { height: 30px; width: auto; object-fit: contain; }
.ex-card-top b { color: #646477; font-size: 13.5px; letter-spacing: .1em; }
.ex-logo { color: #6a6a7c; font-size: 12px; letter-spacing: .12em; }

.ex-card-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 18px 0;
}
.ex-card-title {
  font-size: 27px;
  font-weight: 800;
  color: #23233c;
  line-height: 1.35;
  letter-spacing: -.02em;
  word-break: keep-all;
  /* 제목이 길면 3줄까지만 보이고 잘린다 (카드 밖으로 넘치지 않게) */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ex-card-sub { color: var(--ex-primary); font-size: 15px; font-weight: 700; margin-top: 9px; }
.ex-card-copy { margin-top: 18px; color: #4c4c63; font-size: 16.5px; line-height: 1.75; overflow: hidden; word-break: keep-all; }
.ex-card-copy p { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.ex-card-copy .blank { color: #6a6a7a; }

.ex-card-foot { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--ex-line); padding-top: 15px; }
.ex-card-foot img { width: 39px; height: 39px; border-radius: 50%; object-fit: cover; }
.ex-card-foot > span { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; background: #f0f0f7; color: #626274; font-size: 10.5px; }
.ex-card-foot strong { display: block; font-size: 13.5px; color: #3d3d55; }
.ex-card-foot small { color: var(--ex-muted); font-size: 12px; }
.ex-card-foot em { margin-left: auto; font-style: normal; font-size: 12px; letter-spacing: .1em; color: #676778; }

.poster-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px 12px; }
.poster-metrics span { font-size: 13.5px; color: var(--ex-muted); }
.poster-metrics b { display: block; font-size: 30px; font-weight: 800; color: #2c2c48; line-height: 1.1; }
.poster-table { display: flex; flex-direction: column; }
.poster-table > div {
  display: grid;
  grid-template-columns: 30px 1fr 1fr 30px;
  align-items: center;
  gap: 9px;
  border-top: 1px solid #f2f2f6;
  padding: 6px 0;
  font-size: 13.5px;
}
.poster-table b { color: var(--ex-primary); }
.poster-table .difficulty { width: 24px; height: 24px; font-size: 10.5px; }
.poster-big { font-size: 66px; font-weight: 800; color: var(--ex-primary); line-height: 1; }
.poster-big small { display: block; font-size: 16.5px; color: #55556e; margin-top: 9px; font-weight: 700; }

.ex-series { margin-top: 39px; }
.ex-series-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.ex-series-head h3 { font-size: 22.5px; font-weight: 800; color: #23233c; }
.ex-card-item > button {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--ex-line);
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #414156;
  background: #fff;
}
.ex-card-item > button:hover { border-color: var(--ex-primary); color: var(--ex-primary); }

/* ---------- 토스트 ---------- */
.toast-host { position: fixed; right: 33px; bottom: 33px; display: flex; flex-direction: column; gap: 12px; z-index: 90; }
.toast {
  display: grid;
  grid-template-columns: 33px 1fr;
  align-items: center;
  gap: 13.5px;
  min-width: 375px;
  max-width: 570px;
  border: 1px solid var(--ex-line);
  border-radius: 15px;
  padding: 18px 21px;
  background: #fff;
  box-shadow: 0 15px 45px #1a1a3312;
  font-size: 16.5px;
  color: #40405a;
  animation: toast-in .18s ease-out;
}
.toast span { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; background: #f0f0f7; color: #4f4f65; font-weight: 800; font-size: 16.5px; }
.toast.success span { background: #e9f8f4; color: var(--ex-ok); }
.toast.error { border-color: #84727b; }
.toast.error span { background: #fff0ef; color: var(--ex-danger); }
.toast.out { opacity: 0; transform: translateY(9px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

.loading { padding: 90px 0; text-align: center; color: var(--ex-muted); font-size: 16.5px; }
.loading.error { color: var(--ex-danger); }

/* ---------- 인쇄 (A4 리포트) ---------- */
@media print {
  body.printing-report .sidebar,
  body.printing-report .topbar,
  body.printing-report .page-heading,
  body.printing-report .stepper,
  body.printing-report .report-complete,
  body.printing-report .output-panel,
  body.printing-report .ex-series,
  body.printing-report .workflow-footer,
  body.printing-report .incomplete-banner,
  body.printing-report .toast-host { display: none !important; }
  /* 화면 확대(zoom)는 인쇄에 적용하면 안 된다. 그대로 두면 종이 밖으로 잘려 나간다 */
  body.printing-report { zoom: 1 !important; }
  body.printing-report .app-shell,
  body.printing-report .main,
  body.printing-report .page { display: block; margin: 0; padding: 0; }
  body.printing-report .ex-report-layout { display: block; }
  body.printing-report #a4-report {
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0 12mm;   /* 글자가 종이 가장자리에 붙지 않게 */
  }
  body.printing-report .report-accent { display: none; }
  @page { margin: 12mm 0; }
  .report-section { break-inside: avoid; }
}

@media (width <= 1350px) {
  .editor-grid { grid-template-columns: 1fr; }
  .hit-list { grid-template-columns: 1fr; }
  .report-summary.five { grid-template-columns: repeat(2, 1fr); }
}

.editor-choice .hint { color: var(--ex-muted); font-size: 13.5px; font-weight: 500; align-self: center; }

/* ---------- 사이드바 학원 배지 ----------
   원본은 "권영복 원장 / 전문가집단학원" 이 화면에 박혀 있었다.
   이제 저장된 학원 정보를 보여주고, 누르면 학원 정보 화면으로 간다. */
button.profile {
  width: 100%;
  text-align: left;
  background: none;
  cursor: pointer;
}
button.profile:hover strong { color: #fff; }
button.profile > b { color: #515167; font-size: 19.5px; }
button.profile strong { color: #e9e9f4; }

/* ---------- 학원 정보 화면 ---------- */
.asset-upload.wide { grid-template-columns: 64.5px 1fr auto; }
.asset-upload.wide em { font-style: normal; font-size: 15px; font-weight: 700; color: var(--ex-primary); }
.logo-preview {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  border: 1px solid var(--ex-line);
  border-radius: 15px;
  padding: 18px;
  background: #fff;
}
.logo-preview img { max-height: 69px; max-width: 285px; object-fit: contain; }
.logo-preview button {
  margin-left: auto;
  border: 1px solid var(--ex-line);
  border-radius: 10.5px;
  padding: 9px 15px;
  font-size: 15px;
  font-weight: 700;
  color: #4f4f62;
}
.logo-preview button:hover { border-color: var(--ex-danger); color: var(--ex-danger); }
.report-foot strong .blank { color: #6a6a7a; }

/* ---------- 학교급 탭 ---------- */
.level-tabs { display: inline-flex; gap: 6px; padding: 6px; margin-bottom: 21px; background: #f2f2f8; border-radius: 13.5px; }
.level-tabs button {
  border-radius: 10.5px;
  padding: 10.5px 24px;
  font-size: 16.5px;
  font-weight: 700;
  color: #4f4f62;
  background: none;
}
.level-tabs button.on { background: #fff; color: var(--ex-primary); box-shadow: 0 1px 4.5px #1a1a3312; }

/* ---------- 교과군이 많아졌을 때 ---------- */
.subject-grid.many { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 13.5px; }
.subject-grid.many .subject-card { padding: 18px; }
.subject-grid.many .subject-card strong { font-size: 18px; }
.subject-grid.many .subject-card small {
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.template-tabs.many { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 12px; }
.template-tabs.many small { color: var(--ex-muted); font-size: 12px; }

/* ---------- 과목 고르기 ---------- */
.form-grid .hidden { display: none; }
.form-grid select, .form-grid input { font-family: inherit; }
.heading-actions { display: flex; gap: 12px; }

.course-title { margin-top: 33px; border-top: 1px solid var(--ex-line); padding-top: 27px; }
.course-catalog { display: flex; flex-direction: column; gap: 15px; }
.course-catalog > div { display: grid; grid-template-columns: 93px 1fr; gap: 13.5px; align-items: start; }
.course-catalog b { color: var(--ex-primary); font-size: 13.5px; padding-top: 6px; }
.course-catalog p { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- 보관함 교과 필터 ---------- */
.archive-filter { display: flex; align-items: center; gap: 12px; color: #4a4a5d; font-size: 15px; font-weight: 700; }
.archive-filter select {
  border: 1px solid var(--ex-line);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 16.5px;
  font-family: inherit;
  color: #33334a;
  background: #fff;
}

/* ---------- AI 실행 상자 ---------- */
.ai-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 21px;
  padding: 19.5px 22.5px;
  border: 1px solid #ddddf2;
  border-radius: 16.5px;
  background: linear-gradient(120deg, #f6f6ff, #fdfdff);
}
.ai-box > div { display: flex; align-items: center; gap: 15px; }
.ai-mark {
  display: grid;
  place-items: center;
  width: 45px; height: 45px;
  border-radius: 13.5px;
  background: var(--ex-primary);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .04em;
  flex: none;
}
.ai-box strong { display: block; font-size: 16.5px; color: #33334a; }
.ai-box small { display: block; margin-top: 4.5px; color: var(--ex-muted); font-size: 13.5px; line-height: 1.5; }
.btn.ai { background: var(--ex-primary); color: #fff; border: 0; border-radius: 12px; padding: 13.5px 24px; font-size: 16.5px; font-weight: 700; flex: none; }
.btn.ai:hover { filter: brightness(1.06); }
.btn.ai.small { padding: 9px 16.5px; font-size: 15px; margin-left: 12px; }
.analysis-toolbar > div:last-child { display: flex; align-items: center; }

/* ---------- AI 진행 표시 ---------- */
.ai-progress {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #1a1a3355;
  z-index: 120;
}
.ai-progress-inner {
  display: grid;
  grid-template-columns: 51px 1fr;
  gap: 21px;
  align-items: center;
  width: min(630px, 90vw);
  padding: 30px 33px;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 27px 75px #1a1a3330;
}
.ai-progress strong { display: block; font-size: 18px; color: #23233c; }
.ai-progress small { display: block; margin-top: 10.5px; color: var(--ex-muted); font-size: 13.5px; }
.ai-progress .bar { height: 9px; margin-top: 13.5px; border-radius: 6px; background: #eeeef5; overflow: hidden; }
.ai-progress .bar i { display: block; height: 100%; border-radius: 6px; background: var(--ex-primary); transition: width .3s; }
.ai-progress .bar i.indet { animation: ai-indet 1.4s ease-in-out infinite; }
@keyframes ai-indet { 0% { margin-left: -20%; } 100% { margin-left: 100%; } }
.ai-progress .spin {
  width: 39px; height: 39px;
  border: 4.5px solid #e4e4f2;
  border-top-color: var(--ex-primary);
  border-radius: 50%;
  animation: ai-spin .8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* ---------- 글씨 크기 조절 ----------
   원본 디자인이 8~16.5px 기준이라 그대로 두면 눈이 아프다.
   글자만 키우면 고정폭 칸(난도 배지 등)에서 넘치므로 화면 전체를 확대한다. */
body { zoom: var(--ui-scale, 1); }

.zoom-control {
  display: flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--ex-line);
  border-radius: 12px;
  padding: 3px;
  background: #fff;
}
.zoom-control button {
  width: 39px;
  height: 33px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 800;
  color: #4a4a5d;
}
.zoom-control button:hover { background: #f1f1f8; color: var(--ex-primary); }
.zoom-control b {
  min-width: 51px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ex-muted);
}

/* 확대했을 때 좁아진 만큼 2열 배치를 접는다 (body[data-w] 는 app.js 가 넣는다) */
body[data-w="md"] .analysis-workspace,
body[data-w="sm"] .analysis-workspace,
body[data-w="xs"] .analysis-workspace,
body[data-w="md"] .answer-layout,
body[data-w="sm"] .answer-layout,
body[data-w="xs"] .answer-layout,
body[data-w="md"] .upload-layout,
body[data-w="sm"] .upload-layout,
body[data-w="xs"] .upload-layout,
body[data-w="md"] .ex-report-layout,
body[data-w="sm"] .ex-report-layout,
body[data-w="xs"] .ex-report-layout,
body[data-w="sm"] .workspace-grid,
body[data-w="xs"] .workspace-grid,
body[data-w="sm"] .template-layout,
body[data-w="xs"] .template-layout {
  grid-template-columns: 1fr;
}
body[data-w="md"] .ex-report .report-subject,
body[data-w="sm"] .ex-report .report-subject,
body[data-w="xs"] .ex-report .report-subject { display: none; }
body[data-w="sm"] .subject-grid.many,
body[data-w="xs"] .subject-grid.many { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

/* ---------- 홍보물 원클릭 ---------- */
.btn.ai.wide { width: 100%; margin-bottom: 9px; }
.blank-note.oneclick { margin: 0 0 18px; line-height: 1.6; }
.promo-text { margin-top: 39px; }
.promo-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-top: 21px; }
body[data-w="sm"] .promo-grid,
body[data-w="xs"] .promo-grid { grid-template-columns: 1fr; }
.promo-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.promo-head strong { font-size: 18px; color: #33334a; }
.promo-text input,
.promo-text textarea {
  width: 100%;
  border: 1px solid var(--ex-line);
  border-radius: 12px;
  padding: 15px 18px;
  font-family: inherit;
  font-size: 16.5px;
  line-height: 1.75;
  color: #33334a;
  resize: vertical;
}
.promo-text input { font-weight: 700; margin-bottom: 12px; }
.promo-text input:focus, .promo-text textarea:focus { border-color: var(--ex-primary); outline: none; }
.poster-table.hit > div { grid-template-columns: 36px 1fr 1.3fr 45px; }
.poster-table.hit .pill { font-size: 10.5px; padding: 4.5px 7.5px; }

/* ---------- 4단계 상단 탭 ---------- */
.step-tabs { display: inline-flex; gap: 6px; padding: 6px; margin-bottom: 21px; background: #eeeef6; border-radius: 15px; }
.step-tabs button {
  border-radius: 12px;
  padding: 13.5px 30px;
  font-size: 18px;
  font-weight: 700;
  color: #4f4f62;
  background: none;
}
.step-tabs button.on { background: #fff; color: var(--ex-primary); box-shadow: 0 1px 6px #1a1a3315; }
.question-list-panel.full { width: 100%; }

/* 상세분석 — 번호 칩 */
.q-jump { display: flex; flex-wrap: wrap; gap: 7.5px; margin: 6px 0 24px; }
.q-jump button {
  min-width: 51px;
  border: 1px solid var(--ex-line);
  border-radius: 10.5px;
  padding: 9px 12px;
  font-size: 15px;
  font-weight: 700;
  color: #4a4a5d;
  background: #fff;
}
.q-jump button:hover { border-color: var(--ex-primary); color: var(--ex-primary); }
.q-jump button.todo { border-color: #84727b; color: #d76c65; }

/* 상세분석 — 문항 카드 */
.q-detail-list { display: flex; flex-direction: column; gap: 27px; }
.q-detail { border: 1px solid var(--ex-line); border-radius: 19.5px; padding: 27px 30px; background: #fff; }
.q-detail > header { display: flex; align-items: center; gap: 15px; margin-bottom: 18px; }
.q-detail-no {
  display: grid; place-items: center;
  min-width: 66px; height: 45px; padding: 0 12px;
  border-radius: 12px;
  background: var(--ex-primary);
  color: #fff; font-size: 18px; font-weight: 800;
}
.q-detail > header > div { flex: 1; }
.q-detail > header strong { display: block; font-size: 19.5px; color: #23233c; }
.q-detail > header small { color: var(--ex-muted); font-size: 15px; }
.q-stem {
  border-left: 4.5px solid #e3e3f0;
  margin: 0 0 21px;
  padding: 3px 0 3px 16.5px;
  color: #404055; font-size: 16.5px; line-height: 1.7;
}
.premium-analysis-list.wide { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 21px; }
body[data-w="xs"] .premium-analysis-list.wide { grid-template-columns: 1fr; }

/* ---------- 결과지 안의 문항별 상세분석 ---------- */
.report-detail-list { display: flex; flex-direction: column; gap: 21px; margin-top: 15px; }
.report-detail { border: 1px solid var(--ex-line); border-radius: 16.5px; padding: 21px 24px; }
.report-detail > header { display: flex; align-items: center; gap: 13.5px; margin-bottom: 12px; }
.report-detail > header b { color: var(--ex-primary); font-size: 16.5px; min-width: 69px; }
.report-detail > header span { flex: 1; font-size: 16.5px; font-weight: 700; color: #33334a; }
.report-detail > header em { font-style: normal; font-size: 15px; color: var(--ex-muted); }
.detail-summary { color: #55556e; font-size: 15px; margin: 0 0 13.5px; line-height: 1.7; }
/* 6칸이 붙어 있어 구분이 안 된다는 지적 — 가로·세로 구분선을 넣는다 */
.report-detail dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--ex-line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.report-detail dl > div {
  padding: 13px 16px;
  border-top: 1px solid var(--ex-line);
  border-left: 1px solid var(--ex-line);
}
.report-detail dl > div:nth-child(-n+2) { border-top: 0; }  /* 첫 줄 */
.report-detail dl > div:nth-child(odd) { border-left: 0; }  /* 왼쪽 칸 */
.report-detail dt { color: var(--ex-primary); font-size: 13.5px; font-weight: 800; margin-bottom: 3px; }
.report-detail dd { margin: 0; color: #55556b; font-size: 15px; line-height: 1.7; }
/* 한 줄로 접히면 세로선은 없애고 가로선만 남긴다 */
body[data-w="xs"] .report-detail dl { grid-template-columns: 1fr; }
body[data-w="xs"] .report-detail dl > div { border-left: 0; border-top: 1px solid var(--ex-line); }
body[data-w="xs"] .report-detail dl > div:first-child { border-top: 0; }
@media print { .report-detail { break-inside: avoid; } }

/* ---------- 학생용 링크 ---------- */
.share-box { border-top: 1px solid var(--ex-line); margin-top: 21px; padding-top: 21px; }
.share-box-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.share-box-head strong { font-size: 18px; color: #33334a; }
.share-box > p { color: var(--ex-muted); font-size: 15px; line-height: 1.6; margin: 0 0 15px; }
.share-url { display: flex; gap: 9px; }
.share-url input {
  flex: 1; min-width: 0;
  border: 1px solid var(--ex-line);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 15px;
  color: #4a4a60;
  background: #fafaff;
}
.share-url button, .share-actions button {
  border: 1px solid var(--ex-line);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 15px;
  font-weight: 700;
  color: #4a4a5d;
  background: #fff;
  white-space: nowrap;
}
.share-url button:hover, .share-actions button:hover { border-color: var(--ex-primary); color: var(--ex-primary); }
.share-actions { display: flex; gap: 9px; margin-top: 10.5px; flex-wrap: wrap; }

/* ---------- 1단계 : 자료 한 번에 올리고 한 번에 처리 ---------- */
.quick-uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 18px; }
body[data-w="sm"] .quick-uploads, body[data-w="xs"] .quick-uploads { grid-template-columns: 1fr; }
.oneclick-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 21px;
  margin-top: 21px;
  padding: 22.5px 25.5px;
  border: 1px solid #d6d6f0;
  border-radius: 18px;
  background: linear-gradient(120deg, #f4f4ff, #fdfdff);
}
.oneclick-box > div { display: flex; align-items: flex-start; gap: 16.5px; }
.oneclick-box strong { display: block; font-size: 18px; color: #2c2c48; }
.oneclick-box small { display: block; margin-top: 6px; color: var(--ex-muted); font-size: 15px; line-height: 1.6; }

/* ---------- 5단계 탭 분리 ---------- */
.ex-report-layout.single { grid-template-columns: minmax(0, 1.6fr) minmax(330px, .6fr); }
body[data-w="md"] .ex-report-layout.single,
body[data-w="sm"] .ex-report-layout.single,
body[data-w="xs"] .ex-report-layout.single { grid-template-columns: 1fr; }
.output-panel.report-side h3 { margin-top: 6px; }
.promo-tab { margin-top: 6px; }
.promo-lead { max-width: 760px; }
.promo-lead h3 { font-size: 22px; font-weight: 800; color: #23233c; margin: 8px 0; }
.promo-lead > p { color: var(--ex-muted); font-size: 15px; margin: 0 0 16px; }
.promo-outs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
body[data-w="xs"] .promo-outs { grid-template-columns: 1fr; }
.promo-outs > button {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--ex-line);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
  text-align: left;
}
.promo-outs > button:hover { border-color: var(--ex-primary); }
.promo-outs strong { display: block; font-size: 16px; color: #2c2c48; }
.promo-outs small { display: block; margin-top: 4px; color: var(--ex-muted); font-size: 13px; }
.promo-outs i { margin-left: auto; font-style: normal; color: var(--ex-primary); }

/* ---------- 결과지 안 구역 탭 ---------- */
.report-tabs { margin: 6px 0 18px; }
.report-part > .report-section:first-child { border-top: 0; padding-top: 0; }
/* 인쇄할 때는 탭과 상관없이 전부 나와야 한다 */
@media print {
  body.printing-report .report-tabs { display: none !important; }
  body.printing-report .report-part { display: block !important; }
  body.printing-report .report-part[hidden] { display: block !important; }
}

/* ---------- 사이드바 ----------
   원본 base.css 의 두 가지 문제를 여기서 덮는다.
   1) 폭이 375px(좁으면 330px)이라 본문과 균형이 안 맞았다.
   2) `.new-analysis:not(:focus)~*{display:none}` 때문에 창이 조금만 좁아지면
      ＋버튼 아래의 메뉴·학원정보가 통째로 사라지고 빈 검은 기둥만 남았다.
      (원본은 108px 아이콘 막대를 의도했지만 아이콘까지 같이 숨어 버린다.)
   확대(zoom)를 쓰면 미디어쿼리가 실제 보이는 폭과 어긋나므로,
   app.js 가 넣어 주는 body[data-w] 를 기준으로 쓴다. */
.sidebar {
  width: 236px !important;
  min-width: 236px !important;
  padding: 26px 16px 20px !important;
}
body[data-w="md"] .sidebar { width: 216px !important; min-width: 216px !important; }
body[data-w="sm"] .sidebar { width: 200px !important; min-width: 200px !important; padding: 22px 13px 16px !important; }
body[data-w="xs"] .sidebar { width: 178px !important; min-width: 178px !important; padding: 20px 11px 14px !important; }

/* 숨겨져 버린 것들을 되살린다 */
.sidebar .brand > div:last-child { display: block !important; }
.sidebar nav { display: flex !important; }
.sidebar .nav-caption { display: block !important; }
.sidebar button.profile > span { display: flex !important; }
.sidebar button.profile > b { display: block !important; }
.sidebar-focus { display: block !important; }
.sidebar button.profile { display: flex !important; justify-content: flex-start !important; padding: 16px 0 0 !important; }
.sidebar .brand { justify-content: flex-start !important; padding: 0 0 22px !important; }
.sidebar .new-analysis { width: 100% !important; height: auto !important; margin: 0 !important; }
.sidebar .new-analysis span { font-size: 18px !important; }
/* 단계 표시줄의 글자도 같이 숨겨져 있었다 */
.stepper li div { display: block !important; }
/* 아이콘 막대용 규칙도 같이 되돌린다 */
.sidebar nav button { justify-content: flex-start !important; padding: 11px 12px !important; font-size: 14px; }
.sidebar nav button > span { font-size: 16px !important; }

/* 글자 크기는 폭에 맞춰 살짝 줄인다 */
.sidebar .brand strong { font-size: 21px; }
.sidebar .brand small { font-size: 11px; }
.sidebar .new-analysis { padding: 14px 12px !important; font-size: 14px !important; }
.sidebar .nav-caption { font-size: 11px; }
.sidebar-focus { padding: 15px 14px; }
.sidebar-focus span { font-size: 10px; }
.sidebar-focus strong { font-size: 13px; }
.sidebar-focus p { font-size: 11px; line-height: 1.6; }
.sidebar button.profile strong { font-size: 13px; }
.sidebar button.profile small { font-size: 11px; }
/* 좁으면 안내 문구는 접는다 (메뉴가 우선) */
body[data-w="sm"] .sidebar-focus,
body[data-w="xs"] .sidebar-focus { display: none !important; }
body[data-w="xs"] .sidebar nav button { font-size: 13px; padding: 10px 9px !important; }
body[data-w="xs"] .sidebar .new-analysis { font-size: 13px !important; padding: 12px 9px !important; }

/* ---------- 홍보물 탭 균형 ----------
   base.css 의 `.panel` 은 테두리·둥근모서리·흰 배경만 준다 (여백 없음).
   쓰는 쪽에서 padding 을 안 넣으면 글자가 둥근 테두리에 딱 붙는다. */
.promo-tab .panel,
.promo-text .panel { padding: 30px 33px; }
body[data-w="xs"] .promo-tab .panel,
body[data-w="xs"] .promo-text .panel { padding: 22px 20px; }

/* 창 폭(미디어쿼리·data-w)이 아니라 '실제로 남는 자리' 를 보고 접는다.
   확대(zoom)를 써도 어긋나지 않고, 사이드바 폭이 바뀌어도 알아서 맞는다. */
.promo-lead {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 30px;
  align-items: stretch;
}
/* 왼쪽에 아주 큰 grow 를 줘서 남는 자리를 거의 다 가져간다.
   그래야 옆에 붙었을 땐 요약 카드가 372px 로 얌전히 있고,
   아래로 내려가면(혼자 한 줄) 폭을 다 써서 가로 3칸이 된다. */
.promo-lead-left { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; }
.promo-lead-right {
  flex: 1 1 372px;
  min-width: 288px;
  display: grid;
  gap: 12px;
  /* 옆에 못 붙어 아래로 내려가면 자동으로 가로 3칸이 된다 */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-content: start;
}
.promo-lead-left h3 { font-size: 22px; font-weight: 800; color: #23233c; margin: 8px 0 10px; }
.promo-lead-left > p { color: var(--ex-muted); font-size: 15px; line-height: 1.75; margin: 0 0 18px; max-width: 46em; }
.promo-lead-left .btn.ai.wide { width: 100%; max-width: 380px; }
/* 아래 안내문을 바닥에 붙여 오른쪽 요약 카드와 키를 맞춘다 */
.promo-lead-left .blank-note { margin: 12px 0 0; padding-top: 4px; }
.promo-lead-left > *:last-child { margin-top: auto; }
.promo-stat {
  border: 1px solid var(--ex-line);
  border-radius: 12px;
  padding: 12px 15px;
  background: #fafaff;
}
.promo-stat b { display: block; font-size: 22px; font-weight: 800; color: var(--ex-primary); line-height: 1.25; }
.promo-stat span { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; color: #33334a; }
.promo-stat small { display: block; margin-top: 1px; font-size: 12px; color: var(--ex-muted); }

/* ---------- 상위노출 블로그 ---------- */
.seo-blog {
  margin-top: 22px;
  border-top: 1px dashed var(--ex-line);
  padding-top: 18px;
}
.seo-blog strong { display: block; font-size: 15px; font-weight: 800; color: #2c2c48; }
.seo-blog > p { margin: 6px 0 12px; font-size: 13px; line-height: 1.65; color: var(--ex-muted); max-width: 46em; }
.seo-row { display: flex; gap: 10px; max-width: 560px; }
.seo-row input {
  flex: 1; min-width: 0;
  border: 1px solid var(--ex-line); border-radius: 10px;
  padding: 12px 14px; font-size: 14px;
}
.seo-row .btn { white-space: nowrap; }

/* ---------- 드래그 앤 드롭 하이라이트 ---------- */
label.drop-hover, .asset-upload.drop-hover, .analysis-file-drop.drop-hover,
.mini-drop.drop-hover, .answer-drop.drop-hover {
  outline: 3px dashed #2b2b8f;
  outline-offset: -3px;
  background: #f0f2ff !important;
}
.analysis-document-panel.drop-hover {
  outline: 3px dashed #2b2b8f;
  outline-offset: -3px;
  background: #f7f8ff;
}

/* ---------- 4단계 문항표: 서술형은 정답을 아랫줄 전체 폭으로 (2026-08-22) ---------- */
.analysis-table > button.essay .essay-mark { font-size: 13.5px; color: #5d5d6f; font-weight: 700; }
.analysis-table > button.essay .essay-answer {
  grid-column: 1 / -1;
  display: block;
  margin-top: 4px;
  padding: 9px 14px;
  background: #f7f8fb;
  border: 1px solid #d9dde7;
  font-size: 14.5px;
  line-height: 1.55;
  color: #2c2c40;
  text-align: left;
  word-break: break-word;
  white-space: normal;
}
.analysis-table > button.essay .essay-answer em { color: #8a8a9c; font-style: normal; }
