/* 자소서 경로 — 「첨삭지」 한 장. 스크롤 없이 한 화면(390×844·1440×900 실측은 tests/jasoseo_e2e.mjs). 2026-10-20 리뉴얼(docs/RENEWAL_2026-10-20.md).
   얼굴: 붙여넣은 답변이 문장 한 줄씩 놓이고, 경험이 빠진 문장에만 여백 질문이 붙는다. 질문·라벨·표제는 부리(SG Buri = 첨삭하는 사람의 손),
         답변 문장은 **시스템 고딕**(붙여넣은 글 — 본 페이지 기계 쪽 칸과 같은 규칙). 짚은 자리는 굵기 700 하나로만 표시한다(왼쪽 색 괘 폐지 — §2 side-tab).
   위 가느다란 띠는 답변 전체의 지도 — 한 칸이 한 문장, 칸 폭이 문장 길이, 질문이 달린 칸만 칠한다.
   색·활자·이중 괘선은 본 페이지(../styles.css)와 같은 제품이라 같은 값을 쓴다. 토큰 값이 갈라지면 tests/jasoseo.mjs 가 EXIT 1. */

@font-face { font-family: "SG Buri"; src: url(../fonts/SGBuri-Regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "SG Buri"; src: url(../fonts/SGBuri-Light.woff2) format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }

:root {
  --paper: #ffe7f0;
  --paper-raised: #ffecf3;
  --ink: #1b1e24;
  --ink-soft: #565d69;
  --rule: #f0ccda;
  --pencil: #d40037;
  --pencil-mark: #e5004a;
  --pencil-soft: #ffc9dc;
  --serif: "SG Buri", "AppleMyungjo", "Nanum Myeongjo", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191319;
    --paper-raised: #221b23;
    --ink: #f0e7ec;
    --ink-soft: #ac9fa8;
    --rule: #3d323b;
    --pencil: #f77e9c;
    --pencil-mark: #ff6d90;
    --pencil-soft: #4a1f30;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 16px; line-height: 1.56; font-weight: 400;
  word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--pencil-soft); color: var(--ink); }
a { color: var(--ink-soft); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--pencil); outline-offset: 2px; }

/* ── 한 화면 뼈대: 머리 · 입력 · 첨삭지 · 발치. 첨삭지만 늘고 줄며, 넘치는 문장은 그 칸 안에서만 흐른다. ── */
.page {
  height: 100vh; height: 100svh;
  padding: 0 20px;
  display: grid; row-gap: 10px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "head" "input" "marked" "foot";
}

.head { grid-area: head; }
h1 { margin: 18px 0 4px; font-size: 28px; line-height: 1.2; font-weight: 300; letter-spacing: 0; }
.line { margin: 0; color: var(--ink-soft); }

.input { grid-area: input; display: flex; flex-direction: column; min-height: 0; }
.input label { color: var(--ink-soft); margin-bottom: 4px; }
.input textarea {
  display: block; width: 100%; height: 72px; resize: none;
  background: var(--paper-raised); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 0; padding: 8px 12px;
  font: 400 16px/1.56 var(--sans);
}
.input textarea::placeholder { color: var(--ink-soft); opacity: 1; }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.acts button {
  min-height: 44px; padding: 8px 16px; border-radius: 0; cursor: pointer;
  font: 400 16px/1.56 var(--serif); word-break: keep-all;
}
.run { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.back { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.count { margin-left: auto; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.count.over { color: var(--pencil); }

.marked {
  grid-area: marked; display: flex; flex-direction: column; min-height: 0;
  border-top: 3px double var(--ink); padding-top: 8px;
}
.which { margin: 0; color: var(--ink-soft); }
.sum { margin: 2px 0 8px; }
.strip { display: flex; gap: 2px; height: 8px; margin-bottom: 6px; }
.seg { display: block; background: var(--rule); }
.seg.f { background: var(--pencil); }

.sheet {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
  list-style: none; margin: 0; padding: 0;
}
/* 짚힌 줄과 안 짚힌 줄의 글줄 시작 x 는 같다 — 표시는 굵은 글자와 그 밑 질문뿐(색 괘·들여쓰기 0). */
.row { display: grid; grid-template-columns: minmax(0, 1fr); padding: 8px 0; border-bottom: 1px solid var(--rule); }
.sent { margin: 0; font-family: var(--sans); }
.hit { font-weight: 700; color: var(--pencil); font-family: var(--sans); }
.ask { margin: 4px 0 0; color: var(--pencil); }
.ask .q { display: block; }
.ask .blank { display: block; color: var(--ink-soft); overflow-wrap: normal; }   /* 빈칸 틀은 줄 끝에서 쪼개지지 않게 제 줄에 둔다 */

.foot {
  grid-area: foot; position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--rule); padding-bottom: 4px;
}
.foot a, .limits summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-soft); }
.limits summary { cursor: pointer; list-style: none; text-decoration: underline; text-underline-offset: 3px; }
.limits summary::-webkit-details-marker { display: none; }
/* 펼쳐도 문서 높이가 늘지 않게 발치 위로 띄운다(한 화면 원칙 — 펼친 상태도 e2e 가 잰다). */
.limits .pop {
  position: absolute; right: 0; bottom: 100%; z-index: 1;
  width: min(30rem, calc(100vw - 40px));
  background: var(--paper-raised); border: 1px solid var(--ink); padding: 12px 14px 4px;
}
.limits .pop p { margin: 0 0 8px; }

@media (min-width: 900px) {
  .page {
    padding: 0 32px; column-gap: 0; row-gap: 14px;
    grid-template-columns: 22rem minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "head head" "input marked" "foot foot";
  }
  h1 { margin-top: 24px; font-size: 38px; line-height: 1.15; }
  .sum { font-size: 21px; line-height: 1.3; }
  .input { padding-right: 32px; }
  .input textarea { flex: 0 1 auto; height: 18rem; min-height: 0; }   /* 2026-10-20 독립 판정 ④: 빈 칸이 650px 로 늘어나던 것을 문항 하나 분량(18rem)으로 */
  .marked { border-top: 0; padding-top: 0; border-left: 3px double var(--ink); padding-left: 32px; }
  .row { grid-template-columns: minmax(0, 1fr) 19rem; column-gap: 28px; padding: 14px 0; }
  .sum { margin-bottom: 12px; }
  .strip { margin-bottom: 12px; }
  .ask { margin: 0; }
}

/* 높이가 낮은 화면(가로로 든 폰 844×390 · 320×568)에서는 한 화면에 가두면 첨삭지가 0~72px 로 짓눌려 결과가 사라진다(공방 R3-1).
   이때만 문서가 자연히 길어지게 둔다 — 결과가 보이는 것이 스크롤 0 보다 먼저다. 390×844·1440×900 은 이 규칙 밖이라 한 화면 그대로(2026-10-20: 표제가 부리 Light 로 커져 경계를 600→700 으로). */
@media (max-height: 700px) {
  .page { height: auto; min-height: 100vh; min-height: 100svh; }
  .sheet { flex: none; overflow: visible; }
  .input textarea { min-height: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .page { height: auto; display: block; }
  .input, .foot, .strip { display: none; }
  .sheet { overflow: visible; }
  body { background: #fff; color: #000; }
}
