/* ===== けいさんプリント工房 デザイン（lazeee.labs 共通のデザインルール 版3.0 に合わせる：docs/company/design-rules.md） =====
   色はすべてこの変数で決める。白の土台＋会社の色（ティール）1色＋差し色の黄。暗い色の帯は使わない。 */
:root {
  /* 共通の色（ルール 2-1） */
  --header-bg: #FFFFFF; --bg: #F7F9FC; --surface: #FFFFFF; --surface-2: #F1F4F8; --ink: #1F2A37; --muted: #566173;
  --line: #D9DEE7; --line-strong: #AAB3C2; --focus: #1D6FD8;
  --ok: #1F7A4D; --ok-bg: #E8F4EE; --ng: #B42318; --ng-bg: #FDEDEB;
  --note-bg: #EEF3F7; --note-line: #7D97B3;
  --preview-bg: #8A3C00;
  /* 会社の色（ルール 2-2。3事業とも同じ）と差し色の黄（マーカー・イラスト・小さな印だけ） */
  --accent: #0D8079; --accent-ink: #0B6E69; --accent-soft: #E6F6F4; --on-accent: #FFFFFF;
  --marker: #FFD25E; --marker-hl: #FFD25E; --mark-ink: #095C57; --band-bg: #0B6E69; --dots: rgba(13, 128, 121, .16);
  /* トップの帯：薄いティール → 白 */
  --hero-bg: linear-gradient(180deg, var(--accent-soft) 0%, #FFFFFF 100%);
  /* 学年の色（データの区別だけに使う） */
  --g1: #FF8A5B; --g2: #F59F00; --g3: #12B886; --g4: #15AABF; --g5: #4C6EF5; --g6: #7950F2; --g7: #E64980;
  /* 形 */
  --radius-s: 10px; --radius-btn: 12px; --radius: 14px; --radius-l: 18px;
  --shadow: 0 1px 2px rgba(31, 42, 55, .05), 0 4px 16px rgba(31, 42, 55, .06);
  --shadow-l: 0 2px 4px rgba(31, 42, 55, .06), 0 12px 32px rgba(31, 42, 55, .10);
  --font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  /* プリント（紙）の色 */
  --paper: #fff; --ans: #C62828;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --header-bg: #141C2E; --bg: #0B1222; --surface: #141C2E; --surface-2: #1B2539; --ink: #E7ECF5; --muted: #A9B4C8;
    --line: #2A3448; --line-strong: #46536B; --focus: #8AB4FF; --ok: #5CC08A; --ok-bg: #12291F; --ng: #FF8A80; --ng-bg: #33191A;
    --note-bg: #18212B; --note-line: #4F6A88; --accent-soft: #12312C; --accent-ink: #5FD3C3; --marker: rgba(255, 210, 94, .32); --marker-hl: rgba(255, 210, 94, .2); --mark-ink: #5FD3C3; --dots: rgba(95, 211, 195, .12);
    --hero-bg: linear-gradient(180deg, #12312C 0%, #0B1222 100%);
    --shadow: none; --shadow-l: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --header-bg: #141C2E; --bg: #0B1222; --surface: #141C2E; --surface-2: #1B2539; --ink: #E7ECF5; --muted: #A9B4C8;
  --line: #2A3448; --line-strong: #46536B; --focus: #8AB4FF; --ok: #5CC08A; --ok-bg: #12291F; --ng: #FF8A80; --ng-bg: #33191A;
  --note-bg: #18212B; --note-line: #4F6A88; --accent-soft: #12312C; --accent-ink: #5FD3C3; --marker: rgba(255, 210, 94, .32); --marker-hl: rgba(255, 210, 94, .2); --mark-ink: #5FD3C3; --dots: rgba(95, 211, 195, .12);
  --hero-bg: linear-gradient(180deg, #12312C 0%, #0B1222 100%);
  --shadow: none; --shadow-l: none; color-scheme: dark;
}

/* ---- 土台 ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.8; -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.4; font-weight: 700; word-break: auto-phrase; overflow-wrap: normal; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
svg { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: var(--radius-s); font-weight: 700; }
.skip:focus { top: 12px; }
main:focus { outline: none; }
.preview-bar { background: var(--preview-bg); color: #fff; text-align: center; font-size: 13px; line-height: 1.5; padding: 6px 12px; }

/* ---- ヘッダー ---- */
.site-head { position: sticky; top: 0; z-index: 20; background: var(--header-bg); color: var(--ink); border-bottom: 1px solid var(--line); }
.head-in { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: inherit; text-decoration: none; }
.logo-mark { width: 28px; height: 28px; }
.logo-text { font-weight: 700; font-size: 17px; letter-spacing: .02em; }
.gnav { display: flex; gap: 4px; }
.gnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--muted); font-size: 15px; font-weight: 700; text-decoration: none; border-radius: var(--radius-s); position: relative; }
.gnav a:hover { color: var(--ink); background: var(--surface-2); }
.gnav a[aria-current="page"] { color: var(--ink); }
.gnav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 3px; border-radius: 2px; background: var(--accent); }

/* ---- ボタン（角丸 12px・高さ 52px／小 44px。主ボタンは1画面に1つ） ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; font: inherit; font-size: 16px; font-weight: 700; line-height: 1.3; text-decoration: none; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--radius-btn); cursor: pointer; transition: background-color .15s, border-color .15s; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.05); border-color: var(--accent); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn svg { width: 20px; height: 20px; }

/* ---- トップの帯（ヒーロー）：薄いティール → 白、ぼかした円と点の模様、PC は右にイラスト ---- */
.hero { position: relative; overflow: hidden; isolation: isolate; background: var(--hero-bg); color: var(--ink); border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(var(--dots) 1.3px, transparent 1.6px); background-size: 20px 20px; -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 80%); mask-image: linear-gradient(180deg, #000 0%, transparent 80%); }
.blob { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.blob.b1 { width: 560px; height: 560px; right: -180px; top: -220px; background: radial-gradient(circle, rgba(13, 128, 121, .22) 0%, rgba(13, 128, 121, 0) 68%); }
.blob.b2 { width: 420px; height: 420px; left: -160px; bottom: -200px; background: radial-gradient(circle, rgba(255, 210, 94, .5) 0%, rgba(255, 210, 94, 0) 68%); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); grid-template-areas: "copy art" "picker art" "trust art"; column-gap: 48px; align-items: start; padding-top: 56px; padding-bottom: 56px; }
.hero-copy { grid-area: copy; }
.badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 4px 14px; font-size: 13px; font-weight: 700; line-height: 1.6; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--marker); box-shadow: 0 0 0 3px rgba(255, 210, 94, .35); }
.hero h1 { margin: 0 0 16px; font-size: 46px; line-height: 1.35; font-weight: 800; letter-spacing: -.01em; }
.hero h1 em, .mark { font-style: normal; color: var(--mark-ink); background: linear-gradient(transparent 65%, var(--marker-hl) 65%); padding: 0 .06em; }
.hero-lead { margin: 0 0 24px; max-width: 32em; color: var(--muted); font-size: 17px; line-height: 1.8; }
.trust { grid-area: trust; list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 22px; color: var(--ink); font-size: 15px; font-weight: 700; }
.trust li { display: flex; align-items: center; gap: 8px; }
.trust svg { color: var(--accent-ink); width: 22px; height: 22px; }
.hero-art { grid-area: art; align-self: center; width: 100%; height: auto; }
.picker { grid-area: picker; background: var(--surface); color: var(--ink); border-radius: var(--radius-l); box-shadow: var(--shadow-l); border: 1px solid var(--line); padding: 20px 24px 16px; display: grid; gap: 14px; }
.picker-title { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.picker-title::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--accent); }
.pk-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 12px; }
.field { display: grid; gap: 6px; }
.field label, .opt legend { font-size: 14px; font-weight: 700; color: var(--ink); }
select { font: inherit; font-size: 16px; color: var(--ink); width: 100%; min-height: 50px; padding: 0 44px 0 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566173' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px; appearance: none; -webkit-appearance: none; }
select:hover { border-color: var(--ink); }
.pk-go { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pk-go .btn, .actions .btn { white-space: nowrap; padding: 0 14px; }
.picker-note { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted); }

/* ---- セクション：番号付きラベル → 見出し → 説明。白と薄い色を交互に ---- */
.sec { padding: 72px 0; }
.sec-white { background: var(--surface); }
.sec-tint { background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-label { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--accent-ink); letter-spacing: .04em; }
.sec-label span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--accent-soft); font-weight: 800; font-variant-numeric: tabular-nums; position: relative; }
.sec-label span::after { content: ""; position: absolute; right: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--marker); }
.sec-title { margin: 0 0 8px; font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.sec-lead { margin: 0 0 32px; color: var(--muted); max-width: 40em; }
/* 使い方：番号の丸を線でつなぐ */
.howto { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.howto li { position: relative; }
.howto li:not(:last-child)::after { content: ""; position: absolute; top: 25px; left: 68px; right: -12px; height: 2px; background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 14px); opacity: .6; }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 16px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 6px var(--accent-soft); position: relative; z-index: 1; }
.howto h3, .feat h3 { margin: 0 0 6px; font-size: 18px; }
.howto p, .feat p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
/* 特徴カード：アイコンを薄いティールの四角に。触れると少し浮く */
.feat { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.feat li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 20px; transition: transform .2s, box-shadow .2s; }
.feat li:hover { transform: translateY(-3px); box-shadow: var(--shadow-l); }
.fi { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: var(--radius-btn); background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 14px; }
.fi svg { width: 22px; height: 22px; }
/* 締めの帯（ページの終わりに1つ） */
.cta { position: relative; overflow: hidden; isolation: isolate; background: var(--band-bg); color: #FFFFFF; padding: 56px 0; margin-top: 64px; }
.cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255, 255, 255, .14) 1.3px, transparent 1.6px); background-size: 20px 20px; -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%); mask-image: linear-gradient(90deg, transparent 30%, #000 100%); }
.cta::after { content: ""; position: absolute; z-index: -1; width: 380px; height: 380px; right: -100px; bottom: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 210, 94, .45) 0%, rgba(255, 210, 94, 0) 68%); }
.cta-in { display: flex; align-items: center; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; }
.cta h2 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.01em; color: #FFFFFF; }
.cta p { margin: 0; color: #FFFFFF; max-width: 36em; }
.btn.cta-btn { background: #FFFFFF; border-color: #FFFFFF; color: #0B6E69; padding: 0 24px; }
.btn.cta-btn:hover { border-color: #FFD25E; box-shadow: 0 0 0 3px rgba(255, 210, 94, .6); }
.cta :focus-visible { outline-color: #FFD25E; }
.cta + .site-foot, main:has(.cta) + .site-foot { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .feat li { transition: none; } .feat li:hover { transform: none; } }

/* ---- 学年タブ・一覧 ---- */
.tabs { position: sticky; top: 64px; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; margin-top: 16px; background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.grades .tabs { background: var(--surface); }
.tab { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 15px; text-decoration: none; }
.tab:hover { border-color: var(--ink); }
.tab.on { background: var(--accent-soft); border-color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-ink); }
.gdot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--gc, var(--muted)); flex: none; }
.g1 { --gc: var(--g1); } .g2 { --gc: var(--g2); } .g3 { --gc: var(--g3); } .g4 { --gc: var(--g4); } .g5 { --gc: var(--g5); } .g6 { --gc: var(--g6); } .g7 { --gc: var(--g7); }
.grade { padding: 24px 0 8px; scroll-margin-top: 140px; }
.grade-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.grade-head .gdot { width: 14px; height: 14px; border-radius: 4px; }
.grade-head h3 { margin: 0; font-size: 22px; }
.grade-count { color: var(--muted); font-size: 14px; font-weight: 700; }
.grade-more { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 700; font-size: 15px; text-decoration: none; }
.grade-more svg { width: 18px; height: 18px; }
.catbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; box-shadow: var(--shadow); }
.catbox summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 20px; cursor: pointer; font-weight: 700; font-size: 17px; border-radius: var(--radius); }
.catbox summary::-webkit-details-marker { display: none; }
.cat-n { font-size: 13px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 10px; }
.cat-chev { margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.catbox[open] .cat-chev { transform: translateY(2px) rotate(-135deg); }
.catbox .cards { padding: 0 16px 16px; }
body.js-tabs .grade { padding-top: 16px; }

/* ---- カード（単元） ---- */
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card-li { position: relative; }
.card { display: flex; flex-direction: column; gap: 8px; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 44px 12px 16px; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card-title { font-weight: 700; line-height: 1.55; }
.card-meta { display: flex; margin-right: -28px; align-items: center; gap: 6px; min-height: 44px; margin-top: auto; padding-right: 140px; font-size: 13px; line-height: 1.4; flex-wrap: wrap; color: var(--muted); font-weight: 700; }
.card-go { position: absolute; right: 14px; top: 16px; color: var(--muted); }
.card:hover .card-go { color: var(--accent-ink); }
.card-app { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: var(--radius-btn); border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; }
.card-app:hover { border-color: var(--ink); }
.card-app svg { width: 18px; height: 18px; }

/* ---- ページ上部の帯（ヒーロー以外） ---- */
.page-hero { position: relative; overflow: hidden; isolation: isolate; background: var(--hero-bg); color: var(--ink); padding: 32px 0 44px; border-bottom: 1px solid var(--line); }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(var(--dots) 1.3px, transparent 1.6px); background-size: 20px 20px; -webkit-mask-image: linear-gradient(90deg, transparent 45%, #000 100%); mask-image: linear-gradient(90deg, transparent 45%, #000 100%); }
.page-hero::after { content: ""; position: absolute; z-index: -1; width: 460px; height: 460px; right: -140px; top: -240px; border-radius: 50%; background: radial-gradient(circle, rgba(13, 128, 121, .18) 0%, rgba(13, 128, 121, 0) 68%); }
.crumbs ol { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .7; }
.crumbs a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); }
.crumbs a:hover { color: var(--ink); }
.page-hero h1 { margin: 0; font-size: 32px; line-height: 1.4; font-weight: 800; letter-spacing: -.01em; }
.h1-sub { font-size: .6em; color: var(--muted); margin-left: .3em; white-space: nowrap; }
.ph-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 8px 0 0; color: var(--muted); font-size: 14px; font-weight: 700; }
.intro { max-width: 46em; margin: 24px 0 20px; font-size: 17px; line-height: 1.9; }
.intro p { margin: 0 0 8px; }

/* ---- ドリルのページ：操作の箱 ---- */
.drill-body { padding-bottom: 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "mode mode" "actions opts" "share opts"; gap: 20px 32px; margin-bottom: 24px; }
.modetabs { grid-area: mode; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px; background: var(--surface-2); border-radius: var(--radius-btn); }
.modetab { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 6px 12px; border: 1.5px solid transparent; border-radius: var(--radius-s); background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 16px; line-height: 1.3; cursor: pointer; text-align: left; }
.modetab small { display: block; font-size: 13px; font-weight: 400; }
.modetab:hover { color: var(--ink); }
.modetab.on { background: var(--surface); color: var(--ink); border-color: var(--accent-ink); box-shadow: var(--shadow); }
.modetab.on svg { color: var(--accent-ink); }
.actions { grid-area: actions; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.opts { grid-area: opts; display: grid; gap: 16px; align-content: start; }
.opt { border: 0; margin: 0; padding: 0; min-width: 0; }
.opt legend { padding: 0; margin-bottom: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-i { position: relative; display: inline-flex; }
.seg-i input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-i > span, .seg .lv { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 64px; justify-content: center; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.seg-i > span svg { width: 18px; height: 18px; display: none; }
.seg-i input:checked + span, .seg .lv.on { background: var(--accent-soft); border-color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-ink); }
.seg-i.chk input:checked + span svg { display: block; color: var(--accent-ink); }
.seg-i.fixed > span { cursor: default; color: var(--muted); border-style: dashed; }
.seg-i input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg-i:hover input:not(:checked) + span, .seg .lv:not(.on):hover { border-color: var(--ink); }
.share { grid-area: share; align-self: end; }
.share-l { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.share-l svg { width: 18px; height: 18px; }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); }
.lv-note { font-size: 14px; color: var(--muted); margin: -12px 4px 20px; line-height: 1.7; }
.canvas { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px 16px 8px; }
.canvas-cap { margin: 0 0 8px; text-align: center; font-size: 14px; color: var(--muted); font-weight: 700; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 32px 0; }
.info, .guide, .prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.info h2, .guide h2 { margin: 0 0 12px; font-size: 20px; }
.info ul, .info ol { margin: 0; padding: 0; list-style: none; }
.info li { margin: 0 0 10px; font-size: 15.5px; line-height: 1.8; }
.ticks li { display: flex; gap: 10px; }
.ticks svg { color: var(--ok); margin-top: 4px; }
.nums { counter-reset: n; }
.nums li { counter-increment: n; display: flex; gap: 10px; }
.nums li::before { content: counter(n); flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-top: 2px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 700; }
.guide { margin: 32px 0 8px; }
.guide h3 { font-size: 17px; margin: 24px 0 8px; padding-left: 12px; border-left: 4px solid var(--accent); }
.guide p, .guide li, .guide dd { line-height: 1.9; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.guide-grid h3 { margin-top: 8px; }
.faq { margin: 0; display: grid; gap: 8px; }
.faq > div { background: var(--surface-2); border-radius: var(--radius-s); padding: 14px 16px; }
.faq dt { font-weight: 700; display: flex; gap: 8px; }
.faq dt::before { content: "Q"; flex: none; color: var(--accent-ink); font-weight: 800; }
.faq dd { margin: 6px 0 0; display: flex; gap: 8px; }
.faq dd::before { content: "A"; flex: none; color: var(--muted); font-weight: 800; }
.related { margin: 40px 0 12px; }
.related h2, .winter-grade h2 { font-size: 22px; margin: 0 0 16px; }
.more { margin: 16px 0 0; }

/* ---- アプリで解く ---- */
body.app-mode .canvas, body.app-mode .actions, body.app-mode .opt-count, body.app-mode .tb-opts, body.app-mode .share { display: none; }
body.app-mode .panel { grid-template-columns: minmax(0, 1fr); grid-template-areas: "mode" "opts"; }
body.app-mode .panel:not(:has(.opt-lv)) { grid-template-areas: "mode"; }
body.app-mode .panel:not(:has(.opt-lv)) .opts { display: none; }
.app-panel { max-width: 640px; margin: 0 auto 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 20px; }
.quiz-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.quiz-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
@media (prefers-reduced-motion: reduce) { .quiz-bar span, .cat-chev { transition: none; } }
.quiz-top { display: flex; justify-content: space-between; color: var(--muted); font-weight: 700; font-size: 15px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.quiz-q { font-size: 26px; font-weight: 700; line-height: 1.7; margin: 8px 0 16px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.quiz-q .fr, .quiz-in .fr, .quiz-fb .fr, .quiz-steps .fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1.1; margin: 0 2px; }
.quiz-q .fr > span:first-child, .quiz-in .fr > span:first-child, .quiz-fb .fr > span:first-child, .quiz-steps .fr > span:first-child { border-bottom: 2px solid currentColor; padding: 0 3px; }
.quiz-in { min-height: 68px; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; border: 2px solid var(--accent-ink); border-radius: var(--radius-btn); margin-bottom: 14px; padding: 6px 12px; background: var(--surface); font-variant-numeric: tabular-nums; }
.quiz-in .ph { font-size: 16px; color: var(--muted); font-weight: 400; }
.quiz-in.done { border-color: var(--line-strong); }
.quiz-in .to { font-size: 16px; margin: 0 2px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key { min-height: 56px; font: inherit; font-size: 24px; font-weight: 700; border: 1px solid var(--line-strong); border-radius: var(--radius-btn); background: var(--surface-2); color: var(--ink); cursor: pointer; touch-action: manipulation; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.key:hover { border-color: var(--ink); }
.key.sym { font-size: 16px; }
.key svg { width: 26px; height: 26px; }
.key.go { grid-column: 1 / -1; background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-size: 18px; }
.key:active { transform: translateY(1px); }
.quiz-hint { margin: 12px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
@media (hover: none) { .quiz-hint { display: none; } }
.quiz-fb { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; padding: 14px 16px; border-radius: var(--radius-btn); margin-bottom: 12px; border-left: 5px solid currentColor; }
.quiz-fb svg { width: 26px; height: 26px; }
.quiz-fb.ok { background: var(--ok-bg); color: var(--ok); }
.quiz-fb.ng { background: var(--ng-bg); color: var(--ng); }
.quiz-fb.ng b { color: var(--ink); }
.quiz-steps { margin: 0 0 16px; padding: 12px 16px 12px 2.2em; line-height: 1.9; background: var(--note-bg); border-left: 4px solid var(--note-line); border-radius: var(--radius-s); }
.quiz-next { width: 100%; }
.quiz-end { text-align: center; padding: 12px 0; }
.quiz-score { margin: 8px 0; display: flex; align-items: baseline; justify-content: center; gap: 6px; font-weight: 700; font-size: 20px; }
.quiz-score b { font-size: 56px; line-height: 1.1; font-weight: 800; color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* ---- 説明ページ・まとめページ ---- */
.prose { max-width: 720px; margin: 32px auto; font-size: 17px; line-height: 1.9; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 22px; margin: 32px 0 8px; }
.prose ul { padding-left: 1.3em; }
.prose li { margin: 6px 0; }
.art-meta { font-size: 14px; color: var(--muted); margin: 0 0 16px; }
.winter { padding-bottom: 8px; }
.winter .intro { max-width: 46em; }
.winter .prose { max-width: none; margin: 24px 0; }
.winter-grade { margin: 32px 0; }
.winter-grade > p { margin: 0 0 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.chip-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 15px; text-decoration: none; }
.chip-link:hover { border-color: var(--ink); }

/* ---- フッター ---- */
.site-foot { background: var(--surface); color: var(--muted); border-top: 1px solid var(--line); padding: 48px 0 32px; font-size: 14px; line-height: 1.7; }
.foot-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-foot .logo { color: var(--ink); }
.foot-brand p { margin: 12px 0 0; max-width: 28em; }
.site-foot h2 { color: var(--ink); font-size: 15px; margin: 0 0 8px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot nav a, .foot-services a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink); text-decoration: none; }
.site-foot nav a:hover, .foot-services a:hover, .foot-op a:hover { text-decoration: underline; }
.foot-bottom { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 24px; display: grid; gap: 8px; }
.foot-op { margin: 0; color: var(--ink); font-weight: 700; }
.foot-op a { color: var(--ink); font-weight: 400; }
.foot-op { display: flex; flex-wrap: wrap; gap: 0 8px; }
.foot-op span { color: var(--line-strong); }
.foot-note, .copy { margin: 0; }
.foot-services { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 8px 0; }
.foot-services h2 { margin: 0; font-size: 14px; }
.foot-services ul { display: flex; flex-wrap: wrap; gap: 0 16px; }
.foot-services a[aria-current] { font-weight: 700; }

/* ---- 画面の幅ごと ---- */
@media (max-width: 960px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "picker" "trust"; padding-top: 32px; padding-bottom: 40px; }
  .hero-art { display: none; }
  .hero h1 { font-size: 36px; }
  .feat { grid-template-columns: 1fr 1fr; }
  .panel { grid-template-columns: minmax(0, 1fr); grid-template-areas: "mode" "actions" "opts" "share"; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .head-in { flex-direction: column; align-items: stretch; gap: 0; min-height: 0; }
  .site-head { position: static; }
  .logo { min-height: 52px; }
  .gnav { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; margin: 0 -8px; gap: 0; border-top: 1px solid var(--line); }
  .gnav a { min-height: 46px; padding: 0 8px; font-size: 14px; justify-content: center; }
  .gnav a[aria-current="page"]::after { left: 8px; right: 8px; bottom: 2px; }
  .tabs { top: 0; }
  .grade { scroll-margin-top: 80px; }
  .hero h1 { font-size: clamp(24px, 7vw, 28px); }
  .hero-lead { font-size: 16px; }
  .badge { margin-bottom: 12px; }
  .hero-lead { margin-bottom: 20px; }
  .blob.b1 { width: 340px; height: 340px; right: -150px; top: -150px; }
  .blob.b2 { display: none; }
  .picker { padding: 20px 16px; gap: 14px; }
  .trust { flex-direction: column; gap: 8px; }
  .page-hero h1 { font-size: 24px; }
  .intro { font-size: 16.5px; margin-top: 20px; }
  .howto, .feat, .info-grid, .guide-grid, .foot-cols { grid-template-columns: minmax(0, 1fr); }
  .how { padding-top: 48px; }
  .sec { padding: 48px 0; }
  .sec-title { font-size: 22px; }
  .sec-lead { margin-bottom: 20px; }
  .howto { gap: 20px; margin-top: 20px; }
  .howto li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 16px; }
  .howto li:not(:last-child)::after { top: 52px; bottom: -16px; left: 21px; right: auto; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--accent) 0 6px, transparent 6px 11px); }
  .step-n { width: 44px; height: 44px; font-size: 19px; margin: 0; box-shadow: 0 0 0 5px var(--accent-soft); }
  .feat { gap: 12px; }
  .feat li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 14px; padding: 16px; }
  .feat .fi { grid-row: span 2; margin: 0; }
  .feat h3 { margin: 0; }
  .pk-fields { grid-template-columns: minmax(0, 1fr); }
  .cta { padding: 40px 0; margin-top: 48px; }
  .cta h2 { font-size: 21px; }
  .cta-btn { width: 100%; }
  .page-hero { padding: 20px 0 28px; }
  .foot-op { flex-direction: column; } .foot-op span { display: none; }
  .panel { padding: 16px; gap: 16px; }
  .modetab { flex-direction: column; gap: 2px; text-align: center; min-height: 64px; }
  .info, .guide, .prose { padding: 20px 16px; }
  .prose { font-size: 16.5px; }
  .canvas { padding: 12px 8px 4px; margin: 0 -8px; }
  #sheet { overflow-x: hidden; }
  #sheet .sheet { zoom: .58; }
  .quiz-q { font-size: 24px; }
  .grade-more { margin-left: 0; width: 100%; }
  .actions, .pk-go { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .wrap { padding: 0 12px; }
  .gnav a { font-size: 13px; padding: 0 4px; }
  #sheet .sheet { zoom: .5; }
}

/* ---- プリント本体（画面でも紙の見た目。印刷物の見た目は変えない） ---- */
#sheet { margin: 16px 0; overflow-x: auto; }
.sheet { overflow-wrap: normal; background: var(--paper); color: #222; width: 100%; max-width: 760px; margin: 0 auto 20px; padding: 28px 32px; border: 1px solid #ccc; box-shadow: 0 2px 8px rgba(0,0,0,.08); min-width: 560px; }
.sheet-head { border-bottom: 2px solid #222; padding-bottom: 6px; margin-bottom: 14px; }
.sheet-title { font-size: 1.35rem; margin: 0 0 6px; }
.tag { font-size: .9rem; color: var(--ans); border: 1px solid var(--ans); border-radius: 4px; padding: 0 6px; vertical-align: middle; }
.fields { display: flex; gap: 24px; font-size: .95rem; flex-wrap: wrap; }
.line-field { display: inline-block; width: 160px; border-bottom: 1px solid #222; margin-left: 6px; }
.score { margin-left: auto; }
.qs { list-style: none; padding: 0; margin: 0; display: grid; gap: 0 24px; grid-auto-flow: column; grid-template-rows: repeat(var(--rows), auto); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.q { font-variant-numeric: tabular-nums; }
.q.h { font-size: 1.25rem; padding: 7px 0; border-bottom: 1px dotted #ddd; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.no { font-size: .8rem; color: #888; min-width: 2.2em; }
.blank { display: inline-block; width: 3.2em; border-bottom: 1px solid #999; }
.blank.s { width: 2em; }
.ans { color: var(--ans); font-weight: 700; }
.q.v { padding: 8px 0 18px; display: flex; gap: 6px; }
.hissan { font-size: 1.45rem; letter-spacing: .35em; font-family: "Courier New", ui-monospace, monospace; font-weight: 600; }
.hissan .r { display: flex; justify-content: flex-end; min-width: 4.6em; }
.hissan .o { margin-right: auto; letter-spacing: 0; }
.hissan .line { border-bottom: 2px solid #222; }
.hissan .res { min-height: 1.7em; }
.q.v.big .res { min-height: 5.4em; }
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .8em; line-height: 1.15; margin: 0 .1em; }
.fr > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 .15em; }
.box { display: inline-block; border: 1.5px solid #333; width: 1.6em; text-align: center; line-height: 1.3; color: transparent; }
.q.x { flex-wrap: wrap; white-space: normal; }
.q.x.big { padding: 10px 0 64px; }
.q.x .sol { margin-left: auto; }
.q.word { font-size: 1.02rem; line-height: 1.8; align-items: flex-start; }
.q.word .expr { flex: 1 1 calc(100% - 3em); min-width: 0; }
.q.word .ans, .q.word .blank { margin-left: auto; }
.blank.w { width: 5em; }
.strike { text-decoration: line-through; text-decoration-thickness: 2px; color: #999; }

.sheet.steps { font-size: .82rem; }
.steps-list { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.steps-list > li { break-inside: avoid; padding: 6px 0 8px; border-bottom: 1px dotted #ddd; }
.sheet.steps.one-col .steps-list { columns: 1; }
.sq { font-size: .95rem; margin-bottom: 2px; }
.sq b { color: var(--ans); }
.st { margin: 0; padding-left: 1.4em; color: #333; line-height: 1.6; }
.st .fr { font-size: .78em; }
body.no-steps .sheet.steps { display: none; }.sheet { color: #222; }

/* プリント下端のサイト名とQR（印刷物からサイトに来てもらうため） */
.sheet-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 8px; padding-top: 6px; border-top: 1px solid #e3e3e3; font-size: 9px; line-height: 1.35; color: #8a8a8a; text-align: right; }
.sheet-foot small { font-size: 8px; color: #a0a0a0; }
.sheet-qr { width: 40px; height: 40px; flex: none; }

.lvtag { font-size: .8rem; font-weight: 700; margin-left: 10px; padding: 1px 10px; border: 1.5px solid #555; border-radius: 999px; vertical-align: middle; color: #333; }

/* ---- 印刷（A4・問題1枚＋答え1枚）。印刷物は読みやすさを優先し、色は答えの赤だけ ---- */
@page { size: A4 portrait; margin: 12mm; }
@media print {
  body { background: #fff; color: #222; }
  .no-print, .skip, .cta, .blob, .hero-art, .site-head, .site-foot, .controls, .panel, .info-grid, .about, .related, .crumbs, .page-hero, .intro, .preview-bar, .lv-note, .guide, .canvas-cap, .modetabs, .app-panel { display: none !important; }
  body.app-mode .canvas { display: block !important; }
  .wrap { max-width: none; padding: 0; }
  .canvas { background: none; padding: 0; border: 0; border-radius: 0; margin: 0; }
  #sheet { margin: 0; overflow: visible; }
  .sheet { box-shadow: none; border: 0; padding: 0; margin: 0; max-width: none; min-width: 0; break-after: page; height: 266mm; display: flex; flex-direction: column; overflow: hidden; zoom: 1 !important; }
  .qs { flex: 1; grid-template-rows: repeat(var(--rows), 1fr); }
  .q.h { align-items: center; }
  .sheet:last-child { break-after: auto; }
  .sheet.steps { height: auto; display: block; overflow: visible; }
  body.no-answers .sheet.answers + .sheet.steps { break-before: page; }
  body.no-answers .sheet.answers { display: none; }
  body.no-answers .sheet:first-child { break-after: auto; }
  body.no-steps .sheet.answers { break-after: auto; }
  .ans { color: #c62828; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet-qr { width: 15mm; height: 15mm; } .sheet-foot { flex: none; }
}

/* サイト名の下の運営者名（目立たせすぎない補助色） */
.logo-text { display: inline-flex; flex-direction: column; line-height: 1.2; }
.logo-by { font-size: 11px; font-weight: 400; letter-spacing: .02em; color: var(--muted); }
