/* ===================================
   無料知育ぬりえ — 共通スタイル
   まなびHack のデザイントークンに合わせる
   =================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #0F172A;
  --mint:       #2DD4BF;
  --mint-soft:  rgba(45,212,191,0.1);
  --mint-border:rgba(45,212,191,0.2);
  --crayon:     #F97316;
  --crayon-soft:rgba(249,115,22,0.08);
  --bg:         #FFFFFF;
  --bg-sub:     #F8FAFC;
  --text:       #1E293B;
  --text-sub:   #64748B;
  --text-muted: #94A3B8;
  --border:     #E2E8F0;
  --radius:     14px;
  --radius-sm:  10px;
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow:     0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
  --t:          0.15s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.logo-gradient {
  background: linear-gradient(135deg, var(--navy) 0%, var(--mint) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; font-weight: 800;
}

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 56px; display: flex; align-items: center; gap: 1rem;
  padding: 0 clamp(1rem, 4vw, 2rem);
}
.header-back {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8rem; font-weight: 600; color: var(--text-sub);
  text-decoration: none; padding: .35rem .7rem;
  border: 1px solid var(--border); border-radius: 999px; transition: var(--t);
}
.header-back:hover { color: var(--navy); border-color: var(--mint); background: var(--mint-soft); }
.header-logo { font-size: 1rem; text-decoration: none; }
.header-nav { margin-left: auto; display: flex; gap: 1rem; }
.header-nav a { font-size: .82rem; font-weight: 600; color: var(--text-sub); text-decoration: none; }
.header-nav a:hover { color: var(--mint); }

/* ===== レイアウト ===== */
.wrap { max-width: 860px; margin: 0 auto; padding: 0 clamp(1rem, 5vw, 2rem); }
.wrap-wide { max-width: 1120px; margin: 0 auto; padding: 0 clamp(1rem, 5vw, 2rem); }

.breadcrumb { font-size: .78rem; color: var(--text-muted); padding: 1rem 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; }
.breadcrumb li::after { content: '›'; margin-left: .35rem; color: var(--border); }
.breadcrumb li:last-child::after { content: ''; }
.breadcrumb a { color: var(--text-sub); text-decoration: none; }
.breadcrumb a:hover { color: var(--mint); }

/* ===== 見出し ===== */
.page-head { padding: 1.2rem 0 0; }
.page-head h1 {
  font-size: clamp(1.45rem, 4.6vw, 2.1rem);
  font-weight: 800; line-height: 1.45; letter-spacing: -0.01em;
}
.page-lead { margin-top: .9rem; color: var(--text-sub); font-size: .96rem; }

.sec { margin-top: 2.6rem; }
.sec > h2 {
  font-size: clamp(1.15rem, 3.4vw, 1.4rem); font-weight: 800;
  display: flex; align-items: center; gap: .5rem; line-height: 1.5;
}
.sec > h2 + p { margin-top: .7rem; color: var(--text-sub); font-size: .94rem; }
.sec h3 { font-size: 1rem; font-weight: 700; margin-bottom: .2rem; }

/* ===== ぬりえ画像 ===== */
.sheet {
  margin-top: 1.1rem; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(.6rem, 2vw, 1.2rem);
}
.sheet img { display: block; width: 100%; height: auto; }

/* ===== 印刷・ダウンロード ===== */
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.1rem; }
.btn {
  flex: 1 1 220px; display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; min-height: 54px; padding: .8rem 1.2rem;
  border-radius: 999px; font-size: 1rem; font-weight: 700;
  text-decoration: none; border: none; cursor: pointer; transition: var(--t);
  font-family: inherit;
}
.btn-print { background: var(--navy); color: #fff; }
.btn-print:hover { background: #1E293B; transform: translateY(-1px); }
.btn-pdf { background: var(--mint-soft); color: #0D9488; border: 1.5px solid var(--mint-border); }
.btn-pdf:hover { background: rgba(45,212,191,0.18); transform: translateY(-1px); }
.actions-note { margin-top: .6rem; font-size: .78rem; color: var(--text-muted); }

/* ===== 情報カード ===== */
.qa { margin-top: 1.1rem; display: grid; gap: .8rem; }
.qa-item {
  background: var(--bg-sub); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem 1.15rem;
}
.qa-item p { font-size: .94rem; color: var(--text-sub); }

.callout {
  margin-top: 1.1rem; background: var(--crayon-soft);
  border: 1px solid rgba(249,115,22,0.18); border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.callout p + p { margin-top: .6rem; }
.callout p { font-size: .95rem; }

.spec { margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.spec div {
  flex: 1 1 118px; background: var(--bg-sub); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .8rem 1rem;
}
.spec dt { font-size: .74rem; color: var(--text-muted); font-weight: 600; }
.spec dd { font-size: 1.02rem; font-weight: 700; margin-top: .15rem; }

.tick { margin-top: 1.1rem; list-style: none; display: grid; gap: .55rem; }
.tick li { position: relative; padding-left: 1.7rem; font-size: .95rem; }
.tick li::before {
  content: ''; position: absolute; left: .35rem; top: .72em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--mint);
}

/* ===== リンクカード（ゲーム／ぬりえ） ===== */
.link-grid { margin-top: 1.1rem; display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.link-card {
  display: flex; align-items: center; gap: .8rem;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .85rem 1rem; text-decoration: none; color: var(--text); transition: var(--t);
}
.link-card:hover { border-color: var(--mint); box-shadow: var(--shadow); transform: translateY(-2px); }
.link-card-emoji { font-size: 1.6rem; line-height: 1; }
.link-card-title { font-size: .92rem; font-weight: 700; }
.link-card-sub { font-size: .76rem; color: var(--text-muted); }

.nurie-grid { margin-top: 1.2rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.nurie-card {
  display: flex; gap: .9rem; align-items: flex-start; text-decoration: none; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem; transition: var(--t);
}
.nurie-card:hover { border-color: var(--mint); box-shadow: var(--shadow); transform: translateY(-2px); }
.nurie-card-thumb {
  flex: 0 0 112px; aspect-ratio: 1020 / 720; display: flex; align-items: center; justify-content: center;
  background: var(--bg-sub); border-radius: var(--radius-sm); overflow: hidden;
}
.nurie-card-thumb img { width: 100%; height: auto; display: block; }
.nurie-card-body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.nurie-card-meta { display: flex; flex-wrap: wrap; gap: .3rem; }
.nurie-chip {
  font-size: .68rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px;
  background: var(--mint-soft); color: #0D9488; border: 1px solid var(--mint-border);
}
.nurie-chip-age { background: var(--bg-sub); color: var(--text-sub); border-color: var(--border); }
.nurie-card-title { font-size: 1rem; font-weight: 700; line-height: 1.4; }
.nurie-card-desc { font-size: .8rem; color: var(--text-sub); line-height: 1.65; }

/* ===== Footer ===== */
.page-footer {
  margin-top: 4rem; padding: 2.2rem 1.5rem 2.6rem;
  border-top: 1px solid var(--border); background: var(--bg-sub); text-align: center;
}
.page-footer .footer-logo { font-size: 1rem; font-weight: 800; }
.footer-links { margin: .9rem 0; display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; justify-content: center; }
.footer-links a { font-size: .8rem; color: var(--text-sub); text-decoration: none; }
.footer-links a:hover { color: var(--mint); }
.footer-copy { font-size: .74rem; color: var(--text-muted); }

/* ===== 印刷（ぬりえの線画だけを1枚に） ===== */
@media print {
  .site-header, .breadcrumb, .page-lead, .actions, .actions-note,
  .sec, .page-footer, .print-hide { display: none !important; }
  .sec-sheet, .sec-sheet > .sheet { display: block !important; }
  .sec-sheet > h2 { display: none !important; }
  body { background: #fff; }
  .page-head { padding: 0; }
  .page-head h1 { font-size: 14pt; text-align: center; margin-bottom: 6pt; }
  .sheet { border: none; box-shadow: none; padding: 0; margin: 0; }
  .sheet img { width: 100%; max-height: 90vh; object-fit: contain; }
  @page { size: A4 portrait; margin: 10mm; }
}

/* ===================================
   題材ページの中身（ぬりえ共通パーツ）
   =================================== */

/* 基本データ（時代・大きさ・食べもの など） */
.factgrid { margin-top: 1.1rem; display: grid; gap: .55rem; }
.factgrid div {
  display: grid; grid-template-columns: 6.6rem 1fr; gap: .5rem 1rem;
  align-items: baseline; background: var(--bg-sub);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .7rem .95rem;
}
.factgrid dt { font-size: .76rem; font-weight: 700; color: var(--text-sub); }
.factgrid dd { font-size: .93rem; }
@media (max-width: 420px) {
  .factgrid div { grid-template-columns: 1fr; gap: .1rem; }
}

/* 絵の中から探してみよう（タップでチェックできる） */
.find-list { margin-top: 1.1rem; display: grid; gap: .55rem; }
.find-item {
  display: flex; align-items: center; gap: .75rem;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: .75rem .95rem;
  cursor: pointer; user-select: none; transition: var(--t);
  font-size: .95rem;
}
.find-item:hover { border-color: var(--mint); }
.find-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.find-box {
  flex: 0 0 26px; height: 26px; border: 2px solid var(--border);
  border-radius: 8px; display: grid; place-items: center;
  font-size: .95rem; color: #fff; transition: var(--t);
}
.find-item input:checked ~ .find-box { background: var(--mint); border-color: var(--mint); }
.find-item input:checked ~ .find-box::after { content: '✓'; font-weight: 800; }
.find-item input:focus-visible ~ .find-box { outline: 2px solid var(--mint); outline-offset: 2px; }
.find-item:has(input:checked) { border-color: var(--mint); background: var(--mint-soft); }
.find-count { margin-left: auto; font-size: .78rem; color: var(--text-muted); font-weight: 700; }

/* 塗り見本 */
.sample { margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: flex-start; }
.sample-img {
  flex: 0 0 clamp(150px, 38vw, 210px);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: #fff;
}
.sample-img img { display: block; width: 100%; height: auto; }
.sample-body { flex: 1 1 260px; }
.sample-body p { font-size: .94rem; }
.sample-body p + p { margin-top: .6rem; }
.sample-cap { margin-top: .4rem; font-size: .74rem; color: var(--text-muted); text-align: center; }

/* クイズ */
.quiz {
  margin-top: .8rem; background: var(--bg-sub);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.quiz-q { font-size: .98rem; font-weight: 700; line-height: 1.6; }
.quiz-choices { margin-top: .7rem; display: grid; gap: .45rem; }
.quiz-choice {
  font-family: inherit; font-size: .93rem; text-align: left;
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: .7rem .9rem; min-height: 46px; cursor: pointer; transition: var(--t);
  color: var(--text);
}
.quiz-choice:hover:not(:disabled) { border-color: var(--mint); background: var(--mint-soft); }
.quiz-choice:disabled { cursor: default; }
.quiz-choice.is-correct {
  border-color: #34D399; background: rgba(52,211,153,0.14); font-weight: 700;
}
.quiz-choice.is-correct::before { content: '⭕ '; }
.quiz-choice.is-wrong { border-color: #FCA5A5; background: rgba(248,113,113,0.1); }
.quiz-choice.is-wrong::before { content: '❌ '; }
.quiz-answer {
  margin-top: .7rem; font-size: .9rem; color: var(--text-sub);
  background: #fff; border-radius: var(--radius-sm); padding: .7rem .9rem;
  border: 1px dashed var(--border);
}
.quiz-reset {
  margin-top: .9rem; font-family: inherit; font-size: .85rem; font-weight: 700;
  background: none; border: 1.5px solid var(--border); border-radius: 999px;
  padding: .5rem 1.1rem; cursor: pointer; color: var(--text-sub); transition: var(--t);
}
.quiz-reset:hover { border-color: var(--mint); color: var(--navy); }

/* ===================================
   題材ページのカードレイアウト
   =================================== */

.wrap-page { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }

/* 見出しと 印刷/PDF ボタンを横並びに */
.page-top {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem;
  align-items: flex-start; justify-content: space-between;
  padding: 1.2rem 0 0;
}
.page-top-text { flex: 1 1 420px; min-width: 0; }
.page-top h1 {
  font-size: clamp(1.4rem, 3.6vw, 2rem);
  font-weight: 800; line-height: 1.4; letter-spacing: -0.01em;
}
.page-top-sub { margin-top: .5rem; color: var(--text-sub); font-size: .95rem; }
.page-top-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.big-btn {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 56px; padding: .7rem 1.3rem; border-radius: 14px;
  font-size: .95rem; font-weight: 700; text-decoration: none;
  border: none; cursor: pointer; font-family: inherit; transition: var(--t);
  line-height: 1.3;
}
.big-btn small { display: block; font-size: .7rem; font-weight: 600; opacity: .8; }
.big-btn-print { background: #2C6FB5; color: #fff; }
.big-btn-print:hover { background: #245C99; transform: translateY(-1px); }
.big-btn-pdf { background: var(--crayon); color: #fff; }
.big-btn-pdf:hover { background: #EA6A0C; transform: translateY(-1px); }

/* スマホでは見出しまわりを詰めて、ぬりえ本体を早く見せる */
@media (max-width: 700px) {
  .page-top { padding-top: .7rem; gap: .6rem; }
  .page-top h1 { font-size: 1.22rem; }
  .page-top-sub { margin-top: .25rem; font-size: .83rem; }
  .page-top-actions { width: 100%; }
  .big-btn {
    flex: 1 1 0; justify-content: center; gap: .4rem;
    min-height: 48px; padding: .5rem .7rem; font-size: .84rem;
  }
}

/* カード */
.grid { display: grid; gap: 1rem; margin-top: 1.2rem; }
.grid-main { grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
@media (max-width: 900px) {
  .grid-main, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(1rem, 2.4vw, 1.4rem);
  box-shadow: var(--shadow-sm); min-width: 0;
}
.card > h2, .card > h3 {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.05rem; font-weight: 800; line-height: 1.4; margin-bottom: .2rem;
}
.card > h2 .ico, .card > h3 .ico { font-size: 1.2rem; line-height: 1; }
.card-lead { color: var(--text-sub); font-size: .86rem; margin-bottom: .2rem; }

/* ミニ図鑑（時代・大きさ・食べもの…） */
.dexlist { margin-top: .9rem; display: grid; gap: .1rem; }
.dexlist > div {
  display: grid; grid-template-columns: 1.9rem 6.4rem 1fr; gap: .5rem;
  align-items: baseline; padding: .65rem .1rem;
  border-bottom: 1px solid var(--border-light, #F1F5F9);
}
.dexlist > div:last-child { border-bottom: none; }
.dexlist .ico { font-size: 1.05rem; line-height: 1.4; }
.dexlist dt { font-size: .78rem; font-weight: 700; color: var(--text-sub); }
.dexlist dd { font-size: .9rem; line-height: 1.65; }
@media (max-width: 420px) {
  .dexlist > div { grid-template-columns: 1.7rem 1fr; }
  .dexlist dd { grid-column: 2; }
}
.card-note { margin-top: .9rem; font-size: .76rem; color: var(--text-muted); line-height: 1.7; }

/* ===================================
   デジタルぬりえ
   =================================== */
.dc { display: flex; flex-direction: column; gap: .9rem; }

/* PC・タブレットでは キャンバスを大きくして、道具を右に置く */
@media (min-width: 900px) {
  .dc { flex-direction: row; align-items: flex-start; justify-content: center; gap: 1.4rem; }
  .dc .dc-stage { flex: 1 1 auto; max-width: min(100%, calc(84vh * var(--ar))); margin: 0; }
  .dc .dc-tools { flex: 0 1 300px; display: flex; flex-direction: column; gap: .9rem; }
  .dc .dc-actions { flex-direction: column; }
  .dc .dc-btn { width: 100%; }
}

/* 全画面ボタン（スマホ・タブレットだけ。PCは横に道具を置けるので出さない） */
.dc-view { display: none; }
.dc-view-btn {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  width: 100%; min-height: 52px; padding: .6rem 1rem;
  border-radius: 14px; border: 2px solid var(--mint-border); background: var(--mint-soft);
  font-family: inherit; font-size: .98rem; font-weight: 800; color: #0D9488;
  cursor: pointer; transition: var(--t);
}
.dc-view-btn:active { transform: scale(.985); }

/* 全画面で塗るモード（スマホ）*/
body.dc-full-open { overflow: hidden; }
.dc-bar { display: none; }
.dc.is-full {
  position: fixed; inset: 0; z-index: 2000; margin: 0; padding: 0;
  background: #fff; display: flex; flex-direction: column; gap: 0;
}
.dc.is-full .dc-view { display: none; }
.dc.is-full .dc-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: calc(.4rem + env(safe-area-inset-top)) .6rem .4rem;
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.dc-bar-zooms { display: flex; gap: .4rem; }
.dc-bar-btn {
  min-height: 44px; min-width: 48px; padding: .4rem .8rem;
  border-radius: 12px; border: 1.5px solid var(--border); background: #fff;
  font-family: inherit; font-size: .9rem; font-weight: 700; color: var(--text);
  cursor: pointer; transition: var(--t);
}
.dc-bar-btn:active { background: var(--mint-soft); }

.dc-stage {
  position: relative; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  --ar: 1.4167;                       /* デジタル用SVG（1020x720）の縦横比 */
  aspect-ratio: var(--ar); margin: 0 auto;
  width: 100%; max-width: min(100%, calc(84vh * var(--ar)));
  touch-action: manipulation;
}
.dc-canvas {
  position: absolute; inset: 0;
  transform-origin: 0 0; will-change: transform;
}
.dc-canvas svg { width: 100%; height: 100%; display: block; }
.dc-region { cursor: pointer; transition: fill .1s ease; }
.dc-canvas svg path[fill="none"] { pointer-events: none; }
@media (hover: hover) {
  .dc-region:hover { stroke: #2DD4BF; }
}

/* 指の使いかたの案内（全画面に入ったときだけ、すこし出して消える） */
.dc-tip {
  position: absolute; left: 50%; bottom: .7rem; transform: translateX(-50%);
  margin: 0; padding: .45rem .9rem; border-radius: 999px;
  background: rgba(15,23,42,.8); color: #fff;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
  pointer-events: none; opacity: 0;
}
.dc.is-full .dc-tip.is-shown { animation: dc-tip 4.5s ease forwards; }
@keyframes dc-tip { 0%, 65% { opacity: 1; } 100% { opacity: 0; } }

.dc-fallback { padding: 2rem 1rem; text-align: center; color: var(--text-sub); font-size: .9rem; }

.dc-row { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.dc-row-label {
  font-size: .76rem; font-weight: 700; color: var(--text-muted);
  white-space: nowrap;
}
.dc-swatches { display: flex; flex-wrap: wrap; gap: .45rem; width: 100%; }
.dc-swatch {
  width: 40px; height: 40px; border-radius: 11px; border: 2px solid rgba(0,0,0,.1);
  cursor: pointer; padding: 0; transition: transform .12s ease, box-shadow .12s ease;
}
.dc-swatch.is-white { border-color: var(--border); }
.dc-swatch:hover { transform: scale(1.08); }
.dc-swatch.is-on {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--navy);
  transform: scale(1.08);
}
.dc-sample .dc-swatch { border-radius: 50%; }

.dc-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .2rem; }
.dc-btn {
  flex: 1 1 auto; min-height: 48px; padding: .6rem 1rem;
  border-radius: 12px; border: 1.5px solid var(--border); background: #fff;
  font-family: inherit; font-size: .88rem; font-weight: 700; color: var(--text);
  cursor: pointer; transition: var(--t); white-space: nowrap;
}
.dc-btn:hover { border-color: var(--mint); background: var(--mint-soft); }
.dc-btn.is-on { border-color: var(--navy); background: var(--navy); color: #fff; }
.dc-btn-save { background: var(--mint-soft); border-color: var(--mint-border); color: #0D9488; }
.dc-btn-save:hover { background: rgba(45,212,191,.2); }
.dc-note { font-size: .76rem; color: var(--text-muted); line-height: 1.7; }

/* 全画面のときの道具（下にまとめて、色は横スクロール）*/
.dc.is-full .dc-stage {
  flex: 1 1 auto; width: 100%; max-width: none; height: auto;
  aspect-ratio: auto; border: none; border-radius: 0;
  touch-action: none;                 /* 指の操作は自前で拡大・移動に使う */
}
.dc.is-full .dc-tools {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: .4rem;
  padding: .5rem .6rem calc(.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); background: #fff;
}
.dc.is-full .dc-row { flex-direction: row; align-items: center; gap: 0; }
.dc.is-full .dc-row-label { display: none; }
.dc.is-full .dc-swatches {
  flex-wrap: nowrap; overflow-x: auto; gap: .4rem; padding: 2px 0;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.dc.is-full .dc-swatches::-webkit-scrollbar { display: none; }
.dc.is-full .dc-swatch { flex: 0 0 auto; width: 44px; height: 44px; }
.dc.is-full .dc-actions { flex-wrap: nowrap; gap: .35rem; margin: 0; }
.dc.is-full .dc-btn {
  flex: 1 1 0; min-width: 0; min-height: 46px;
  padding: .4rem .2rem; font-size: .74rem;
}
.dc.is-full .dc-note { display: none; }

/* スマホでは card の余白を削り、絵をできるだけ大きく出す */
@media (max-width: 899px) {
  .dc-view { display: block; }
}
@media (max-width: 700px) {
  .card-color {
    padding-left: .5rem; padding-right: .5rem;
    margin-left: calc(clamp(1rem, 4vw, 2rem) * -1);
    margin-right: calc(clamp(1rem, 4vw, 2rem) * -1);
    border-radius: 0; border-left: none; border-right: none;
  }
  .card-color { padding-top: .8rem; padding-bottom: .9rem; }
  .card-color > h2 { font-size: .98rem; }
  .card-color > .card-lead { font-size: .8rem; }
  .dc { gap: .6rem; }
  .dc-swatch { width: 44px; height: 44px; }
  .dc-stage { max-width: none; }
  .dc-row { gap: .25rem; }
  .dc-swatches { gap: .4rem; }
  .dc-actions { gap: .4rem; }
  .dc-btn { flex: 1 1 46%; min-height: 44px; padding: .45rem .6rem; font-size: .82rem; }
  .dc-note { display: none; }
}

/* 紙で塗る用の線画（デジタルの下に小さく置く） */
.paper-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: .4rem; }
.paper-thumb {
  flex: 0 0 92px; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: #fff;
}
.paper-thumb img { display: block; width: 100%; height: auto; }
.paper-row div { flex: 1 1 220px; }

/* 保護者向けの帯 */
.parent-note {
  margin-top: 1.2rem; display: flex; gap: .7rem; align-items: flex-start;
  background: var(--bg-sub); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .9rem 1.1rem;
  font-size: .82rem; color: var(--text-sub); line-height: 1.8;
}
.parent-note b { color: var(--text); }

/* 印刷時はぬりえの線画だけ（1枚に収める） */
@media print {
  .site-header, .breadcrumb, .page-top-actions, .page-top-sub,
  .grid, .card, .parent-note, .page-footer { display: none !important; }
  .print-sheet { display: block !important; }
  .print-sheet img {
    display: block; margin: 0 auto;
    width: 245mm; height: 173mm;      /* A4よこ（297x210mm）に余白8mmで収まる大きさ */
    max-width: 100%;
  }
  .page-top { display: block; padding: 0; }
  .page-top h1 { font-size: 13pt; text-align: center; margin-bottom: 4pt; }
  .wrap-page { padding: 0; max-width: none; }
  body { background: #fff; }
  @page { size: A4 landscape; margin: 8mm; }
}
.print-sheet { display: none; }
