/* 글다움 첨삭 — 디자인 시스템 v1 (Claude Design 「글다움 01 디자인 방향·컴포넌트」 geuldaum.css 기준)
   아래 「앱 연결」 구획은 지금 앱 마크업(.on 탭, .card, 맨 input 등)을 같은 모양으로 잇는 부분이에요. */

:root, .gd {
  /* 글꼴 — UI는 고딕, 학생 글만 명조, 숫자는 Archivo 고정폭 숫자 */
  --font-ui: "IBM Plex Sans KR", system-ui, sans-serif;
  --font-doc: "Noto Serif KR", "Gowun Batang", serif;
  --font-num: "Archivo", "IBM Plex Sans KR", sans-serif;

  /* 글자 크기 단계 */
  --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-15: 15px; --fs-16: 16px;
  --fs-18: 18px; --fs-22: 22px; --fs-28: 28px; --fs-36: 36px; --fs-48: 48px;
  --fs-doc: 18px; --lh-doc: 2.2;   /* 학생 본문(첨삭 화면) */
  --fs-ed: 17px;  --lh-ed: 2;      /* 학생 작성 칸 — 두 층이 이 값만 씀 */

  /* 간격 (4px 단위) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;

  /* 모서리 — 전부 0. 둥근 것은 없음 */
  --radius: 0px;
  /* 그림자 — 떠 있는 것(토스트·팝오버)에만 */
  --shadow-1: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-2: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);
  --hit: 44px;  /* 최소 터치 영역 */

  /* 색 — 라이트 */
  --bg: #f3f2f2;        /* 바탕 */
  --sheet: #fcfbfa;     /* 원고지 · 입력칸 · 카드 */
  --surface: #eae9e9;   /* 묶음 바탕, hover */
  --surface-2: #dedcdb; /* 막대 바탕 */
  --ink: #201e1d;       /* 본문 글자 (15.6:1) */
  --ink-2: #57534f;     /* 보조 글자 (6.6:1) — 이보다 흐린 글자는 쓰지 않음 */
  --rule: color-mix(in srgb, #201e1d 40%, transparent); /* 2px 큰 구획선 */
  --line: #d7d3d3;      /* 1px 줄 */
  --grid: #e6e1de;      /* 원고지 줄 */
  --margin-line: #f3c9c0; /* 원고지 왼쪽 여백선 */

  --pen: #ec3013;       /* 빨간 펜 — 선·표시·아이콘 (3.7:1) */
  --pen-ink: #ae1800;   /* 빨간 펜 글자 (7.2:1) */
  --pen-strong: #ae1800;/* 빨간 바탕 버튼 */
  --on-pen: #ffffff;
  --pen-tint: #fff2ef;
  --pen-soft: #ffe0d9;

  --ok: #1d6b45;   --ok-tint: #e3efe7;
  --warn: #8a4b00; --warn-fill: #e8a33d; --warn-tint: #fbefd9;
  --q: #2b4c9b;    --q-tint: #e6ebf6;
  --hl: #fbe38a;   /* 형광펜 */
  --focus: #201e1d;
}

[data-theme="dark"], .gd[data-theme="dark"] {
  --bg: #161514; --sheet: #1e1c1b; --surface: #262423; --surface-2: #34312f;
  --ink: #efebe9; --ink-2: #b8b2ae;
  --rule: color-mix(in srgb, #efebe9 36%, transparent);
  --line: #3a3634; --grid: #2b2826; --margin-line: #4a2a24;
  --pen: #ff6a50; --pen-ink: #ff9a85; --pen-strong: #ff6a50; --on-pen: #1a0905;
  --pen-tint: #35191393; --pen-soft: #4d231a;
  --ok: #86d2a8; --ok-tint: #16301f;
  --warn: #f2b866; --warn-fill: #d9952f; --warn-tint: #33260f;
  --q: #a3b8f2; --q-tint: #1a2440;
  --hl: #5a4812;
  --focus: #efebe9;
  --shadow-2: 0 0 0 1px #3a3634, 0 12px 32px #0009;
}

/* ── 바탕 ─────────────────────────────────────────── */
.gd { font-family: var(--font-ui); font-size: var(--fs-15); line-height: 1.6; color: var(--ink);
  background: var(--bg); word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
.gd *, .gd *::before, .gd *::after { box-sizing: border-box; }
.gd :focus { outline: none; }
.gd :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.gd ::selection { background: var(--pen-soft); color: var(--ink); }
.gd a { color: var(--ink); text-underline-offset: 3px; }
.gd a:hover { text-decoration-thickness: 2px; }
.gd h1, .gd h2, .gd h3, .gd h4, .gd p { margin: 0; }
.gd .h1 { font: 700 var(--fs-28)/1.3 var(--font-ui); letter-spacing: -0.02em; }
.gd .h2 { font: 700 var(--fs-22)/1.35 var(--font-ui); letter-spacing: -0.015em; }
.gd .h3 { font: 600 var(--fs-18)/1.4 var(--font-ui); }
.gd .kicker { font: 600 var(--fs-13)/1.4 var(--font-ui); color: var(--ink-2); letter-spacing: 0.02em; }
.gd .sub { color: var(--ink-2); font-size: var(--fs-14); }
.gd .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.gd .ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gd .ic.sm { width: 16px; height: 16px; }
.gd .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── 레이아웃 ───────────────────────────────────────── */
.gd .wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--sp-6); }
.gd .stack { display: flex; flex-direction: column; gap: var(--gap, var(--sp-4)); }
.gd .row { display: flex; align-items: center; gap: var(--gap, var(--sp-2)); flex-wrap: wrap; }
.gd .between { justify-content: space-between; }
.gd .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap, var(--sp-8)); }
.gd .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap, var(--sp-6)); }
.gd .screen { container-type: inline-size; }
@container (max-width: 640px) { .gd .grid2, .gd .grid3 { grid-template-columns: minmax(0, 1fr); } }

/* 구획 머리 — 카드를 쌓는 대신 2px 선으로 나눕니다 */
.gd .sec { border-top: 2px solid var(--rule); padding-top: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-3); }
.gd .sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.gd .sec-h .h3 .num { color: var(--ink-2); font-weight: 500; margin-left: 6px; }

/* 상단 띠 (학생·보호자) */
.gd .top { display: flex; align-items: center; gap: var(--sp-4); min-height: 56px; padding: 0 var(--sp-4); border-bottom: 2px solid var(--rule); background: var(--bg); }
.gd .top nav { display: flex; gap: 0; margin-left: auto; }
.gd .top nav a { display: inline-flex; align-items: center; min-height: var(--hit); padding: 0 10px; font-size: var(--fs-15); font-weight: 500; text-decoration: none; color: var(--ink-2); position: relative; }
.gd .top nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.gd .top nav a[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 2px; background: var(--ink); }
.gd .top nav a .dot { width: 6px; height: 6px; background: var(--ink); margin-left: 4px; align-self: flex-start; margin-top: 12px; }
.gd .brand { display: inline-flex; align-items: baseline; gap: 3px; font: 700 var(--fs-18)/1 var(--font-ui); letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.gd .brand i { font-style: normal; color: var(--pen); font: 700 13px/1 var(--font-ui); transform: translateY(-6px); }

/* 선생님: 사이드바 + 본문 (상단 띠 없음) */
.gd .tlayout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }
.gd .tlayout.focus { grid-template-columns: 64px minmax(0, 1fr); }
.gd .side { border-right: 2px solid var(--rule); padding: var(--sp-5) 0; display: flex; flex-direction: column; gap: var(--sp-6); background: var(--bg); }
.gd .side .brand { padding: 0 var(--sp-5); }
.gd .side-g { display: flex; flex-direction: column; }
.gd .side-g > b { font: 600 var(--fs-12)/1 var(--font-ui); color: var(--ink-2); padding: 0 var(--sp-5) var(--sp-2); letter-spacing: 0.04em; }
.gd .side a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 var(--sp-5); font-size: var(--fs-15); color: var(--ink); text-decoration: none; position: relative; }
.gd .side a:hover { background: var(--surface); }
.gd .side a[aria-current="page"] { background: var(--surface); font-weight: 700; }
.gd .side a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ink); }
.gd .side a .cnt { margin-left: auto; font: 700 13px/1 var(--font-num); font-variant-numeric: tabular-nums; min-width: 24px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border: 1.5px solid var(--ink); }
.gd .side a .cnt.hot { background: var(--ink); color: var(--bg); }
.gd .side-foot { margin-top: auto; padding: 0 var(--sp-5); font-size: var(--fs-13); color: var(--ink-2); }
.gd .tlayout.focus .side { align-items: center; }
.gd .tlayout.focus .side a { width: 64px; justify-content: center; padding: 0; min-height: 48px; }
.gd .tlayout.focus .side a span:not(.cnt), .gd .tlayout.focus .side-g > b { display: none; }
.gd .tlayout.focus .side a .cnt { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; font-size: 11px; border-width: 1px; padding: 0 3px; }
.gd .page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; padding: var(--sp-8) 0 var(--sp-6); }

/* ── 버튼 ─────────────────────────────────────────── */
/* 기본 .btn = 보조(외곽선). 주 버튼 .pri = 먹색. 빨간 .pen 은 첨삭 화면의 "코멘트 달기"에만 */
.gd .btn { --h: var(--hit); display: inline-flex; align-items: center; gap: 8px; min-height: var(--h); padding: 0 16px;
  border: 1.5px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink);
  font: 600 var(--fs-15)/1.2 var(--font-ui); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .12s; }
.gd .btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.gd .btn:active { background: color-mix(in srgb, var(--ink) 15%, transparent); }
.gd .btn.pri { background: var(--ink); color: var(--bg); }
.gd .btn.pri:hover { background: color-mix(in srgb, var(--ink) 84%, var(--bg)); }
.gd .btn.pri:active { background: color-mix(in srgb, var(--ink) 70%, var(--bg)); }
.gd .btn.pen { background: var(--pen-strong); border-color: var(--pen-strong); color: var(--on-pen); }
.gd .btn.pen:hover { background: color-mix(in srgb, var(--pen-strong) 86%, var(--ink)); }
.gd .btn.danger { border-color: var(--pen-ink); color: var(--pen-ink); }
.gd .btn.danger:hover { background: var(--pen-tint); }
.gd .btn.quiet { border-color: transparent; }
.gd .btn.sm { --h: 32px; padding: 0 10px; font-size: var(--fs-13); gap: 6px; }
.gd .btn.lg { --h: 52px; padding: 0 18px; font-size: var(--fs-16); }
.gd .btn.block { width: 100%; justify-content: space-between; }   /* 글자는 왼쪽, 화살표는 오른쪽 */
.gd .btn.icon { width: var(--h); padding: 0; justify-content: center; }
.gd .btn:disabled, .gd .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; background: transparent; }
.gd .btn.pri:disabled, .gd .btn.pri[aria-disabled="true"] { background: var(--ink); }
.gd .btn[aria-busy="true"] { cursor: progress; }
.gd .btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gd-spin .7s linear infinite; }
@keyframes gd-spin { to { transform: rotate(360deg); } }
.gd .linkbtn { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--ink);
  font: 500 var(--fs-14)/1.3 var(--font-ui); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; cursor: pointer; }
.gd .linkbtn:hover { text-decoration-thickness: 2px; }
.gd .linkbtn.danger { color: var(--pen-ink); }

/* ── 칩 · D-day · 배지 ─────────────────────────────── */
/* 상태 칩: 모양(□ ■ ◩ ✓)과 글자로 구분, 색은 보조 */
.gd .chip { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 9px; border: 1px solid var(--line);
  background: var(--sheet); color: var(--ink); font: 600 var(--fs-13)/1 var(--font-ui); white-space: nowrap; }
.gd .chip.plain::before { display: none; }
.gd .chip::before { content: ""; width: 8px; height: 8px; flex: none; }
.gd .st-draft { color: var(--ink-2); }
.gd .st-draft::before { border: 1.5px solid currentColor; }
.gd .st-wait { background: var(--warn-tint); border-color: transparent; color: var(--warn); }
.gd .st-wait::before { background: currentColor; }
.gd .st-revise { background: var(--q-tint); border-color: transparent; color: var(--q); }
.gd .st-revise::before { border: 1.5px solid currentColor; background: linear-gradient(135deg, currentColor 50%, transparent 50%); }
.gd .st-final { background: var(--ok-tint); border-color: transparent; color: var(--ok); }
.gd .st-final::before { width: 9px; height: 5px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translate(1px, -1px); }
.gd .chip.neutral::before { display: none; }
.gd .badge-check { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; background: var(--warn-tint); color: var(--warn); font: 600 12px/1 var(--font-ui); }
.gd .badge-check::before { content: "!"; font-weight: 800; }

/* D-day: 4일+ 외곽선 → D-3~2 주의 → D-1·D-day 먹색 채움 → 지남 빨강 */
.gd .dd { display: inline-flex; align-items: center; height: 26px; padding: 0 8px; border: 1.5px solid var(--ink); color: var(--ink);
  font: 700 var(--fs-13)/1 var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: 0.01em; }
.gd .dd.soon { border-color: var(--warn); background: var(--warn-tint); color: var(--warn); }
.gd .dd.hot { background: var(--ink); color: var(--bg); }
.gd .dd.over { background: var(--pen-strong); border-color: var(--pen-strong); color: var(--on-pen); }
.gd .dd.lg { height: 32px; font-size: var(--fs-16); padding: 0 10px; }

/* 코멘트 유형 태그: 글자 칸 + 이름. 색만으로 구분하지 않음 */
.gd .tag { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding-right: 8px; background: var(--surface); color: var(--ink);
  font: 600 var(--fs-12)/1 var(--font-ui); white-space: nowrap; }
.gd .tag i { font-style: normal; width: 24px; height: 24px; display: inline-grid; place-items: center; font: 800 13px/1 var(--font-num); color: #fff; }
.gd .t-good i { background: var(--ok); }
.gd .t-q i { background: var(--q); }
.gd .t-fix i { background: var(--ink); color: var(--bg); }
.gd .t-fact i { background: var(--warn-fill); color: #201e1d; }
.gd .t-ban i { background: var(--pen-strong); color: var(--on-pen); }
[data-theme="dark"] .tag i { color: #161514; }

/* ── 원고지 본문 · 교정 표시 ──────────────────────── */
.gd .doc { position: relative; background: var(--sheet); border: 1px solid var(--line); padding: var(--sp-8) var(--sp-10) var(--sp-8) 72px;
  font: 400 var(--fs-doc)/var(--lh-doc) var(--font-doc); color: var(--ink); letter-spacing: 0.005em;
  background-image: linear-gradient(to bottom, transparent calc(100% - 1px), var(--grid) calc(100% - 1px));
  background-size: 100% calc(var(--fs-doc) * var(--lh-doc)); background-origin: content-box; background-repeat: repeat; }
.gd .doc::before { content: ""; position: absolute; top: 0; bottom: 0; left: 48px; width: 5px; border-left: 1px solid var(--margin-line); border-right: 1px solid var(--margin-line); }
.gd .doc p { margin: 0; text-indent: 1em; }
.gd .doc.sm { --fs-doc: 16px; --lh-doc: 2.1; padding: var(--sp-5) var(--sp-4) var(--sp-5) 36px; }
.gd .doc.sm::before { left: 20px; width: 4px; }

.gd .cm { text-decoration: underline; text-decoration-color: var(--pen); text-decoration-thickness: 1.5px; text-underline-offset: 6px; cursor: pointer; }
.gd .cm[data-n]::after { content: attr(data-n); font: 700 11px/0 var(--font-num); color: var(--pen-ink); vertical-align: super; margin: 0 2px 0 1px; text-decoration: none; display: inline-block; }
.gd .cm-hl { text-decoration: none; background: linear-gradient(transparent 42%, var(--hl) 42%, var(--hl) 88%, transparent 88%); }
.gd .cm-del { text-decoration: line-through; text-decoration-color: var(--pen); text-decoration-thickness: 2px; }
.gd .cm-ins { text-decoration: none; position: relative; }
.gd .cm-ins .caret { position: relative; display: inline-block; width: 0; }
.gd .cm-ins .caret::before { content: "∧"; position: absolute; left: -0.3em; top: 0.9em; font: 700 15px/1 var(--font-ui); color: var(--pen); }
.gd .cm-typo { position: relative; text-decoration: underline dotted; text-decoration-color: var(--pen); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.gd .cm-typo::before { content: attr(data-fix); position: absolute; left: 0; bottom: 1.45em; font: 600 12px/1 var(--font-ui); color: var(--pen-ink); white-space: nowrap; letter-spacing: 0; }
.gd .cm.on { background-color: var(--pen-soft); text-decoration-thickness: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.gd .cm-hl.on { background-color: transparent; }
.gd .sel { background: var(--pen-soft); box-shadow: 0 0 0 2px var(--pen-soft); }

/* ── 규칙 검사 (작성 칸 뒤 층) — 선 모양으로도 구분 ─── */
.gd .hit-ban { background: var(--pen-tint); text-decoration: underline wavy var(--pen); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.gd .hit-minus { background: var(--warn-tint); text-decoration: underline solid var(--warn); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.gd .hit-warn { text-decoration: underline dashed var(--warn); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.gd .hit-abs { background: color-mix(in srgb, var(--ink) 9%, transparent); text-decoration: underline dotted var(--ink-2); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.gd .hit-rep { text-decoration: underline double var(--q); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }

.gd .hits { display: flex; flex-wrap: wrap; gap: 6px; }
.gd .hit { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); background: var(--sheet); font-size: var(--fs-13); }
.gd .hit b { font-weight: 700; }
.gd .hit .sw { font-family: var(--font-doc); font-size: 14px; }
.gd .hit .num { color: var(--ink-2); }

/* 작성 칸: 투명 textarea(.ed-ta) + 같은 글자를 그린 뒤 층(.ed-back). 아래 5개 값은 두 층이 반드시 같아야 함 */
.gd .ed { position: relative; background: var(--sheet); border: 1.5px solid var(--rule);
  background-image: linear-gradient(to bottom, transparent calc(100% - 1px), var(--grid) calc(100% - 1px));
  background-size: 100% calc(var(--fs-ed) * var(--lh-ed)); background-origin: content-box; }
.gd .ed:focus-within { border-color: var(--ink); }
.gd .ed-back, .gd .ed-ta { margin: 0; padding: var(--sp-4); font: 400 var(--fs-ed)/var(--lh-ed) var(--font-doc); letter-spacing: 0;
  white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.gd .ed-back { color: transparent; min-height: 220px; }
.gd .ed-ta { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; color: var(--ink); caret-color: var(--pen); resize: none; overflow: hidden; }
.gd .ed-mock .ed-back { color: var(--ink); }  /* 시안 전용: 한 층으로 보여 줌 */

/* ── 글자 수 미터 ─────────────────────────────────── */
/* 막대 = 제한의 120%, 눈금 = 100%. 초과분은 빗금(색 외 구분) */
.gd .meter { display: grid; gap: 6px; }
.gd .meter-top { display: flex; align-items: baseline; gap: 6px 10px; flex-wrap: wrap; font-size: var(--fs-14); }
.gd .meter-top .n { font: 700 var(--fs-18)/1 var(--font-num); font-variant-numeric: tabular-nums; }
.gd .meter-top .lim { font: 500 var(--fs-14)/1 var(--font-num); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.gd .meter-top .st { margin-left: auto; font-weight: 600; }
.gd .mbar { position: relative; height: 8px; background: var(--surface-2); }
.gd .mbar i { position: absolute; top: 0; bottom: 0; left: 0; width: var(--p); background: var(--ink); }
.gd .mbar i.x { left: 83.333%; width: var(--x); background: repeating-linear-gradient(-45deg, var(--pen) 0 3px, var(--pen-soft) 3px 6px); }
.gd .mbar::after { content: ""; position: absolute; left: 83.333%; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.gd .meter-sub > * { white-space: nowrap; }
.gd .meter-sub { display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: var(--fs-13); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gd .meter.over .n, .gd .meter.over .st { color: var(--pen-ink); }

/* ── 숫자 카드 · 목록 · 표 ────────────────────────── */
.gd .stats { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); border-top: 2px solid var(--rule); border-bottom: 1px solid var(--line); }
.gd .stat { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-4) var(--sp-5) var(--sp-5); color: inherit; text-decoration: none; }
.gd .stat + .stat { border-left: 1px solid var(--line); }
.gd a.stat:hover { background: var(--surface); }
.gd .stat .k { font-size: var(--fs-14); color: var(--ink-2); font-weight: 500; }
.gd .stat .v { font: 700 var(--fs-36)/1 var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.gd .stat .v small { font: 500 var(--fs-15) var(--font-ui); margin-left: 3px; letter-spacing: 0; }
.gd .stat.mark .v { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
@container (max-width: 560px) { .gd .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gd .stat:nth-child(odd) { border-left: 0; } .gd .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

.gd .list { display: flex; flex-direction: column; border-top: 2px solid var(--rule); }
.gd .item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2) var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); min-height: 60px; }
.gd .item .who { font-weight: 700; }
.gd .item .meta { font-size: var(--fs-14); color: var(--ink-2); }
.gd .item.cols { grid-template-columns: 148px minmax(0, 1fr) 104px 176px 64px auto; }
.gd .item .rnd { font: 600 var(--fs-14)/1 var(--font-num); font-variant-numeric: tabular-nums; }
.gd .list-h { display: grid; gap: var(--sp-4); padding: var(--sp-2) 0; font-size: var(--fs-13); color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line); }
@container (max-width: 760px) { .gd .item.cols { grid-template-columns: minmax(0, 1fr) auto; } .gd .list-h { display: none; } }

.gd .tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.gd .tbl th { text-align: left; font: 600 var(--fs-13)/1.3 var(--font-ui); color: var(--ink-2); padding: 10px 12px; border-bottom: 2px solid var(--rule); white-space: nowrap; }
.gd .tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.gd .tbl tbody tr:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.gd .tbl .r { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
/* 휴대폰: 표 → 카드. 각 td 에 data-label, 첫 칸은 .lead */
@container (max-width: 600px) {
  .gd .tbl, .gd .tbl tbody, .gd .tbl tr, .gd .tbl td { display: block; }
  .gd .tbl thead { display: none; }
  .gd .tbl tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .gd .tbl td { padding: 0; border: 0; text-align: left !important; }
  .gd .tbl td::before { content: attr(data-label); display: block; font: 500 12px/1.4 var(--font-ui); color: var(--ink-2); }
  .gd .tbl td.lead { grid-column: 1 / -1; font-weight: 700; font-size: var(--fs-16); }
  .gd .tbl td.lead::before { display: none; }
  .gd .tbl td.act { grid-column: 1 / -1; }
}

/* ── 탭 · 세그먼트 ────────────────────────────────── */
.gd .tabs { display: flex; border-bottom: 2px solid var(--rule); }
.gd .tabs.fill { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.gd .tabs > * { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--hit); padding: 0 14px; margin-bottom: -2px;
  border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ink-2); font: 600 var(--fs-15)/1.2 var(--font-ui); cursor: pointer; text-decoration: none; white-space: nowrap; }
.gd .tabs > *:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.gd .tabs > [aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.gd .tabs .c { font: 700 12px/1 var(--font-num); font-variant-numeric: tabular-nums; min-width: 18px; height: 18px; padding: 0 4px; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.gd .tabs [aria-selected="true"] .c { background: var(--ink); color: var(--bg); }
.gd .tabs .c.pen { background: var(--pen-strong); color: var(--on-pen); }

.gd .seg { display: inline-flex; border: 1.5px solid var(--ink); }
.gd .seg > * { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 0; background: transparent; color: var(--ink); font: 600 var(--fs-14)/1 var(--font-ui); cursor: pointer; white-space: nowrap; }
.gd .seg > * + * { border-left: 1.5px solid var(--ink); }
.gd .seg > *:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.gd .seg > [aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.gd .seg .new::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }  /* ● 아직 첨삭 안 함 */

.gd .toggle { display: inline-flex; align-items: center; gap: 10px; min-height: var(--hit); cursor: pointer; font-size: var(--fs-14); font-weight: 500; background: none; border: 0; color: var(--ink); padding: 0; }
.gd .toggle .sw { width: 40px; height: 22px; border: 1.5px solid var(--ink); position: relative; flex: none; background: var(--sheet); }
.gd .toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; background: var(--ink-2); transition: left .15s; }
.gd .toggle[aria-checked="true"] .sw { background: var(--ink); }
.gd .toggle[aria-checked="true"] .sw::after { left: 20px; background: var(--bg); }

/* ── 안내 · 빈 상태 · 토스트 ──────────────────────── */
.gd .note { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 12px 14px; background: var(--surface); font-size: var(--fs-14); line-height: 1.55; }
.gd .note .ic { margin-top: 1px; }
.gd .note b { font-weight: 700; }
.gd .note.info { background: var(--q-tint); } .gd .note.info .ic { color: var(--q); }
.gd .note.warn { background: var(--warn-tint); } .gd .note.warn .ic { color: var(--warn); }
.gd .note.ok { background: var(--ok-tint); } .gd .note.ok .ic { color: var(--ok); }
.gd .note .act { grid-column: 2; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.gd .empty { display: grid; justify-items: start; gap: 10px; padding: var(--sp-8) var(--sp-6); border: 1.5px dashed var(--rule); }
.gd .empty .gridmark { width: 96px; height: 40px; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 16px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.gd .empty b { font-size: var(--fs-16); }

.gd .toast { display: inline-flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 8px 0 16px; background: var(--ink); color: var(--bg); font-size: var(--fs-14); box-shadow: var(--shadow-2); }
.gd .toast .linkbtn { color: var(--bg); }
.gd .toast.fixed { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; }

/* ── 폼 ───────────────────────────────────────────── */
.gd .form { display: grid; gap: var(--sp-5); }
.gd .field { display: grid; gap: 6px; }
.gd .field > label, .gd .label { font: 600 var(--fs-15)/1.4 var(--font-ui); color: var(--ink); }
.gd .field .opt { font-weight: 400; color: var(--ink-2); margin-left: 4px; }
.gd .field .help { font-size: var(--fs-13); color: var(--ink-2); }
.gd .input, .gd .select, .gd .textarea { width: 100%; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--rule); border-radius: 0; background: var(--sheet); color: var(--ink);
  font: 400 var(--fs-16)/1.4 var(--font-ui); display: flex; align-items: center; }
.gd .input:hover, .gd .select:hover, .gd .textarea:hover { border-color: color-mix(in srgb, var(--ink) 70%, transparent); }
.gd .input:focus-visible, .gd .select:focus-visible, .gd .textarea:focus-visible, .gd .input.is-focus { border-color: var(--ink); outline: 2px solid var(--focus); outline-offset: 1px; }
.gd .input::placeholder, .gd .ph { color: var(--ink-2); }
.gd .input[aria-invalid="true"] { border-color: var(--pen-strong); }
.gd .input:disabled, .gd .input.is-disabled { opacity: .5; background: var(--surface); cursor: not-allowed; }
.gd .select { appearance: none; padding-right: 40px; justify-content: space-between;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2357534f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.gd .textarea { min-height: 120px; padding: 12px 14px; align-items: flex-start; resize: vertical; }
.gd .err { display: flex; align-items: center; gap: 6px; font-size: var(--fs-13); color: var(--pen-ink); font-weight: 500; }
.gd .check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; min-height: var(--hit); padding: 10px 0; font-size: var(--fs-15); cursor: pointer; }
.gd .check input, .gd .check .box { appearance: none; width: 22px; height: 22px; margin: 1px 0 0; border: 1.5px solid var(--ink); background: var(--sheet); display: grid; place-items: center; }
.gd .check input:checked, .gd .check .box.on { background: var(--ink); }
.gd .check input:checked::after, .gd .check .box.on::after { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--bg); border-bottom: 2px solid var(--bg); transform: rotate(-45deg) translate(1px, -1px); }
.gd .check .req { font-weight: 700; }
/* 선택지 버튼 (분야·진행 정도·연락 방법) */
.gd .choice { display: flex; flex-wrap: wrap; gap: 6px; }
.gd .choice.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gd .choice.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gd .choice > * { display: inline-flex; align-items: center; min-height: var(--hit); padding: 0 14px; border: 1.5px solid var(--rule); background: var(--sheet); color: var(--ink); font: 500 var(--fs-15)/1.2 var(--font-ui); cursor: pointer; }
.gd .choice > *:hover { border-color: var(--ink); }
.gd .choice > [aria-checked="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); font-weight: 600; }

/* ── 첨삭 화면 ────────────────────────────────────── */
.gd .review { display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }
.gd .review-main { padding: var(--sp-6) var(--sp-10) var(--sp-16); border-right: 2px solid var(--rule); min-width: 0; display: flex; flex-direction: column; gap: var(--sp-5); }
.gd .sticky { position: sticky; top: 0; max-height: 100vh; overflow: auto; display: flex; flex-direction: column; background: var(--bg); }
@container (max-width: 1100px) { .gd .review { grid-template-columns: minmax(0, 1fr) 340px; } .gd .review-main { padding-inline: var(--sp-6); } }
.gd .rv-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-3) var(--sp-6); align-items: end; padding: var(--sp-4) var(--sp-10) var(--sp-5); border-bottom: 2px solid var(--rule); }
.gd .facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: var(--fs-14); }
.gd .facts > span { display: inline-flex; align-items: center; gap: 8px; }
.gd .facts .k { color: var(--ink-2); }

/* 오른쪽 열 — "지금 할 일" 줄 → 작성기(선택 시) → 탭 */
.gd .now { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 2px solid var(--rule); }
.gd .now > * { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: none; border: 0; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.gd .now > * + * { border-left: 1px solid var(--line); }
.gd .now > *:hover { background: var(--surface); }
.gd .now .v { font: 700 22px/1 var(--font-num); font-variant-numeric: tabular-nums; }
.gd .now .k { font-size: 13px; color: var(--ink-2); }
.gd .now .todo .v { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.gd .compose { padding: var(--sp-4); background: var(--sheet); border-bottom: 2px solid var(--pen); display: flex; flex-direction: column; gap: var(--sp-3); }
.gd .opts5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); }
.gd .opts5 > * { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; padding: 6px 2px; background: none; border: 0; font: 500 12px/1.2 var(--font-ui); color: var(--ink); cursor: pointer; }
.gd .opts5 > * + * { border-left: 1px solid var(--line); }
.gd .opts5 > *:hover { background: var(--surface); }
.gd .opts5 > [aria-checked="true"] { background: var(--ink); color: var(--bg); font-weight: 700; }
.gd .opts5 .smp { font: 500 15px/1 var(--font-doc); }
.gd .cmt { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px 12px; padding: var(--sp-4); border-bottom: 1px solid var(--line); }
.gd .cmt.on { background: var(--sheet); box-shadow: inset 3px 0 0 var(--pen); }
.gd .cmt .no { width: 26px; height: 26px; display: grid; place-items: center; border: 1.5px solid var(--pen); color: var(--pen-ink); font: 700 13px/1 var(--font-num); }
.gd .cmt .body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gd .cmt .say { color: var(--pen-ink); font-size: var(--fs-15); line-height: 1.6; }  /* 선생님 글씨 = 빨간 펜 */
.gd .quote { font: 400 var(--fs-14)/1.6 var(--font-doc); color: var(--ink-2); padding-left: 10px; border-left: 2px solid var(--line); }
.gd .resp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-13); }
.gd .resp .r { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.gd .r-done { color: var(--ok); } .gd .r-done::before { content: "✓"; }
.gd .r-q { color: var(--q); } .gd .r-q::before { content: "?"; }
.gd .r-no { color: var(--ink-2); } .gd .r-no::before { content: "—"; }
.gd .r-none { color: var(--ink-2); font-weight: 500 !important; } .gd .r-none::before { content: "○"; }
.gd .ask { background: var(--q-tint); padding: 10px 12px; font-size: var(--fs-14); display: grid; gap: 4px; }

/* 버전 비교 — 지운 것 = 취소선+[−], 더한 것 = 밑줄+[+] */
.gd .diff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); background: var(--sheet); }
.gd .diff > * { padding: var(--sp-5) var(--sp-6); font: 400 17px/2 var(--font-doc); }
.gd .diff > * + * { border-left: 2px solid var(--rule); }
.gd .diff h4 { font: 600 var(--fs-13)/1 var(--font-ui); color: var(--ink-2); margin-bottom: 10px; }
.gd .diff del { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--ink); background: color-mix(in srgb, var(--ink) 10%, transparent); }
.gd .diff ins { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; background: var(--ok-tint); }
.gd .diff del::before { content: "−"; font: 700 11px/0 var(--font-num); vertical-align: super; margin-right: 1px; }
.gd .diff ins::before { content: "+"; font: 700 11px/0 var(--font-num); vertical-align: super; margin-right: 1px; }
@container (max-width: 600px) { .gd .diff { grid-template-columns: minmax(0, 1fr); } .gd .diff > * + * { border-left: 0; border-top: 2px solid var(--rule); } }

/* ── 보호자 여정 ────────────────────────────────────── */
.gd .journey { display: grid; gap: 12px; }
.gd .jbar { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; }
.gd .jbar i { height: 12px; background: var(--surface-2); }
.gd .jbar i.done { background: var(--ink); }
.gd .jbar i.now { background: repeating-linear-gradient(-45deg, var(--ink) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1.5px var(--ink); }
.gd .jnow { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gd .jnow .step { font: 700 var(--fs-14)/1 var(--font-num); color: var(--ink-2); }
.gd .jlist { list-style: none; margin: 0; padding: 0; display: grid; }
.gd .jlist li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 40px; border-bottom: 1px solid var(--line); font-size: var(--fs-15); }
.gd .jlist li .m { width: 20px; height: 20px; display: grid; place-items: center; border: 1.5px solid var(--line); font: 700 11px/1 var(--font-num); color: var(--ink-2); }
.gd .jlist li.done .m { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.gd .jlist li.now { font-weight: 700; }
.gd .jlist li.now .m { border-color: var(--ink); color: var(--ink); background: repeating-linear-gradient(-45deg, var(--surface-2) 0 2px, transparent 2px 5px); }
.gd .jlist li.todo { color: var(--ink-2); }

/* ── 칸반 ─────────────────────────────────────────── */
.gd .kan { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 0; border-top: 2px solid var(--rule); }
.gd .kcol { display: flex; flex-direction: column; gap: 8px; padding: 12px; min-height: 360px; }
.gd .kcol + .kcol { border-left: 1px solid var(--line); }
.gd .kcard { background: var(--sheet); border: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; }

/* ── 로그인 전 · 공통 ─────────────────────────────── */
.gd .hero { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-8) var(--sp-5) var(--sp-6); border-bottom: 2px solid var(--rule); }
.gd .auth { max-width: 420px; display: flex; flex-direction: column; gap: var(--sp-5); }
.gd .foot { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: var(--sp-5) var(--sp-5) var(--sp-8); border-top: 1px solid var(--line); font-size: var(--fs-13); color: var(--ink-2); }
.gd .foot a { color: var(--ink-2); }
.gd .dock { position: sticky; bottom: 0; display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-4) calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 2px solid var(--rule); z-index: 5; }
.gd details > summary { list-style: none; cursor: pointer; }
.gd details > summary::-webkit-details-marker { display: none; }
.gd .sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: var(--hit); font-weight: 600; }
.gd details[open] > .sum .ic { transform: rotate(180deg); }


/* ── 다크 자동 전환 (기기 설정 따름) ─────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]), :root:not([data-theme="light"]) .gd {
    --bg: #161514; --sheet: #1e1c1b; --surface: #262423; --surface-2: #34312f;
    --ink: #efebe9; --ink-2: #b8b2ae;
    --rule: color-mix(in srgb, #efebe9 36%, transparent);
    --line: #3a3634; --grid: #2b2826; --margin-line: #4a2a24;
    --pen: #ff6a50; --pen-ink: #ff9a85; --pen-strong: #ff6a50; --on-pen: #1a0905;
    --pen-tint: #35191393; --pen-soft: #4d231a;
    --ok: #86d2a8; --ok-tint: #16301f;
    --warn: #f2b866; --warn-fill: #d9952f; --warn-tint: #33260f;
    --q: #a3b8f2; --q-tint: #1a2440; --hl: #5a4812; --focus: #efebe9;
    --shadow-2: 0 0 0 1px #3a3634, 0 12px 32px #0009;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .tag i { color: #161514; }
}

/* ── 앱 연결: 바탕 · 글자 ───────────────────────────── */
html, body { margin: 0; }
body.gd { min-height: 100vh; }
[hidden] { display: none !important; }
.gd img { max-width: 100%; }
.gd h1 { font: 700 var(--fs-28)/1.3 var(--font-ui); letter-spacing: -0.02em; text-wrap: balance; }
.gd h2 { font: 700 var(--fs-22)/1.35 var(--font-ui); letter-spacing: -0.015em; }
.gd h3 { font: 600 var(--fs-18)/1.4 var(--font-ui); }
.gd h4 { font: 600 var(--fs-13)/1.4 var(--font-ui); color: var(--ink-2); letter-spacing: 0.02em; }
.gd .muted { color: var(--ink-2); }
.gd .small { font-size: var(--fs-14); }
.gd button, .gd input, .gd select, .gd textarea { font: inherit; color: inherit; }
.gd mark { background: none; color: inherit; }
.gd .code { font: 700 var(--fs-16)/1 var(--font-num); letter-spacing: .12em; padding: 6px 10px; border: 1.5px dashed var(--rule); background: var(--sheet); }

/* 화면 틀 */
.gd main.wrap { container-type: inline-size; display: flex; flex-direction: column; gap: var(--sp-6); padding-top: var(--sp-8); padding-bottom: var(--sp-16);
  padding-left: max(var(--sp-4), env(safe-area-inset-left, 0px)); padding-right: max(var(--sp-4), env(safe-area-inset-right, 0px)); }
@media (min-width: 700px) { .gd main.wrap { padding-left: var(--sp-6); padding-right: var(--sp-6); } }
.gd .tlayout { max-width: 1440px; margin: 0 auto; min-height: 100vh; }
.gd .tlayout > .wrap { max-width: none; margin: 0; padding: var(--sp-8) var(--sp-10) var(--sp-16); }
.gd .grid2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.gd .grid3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* 카드는 최소로 — 2px 구획선 아래에 내용이 바로 놓여요 */
.gd .card { border-top: 2px solid var(--rule); padding-top: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.gd .card.auth { margin: 0 auto; width: 100%; }

/* 상단 띠 (학생·보호자·로그인 전) */
.gd .top { position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top, 0px); }
.gd .top-in { width: 100%; max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: var(--sp-4); min-height: 56px; }
.gd .top nav button { display: inline-flex; align-items: center; min-height: var(--hit); padding: 0 10px; font-size: var(--fs-15); font-weight: 500; color: var(--ink-2); position: relative; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.gd .top nav button[aria-current="page"] { color: var(--ink); font-weight: 700; }
.gd .top nav button[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 2px; background: var(--ink); }
.gd .top nav button .dot { width: 6px; height: 6px; background: var(--ink); margin-left: 4px; align-self: flex-start; margin-top: 12px; }
.gd button.brand { background: none; border: 0; padding: 0; cursor: pointer; }

/* 선생님 사이드바 */
.gd .side { position: sticky; top: 0; align-self: start; height: 100vh; overflow: auto; }
.gd .side button.nav { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 var(--sp-5); font-size: var(--fs-15); color: var(--ink); background: none; border: 0; text-align: left; cursor: pointer; position: relative; }
.gd .side button.nav:hover { background: var(--surface); }
.gd .side button.nav[aria-current="page"] { background: var(--surface); font-weight: 700; }
.gd .side button.nav[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ink); }
.gd .side button.nav .cnt { margin-left: auto; font: 700 13px/1 var(--font-num); font-variant-numeric: tabular-nums; min-width: 24px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border: 1.5px solid var(--ink); }
.gd .side button.nav .cnt.hot { background: var(--ink); color: var(--bg); }
.gd .side-foot { display: flex; flex-direction: column; gap: 2px; }
.gd .side-foot b { color: var(--ink); font-size: var(--fs-14); }
@media (max-width: 860px) {
  .gd .tlayout { grid-template-columns: minmax(0, 1fr); }
  .gd .tlayout > .wrap { padding: var(--sp-6) var(--sp-4) var(--sp-16); }
  .gd .side { position: sticky; height: auto; flex-direction: row; align-items: center; gap: 0; padding: 0 var(--sp-2); border-right: 0; border-bottom: 2px solid var(--rule); overflow-x: auto; scrollbar-width: none; z-index: 10; }
  .gd .side .brand { padding: 0 var(--sp-3); }
  .gd .side-g { flex-direction: row; }
  .gd .side-g > b { display: none; }
  .gd .side button.nav { width: auto; white-space: nowrap; padding: 0 12px; min-height: 52px; }
  .gd .side button.nav[aria-current="page"]::before { top: auto; width: auto; height: 3px; right: 0; }
  .gd .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; gap: 10px; white-space: nowrap; padding: 0 12px; }
  .gd .side-foot b { display: none; }
}

/* 하단 */
.gd .foot { max-width: 1120px; margin: 0 auto; width: 100%; }
.gd .foot .linkbtn, .gd .foot a { color: var(--ink-2); font-size: var(--fs-13); min-height: 0; }

/* 버튼 상태: 화면 전체 대신 누른 버튼만 */
body.busy { cursor: progress; }
body.busy .btn { pointer-events: none; }

/* 탭 · 세그먼트: .on 도 같은 모양 */
.gd .tabs { overflow-x: auto; scrollbar-width: none; }
.gd .tabs > .on { color: var(--ink); border-bottom-color: var(--ink); }
.gd .seg { flex-wrap: wrap; }
.gd .seg > .on { background: var(--ink); color: var(--bg); }

/* 숫자 카드: 지금 마크업(span.small + b) */
.gd .stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.gd .stat { background: none; border: 0; }
.gd .stat > .small, .gd .stat > span.muted { font-size: var(--fs-14); color: var(--ink-2); font-weight: 500; }
.gd .stat > b { font: 700 var(--fs-36)/1 var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.gd .stat.alert > b { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.gd .stat + .stat { border-left: 1px solid var(--line); }

/* 목록 줄: 버튼이 여러 개여도 한 줄로 */
.gd .item { display: flex; flex-wrap: wrap; justify-content: space-between; }
.gd .item .t { flex: 1 1 220px; min-width: 0; display: block; }
.gd .item .t > .row, .gd .item .t > div { margin-top: 4px; }
.gd .list > .item:first-child { border-top: 0; }
.gd p.empty, .gd td.empty, .gd span.empty { display: block; border: 0; padding: var(--sp-3) 0; color: var(--ink-2); font-size: var(--fs-14); }

/* 안내 박스: 아이콘이 없으면 한 칸 */
.gd .note { display: block; }
.gd .note:has(> .ic) { display: grid; }
.gd .note.pen { background: var(--pen-tint); color: var(--pen-ink); }

/* 토스트 */
.gd #toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50;
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; background: var(--ink); color: var(--bg); font-size: var(--fs-14); box-shadow: var(--shadow-2); max-width: calc(100% - 32px); }

/* 폼: 맨 input · select · textarea 도 같은 모양 */
.gd .form { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--sp-4) var(--sp-5); }
.gd .form .full { grid-column: 1 / -1; }
.gd label { display: flex; flex-direction: column; gap: 6px; font: 600 var(--fs-15)/1.4 var(--font-ui); color: var(--ink); }
.gd label.inline { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; min-height: var(--hit); padding: 10px 0; cursor: pointer; }
.gd label.inline.small { font-size: var(--fs-14); min-height: 0; padding: 4px 0; align-items: center; }
.gd input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .gd select, .gd textarea:not(.ed-ta) {
  width: 100%; min-width: 0; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--rule); border-radius: 0; background: var(--sheet); color: var(--ink); font: 400 var(--fs-16)/1.4 var(--font-ui); }
.gd textarea:not(.ed-ta) { padding: 12px 14px; min-height: 96px; resize: vertical; }
.gd input:hover, .gd select:hover, .gd textarea:not(.ed-ta):hover { border-color: color-mix(in srgb, var(--ink) 70%, transparent); }
.gd input:focus-visible, .gd select:focus-visible, .gd textarea:not(.ed-ta):focus-visible { border-color: var(--ink); outline: 2px solid var(--focus); outline-offset: 1px; }
.gd input::placeholder, .gd textarea::placeholder { color: var(--ink-2); }
.gd select { appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2357534f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.gd input[type="checkbox"] { appearance: none; flex: none; width: 22px; height: 22px; margin: 1px 0 0; border: 1.5px solid var(--ink); background: var(--sheet); display: inline-grid; place-items: center; cursor: pointer; }
.gd input[type="checkbox"]:checked { background: var(--ink); }
.gd input[type="checkbox"]:checked::after { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--bg); border-bottom: 2px solid var(--bg); transform: rotate(-45deg) translate(1px, -1px); }
.gd label.inline.small input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
.gd .period select { width: auto; font: 600 var(--fs-15)/1 var(--font-num); }
.gd .row > input, .gd .row > select { width: auto; flex: 1 1 160px; }

/* 코멘트 작성기 */
.gd #composer { padding: var(--sp-4); background: var(--sheet); border-top: 0; border-bottom: 2px solid var(--pen); }
.gd .radios { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); }
.gd .radios label { flex: 1 1 auto; flex-direction: row; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 10px; font: 500 var(--fs-13)/1.2 var(--font-ui); cursor: pointer; border-right: 1px solid var(--line); }
.gd .radios label:last-child { border-right: 0; }
.gd .radios label:hover { background: var(--surface); }
.gd .radios label:has(input:checked) { background: var(--ink); color: var(--bg); font-weight: 700; }
.gd .radios label.tag { height: auto; padding: 6px 10px 6px 6px; background: none; }
.gd .radios label.tag:has(input:checked) { background: var(--ink); color: var(--bg); }
.gd .radios input { position: absolute; opacity: 0; pointer-events: none; }
.gd .tplres { display: flex; flex-direction: column; max-height: 200px; overflow: auto; border-top: 1px solid var(--line); }
.gd .tplres button { text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 4px; cursor: pointer; font-size: var(--fs-14); color: var(--ink); }
.gd .tplres button:hover { background: var(--surface); }

/* 첨삭 화면 2단 */
.gd .review { gap: 0; grid-template-columns: minmax(0, 1fr) 400px; }
.gd .review > :first-child { padding-right: var(--sp-8); border-right: 2px solid var(--rule); min-width: 0; }
.gd .review > .sticky { padding-left: var(--sp-6); gap: var(--sp-6); background: none; }
@container (max-width: 1000px) { .gd .review { grid-template-columns: minmax(0, 1fr) 340px; } .gd .review > :first-child { padding-right: var(--sp-5); } .gd .review > .sticky { padding-left: var(--sp-5); } }
@container (max-width: 820px) { .gd .review { grid-template-columns: minmax(0, 1fr); gap: var(--sp-8); } .gd .review > :first-child { padding-right: 0; border-right: 0; } .gd .review > .sticky { position: static; max-height: none; padding-left: 0; } }
.gd .cmt { cursor: pointer; }
.gd .cmt .say { margin: 0; }
.gd .cmt form.row input { min-height: 40px; }
.gd .carousel-nav { display: flex; gap: var(--sp-2); align-items: center; justify-content: space-between; }

/* 원고: 학생 글 줄바꿈 그대로 */
.gd .doc { white-space: pre-wrap; min-height: 120px; }
@container (max-width: 600px) { .gd .doc { --fs-doc: 16px; --lh-doc: 2.1; padding: var(--sp-5) var(--sp-4) var(--sp-5) 36px; } .gd .doc::before { left: 20px; width: 4px; } }
.gd .diff > * { white-space: pre-wrap; min-width: 0; }

/* 작성 칸: 뒤 층은 겹쳐 두고 textarea 높이를 글에 맞춰요 (autosize) */
.gd .ed-back { position: absolute; inset: 0; min-height: 0; pointer-events: none; overflow: hidden; }
.gd .ed-ta { position: relative; inset: auto; display: block; height: auto; min-height: 220px; outline: none; }
.gd .ed-ta[readonly] { color: var(--ink-2); }
.gd .ed-back mark { color: transparent; }

/* 최종 점검표 */
.gd .chk { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.gd .chk li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.gd .chk .mk { width: 22px; height: 22px; flex: none; display: grid; place-items: center; font: 700 13px/1 var(--font-num); }
.gd .chk .y { background: var(--ink); color: var(--bg); }
.gd .chk .n { border: 1.5px solid var(--pen); color: var(--pen-ink); }
.gd .chk label.inline { padding: 0; min-height: 0; }

/* 칸반은 휴대폰에서 옆으로 */
.gd .kan { overflow-x: auto; }
.gd .kcol > .row:first-child { padding-bottom: 6px; border-bottom: 1px solid var(--line); }

/* 로그인 전 첫 화면 */
.gd .hero { padding: var(--sp-6) 0 var(--sp-6); }
.gd .hero h1 { font-size: clamp(30px, 6vw, 44px); letter-spacing: -0.03em; }
.gd .hero h1 i { font-style: normal; color: var(--pen-ink); text-decoration: line-through 3px var(--pen); }

/* 처리방침 · 약관 */
.gd .legal { max-width: 760px; margin: 0 auto; width: 100%; gap: var(--sp-4); line-height: 1.75; }
.gd .legal h3 { margin-top: var(--sp-5); }
.gd .legal ul { padding-left: 20px; margin: 0; }
.gd .legal li { margin: 4px 0; }

@media (prefers-reduced-motion: reduce) { .gd * { transition: none !important; animation: none !important; } }

/* 다듬기 */
.gd .brand { white-space: nowrap; flex: none; }
.gd .stats { overflow: hidden; }
.gd .stat, .gd .stat + .stat { border-left: 1px solid var(--line); margin-left: -1px; border-bottom: 1px solid var(--line); margin-bottom: -1px; }
.gd .hero { border-bottom: 0; }
.gd .period { flex-wrap: nowrap; }
.gd .period select { flex: 0 0 auto; min-width: 120px; }
