/* =========================================================
   うけつけ サンプルデッキ「うけつけ　フォームの作法」
   正本：system/SLIDES.md（寸法・文字・12レイアウト・フォームの図）／DESIGN.md（色・状態・作法）
   1920×1080 のステージを JS で拡大縮小。寸法はすべてステージ上の px（box-sizing: border-box）。
   数値の体系：
     外周  左右 120 / 上 96 / 下 144（家具の帯 y 984〜1080）
     本文領域 x 120〜1800、y 96〜936（1680×840）。タイトル組のあとの本文は y=272 から（比較は 344）
     罫 2px（＝pptx 1pt）・エラーと完了の縁だけ 4px、角丸 4 / 8 / 12、影なし
     文字 表紙 88 / 章題 80 / 一文 64 / タイトル 56 / 引用 44 / 小見出し 36 / 本文 32 / カード・表 28 / 注記・家具 24（最小）
   ========================================================= */

/* ---------- 1. トークン（DESIGN.md 2章の値。ライト基調だけ） ---------- */
:root {
  --bg: #FDFCFA; --surface: #FFFFFF; --ink: #1E2430; --ink-2: #4B5363; --ink-3: #6B7280;
  --line: #DCDFE4; --line-control: #8A92A0; --accent: #2E4A9E; --on-accent: #FFFFFF;
  --error: #C2372F; --done: #1E7A4C; --on-state: #FFFFFF;
  --selected: #EEF1F7; --error-bg: #FBF3F3; --done-bg: #F2F7F4;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px;
  /* スライドの書体（SLIDES.md 5.1）：游ゴシック、受付番号・コード・数字だけ Consolas。
     その書体がない環境でだけ Web の BIZ UD ゴシックで代わりに表示する */
  --font-slide: "Yu Gothic", YuGothic, "BIZ UDPGothic", sans-serif;
  --font-code: Consolas, "BIZ UDGothic", monospace;
  --font-web: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  --rule: 2px solid var(--line);
}
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 2. 表示枠（閲覧画面） ---------- */
html, body.deck { height: 100%; }
body.deck { margin: 0; background: var(--line); overflow: hidden; }
.deck-stage { position: fixed; left: 0; top: 0; right: 0; bottom: 44px; overflow: hidden; cursor: pointer; }
.deck-scaler { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform: translate(-50%, -50%) scale(var(--k, .5)); }
.deck-scaler > .slide { position: absolute; left: 0; top: 0; }
.deck-scaler > .slide:not(.is-active) { display: none; }
.deck-bar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 44px; box-sizing: border-box;
  display: flex; align-items: center; gap: 24px; padding: 0 24px;
  background: var(--surface); border-top: 1px solid var(--line);
  font-family: var(--font-web); font-size: 14px; line-height: 1.5; color: var(--ink-2);
}
.deck-bar p { margin: 0; }
.deck-bar__count { margin-left: auto !important; color: var(--ink); font-family: "BIZ UDGothic", Consolas, monospace; font-variant-numeric: tabular-nums; }
.deck-bar__links { display: flex; gap: 16px; }
.deck-bar a { color: var(--accent); text-underline-offset: .2em; }
.deck-bar a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 767px) {
  /* スマホ幅：1行目＝ヒント＋カウンタ、2行目＝リンク。高さは固定 92px で、ステージの bottom と揃える */
  .deck-stage { bottom: 92px; }
  .deck-bar { height: 92px; flex-wrap: wrap; align-content: center; column-gap: 16px; row-gap: 4px; padding: 8px 16px; }
  .deck-bar__hint { flex: 1 1 0; min-width: 0; }
  .deck-bar__count { flex: none; white-space: nowrap; }
  .deck-bar__links { flex: 1 0 100%; flex-wrap: wrap; column-gap: 16px; row-gap: 0; }
  .deck-bar__links a { padding: 4px 0; white-space: nowrap; }
}

/* ---------- 3. スライドの共通 ---------- */
.slide {
  position: relative; width: 1920px; height: 1080px; overflow: hidden; box-sizing: border-box;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-slide); font-weight: 500; font-size: 32px; line-height: 1.7; letter-spacing: .02em;
  -webkit-font-smoothing: antialiased; -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.slide *, .slide *::before, .slide *::after { box-sizing: border-box; }
.slide h1, .slide h2, .slide h3, .slide p, .slide ul, .slide ol, .slide li, .slide figure, .slide blockquote, .slide pre, .slide dl, .slide dd { margin: 0; padding: 0; }
.slide ul, .slide ol { list-style: none; }
.slide h1, .slide h2, .slide h3 { font-weight: 700; letter-spacing: .01em; color: var(--ink); }
.slide strong, .slide b { font-weight: 700; }
.slide svg { display: block; }
.code, .slide .num { font-family: var(--font-code); font-variant-numeric: tabular-nums; letter-spacing: 0; font-weight: 400; }
.sub { color: var(--ink-2); }
.note { font-size: 24px; line-height: 1.6; color: var(--ink-2); }

/* 用紙の罫（SLIDES.md 4.4）：表紙・章扉だけ。x 1320〜1800、y 168 から 72 間隔で 888 まで 11本、各 2px */
.bg-rule::before {
  content: ""; position: absolute; left: 1320px; top: 168px; width: 480px; height: 722px; pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--line) 0 2px, transparent 2px 72px);
}

/* タイトル組（5.3）：見出しラベル（y=96、Consolas 24px）→ 12px → タイトル（y=144、56px・1行）→ 本文は y=272 */
.eyebrow {
  position: absolute; left: 120px; top: 96px; height: 36px; white-space: nowrap;
  font-family: var(--font-code); font-size: 24px; line-height: 1.5; letter-spacing: .08em; color: var(--ink-2);
}
.eyebrow b { font-weight: 400; color: var(--accent); margin-right: 16px; }
.s-title { position: absolute; left: 120px; top: 144px; max-width: 1680px; font-size: 56px; line-height: 1.4; white-space: nowrap; }

/* タグ（9.5）：高さ 44、縁 2、面 白、左右 16、24px・行間 1.0、角丸 4。藍は「おすすめ」、薄墨は「よくない例」 */
.tag {
  display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 2px solid var(--accent); background: var(--surface); font-size: 24px; line-height: 1; color: var(--ink); white-space: nowrap;
}
.tag--bad { border-color: var(--ink-2); color: var(--ink-2); }

/* 家具（3章）：左下にデッキ名、右下にページ番号（下端から 48px、y 996〜1032） */
.f-deck { position: absolute; left: 120px; bottom: 48px; font-size: 24px; line-height: 1.5; color: var(--ink-2); }
.f-page { position: absolute; right: 120px; bottom: 48px; font-family: var(--font-code); font-size: 24px; line-height: 1.5; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.f-page b { font-weight: 400; color: var(--ink); }

/* ロゴ（9.5）：印 48×48（24 の座標で線幅 1.5 → 3px、墨）＋ 16 ＋ プロダクト名 32px Bold */
.logo { display: flex; align-items: center; gap: 16px; font-size: 32px; font-weight: 700; line-height: 1.5; }
.logo svg { width: 48px; height: 48px; color: var(--ink); }

/* コードブロック（9.5）：白・2px 罫・角丸 8・内側 24 32、Consolas 24px・行間 1.6。記号は薄墨 */
.codeblock {
  padding: 24px 32px; background: var(--surface); border: var(--rule); border-radius: var(--radius-md);
  font-family: var(--font-code); font-size: 24px; line-height: 1.6; color: var(--ink); white-space: pre; letter-spacing: 0;
}
.codeblock .k { color: var(--ink-2); }

/* ---------- 4. フォームの図（SLIDES.md 7章。寸法は 7.2） ---------- */
.ff-sheet { padding: 40px; background: var(--surface); border: var(--rule); border-radius: var(--radius-lg); }
.ff-legend { font-size: 24px; line-height: 1.6; color: var(--ink-2); }
.ff-field + .ff-field { margin-top: 40px; }
.ff-label { display: block; font-size: 28px; font-weight: 700; line-height: 1.5; }
.ff-opt { font-weight: 500; color: var(--ink-2); }
.ff-help { margin-top: 8px !important; font-size: 24px; line-height: 1.6; color: var(--ink-2); }
.ff-error { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px !important; font-size: 24px; font-weight: 700; line-height: 1.6; color: var(--error); }
.ff-error .st-icon { margin-top: 7.2px; }
.ff-bad { margin-top: 12px !important; font-size: 24px; line-height: 1.6; color: var(--ink); }
.ff-input {
  display: flex; align-items: center; height: 72px; margin-top: 12px; padding: 0 24px;
  background: var(--surface); border: 2px solid var(--line-control); border-radius: var(--radius-md);
  font-size: 28px; line-height: 1.5; color: var(--ink); white-space: nowrap; overflow: hidden;
}
.ff-label + .ff-input { margin-top: 12px; }
.slide .ff-input { padding: 0 24px; }
.slide .ff-input.is-error { border: 4px solid var(--error); padding: 0 22px; }
.slide .ff-area { padding-top: 14px; }
.ff-input.is-focus { border-color: var(--accent); outline: 4px solid var(--accent); outline-offset: 4px; }
.ff-ph { color: var(--ink-3); }
.ff-area { height: 144px; align-items: flex-start; padding-top: 14px; white-space: normal; }
.ff-counter { margin-top: 12px !important; font-size: 24px; line-height: 1.6; color: var(--ink-2); }
.ff-counter .code { color: var(--ink); }
.ff-btn {
  display: inline-flex; align-items: center; gap: 16px; height: 72px; padding: 0 40px; border-radius: var(--radius-md);
  background: var(--accent); border: 2px solid var(--accent); color: var(--on-accent); font-size: 28px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.ff-btn--sec { background: var(--surface); border-color: var(--line-control); color: var(--ink); }
.ff-btn--s { height: 56px; padding: 0 24px; font-size: 24px; }
.ff-spinner { width: 24px; height: 24px; flex: none; }   /* 静止した 3/4 の弧（7.4：回さない） */
.ff-actions { display: flex; align-items: center; gap: 24px; }
.ff-saved { display: inline-flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; line-height: 1.6; color: var(--done); white-space: nowrap; }
.ff-summary { padding: 24px 32px; background: var(--error-bg); border: 4px solid var(--error); border-radius: var(--radius-md); }
.ff-summary__head { display: flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 700; line-height: 1.5; }
.ff-summary__head .st-icon { width: 32px; height: 32px; }
.ff-summary ul { margin-top: 8px !important; }
.ff-summary li { font-size: 24px; line-height: 1.6; color: var(--error); text-decoration: underline; text-underline-offset: .2em; }
.ff-receipt { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 32px; background: var(--done-bg); border: 4px solid var(--done); border-radius: var(--radius-lg); }
.ff-receipt__label { font-size: 24px; line-height: 1.6; color: var(--ink-2); }
.ff-receipt__no { font-family: var(--font-code); font-size: 48px; font-weight: 700; line-height: 1.2; letter-spacing: .04em; white-space: nowrap; }
.ff-done-head { display: flex; align-items: center; gap: 16px; }
.ff-done-head .st-icon { width: 48px; height: 48px; }
.ff-done-head p { font-size: 36px; font-weight: 700; line-height: 1.5; }
.ff-flow-title { font-size: 28px; font-weight: 700; line-height: 1.5; }
.ff-flow { margin-top: 8px !important; }
.ff-flow li { display: flex; gap: 16px; font-size: 24px; line-height: 1.6; }
.ff-flow li + li { margin-top: 4px; }
.ff-flow .code { flex: none; width: 32px; color: var(--ink-2); }
.ff-flow b { flex: none; }
.ff-flow .ff-flow__date { width: auto; color: var(--ink); font-weight: 400; }

/* 状態アイコン（7.3）：フォームの図の中は 24px、まとめの見出しは 32px、完了の見出しは 48px */
.st-icon { width: 24px; height: 24px; flex: none; }
.st-icon--error { color: var(--error); }
.st-icon--done { color: var(--done); }

/* ---------- 5. レイアウト12種（番号は SLIDES.md 6章） ---------- */

/* 01 表紙：用紙の罫。ロゴ（y=96）→ y=360 見出しラベル → 24 → 表紙タイトル 88px（2行）→ 40 → サブ 32px → 下端から 96 に日付・発行者・注記 */
.cover-logo { position: absolute; left: 120px; top: 96px; }
.cover-main { position: absolute; left: 120px; top: 360px; width: 1200px; }
.cover-kicker { font-family: var(--font-code); font-size: 24px; line-height: 1.5; letter-spacing: .08em; color: var(--ink-2); }
.cover-title { margin-top: 24px !important; font-size: 88px; line-height: 1.3; }
.cover-sub { margin-top: 40px !important; font-size: 32px; line-height: 1.7; color: var(--ink-2); white-space: nowrap; }
.cover-meta { position: absolute; left: 120px; bottom: 96px; display: flex; gap: 48px; font-size: 24px; line-height: 1.5; color: var(--ink-2); }
.cover-meta .code { color: var(--ink); }

/* 02 目次：行 1200px・高さ 104px、番号（Consolas 32px・薄墨・幅 96）→ 項目名 36px → 右端に章名 24px。上と各行の下に 2px 罫 */
.toc { position: absolute; left: 120px; top: 272px; width: 1200px; border-top: var(--rule); }
.toc li { display: flex; align-items: center; height: 104px; border-bottom: var(--rule); }
.toc__num { width: 96px; flex: none; font-family: var(--font-code); font-size: 32px; line-height: 1; color: var(--ink-2); letter-spacing: 0; }
.toc__name { font-size: 36px; font-weight: 700; line-height: 1.5; }
.toc__ch { margin-left: auto; font-size: 24px; line-height: 1.6; color: var(--ink-2); }

/* 03 章扉：用紙の罫。章番号（Consolas 160px・藍＝現在地）y=280 → 32 → 章題 80px → 40 → 要旨 32px（幅 1200、2行まで） */
.ch-main { position: absolute; left: 120px; top: 280px; width: 1200px; }
.ch-num { font-family: var(--font-code); font-size: 160px; line-height: 1; color: var(--accent); letter-spacing: 0; }
.ch-title { margin-top: 32px !important; font-size: 80px; line-height: 1.3; white-space: nowrap; }
.ch-summary { margin-top: 40px !important; color: var(--ink-2); }

/* 04 本文：段 1200px、リード → 32 → 箇条（印 16×4・薄墨、字下げ 40、間 16）。右 480px は空ける */
.body-col { position: absolute; left: 120px; top: 272px; width: 1200px; }
.list { margin-top: 32px !important; }
.list li { position: relative; padding-left: 40px; }
.list li + li { margin-top: 16px; }
.list li::before { content: ""; position: absolute; left: 0; top: 25.2px; width: 16px; height: 4px; background: var(--ink-2); }

/* 05 2カラム：800＋80＋800、間の中央（x 959〜961）に 2px の縦罫（y 272〜856）。小見出し 36 → 24 → 本文 32 → 24 → 注記 24 */
.cols { position: absolute; left: 120px; top: 272px; width: 1680px; display: grid; grid-template-columns: 800px 800px; column-gap: 80px; }
.cols::before { content: ""; position: absolute; left: 839px; top: 0; height: 584px; width: 2px; background: var(--line); }
.col__title { font-size: 36px; line-height: 1.5; }
.col__text { margin-top: 24px !important; }
.col .note { margin-top: 24px; }
.col__fig { margin-top: 32px; }
.col__fig .tag { display: flex; width: max-content; }
.col__fig .tag + .ff-sheet { margin-top: 16px; }
.col__fig--pad { padding-top: 60px; }   /* 片側にだけ「よくない例」のタグがあるとき、図の上端を揃える（44＋16） */
.col .ff-sheet { padding: 32px 40px; }

/* 06 ビジュアル中心：画面フレーム 1120×640（白・2px 罫・角丸 12、上端に 48px のバー：紙・Consolas 24px の URL）→ 80 → 説明 480px（下端 912 に揃える） */
.vis-frame { position: absolute; left: 120px; top: 272px; width: 1120px; height: 640px; background: var(--surface); border: var(--rule); border-radius: var(--radius-lg); overflow: hidden; }
.vis-bar { display: flex; align-items: center; height: 48px; padding: 0 24px; background: var(--bg); border-bottom: var(--rule); font-family: var(--font-code); font-size: 24px; line-height: 1.5; color: var(--ink-2); letter-spacing: 0; }
.vis-body { padding: 38px 38px 0; }   /* フレームの罫 2＋内側 38 → 中身は x 162〜1198 / y 362〜 */
.vis-desc { position: absolute; left: 1320px; bottom: 168px; width: 480px; }
.vis-desc__title { font-size: 36px; line-height: 1.5; }
.vis-desc p { margin-top: 24px !important; }

/* 07 カード3枚：各 528×600（y 272〜872）、間 48。白・2px 罫・角丸 12、内側 上下 48・左右 40。番号 → 32 → 小見出し → 16 → 本文 28px・薄墨 */
.cards { position: absolute; left: 120px; top: 272px; display: grid; grid-template-columns: repeat(3, 528px); column-gap: 48px; }
.card { display: flex; flex-direction: column; height: 600px; padding: 48px 40px; background: var(--surface); border: var(--rule); border-radius: var(--radius-lg); }
.card__num { font-family: var(--font-code); font-size: 32px; line-height: 1; color: var(--ink-2); letter-spacing: 0; }
.card__title { margin-top: 32px !important; font-size: 36px; line-height: 1.5; }
.card__text { margin-top: 16px !important; font-size: 28px; line-height: 1.7; color: var(--ink-2); }
.slide .card__fig { margin-top: auto; }
.card__fig.codeblock { padding: 16px 20px; }

/* 08 表：幅 1680、見出し行 72（24px・薄墨・下に 2px 罫）、行 88（28px、各行の下に 2px 罫）。縦罫・外枠・しま・塗りの見出し行なし */
.tbl-wrap { position: absolute; left: 120px; top: 272px; width: 1680px; }
.tbl { width: 1680px; border-collapse: collapse; table-layout: fixed; font-size: 28px; line-height: 1.5; }
.tbl th, .tbl td { height: 88px; padding: 0 24px; text-align: left; vertical-align: middle; border-bottom: var(--rule); font-weight: 500; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl thead th { height: 72px; font-size: 24px; color: var(--ink-2); }
.tbl tbody th { font-weight: 700; }
.tbl .dash { color: var(--ink-3); }
.tbl-wrap .note { margin-top: 24px; }

/* 09 ステップ：4段（各 384、間 48）。番号 Consolas 64px の縦中央に 2px の横罫、次の段の手前 24 で止める。1段目の番号だけ藍 */
.steps { position: absolute; left: 120px; top: 272px; width: 1680px; display: grid; grid-template-columns: repeat(4, 384px); column-gap: 48px; }
.step__num { display: flex; align-items: center; gap: 24px; font-family: var(--font-code); font-size: 64px; line-height: 1; color: var(--ink); letter-spacing: 0; }
.step__num::after { content: ""; flex: 1; height: 2px; background: var(--line); margin-right: -24px; }
.step:last-child .step__num::after { margin-right: 0; }
.step:first-child .step__num { color: var(--accent); }
.step__title { margin-top: 40px !important; font-size: 36px; line-height: 1.5; white-space: nowrap; }
.step__text { margin-top: 16px !important; font-size: 28px; line-height: 1.7; color: var(--ink-2); }
.step__text .code { color: var(--ink); }

/* 10 声・引用：引用符（Consolas 160px・淡墨）x=120・y=240、引用文 44px（x=240、幅 1280、縦中央 y=520）→ 48 → 出典 24px */
.q-mark { position: absolute; left: 120px; top: 240px; font-family: var(--font-code); font-size: 160px; line-height: 1; color: var(--ink-3); }
.q-body { position: absolute; left: 240px; top: 520px; transform: translateY(-50%); width: 1280px; }
.q-text { font-size: 44px; font-weight: 700; line-height: 1.7; }
.q-cite { margin-top: 48px; font-size: 24px; line-height: 1.6; color: var(--ink-2); }

/* 11 比較：項目 320＋A 640＋B 640（間 40）。見出し行 72、行 96。B だけを藍 2px・角丸 12 で囲み（上下に 24 はみ出す）、上にタグ */
.cmp { position: absolute; left: 120px; top: 344px; width: 1680px; }
.cmp__row { display: grid; grid-template-columns: 320px 640px 640px; column-gap: 40px; height: 96px; }
.cmp__row > span { display: flex; align-items: center; border-bottom: var(--rule); font-size: 28px; line-height: 1.5; }
.cmp__row--head { height: 72px; }
.cmp__row--head > span { font-size: 24px; color: var(--ink-2); }
.cmp__label { color: var(--ink-2); }
.cmp__a { color: var(--ink-2); }
.cmp__b { padding: 0 24px; color: var(--ink); }
.cmp__box { position: absolute; left: 1040px; width: 640px; top: -24px; bottom: -24px; border: 2px solid var(--accent); border-radius: var(--radius-lg); pointer-events: none; }
.cmp__tag { position: absolute; left: 1040px; top: -88px; }

/* 12 クロージング：中央揃え・縦中央 540。ロゴ → 48 → 一文 64px → 48 → 連絡先 Consolas 32px → 32 → 注記。家具なし */
.cl-main { position: absolute; left: 120px; top: 540px; width: 1680px; transform: translateY(-50%); text-align: center; }
.cl-main .logo { justify-content: center; }
.cl-title { margin-top: 48px !important; font-size: 64px; line-height: 1.4; }
.cl-contact { margin-top: 48px !important; font-family: var(--font-code); font-size: 32px; line-height: 1.6; color: var(--ink); letter-spacing: 0; }
.cl-main .note { margin-top: 32px; }

/* ---------- 6. 印刷：1ページ1スライド ---------- */
@page { size: 1920px 1080px; margin: 0; }
@media print {
  html, body.deck { height: auto; overflow: visible; background: none; }
  .deck-bar { display: none; }
  .deck-stage { position: static; overflow: visible; }
  .deck-scaler { position: static; transform: none; width: auto; height: auto; }
  .deck-scaler > .slide, .deck-scaler > .slide:not(.is-active) { display: block; position: relative; break-after: page; page-break-after: always; }
  .deck-scaler > .slide:last-child { break-after: auto; page-break-after: auto; }
}
