/* 회로놀이터 site.css — 주인 40장(§7·§8-1). 색 토큰 표는 0단계 조율자, 나머지는 1-A 뼈대 줄이 40장 §7 대로.
   첫 규칙은 [hidden](40장 §7-1, 00-FIXED 3번 — fb.css .fb-btn{display:inline-flex} 가 hidden 을 이기지 못하게, a11y-03).
   모양 값(간격·둥글기)은 3단계 견본 승인 뒤 DESIGN.md 에 고정한다. 간격은 4px 배수(40장 §8-1).

   대비(잰 값, work/pages/tokens.out.txt — 40장 §7-2). 회로 데이터 색에 빨강(pole-pos)·파랑(pole-neg)을 쓰므로
   강조색은 초록. 입력 테두리는 --fb-line 이 아니라 --ctl-border(car #dde3e8 은 흰 면 위 1.29:1).
   짝                                         라이트   다크    기준
   ink / surface                               16.48   14.86   4.5
   ink / bg                                    15.21   15.86   4.5
   muted / surface                              7.50    8.40   4.5
   muted / bg                                   6.93    8.97   4.5
   muted / CTA·메뉴 유리(#fcfcfd·#12181e 어림)  7.32    8.64   4.5
   muted / 푸터 바탕                            7.26    8.65   4.5
   ink / 메뉴 현재 칸 바탕(accent 14%)         13.13   11.54   4.5
   on-accent / accent                           6.15    9.47   4.5
   accent / surface (폰 탭 현재 글자)           6.15    9.57   4.5
   accent / bg (초점 링)                        5.68   10.21   3
   accent / 유리                                6.00    9.84   4.5
   ctl-border / surface                         3.88    4.97   3
   ctl-border / bg                              3.58    5.31   3
   warn / warn-bg                               6.24    9.37   4.5
   ink / warn-bg                               15.12   13.44   4.5
   ink / note-bg                               14.75   13.47   4.5
   muted / note-bg                              6.72    7.62   4.5
   warn / surface                               6.80   10.35   3
*/
[hidden] { display: none !important; }                        /* 첫 규칙 — fb.css .fb-btn{display:inline-flex} 가 hidden 을 이기지 못하게(a11y-03, 00-FIXED 3번) */

:root {
  --fb-bg: #f4f6f8;          /* 바탕 */
  --fb-surface: #ffffff;     /* 면(20장 lab-paper 와 같은 값) */
  --fb-ink: #16202a;         /* 본문 글자 */
  --fb-muted: #4a5662;       /* 보조 글자 */
  --fb-line: #dde3e8;        /* 장식 선(카드 테두리)만 */
  --fb-accent: #1f6f43;      /* CTA 단추·현재 위치·초점 링·체크 색 */
  --fb-on-accent: #ffffff;   /* 단추 글자 */
  --ctl-border: #76838f;     /* 입력·select 테두리 */
  --warn: #8a4b00;           /* 주의 글자·테두리 */
  --warn-bg: #fff4e0;        /* 주의 칸 바탕 */
  --note-bg: #eef3f7;        /* 참고 칸 바탕 */
}
@media (prefers-color-scheme: dark) {
  :root {
    --fb-bg: #0e1418;
    --fb-surface: #141b21;
    --fb-ink: #e8eef3;
    --fb-muted: #a9b6c2;
    --fb-line: #26313a;
    --fb-accent: #6fd49a;
    --fb-on-accent: #0b1f14;
    --ctl-border: #7d8b96;
    --warn: #f2c14e;
    --warn-bg: #2a2212;
    --note-bg: #1a242c;
  }
}

/* ── 40장 §7-1 건너뛰기·초점·스크롤 여백 ── */
:root { color-scheme: light dark; --fb-display-weight: 700; }
html { scroll-padding-top: 86px; }                             /* 머리 막대 아래 끝 78px + 8 (a11y-06) */
@media (max-width: 719px) { html { scroll-padding-top: 74px; scroll-padding-bottom: calc(92px + env(safe-area-inset-bottom)); } }
.skip { position: absolute; left: 16px; top: -120px; z-index: 70; display: inline-flex; align-items: center; min-height: 44px;
        padding: 0 16px; background: var(--fb-surface); color: var(--fb-ink); border-radius: var(--fb-r-s); }
.skip:focus { top: 8px; }                                       /* z-index 70 > fb-nav 50·탭 바 60 (a11y-05) */
:focus-visible { outline: 2px solid var(--fb-accent); outline-offset: 2px; }
#main:focus, #lab:focus { outline: none; }                      /* 건너뛰기 착지점은 조작 요소가 아니다 */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fb-foot a { min-height: 44px; }                                /* fb.css 720px 이상 36px 를 덮음(a11y-25) */
input:not([type=checkbox],[type=radio],[type=range]), select { min-height: 44px; box-sizing: border-box; padding: 8px 12px;
        border: 1px solid var(--ctl-border); border-radius: var(--fb-r-s); background: var(--fb-surface); color: var(--fb-ink); font: inherit; }
input[type=range] { min-height: 44px; accent-color: var(--fb-accent); }   /* appearance:none 으로 다시 그리지 않는다 */
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; margin: 0; accent-color: var(--fb-accent); }
summary { min-height: 44px; box-sizing: border-box; padding-block: 10px; cursor: pointer; }
.crumbs a, .lesson-row__t, .tool__go a, .part-index a, .lab__reset { min-height: 44px; display: inline-flex; align-items: center; }

/* ── 40장 §7-7 글꼴(웹폰트 없음) ── */
body { margin: 0; background: var(--fb-bg); color: var(--fb-ink); font: 16px/1.7 system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }

/* ── 40장 §7-9 본문 폭·빵 부스러기(결정 13) — 폭은 fb.css --fb-max(위 메뉴·푸터와 같음), 여백 20px(푸터와 같음)·폰 16px ── */
.wrap { box-sizing: border-box; max-width: var(--fb-max); margin-inline: auto; padding-inline: 20px; }
@media (max-width: 719px) { .wrap { padding-inline: 16px; } }
.page { padding-top: 16px; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.crumbs li + li::before { content: "›"; content: "›" / ""; margin: 0 8px; color: var(--fb-muted); }
.crumbs [aria-current] { color: var(--fb-muted); }

/* ── 40장 §7-4 360px 에서 가로 넘침 없음(body·html 에 overflow-x:hidden 을 두지 않는다) ── */
main p, main li, main dd { overflow-wrap: break-word; word-break: keep-all; }
.formula { overflow-x: auto; }                                  /* 식 — 가로 넘침만 스크롤(UIUX 도식 예외) */
.tbl-wrap { overflow-x: auto; }

/* ── 강의 글 블록(40장 §3-3·§3-3-1) — 색은 토큰만. 모양 값은 3단계 견본 승인 때 고정 ── */
.callout { margin: 16px 0; padding: 12px 16px; border-radius: var(--fb-r-s); }
.callout p { margin: 0; }
.callout--note { background: var(--note-bg); }
.callout--warn { background: var(--warn-bg); border-left: 4px solid var(--warn); }
.callout--warn .callout__k { color: var(--warn); }
.mis { margin: 16px 0; }
.mis p { margin: 4px 0; }
.where, .lesson-cat { color: var(--fb-muted); }
.where__k { font-weight: 700; }
.predict, .quiz { margin: 16px 0; }
.quiz__choices { padding-left: 24px; }

/* ── 목록 줄(40장 §3-2) — 줄 전체를 덮는 링크로 만들지 않는다 ── */
.lesson-list { padding-left: 24px; }
.lesson-row { margin: 8px 0; }
.lesson-row__d { margin: 0; color: var(--fb-muted); }
.done-mark { margin-left: 8px; color: var(--fb-accent); font-weight: 700; }
.progress-sum, .progress-note { color: var(--fb-muted); }

/* ── 히어로 그림(40장 §8-1, a11y-27) ── */
.fb-hero__art svg { width: min(100%, 320px); height: auto; }
@media (max-width: 719px) { .fb-hero__art svg { width: 200px; } }

/* ── 40장 §7-10 좁은 폭 CTA 띠·카드 글(fix6, stage3b B1·B3) — fb.css 는 고치지 않고 같은 선택자로 뒤에서 덮는다.
   fb.css 의 아이콘 없는 CTA 두 칸 규칙(구체성 0,3,0)이 720 미만 .fb-cta 한 칸(0,1,0)을 이겨 360 에서 두 칸이었고, 폭 100% 단추는
   content-box 라 안쪽 여백·테두리 54px 만큼 칸보다 넓어 띠 밖으로 33px 나갔다 ── */
@media (max-width: 719px) {
  .fb-cta:not(:has(.fb-cta__icon:not([src*="/fb/icons/"]))) { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .fb-cta .fb-btn { box-sizing: border-box; }
}
.fb-card__t, .fb-card__d { display: block; }

/* ── 40장 §3-1 홈 히어로 짜임(touch, stage3c C1) — 주 단추를 .fb-hero__actions 에 넣어 fb.css 720 미만 폭 100% 를 받는다.
   content-box 면 CTA(§7-10)와 같이 54px 넘치므로 border-box ── */
@media (max-width: 719px) { .fb-hero__actions .fb-btn { box-sizing: border-box; } }

/* ── 40장 §7-5 움직임 줄이기(scroll-behavior: smooth 는 어디에도 쓰지 않는다) ── */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ── 40장 §7-8 인쇄(이 파일 끝) ── */
@media print {
  :root { --fb-bg:#ffffff; --fb-surface:#ffffff; --fb-ink:#000000; --fb-muted:#333333; --fb-line:#bbbbbb; color-scheme: light; }
  .fb-nav, .skip, .fb-cta, .fb-foot nav, .lab__display, .lab__actions, .lab__controls .js-wait, .progress, .lesson-nav, .progress-sum, #progress-clear { display: none !important; }
  body:has(.fb-nav__links) { padding-bottom: 0; }
  .lab__stage { position: static !important; max-height: none !important; }
  .lab-fig { display: block !important; break-inside: avoid; }   /* 고른 보기와 관계없이 두 그림 다 */
  .lab--sticky .lab-svg { max-height: none !important; }
}
