/* ===== 기본 ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: 1.65;
  color: var(--c-ink-2);
  background: var(--c-bg);
  /* 한글은 어절 중간에서 끊지 않는다("분석 / 지 Ⅰ" 방지).
     keep-all 로 끊기지 않는 긴 URL·영문 토큰만 overflow-wrap 이 처리한다. */
  word-break: keep-all;
  overflow-wrap: break-word;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; color: var(--c-ink); text-wrap: balance; }
h1, h2 { font-family: var(--f-display); font-weight: 400; letter-spacing: -.01em; }
h1 { font-size: var(--t-h1); line-height: 1.25; }
h2 { font-size: var(--t-h2); line-height: 1.3; }
h3 { font-size: var(--t-h3); font-weight: 700; }
p { margin: 0 0 var(--s-3); }
.lead { color: var(--c-ink-3); margin-bottom: var(--s-5); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== 레이아웃 ===== */
.shell { max-width: var(--w-shell); margin: 0 auto; padding: 0 var(--s-5); }
.content { max-width: var(--w-content); margin: 0 auto; padding: var(--s-6) var(--s-5) var(--s-8); }
main { min-height: 60vh; }

/* ===== 헤더 ===== */
.site-header { background: var(--c-surface); border-bottom: 1px solid var(--c-line); position: sticky; top: 0; z-index: 20; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: var(--s-4); }
.site-brand { display: flex; align-items: center; gap: var(--s-4); min-width: 0; }
.logo img { height: 36px; width: auto; }
.site-title { font-family: var(--f-display); font-size: 20px; color: var(--c-brand-deep); white-space: nowrap; transition: color var(--dur-fast), border-color var(--dur-fast); border-bottom: 2px solid var(--c-brand); padding-bottom: 2px; }
.site-title:hover { color: var(--c-brand-deep); border-color: var(--c-brand-deep); }

/* 관리자 로그인 띠 배너 (공개 페이지 전용) */
.admin-band { background: var(--c-band-bg); border-bottom: 1px solid var(--c-brand-tint); }
.admin-band__inner { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: .9rem; color: var(--c-ink-2); }
.admin-band a { color: var(--c-brand-deep); font-weight: 700; text-decoration: none; }
.admin-band a:hover { text-decoration: underline; }
.site-nav { display: flex; align-items: center; gap: var(--s-4); font-weight: 700; font-size: var(--t-nav); color: var(--c-ink); }
.site-nav a { padding: var(--s-2) var(--s-1); border-bottom: 2px solid transparent; transition: color var(--dur-fast), border-color var(--dur-fast); }
.site-nav a:hover, .site-nav a.is-active { color: var(--c-brand-deep); border-color: var(--c-brand); }
.site-nav .dot { color: var(--c-ink-3); }
/* askmath(서비스 루트)로 나가는 링크. 다른 메뉴와 같은 평링크로 두고, 사이트를
   떠난다는 것만 옅은 글자색과 ↗ 로 알린다 — 밑줄 hover 는 나머지와 동일하다. */
.site-nav a.site-nav__out { color: var(--c-ink-3); white-space: nowrap; }
.inline-form { display: inline; margin: 0; }
.linklike { background: none; border: 0; padding: var(--s-2) var(--s-1); font-weight: 700; font-size: var(--t-nav); color: var(--c-ink-3); }
.linklike:hover { color: var(--c-accent); }
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .site-header__inner { height: 60px; }
  .logo img { height: 30px; }
  .site-title { font-size: 18px; }
  .menu-toggle { display: flex; flex-direction: column; gap: 5px; background: none; border: 0; padding: var(--s-2); }
  .menu-toggle span { width: 24px; height: 2px; background: var(--c-ink); border-radius: 2px; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 60px; flex-direction: column; align-items: stretch; gap: 0; background: var(--c-surface); border-bottom: 1px solid var(--c-line); box-shadow: var(--sh-md); padding: var(--s-2) var(--s-5); }
  .site-nav.is-open { display: flex; }
  .site-nav .dot { display: none; }
  .site-nav a, .site-nav .linklike { padding: var(--s-3) 0; border-bottom: 1px solid var(--c-line); text-align: left; }
  /* 세로 메뉴에서는 아래 테두리가 항목 구분선이라 밑줄로 못 쓴다 — 색으로만 알린다. */
  .site-nav a.is-active { color: var(--c-brand-deep); border-bottom-color: var(--c-line); }
}

/* ===== 푸터 ===== */
.site-footer { border-top: 1px solid var(--c-line); margin-top: var(--s-8); padding: var(--s-6) 0 var(--s-7); color: var(--c-ink-3); font-size: var(--t-small); }
.site-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); }
.site-footer__contacts { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); margin: 0 0 var(--s-2); }
.site-footer__copy { margin: 0; }
.site-footer__logo { height: 40px; width: auto; flex: none; }
@media (max-width: 960px) { .site-footer__inner { flex-direction: column; align-items: flex-start; } }

/* ===== 버튼·칩·배지 ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); border: 1px solid transparent; border-radius: var(--r-md); padding: 0 var(--s-5); height: 44px; font-weight: 700; font-size: var(--t-body); color: var(--c-ink); background: var(--c-row); transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast); }
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--c-accent); color: var(--c-white); }
.btn--accent:hover { background: var(--c-accent-deep); }
.btn--ghost { background: var(--c-surface); color: var(--c-ink); border-color: var(--c-line); }
.btn--ghost:hover { border-color: var(--c-brand); color: var(--c-brand-deep); }
.btn--danger { background: var(--c-surface); color: var(--c-danger); border-color: var(--c-danger); }
.btn--danger:hover { background: var(--c-danger); color: var(--c-white); }
.btn--sm { height: 34px; padding: 0 var(--s-3); font-size: var(--t-small); }
.btn--lg { height: 52px; padding: 0 var(--s-6); font-size: 18px; }
.btn--block { width: 100%; }
.chips { display: inline-flex; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-pill); padding: 4px; gap: 2px; flex-wrap: wrap; }
.chip { border: 0; background: transparent; border-radius: var(--r-pill); padding: 0 var(--s-5); height: 40px; font-weight: 500; color: var(--c-ink-2); transition: background var(--dur-fast), color var(--dur-fast); }
.chip:hover { color: var(--c-ink); }
.chip.is-active { background: var(--c-accent); color: var(--c-white); font-weight: 700; }
.badge { display: inline-block; border-radius: var(--r-pill); padding: 2px 10px; font-size: var(--t-caption); font-weight: 700; background: var(--c-overlay-ink); color: var(--c-ink); }
.status { display: inline-block; border-radius: var(--r-pill); padding: 2px 10px; font-size: var(--t-caption); font-weight: 700; }
.status--done { background: var(--c-brand-tint); color: var(--c-brand-deep); }
.status--open { background: var(--c-row); color: var(--c-ink-3); }
.status--warn { background: var(--c-warn-bg); color: var(--c-warn-ink); }
.status--error { background: var(--c-alert-bg); color: var(--c-danger); }

/* ===== 히어로 ===== */
.hero { position: relative; overflow: hidden; margin-top: var(--s-5); background: var(--c-brand); border-radius: var(--r-lg); padding: var(--s-8) var(--s-5); min-height: 260px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: var(--c-white); }
.hero__title { font-family: var(--f-display); font-size: var(--t-hero); color: var(--c-white); text-shadow: 0 3px 0 var(--c-hero-shadow); margin: 0 0 var(--s-5); }
.hero__actions { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: center; }
.hero .btn--ghost { background: var(--c-white); border-color: var(--c-white); color: var(--c-brand-deep); }
.hero__glyph { position: absolute; font-family: var(--f-display); color: var(--c-glyph); user-select: none; pointer-events: none; line-height: 1; }
.hero__glyph--1 { left: 6%; top: 12%; font-size: 96px; transform: rotate(-12deg); }
.hero__glyph--2 { left: 18%; bottom: 6%; font-size: 72px; transform: rotate(8deg); }
.hero__glyph--3 { right: 8%; top: 10%; font-size: 84px; transform: rotate(10deg); }
.hero__glyph--4 { right: 20%; bottom: 2%; font-size: 88px; transform: rotate(-8deg); }
.hero__glyph--5 { left: 45%; top: 4%; font-size: 48px; }
@media (max-width: 640px) {
  .hero { min-height: 200px; padding: var(--s-6) var(--s-4); }
  .hero__glyph { display: none; }
}

/* ===== 보드 (안내사항·분석지 바로가기) ===== */
.boards { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--s-6); margin: var(--s-7) 0 0; }
@media (max-width: 860px) { .boards { grid-template-columns: 1fr; } }
.board__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-4); }
.board__more { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 24px; line-height: 1; color: var(--c-ink-3); transition: background var(--dur-fast), color var(--dur-fast); }
.board__more:hover { background: var(--c-row); color: var(--c-ink); }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.row { padding: 0; background: var(--c-row); border-radius: var(--r-sm); transition: background var(--dur-fast); }
.row:hover { background: var(--c-sky); }
.row--pinned { background: var(--c-brand-tint); }
.row__link { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); width: 100%; padding: 14px var(--s-4); color: var(--c-ink); text-decoration: none; border-radius: inherit; }
.row__link:hover .row__title { color: var(--c-brand-deep); }
.row__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { color: var(--c-ink-3); font-size: var(--t-small); white-space: nowrap; }
.empty { color: var(--c-ink-3); background: var(--c-row); border-radius: var(--r-sm); padding: var(--s-4); text-align: center; }

/* ===== 타일 (분석지 카드) ===== */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
.tiles--grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-4); }
.tile { --tile-art: 76px; container-type: inline-size; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: var(--s-2); min-height: 200px; padding: var(--s-5); border-radius: var(--r-lg); color: var(--c-ink); transition: transform var(--dur-fast), box-shadow var(--dur-fast); }
.tile:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.tile--mint { background: var(--c-brand-tint); }
.tile--butter { background: var(--c-butter); }
.tile--sky { background: var(--c-sky); }
.tile--periwinkle { background: var(--c-periwinkle); }
.tile .badge { align-self: flex-start; background: var(--c-overlay-white); }
/* 제목은 카드 폭을 다 쓴다 — PDF에서 가져온 장식 삽화는 카드 아래쪽
   모서리에 있어 제목 줄과 겹치지 않는다. 삽화 자리를 비워 두는 건 아래
   .tile__desc 뿐이다. */
.tile__title { font-family: var(--f-display); font-size: 22px; line-height: 1.35; color: var(--c-ink); padding-right: var(--s-2); text-wrap: balance; }
.tile__desc { font-size: var(--t-small); color: var(--c-ink-2); padding-right: calc(var(--tile-art) + var(--s-2)); text-wrap: pretty; }
.tile__cta { margin-top: auto; font-weight: 700; font-size: var(--t-small); color: var(--c-ink); }
.tile__art { position: absolute; right: var(--s-3); bottom: var(--s-2); width: var(--tile-art); height: var(--tile-art); opacity: .94; pointer-events: none; }
.tile__art img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* 같은 카드가 메인의 반쪽 보드와 선택 화면의 넓은 그리드에 함께 쓰이므로
   뷰포트가 아니라 카드 자신의 폭에 맞춘다. */
@container (max-width: 320px) {
  .tile__title { font-size: 19px; }
  .tile__desc { padding-right: calc(48px + var(--s-2)); }
  .tile__art { width: 56px; height: 56px; }
}
@container (max-width: 240px) {
  .tile__title { font-size: 17px; }
  .tile__desc { padding-right: calc(40px + var(--s-2)); }
  .tile__art { width: 48px; height: 48px; }
}
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } }

/* ===== 밴드 (Q&A 섹션) ===== */
.band { padding: var(--s-7) 0; margin-top: var(--s-7); }
.band--sky { background: var(--c-sky); }
.band__head { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; margin-bottom: var(--s-5); }
.band__head h2 { font-size: var(--t-h1); }
.band__actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-4); }
.band__more { color: var(--c-ink-2); font-weight: 500; }
.qgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
@media (max-width: 960px) { .qgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .qgrid { grid-template-columns: 1fr; } .band__actions { margin-left: 0; } }
.qcard { display: flex; flex-direction: column; gap: var(--s-2); background: var(--c-surface); border-radius: var(--r-md); padding: var(--s-4) var(--s-5); box-shadow: var(--sh-sm); transition: transform var(--dur-fast), box-shadow var(--dur-fast); }
.qcard:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.qcard__title { font-weight: 700; color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcard__meta { font-size: var(--t-small); color: var(--c-ink-3); }
.qcard .status { align-self: flex-start; }

/* ===== 페이지 머리·페이지네이션 ===== */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.pagination { display: flex; justify-content: center; align-items: center; gap: var(--s-4); margin-top: var(--s-6); flex-wrap: wrap; }
.pagination__page {
  min-width: 34px; padding: 6px 4px; text-align: center; border-radius: 8px;
  color: var(--c-ink-2); text-decoration: none; font-size: .9rem;
  border: 1px solid var(--c-line); background: var(--c-surface);
}
a.pagination__page:hover { border-color: var(--c-brand); color: var(--c-brand-deep); }
.pagination__page.is-current {
  background: var(--c-brand); border-color: var(--c-brand);
  color: var(--c-white); font-weight: 700;
}

/* ===== 카드·게시글 ===== */
.card { background: var(--c-surface); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--sh-sm); }
.post { background: var(--c-surface); border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--sh-sm); margin-bottom: var(--s-4); }
.post__title { font-size: var(--t-h2); }
.post__meta { color: var(--c-ink-3); font-size: var(--t-small); margin: var(--s-2) 0 var(--s-4); }
.post__body { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; margin: 0; }
.post__kind {
  display: inline-block; margin-bottom: 6px;
  font-size: var(--t-small); font-weight: 700; color: var(--c-ink-3);
  letter-spacing: .06em;
}
.post--answer { background: var(--c-row); }

.field__error { color: var(--c-danger); font-size: var(--t-small); margin: var(--s-1) 0 0; }

/* 공지 첨부파일 */
.post__files { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--c-line); }
.post__files-head { font-size: var(--t-small); font-weight: 700; color: var(--c-ink-3); letter-spacing: .06em; margin: 0 0 var(--s-3); }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.file-list__item { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; background: var(--c-row); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); }
.file-list__name { font-weight: 600; word-break: break-all; min-width: 0; }
a.file-list__name { color: inherit; text-decoration: underline; }
.file-list__size { color: var(--c-ink-3); font-size: var(--t-small); flex: none; }
.file-list__actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--s-2); max-width: 100%; }
.file-list__del { margin-left: auto; }
.file-list__copy-status { flex-basis: 100%; font-size: var(--t-small); overflow-wrap: anywhere; }
.file-list__del .check__box { width: 18px; height: 18px; }
.file-list__del input:checked + .check__box::after { left: 4px; top: 1px; width: 5px; height: 9px; }
.file-embed { margin: var(--s-4) 0 0; }
.file-embed img { max-width: 100%; border-radius: var(--r-md); border: 1px solid var(--c-line); }
.file-preview { width: min(1100px, calc(100vw - 32px)); height: 90vh; height: 90dvh; max-width: none; max-height: calc(100% - 32px); margin: auto; padding: 0; border: 0; border-radius: var(--r-lg); background: var(--c-surface); color: var(--c-ink); box-shadow: var(--sh-sm); }
.file-preview[open] { display: flex; flex-direction: column; }
.file-preview:not([open]) { display: none; }
.file-preview::backdrop { background: var(--c-overlay-dim); }
.file-preview__head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--c-line); }
.file-preview__title { flex: 1; min-width: 0; font-family: var(--f-body); font-size: var(--t-body); font-weight: 700; overflow-wrap: anywhere; }
.file-preview__head .btn { flex: none; }
.file-preview iframe { display: block; width: 100%; flex: 1; min-height: 0; border: 0; background: var(--c-row); }
.file-preview__fallback { margin: 0; padding: var(--s-2) var(--s-4); font-size: var(--t-small); color: var(--c-ink-3); }
.file-preview__fallback a { text-decoration: underline; }
body.has-file-preview { overflow: hidden; }
.file-embed__caption { color: var(--c-ink-3); font-size: var(--t-small); margin-top: var(--s-1); }
.alert { background: var(--c-alert-bg); color: var(--c-danger); border: 1px solid var(--c-alert-line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); }
.banner { background: var(--c-surface); border: 2px solid var(--c-brand); border-radius: var(--r-lg); text-align: center; padding: var(--s-6) var(--s-4); margin-bottom: var(--s-5); }
.banner h1 { color: var(--c-brand-deep); margin-bottom: var(--s-2); }

/* ===== 폼 ===== */
.field { display: block; margin-bottom: var(--s-4); }
.field__label { display: block; font-size: var(--t-body-m); font-weight: 500; color: var(--c-ink); margin-bottom: var(--s-2); }
.input { width: 100%; border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 12px 14px; font: inherit; color: var(--c-ink); background: var(--c-surface); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.input:focus { outline: 0; border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-focus-ring); }
textarea.input { resize: vertical; min-height: 120px; }
select.input { height: 44px; }
.input--etc { display: inline-block; width: 12em; border: 0; border-bottom: 1px solid var(--c-sheet-line); border-radius: 0; background: transparent; padding: 4px 8px; vertical-align: baseline; }
.input--etc:focus { box-shadow: none; border-bottom: 2px solid var(--c-sheet-navy); }
.captcha { background: var(--c-row); border-radius: var(--r-md); padding: var(--s-4); margin: var(--s-5) 0; }
.captcha__label { display: block; font-size: var(--t-small); color: var(--c-ink-2); margin-bottom: var(--s-2); }
.captcha__row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-2); }
.captcha img { border-radius: var(--r-sm); border: 1px solid var(--c-line); background: var(--c-white); }
.captcha .input { max-width: 220px; }
.privacy { border: 1px solid var(--c-line); border-radius: 10px; padding: 12px 14px; }
.privacy .check { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--c-ink); }
.privacy__fields { margin-top: 10px; display: grid; gap: 10px; }
.lock { margin-left: 4px; }
.form-notice {
  background: var(--c-brand-tint); border-radius: 10px;
  padding: 10px 14px; font-size: .88rem; color: var(--c-ink-2); line-height: 1.6;
}
.form-notice p { margin: 2px 0; }
.form-notice strong { color: var(--c-ink); }
.check__hint { display: block; margin-top: 4px; font-size: .82rem; color: var(--c-ink-3); }
.alert--info { background: var(--c-brand-tint); border: 1px solid var(--c-brand); color: var(--c-ink); }

/* ===== 관리자 ===== */
.subnav-wrap { max-width: var(--w-content); margin: 0 auto; padding: var(--s-5) var(--s-5) 0; }
.subnav { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-bottom: 0; }
.subnav a { padding: 8px 16px; border-radius: var(--r-pill); font-weight: 500; color: var(--c-ink-2); background: var(--c-row); transition: background var(--dur-fast), color var(--dur-fast); }
.subnav a:hover { background: var(--c-sky); color: var(--c-ink); }
.subnav a.is-active { background: var(--c-accent); color: var(--c-white); font-weight: 700; }
.subnav-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); }
/* 시스템 관리자 전용 묶음 — 세로 구분선과 라벨로 운영 메뉴와 갈라 둔다. */
.subnav--sys { position: relative; padding-left: var(--s-5); }
.subnav--sys::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px; background: var(--c-line); }
.subnav__tag { align-self: center; font-size: var(--t-caption); font-weight: 700; color: var(--c-ink-3); letter-spacing: .04em; }
.subnav--sys a { background: transparent; border: 1px solid var(--c-line); color: var(--c-ink-3); }
.subnav--sys a:hover { background: var(--c-row); color: var(--c-ink); }
.subnav--sys a.is-active { background: var(--c-ink-2); border-color: var(--c-ink-2); color: var(--c-white); }
@media (max-width: 700px) {
  .subnav--sys { padding-left: 0; width: 100%; }
  .subnav--sys::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 1px; }
  .subnav--sys { padding-top: var(--s-3); }
}

/* 접속 통계 기간 선택 */
.toolbar__spacer { flex: 1 1 auto; }
.period { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); margin: var(--s-4) 0 var(--s-2); }
.period__presets .chip { height: 34px; padding: 0 var(--s-4); display: inline-flex; align-items: center; }
.period__range { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.period__range label { font-size: var(--t-small); color: var(--c-ink-2); }
.period__note { color: var(--c-ink-3); font-size: var(--t-caption); margin: 0 0 var(--s-4); }
.input--date { width: auto; padding: 8px 10px; }
/* 긴 기간이면 막대가 많아지므로 차트만 가로로 스크롤한다. */
.chart { overflow-x: auto; }
.chart .chart__col { min-width: 18px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-4); }
.stat { background: var(--c-surface); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--sh-sm); text-align: center; color: var(--c-ink); transition: box-shadow var(--dur-fast); }
.stat:hover { box-shadow: var(--sh-md); }
.stat strong { display: block; font-family: var(--f-display); font-weight: 400; font-size: 40px; color: var(--c-logo-ink); }
.stat span { color: var(--c-ink-3); font-size: var(--t-small); }
.table-card { background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.table td.wrap { white-space: normal; }
.table thead th { background: var(--c-row); color: var(--c-ink-2); font-weight: 500; }
.table tbody tr:hover { background: var(--c-sky); }
.table a { color: var(--c-logo-ink); font-weight: 500; }
/* 공개 게시판 표 */
.board__num { width: 64px; color: var(--c-ink-3); text-align: center; }
.board__title a { color: var(--c-ink); text-decoration: none; }
.board__title a:hover { color: var(--c-brand-deep); text-decoration: underline; }
.board td, .board th { white-space: nowrap; }
.board .board__title { white-space: normal; min-width: 200px; }
.pin { margin-right: 4px; }
tr.is-pinned td { background: var(--c-brand-tint); }
tr.is-pinned:hover td { background: var(--c-sky); }
.actions { display: flex; gap: var(--s-2); align-items: center; }
.actions form { margin: 0; }
.login-card { max-width: 380px; margin: var(--s-8) auto; padding: var(--s-5); background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--sh-sm); text-align: center; }
.login-card .logo img { margin: 0 auto var(--s-4); height: 40px; }
.login-card .field, .login-card .field__label { text-align: left; }
.login-card__site {
  font-family: var(--f-display, inherit); color: var(--c-brand-deep);
  font-size: 1.05rem; letter-spacing: .02em; margin-top: 6px;
}
.totp-guide { color: var(--c-ink-2); font-size: .92rem; line-height: 1.6; }
.totp-qr { align-self: center; border: 1px solid var(--c-line); border-radius: 10px; background: var(--c-white); }
.totp-secret { font-size: .85rem; color: var(--c-ink-3); word-break: break-all; }
.totp-secret code { color: var(--c-ink); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.results-filter { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-4); margin-bottom: var(--s-5); }
.results-filter__school { flex: 1 1 240px; min-width: 0; }
.results-filter__verification { flex: 1 0 100%; min-width: 0; }
.sheets-menu { margin-bottom: var(--s-5); }

/* ===== 에러 ===== */
.error-box { text-align: center; padding: var(--s-8) 0; }
.error-box h1 { font-size: 72px; color: var(--c-brand); line-height: 1; margin-bottom: var(--s-3); }

/* ===== 분석지 (PDF 재현) ===== */
.sheet-stage {
  background-color: var(--c-sheet-bg);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 27px, var(--c-sheet-grid) 27px 28px),
    repeating-linear-gradient(90deg, transparent 0 27px, var(--c-sheet-grid) 27px 28px);
  padding: var(--s-7) var(--s-4) var(--s-8);
}
.sheet { max-width: var(--w-sheet); margin: 0 auto; display: grid; gap: var(--s-5); }
.sheet-preview__content { display: contents; }
.sheet-preview {
  position: sticky; top: var(--s-3); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border: 2px solid var(--c-brand); border-radius: var(--r-lg);
  background: var(--c-white); box-shadow: var(--sh-md); color: var(--c-ink);
}
.sheet-preview div { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
.sheet-preview strong { color: var(--c-brand-deep); }
.sheet-preview span { color: var(--c-ink-3); font-size: var(--t-small); }
@media (max-width: 640px) { .sheet-preview { align-items: flex-start; flex-direction: column; } }
.sheet__head { text-align: center; color: var(--c-white); margin-bottom: var(--s-2); }
.sheet__kicker { font-family: var(--f-display); font-size: 22px; margin: 0; letter-spacing: .04em; text-shadow: 0 2px 0 var(--c-sheet-navy); }
.sheet__title { font-family: var(--f-display); font-size: var(--t-hero); color: var(--c-white); margin: 0; text-shadow: 0 3px 0 var(--c-sheet-navy), 0 0 2px var(--c-sheet-navy); }
.sheet__meta { color: var(--c-white); opacity: .9; font-size: var(--t-small); margin: var(--s-2) 0 0; }
.card--spiral { position: relative; border-radius: var(--r-xl); padding: var(--s-6) var(--s-6) var(--s-6) 56px; }
.card--spiral::before {
  content: ""; position: absolute; left: 16px; top: 28px; bottom: 28px; width: 14px;
  background-image: radial-gradient(circle at 7px 7px, var(--c-sheet-bg) 6px, transparent 7px);
  background-size: 14px 44px; background-repeat: repeat-y;
}
.step__head { display: flex; align-items: center; gap: var(--s-3); margin: -8px 0 var(--s-4); padding-bottom: var(--s-3); border-bottom: 2px solid var(--c-sheet-line); }
.ribbon { display: inline-block; background: var(--c-sheet-navy); color: var(--c-white); font-family: var(--f-display); font-size: 15px; padding: 6px 14px 10px; margin-top: -18px; letter-spacing: .02em; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); }
.step__title { font-family: var(--f-display); font-size: 22px; color: var(--c-sheet-navy-deep); margin: 0; }
.step__q { font-weight: 700; color: var(--c-ink); margin: var(--s-4) 0 var(--s-3); }
.step__hint { font-weight: 400; color: var(--c-ink-3); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.check-row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.check { position: relative; display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box { width: 22px; height: 22px; border: 2px solid var(--c-sheet-navy); border-radius: 6px; background: var(--c-white); flex: none; position: relative; transition: background var(--dur-fast); }
.check input:checked + .check__box { background: var(--c-sheet-navy); }
.check input:checked + .check__box::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid var(--c-white); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.check input:focus-visible + .check__box { box-shadow: 0 0 0 3px var(--c-sheet-ring); }
.check__label { color: var(--c-ink); }
.check-grid { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.admin-homepage-settings { margin-bottom: var(--s-6); }
.admin-homepage-settings fieldset { border: 0; padding: 0; }
.admin-homepage-settings legend { font-weight: 600; margin-bottom: var(--s-2); }
.admin-homepage-settings > h2 { margin-top: 0; }
.admin-homepage-settings .lead { margin-bottom: var(--s-4); }
.admin-number { max-width: 140px; }
.check:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.admin-form-actions { margin-top: var(--s-5); }
.moods { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s-3); margin: var(--s-3) 0; }
@media (max-width: 640px) { .moods { grid-template-columns: repeat(2, 1fr); } }
.mood { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s-3) var(--s-2); border: 2px solid transparent; border-radius: var(--r-lg); background: var(--c-row); cursor: pointer; text-align: center; transition: background var(--dur-fast), border-color var(--dur-fast); }
.mood input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mood__face { display: block; width: 76px; height: 76px; line-height: 1; }
.emotion-art { display: block; width: 100%; height: 100%; object-fit: contain; }
.emotion-art--thumb { width: 48px; height: 48px; }
.mood__label { font-size: var(--t-small); font-weight: 500; color: var(--c-ink); }
.mood:has(input:checked) { background: var(--c-brand-tint); border-color: var(--c-sheet-navy); }
.mood:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--c-sheet-ring); }
.lined { display: flex; align-items: baseline; gap: var(--s-2); margin: var(--s-2) 0 var(--s-4); }
.lined__label { white-space: nowrap; color: var(--c-ink-2); }
.input--line { border: 0; border-bottom: 1px solid var(--c-sheet-line); border-radius: 0; padding: 6px 4px; background: transparent; }
.input--line:focus { box-shadow: none; border-bottom: 2px solid var(--c-sheet-navy); }
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.lines__item { display: flex; align-items: center; gap: var(--s-3); }
.lines__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-sheet-navy); flex: none; }
.clipboard { position: relative; background: var(--c-surface); border: 4px solid var(--c-sheet-navy); border-radius: var(--r-xl); padding: var(--s-7) var(--s-6) var(--s-6); margin-top: var(--s-4); text-align: center; }
.clipboard::before { content: ""; position: absolute; left: 50%; top: -22px; transform: translateX(-50%); width: 120px; height: 30px; background: var(--c-clip); border-radius: 8px 8px 4px 4px; }
.clipboard::after { content: ""; position: absolute; left: 50%; top: -30px; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; background: var(--c-white); border: 4px solid var(--c-clip); }
.clipboard__title { font-family: var(--f-display); font-size: 26px; color: var(--c-sheet-navy-deep); margin-bottom: var(--s-2); }
.clipboard__q { color: var(--c-ink); margin-bottom: var(--s-4); }
.clipboard__q em { font-style: normal; color: var(--c-sheet-navy); font-weight: 700; }
.input--ruled { border: 0; border-radius: 0; background: repeating-linear-gradient(transparent 0 35px, var(--c-sheet-line) 35px 36px); line-height: 36px; padding: 0 var(--s-2); min-height: 108px; text-align: left; }
.input--ruled:focus { box-shadow: none; }
.marks-wrap { overflow-x: auto; margin: var(--s-3) 0; }
.marks { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; }
.marks th, .marks td { border: 1px solid var(--c-sheet-line); padding: 10px 8px; text-align: center; }
.marks thead th { background: var(--c-sheet-navy); color: var(--c-white); font-weight: 500; }
.marks tbody th { text-align: left; font-weight: 500; background: var(--c-sheet-th); color: var(--c-ink); }
.marks__total { font-family: var(--f-display); color: var(--c-sheet-navy-deep); font-size: 18px; }
.marks .check { justify-content: center; }
/* ===== 사용자 정보 입력(학교·학년·반·번호) =====
   서식 그대로 "학교명 [   ] 학년 [ ]학년 반 [ ]반 번호 [ ]번" 한 줄로 두고,
   폭이 모자라면 칸 단위로 줄바꿈된다. */
.identity { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); }
.identity__legend { flex: 0 0 auto; margin: 0; padding: 6px var(--s-3); border-radius: var(--r-sm); background: var(--c-sheet-th); color: var(--c-sheet-navy-deep); font-weight: 700; white-space: nowrap; }
.identity__fields { flex: 1 1 320px; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.identity__field { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.identity__field--school { flex: 1 1 200px; }
.identity__field--group { flex: 0 1 280px; }
.identity__label { flex: 0 0 auto; font-size: var(--t-small); font-weight: 500; color: var(--c-ink-2); white-space: nowrap; }
.identity__control { display: flex; align-items: center; gap: var(--s-1); }
.identity__unit { color: var(--c-ink-2); white-space: nowrap; }
.identity__hint { flex: 1 0 100%; margin: 0; font-size: var(--t-caption); color: var(--c-danger); }
.identity .combo { flex: 1 1 auto; min-width: 140px; }
.identity .input { height: 44px; padding: 10px 12px; }
.identity .input--num { width: 4em; text-align: center; padding: 10px var(--s-1); }
.identity .input--pick { width: auto; min-width: 4em; padding: 10px var(--s-2); }

/* 학교 콤보박스 — 목록은 입력칸 아래에 겹쳐 띄운다. */
.combo { position: relative; }
.combo__list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto; margin: 0; padding: var(--s-1); list-style: none; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); box-shadow: var(--sh-md); }
.combo__opt { padding: 8px var(--s-3); border-radius: var(--r-sm); cursor: pointer; }
.combo__opt:hover, .combo__opt.is-active { background: var(--c-band-bg); color: var(--c-brand-deep); }

.members { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-2) var(--s-4); }
.members__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }
.members__actions .btn[disabled] { opacity: .45; cursor: default; }
.members__hint { font-size: var(--t-caption); color: var(--c-ink-3); }
.view-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.view-list li { display: flex; gap: var(--s-2); align-items: baseline; }
.view-check { color: var(--c-sheet-navy); font-weight: 700; }
.view-line { border-bottom: 1px solid var(--c-sheet-line); padding: 4px 0; flex: 1; min-height: 1.6em; }
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--c-brand-tint); border-radius: var(--r-pill); padding: 6px 14px; margin: 4px 6px 4px 0; font-size: var(--t-small); color: var(--c-ink); }
.tag__face { display: inline-block; width: 30px; height: 30px; line-height: 1; }
.view-label { color: var(--c-ink-3); font-size: var(--t-small); margin: var(--s-3) 0 var(--s-1); }

/* ===== Turbo · 전환 ===== */
.turbo-progress-bar { background: var(--c-accent); height: 3px; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 200ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ===== 인쇄 ===== */
@media print {
  .site-header, .site-footer, .banner, .btn, .captcha, .pagination, .subnav, .toolbar,
  .members__actions, .file-preview { display: none !important; }
  body { background: var(--c-white); }
  .sheet-stage { background: var(--c-white); padding: 0; }
  .card, .clipboard, .post { box-shadow: none; border: 1px solid var(--c-print-line); }
  .card--spiral::before { display: none; }
  /* 모둠원이 늘어난 집계표도 한 쪽 폭에 들어가게 — 화면용 가로 스크롤은 인쇄에선 잘린다. */
  .marks-wrap { overflow: visible; }
  .marks { min-width: 0; font-size: 12px; }
  .marks th, .marks td { padding: 6px 4px; }
}

/* 리치 공지 본문 */
.post__body--rich { color: var(--c-ink-2); line-height: 1.7; }
.post__body--rich h1, .post__body--rich h2, .post__body--rich h3 {
  color: var(--c-ink); margin: 1.2em 0 .4em; line-height: 1.3;
}
.post__body--rich h1 { font-size: 1.5rem; }
.post__body--rich h2 { font-size: 1.25rem; }
.post__body--rich h3 { font-size: 1.1rem; }
.post__body--rich p { margin: .55em 0; }
.post__body--rich ol, .post__body--rich ul { margin: .55em 0; padding-left: 1.5em; }
.post__body--rich blockquote {
  margin: .8em 0; padding: .4em 1em;
  border-left: 3px solid var(--c-brand); background: var(--c-brand-tint); border-radius: 4px;
}
.post__body--rich a { color: var(--c-sheet-navy); text-decoration: underline; }
.post__body--rich .ql-align-center, .post__body--rich [style*="text-align: center"] { text-align: center; }
.post__body--rich .ql-align-right { text-align: right; }
.post__body--rich .ql-align-justify { text-align: justify; }
/* 에디터 마운트 */
.notice-editor:not(.ql-container) { display: none; }
.notice-editor.ql-container { min-height: 220px; background: var(--c-surface); }

/* Q&A 첨부 이미지 */
.post__images { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.post__images img {
  width: 160px; height: 120px; object-fit: cover;
  border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-row);
}

/* 업로드 미리보기 */
.upload-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.upload-card {
  display: flex; flex-direction: column; gap: 6px; width: 170px;
  border: 1px solid var(--c-line); border-radius: 10px; padding: 8px; background: var(--c-surface);
}
.upload-card img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; background: var(--c-row); }
.upload-card__meta { font-size: .78rem; color: var(--c-ink-3); word-break: break-all; }
.upload-card__meta--over { color: var(--c-danger); }
.upload-card__actions { display: flex; gap: 6px; }
/* 편집 모달 */
.upload-modal {
  position: fixed; inset: 0; z-index: 60; background: var(--c-overlay-dim);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.upload-modal__panel {
  background: var(--c-surface); border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column; gap: 12px; max-width: 580px; width: 100%;
}
.upload-modal__hint { color: var(--c-ink-2); font-size: .9rem; }
.upload-modal__canvas { max-width: 100%; touch-action: none; cursor: crosshair; align-self: center; }
.upload-modal__slider { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--c-ink-2); }
.upload-modal__slider input { flex: 1; }
.upload-modal__actions { display: flex; justify-content: flex-end; gap: 8px; }
/* 대시보드 차트 */
.chart-card {
  margin-top: 18px; padding: 16px 18px; background: var(--c-surface);
  border: 1px solid var(--c-line); border-radius: 14px;
}
.chart-card h2 { font-size: 1.02rem; color: var(--c-ink); }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 170px; margin-top: 12px; }
.chart__col {
  flex: 1; min-width: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px;
}
.chart__bar {
  width: 100%; max-width: 28px; height: var(--h, 0%);
  background: var(--c-brand); border-radius: 4px 4px 0 0;
}
.chart__bar--alt { background: var(--c-periwinkle); }
.chart__val { font-size: .72rem; color: var(--c-ink-2); min-height: 1em; }
.chart__label { font-size: .68rem; color: var(--c-ink-3); white-space: nowrap; }
/* 대시보드 시스템 관리자 동작 */
.panel { background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--sh-sm); padding: var(--s-5); margin-bottom: var(--s-5); }
.panel__lead { margin: 0 0 var(--s-3); color: var(--c-ink); }
.panel__notes { margin: 0 0 var(--s-4); padding-left: var(--s-5); color: var(--c-ink-2); font-size: var(--t-small); }
.panel__notes li { margin-bottom: var(--s-1); }
.table-card__title { font-size: 1.02rem; margin-bottom: var(--s-3); }
.dash-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.dash-actions__note { color: var(--c-ink-3); font-size: .82rem; }

/* 앱 로그 */
.log-table td { vertical-align: top; }
.log-msg { white-space: normal; word-break: break-word; }
.log-attrs { display: block; margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--c-ink-2); white-space: pre-wrap; word-break: break-all; }
.plain-list { margin: 0 0 var(--s-4); padding-left: 1.2em; }
.plain-list li { margin-bottom: 4px; }
.log-filter__q { width: 22em; max-width: 100%; padding: 8px 10px; }
.log-filter__n { width: auto; padding: 8px 10px; }
