/* DS 시절 RPG 메뉴 느낌의 픽셀 테마. 라이트/다크 두 벌. */

@font-face { font-family: "Galmuri11"; src: url("../fonts/Galmuri11.woff2") format("woff2"); font-weight: 400; font-display: swap; }
/* 굵은 갈무리11은 11픽셀 안에 획을 두껍게 넣느라 '틀', '블', '를'처럼 획이 많은 글자가 뭉개져요.
   굵게 써도 보통 굵기 글꼴을 쓰게 해서, 브라우저가 가짜 굵게를 만들지도 않게 해요. 강조는 크기와 색으로 해요. */
@font-face { font-family: "Galmuri11"; src: url("../fonts/Galmuri11.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "GalmuriMono11"; src: url("../fonts/GalmuriMono11.woff2") format("woff2"); font-display: swap; }

/* ── 색 ───────────────────────────────────────── */
:root {
  color-scheme: light;
  --sky-1: #cfe6f7;
  --sky-2: #bcdcf3;
  --sky-3: #a8d1ee;
  --stripe-a: #e4eef6;
  --stripe-b: #d8e6f1;
  --page: #e9f0f6;
  --panel: #fbfcfe;
  --line: #33415c;      /* 창 테두리 */
  --edge: #8cc3e8;      /* 창 안쪽 띠 */
  --edge-hot: #f2c230;  /* 지금 듣는 시즌 */
  --text: #26324a;
  --muted: #5f6e86;
  --faint: #c6d1de;
  --hp: #48c058;
  --hp-dark: #2f8a3c;
  --xp: #3f8fe0;
  --red: #e0483e;
  --gold: #e8b23a;
  --heat-1: #b9e6bf;
  --heat-2: #6fcf7c;
  --heat-3: #2f9e43;
  --lock-fill: #c9d2dd;
  --lock-glyph: #a3afbf;
  --shell: #c3cedb;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --sky-1: #1d2a4a;
  --sky-2: #1a2643;
  --sky-3: #17223c;
  --stripe-a: #1c2338;
  --stripe-b: #192033;
  --page: #151b2c;
  --panel: #232d47;
  --line: #0c1120;
  --edge: #4a6fae;
  --edge-hot: #e8b829;
  --text: #e7edf8;
  --muted: #a5b2c9;
  --faint: #3a4766;
  --hp: #55d468;
  --hp-dark: #2f9e43;
  --xp: #5ea2f0;
  --red: #ff6a5c;
  --gold: #f2c14a;
  --heat-1: #24553a;
  --heat-2: #2f8f4c;
  --heat-3: #55d468;
  --lock-fill: #36425f;
  --lock-glyph: #4f5d7e;
  --shell: #2b3654;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --sky-1: #1d2a4a; --sky-2: #1a2643; --sky-3: #17223c;
    --stripe-a: #1c2338; --stripe-b: #192033;
    --page: #151b2c; --panel: #232d47; --line: #0c1120; --edge: #4a6fae; --edge-hot: #e8b829;
    --text: #e7edf8; --muted: #a5b2c9; --faint: #3a4766;
    --hp: #55d468; --hp-dark: #2f9e43; --xp: #5ea2f0; --red: #ff6a5c; --gold: #f2c14a;
    --heat-1: #24553a; --heat-2: #2f8f4c; --heat-3: #55d468;
    --lock-fill: #36425f; --lock-glyph: #4f5d7e; --shell: #2b3654;
  }
}

:root {
  --px: "Galmuri11", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --sans: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", "Galmuri11", sans-serif;
  --mono: "GalmuriMono11", ui-monospace, Menlo, Consolas, monospace;
  --b: 3px; /* 픽셀 한 칸 */
}

/* ── 기본 ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--px);
  font-size: 15px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: none;
  font-smooth: never;
}
a { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--edge); }
a:hover { text-decoration-color: var(--red); }
:focus-visible { outline: var(--b) solid var(--red); outline-offset: 3px; }
h1, h2, h3 { font-weight: 700; line-height: 1.35; margin: 0; letter-spacing: 0; }
h1 { font-size: 30px; }
h2 { font-size: 18px; }
p { margin: 0 0 1em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--line); color: #fff; padding: 6px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* 픽셀 창: 모서리가 한 칸씩 깎인 테두리 + 안쪽 색 띠 */
.window {
  position: relative;
  background: var(--panel);
  margin: var(--b);
  padding: 20px 22px;
  box-shadow:
    0 calc(var(--b) * -1) 0 0 var(--line),
    0 var(--b) 0 0 var(--line),
    calc(var(--b) * -1) 0 0 0 var(--line),
    var(--b) 0 0 0 var(--line),
    inset 0 0 0 var(--b) var(--edge),
    inset 0 0 0 calc(var(--b) * 2) var(--panel),
    calc(var(--b) * 2) calc(var(--b) * 2) 0 0 rgba(0, 0, 0, 0.12);
}
.window > h2 {
  display: inline-block;
  margin: -2px 0 14px;
  padding: 2px 10px 3px;
  background: var(--line);
  color: #fff;
  font-size: 15px;
}

/* ── 머리말 ───────────────────────────────────── */
.masthead { background: var(--line); color: #fff; }
.masthead-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; text-decoration: none; color: #fff; }
.brand-badge svg { width: 28px; height: 28px; display: block; }
.masthead nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.masthead nav a { color: #dbe5f3; text-decoration: none; padding: 4px 10px; }
.masthead nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.masthead nav a[aria-current="page"] { color: var(--line); background: #fff; }
.masthead nav a[aria-current="page"]::before { content: "▶"; font-size: 10px; margin-right: 6px; vertical-align: 1px; }
.theme-toggle {
  font: inherit; font-size: 13px; color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: var(--b) solid #fff; padding: 3px 10px; margin-left: 8px;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.12); }
.theme-icon { display: none; }

main.wrap { padding-top: 36px; padding-bottom: 64px; }

/* ── DS 두 화면 ───────────────────────────────── */
.ds { max-width: 980px; margin: 0 auto 40px; }
.screen {
  position: relative;
  margin: 4px;
  box-shadow:
    0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line);
}
.screen-top {
  padding: 26px 28px 24px;
  background: repeating-linear-gradient(to bottom, var(--sky-1) 0 48px, var(--sky-2) 48px 96px, var(--sky-3) 96px 144px);
}
.screen-bottom {
  padding: 22px;
  background: repeating-linear-gradient(135deg, var(--stripe-a) 0 8px, var(--stripe-b) 8px 16px);
}
.hinge { display: flex; justify-content: center; gap: 0; height: 22px; margin: 0 auto; width: 70%; background: var(--shell); border-left: 4px solid var(--line); border-right: 4px solid var(--line); align-items: center; }
.hinge span { width: 34px; height: 6px; background: var(--line); margin: 0 18%; opacity: 0.5; }
.screen-top h1 { font-size: 24px; margin-bottom: 26px; text-shadow: 2px 2px 0 var(--panel); }

/* 시즌 지도 */
.map { list-style: none; margin: 0 0 26px; padding: 22px 0 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); }
.stop { position: relative; text-align: center; }
.stop::before { /* 길: 점선 */
  content: ""; position: absolute; top: 20px; left: -50%; right: 50%; height: 6px;
  background: repeating-linear-gradient(to right, var(--line) 0 6px, transparent 6px 12px);
  opacity: 0.55;
}
.stop.is-done::before, .stop.is-current::before { opacity: 1; background: repeating-linear-gradient(to right, var(--hp-dark) 0 6px, transparent 6px 12px); }
.stop:first-child::before { display: none; }
.stop a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--text); }
.stop .badge svg { width: 42px; height: 42px; display: block; image-rendering: pixelated; }
.stop-code { font-weight: 700; font-size: 13px; }
.stop-name { font-size: 12px; color: var(--muted); line-height: 1.4; }
.stop-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stop.is-current .stop-name { color: var(--text); }
.stop.is-current .badge { position: relative; }
.stop.is-current .badge::before { /* 현재 위치 화살표 */
  content: ""; position: absolute; left: 50%; top: -22px; transform: translateX(-50%);
  border: 8px solid transparent; border-top: 10px solid var(--red); border-bottom: 0;
  animation: bob 1s steps(2) infinite;
}
.stop a:hover .stop-name { color: var(--red); }
.clear-mark { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: #fff; background: var(--red); padding: 0 5px; white-space: nowrap; z-index: 2; }

/* 대화창 */
.dialog {
  position: relative;
  background: var(--panel);
  padding: 18px 48px 16px 22px;
  margin: 0 var(--b);
  box-shadow:
    0 calc(var(--b) * -1) 0 0 var(--line), 0 var(--b) 0 0 var(--line), calc(var(--b) * -1) 0 0 0 var(--line), var(--b) 0 0 0 var(--line),
    inset 0 0 0 var(--b) var(--red), inset 0 0 0 calc(var(--b) * 2) var(--panel), inset 0 0 0 calc(var(--b) * 3) var(--edge);
  font-size: 17px; line-height: 1.8;
}
.dialog p { margin: 0; }
#schedule-note { color: var(--muted); font-size: 15px; }
.dialog-cursor { position: absolute; right: 20px; bottom: 14px; border: 7px solid transparent; border-top: 9px solid var(--red); border-bottom: 0; animation: blink 1s steps(1) infinite; }

/* 아래 화면 메뉴 */
.menu-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; }
.window-wide { grid-column: 1 / -1; }

.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li { position: relative; padding: 9px 0 9px 22px; border-bottom: 2px dotted var(--faint); }
.menu-list li.is-cursor::before { content: "▶"; position: absolute; left: 0; top: 10px; font-size: 12px; color: var(--red); animation: blink 1.2s steps(1) infinite; }
.menu-list li.is-done .todo-title { color: var(--muted); font-weight: 400; }
.menu-list li.is-done::before { content: ""; position: absolute; left: 2px; top: 16px; width: 3px; height: 3px; background: var(--hp-dark); box-shadow: 3px 3px 0 var(--hp-dark), 6px 0 0 var(--hp-dark), 9px -3px 0 var(--hp-dark); }
.menu-list li.week-clear { padding-left: 0; color: var(--hp-dark); font-weight: 700; }
.week-dates { color: var(--muted); font-size: 13px; margin: -6px 0 8px; }
.todo-title { display: block; font-weight: 700; }
.todo-meta { display: block; color: var(--muted); font-size: 13px; }
.todo-recall { display: block; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* 학생증 */
.card-top { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: center; margin-bottom: 14px; }
.card-photo { width: 72px; height: 72px; display: grid; place-items: center; background: var(--sky-1); box-shadow: inset 0 0 0 var(--b) var(--line); }
.card-photo svg { width: 48px; height: 48px; image-rendering: pixelated; }
.card-id { margin: 0; display: grid; grid-template-columns: 4em 1fr; gap: 2px 10px; font-size: 14px; }
.card-id dt { color: var(--muted); }
.card-id dd { margin: 0; font-weight: 700; }
.bar-row { display: grid; grid-template-columns: 3.2em 1fr auto; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; }
.bar-label { background: var(--line); color: var(--gold); font-weight: 700; text-align: center; padding: 0 4px; font-size: 12px; }
.bar { position: relative; height: 12px; background: var(--faint); box-shadow: 0 0 0 2px var(--line); overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--hp); box-shadow: inset 0 -4px 0 0 var(--hp-dark); transition: width 600ms steps(12); }
.bar-xp > span { background: var(--xp); box-shadow: inset 0 -4px 0 0 rgba(0, 0, 0, 0.18); }
.bar-num { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge-case { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; padding: 10px; margin: 14px 0 12px; background: var(--sky-1); box-shadow: inset 0 0 0 var(--b) var(--line); }
.badge-case .badge svg { width: 100%; max-width: 32px; height: auto; display: block; margin: 0 auto; image-rendering: pixelated; }
.card-stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; font-size: 13px; }
.card-stats div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 2px dotted var(--faint); }
.card-stats dt { color: var(--muted); }
.card-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 출석부 */
.heatmap .cells { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); grid-template-columns: repeat(26, minmax(8px, 1fr)); gap: 4px; max-width: 620px; padding: 2px; }
.heatmap .cell { aspect-ratio: 1; }
.cell { background: var(--panel); box-shadow: inset 0 0 0 2px var(--faint); }
.cell.l1 { background: var(--heat-1); box-shadow: none; }
.cell.l2 { background: var(--heat-2); box-shadow: none; }
.cell.l3 { background: var(--heat-3); box-shadow: none; }
.cell.future { background: transparent; box-shadow: inset 0 0 0 2px var(--faint); opacity: 0.4; }
.cell.today { box-shadow: inset 0 0 0 2px var(--red); }
.heat-axis { display: flex; justify-content: space-between; max-width: 620px; color: var(--muted); font-size: 12px; margin-top: 8px; }

/* 최근 리포트 */
.recent { max-width: 972px; margin: 0 auto; }
.report-list { list-style: none; margin: 0; padding: 0; }
.report-list li { display: grid; grid-template-columns: 7em 1fr; gap: 2px 16px; padding: 10px 0; border-bottom: 2px dotted var(--faint); align-items: baseline; }
.report-list time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.report-list a { font-weight: 700; }
.report-meta { display: block; color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); margin: 0; }

/* ── 공통 머리 ─────────────────────────────────── */
.page-head { max-width: 720px; margin: 0 0 32px; }
.page-head p { color: var(--muted); margin-top: 12px; font-family: var(--sans); font-size: 15px; -webkit-font-smoothing: auto; }

/* ── 계획서 ───────────────────────────────────── */
.season { margin-top: 48px; scroll-margin-top: 20px; }
.season-head { display: grid; grid-template-columns: 64px 1fr; gap: 6px 18px; align-items: start; margin-bottom: 18px; }
.season-badge svg { width: 64px; height: 64px; display: block; image-rendering: pixelated; }
.season-title h2 { font-size: 20px; }
.season-code { color: var(--muted); margin-right: 6px; }
.season-blurb { color: var(--muted); margin: 4px 0 0; }
.season-facts { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 20px; margin: 10px 0 0; font-size: 13px; }
.season-facts dt { color: var(--muted); }
.season-facts dd { margin: 0; }
.season-bar { grid-column: 1 / -1; margin-top: 4px; }
.season.is-current .season-head {
  box-shadow:
    0 calc(var(--b) * -1) 0 0 var(--line), 0 var(--b) 0 0 var(--line), calc(var(--b) * -1) 0 0 0 var(--line), var(--b) 0 0 0 var(--line),
    inset 0 0 0 var(--b) var(--edge-hot), inset 0 0 0 calc(var(--b) * 2) var(--panel),
    calc(var(--b) * 2) calc(var(--b) * 2) 0 0 rgba(0, 0, 0, 0.12);
}
.season.is-current .season-title h2::after { content: "수강 중"; margin-left: 10px; font-size: 12px; vertical-align: 3px; background: var(--edge-hot); color: #33415c; padding: 1px 6px; }

.table-scroll { overflow-x: auto; margin: 0 var(--b); }
.quests { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14px; background: var(--panel); box-shadow: inset 0 0 0 var(--b) var(--line); }
.quests thead th { text-align: left; font-weight: 700; font-size: 12px; background: var(--line); color: #fff; padding: 8px 10px; }
.quests td { padding: 10px; border-bottom: 2px dotted var(--faint); vertical-align: top; }
.quests tr:last-child td { border-bottom: 0; }
.quests td:first-child, .quests th:first-child { padding-left: 14px; }
.quests .c-state { width: 44px; }
.quests .c-num { width: 54px; text-align: right; font-variant-numeric: tabular-nums; }
.quests .c-sub { width: 82px; white-space: nowrap; padding-right: 14px; }
.quests .c-res { width: 21%; color: var(--muted); }
.quests .c-recall { width: 30%; color: var(--muted); }
.quests tr.type-사이드 .c-quest { color: var(--muted); }
.quests thead .c-res, .quests thead .c-recall { color: #fff; }
.check { display: inline-block; width: 18px; height: 18px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); position: relative; vertical-align: -4px; }
tr.is-done .check { background: var(--hp); }
tr.is-done .check::after { /* 픽셀 체크 */
  content: ""; position: absolute; left: 4px; top: 7px; width: 3px; height: 3px; background: #fff;
  box-shadow: 3px 3px 0 #fff, 6px 0 0 #fff, 9px -3px 0 #fff;
}
tr.is-done td { color: var(--muted); }
tr.is-done .c-quest { color: var(--hp-dark); }
.unsubmitted { color: var(--muted); font-size: 13px; }
.c-sub a { color: var(--red); font-weight: 700; text-decoration-color: var(--red); }

.tag { display: inline-block; font-size: 11px; line-height: 1; padding: 3px 5px; margin-right: 4px; vertical-align: 1px; color: #fff; background: var(--muted); }
.tag-보스 { background: var(--red); }
.tag-복습 { background: var(--xp); }
.tag-사이드 { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 2px var(--faint); }
.tag-밀림 { background: var(--red); }
.tag-예습 { background: var(--hp-dark); }

/* 계획서의 주차 머리줄 */
.quests tr.week-row th { text-align: left; font-size: 13px; font-weight: 700; background: var(--sky-1); color: var(--text); padding: 6px 14px; border-top: var(--b) solid var(--line); box-shadow: inset var(--b) 0 0 0 var(--line), inset calc(var(--b) * -1) 0 0 0 var(--line); }
.quests tr.week-row:first-child th { border-top: 0; }
.quests tr.week-row .week-sub { font-weight: 400; color: var(--muted); margin-left: 8px; }
.quests tr.week-row.is-now th { background: var(--edge-hot); color: #33415c; }
.quests tr.week-row.is-now .week-sub { color: #33415c; }
.quests tr.week-row.is-side th { background: var(--faint); }
.now-tag { margin-left: 8px; background: var(--red); color: #fff; padding: 0 6px; font-size: 12px; }
.span-weeks { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ── 리포트 목록 ───────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip { font: inherit; font-size: 13px; color: var(--text); background: var(--panel); border: 0; box-shadow: inset 0 0 0 2px var(--line); padding: 4px 12px; cursor: pointer; }
.chip:hover { box-shadow: inset 0 0 0 2px var(--red); }
.chip[aria-pressed="true"] { background: var(--line); color: #fff; }
.chip[aria-pressed="true"]::before { content: "▶ "; font-size: 10px; }

/* ── 리포트 ───────────────────────────────────── */
.report { max-width: 760px; margin: 0 auto; }
.report-cover { margin-bottom: 36px; padding: 24px 26px; }
.cover-top { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: center; margin-bottom: 16px; }
.cover-top .season-badge svg { width: 56px; height: 56px; }
.report-kind { color: var(--muted); font-size: 13px; margin: 0 0 2px; }
.report-cover h1 { font-size: 24px; }
.cover-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cover-table th { text-align: left; font-weight: 400; color: var(--muted); width: 6.5em; padding: 6px 0; border-top: 2px dotted var(--faint); vertical-align: top; }
.cover-table td { padding: 6px 0; border-top: 2px dotted var(--faint); }
.stamps { display: flex; gap: 8px; margin: 16px 0 0; }
.stamp { font-weight: 700; font-size: 13px; padding: 3px 10px; color: #fff; }
.stamp-clear { background: var(--red); }
.stamp-recall { background: var(--xp); }
.stamp-wip { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 2px var(--faint); }

.report-body { counter-reset: sec; }
.report-body section { margin-bottom: 34px; }
.report-body > section > h2 { counter-increment: sec; font-size: 17px; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.report-body > section > h2::before { content: counter(sec); display: inline-grid; place-items: center; min-width: 26px; height: 26px; background: var(--line); color: #fff; font-size: 13px; }
.prose-text, .prose p, .prose li { font-family: var(--sans); font-size: 16px; line-height: 1.8; -webkit-font-smoothing: auto; }
.report-body section.sec-recall_note .prose-text { background: var(--panel); padding: 12px 16px; box-shadow: inset var(--b) 0 0 0 var(--gold); }
.report-body section.sec-gaps .prose-text { background: var(--panel); padding: 12px 16px; box-shadow: inset var(--b) 0 0 0 var(--red); }
.prose-text h2, .prose-text h3 { font-family: var(--px); font-size: 15px; margin: 22px 0 8px; }
.prose-text h2 { font-size: 16px; }
.prose-text > :first-child { margin-top: 0; }
.prose-text img { max-width: 100%; height: auto; image-rendering: auto; }
.prose-text pre, .prose pre { background: var(--line); color: #e7edf8; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.prose-text code, .prose code { font-family: var(--mono); font-size: 0.9em; }
.prose-text :not(pre) > code, .prose :not(pre) > code { background: var(--faint); padding: 1px 5px; }
.prose-text blockquote, .prose blockquote { margin: 0 0 1em; padding-left: 14px; box-shadow: inset var(--b) 0 0 0 var(--edge); color: var(--muted); }
.prose-text table, .prose table { border-collapse: collapse; margin-bottom: 1em; font-family: var(--sans); }
.prose-text th, .prose-text td, .prose th, .prose td { border: 2px solid var(--faint); padding: 6px 10px; }
.report-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 18px; border-top: 4px solid var(--line); font-size: 14px; }

/* ── 과정 소개 ─────────────────────────────────── */
.prose { max-width: 760px; margin: 0 auto; padding: 28px 30px; }
.prose h1 { font-size: 26px; margin-bottom: 18px; }
.prose h2 { font-size: 18px; margin: 34px 0 10px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 4px; }

/* ── 꼬리말 ───────────────────────────────────── */
.colophon { background: var(--line); color: #b9c6da; font-size: 13px; padding: 18px 0 24px; }
.colophon p { margin: 0; }

/* ── 움직임 ───────────────────────────────────── */
@keyframes blink { 50% { opacity: 0; } }
@keyframes bob { 50% { transform: translate(-50%, 4px); } }
@media (prefers-reduced-motion: reduce) {
  .dialog-cursor, .menu-list li.is-cursor::before, .stop.is-current .badge::before { animation: none; }
  .bar > span { transition: none; }
}

/* ── 좁은 화면 ─────────────────────────────────── */
@media (max-width: 860px) {
  .menu-grid { grid-template-columns: minmax(0, 1fr); }
  .map { grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 34px; }
  .stop:nth-child(6)::before { display: none; }
  .season-facts { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .screen-top { padding: 20px 16px; }
  .screen-bottom { padding: 14px; }
  .window { padding: 18px 16px; }
  .screen-top h1 { font-size: 20px; }
  .stop .badge svg { width: 36px; height: 36px; }
  .stop-name { display: none; }
  .dialog { font-size: 15px; padding-right: 40px; }
  .report-list li { grid-template-columns: 1fr; }
  .card-stats { grid-template-columns: 1fr; }
  .masthead nav { gap: 2px; }
  .heatmap .cells { gap: 2px; grid-template-columns: repeat(26, minmax(5px, 1fr)); }
  .theme-toggle { margin-left: 4px; padding: 2px 8px; }
}

/* ── 로그인 ───────────────────────────────────── */
.auth-slot { display: inline-flex; align-items: center; gap: 4px 8px; margin-left: 8px; }
.auth-slot[hidden] { display: none; }
.masthead nav .auth-write { color: var(--line); background: var(--gold); font-weight: 700; }
.masthead nav .auth-write:hover { color: var(--line); background: #fff; }
.masthead nav .auth-write::before { content: "✎"; margin-right: 6px; }
.masthead nav .auth-write[aria-current="page"]::before { content: "✎"; font-size: inherit; }
.auth-who { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #dbe5f3; }
.auth-who img { width: 22px; height: 22px; display: block; image-rendering: pixelated; box-shadow: 0 0 0 2px #fff; }
.auth-logout, .masthead nav .auth-login {
  font: inherit; font-size: 13px; color: #dbe5f3; cursor: pointer; text-decoration: none;
  background: transparent; border: 0; padding: 4px 8px;
}
.auth-logout:hover, .masthead nav .auth-login:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* ── 픽셀 버튼 ───────────────────────────────── */
.px-btn {
  font: inherit; font-size: 14px; font-weight: 700; line-height: 1.4; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--text); background: var(--panel); border: 0; padding: 7px 16px;
  box-shadow: inset 0 0 0 var(--b) var(--line), inset 0 calc(var(--b) * -2) 0 0 var(--faint);
}
.px-btn:hover { box-shadow: inset 0 0 0 var(--b) var(--red), inset 0 calc(var(--b) * -2) 0 0 var(--faint); }
.px-btn:active { transform: translateY(2px); }
.px-btn:disabled { opacity: 0.55; cursor: progress; transform: none; }
.px-btn.is-primary { color: #fff; background: var(--red); box-shadow: inset 0 0 0 var(--b) var(--line), inset 0 calc(var(--b) * -2) 0 0 rgba(0, 0, 0, 0.25); }
.px-btn.is-primary:hover { background: #c93a31; }
.px-btn.is-ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--faint); font-weight: 400; }
.px-btn.is-ghost:hover { box-shadow: inset 0 0 0 2px var(--red); }
.px-btn.is-armed { color: #fff; background: var(--red); box-shadow: inset 0 0 0 var(--b) var(--line); font-weight: 700; }
.link-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--red); }

/* ── 글쓰기 ───────────────────────────────────── */
.write-gate { max-width: 760px; margin: 0 auto; }
.write-gate[hidden], .write-dialog[hidden] { display: none; }
.gate-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px !important; }
.gate-actions:empty { display: none; }
.write-form { padding-bottom: 8px; }
.write-notice { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 0 var(--b) 18px; padding: 8px 14px; font-size: 14px; background: var(--sky-1); box-shadow: inset var(--b) 0 0 0 var(--xp); }
.write-notice[hidden] { display: none; }

.kind-select {
  font: inherit; font-size: 13px; color: var(--muted); background: transparent; border: 0; padding: 0 18px 0 0; margin: 0 0 2px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
  background-size: 5px 5px; background-position: right 7px top 60%, right 2px top 60%; background-repeat: no-repeat;
}
.title-input, .title-preview {
  display: block; width: 100%; box-sizing: border-box; resize: none; overflow: hidden;
  font-family: var(--px); font-size: 24px; font-weight: 700; line-height: 1.35; color: var(--text);
  background: transparent; border: 0; padding: 2px 0 4px; margin: 0;
  box-shadow: inset 0 -2px 0 0 var(--faint);
}
.title-input::placeholder { color: var(--faint); }
.title-input:focus { outline: none; box-shadow: inset 0 calc(var(--b) * -1) 0 0 var(--red); }
.title-preview { box-shadow: none; }

.cover-table td select, .cell-input {
  font: inherit; font-size: 14px; color: var(--text); background: var(--panel); border: 0; max-width: 100%;
  padding: 3px 8px; box-shadow: inset 0 0 0 2px var(--faint);
}
.cover-table td select { width: 100%; padding-right: 8px; }
.cover-table td select:hover, .cell-input:hover { box-shadow: inset 0 0 0 2px var(--edge); }
.cover-table td select:focus, .cell-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--red); }
.hours-input { width: 6em; }
#w-recall { color: var(--muted); font-size: 13px; }

.stamp-toggle { position: relative; cursor: pointer; }
.stamp-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stamp-toggle span { display: inline-block; font-weight: 700; font-size: 13px; padding: 3px 10px; color: var(--muted); box-shadow: inset 0 0 0 2px var(--faint); }
.stamp-toggle span::before { content: "□ "; }
.stamp-toggle:hover span { box-shadow: inset 0 0 0 2px var(--edge); }
.stamp-toggle input:focus-visible + span { outline: var(--b) solid var(--red); outline-offset: 3px; }
.stamp-toggle input:checked + span { color: #fff; box-shadow: none; transform: rotate(-3deg); }
.stamp-toggle input:checked + span::before { content: "■ "; }
.stamp-toggle.is-clear input:checked + span { background: var(--red); }
.stamp-toggle.is-recall input:checked + span { background: var(--xp); }

.field {
  display: block; width: 100%; box-sizing: border-box; resize: vertical; min-height: 3.6em;
  font-family: var(--sans); font-size: 16px; line-height: 1.8; color: var(--text); -webkit-font-smoothing: auto;
  background: var(--panel); border: 0; padding: 12px 16px;
  box-shadow: inset 0 0 0 2px var(--faint);
}
.field::placeholder { color: var(--muted); opacity: 0.7; }
.field:hover { box-shadow: inset 0 0 0 2px var(--edge); }
.field:focus { outline: none; box-shadow: inset 0 0 0 2px var(--red); }
.field-body { min-height: 16em; }
.report-body section.sec-recall_note .field { box-shadow: inset var(--b) 0 0 0 var(--gold), inset 0 0 0 2px var(--faint); }
.report-body section.sec-recall_note .field:focus { box-shadow: inset var(--b) 0 0 0 var(--gold), inset 0 0 0 2px var(--red); }
.report-body section.sec-gaps .field { box-shadow: inset var(--b) 0 0 0 var(--red), inset 0 0 0 2px var(--faint); }
.report-body section.sec-gaps .field:focus { box-shadow: inset var(--b) 0 0 0 var(--red), inset 0 0 0 2px var(--red); }
.report-body > section > h2 label { cursor: text; }
.write-form.is-preview section.is-empty { display: none; }
.write-form .preview.prose-text:empty::before { content: "(비어 있어요)"; color: var(--muted); }

.write-dialog { margin: 0 var(--b) 18px; }
.write-dialog.is-error { box-shadow:
    0 calc(var(--b) * -1) 0 0 var(--line), 0 var(--b) 0 0 var(--line), calc(var(--b) * -1) 0 0 0 var(--line), var(--b) 0 0 0 var(--line),
    inset 0 0 0 var(--b) var(--red), inset 0 0 0 calc(var(--b) * 2) var(--panel), inset 0 0 0 calc(var(--b) * 3) var(--red); }
.write-dialog .gate-actions a, .write-gate .gate-actions a { text-decoration: none; }

.write-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px;
  margin: 8px calc(var(--b) * -1) 0; padding: 12px 14px;
  background: var(--line); box-shadow: 0 calc(var(--b) * -1) 0 0 var(--edge);
}
.write-bar .saved { margin: 0 auto 0 0; color: #b9c6da; font-size: 13px; }
.write-bar .px-btn:not(.is-primary):not(.is-armed) { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px #8798b3; }
.write-bar .px-btn:not(.is-primary):not(.is-armed):hover { box-shadow: inset 0 0 0 2px #fff; }
.page-write .colophon { display: none; }

.report-nav-end { display: inline-flex; flex-wrap: wrap; gap: 8px 18px; }
.report-nav-end .owner-only[hidden] { display: none; }

@media (max-width: 560px) {
  .title-input, .title-preview { font-size: 20px; }
  .write-bar { padding: 10px; gap: 8px; }
  .write-bar .saved { flex-basis: 100%; }
  .write-bar .px-btn { padding: 6px 12px; font-size: 13px; }
  .auth-name { display: none; }
}
.px-btn[hidden] { display: none; }
.write-dialog { scroll-margin-bottom: 150px; }
.write-form textarea[hidden], .write-form .preview[hidden] { display: none; }

/* ── 게임 규칙 ───────────────────────────────── */
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 26px; align-items: start; }
.rules .rule-group:first-child { grid-column: 1 / -1; }
.rule-list { margin: 0; }
.rule { padding: 12px 0; border-top: 2px dotted var(--faint); }
.rule:first-child { border-top: 0; padding-top: 4px; }
.rule dt { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.rule dt::before { content: "▸"; color: var(--red); margin-right: 8px; }
.rule dd { margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.75; -webkit-font-smoothing: auto; }
.rule dd p { margin: 10px 0 0; }
.rule dd code { font-size: 13px; }
.loop { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: loop; }
.loop li { position: relative; counter-increment: loop; padding: 10px 12px; background: var(--sky-1); box-shadow: inset 0 calc(var(--b) * -1) 0 0 var(--xp); }
.loop li b { display: block; font-family: var(--px); font-size: 15px; margin-bottom: 2px; }
.loop li b::before { content: counter(loop) ". "; color: var(--muted); }
.loop li:not(:last-child)::after { content: "▶"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--red); z-index: 1; }
@media (max-width: 760px) {
  .rules { grid-template-columns: minmax(0, 1fr); }
  .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loop li:nth-child(2)::after { display: none; }
}

/* ── 공통: 주인만 보이는 것 ────────────────────── */
.owner-only[hidden] { display: none !important; }
.more-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 0; font-size: 14px; }

/* ── CS 과정 하위 메뉴 ─────────────────────────── */
.course-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 4px; margin: -12px 0 28px; padding: 6px 8px; background: var(--sky-1); box-shadow: inset 0 calc(var(--b) * -1) 0 0 var(--edge); font-size: 14px; }
.course-nav-title { color: var(--muted); font-size: 13px; margin-right: 10px; padding-left: 6px; }
.course-nav a { text-decoration: none; padding: 2px 10px; }
.course-nav a:hover { background: var(--panel); }
.course-nav a[aria-current="page"] { background: var(--line); color: #fff; }

/* ── 홈 ───────────────────────────────────────── */
.home-hero { margin: 4px 0 30px; }
.home-hero h1 { font-size: 30px; }
.home-hero > p { margin: 10px 0 0; max-width: 46em; color: var(--muted); font-family: var(--sans); font-size: 15px; -webkit-font-smoothing: auto; }
.home-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.home-stats div { display: flex; align-items: baseline; gap: 8px; padding: 4px 12px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); }
.home-stats dt { color: var(--muted); font-size: 13px; }
.home-stats dd { margin: 0; font-size: 18px; font-variant-numeric: tabular-nums; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 22px 26px; align-items: start; }
.home-side { display: grid; gap: 22px; }
.home-heat { grid-column: 1 / -1; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); gap: 2px 14px; padding: 12px 0; border-bottom: 2px dotted var(--faint); align-items: baseline; }
.feed-item:last-child { border-bottom: 0; }
.feed-item time, .note-list time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.feed-item > div > a, .note-title { font-size: 16px; }
.feed-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.feed-summary { display: block; margin-top: 3px; color: var(--muted); font-family: var(--sans); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: auto; }
.feed-series { color: var(--text); text-decoration: none; }
a.feed-series:hover { text-decoration: underline; }
.kind-pill { font-size: 11px; line-height: 1; padding: 3px 6px; color: #fff; }
.kind-pill.is-note { background: var(--xp); }
.kind-pill.is-report { background: var(--red); }

.tag-chip { display: inline-flex; align-items: baseline; gap: 4px; font-size: 13px; color: var(--muted); text-decoration: none; padding: 0 6px; box-shadow: inset 0 0 0 2px var(--faint); }
a.tag-chip:hover { color: var(--text); box-shadow: inset 0 0 0 2px var(--edge); }
.tag-chip[aria-pressed="true"] { color: #fff; background: var(--xp); box-shadow: none; }
.tag-count { font-size: 11px; color: var(--muted); }
.tag-chip[aria-pressed="true"] .tag-count { color: inherit; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }

.home-course-top { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.home-course-top .season-badge svg { width: 48px; height: 48px; }
.home-course-line { margin: 0; font-size: 15px; }
.home-course-todo { margin: 0; color: var(--muted); font-size: 13px; }
.home-course-next { margin: 12px 0 0; font-size: 14px; }
.home-course-next span { color: var(--muted); font-size: 12px; margin-right: 6px; }

.series-shelf { list-style: none; margin: 0; padding: 0; }
.series-shelf a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; text-decoration: none; border-bottom: 2px dotted var(--faint); }
.series-shelf li:last-child a { border-bottom: 0; }
.series-shelf a:hover .series-name { text-decoration: underline; text-decoration-color: var(--red); }
.series-name::before { content: "▤ "; color: var(--xp); }
.series-count { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ── 공부 노트 목록 ─────────────────────────────── */
.note-filters { margin-bottom: 22px; }
.note-filters .filters { margin-bottom: 12px; }
a.chip { text-decoration: none; display: inline-block; }
.filter-state { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 2px 16px; padding: 12px 0; border-bottom: 2px dotted var(--faint); align-items: baseline; }
.note-list li:last-of-type { border-bottom: 0; }
.note-list li[hidden] { display: none; }
.note-no { display: inline-block; color: #fff; background: var(--xp); font-size: 11px; padding: 0 5px; margin-right: 6px; }
.tag-chip.is-static { box-shadow: none; padding: 0; }
.series-link { margin-top: 8px !important; }

/* ── 공부 노트 글 ───────────────────────────────── */
.note { max-width: 780px; margin: 0 auto; }
.note-head { margin: 0 var(--b) 22px; }
.note-series { margin: 0 0 6px; font-size: 14px; }
.note-series a { color: var(--xp); text-decoration: none; }
.note-series a::before { content: "▤ "; }
.note-series a:hover { text-decoration: underline; }
.note-head h1 { font-size: 28px; }
.note-summary { margin: 10px 0 0; color: var(--muted); font-family: var(--sans); font-size: 16px; -webkit-font-smoothing: auto; }
.note-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.note-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.note-body { padding: 28px 32px; margin-bottom: 26px; }
.note-body.prose-text { font-size: 17px; line-height: 1.85; }
.note-body p, .note-body ul, .note-body ol { margin: 0 0 1.1em; }
.note-body h2 { font-size: 18px; margin: 34px 0 10px; }
.note-body h3 { font-size: 16px; margin: 26px 0 8px; }
.series-box { margin-bottom: 26px; }
.series-toc { margin: 0; padding-left: 1.6em; font-size: 14px; }
.series-toc li { padding: 3px 0; }
.series-toc li.is-here a { text-decoration: none; color: var(--red); }
.series-toc li.is-here a::after { content: " (지금 글)"; color: var(--muted); font-size: 12px; }
.series-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; margin: 14px 0 0; padding-top: 12px; border-top: 2px dotted var(--faint); font-size: 14px; }
.series-pager .is-next { margin-left: auto; text-align: right; }

@media (max-width: 860px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .home-hero h1, .note-head h1 { font-size: 24px; }
  .feed-item, .note-list li { grid-template-columns: minmax(0, 1fr); }
  .note-body { padding: 20px 18px; }
  .note-body.prose-text { font-size: 16px; }
  .course-nav-title { flex-basis: 100%; margin-bottom: 2px; }
}

/* ── 글쓰기 탭 ───────────────────────────────── */
.write-tabs { display: flex; gap: 4px; max-width: 780px; margin: -8px auto 22px; font-size: 14px; }
.page-write .write-tabs { max-width: none; }
.write-tabs a { text-decoration: none; padding: 4px 14px; box-shadow: inset 0 0 0 2px var(--faint); color: var(--muted); }
.write-tabs a:hover { color: var(--text); box-shadow: inset 0 0 0 2px var(--edge); }
.write-tabs a[aria-current="page"] { color: #fff; background: var(--line); box-shadow: none; }
.page-write-note .colophon, .page-manage .colophon { display: none; }
.page-write-note .write-gate, .page-manage .write-gate { max-width: 780px; }

/* ── 노트 쓰기 ───────────────────────────────── */
.note-form .note-head { display: grid; gap: 10px; }
.series-pick { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.series-select { font: inherit; font-size: 14px; color: var(--xp); background: var(--panel); border: 0; padding: 3px 8px; box-shadow: inset 0 0 0 2px var(--faint); max-width: 100%; }
.series-select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--red); }
.summary-input {
  font-family: var(--sans); font-size: 16px; color: var(--text); background: transparent; border: 0; padding: 4px 0; width: 100%;
  box-shadow: inset 0 -2px 0 0 var(--faint); -webkit-font-smoothing: auto;
}
.summary-input::placeholder { color: var(--muted); opacity: 0.7; }
.summary-input:focus { outline: none; box-shadow: inset 0 calc(var(--b) * -1) 0 0 var(--red); }
.note-meta-edit { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--muted); }
.note-meta-edit label { display: inline-flex; align-items: center; gap: 8px; }

.tag-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 8px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--faint); cursor: text; }
.tag-input:focus-within { box-shadow: inset 0 0 0 2px var(--red); }
.tag-input-label { color: var(--muted); font-size: 13px; margin-right: 2px; }
.tag-chips { display: contents; }
.tag-edit { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 0 2px 0 8px; background: var(--sky-1); }
.tag-edit.is-new { background: transparent; box-shadow: inset 0 0 0 2px var(--xp); }
.tag-new-mark { font-size: 10px; color: #fff; background: var(--xp); padding: 0 4px; }
.tag-remove { font: inherit; font-size: 14px; line-height: 1; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 5px; }
.tag-remove:hover { color: var(--red); }
#n-tag-text { flex: 1 1 10em; min-width: 8em; font: inherit; font-size: 14px; color: var(--text); background: transparent; border: 0; padding: 3px 2px; }
#n-tag-text:focus { outline: none; }
.field-help { margin: 0; color: var(--muted); font-size: 12px; }
.field-help.is-error { color: var(--red); }
.note-body-edit { padding: 0; }
.field-plain { box-shadow: none; padding: 24px 28px; font-size: 17px; line-height: 1.85; min-height: 22em; background: transparent; }
.field-plain:hover, .field-plain:focus { box-shadow: none; }
.note-body-edit:focus-within { outline: var(--b) solid var(--red); outline-offset: 2px; }
.note-body-edit .preview { padding: 28px 32px; font-size: 17px; line-height: 1.85; }
.note-form .write-bar { margin-left: 0; margin-right: 0; }

.mini-form { margin: 4px 0 0; padding: 14px 16px; background: var(--sky-1); box-shadow: inset 0 0 0 2px var(--edge); }
.mini-form[hidden] { display: none; }
.mini-title { margin: 0 0 10px; font-size: 14px; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.mini-grid label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.mini-grid .cell-input { width: 100%; }
.mini-wide { grid-column: 1 / -1; }
.mini-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 12px 0 0; }
.mini-msg { font-size: 13px; color: var(--muted); }

/* ── 관리 ───────────────────────────────────── */
.manage { display: grid; gap: 26px; max-width: 780px; margin: 0 auto; }
.manage[hidden] { display: none; }
.manage .field-help { margin-bottom: 12px; font-size: 13px; }
.manage-list { list-style: none; margin: 0 0 16px; padding: 0; }
.manage-item { padding: 12px 0; border-bottom: 2px dotted var(--faint); }
.manage-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.manage-sub { color: var(--muted); font-size: 12px; }
.manage-desc { margin: 4px 0 0; color: var(--muted); font-family: var(--sans); font-size: 14px; -webkit-font-smoothing: auto; }
.manage-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.manage-actions .px-btn, .manage-inline .px-btn { padding: 3px 12px; font-size: 13px; }
.manage-edit { margin-top: 12px; padding: 12px; background: var(--sky-1); }
.manage-edit[hidden] { display: none; }
.manage-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.manage-inline .cell-input { flex: 1 1 14em; }

.todo-write { display: inline-block; margin-top: 4px; font-size: 12px; }

@media (max-width: 560px) {
  .mini-grid { grid-template-columns: minmax(0, 1fr); }
  .field-plain { padding: 18px 16px; font-size: 16px; }
}
.note-body > h2, .note-body > h3 { display: block; background: none; color: var(--text); padding: 0 0 4px; box-shadow: inset 0 -2px 0 0 var(--faint); }
.note-body > h3 { box-shadow: none; }
.note-body > h2::before { content: "■ "; color: var(--red); font-size: 0.8em; }
.note-body > :first-child { margin-top: 0; }
.page-manage .page-head { max-width: 780px; margin-left: auto; margin-right: auto; }

/* ── 리포트 필수 칸 ─────────────────────────────── */
.req-tag { display: inline-block; font-size: 11px; line-height: 1; padding: 3px 5px; margin-left: 6px; vertical-align: 2px; color: #fff; background: var(--red); }
.stamp-missing { background: transparent; color: var(--red); box-shadow: inset 0 0 0 2px var(--red); }
.missing-note { margin: 10px 0 0; font-size: 13px; color: var(--red); }
.missing-note[hidden] { display: none; }
.missing-box { margin: 0; padding: 12px 16px; color: var(--muted); font-family: var(--sans); font-size: 15px; line-height: 1.7; background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--sky-1) 6px 12px); box-shadow: inset 0 0 0 2px var(--faint); -webkit-font-smoothing: auto; }
.missing-tag { display: inline-block; font-family: var(--px); font-size: 12px; color: var(--red); margin-right: 6px; }
.write-form section.is-missing .field::placeholder { color: var(--red); opacity: 0.55; }

/* ── 출석 체크 ───────────────────────────────── */
.now-card { margin-bottom: 26px; }
.now-line { margin: 0; font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.now-line.is-idle { color: var(--muted); font-size: 15px; }
.now-dot { width: 10px; height: 10px; background: var(--hp); box-shadow: 0 0 0 2px var(--line); animation: now-blink 1.2s steps(1) infinite; }
@keyframes now-blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .now-dot { animation: none; } }
.now-meta { margin: 6px 0 0; color: var(--muted); font-size: 13px; font-family: var(--sans); -webkit-font-smoothing: auto; }
.now-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 14px; padding-top: 14px; border-top: 2px dotted var(--faint); }
.now-form[hidden] { display: none; }
.now-input { flex: 1 1 18em; min-width: 0; font-family: var(--sans); font-size: 15px; padding: 5px 10px; }
.now-kind { flex: 0 0 auto; }
.page-checkins .now-card .more-links { display: none; }

.checkin-summary { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.checkin-day { padding: 10px 0 4px; border-top: 2px dotted var(--faint); }
.checkin-day:first-of-type { border-top: 0; }
.checkin-day h3 { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px; font-size: 15px; }
.checkin-total { color: var(--muted); font-size: 13px; font-weight: 400; }
.checkin-list { list-style: none; margin: 0; padding: 0; }
.checkin-list li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: baseline; padding: 5px 0; font-size: 14px; }
.checkin-list li.is-live .checkin-time { color: var(--hp); }
.checkin-time, .checkin-dur { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.checkin-main { font-family: var(--sans); -webkit-font-smoothing: auto; }
.checkin-note { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.checkin-del { font-size: 12px; color: var(--muted); }
@media (max-width: 560px) {
  .checkin-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .checkin-time { grid-column: 1 / -1; }
}

/* ── 로파이 플레이어 ─────────────────────────────── */
.lofi {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px;
  color: #e7edf8; background: var(--line); font-size: 13px;
  box-shadow: 0 0 0 var(--b) #8798b3, 4px 4px 0 0 rgba(0, 0, 0, 0.25);
}
.page-write .lofi, .page-write-note .lofi { bottom: 76px; }
.lofi-btn {
  width: 30px; height: 30px; flex: none; cursor: pointer; font: inherit; font-size: 12px; line-height: 1;
  color: var(--line); background: var(--gold); border: 0; box-shadow: inset 0 -3px 0 0 rgba(0, 0, 0, 0.2);
}
.lofi-btn:hover { background: #fff; }
.lofi-btn:focus-visible, .lofi-vol:focus-visible { outline: var(--b) solid var(--red); outline-offset: 2px; }
.lofi-label { white-space: nowrap; max-width: 14em; overflow: hidden; text-overflow: ellipsis; }
.lofi-eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.lofi-eq i { display: block; width: 3px; height: 4px; background: var(--hp); animation: eq 0.9s steps(3) infinite; }
.lofi-eq i:nth-child(2) { animation-delay: -0.3s; }
.lofi-eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { 0% { height: 4px; } 33% { height: 12px; } 66% { height: 7px; } 100% { height: 4px; } }
.lofi.is-playing .lofi-eq { display: inline-flex; }
.lofi-vol { width: 0; opacity: 0; transition: width 0.15s steps(3), opacity 0.15s; accent-color: var(--gold); }
.lofi.is-playing .lofi-vol, .lofi:focus-within .lofi-vol { width: 80px; opacity: 1; }
.lofi.is-waiting .lofi-btn { animation: lofi-wait 1s steps(1) infinite; }
@keyframes lofi-wait { 50% { background: #fff; } }
@media (prefers-reduced-motion: reduce) { .lofi-eq i, .lofi.is-waiting .lofi-btn { animation: none; } .lofi-vol { transition: none; } }
@media (max-width: 560px) {
  .lofi { right: 10px; bottom: 10px; padding-right: 8px; }
  .lofi-label { max-width: 8em; }
  .lofi.is-playing .lofi-vol { width: 56px; }
}
.colophon { padding-bottom: 72px; }
.lofi-pause { display: inline-block; width: 9px; height: 10px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; box-sizing: border-box; vertical-align: -1px; }
.lofi-mode {
  font: inherit; font-size: 11px; cursor: pointer; color: #dbe5f3; background: transparent; border: 0;
  padding: 3px 7px; box-shadow: inset 0 0 0 2px #8798b3;
}
.lofi-mode:hover { color: #fff; box-shadow: inset 0 0 0 2px #fff; }
.lofi-mode[hidden] { display: none; }
.lofi.is-youtube .lofi-eq i { background: var(--red); }
/* 유튜브 플레이어: 유튜브 규칙대로 200px 이상 크기로, 재생 중엔 항상 보이게 */
.lofi-yt { position: absolute; right: 0; bottom: calc(100% + 10px); width: 356px; background: var(--line); box-shadow: 0 0 0 var(--b) #8798b3, 4px 4px 0 0 rgba(0, 0, 0, 0.25); }
.lofi-yt[hidden] { display: none; }
.lofi-yt-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 10px; font-size: 12px; color: #b9c6da; }
.lofi-yt-close { font: inherit; font-size: 16px; line-height: 1; color: #dbe5f3; background: none; border: 0; cursor: pointer; padding: 0 4px; }
.lofi-yt-close:hover { color: #fff; }
.lofi-yt-frame iframe { display: block; width: 356px; height: 200px; border: 0; }
@media (max-width: 560px) {
  .lofi-yt { width: calc(100vw - 20px); }
  .lofi-yt-frame iframe { width: 100%; height: calc((100vw - 20px) * 0.5625); min-height: 200px; }
}

/* ── 프로젝트 ───────────────────────────────────── */
.project-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); min-width: 0; }
.project-card.is-main { box-shadow: inset 0 0 0 2px var(--line), inset 0 0 0 5px var(--edge-hot); }
.project-main .project-card, .home-main .project-card { box-shadow: none; padding: 0; background: transparent; }
.project-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.project-name { font-size: 17px; font-weight: 700; text-decoration: none; color: var(--text); overflow-wrap: anywhere; }
.project-name:hover { text-decoration: underline; text-decoration-color: var(--red); }
.project-card.is-full .project-name { font-size: 20px; }
.status-pill { flex: none; font-size: 11px; line-height: 1; padding: 4px 7px; color: #fff; background: var(--hp-dark); }
.status-pill.is-pause { background: var(--gold); color: var(--line); }
.status-pill.is-done { background: var(--muted); }
.project-goal { margin: 0; font-size: 14px; line-height: 1.6; }
.project-goal.is-desc { color: var(--muted); }
.project-goal-label { display: inline-block; font-size: 11px; line-height: 1.5; padding: 0 5px; margin-right: 4px; color: var(--gold); background: var(--line); vertical-align: 1px; }
.project-goal.is-big { font-size: 17px; margin-bottom: 12px; }
.project-empty, .project-meta { margin: 0; color: var(--muted); font-size: 13px; }
.project-meta a { margin-left: 6px; }
.project-actions { margin: 2px 0 0; }
.project-card .bar-row { margin: 2px 0; }
.project-card .home-course { margin: 0; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.project-main { margin-bottom: 22px; }
.project-main .project-card.is-full { gap: 10px; }

.value-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.value-list li { position: relative; padding: 6px 10px 6px 26px; background: var(--sky-1); font-size: 15px; line-height: 1.5; }
.value-list li::before { content: ""; position: absolute; left: 10px; top: 13px; width: 6px; height: 6px; background: var(--red); box-shadow: 2px 2px 0 0 var(--line); }
.value-list.is-compact li { font-size: 13px; padding: 3px 8px 3px 22px; }
.value-list.is-compact li::before { left: 8px; top: 10px; width: 5px; height: 5px; }
.todo-peek { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.todo-peek li::marker { content: "□ "; color: var(--line); }

.side-shelf { list-style: none; margin: 0; padding: 0; }
.side-shelf a { display: grid; grid-template-columns: minmax(0, 1fr) 64px auto; align-items: center; gap: 10px; padding: 8px 0; text-decoration: none; border-bottom: 2px dotted var(--faint); }
.side-shelf li:last-child a { border-bottom: 0; }
.side-shelf .series-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-shelf a:hover .series-name { text-decoration: underline; text-decoration-color: var(--red); }
.side-shelf li.is-quiet .series-name { color: var(--muted); }
.side-bar { position: relative; height: 8px; background: var(--faint); box-shadow: 0 0 0 2px var(--line); overflow: hidden; }
.side-bar > span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--hp); }
.more-links a + a { margin-left: 12px; }

.project-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.project-crumb { margin: 0 0 6px !important; font-size: 13px; }
.project-crumb a { color: var(--muted); }
.project-crumb a::before { content: "◀ "; font-size: 10px; }
.main-badge { font-size: 12px; line-height: 1; padding: 5px 8px; background: var(--edge-hot); color: var(--line); }
.project-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.project-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px !important; }
.project-edit { margin-bottom: 22px; }
.project-edit textarea { width: 100%; resize: vertical; font-family: var(--sans); line-height: 1.6; }
.project-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px 26px; align-items: start; }
.project-notes { grid-column: 1 / -1; }

.todo-list { list-style: none; margin: 10px 0 0; padding: 0; }
.todo-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 2px dotted var(--faint); }
.todo-list li:last-child { border-bottom: 0; }
.todo-list label { flex: 1; display: flex; align-items: baseline; gap: 10px; cursor: pointer; font-size: 15px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.todo-list input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); position: relative; top: 3px; cursor: pointer; }
.todo-list input[type="checkbox"]:checked { background: var(--hp); }
.todo-list input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 6px; top: 2px; width: 4px; height: 8px; border: solid var(--line); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.todo-list input[type="checkbox"]:disabled { cursor: default; }
.todo-list input[type="checkbox"]:focus-visible { outline: 3px solid var(--edge-hot); outline-offset: 2px; }
.todo-list li.is-done label span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--red); }
.todo-del { flex: none; font: inherit; font-size: 12px; color: var(--muted); background: none; border: 0; padding: 2px 6px; cursor: pointer; opacity: 0; }
.todo-list li:hover .todo-del, .todo-del:focus-visible { opacity: 1; }
.todo-del:hover { color: var(--red); }
@media (hover: none) { .todo-del { opacity: 1; } }
.todo-add { display: flex; gap: 8px; margin-top: 12px; }
.todo-add .cell-input { flex: 1; min-width: 0; }

@media (max-width: 760px) {
  .project-layout { grid-template-columns: minmax(0, 1fr); }
}
