/* 본문 글꼴: 본고딕(Noto Sans KR) 가변 400~700. 우리 서버에서 직접 제공(Google Fonts 요청 없음). 한글 2,350자+자모+영문·기호 서브셋 */
@font-face {
  font-family: "Noto Sans KR";
  src: url("/webfonts/NotoSansKR-VF.v1.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
/* 부모님 화면·소개 페이지 큰 제목: 마루 부리 */
@font-face {
  font-family: "MaruBuri";
  src: url("/webfonts/MaruBuri-Bold.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Dunggeunmiso";
  src: url("/webfonts/HakgyoansimDunggeunmiso-B.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* 아이 화면: 제목·버튼·숫자 모두 학교안심 둥근미소 */
  --font-display: "Dunggeunmiso", "Noto Sans KR", sans-serif;
  --font-title: var(--font-display);
  --font-number: var(--font-display);
  --display-weight: 400;
  --bg: #fff8ec;
  --card: #ffffff;
  --ink: #2a2733;
  --muted: #66616e;          /* 보조 글자: 밝은 바탕 모두에서 4.5:1 이상 (#fde6e4 위 5.0) */
  --line: #efe4d2;
  --primary: #ff7a3d;
  --primary-ink: #ffffff;
  --primary-text: #b04314;   /* 주황 글자용 (주황 바탕·연한 주황 위 4.8:1 이상). 면·선은 --primary 그대로 */
  --primary-soft: #ffe9dc;
  --good: #1fa971;
  --good-soft: #dff5ea;
  --good-text: #147a52;      /* 초록 숫자·글자용 (#dff5ea 위 4.7:1) */
  --bad: #e5534b;
  --bad-soft: #fde6e4;
  --bad-text: #b8332b;       /* 오류 글자용 (#fde6e4 위 5.0:1) */
  --sun: #ffc93c;
  /* 주 버튼(의뢰인 결정 2026-11-11): 잉크색 바탕 + 흰 글자 + 주황 그림자 */
  --btn-bg: var(--ink);
  --btn-ink: #ffffff;
  --btn-shadow: var(--primary);
  --memo-edge: #d6d1c4;      /* 알림장 쪽지·구분 점선 (장식 선, 대비 기준 밖) */
  --radius: 20px;
  --shadow: 0 6px 0 rgba(42, 39, 51, 0.08);
}

/* 부모님이 보는 화면: 수치와 안내를 차분하게 */
/* 부모님 화면: 큰 제목은 마루 부리, 버튼·숫자는 본고딕 굵게 */
.calm { --font-title: "MaruBuri", "Noto Sans KR", serif; --font-display: "Noto Sans KR", sans-serif; --font-number: "Noto Sans KR", sans-serif; --display-weight: 700; }
/* 소개 페이지: 큰 제목만 마루 부리, 나머지는 아이 화면과 같게 */
.brand { --font-title: "MaruBuri", "Noto Sans KR", serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
h1, h2, h3, .display { font-family: var(--font-display); font-weight: var(--display-weight); line-height: 1.3; margin: 0; }
h1, h2 { font-family: var(--font-title); }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }

.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; min-height: 100dvh; }
.wrap.wide { max-width: 760px; }

.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
/* 로고: 그림(마크 + 손글씨 윤곽선) 한 장. 글꼴 파일을 쓰지 않는다(온글잎 글꼴 파일 수정 조항). 대체 글은 img alt */
.logo { line-height: 1; display: flex; align-items: center; }
.logo-img { display: block; height: 40px; width: auto; }
.chip { background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 700; }
/* 따로 떨어진 링크(머리 칩, 로고, '소개 보기'·'리포트 보기' 같은 한 줄 링크)는 누르는 높이 44px */
a.chip, a.logo, a.muted { display: inline-flex; align-items: center; min-height: 44px; }

.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--muted); font-size: 15px; }
.center { text-align: center; }

.btn {
  display: block; width: 100%; border: 0; border-radius: 16px; padding: 16px 18px;
  background: var(--btn-bg); color: var(--btn-ink); font-family: var(--font-display); font-weight: var(--display-weight); font-size: 20px;
  box-shadow: 4px 4px 0 var(--btn-shadow); transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--btn-shadow); }
.btn:disabled { background: #e3dccf; color: #605a4e; box-shadow: 4px 4px 0 #cfc7b8; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; font-family: inherit; font-size: 15px; padding: 10px; text-decoration: underline; }
.btn:focus-visible, .opt:focus-visible, .pick:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.field { display: block; font-weight: 700; margin-bottom: 8px; }
input[type="text"], textarea {
  width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 14px; font: inherit; color: inherit; background: #fffdf8;
}
textarea { min-height: 170px; resize: vertical; line-height: 1.8; }

.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { border: 2px solid var(--line); background: #fffdf8; border-radius: 999px; padding: 8px 16px; font-weight: 500; }
.pick[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); font-weight: 700; }
/* 등록 화면 학년: 1·2학년이 열려 있을 때만 두 묶음(1·2 / 3~6). 닫혀 있으면 위 .picks 한 줄 그대로 */
.picks.grade-groups { display: grid; gap: 12px; }
.grade-group-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.grade-group-note { display: block; font-weight: 400; color: var(--muted); font-size: 14px; line-height: 1.5; }
.grade-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 360px) { .grade-row.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grade-row .pick { white-space: nowrap; min-height: 48px; padding-inline: 4px; }
.grade-group .consent { margin-top: 8px; }

.consent { position: relative; display: flex; gap: 10px; align-items: flex-start; min-height: 48px; background: #fffdf8; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.6; }
.consent[hidden] { display: none; } /* 1학년 보호자 확인: 1학년을 고를 때만 보인다 */
.consent input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--primary); }
.consent a, .consent input { color: var(--ink); position: relative; z-index: 1; }
/* 22px 체크박스 대신 상자 전체(44px 이상)를 눌러도 체크되게: 라벨의 누르는 영역을 상자 크기로 넓힌다 */
.consent label { cursor: pointer; }
.consent label::after { content: ""; position: absolute; inset: -2px; }
.consent:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn.danger { background: transparent; color: var(--bad-text); box-shadow: none; border: 2px solid var(--bad-soft); font-family: inherit; font-size: 15px; padding: 12px; }

/* 홈 */
.hero { text-align: center; }
.hero h1 { font-size: 30px; }
.streak { font-family: var(--font-number); font-weight: var(--display-weight); font-size: 56px; line-height: 1; color: var(--primary-text); }
.week { display: flex; justify-content: space-between; gap: 6px; }
.day { flex: 1; text-align: center; font-size: 13px; color: var(--muted); }
.dot { width: 100%; aspect-ratio: 1; max-width: 44px; margin: 0 auto 4px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; font-size: 18px; }
.day.done .dot { background: var(--sun); border: 2px solid #f0b400; color: #6e4700; }
.day.today { color: var(--ink); font-weight: 700; }
.day.today .dot { border-color: var(--primary); }

/* 진행 표시 */
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps span { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--primary); }
.step-label { font-size: 14px; font-weight: 700; color: var(--primary-text); margin-bottom: 6px; }

/* 읽기 */
.passage h2 { font-size: 26px; margin-bottom: 14px; }
.passage p { font-size: 18px; line-height: 1.95; }
.passage p + p { margin-top: 14px; }
.vocab { background: #fff4d6; border-radius: 14px; padding: 14px 16px; font-size: 15px; }
.vocab b { font-weight: 700; }
.vocab li + li { margin-top: 4px; }
.vocab ul { margin: 6px 0 0; padding-left: 18px; }

/* 퀴즈 */
.q { font-size: 19px; font-weight: 700; }
.opt { display: block; width: 100%; text-align: left; border: 2px solid var(--line); background: #fffdf8; border-radius: 14px; padding: 14px 16px; }
.opt.right { background: var(--good-soft); border-color: var(--good); font-weight: 700; }
.opt.wrong { background: var(--bad-soft); border-color: var(--bad); }
.opt:disabled { cursor: default; color: inherit; }
.explain { border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.explain.ok { background: var(--good-soft); }
.explain.no { background: var(--bad-soft); }

/* 쓰기 */
.prompt { background: var(--primary-soft); border-radius: 14px; padding: 14px 16px; font-weight: 700; }
.counter { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.lines { display: flex; gap: 6px; }
.lines i { width: 26px; height: 8px; border-radius: 4px; background: var(--line); }
.lines i.on { background: var(--good); }
details.peek { font-size: 15px; }
details.peek summary { cursor: pointer; color: var(--muted); font-weight: 700; }
/* 접기 줄: 누르는 높이 44px 이상 (아이 화면 '글 다시 보기', 리포트 회차 글·기록 삭제) */
details > summary { min-height: 44px; padding: 9px 0; }
details.peek .passage p { font-size: 16px; }

/* 피드백 */
.fb h3 { font-size: 20px; margin-bottom: 6px; }
.fb-box { border-radius: 16px; padding: 14px 16px; }
.fb-praise { background: var(--good-soft); }
.fb-tip { background: #fff4d6; }
.fb-rewrite { background: #f1eefc; }
.fb-level { background: #fff1c2; border: 2px solid #f0b400; }
.assess-card { border-color: var(--good); }

/* 성장 */
.compare { display: grid; gap: 12px; }
@media (min-width: 620px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare .pane { border: 2px solid var(--line); border-radius: 16px; padding: 14px; background: #fffdf8; }
.compare .pane.now { border-color: var(--good); background: var(--good-soft); }
.compare .pane p.w { white-space: pre-wrap; margin-top: 6px; }
.compare .meta { font-size: 13px; color: var(--muted); font-weight: 700; }
.big-num { font-family: var(--font-number); font-weight: var(--display-weight); font-size: 34px; line-height: 1.1; color: var(--good-text); }
.rubric td:first-child, .rubric th:first-child { font-weight: 700; }
.rubric td { text-align: center; } .rubric th { text-align: center; }
.rubric td:first-child, .rubric th:first-child { text-align: left; }
table.weekly { font-size: 13px; table-layout: fixed; }
table.weekly th, table.weekly td { padding: 7px 3px; text-align: center; }
table.weekly th:first-child, table.weekly td:first-child { white-space: normal; text-align: left; width: 34%; word-break: keep-all; }
.pips { letter-spacing: 2px; color: #9c6c00; }
/* 빈 점은 색이 아니라 모양(속 빈 원)으로 구분한다. 점수는 aria-label 로 읽힌다 */
.pips i { font-style: normal; color: transparent; -webkit-text-stroke: 1.2px var(--muted); }
.fb-spell { font-size: 15px; }
.fb-spell s { color: var(--bad-text); }
.mine { border-left: 4px solid var(--line); padding-left: 12px; color: var(--muted); white-space: pre-wrap; }
.big-emoji { font-size: 60px; line-height: 1; }

.loading { text-align: center; padding: 40px 0; }
.pencil { font-size: 48px; display: inline-block; animation: wiggle 0.9s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(-12deg) translateX(-6px); } 50% { transform: rotate(8deg) translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .pencil { animation: none; } .btn { transition: none; } }

.err { color: var(--bad-text); font-weight: 700; font-size: 15px; }
.btn-sub { align-self: flex-start; min-height: 44px; padding: 0 16px; border: 2px solid var(--line); background: #fffdf8; color: var(--ink); border-radius: 12px; font: inherit; font-weight: 700; font-size: 15px; }
.btn-sub:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-size: 13px; padding: 10px; }
.linkbox button { flex: none; border: 2px solid var(--line); background: #fffdf8; border-radius: 12px; padding: 0 14px; font-weight: 700; font-size: 14px; }
.notice { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* 리포트 */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 620px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: #fffdf8; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat .n { font-family: var(--font-number); font-weight: var(--display-weight); font-size: 28px; line-height: 1.2; }
.stat .l { font-size: 13px; color: var(--muted); }
.stat .d { font-size: 12px; font-weight: 700; }
.up { color: var(--good-text); } .down { color: var(--bad-text); }
.entry { border-top: 2px solid var(--line); padding-top: 14px; margin-top: 14px; }
.entry:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.entry h3 { font-size: 18px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; background: var(--line); border-radius: 999px; padding: 2px 10px; margin-left: 6px; vertical-align: middle; font-family: "Noto Sans KR", sans-serif; }
.survey-opts { display: grid; gap: 8px; }
::placeholder { color: var(--muted); opacity: 1; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.scroll { overflow-x: auto; }

/* ───────────── 하루세줄 공통 부품 (2026-11-11 시범 전 회의 D1) ─────────────
   시안: docs/team/2026-11-11-prelaunch/designer/mock.html. 클래스 이름은 시안과 같고, 쪽지는 .memo 로 합쳤다(.guard* 는 같은 규칙의 다른 이름).
   색 규칙: 잉크 = 이름표·체크, 초록 띠 = 보호자께, 빨강 = 선생님 펜 글씨·필수·오류, 주황 = 누르는 것(이름표에는 쓰지 않는다). */

/* AI 이름표: 사람 이름표처럼 잉크색 테두리만 있는 알약 + 하루세줄 단색 마크. 한 부품, 한 문구("AI 선생님")로만 쓴다.
   마크는 CSS 로 그린다(마크업은 <span class="ai-tag">AI 선생님</span> 만 있으면 된다. 마크업에 <img> 를 넣으면 CSS 마크는 빠진다) */
.ai-tag { display: inline-flex; align-items: center; gap: 6px; font-family: "Noto Sans KR", sans-serif; font-size: 14px; font-weight: 700; line-height: 1;
  color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; padding: 5px 10px 5px 8px; background: #fff; white-space: nowrap; }
.ai-tag::before { content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("/img/brand/mark-mono.svg") center / contain no-repeat; mask: url("/img/brand/mark-mono.svg") center / contain no-repeat; }
.ai-tag:has(img)::before { display: none; }
.ai-tag img { width: 16px; height: 16px; }
/* 이름표 + 한 줄 문장 ("가끔 틀릴 수 있어요.") */
.ai-by { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.ai-sign { text-align: right; font-size: 14px; color: var(--muted); }
.ai-sign b { color: var(--ink); }
.level-early .ai-tag { font-size: 16px; padding: 6px 12px 6px 9px; }
.level-early .ai-tag::before, .level-early .ai-tag img { width: 18px; height: 18px; }

/* 알림장 쪽지 "보호자께": 보호자에게 하는 말은 모두 이 모양(왼쪽 초록 띠). 1·2학년 홈·쓰기와 등록 화면이 같이 쓴다 */
.memo, .guard { background: #fff; border: 1px solid var(--memo-edge); border-left: 6px solid var(--good); border-radius: 0 10px 10px 0; padding: 14px 14px 12px; font-size: 15px; line-height: 1.7; }
.memo-to, .guard-to { font-weight: 700; color: var(--good-text); font-size: 15px; }
.memo-title { font-family: var(--font-display); font-size: 1.25rem; margin: 2px 0 4px; }
.memo-lead, .guard-lead { font-size: 14px; color: var(--muted); margin-top: 2px; line-height: 1.6; }
/* 쪽지 밖에 두는 같은 크기 한 줄 ("동의하지 않으면 … 쓸 수 없어요") */
.memo-lead.out, .guard-lead.out { margin-top: 0; }
/* 세 줄 요약 표: 받는 것 / 쓰는 곳 / 보관 */
.memo dl, .memo-sum { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); gap: 4px 10px; margin: 12px 0 0; font-size: 14px; line-height: 1.55; }
.memo dt, .memo-sum dt { font-weight: 700; }
.memo dd, .memo-sum dd { margin: 0; }
.memo-warn { font-size: 14px; line-height: 1.6; margin-top: 8px; }
.memo-links, .guard-links { display: flex; flex-wrap: wrap; gap: 0 16px; border-top: 1px dashed var(--memo-edge); padding-top: 4px; margin-top: 4px; font-size: 14px; }
.memo-links a, .guard-links a { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }

/* 체크 한 줄(동의 칸). 줄 전체(48px 이상)를 눌러도 체크된다. .picks 와 달리 아이가 고르는 칸이 아니라 보호자 칸이다 */
.agree { display: flex; gap: 10px; align-items: flex-start; padding: 12px 8px; border-top: 1px dashed var(--memo-edge); font-size: 15px; line-height: 1.55; position: relative; }
.memo dl + .agree, .memo-sum + .agree { margin-top: 12px; }
.agree-who { margin: 12px 0 0; padding: 12px 8px 0; border-top: 1px dashed var(--memo-edge); font-size: 15px; line-height: 1.55; }
.agree-who + .agree { margin-top: 0; padding-top: 4px; border-top: 0; }
.agree input { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--ink); position: relative; z-index: 1; }
.agree label { cursor: pointer; }
.agree label::after { content: ""; position: absolute; inset: 0; }
.agree a { position: relative; z-index: 1; }
.agree:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: -2px; border-radius: 8px; }
.agree small, .agree-sub { display: block; font-size: 13px; color: var(--muted); line-height: 1.5; }
/* 빠진 칸: 색만이 아니라 두꺼운 테두리 + 오류 글(app.js 가 .is-needed 를 붙인다) */
.agree.is-needed { background: var(--bad-soft); border-radius: 8px; box-shadow: 0 0 0 2px var(--bad); border-top-color: transparent; }
/* 필수 표시 */
.req { font-size: 12px; font-weight: 700; color: var(--bad-text); margin-right: 6px; white-space: nowrap; }
.kid-label { font-size: 13px; font-weight: 700; color: var(--primary-text); letter-spacing: .02em; }

/* 접힌 상자 (쪽지 안 "미국으로 가는 정보 자세히") */
.memo details.more { border-top: 1px dashed var(--memo-edge); margin-top: 4px; font-size: 14px; }
.memo details.more > summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; min-height: 44px; padding: 6px 0; }
/* 펼침 표시: 글자 대신 모양(▸ → ▾)이라 읽는 프로그램에는 영향 없음 */
.memo details.more > summary { list-style: none; gap: 8px; }
.memo details.more > summary::-webkit-details-marker { display: none; }
.memo details.more > summary::before { content: ""; flex: none; width: 0.5em; height: 0.5em; border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: rotate(-45deg); transition: transform 0.12s; }
.memo details.more[open] > summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .memo details.more > summary::before { transition: none; } }
.memo details.more > summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.more-body { background: #faf7ee; border-radius: 8px; padding: 10px 12px; margin: 0 0 10px; line-height: 1.6; }
.more-body p + p { margin-top: 8px; }
.more-body b { font-weight: 700; }

/* 시작 버튼 바로 위 한 줄: 본문 크기(작은 회색 글이 아니라 누르기 전에 읽히게) */
.terms-line { font-size: 16px; color: var(--ink); text-align: center; line-height: 1.6; }
.terms-line a { color: var(--ink); font-weight: 700; padding: 10px 0; } /* 글 속 링크라 한 줄 안에 두되, 위아래 여백으로 누르는 곳을 넓힌다 */

/* 참여 코드 없음 / 쓴 코드 / 만료 안내 화면: 별명 칸 없이 이유 한 줄과 연락처만 */
.gate { text-align: center; padding: 28px 20px; }
.gate h1, .gate h2 { font-size: 26px; }
.gate-state { display: inline-block; font-size: 13px; font-weight: 700; border: 1.5px solid var(--ink); border-radius: 999px; padding: 3px 12px; line-height: 1.5; }
.gate-help { font-size: 17px; line-height: 1.7; }
.gate-apply { text-align: center; text-decoration: none; max-width: 420px; justify-self: center; }
.gate-mail { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border: 2px solid var(--ink); border-radius: 14px; background: #fffdf8; color: var(--ink); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.gate-mail:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
