/* Grading Copilot — 3D 입체 스타일시트 (외부 의존성 없음)
   깊이 표현 규칙
   · 조작 대상(버튼·칩·카드)은 표면 위로 '솟아오르고', 입력 대상(인풋·본문·업로드)은 표면 안으로 '들어간다'
   · 모든 솟은 면은 위쪽 하이라이트 + 아래쪽 굳은 모서리 + 확산 그림자 3겹으로 만든다
   · 글자가 얹히는 면은 기울이지 않는다. 회전은 통계 타일·로고처럼 읽을 거리가 짧은 곳에만 쓴다 */

:root {
  color-scheme: light;

  --bg: #eef1f6;
  --bg-tint-a: #dfe6f5;
  --bg-tint-b: #f4f1ec;

  --panel: #ffffff;
  --panel-hi: #ffffff;          /* 솟은 면의 위쪽 밝은 끝 */
  --panel-lo: #f4f6fa;          /* 솟은 면의 아래쪽 어두운 끝 */
  --sunk-hi: #e9edf4;           /* 들어간 면의 위쪽(그늘) */
  --sunk-lo: #fdfefe;           /* 들어간 면의 아래쪽(빛) */

  --ink: #12151b;

  /* 앱 이름 글자 아래에 깔리는 두께 색 */
  --brand-extrude: #ccd5ec;
  --brand-extrude-2: #a9b7dc;
  --ink-2: #454d5d;
  --ink-3: #78829a;

  --line: #d8dee9;
  --line-2: #e8ecf3;
  --edge-hi: rgba(255, 255, 255, 0.9);   /* 위쪽 하이라이트 */
  --edge-lo: rgba(21, 30, 51, 0.1);      /* 아래쪽 굳은 모서리 */

  --brand: #2f5bea;
  --brand-top: #5b7ff5;
  --brand-bot: #2a52d8;
  --brand-edge: #1e3ca6;
  --brand-soft: #e6ecff;
  --brand-ink: #2648c4;

  --ok: #0d7a58;
  --ok-top: #2fbb8d;
  --ok-bot: #10906a;
  --ok-edge: #0a6045;
  --ok-soft: #dcf3ea;

  --warn: #99590a;
  --warn-soft: #fbeed8;
  --bad: #b8283a;
  --bad-soft: #fbe6e9;
  --draft: #5f3cc4;
  --draft-soft: #ece5ff;

  --shadow-key: 21, 30, 51;     /* 그림자 기본 색상(rgb) */

  /* 고도 단계 — 숫자가 클수록 표면에서 더 떠 있다 */
  --e1: 0 1px 1px rgba(var(--shadow-key), 0.05), 0 2px 4px -1px rgba(var(--shadow-key), 0.07);
  --e2: 0 1px 1px rgba(var(--shadow-key), 0.05), 0 3px 6px -1px rgba(var(--shadow-key), 0.09),
        0 10px 18px -8px rgba(var(--shadow-key), 0.14);
  --e3: 0 2px 3px rgba(var(--shadow-key), 0.07), 0 8px 16px -4px rgba(var(--shadow-key), 0.12),
        0 22px 34px -14px rgba(var(--shadow-key), 0.2);
  --e4: 0 4px 8px rgba(var(--shadow-key), 0.1), 0 18px 34px -8px rgba(var(--shadow-key), 0.22),
        0 46px 70px -28px rgba(var(--shadow-key), 0.34);

  --inset-soft: inset 0 1px 3px rgba(var(--shadow-key), 0.08), inset 0 0 0 1px rgba(var(--shadow-key), 0.04);
  --inset-deep: inset 0 2px 5px rgba(var(--shadow-key), 0.11), inset 0 -1px 0 rgba(255, 255, 255, 0.75);

  --radius: 14px;
  --radius-sm: 10px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  --sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.28, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0d1016;
  --bg-tint-a: #121a2c;
  --bg-tint-b: #1a1622;

  --panel: #191e27;
  --panel-hi: #222834;
  --panel-lo: #161a22;
  --sunk-hi: #10141b;
  --sunk-lo: #1d232e;

  --ink: #eef0f5;

  --brand-extrude: #2c3446;
  --brand-extrude-2: #1b2130;
  --ink-2: #b6bdcb;
  --ink-3: #828d9f;

  --line: #2d3542;
  --line-2: #232a35;
  --edge-hi: rgba(255, 255, 255, 0.08);
  --edge-lo: rgba(0, 0, 0, 0.5);

  --brand: #7b98ff;
  --brand-top: #7f9bff;
  --brand-bot: #4a6ae8;
  --brand-edge: #2b3f96;
  --brand-soft: #1d2740;
  --brand-ink: #a7bcff;

  --ok: #52d6a8;
  --ok-top: #4fd6a6;
  --ok-bot: #21a179;
  --ok-edge: #10604a;
  --ok-soft: #123027;

  --warn: #edaf5b;
  --warn-soft: #33270f;
  --bad: #ff8494;
  --bad-soft: #3a1921;
  --draft: #bda4ff;
  --draft-soft: #241d38;

  --shadow-key: 0, 0, 0;

  --e1: 0 1px 1px rgba(0, 0, 0, 0.4), 0 2px 5px -1px rgba(0, 0, 0, 0.5);
  --e2: 0 1px 1px rgba(0, 0, 0, 0.4), 0 4px 10px -2px rgba(0, 0, 0, 0.55),
        0 12px 22px -10px rgba(0, 0, 0, 0.7);
  --e3: 0 2px 4px rgba(0, 0, 0, 0.45), 0 10px 20px -6px rgba(0, 0, 0, 0.6),
        0 26px 40px -16px rgba(0, 0, 0, 0.75);
  --e4: 0 6px 12px rgba(0, 0, 0, 0.5), 0 22px 40px -10px rgba(0, 0, 0, 0.7),
        0 54px 80px -30px rgba(0, 0, 0, 0.85);

  --inset-soft: inset 0 1px 3px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  --inset-deep: inset 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* 바닥면 — 은은한 광원 두 개로 화면 전체에 깊이의 방향을 준다 */
  background:
    radial-gradient(1100px 700px at 12% -8%, var(--bg-tint-a) 0%, transparent 62%),
    radial-gradient(900px 620px at 108% 6%, var(--bg-tint-b) 0%, transparent 58%),
    var(--bg);
  background-attachment: fixed;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- 레이아웃 ---------- */

.app {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  perspective: 1400px;          /* 자식의 3D 변형이 원근을 갖도록 */
}

.sidebar {
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel) 46%, var(--panel-lo) 100%);
  border-right: 1px solid var(--line);
  box-shadow:
    inset -1px 0 0 var(--edge-lo),
    12px 0 28px -18px rgba(var(--shadow-key), 0.4);
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 4px; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.3px;
  flex: none;
  color: #fff;
  background: linear-gradient(155deg, var(--brand-top) 0%, var(--brand-bot) 72%, var(--brand-edge) 100%);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 3px rgba(0, 0, 0, 0.28),
    0 2px 0 var(--brand-edge),
    0 8px 16px -6px rgba(47, 91, 234, 0.6);
  transform: rotateX(12deg) rotateZ(-3deg);
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease);
}

.brand:hover .brand-mark { transform: rotateX(0deg) rotateZ(0deg) translateZ(6px); }

/* 앱 이름은 화면에서 가장 큰 글자다 — 본문 제목(21px)보다 크게 세운다.
   글자 아래로 같은 색을 몇 겹 깔아 두께를 만들고 그 아래에 그림자를 떨어뜨려
   판에서 밀어 올린 것처럼 보이게 한다. */
.brand-name {
  font-size: 25px;
  font-weight: 850;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--ink);
  text-shadow:
    0 1px 0 var(--edge-hi),
    0 2px 0 var(--brand-extrude),
    0 3px 0 var(--brand-extrude),
    0 4px 0 var(--brand-extrude-2),
    0 6px 10px rgba(var(--shadow-key), 0.32);
}

.brand-sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 3px;
  letter-spacing: -0.1px;
}

/* 이름이 커진 만큼 표식도 함께 키워 균형을 맞춘다 */
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 15px;
}

.steps { display: flex; flex-direction: column; gap: 5px; }

.step {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel-lo) 100%);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e1);
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--ink-2);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}

.step:hover {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  border-color: var(--line-2);
  box-shadow: var(--e1), inset 0 1px 0 var(--edge-hi);
  transform: translateY(-1px);
}

.step[aria-current="true"] {
  color: var(--brand-ink);
  font-weight: 650;
  background: linear-gradient(180deg, var(--panel-hi), var(--brand-soft));
  border-color: var(--line-2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 1px rgba(var(--shadow-key), 0.05),
    0 5px 12px -5px rgba(47, 91, 234, 0.45);
  transform: translateY(-1px);
}

.step:active { transform: translateY(1px); box-shadow: var(--inset-soft); }

/* 단계 번호 — 구슬처럼 둥글게 솟은 면 */
.step-num {
  width: 23px;
  height: 23px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  background: radial-gradient(circle at 34% 26%, var(--panel-hi), var(--panel-lo) 74%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1.5px 2px rgba(var(--shadow-key), 0.12),
    0 1px 2px rgba(var(--shadow-key), 0.14);
}

.step[aria-current="true"] .step-num {
  color: #fff;
  background: radial-gradient(circle at 34% 26%, var(--brand-top), var(--brand-bot) 76%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 3px rgba(0, 0, 0, 0.3),
    0 2px 5px -1px rgba(47, 91, 234, 0.6);
}

.step.done .step-num {
  color: #fff;
  background: radial-gradient(circle at 34% 26%, var(--ok-top), var(--ok-bot) 76%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -2px 3px rgba(0, 0, 0, 0.28),
    0 2px 5px -1px rgba(13, 122, 88, 0.5);
}

/* 현재 단계는 완료 여부와 무관하게 파란 구슬로 — 지금 어디 있는지가 우선이다 */
.step[aria-current="true"].done .step-num {
  background: radial-gradient(circle at 34% 26%, var(--brand-top), var(--brand-bot) 76%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 3px rgba(0, 0, 0, 0.3),
    0 2px 5px -1px rgba(47, 91, 234, 0.6);
}

/* 단계마다 오른쪽 같은 자리에 같은 형식으로 붙는 요약값 */
.step-meta {
  flex: none;
  min-width: 42px;
  text-align: right;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.step.done .step-meta { color: var(--ok); }
.step[aria-current="true"] .step-meta { color: var(--brand-ink); }

.sidebar-foot {
  margin-top: auto;
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 사이드바 오른쪽 기둥 — 본문과 푸터를 세로로 쌓고 푸터를 바닥에 붙인다 */
.content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.main {
  flex: 1;
  padding: 26px 30px 56px;
  max-width: 1180px;
  width: 100%;
  /* 그리드 항목은 기본값이 min-width:auto라 넓은 표가 페이지 전체를 늘린다.
     0으로 낮춰야 표가 .table-wrap 안에서만 가로 스크롤된다. */
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* 제목은 글자만 두지 않고 받침대 위에 올린다.
   위쪽 하이라이트와 아래쪽 그림자로 눌러 붙인 명패처럼 보이게 한다. */
h1 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  line-height: 1.25;
  margin: 0 0 7px;
  padding: 7px 13px;
  letter-spacing: -0.5px;
  font-weight: 750;
  border-radius: 13px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, var(--panel-hi) 0%, var(--brand-soft) 100%);
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    inset 0 -1px 0 var(--edge-lo),
    var(--e2);
  text-shadow: 0 1px 0 var(--edge-hi);
}

h2 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  line-height: 1.25;
  margin: 0 0 11px;
  padding: 5px 11px;
  letter-spacing: -0.3px;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel-lo) 100%);
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    inset 0 -1px 0 var(--edge-lo),
    var(--e1);
  text-shadow: 0 1px 0 var(--edge-hi);
}

/* 제목 앞 이모지 — 살짝 띄워 아이콘처럼 세운다 */
.h-emoji {
  font-size: 1.05em;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(var(--shadow-key), 0.35));
}

/* 모달 안 제목은 카드 위가 아니라 창 위라 한 단계 눌러 둔다 */
.modal h2 { background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel) 100%); }
h3 { font-size: 13px; margin: 0 0 6px; color: var(--ink-2); }
.sub { color: var(--ink-2); margin: 0; font-size: 13px; }

/* ---------- 카드 ---------- */

.card {
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel) 40%, var(--panel-lo) 100%);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e2);
  transition: box-shadow 0.22s var(--ease), transform 0.22s var(--ease);
}

.card:hover {
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e3);
  transform: translateY(-2px);
}

.card.tight { padding: 14px 16px; }

.row { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1 1 220px; min-width: 0; }
.spacer { flex: 1; }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-2); }

/* ---------- 입력: 표면 안으로 눌린 면 ---------- */

input[type="text"], input[type="number"], input[type="password"],
input[type="date"], input[type="time"], select, textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  width: 100%;
  outline: none;
  background: linear-gradient(180deg, var(--sunk-hi) 0%, var(--sunk-lo) 68%);
  box-shadow: var(--inset-soft);
  transition: box-shadow 0.16s var(--ease), border-color 0.16s var(--ease);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--inset-deep), 0 0 0 3.5px var(--brand-soft);
}

textarea { resize: vertical; min-height: 92px; line-height: 1.7; }

select {
  appearance: none;
  padding-right: 26px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%),
    linear-gradient(180deg, var(--sunk-hi) 0%, var(--sunk-lo) 68%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%, 0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-repeat: no-repeat;
}

/* ---------- 버튼: 두께가 있는 키캡 ---------- */

.btn {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel-lo) 100%);
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    0 1.5px 0 var(--edge-lo),
    var(--e1);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), filter 0.12s var(--ease);
}

.btn:hover {
  transform: translateY(-1.5px);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 3px 0 var(--edge-lo), var(--e2);
}

.btn:active {
  transform: translateY(1.5px);
  box-shadow: inset 0 2px 4px rgba(var(--shadow-key), 0.16), 0 0 0 var(--edge-lo);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--inset-soft);
}

.btn.primary {
  border-color: var(--brand-edge);
  color: #fff;
  background: linear-gradient(180deg, var(--brand-top) 0%, var(--brand-bot) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -2px 3px rgba(0, 0, 0, 0.22),
    0 2px 0 var(--brand-edge),
    0 8px 16px -7px rgba(47, 91, 234, 0.75);
}

.btn.primary:hover {
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -2px 3px rgba(0, 0, 0, 0.22),
    0 4px 0 var(--brand-edge),
    0 12px 22px -8px rgba(47, 91, 234, 0.8);
}

.btn.primary:active {
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.3),
    0 0 0 var(--brand-edge);
}

.btn.ok {
  border-color: var(--ok-edge);
  color: #fff;
  background: linear-gradient(180deg, var(--ok-top) 0%, var(--ok-bot) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 3px rgba(0, 0, 0, 0.22),
    0 2px 0 var(--ok-edge),
    0 8px 16px -7px rgba(13, 122, 88, 0.65);
}

.btn.ok:hover {
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 3px rgba(0, 0, 0, 0.22),
    0 4px 0 var(--ok-edge),
    0 12px 22px -8px rgba(13, 122, 88, 0.7);
}

.btn.ok:active { box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3), 0 0 0 var(--ok-edge); }

.btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  font-weight: 500;
}

.btn.ghost:hover {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  border-color: var(--line-2);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e1);
}

.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

/* 아이콘만 남긴 버튼 — 글자 폭이 없으니 정사각으로 잡아 준다 */
.btn.icon-only {
  padding: 0;
  width: 30px;
  height: 30px;
  font-size: 14px;
  justify-content: center;
}
.btn.danger { color: var(--bad); }

/* ---------- 칩 ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(var(--shadow-key), 0.07);
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 1px 2px rgba(var(--shadow-key), 0.12);
}

.pill.draft { background: linear-gradient(180deg, var(--draft-soft), color-mix(in srgb, var(--draft-soft) 84%, var(--draft))); color: var(--draft); }
.pill.confirmed { background: linear-gradient(180deg, var(--ok-soft), color-mix(in srgb, var(--ok-soft) 84%, var(--ok))); color: var(--ok); }
.pill.pending { background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo)); color: var(--ink-3); }
.pill.warn { background: linear-gradient(180deg, var(--warn-soft), color-mix(in srgb, var(--warn-soft) 84%, var(--warn))); color: var(--warn); }
.pill.bad { background: linear-gradient(180deg, var(--bad-soft), color-mix(in srgb, var(--bad-soft) 84%, var(--bad))); color: var(--bad); }
.pill.brand { background: linear-gradient(180deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 84%, var(--brand))); color: var(--brand-ink); }

/* ---------- 알림 문구: 표면에 얕게 눌린 띠 ---------- */

.note {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 12.5px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--sunk-hi), var(--sunk-lo));
  box-shadow: var(--inset-soft);
  color: var(--ink-2);
  /* 글줄이 오른쪽 끝까지 차게 한다 — 어절 단위로만 끊으면 빈자리가 남는다 */
  word-break: normal;
  overflow-wrap: anywhere;
}

/* 피드백·종합평가처럼 줄바꿈을 그대로 살리는 글도 폭을 끝까지 쓴다 */
.note[style*="pre-wrap"],
.evidence,
.help-list,
.help-faq dd,
.summary-foot {
  word-break: normal;
  overflow-wrap: anywhere;
}

.note.warn {
  background: linear-gradient(180deg, var(--warn-soft), color-mix(in srgb, var(--warn-soft) 90%, transparent));
  border-color: color-mix(in srgb, var(--warn) 28%, transparent);
  color: var(--warn);
}

.note.draft {
  background: linear-gradient(180deg, var(--draft-soft), color-mix(in srgb, var(--draft-soft) 90%, transparent));
  border-color: color-mix(in srgb, var(--draft) 26%, transparent);
  color: var(--draft);
}

.note.ok {
  background: linear-gradient(180deg, var(--ok-soft), color-mix(in srgb, var(--ok-soft) 90%, transparent));
  border-color: color-mix(in srgb, var(--ok) 26%, transparent);
  color: var(--ok);
}

.empty {
  text-align: center;
  padding: 52px 18px;
  color: var(--ink-3);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--sunk-hi), var(--sunk-lo));
  box-shadow: var(--inset-deep);
}

/* ---------- 표 ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  /* 카드 위에 얹힌 판이 아니라 카드에 파 넣은 홈처럼 보이게 한다 */
  box-shadow:
    inset 0 2px 4px -2px rgba(var(--shadow-key), 0.22),
    inset 0 -1px 0 var(--edge-hi),
    var(--e1);
}

table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; }

th {
  text-align: left;
  font-weight: 700;
  font-size: 10.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 9px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel-lo) 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 3px 6px -4px rgba(var(--shadow-key), 0.3);
}

/* 셀은 한 줄로 눕히고, 넘치면 잘라 낸다. 예전에는 여기서 표가 옆으로 밀려
   [열기] 같은 오른쪽 끝 버튼을 스크롤해야 볼 수 있었다.
   잘린 값은 title 속성으로 남으니 마우스를 올리면 전문이 보인다. */
td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

/* 길게 이어지는 설명 셀만 줄바꿈을 허용한다.
   min-width를 크게 잡으면 좁은 칼럼(채점 화면 왼쪽 단 같은 곳)에서
   그 한 칸이 표 전체를 밀어내 가로 스크롤이 생긴다. 최소를 낮게 두고
   남는 폭이 있을 때만 넓어지게 한다. */
td.wrap, th.wrap {
  white-space: normal;
  /* keep-all은 어절이 통째로 넘어가 줄 끝에 빈자리를 남긴다.
     한국어는 음절에서 끊어도 읽히므로 폭을 끝까지 쓴다. */
  word-break: normal;
  overflow-wrap: anywhere;
  overflow: visible;
  min-width: 84px;
  max-width: 300px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.14s var(--ease), box-shadow 0.14s var(--ease); }

/* 줄 위에 마우스를 올리면 한 칸 떠오른다 — 표에서도 깊이를 잃지 않게 */
tbody tr:hover {
  background: linear-gradient(180deg, var(--panel-hi), rgba(var(--shadow-key), 0.04));
  box-shadow: inset 0 1px 0 var(--edge-hi), inset 0 -1px 0 var(--edge-lo);
}

/* 짝수 줄을 아주 옅게 눕혀 두면 가로로 눈이 미끄러지지 않는다 */
tbody tr:nth-child(even) { background: rgba(var(--shadow-key), 0.018); }
tbody tr:nth-child(even):hover { background: linear-gradient(180deg, var(--panel-hi), rgba(var(--shadow-key), 0.05)); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 점수는 표에서 가장 먼저 읽히는 값이라 한 겹 도드라지게 */
td.num.mono b { text-shadow: 0 1px 0 var(--edge-hi); }
.mono { font-family: var(--mono); font-size: 12px; }

/* 표 안의 버튼 묶음 — td에 직접 display:flex를 주면 셀 배치가 무너지므로
   반드시 안쪽 div에 건다. 한 행에 그대로 서도록 줄바꿈을 막는다. */
.cell-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

td .cell-actions .btn { flex: none; }

/* 버튼이 든 칸은 잘라 내지 않는다.
   td의 기본 max-width(190px)를 그대로 두면 버튼 넉 줄 가운데 마지막 '삭제'가 셀 밖으로
   밀려 잘려 보였다. 이 칸만 내용 폭을 그대로 쓰게 한다. */
td:has(.cell-actions) {
  max-width: none;
  overflow: visible;
  width: 1%;
  white-space: nowrap;
}

/* :has()를 모르는 브라우저를 위한 대비 — 안쪽 묶음만이라도 흘러넘치지 않게 */
td .cell-actions { max-width: 100%; }

/* 채점 중인 답안 줄 */
tbody tr.row-current {
  background: linear-gradient(90deg, var(--brand-soft), transparent 70%);
  box-shadow: inset 3px 0 0 var(--brand);
}

tbody tr.row-current:hover { background: linear-gradient(90deg, var(--brand-soft), transparent 55%); }

/* 승인 대기 줄은 눈에 띄게 */
tbody tr.row-pending { background: linear-gradient(90deg, var(--warn-soft), transparent 60%); }
tbody tr.row-pending:hover { background: linear-gradient(90deg, var(--warn-soft), transparent 45%); }

/* ---------- 업로드: 깊게 파인 홈 ---------- */

.drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 38px 20px;
  text-align: center;
  color: var(--ink-2);
  cursor: pointer;
  background: linear-gradient(180deg, var(--sunk-hi) 0%, var(--sunk-lo) 72%);
  box-shadow: var(--inset-deep);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}

.drop:hover { border-color: var(--ink-3); }

.drop.hot {
  border-color: var(--brand);
  background: linear-gradient(180deg, var(--brand-soft) 0%, var(--sunk-lo) 88%);
  box-shadow: var(--inset-deep), 0 0 0 4px var(--brand-soft);
  transform: scale(0.995);
}

.drop b { color: var(--ink); }

/* ---------- 채점 화면 ---------- */

.grade-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* 그리드 항목은 기본값이 min-width:auto라 안쪽 표가 칸을 밀어낸다.
   0으로 낮춰야 표가 .table-wrap 안에서만 가로로 굴러간다. */
.grade-layout > * { min-width: 0; }

/* 답안 본문 — 표면 안쪽으로 파인 읽기 면 */
.answer-body {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  max-height: 62vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.9;
  font-size: 13.5px;
  background: linear-gradient(180deg, var(--sunk-hi) 0%, var(--sunk-lo) 12%, var(--sunk-lo) 100%);
  box-shadow: var(--inset-deep);
}

mark.ev {
  background: transparent;
  color: inherit;
  border-bottom: 2px solid var(--draft);
  border-radius: 3px;
  padding: 1px 2px;
  cursor: pointer;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

mark.ev:hover { background: color-mix(in srgb, var(--draft-soft) 70%, transparent); }

mark.ev.active {
  background: var(--draft-soft);
  box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--draft) 55%, transparent);
}

/* 평가항목 블록 — 카드 위에 한 층 더 얹힌 판 */
.crit {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  margin-bottom: 11px;
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel-lo) 100%);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e1);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.crit:hover { box-shadow: inset 0 1px 0 var(--edge-hi), var(--e2); transform: translateY(-1px); }

/* 문항 머리줄은 요소가 많아 좁은 화면에서 넘친다. 줄바꿈을 허용해 가로 스크롤을 막는다 */
.crit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.crit-head .crit-name { flex: 1 1 90px; }
.crit-name { font-weight: 650; flex: 1; min-width: 0; }

/* input[type="number"]의 width:100%가 클래스보다 우선순위가 높아 점수칸이 통째로 늘어난다.
   요소 선택자를 붙여 이겨야 숫자 폭만 남는다. */
input.score-input {
  width: 74px;
  flex: 0 0 74px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  padding-right: 9px;
}

.levels { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }

.level-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11.5px;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-2);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 1.5px 0 var(--edge-lo), var(--e1);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}

.level-btn:hover { transform: translateY(-1.5px); box-shadow: inset 0 1px 0 var(--edge-hi), 0 3px 0 var(--edge-lo), var(--e2); }
.level-btn:active { transform: translateY(1.5px); box-shadow: var(--inset-soft); }

.level-btn[aria-pressed="true"] {
  color: #fff;
  border-color: var(--brand-edge);
  background: linear-gradient(180deg, var(--brand-top), var(--brand-bot));
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2),
    0 1px 2px rgba(var(--shadow-key), 0.2);
}

.evidence {
  font-size: 12px;
  color: var(--ink-2);
  border-left: 3px solid var(--draft);
  border-radius: 0 8px 8px 0;
  padding: 5px 9px;
  margin: 5px 0;
  cursor: pointer;
  background: linear-gradient(90deg, color-mix(in srgb, var(--draft-soft) 60%, transparent), transparent 72%);
  transition: transform 0.14s var(--ease), color 0.14s var(--ease), box-shadow 0.14s var(--ease);
}

.evidence:hover {
  color: var(--ink);
  transform: translateX(3px);
  box-shadow: var(--e1);
}

.roster {
  max-height: 62vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--sunk-hi), var(--sunk-lo));
  box-shadow: var(--inset-soft);
}

.roster-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  width: 100%;
  border-left: 3px solid transparent;
  background: transparent;
  text-align: left;
  transition: background 0.14s var(--ease), transform 0.14s var(--ease), box-shadow 0.14s var(--ease);
}

.roster-item:hover {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  box-shadow: var(--e1);
}

.roster-item[aria-current="true"] {
  border-left-color: var(--brand);
  background: linear-gradient(180deg, var(--panel-hi), var(--brand-soft));
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e2);
  transform: translateX(2px);
}

.roster-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 통계 ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
  perspective: 900px;
}

/* 통계 타일만 살짝 기울여 세운다 — 글자 수가 적어 가독성 손해가 없다 */
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  background: linear-gradient(165deg, var(--panel-hi) 0%, var(--panel) 45%, var(--panel-lo) 100%);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e2);
  transform: rotateX(3.5deg);
  transform-origin: center bottom;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.stat:hover {
  transform: rotateX(0deg) translateY(-4px);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e3);
}

.stat .k { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }

.stat .v {
  font-size: 27px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  line-height: 1.25;
  text-shadow: 0 1px 0 var(--edge-hi), 0 2px 6px rgba(var(--shadow-key), 0.12);
}

.stat .d { font-size: 11.5px; color: var(--ink-3); }

/* 막대 — 홈에 박힌 원통 */
.bar-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  min-width: 70px;
  background: linear-gradient(180deg, var(--sunk-hi), var(--sunk-lo));
  box-shadow: var(--inset-deep);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-top) 0%, var(--brand-bot) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 3px rgba(0, 0, 0, 0.22);
  transition: width 0.4s var(--ease);
}

.bar-fill.ok { background: linear-gradient(180deg, var(--ok-top), var(--ok-bot)); }
.bar-fill.warn { background: linear-gradient(180deg, #f0b662, #c9852a); }
.bar-fill.bad { background: linear-gradient(180deg, #f2798a, #c62f43); }

svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart text { fill: var(--ink-3); font-size: 10px; font-family: var(--sans); }
svg.chart .axis { stroke: var(--line); stroke-width: 1; }
svg.chart .bar-top { fill: var(--brand-top); }
svg.chart .bar-side { fill: var(--brand-bot); }
svg.chart .bar-face { fill: url(#barGrad); }
svg.chart .bar-shadow { fill: rgba(var(--shadow-key), 0.16); }
svg.chart .val { fill: var(--ink-2); font-weight: 700; font-size: 10.5px; }

/* ---------- 모달 / 토스트 ---------- */

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 16, 0.55);
  backdrop-filter: blur(4px) saturate(115%);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
  perspective: 1200px;
  animation: fadeIn 0.16s var(--ease);
}

.modal {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  width: min(620px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel) 38%, var(--panel-lo) 100%);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e4);
  animation: popIn 0.22s var(--ease);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes popIn {
  from { opacity: 0; transform: translateY(14px) rotateX(7deg) scale(0.97); }
  to { opacity: 1; transform: none; }
}

#toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 90;
  perspective: 700px;
}

.toast {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  padding: 10px 15px;
  font-size: 13px;
  max-width: 348px;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e3);
  animation: slideIn 0.24s var(--ease);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(22px) rotateY(-14deg); }
  to { opacity: 1; transform: none; }
}

.toast.bad { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--ok); }

#busy .modal { animation: popIn 0.22s var(--ease); }

/* ---------- 문제 출제 ---------- */

.paper-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 16px;
  align-items: start;
}

.paper-preview { position: sticky; top: 22px; }

/* 안내문 미리보기 — 책상 위에 놓인 종이 한 장 */
.sheet {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  line-height: 1.85;
  padding: 20px 22px;
  max-height: 58vh;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 12%),
    linear-gradient(180deg, var(--panel-hi) 0%, var(--panel) 30%, var(--panel-lo) 100%);
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    0 1px 1px rgba(var(--shadow-key), 0.06),
    0 8px 18px -10px rgba(var(--shadow-key), 0.3);
}

[data-theme="dark"] .sheet { background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel-lo) 100%); }

/* 제출 방법 다중 선택 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.chip-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-2);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 1.5px 0 var(--edge-lo), var(--e1);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), color 0.12s var(--ease);
}

.chip-toggle:hover { transform: translateY(-1.5px); box-shadow: inset 0 1px 0 var(--edge-hi), 0 3px 0 var(--edge-lo), var(--e2); }

.chip-toggle[aria-pressed="true"] {
  color: #fff;
  border-color: var(--brand-edge);
  background: linear-gradient(180deg, var(--brand-top), var(--brand-bot));
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2),
    0 1px 2px rgba(var(--shadow-key), 0.2);
}

/* 이 도구가 읽지 못하는 제출 형식은 선택했을 때 경고색으로 바꾼다 */
.chip-toggle.risky[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--warn) 60%, #000);
  background: linear-gradient(180deg, #e8a94f, #b9761c);
}

/* 문제안 — 체크해서 고르는 판 */
.proposal {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel-lo) 100%);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e1);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), border-color 0.16s var(--ease);
}

.proposal:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 var(--edge-hi), var(--e2); }

.proposal.picked {
  border-color: var(--brand);
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--brand-soft) 100%);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 0 0 1px var(--brand), var(--e2);
}

/* 체크 표시 — 누르면 눌리는 작은 판 */
.tick {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: transparent;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--sunk-hi), var(--sunk-lo));
  box-shadow: var(--inset-soft);
  transition: background 0.16s var(--ease), color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.proposal.picked .tick {
  color: #fff;
  border-color: var(--brand-edge);
  background: linear-gradient(180deg, var(--brand-top), var(--brand-bot));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -2px 3px rgba(0, 0, 0, 0.25),
    0 2px 5px -2px rgba(47, 91, 234, 0.6);
}

.prop-qs {
  margin: 10px 0 0;
  padding-left: 20px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.75;
}

.prop-qs li { margin-bottom: 5px; }
.prop-qs li::marker { color: var(--ink-3); font-weight: 700; }

.prop-meta {
  display: inline-block;
  margin-right: 7px;
  padding: 1px 7px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  background: linear-gradient(180deg, var(--sunk-hi), var(--sunk-lo));
  box-shadow: var(--inset-soft);
}

/* 확정 문항 한 줄 */
.q-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel-lo) 100%);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e1);
}

/* 본문이 주인공이라 왼쪽이 남는 폭을 다 가져가고, 오른쪽은 점수·난이도가 들어갈 만큼만 차지한다 */
.q-row > .grow { flex: 1 1 auto; min-width: 0; }
.q-row > .col:last-child { flex: 0 0 auto; }

.q-row textarea { min-height: 76px; font-size: 13px; line-height: 1.65; }
.q-row .level-btn { padding: 3px 9px; font-size: 11px; }

/* 문항 번호 구슬 */
.q-no {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 800;
  flex: none;
  color: #fff;
  font-variant-numeric: tabular-nums;
  background: radial-gradient(circle at 34% 26%, var(--brand-top), var(--brand-bot) 76%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 3px rgba(0, 0, 0, 0.3),
    0 2px 5px -1px rgba(47, 91, 234, 0.55);
}

/* ---------- 문제 팝업: 실제 시험지처럼 ---------- */

/* overflow:hidden을 걸면 긴 문제지를 아래로 굴려 볼 수 없다. 세로 스크롤을 열어 둔다. */
.exam-modal {
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 88vh;
  overscroll-behavior: contain;
}

/* 버튼 줄은 굴러 올라가지 않게 바닥에 붙여 둔다 */
.exam-modal .row.end {
  position: sticky;
  bottom: 0;
  margin: 0;
  background: linear-gradient(180deg, transparent, var(--panel) 35%);
  border-top: 1px solid var(--line-2);
  backdrop-filter: blur(3px);
}

.exam {
  padding: 30px 34px 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), transparent 10%),
    linear-gradient(180deg, var(--panel-hi) 0%, var(--panel) 55%, var(--panel-lo) 100%);
}

.exam-head { text-align: center; padding-bottom: 16px; border-bottom: 2px solid var(--ink); margin-bottom: 20px; }
.exam-org { font-size: 12.5px; color: var(--ink-2); line-height: 1.75; }

.exam-title {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 12px 0 12px;
  line-height: 1.35;
}

.exam-badges { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }

/* 응시자 정보 · 주의사항을 담는 테두리 상자 */
.exam-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px 15px;
  margin-bottom: 18px;
  background: linear-gradient(180deg, var(--sunk-hi), var(--sunk-lo));
  box-shadow: var(--inset-soft);
}

.exam-box-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 11px;
}

.exam-ident { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 11px; }
.exam-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--ink-2); }

.exam-field input {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: none;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
}

.exam-notes { margin: 0; padding-left: 19px; font-size: 12.5px; color: var(--ink-2); line-height: 1.85; }
.exam-notes li { margin-bottom: 2px; }
.exam-notes li::marker { color: var(--brand); }

.exam-intro {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.8;
  padding: 12px 15px;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: linear-gradient(90deg, var(--brand-soft), transparent 80%);
  margin-bottom: 20px;
}

/* 문항 — 번호·본문·배점을 한 줄에 세우고 답안란을 넉넉히 준다 */
.exam-q { margin-bottom: 22px; }

.exam-q-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.exam-q-text { margin: 0; flex: 1; font-weight: 650; font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; }

.exam-q-pts {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
  white-space: nowrap;
}

.exam-q-hint { font-size: 12px; color: var(--ink-3); margin: 0 0 9px 34px; }

textarea.exam-answer {
  min-height: 250px;                 /* 12행 이상이 한눈에 들어오는 높이 */
  line-height: 1.9;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  /* 원고지처럼 줄이 비치게 해 손으로 쓰는 시험지 느낌을 준다 */
  background-image: repeating-linear-gradient(
    180deg, transparent, transparent calc(1.9em - 1px), var(--line-2) calc(1.9em - 1px), var(--line-2) 1.9em);
  background-color: var(--panel);
  box-shadow: var(--inset-soft);
}

.exam-foot {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
}

.exam-modal .row.end { padding: 0 20px 18px; }

/* 인용 형식 예시 — 문제 팝업과 온라인 문제지가 같은 모양을 쓴다 */
.cite-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 10px 0 5px;
}

.cite-label:first-of-type { margin-top: 0; }

.cite-ex {
  font-size: 12.5px;
  line-height: 1.75;
  padding: 7px 11px;
  margin-bottom: 5px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  word-break: break-word;
}

.cite-note { font-size: 11.5px; color: var(--ink-3); margin-top: 9px; }

/* 인쇄: 문제지만 남긴다 */
@media print {
  body.printing-problem > .app,
  body.printing-problem #toasts { display: none !important; }
  body.printing-problem .modal-bg {
    position: static;
    background: none;
    backdrop-filter: none;
    padding: 0;
    display: block;
  }
  body.printing-problem .modal {
    width: 100% !important;
    max-height: none;
    border: none;
    box-shadow: none;
    background: #fff;
    color: #000;
    padding: 0;
    animation: none;
  }
  body.printing-problem .no-print { display: none !important; }
  body.printing-problem .exam { padding: 0; background: #fff; }
  body.printing-problem .exam-q { break-inside: avoid; }
  body.printing-problem .exam-box { background: #fff; box-shadow: none; }
  body.printing-problem textarea.exam-answer {
    min-height: 300px;
    background: #fff;
    box-shadow: none;
    border: 1px solid #bbb;
  }
}

/* 인쇄: 안내문 한 장만 남긴다 */
@media print {
  body.printing { background: #fff; }
  body.printing .sidebar,
  body.printing .site-foot,
  body.printing .page-head,
  body.printing #toasts,
  body.printing .paper-layout > div:first-child,
  body.printing .paper-preview .card:last-child,
  body.printing .paper-preview .row { display: none !important; }

  body.printing .app { display: block; }
  body.printing .main { padding: 0; max-width: none; }
  body.printing .paper-layout { display: block; }
  body.printing .paper-preview { position: static; }
  body.printing .card { border: none; box-shadow: none; padding: 0; margin: 0; }

  body.printing .sheet {
    max-height: none;
    overflow: visible;
    border: none;
    box-shadow: none;
    background: #fff;
    color: #000;
    font-size: 11.5pt;
    padding: 0;
  }
}

/* 보고서 DB 도구 줄 — 과목 선택과 일괄 내려받기 */
.db-toolbar {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--sunk-hi), var(--sunk-lo));
  box-shadow: var(--inset-soft);
  align-items: flex-end;
}

.db-toolbar .field { margin: 0; }

/* ---------- 상단 바: 로그인 · 관리자 ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 11px 30px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel-lo) 100%);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 6px 14px -14px rgba(var(--shadow-key), 0.5);
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 52px;
}

.topbar:empty { display: none; }

.top-note { font-size: 12px; color: var(--warn); }

.g-icon { display: inline-flex; align-items: center; }

.who {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--sunk-hi), var(--sunk-lo));
  box-shadow: var(--inset-soft);
}

.who-name { font-size: 12.5px; font-weight: 650; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  object-fit: cover;
  background: radial-gradient(circle at 34% 26%, var(--brand-top), var(--brand-bot) 76%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 3px rgba(var(--shadow-key), 0.25);
}

@media (max-width: 900px) {
  .topbar { padding: 10px 15px; }
  .who-name { max-width: 90px; }
}

/* ---------- 분석 종합 보고서 ---------- */

.summary-modal { padding: 0; overflow-y: auto; overflow-x: hidden; max-height: 88vh; overscroll-behavior: contain; }

.summary {
  padding: 32px 38px 26px;
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel) 45%, var(--panel-lo) 100%);
}

.summary-head { text-align: center; padding-bottom: 18px; border-bottom: 2px solid var(--ink); margin-bottom: 24px; }
.summary-org { font-size: 12.5px; color: var(--ink-2); }

.summary-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.7px;
  margin: 10px 0 6px;
}

.summary-sub { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.summary-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; font-variant-numeric: tabular-nums; }

.summary-sec { margin-bottom: 22px; }

.summary-sec h2 {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.2px;
  margin: 0 0 10px;
  padding-left: 11px;
  border-left: 3px solid var(--brand);
}

.summary-sec p {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-2);
  word-break: normal;
  overflow-wrap: anywhere;
}

.summary-list { margin: 0; padding-left: 22px; font-size: 13.5px; line-height: 1.95; color: var(--ink-2); }
.summary-list li { margin-bottom: 7px; word-break: normal; overflow-wrap: anywhere; }
.summary-list li::marker { color: var(--brand); font-weight: 700; }

.summary-foot {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--ink-3);
}

.summary-modal .row.end {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--panel) 35%);
  border-top: 1px solid var(--line-2);
  backdrop-filter: blur(3px);
}

@media print {
  body.printing-problem .summary { padding: 0; background: #fff; }
  body.printing-problem .summary-sec { break-inside: avoid; }
}

@media (max-width: 900px) {
  .summary { padding: 22px 18px 18px; }
  .summary-title { font-size: 20px; }
}

/* ---------- 히어로: 상단바 아래 소개 띠 ---------- */

.hero {
  margin: 0;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--brand-soft) 100%);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 10px 22px -20px rgba(var(--shadow-key), 0.5);
}

.hero.collapsed {
  padding: 7px 22px;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  text-align: right;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 22px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 0 20px;
}

.hero-copy { min-width: 0; }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-ink);
  background: linear-gradient(180deg, var(--panel-hi), var(--brand-soft));
  border: 1px solid var(--brand);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e1);
}

.hero-emoji { font-size: 13px; filter: drop-shadow(0 1px 1px rgba(var(--shadow-key), 0.3)); }

.hero-title {
  margin: 9px 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.7px;
  line-height: 1.25;
  color: var(--ink);
  text-shadow: 0 1px 0 var(--edge-hi);
}

.hero-lead {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 60ch;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-points li {
  font-size: 11.5px;
  color: var(--ink-2);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e1);
}

.hero-nav { display: flex; align-items: center; gap: 7px; margin-top: 14px; }

.hero-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-lo);
  cursor: pointer;
  transition: width 0.25s var(--ease), background 0.25s var(--ease);
}

.hero-dot:hover { background: var(--brand-soft); }

.hero-dot.on {
  width: 24px;
  background: linear-gradient(90deg, var(--brand-top), var(--brand-bot));
  border-color: var(--brand);
}

.hero-count { font-size: 11px; color: var(--ink-3); margin-left: 4px; font-variant-numeric: tabular-nums; }

.hero-close {
  position: absolute;
  top: 6px;
  right: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 12px;
}

.hero-close:hover { background: var(--panel); border-color: var(--line); color: var(--ink); }

/* ---------- 태양계 ---------- */

.hero-sky { display: grid; place-items: center; }

.sky { width: 208px; height: 208px; overflow: visible; }

.sky .orbit {
  fill: none;
  stroke: var(--line);
  stroke-width: 0.7;
  stroke-dasharray: 1.5 3.5;
  opacity: 0.7;
}

.sky .sun {
  fill: url(#sunGlow);
  filter: drop-shadow(0 0 6px rgba(255, 176, 32, 0.55));
}

.sky .sun-halo {
  fill: url(#sunHalo);
  animation: sunPulse 4.2s ease-in-out infinite;
}

/* 실제 색을 눈으로 알아볼 만큼만 옮겨 왔다 */
.sky .planet { stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.4; }
.sky .planet.mercury { fill: #9a9188; }
.sky .planet.venus   { fill: #e6c684; }
.sky .planet.earth   { fill: #3d7fd6; }
.sky .planet.mars    { fill: #c1502e; }
.sky .planet.jupiter { fill: #cba07a; }
.sky .planet.saturn  { fill: #dfc37e; }
.sky .planet.uranus  { fill: #8fd3d8; }
.sky .planet.neptune { fill: #3f63c7; }

.sky .ring {
  fill: none;
  stroke: #dfc37e;
  stroke-width: 1.1;
  opacity: 0.85;
}

.sky .moon { fill: #d8d4cc; }

/* 시작 각도는 바깥 g가 붙들고, 도는 일은 안쪽 g가 맡는다.
   한 요소에 두 transform을 겹치면 시작 각도가 매 바퀴 지워진다. */
.sky .spin-run {
  transform-origin: 120px 120px;
  transform-box: view-box;
  animation-name: orbitSpin;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.sky .spin {
  transform-origin: 120px 120px;
  transform-box: view-box;
}

@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes sunPulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

@media (max-width: 900px) {
  .hero { padding: 0 12px; }
  .hero-inner { grid-template-columns: 1fr; gap: 12px; padding: 14px 0 16px; }
  .hero-title { font-size: 18px; }
  .hero-lead { font-size: 12.5px; }
  .hero-sky { display: none; }
  .hero.collapsed { padding: 6px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .sky .spin-run, .sky .sun-halo { animation: none; }
}

@media print { .hero { display: none; } }

/* ---------- 도움말 ---------- */

.help-modal {
  width: min(920px, calc(100vw - 40px));
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.help-pane { display: flex; flex-direction: column; gap: 14px; }

/* 그림과 설명을 나란히 — 좁아지면 그림이 위로 올라간다 */
.help-step {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e1);
}

.help-shot { position: sticky; top: 0; }

/* 화면 모형 — 실제 앱과 같은 색을 쓰되 글자는 막대로 대신한다 */
.shot {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: var(--e2);
}

.shot .s-bg { fill: var(--bg); stroke: var(--line); }
.shot .s-side { fill: var(--panel-lo); }
.shot .s-top { fill: var(--panel); }
.shot .s-mark { fill: var(--brand); }
.shot .s-step { fill: var(--line-2); }
.shot .s-step.on { fill: var(--brand); }
.shot .s-card { fill: var(--panel); stroke: var(--line-2); }
.shot .s-title { fill: var(--ink-3); }
.shot .s-line { fill: var(--line); }
.shot .s-cell { fill: var(--line-2); }
.shot .s-field { fill: var(--sunk-lo); stroke: var(--line-2); }
.shot .s-btn { fill: var(--line); }
.shot .s-btn.on { fill: var(--brand); }
.shot .s-bar { fill: var(--brand); }
.shot .s-sheet { fill: var(--panel); stroke: var(--line-2); }

.help-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.help-head b { font-size: 14px; }
.help-lead { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-2); }

.help-list {
  margin: 0;
  padding-left: 17px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.65;
}
.help-list li { margin-bottom: 3px; }

/* 빠른 시작 — 번호를 따라 내려가는 목록 */
.help-steps {
  margin: 0;
  padding-left: 20px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.75;
}

.help-steps li { margin-bottom: 8px; }
.help-steps li::marker { color: var(--brand); font-weight: 700; }

/* 자주 묻는 것 */
.help-faq { margin: 0; }
.help-faq dt {
  font-weight: 700;
  font-size: 13px;
  margin-top: 14px;
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e1);
  display: inline-block;
}
.help-faq dt:first-child { margin-top: 0; }
.help-faq dd {
  margin: 7px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.7;
}

@media (max-width: 760px) {
  .help-step { grid-template-columns: 1fr; }
  .help-shot { position: static; max-width: 320px; }
}

/* ---------- 종합 보고서 차트 ---------- */

.rfig {
  margin: 14px 0 18px;
  padding: 12px 14px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--e1);
  page-break-inside: avoid;
  break-inside: avoid;
}

.rfig figcaption {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.rchart { width: 100%; height: auto; display: block; overflow: visible; }
.rchart.donut { width: 192px; height: 192px; flex: none; }

.rchart .c-axis { stroke: var(--line); stroke-width: 1; }
.rchart .c-track { fill: var(--sunk-lo); }
.rchart .c-bar { fill: var(--brand); }
.rchart .c-bar.up { fill: var(--ok); }
.rchart .c-bar.down { fill: var(--brand); }
.rchart .c-lab { font-size: 9.5px; fill: var(--ink-3); }
.rchart .c-val { font-size: 10px; font-weight: 700; fill: var(--ink-2); }
.rchart .c-base { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 3 3; }
.rchart .c-mark { stroke: var(--ink); stroke-width: 2; }
.rchart .c-mark.dash { stroke: var(--ink-3); stroke-dasharray: 3 3; }
.rchart .c-dot-svg { fill: var(--brand); opacity: 0.85; }
.rchart .c-center { font-size: 26px; font-weight: 800; fill: var(--ink); }
.rchart .c-center-sub { font-size: 10px; fill: var(--ink-3); }

/* 도넛 조각 — 잘함에서 못함으로 색이 흐른다 */
.c-slice.s0, .c-dot.s0 { fill: #2f5bea; background: #2f5bea; }
.c-slice.s1, .c-dot.s1 { fill: #3f9f6a; background: #3f9f6a; }
.c-slice.s2, .c-dot.s2 { fill: #d9a441; background: #d9a441; }
.c-slice.s3, .c-dot.s3 { fill: #d2793a; background: #d2793a; }
.c-slice.s4, .c-dot.s4 { fill: #c9483f; background: #c9483f; }

.c-donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.c-legend { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; }
.c-leg { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.c-leg b { margin-left: 3px; }
.c-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.c-pct { color: var(--ink-3); font-size: 10.5px; }

/* 보고서 안 표 — 화면 표와 달리 인쇄를 먼저 생각한다 */
.rtable {
  margin: 12px 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.rtable table { width: 100%; font-size: 11px; border-collapse: collapse; }
.rtable th {
  position: static;
  padding: 6px 8px;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: none;
  background: var(--panel-lo);
}
.rtable td { padding: 5px 8px; max-width: none; border-bottom: 1px solid var(--line-2); }
.rtable td.num, .rtable th.num { text-align: right; }
.rtable tbody tr:nth-child(even) { background: rgba(var(--shadow-key), 0.02); }

@media print {
  .rfig { box-shadow: none; background: #fff; border-color: #ddd; }
  .rtable { border-color: #ccc; }
}

/* ---------- 세부 요소의 입체 마무리 ---------- */

/* 통계 타일의 숫자는 이 화면에서 가장 크게 읽히는 값이라 한 겹 더 세운다 */
.stat .v { text-shadow: 0 1px 0 var(--edge-hi), 0 2px 3px rgba(var(--shadow-key), 0.14); }

/* 알림 상자에 색을 입힌 것들은 테두리까지 살려 둔다 */
.note.warn,
.note.ok,
.note.draft { box-shadow: var(--inset-soft), 0 1px 2px rgba(var(--shadow-key), 0.1); }

/* 척도 라벨·상태 배지가 표 안에서 납작해 보이지 않게 */
td .pill { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 1px 3px rgba(var(--shadow-key), 0.16); }

/* 막대는 홈 안에 든 물체처럼 — 트랙을 더 깊게 판다 */
.bar-track { box-shadow: var(--inset-deep), 0 1px 0 var(--edge-hi); }

/* 창은 화면에서 가장 앞이라 그림자를 가장 크게 준다 */
.modal { box-shadow: inset 0 1px 0 var(--edge-hi), var(--e4), 0 40px 80px -30px rgba(var(--shadow-key), 0.55); }

/* 빈 화면도 파인 홈으로 남겨 둔다 — 이미 눌려 있으니 테두리만 또렷하게 */
.empty { border-style: dashed; }

/* ---------- 채점 현황 표: 항목이 많아도 한 화면에 ---------- */

/* 평가항목이 다섯이면 열이 열둘이 된다. 글자를 줄이고 항목 이름은 두 줄로 접어
   가로 스크롤 없이 [확정]부터 [열기]까지 한눈에 들어오게 한다. */
.grade-table { font-size: 11.5px; }

.grade-table th,
.grade-table td { padding: 6px 7px; }

.grade-table th.crit-col {
  white-space: normal;
  line-height: 1.22;
  min-width: 56px;
  max-width: 88px;
  font-size: 10px;
}

/* 이름·학년·채점자는 짧다. 길어져도 여기서 끊어 표 전체를 밀지 않게 한다. */
.grade-table td:nth-child(2) { max-width: 132px; }
.grade-table td:nth-child(3),
.grade-table td:nth-child(4) { max-width: 76px; }

/* 누를 수 있는 머리칸 — 지금 정렬 기준은 색으로 알린다 */
.grade-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.grade-table th.sortable:hover { background: var(--brand-soft); }

.grade-table th.sorted {
  color: var(--brand);
  background: var(--brand-soft);
}

/* 그래도 넘칠 만큼 좁은 화면에서는 [열기]만이라도 붙잡아 둔다 */
.grade-table .pin-right {
  position: sticky;
  right: 0;
  background: var(--panel);
  box-shadow: -6px 0 8px -6px rgba(0, 0, 0, 0.18);
}

.grade-table tr.row-current .pin-right { background: var(--brand-soft); }

@media (max-width: 900px) {
  .grade-table { font-size: 11.5px; }
  .grade-table th,
  .grade-table td { padding: 6px; }
}

/* ---------- 학생 이름 링크 · 내보내기 미리보기 표 ---------- */

/* 표 안에서는 버튼처럼 보이지 않게 하고, 누를 수 있다는 것만 밑줄로 알린다 */
.student-link {
  padding: 2px 4px;
  font-weight: 600;
  font-size: 13px;
  color: var(--brand);
  background: none;
  border: none;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.student-link:hover {
  background: var(--brand-soft);
  box-shadow: none;
  transform: none;
}

/* 미리보기는 행이 많아 세로로도 스크롤된다 */
.preview-table {
  max-height: 52vh;
  overflow: auto;
}

.preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-hi);
}

/* 미리보기 창은 표에 맞춰 커진다. 일곱 열짜리 파일에 창만 화면 폭으로 벌려 두면
   표는 왼쪽에 몰리고 오른쪽은 빈 채로 남는다. */
/* 여섯 포맷의 미리보기가 같은 크기로 열린다. 창이 파일마다 커졌다 작아졌다 하면
   열 때마다 화면이 흔들리고, 열이 적은 파일과 많은 파일을 견주기도 어렵다.
   상세 CSV가 쓰던 폭을 기준으로 삼는다.
   modal-bg가 좌우 20px씩 여백을 두므로 그만큼 빼야 창이 화면 안에 남는다. */
.preview-modal {
  width: min(1200px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
}

/* ---------- 미리보기 창은 평면으로 ----------
   내보낼 파일을 있는 그대로 확인하는 자리다. 깊이감과 기울기는 값을 읽는 데
   도움이 되지 않으므로, 이 창 안에서만 3D 처리를 걷어 낸다. */

.preview-modal {
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 10px 30px -12px rgba(var(--shadow-key), 0.35);
  animation: fadeIn 0.16s var(--ease);
}

/* 창이 기울며 들어오지 않게 — 배경의 원근도 이 창에는 걸지 않는다 */
.modal-bg:has(.preview-modal) { perspective: none; }

/* 제목은 명패가 아니라 그냥 제목으로 */
.preview-modal h2 {
  border: none;
  background: none;
  box-shadow: none;
  text-shadow: none;
  padding: 0;
  margin-bottom: 10px;
  font-size: 14px;
}

.preview-modal h2 .h-emoji { filter: none; }

/* 안내 상자도 눌린 면 대신 옅은 바탕만 */
.preview-modal > .note {
  background: var(--sunk-hi);
  box-shadow: none;
  border-radius: 8px;
}

/* 표는 홈이 아니라 테두리로 구분한다 */
.preview-modal .table-wrap {
  border-radius: 8px;
  box-shadow: none;
  background: var(--panel);
}

.preview-modal thead th {
  background: var(--panel-lo);
  box-shadow: none;
  text-shadow: none;
}

.preview-modal tbody tr:nth-child(even) { background: transparent; }

.preview-modal tbody tr:hover {
  background: var(--sunk-hi);
  box-shadow: none;
}

.preview-modal td.pin,
.preview-modal th.pin { background: var(--panel); }
.preview-modal thead th.pin { background: var(--panel-lo); }

.preview-modal td.pin-last,
.preview-modal th.pin-last {
  box-shadow: none;
  border-right: 1px solid var(--line);
}

/* 버튼도 눌리고 떠오르는 대신 평평하게 */
.preview-modal .btn {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: none;
  text-shadow: none;
}

.preview-modal .btn:hover { background: var(--sunk-hi); transform: none; box-shadow: none; }
.preview-modal .btn:active { transform: none; box-shadow: none; }

.preview-modal .btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.preview-modal .btn.primary:hover { background: var(--brand-bot); }

/* 글로 보여 주는 파일도 같은 결로 */
.preview-modal textarea {
  box-shadow: none;
  border: 1px solid var(--line);
  background: var(--panel);
}

/* 파일 이름이 길면 제목 한 줄이 창 밖으로 밀린다. 접어 둔다. */
.preview-modal h2 {
  display: block;
  max-width: 100%;
  white-space: normal;
  word-break: break-all;
  line-height: 1.35;
}

/* 학생 배포용 피드백은 표가 아니라 글이다. 창은 다른 포맷과 같은 폭이되
   글줄이 화면 끝까지 늘어지지 않게 단 너비만 잡아 준다. */
.preview-modal textarea {
  width: 100%;
  max-width: 900px;
}

/* 표가 창 폭을 채우려 들면 열 수가 적을수록 남는 폭을 서로 나눠 가져
   짧은 값 옆에 빈 공간이 한 뼘씩 생긴다. 내용 폭만 쓰게 두어 열을 붙인다.
   창은 고정 폭이라 표가 짧으면 오른쪽이 비는데, 열이 벌어지는 것보다 낫다. */
/* 표는 창 폭을 채우되, 남는 자리는 맨 끝 글 칸이 가져간다.
   앞쪽 칸까지 나눠 가지면 짧은 값 옆이 비어 보이므로 그쪽은 내용 폭만 쓴다. */
.preview-table table { width: 100%; }

/* 열이 스물 넘는 표는 머리글 한 줄이 폭을 결정해 버린다.
   "자료 수집과 분석(30)" 같은 이름을 두 줄로 접어 칸을 좁힌다. */
.preview-table table.dense th {
  white-space: normal;
  line-height: 1.25;
  max-width: 82px;
  padding: 4px 5px;
}

.preview-table table.dense td { padding: 3px 5px; }

/* 값이 짧은 칸은 최소한으로 눌러 옆으로 미는 거리를 없앤다.
   남는 폭은 글 칸이 가져가므로 여기서 아낀 만큼 피드백이 넓어진다. */
.preview-table table.dense td:not(.prose),
.preview-table table.dense th:not(.prose) { max-width: 54px; }

.preview-table table.dense td.num,
.preview-table table.dense th.num { max-width: 40px; }

.preview-table table.dense th { max-width: 60px; font-size: 9.5px; }

/* 글 칸은 남는 폭을 나눠 가진다 */
.preview-table table.dense td.prose,
.preview-table table.dense th.prose { min-width: 118px; max-width: none; }

/* 학생에게 나가는 글이 맨 끝에 있으면 창 오른쪽 끝까지 늘려 한 줄이라도 더 보이게 한다 */
.preview-table th.prose:last-child,
.preview-table td.prose:last-child {
  width: 100%;
  max-width: none;
}

/* 한 행은 한 줄. 긴 셀은 잘라서 보여 주고 전문은 title로 남긴다. */
.preview-table td {
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 104px;
  padding: 3px 6px;
}

/* 열 폭을 정하는 것은 값이 아니라 머리글이다. 대문자로 늘리고 자간까지 벌리면
   "SIS USER ID" 한 줄이 그 아래 여덟 자리 숫자보다 넓어진다. 머리글만 원래 꼴로
   되돌리고 더 작게 써서 열이 값에 붙게 한다. */
.preview-table th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 104px;
  padding: 4px 6px;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
}

/* 숫자 열은 오른쪽에 붙는다. 열이 넓으면 값과 이름이 멀어지므로 폭을 내용에 맞춘다. */
.preview-table td.num,
.preview-table th.num { max-width: 72px; }

/* 학생에게 그대로 나가는 글(Notes · Feedback comments · Feedback to Learner)은
   잘라 두면 무엇이 나가는지 확인할 수가 없다. 이 열만 접어서 전문을 보여 준다. */
.preview-table td.prose {
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  overflow: visible;
  text-overflow: clip;
  min-width: 260px;
  max-width: 420px;
  line-height: 1.5;
  padding: 6px 8px;
  vertical-align: top;
}

.preview-table th.prose { max-width: 420px; }

/* 상세 CSV는 열이 스물 넘어 어느 화면에도 다 들어가지 않는다.
   누구 행을 보고 있는지 잃지 않도록 앞 칸을 왼쪽에 붙여 두되,
   붙일 위치는 실제 열 폭을 재서 정한다(pinPreviewColumns).
   폭을 픽셀로 박아 두면 파일마다 열 너비가 달라 옆 칸과 겹친다. */
.preview-table td.pin,
.preview-table th.pin {
  position: sticky;
  z-index: 2;
  background: var(--panel);
}

.preview-table thead th.pin { z-index: 3; background: var(--panel-hi); }

/* 고정 구역의 오른쪽 끝에만 그림자를 둬 경계를 알린다 */
.preview-table td.pin-last,
.preview-table th.pin-last { box-shadow: 6px 0 8px -6px rgba(0, 0, 0, 0.18); }

/* 고정하지 않은 칸이 전역 sticky를 물려받아 서로 겹치는 일이 없게 한다 */
.preview-table tbody td { position: static; }

/* ---------- 로그인 전: 미리보기 잠금 ---------- */

/* 손댈 수 없다는 것을 색으로 알린다. 클릭·포커스 차단은 inert 속성이 맡는다. */
.locked {
  opacity: 0.5;
  filter: saturate(0.55);
  user-select: none;
  cursor: default;
}

/* 잠긴 사이드바 단계 */
.steps.locked .step { cursor: default; }
.steps.locked .step-meta { color: var(--ink-3); }

/* ---------- 푸터: 페이지가 얹힌 바닥 받침 ---------- */

.site-foot {
  margin-top: auto;
  padding: 20px 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--sunk-hi) 0%, var(--sunk-lo) 100%);
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    inset 0 7px 12px -10px rgba(var(--shadow-key), 0.4);
}

.foot-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
}

.foot-sep { color: var(--line); }
.foot-org { color: var(--ink-3); margin-left: 2px; }

/* 버전 배지 — 누르면 변경 이력이 열린다 */
.foot-ver {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    0 1.5px 0 var(--edge-lo),
    var(--e1);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), color 0.12s var(--ease);
}

.foot-ver:hover {
  color: var(--brand-ink);
  transform: translateY(-1.5px);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 3px 0 var(--edge-lo), var(--e2);
}

.foot-ver:active { transform: translateY(1.5px); box-shadow: var(--inset-soft); }

.foot-links { gap: 10px; }

/* 링크는 눌러서 나가는 대상이므로 바닥 위로 솟은 칩으로 만든다 */
.foot-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel-lo) 100%);
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    0 1.5px 0 var(--edge-lo),
    var(--e1);
  transition: transform 0.14s var(--ease), box-shadow 0.14s var(--ease), color 0.14s var(--ease);
}

.foot-link b {
  font-weight: 700;
  color: var(--brand-ink);
  letter-spacing: -0.1px;
}

.foot-link:hover {
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    0 3.5px 0 var(--edge-lo),
    var(--e2);
}

.foot-link:active {
  transform: translateY(1.5px);
  box-shadow: inset 0 2px 4px rgba(var(--shadow-key), 0.16), 0 0 0 var(--edge-lo);
}

.foot-link:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    0 1.5px 0 var(--edge-lo),
    0 0 0 3.5px var(--brand-soft);
}

.foot-ico { font-size: 13px; line-height: 1; }

.hidden { display: none !important; }

/* ---------- 반응형 ---------- */

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; perspective: none; }

  /* 세로로 세워 두면 일곱 단계가 화면 절반을 먹는다.
     위쪽에 눕히고, 단계는 한 줄로 흘려 옆으로 넘겨 보게 한다. */
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    flex-direction: column;
    gap: 8px;
    padding: 9px 12px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 24px -18px rgba(var(--shadow-key), 0.5);
  }

  .brand { gap: 9px; }
  .brand-name { font-size: 19px; }
  .brand-sub { display: none; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 13px; }

  /* 단계는 한 줄 — 넘치면 가로로 밀어 본다. 스크롤바는 감춘다. */
  .steps {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .steps::-webkit-scrollbar { display: none; }

  .step {
    width: auto;
    flex: none;
    gap: 7px;
    padding: 7px 10px;
    font-size: 12px;
  }
  .step-num { width: 20px; height: 20px; font-size: 10.5px; }
  .step .step-meta { display: none; }

  /* 지금 단계만 이름을 보이고 나머지는 번호로 줄여 한 줄에 다 들어가게 한다 */
  .step:not([aria-current="true"]) .grow { display: none; }

  .sidebar-foot {
    margin-top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    gap: 6px;
  }
  /* 상태 설명 줄은 좁은 화면에서 자리만 먹는다 */
  .sidebar-foot > div { display: none; }

  /* 저장 위치 배지도 마찬가지 — 로그인·도움말 버튼만 남긴다 */
  .topbar { padding: 8px 12px; gap: 6px; }
  .topbar > .pill { display: none; }

  /* 상단 버튼은 이모지만 남긴다. 이름은 title에 있어 길게 누르면 읽힌다. */
  .topbar .btn-label { display: none; }
  .topbar .btn.sm { padding: 6px 9px; }
  .who-name { display: none; }

  .grade-layout { grid-template-columns: 1fr; }
  .paper-layout { grid-template-columns: 1fr; }
  .paper-preview { position: static; }
  .q-row { flex-wrap: wrap; }
  .q-row > .col:last-child { align-items: flex-start; width: 100%; }
  .content { min-height: 0; }
  .main { padding: 14px 12px 36px; }
  .stat { transform: none; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 9px; }
  .site-foot { padding: 18px 15px 22px; font-size: 11.5px; }
  .foot-link { width: 100%; justify-content: center; }

  /* 손가락으로 누를 것들은 작아지지 않게 */
  .btn { min-height: 34px; }
  .btn.sm { min-height: 30px; }

  .card { padding: 14px; }
  h1 { font-size: 16px; padding: 6px 11px; }
  h2 { font-size: 13px; padding: 5px 10px; }

  /* 표는 옆으로 밀어 보되, 첫 칸은 붙잡아 어느 줄인지 잃지 않게 한다 */
  .table-wrap table { font-size: 11.5px; }
  th, td { padding: 6px 7px; }

  /* 창은 화면을 거의 다 쓴다 */
  .modal-bg { padding: 12px; }
  .modal { max-height: 88vh; }
  .preview-modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }

  .summary { padding: 20px 16px 18px; }
  .summary-modal { max-height: 90vh; }
}

/* 손바닥 폭 — 여기서는 한 줄에 둘 이상 세우지 않는다 */
@media (max-width: 480px) {
  .page-head { flex-direction: column; align-items: flex-start; gap: 9px; }
  .page-head .row { width: 100%; flex-wrap: wrap; }
  .page-head .row .btn { flex: 1 1 auto; justify-content: center; }

  .row.end { flex-wrap: wrap; }
  .row.end .btn { flex: 1 1 auto; justify-content: center; }

  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat .v { font-size: 20px; }

  .field { min-width: 0; }

  /* 기본 220px 기준으로는 두 칸이 억지로 한 줄에 서다 눌린다 */
  .grow { flex: 1 1 100%; }

  .c-donut-wrap { justify-content: center; }
  .rchart.donut { width: 150px; height: 150px; }

  .site-foot { text-align: center; }
}

/* 모션을 줄이도록 설정한 사용자에게는 깊이만 남기고 움직임을 없앤다 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover, .btn:hover, .stat:hover, .crit:hover, .foot-link:hover,
  .roster-item[aria-current="true"] { transform: none; }
  .stat, .brand-mark { transform: none; }
}
