/* ============================================================
   ItemsERPSystem — Design System
   상단 네비게이션 + 콘텐츠 + 푸터 (사이드바 없음).
   "Steep" 영향: 중립 팔레트 + 단일 액센트, 얇은 보더 + 부드러운 다층 그림자,
   넉넉한 여백, 편집(editorial)톤. 한글 본문은 Pretendard(산세리프).
   ============================================================ */

:root {
  /* Warm study palette — LavenderLabs (따뜻한 종이 + 라벤더 + 형광펜) */
  --ink: #2a2533;          /* 따뜻한 먹색(연보라 기운) */
  --ash: #58535f;
  --graphite: #847e8d;
  --dove: #b4afbc;
  --fog: #f4efe5;          /* 섹션 밴드/보조 표면(따뜻) */
  --line: #ece4d6;         /* 1px 하어라인(따뜻) */
  --line-strong: #ddd2bf;
  --surface: #ffffff;
  --bg: #faf5ec;           /* 본문 배경(따뜻한 종이) */

  /* 라벤더 프라이머리 */
  --accent: #6c5ce0;
  --accent-strong: #5847c4;
  --accent-tint: rgba(108, 92, 224, 0.10);
  --link: #5847c4;

  /* 형광펜 시그니처 */
  --highlight: #ffe06a;
  --hl: #ffe06a;           /* 노랑 형광펜 */
  --hl-mint: #9fe6c8;      /* 민트 형광펜(보조) */

  /* Status */
  --ok: #2f9e63;
  --warn: #c07a1e;
  --danger: #d4503e;

  /* 따뜻하고 부드러운 그림자 */
  --shadow-sm: 0 1px 2px rgba(74,58,40,.05), 0 0 0 1px rgba(74,58,40,.03);
  --shadow-card: 0 6px 22px -10px rgba(74,58,40,.16), 0 2px 6px -3px rgba(74,58,40,.08);
  --shadow-pop: 0 20px 38px -14px rgba(74,58,40,.22);

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;

  --nav-h: 68px;
  --maxw: 1140px;

  --font-sans: 'Pretendard', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

/* ── 다크 모드 — 따뜻한 라벤더-다크(깊은 자보라 종이) ──────────────
   토글(또는 OS 설정)로 html[data-theme="dark"] 가 켜지면 토큰만 교체된다.
   라벤더 악센트·노랑 형광펜 시그니처는 유지하되 어두운 표면에서 밝게. */
html[data-theme="dark"] {
  --ink: #ece8f4;          /* 밝은 잉크(연보라 기운) — 본문·제목 */
  --ash: #c2bcce;          /* 보조 텍스트 */
  --graphite: #9d97a9;     /* 메타·서브(캡션 대비 확보 위해 밝게) */
  --dove: #837c92;         /* 가장 흐린 캡션도 다크에서 읽히도록 상향 */
  --fog: #251f31;          /* 섹션 밴드/보조 표면 */
  --line: #322b41;         /* 헤어라인 */
  --line-strong: #463c58;
  --surface: #1d1827;      /* 카드 표면 */
  --bg: #141019;           /* 본문 배경(깊은 자보라) */

  --accent: #9b8bf2;       /* 라벤더 — 다크에서 밝게 */
  --accent-strong: #b6a9ff;
  --accent-tint: rgba(155, 139, 242, 0.16);
  --link: #b6a9ff;

  --highlight: #f3d34d;
  --hl: #f3d34d;
  --hl-mint: #7fd9b8;

  --ok: #56cf95;
  --warn: #e3ad53;
  --danger: #ff6f5e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .40), 0 0 0 1px rgba(255, 255, 255, .04);
  --shadow-card: 0 8px 26px -12px rgba(0, 0, 0, .60), 0 2px 8px -4px rgba(0, 0, 0, .40);
  --shadow-pop: 0 22px 42px -16px rgba(0, 0, 0, .70);

  color-scheme: dark;
}
/* 상태 배지 — 다크 표면에 맞춰 투명 틴트 배경(글자색은 토큰이라 자동 적응) */
html[data-theme="dark"] .badge-ok { background: rgba(86, 207, 149, .13); border-color: rgba(86, 207, 149, .32); }
html[data-theme="dark"] .badge-warn { background: rgba(227, 173, 83, .13); border-color: rgba(227, 173, 83, .32); }
html[data-theme="dark"] .badge-danger { background: rgba(255, 111, 94, .13); border-color: rgba(255, 111, 94, .32); }
/* 형광펜 — 다크에선 노란 마커가 텍스트를 덮으므로 글자를 어둡게(노랑 위 가독성).
   부분 밑줄형 대신 글자 전체를 덮는 솔리드 하이라이트로 전환. */
html[data-theme="dark"] .hl,
html[data-theme="dark"] .highlight {
  background-image: none;
  background-color: var(--hl);
  color: #221d2e;
  border-radius: 4px;
  padding: 0 .16em;
}

/* 형광펜 시그니처 — 글자 뒤를 마커로 그은 듯한 표시 */
.hl {
  background-image: linear-gradient(180deg, transparent 56%, var(--hl) 56%, var(--hl) 92%, transparent 92%);
  padding: 0 .1em; border-radius: 1px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hl-mint { background-image: linear-gradient(180deg, transparent 56%, var(--hl-mint) 56%, var(--hl-mint) 92%, transparent 92%); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 15px; line-height: 1.55;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.009em;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Site layout ---------- */
.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.content { padding: 32px 0 56px; }

/* ---------- Top navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 1px 3px rgba(23,25,28,.06);
}
.navbar-inner {
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  padding: 0 24px; display: flex; align-items: center; gap: 24px;
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.4px; color: var(--ink);
  white-space: nowrap; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.menu { display: flex; align-items: center; gap: 1px; height: 100%; min-width: 0; }
.menu > a, .menu > .has-sub > .menu-link {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--ash); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.menu .nav-emoji { font-size: 15px; line-height: 1; }
.menu > a:hover, .menu > .has-sub:hover > .menu-link { background: var(--fog); color: var(--ink); text-decoration: none; }
.menu > a.active { color: var(--ink); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* hover submenu (관리자) */
.has-sub { position: relative; height: 100%; display: flex; align-items: center; }
.has-sub > .menu-link::after { content: "▾"; font-size: 10px; color: var(--dove); }
.submenu {
  position: absolute; top: calc(100% - 6px); left: 0; min-width: 210px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: var(--shadow-pop); padding: 8px; display: none;
}
.has-sub:hover .submenu { display: block; }
.submenu a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--ash); font-size: 14px; font-weight: 500;
}
.submenu a:hover { background: var(--fog); color: var(--ink); text-decoration: none; }
.nav-ico { width: 18px; text-align: center; opacity: .85; }

/* mobile: 메뉴 가로 스크롤 */
@media (max-width: 820px) {
  .navbar { height: auto; }
  .navbar-inner { flex-wrap: wrap; padding: 8px 16px; gap: 8px; }
  .menu { flex-wrap: wrap; }
  .submenu { position: static; box-shadow: none; display: block; border: none; padding: 0 0 0 16px; min-width: 0; }
}

/* ---------- Footer (따뜻한 딥플럼 — 본문과 분리) ---------- */
.footer { background: #272031; color: #c5bfce; margin-top: 72px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 44px 24px 32px; }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
@media (max-width: 720px) { .footer-cols { grid-template-columns: 1fr; } }
.footer h4 { font-size: 13px; font-weight: 700; color: #fff; margin: 0 0 12px; }
.footer a { color: #aeb4bf; font-size: 13.5px; display: block; padding: 3px 0; }
.footer a:hover { color: #fff; }
.footer .legal { color: #8b919c; font-size: 12.5px; line-height: 1.85; }
.footer .copyright { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); color: #79808c; font-size: 12.5px; }

/* ---------- Typography ---------- */
.page-head { margin-bottom: 24px; }
.page-title, .heading-lg { font-size: 28px; font-weight: 700; letter-spacing: -0.6px; margin: 0; }
.page-sub, .subheading { color: var(--graphite); font-size: 15px; margin-top: 6px; }
.heading { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.heading-sm { font-size: 16px; font-weight: 600; }
.display { font-size: 34px; font-weight: 700; letter-spacing: -0.8px; }
.text-muted { color: var(--ash); }
.text-caption { font-size: 12.5px; color: var(--dove); }
.highlight { background: var(--highlight); padding: 0 3px; border-radius: 3px; }
.section-heading { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.crumb { font-size: 13px; color: var(--graphite); margin-bottom: 14px; }
.crumb a { color: var(--graphite); }
.crumb a:hover { color: var(--ink); }
.crumb .sep { color: var(--dove); margin: 0 7px; }
.post-meta { display: flex; align-items: center; gap: 10px; color: var(--graphite); font-size: 13px; }

/* 계정(마이페이지) 로컬 사이드바 레이아웃 */
.account-shell { display: grid; grid-template-columns: 216px 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .account-shell { grid-template-columns: 1fr; } }
.account-nav { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 10px; position: sticky; top: 84px; }
@media (max-width: 860px) { .account-nav { position: static; display: flex; gap: 4px; overflow-x: auto; } }
.account-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--ash); font-weight: 500; font-size: 14px; white-space: nowrap; }
.account-nav a:hover { background: var(--fog); color: var(--ink); text-decoration: none; }
.account-nav a.active { background: var(--accent-tint); color: var(--accent-strong); font-weight: 700; }

/* 문항 선택 갤러리 (masonry — 가변 높이, 클릭 선택, 우상단 체크) */
.gallery { column-count: 5; column-gap: 14px; }
@media (max-width: 1200px) { .gallery { column-count: 4; } }
@media (max-width: 980px)  { .gallery { column-count: 3; } }
@media (max-width: 680px)  { .gallery { column-count: 2; } }
@media (max-width: 460px)  { .gallery { column-count: 1; } }
.gcard {
  position: relative; display: block; break-inside: avoid; margin: 0 0 14px;
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 12px 10px;
  background: var(--surface); cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .12s;
}
.gcard:hover { border-color: var(--dove); }
.gcard .cb { position: absolute; opacity: 0; pointer-events: none; }
.gcard .check {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 999px;
  background: var(--surface); border: 1.5px solid var(--line-strong); color: transparent;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800;
}
.gcard .cb:checked ~ .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.gcard:has(.cb:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.gcard .gbody { font-size: 13px; line-height: 1.5; margin-right: 22px; }
.gcard .gchoices { font-size: 12px; color: var(--graphite); margin-top: 6px; }
.gcard .gmeta { font-size: 11px; color: var(--dove); margin-top: 8px; }
.select-bar {
  position: sticky; bottom: 0; z-index: 10; background: rgba(255,255,255,.95);
  backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: 12px 0;
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px;
}
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.pagination a, .pagination span { min-width: 34px; height: 34px; padding: 0 9px; border-radius: 8px;
  border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ash); background: var(--surface); }
.pagination a:hover { background: var(--fog); text-decoration: none; color: var(--ink); }
.pagination .cur { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.pagination .gap { border: none; background: none; min-width: 16px; }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ---------- Helpers ---------- */
.section { padding: 32px 0; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; gap: 12px; align-items: center; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}.mt-32{margin-top:32px}
.divider { height: 1px; background: var(--line); border: none; margin: 20px 0; }

/* ---------- Card ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-card); }
.card-title { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 10px; }
.card-body { color: var(--ash); font-size: 14px; }
.stat .label { font-size: 13px; color: var(--graphite); }
.stat .value { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  font-family: inherit; font-size: 14px; font-weight: 600;
  border-radius: var(--r-sm); padding: 9px 16px; border: 1px solid transparent; cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s, opacity .12s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--fog); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--fog); text-decoration: none; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: rgba(192,57,43,.06); text-decoration: none; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 16px; }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 600; color: var(--ink); }
.input, .select, .textarea { font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 9px 12px; width: 100%; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent-tint); border-color: var(--accent); }
.textarea { min-height: 110px; resize: vertical; }
.search-top input { height: 38px; border-radius: 999px; background: var(--fog); border-color: var(--line); padding: 0 16px; }

/* ---------- Badge ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; white-space: nowrap;
  color: var(--ash); background: var(--fog); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.badge-accent { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-tint); }
.badge-ok { color: var(--ok); border-color: #bfe6cf; background: #f0fbf4; }
.badge-warn { color: var(--warn); border-color: #f3dca6; background: #fdf6e9; }
.badge-danger { color: var(--danger); border-color: #f1c3bd; background: #fdf1ef; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--graphite); white-space: nowrap;
  background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table tbody tr:last-child td { border-bottom: none; }
.table th { color: var(--ash); font-weight: 700; font-size: 12.5px; background: var(--fog); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table thead tr { border-bottom: 0; }
.table tbody tr:hover { background: var(--fog); }
.table code { background: var(--fog); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

/* ---------- Auth / hero ---------- */
.auth-wrap { max-width: 420px; margin: 56px auto; }
.hero { text-align: center; padding: 64px 0 36px; }
.hero h1 { font-size: 46px; font-weight: 800; letter-spacing: -1.4px; line-height: 1.14; margin: 16px 0 18px; }
.hero p { font-size: 18px; color: var(--graphite); max-width: 600px; margin: 0 auto 28px; }

/* 랜딩 — 이용 흐름 / 닫는 CTA */
.step-no { width: 36px; height: 36px; border-radius: 999px; background: var(--accent-tint);
  color: var(--accent-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.cta-band { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 44px; text-align: center; }
.cta-band h2 { font-size: 26px; font-weight: 700; margin: 0 0 8px; }
.cta-band p { color: #c2c7d0; margin: 0 0 22px; }

/* ---------- Carousel (의존성 없음) ---------- */
.carousel { position: relative; }
.carousel-viewport { overflow: hidden; border-radius: var(--r-lg); }
.carousel-track { display: flex; transition: transform .55s cubic-bezier(.22,.61,.36,1); }
.carousel-slide { min-width: 100%; box-sizing: border-box; }
.carousel-slide .slide-card {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: 56px 40px; text-align: center; min-height: 220px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.carousel-slide .slide-ico { font-size: 40px; }
.carousel-slide h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.4px; margin: 0; }
.carousel-slide p { font-size: 16px; color: var(--graphite); margin: 0; max-width: 520px; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; font-size: 20px; line-height: 1;
  box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center;
}
.carousel-arrow:hover { background: var(--fog); }
.carousel-arrow.prev { left: -8px; }
.carousel-arrow.next { right: -8px; }
.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.carousel-dots .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--line-strong); border: none; cursor: pointer; transition: width .2s, background .2s; }
.carousel-dots .dot.active { width: 22px; background: var(--accent); }
@media (max-width: 640px) { .carousel-arrow { display: none; } .carousel-slide .slide-card { padding: 40px 20px; } }

/* ---------- Showcase (시험지 결과물 미리보기) ---------- */
.showcase { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .showcase { grid-template-columns: 1fr; gap: 28px; } }
.showcase h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.18; margin: 12px 0 14px; }
.showcase p { font-size: 16px; color: var(--graphite); margin: 0 0 18px; }
.paper-stack { position: relative; padding: 14px; }
.paper-stack::before {
  content: ""; position: absolute; inset: 26px 0 0 26px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); transform: rotate(3deg); opacity: .7;
}
.paper {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 26px 26px 30px;
}
.paper .ph { text-align: center; border-bottom: 1.5px solid var(--ink); padding-bottom: 12px; margin-bottom: 16px; }
.paper .ph .t { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.paper .ph .s { font-size: 12px; color: var(--graphite); margin-top: 4px; }
.paper .q { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.paper .q .qh { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.paper .q .qb { font-size: 14px; color: var(--ash); margin-top: 4px; }
.paper .q .ch { font-size: 13px; color: var(--graphite); margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.paper .more { text-align: center; color: var(--dove); font-size: 18px; letter-spacing: 3px; padding-top: 8px; }

/* ── 테마 토글 버튼(네비 우측) ─────────────────────────────── */
.theme-toggle {
  width: 36px; height: 36px; padding: 0; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; line-height: 1; color: var(--ink);
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.theme-toggle:hover { background: var(--fog); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }
.theme-ico { display: block; }

/* 마크다운 표 → <table> (render_body 필터) 공통 스타일 */
table.md-table{border-collapse:collapse;margin:10px 0;font-size:.95em;max-width:100%;overflow-x:auto;display:block}
/* ⚠예전에는 여기에 `white-space:nowrap` 이 있었다. 숫자를 안 쪼개려던 것인데,
   **문장이 든 칸까지 안 접혀** 표가 화면의 세 배까지 벌어졌다(실측: 70건 중 31건이 밀리고
   최악은 816px). 숫자는 애초에 쪼갤 자리가 없어 안 접힌다 — 막을 필요가 없었다. */
table.md-table th,table.md-table td{border:1px solid var(--line,#d8d3ea);padding:5px 12px;text-align:center}
/* 수식은 지킨다. 글은 접혀도 되지만 식이 가운데서 끊기면 못 읽는다. */
table.md-table .katex{white-space:nowrap}
table.md-table thead th{background:var(--surface-alt,#f3f0fa);font-weight:600}
table.md-table tbody tr:nth-child(even){background:rgba(0,0,0,.02)}

/* ── <보 기> 상자 (CR-744) — 마크업 SSOT: app/templates/_components/boki.html ──
   실제 시험지 양식: 제목이 **테두리 선 위에 걸쳐** 선을 끊는다(가운데).
   제목의 배경색이 선을 가려 끊긴 것처럼 보이므로, 배경은 **그 화면의 종이색**이어야 한다. */
.boki{position:relative;border:1px solid currentColor;margin:22px auto 14px;padding:16px 16px 12px;max-width:34em;font-size:.97em}
.boki-title{position:absolute;top:0;left:50%;transform:translate(-50%,-50%);
            background:var(--surface, #fff);padding:0 .9em;white-space:nowrap;letter-spacing:.06em;line-height:1.4}
.boki-body{list-style:none;margin:0;padding:0}
.boki-item{margin:0 0 .38em;line-height:1.75;padding-left:1.45em;text-indent:-1.45em}
.boki-item:last-child{margin-bottom:0}

/* ── 그림을 발문 오른쪽에 감싸기 (CR-746) ─────────────────────────────────
   본문에 `[[그림:우]]` 를 쓰면 여기로 온다. 감싸면 그림이 단 폭의 45 % 로 줄어들므로
   그 그림은 `display="float"` 로 그려 글씨를 그만큼 크게 잡아 두어야 한다.
   표·<보 기> 상자는 좁은 자리로 밀려 들어가면 안 되므로 `.qfig-clear` 로 흐름을 끊는다. */
.qfig-right{float:right;width:38%;margin:2px 0 8px 14px}
.qfig-right img,.qfig-right svg{width:100%;height:auto;display:block}
.qfig-clear{clear:both;height:0;font-size:0;line-height:0}

/* ── 자료 상자 (CR-747) — 마크업 SSOT: app/templates/_components/databox.html ──
   실험 과정·조사 결과처럼 발문과 구분되는 자료 덩어리. 시험지 양식대로 테두리 상자에 담고
   머리말은 **상자 안 왼쪽 위**에 둔다(<보 기> 상자는 선 위에 걸치고 가운데 — 서로 다르다). */
.databox{border:1px solid currentColor;margin:12px 0;padding:10px 14px;font-size:.97em}
.databox-head{margin:0 0 6px;font-weight:600}
.databox-line{display:flex;gap:.4em;margin:2px 0;line-height:1.75}
.databox-mark{flex:0 0 auto}
.databox-text{flex:1 1 auto;min-width:0}
