/* スマホ縦を先に組み、広い画面は後から広げる。ピンチ操作と横向き前提を作らない。 */
:root {
  --ink: #14161a;
  --paper: #fbfaf7;
  --card: #ffffff;
  --line: #e4e1da;
  --sub: #6f7580;
  --accent: #c0392b;
  --accent-soft: #fdf0ee;
  --ok: #1e824c;
  --gold: #b8860b;
  --radius: 14px;
  --pad: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f0eee9; --paper: #14161a; --card: #1d2026; --line: #2e333c;
    --sub: #9aa2ae; --accent: #ff7a68; --accent-soft: #2a1d1c; --ok: #5fcf95; --gold: #e0b64a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper); color: var(--ink);
  font-family: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.75; font-size: 16px;
  -webkit-text-size-adjust: 100%;
  padding-bottom: 136px;
}
body.newsletter-final, body.keyboard-open { padding-bottom: 96px; }

/* ---- 上の帯 ---- */
header {
  position: sticky; top: 0; z-index: 20;
  background: var(--ink); color: var(--paper);
  padding: 10px var(--pad) 8px;
}
.hdr-row { display: flex; align-items: baseline; gap: 10px; }
.hdr-part { font-size: 12px; opacity: .7; }
.hdr-n {
  margin-left: auto; font-variant-numeric: tabular-nums;
  font-size: 12px; opacity: .7;
}
.hdr-title { font-size: 15px; font-weight: 700; margin-top: 2px; }
.toc-trigger {
  display: block; width: 100%; min-height: 44px; margin: 0; padding: 0;
  border: 0; background: transparent; color: inherit; text-align: left;
  font: inherit; cursor: pointer;
}
.toc-title-row { display: flex; align-items: center; gap: 12px; }
.toc-title-row .hdr-title { flex: 1; }
.toc-word { flex: 0 0 auto; font-size: 13px; font-weight: 700; opacity: .82; }
.beacon {
  margin-top: 8px; font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.12); display: none;
}
.beacon.show { display: inline-block; }
.beacon.behind { background: var(--accent); color: #fff; font-weight: 700; }
.dots { display: flex; gap: 3px; margin-top: 52px; }
.dots i { position: relative; flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.2); }
.dots i.on { background: var(--paper); }
.dots i.seen { background: color-mix(in srgb, var(--paper) 56%, transparent); }
.dots i.done { background: var(--gold); }

/* ---- 全34画面の目次 ---- */
body.navigation-open { overflow: hidden; }
.toc-overlay {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: rgba(20, 22, 26, .52); padding: 0 var(--pad) max(12px, env(safe-area-inset-bottom));
}
.toc-overlay[hidden], .jump-overlay[hidden] { display: none; }
.toc-sheet {
  width: min(720px, 100%); max-height: min(70vh, 650px); margin: 0 auto;
  overflow: auto; overscroll-behavior: contain; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-top: 4px solid var(--part);
  border-radius: 0 0 16px 16px; box-shadow: 0 18px 40px rgba(0,0,0,.28);
}
.toc-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px; padding: 14px 16px 9px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.toc-head h2 { margin: 1px 0 0; font-size: 20px; }
.toc-kicker { color: var(--sub); font-size: 12px; font-weight: 700; }
.toc-close {
  flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line);
  border-radius: 50%; background: var(--card); color: var(--ink); font: 700 22px/1 system-ui;
}
.toc-legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 16px;
  font-size: 13px; border-bottom: 1px solid var(--line);
}
.toc-legend .done { color: var(--gold); font-weight: 700; }
.toc-legend .seen { color: #3478c7; font-weight: 700; }
.toc-legend .unread { color: var(--sub); }
.toc-group { padding: 8px 12px 12px; }
.toc-group + .toc-group { border-top: 1px solid var(--line); }
.toc-group h3 {
  margin: 4px 4px 7px; padding-left: 9px; border-left: 4px solid var(--c);
  font-size: 15px; line-height: 1.45;
}
.toc-item {
  display: grid; grid-template-columns: 32px minmax(0,1fr) 38px 76px;
  gap: 7px; align-items: center; width: 100%; min-height: 52px; padding: 7px 8px;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.toc-item + .toc-item { border-top-color: var(--line); border-radius: 0; }
.toc-item.current { background: var(--accent-soft); border-color: var(--accent); border-radius: 9px; }
.toc-number { font-weight: 800; font-variant-numeric: tabular-nums; }
.toc-item-title { min-width: 0; line-height: 1.35; }
.toc-minutes { color: var(--sub); text-align: right; font-size: 12px; }
.toc-status { font-size: 12px; text-align: right; white-space: nowrap; }
.toc-item.done .toc-status { color: var(--gold); font-weight: 700; }
.toc-item.seen .toc-status { color: #3478c7; font-weight: 700; }
.toc-item.unread .toc-status { color: var(--sub); }

.jump-overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  padding: 18px; background: rgba(20, 22, 26, .7);
}
.jump-dialog {
  width: min(480px, 100%); padding: 22px; border-radius: 16px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(0,0,0,.34);
}
.jump-kicker { color: var(--accent); font-size: 13px; font-weight: 800; }
.jump-dialog h2 { margin: 5px 0 9px; }
.jump-dialog p { margin: 0 0 18px; }
.jump-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jump-actions .btn { text-align: center; min-height: 48px; }
@media (max-width: 420px) {
  .toc-item { grid-template-columns: 30px minmax(0,1fr) 64px; }
  .toc-minutes { display: none; }
  .jump-actions { grid-template-columns: 1fr; }
}

/* ---- 本体 ---- */
main { padding: var(--pad); max-width: 720px; margin: 0 auto; }
h2 { font-size: 21px; margin: 4px 0 6px; line-height: 1.45; }
.lead { color: var(--sub); margin: 0 0 18px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--pad); margin-bottom: 12px;
}
.close { margin-top: 18px; padding: 14px; background: var(--accent-soft);
  border-left: 3px solid var(--accent); border-radius: 6px; }

/* ---- こより付きの理解図解 ---- */
.learning-diagram { position: relative; overflow: hidden; font-size: 16px; padding: 15px; }
.learning-diagram h3 { margin: 0 0 12px; font-size: 18px; line-height: 1.45; }
.diagram-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(64px, 18%); gap: 12px; align-items: end; }
.diagram-character { align-self: end; max-width: 100%; }
.diagram-character .koyori-blink-stage {
  width: min(100%, calc(142px * var(--koyori-ratio, .5)));
  aspect-ratio: var(--koyori-ratio, .5); margin-inline: auto;
}
.diagram-note { margin: 11px 0 0; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 16px; line-height: 1.6; }
.diagram-path { display: flex; flex-wrap: wrap; align-items: stretch; gap: 7px; }
.diagram-node {
  flex: 1 1 96px; display: grid; place-items: center; min-height: 54px; padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--part) 55%, var(--line)); border-radius: 9px;
  background: color-mix(in srgb, var(--part) 9%, var(--card)); text-align: center;
  font-weight: 700; font-size: 16px; line-height: 1.35;
}
.diagram-arrow { align-self: center; color: var(--part); font-size: 27px; font-weight: 800; }
.diagram-hub { display: grid; gap: 9px; }
.diagram-center {
  width: max-content; min-width: 112px; margin: 0 auto; padding: 9px 18px;
  border-radius: 999px; background: var(--part); color: #fff; text-align: center; font-weight: 800;
}
.diagram-hub-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.diagram-hub-items .diagram-node { flex: 1 1 82px; }
.diagram-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.diagram-column { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.diagram-column.preferred { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--card)); }
.diagram-column h4 { margin: 0 0 7px; font-size: 16px; line-height: 1.4; }
.diagram-column ul { margin: 0; padding-left: 1.2em; }
.diagram-column li { margin: 3px 0; line-height: 1.45; }
.diagram-funnel { display: grid; gap: 8px; }
.diagram-funnel-row { display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: center; }
.diagram-funnel-label { font-weight: 700; }
.diagram-funnel-bar {
  display: flex; align-items: center; justify-content: flex-end; min-width: 44px; height: 34px;
  padding: 0 9px; border-radius: 5px; background: var(--part); color: #fff; transition: width .4s ease;
}
.experience-guide, .figure-koyori {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center;
  min-height: 74px; margin: 0 0 12px; padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--part) 42%, var(--line)); border-radius: 12px;
  background: color-mix(in srgb, var(--part) 6%, var(--card));
}
.experience-guide p, .figure-koyori p { margin: 0; font-size: 16px; line-height: 1.55; }
.experience-koyori .koyori-blink-stage, .figure-koyori-image .koyori-blink-stage {
  width: calc(60px * var(--koyori-ratio, .5)); height: 60px; margin-inline: auto;
}
.figure-koyori { margin: 12px 0 0; }
.koyori-blink-stage { position: relative; display: block; }
.koyori-blink-open {
  position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important;
  max-height: none !important; object-fit: fill !important; border: 0 !important;
  border-radius: 0 !important; background: transparent !important;
}
.koyori-blink-eyes {
  position: absolute; overflow: hidden; pointer-events: none;
}
.koyori-blink-eye-sheet {
  position: absolute; inset: 0 auto 0 0; display: block; width: 300% !important; height: 100% !important;
  max-height: none !important; object-fit: fill !important; border: 0 !important;
  border-radius: 0 !important; background: transparent !important;
  animation: koyoriBlinkEyes 4.6s steps(1, end) infinite;
}
@keyframes koyoriBlinkEyes {
  0%, 89.99%, 94.01%, 100% { transform: translateX(0); }
  90%, 91.49%, 92.99%, 94% { transform: translateX(-33.333333%); }
  91.5%, 92.98% { transform: translateX(-66.666667%); }
}
@media (max-width: 420px) {
  .diagram-body { grid-template-columns: minmax(0, 1fr) 60px; gap: 8px; }
  .diagram-character .koyori-blink-stage { width: min(100%, calc(108px * var(--koyori-ratio, .5))); }
  .diagram-path { gap: 5px; }
  .diagram-arrow { display: none; }
  .diagram-node { flex-basis: 46%; }
  .diagram-compare { grid-template-columns: 1fr; }
}

/* ---- 作品一覧 ---- */
.works { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 620px) { .works { grid-template-columns: 1fr 1fr 1fr; } }
.work {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; min-height: 96px;
}
.work b { display: block; font-size: 14px; line-height: 1.4; }
.work .by { font-size: 11px; color: var(--gold); margin-top: 4px; }
.work .note { font-size: 11px; color: var(--sub); margin-top: 6px; line-height: 1.5; }

/* ---- 待ち画面 ---- */
.ticker { min-height: 150px; display: flex; align-items: center; }
.ticker p { font-size: 18px; line-height: 1.7; margin: 0; }
.spin { display: flex; gap: 6px; margin-bottom: 16px; }
.spin i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.2s infinite; }
.spin i:nth-child(2) { animation-delay: .2s; }
.spin i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* ---- 診断 ---- */
.choices { display: flex; flex-direction: column; gap: 8px; }
button.choice, button.btn {
  font: inherit; text-align: left; width: 100%;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; cursor: pointer;
}
button.choice:active { background: var(--accent-soft); }
button.choice.picked { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.tools { list-style: none; padding: 0; margin: 0; }
.tools li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.tools li:last-child { border-bottom: 0; }
.tools li.always { color: var(--sub); }

/* ---- 比較 ---- */
.cmp { display: grid; gap: 12px; }
@media (min-width: 620px) { .cmp { grid-template-columns: 1fr 1fr; } }
.cmp .head { font-weight: 700; margin-bottom: 8px; }
.cmp .bad .head { color: var(--sub); }
.cmp .good .head { color: var(--ok); }
.cmp ul { margin: 0; padding-left: 1.2em; }
.cmp li { margin-bottom: 6px; }
.verdict { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-weight: 700; font-size: 14px; }
.instruction { font-family: ui-monospace, monospace; background: var(--accent-soft);
  padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }

/* ---- 集計 ---- */
.tal { margin-bottom: 20px; }
.tal h3 { font-size: 15px; margin: 0 0 8px; }
.row { display: grid; grid-template-columns: 92px 1fr 34px; gap: 8px;
  align-items: center; margin-bottom: 5px; font-size: 14px; }
.bar { height: 20px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent);
  transition: width .5s ease; }
.row.top .bar span { background: var(--ok); }
.row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--sub); }
.seeds { list-style: none; padding: 0; margin: 0; }
.seeds li { padding: 10px 12px; background: var(--accent-soft); border-radius: 8px;
  margin-bottom: 6px; }

/* ---- 組み上がる過程 ---- */
.mcp-demo { border-color: #95713a; background: linear-gradient(180deg, #fbf7ee, #f6efe0); }
.mcp-demo h3 { margin: 3px 0 8px; }
.mcp-kicker { color: #6a4e22; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mcp-why, .mcp-result { margin: 0; font-size: 14px; line-height: 1.7; }
.mcp-flow { list-style: none; display: grid; gap: 7px; margin: 12px 0; padding: 0; }
.mcp-flow li { display: grid; grid-template-columns: minmax(152px, auto) 1fr; gap: 10px; align-items: center; }
.mcp-flow code { color: #f0ce7e; background: #161320; border: 1px solid #95713a; border-radius: 5px; padding: 8px 10px; font-size: 13px; }
.mcp-flow span { color: var(--sub); font-size: 13px; }
.mcp-fallback { margin: 10px 0 0; }
#stage { width: 100%; aspect-ratio: 4/3; background: #0e1014;
  border-radius: 10px; display: block; touch-action: manipulation; }
.stages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.stages button { min-height: 44px; font: inherit; font-size: 13px; padding: 0 12px;
  border: 1px solid #95713a; background: linear-gradient(180deg, #232033, #161320); color: #F0CE7E;
  border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(226,193,118,.12), 0 2px 5px rgba(14,10,20,.18);
  cursor: pointer; transition: transform 90ms ease-out, border-color 90ms ease-out; }
.stages button:active { transform: scale(.965); }
.stages button.on { border-color: #e2c176; box-shadow: inset 0 0 0 1px rgba(226,193,118,.45), 0 0 0 2px rgba(149,113,58,.22); }
.stage-note { margin-top: 12px; color: var(--sub); font-size: 14px; min-height: 3em; }
.score { font-variant-numeric: tabular-nums; font-weight: 700; }

@media (max-width: 460px) {
  .mcp-flow li { grid-template-columns: 1fr; gap: 4px; }
  .stages button { flex: 1 1 calc(50% - 6px); }
}

/* ---- 遊ぶ ---- */
.playbtn {
  display: block; text-align: center; text-decoration: none;
  background: var(--accent); color: #fff; font-weight: 700;
  padding: 16px; border-radius: 12px; margin: 4px 0 14px;
}
.gname { font-size: 18px; font-weight: 700; }
.gby { font-size: 12px; color: var(--gold); margin-bottom: 12px; }
.point { font-weight: 700; border-left: 3px solid var(--ok); padding-left: 12px; margin-bottom: 12px; }

/* ---- LINE ---- */
.linebtn { display: block; text-align: center; text-decoration: none;
  background: #06C755; color: #fff; font-weight: 700; padding: 16px;
  border-radius: 12px; margin-bottom: 16px; }
ol.steps { padding-left: 1.3em; margin: 0; }
ol.steps li { margin-bottom: 10px; }
.example { font-family: ui-monospace, monospace; background: var(--accent-soft);
  padding: 12px; border-radius: 8px; display: inline-block; margin-top: 6px; }

/* ---- カード ---- */
.slip { border: 2px solid var(--ink); border-radius: 12px; padding: 18px; background: var(--card); }
.slip h3 { margin: 0 0 14px; font-size: 16px; }
.slip dl { margin: 0; }
.slip dt { font-size: 12px; color: var(--sub); margin-top: 12px; }
.slip dd { margin: 2px 0 0; font-weight: 700; }
.slip .none { font-weight: 400; color: var(--sub); }

/* ---- 下の操作 ---- */
footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 0 var(--pad); padding-bottom: env(safe-area-inset-bottom);
  display: flex; flex-direction: column; align-items: stretch;
}
.footer-nav {
  display: flex; gap: 10px; align-items: center;
  width: 100%; padding: 10px 0;
}
footer .nav {
  font: inherit; font-weight: 700; padding: 14px 18px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
}
footer .nav.next { flex: 1; background: var(--ink); color: var(--paper); border-color: var(--ink); }
footer .nav:disabled { opacity: .35; }
.newsletter-dock { position: relative; width: 100%; height: 40px; }
.newsletter-strip {
  width: 100%; height: 40px; margin: 0; padding: 4px 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-bottom: 1px solid var(--gold);
  background: #f5f0e4; color: #14161a;
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.newsletter-mark {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: #19284b; color: #fff0cd; border: 2px solid #b8860b;
  font-size: 17px; line-height: 1;
}
.newsletter-sheet {
  position: absolute; right: 0; bottom: 0; z-index: 2;
  width: min(358px, 100%); height: 179px;
  background: #071321; border: 1px solid var(--gold);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, .28);
}
.newsletter-sheet[hidden] { display: none; }
.newsletter-sheet a, .newsletter-sheet img { display: block; width: 100%; height: 100%; }
.newsletter-sheet img { object-fit: cover; }
.newsletter-close {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(20,22,26,.2); background: rgba(255,255,255,.94);
  color: #14161a; font: 700 20px/1 system-ui, sans-serif; cursor: pointer;
}
.newsletter-complete {
  display: block; overflow: hidden; margin-top: 18px;
  border: 1px solid var(--gold); border-radius: 12px;
  background: #071321;
}
.newsletter-complete img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }
.consulting-offer {
  display: block; overflow: hidden; margin-top: 18px;
  border: 1px solid var(--gold); border-radius: 12px;
  background: #071321; text-decoration: none;
}
.consulting-offer img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }
.consulting-offer-cta {
  display: flex; min-height: 44px; padding: 10px 16px; align-items: center; justify-content: center; text-align: center;
  background: #c63722; color: #fff; font-weight: 800; line-height: 1.4;
}
.consulting-offer:focus-visible { outline: 3px solid var(--part); outline-offset: 3px; }
.app-entry-qr { text-align: center; }
.app-entry-qr h3 { margin: 0; }
.app-entry-qr .hint { margin: 3px 0 10px; }
.app-entry-qr-link { display: block; width: min(240px, 76vw); margin: 0 auto; }
.app-entry-qr-link img {
  display: block; width: 100%; height: auto; aspect-ratio: 1;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.app-entry-url { display: block; margin-top: 9px; font-size: 13px; overflow-wrap: anywhere; }
body.newsletter-final .newsletter-dock,
body.keyboard-open .newsletter-dock { display: none; }
.hint { font-size: 12px; color: var(--sub); }

/* いま渡しているプロンプト（wait / build）。読むだけでなく持ち帰れるようにする */
.card.prompt { background: var(--paper); border: 1px solid var(--line); }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prompt-head h3 { margin: 0; }
.prompt-head h3 { flex: 1 1 auto; min-width: 0; font-size: 16px; }
/* button.btn は width:100% なので、並べるときは打ち消す */
button.btn.small {
  flex: 0 0 auto; width: auto; text-align: center;
  padding: 7px 16px; font-size: 13px; white-space: nowrap;
}
.prompt-body {
  margin: 10px 0 0; padding: 12px;
  background: rgba(0, 0, 0, .04); border-radius: 8px;
  font: inherit; font-size: 13px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}

/* 待ち時間の相棒。こよりが歩いてコインを拾う */
.walk { position: relative; margin: 14px 0 4px; }
.walk canvas {
  display: block; width: 100%; border-radius: 10px;
  background: linear-gradient(180deg, rgba(40,52,90,.05), rgba(40,52,90,.12));
  touch-action: manipulation;
}
.walk-coins {
  pointer-events: none;
  position: absolute; right: 10px; top: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--ink); background: rgba(255,255,255,.72);
  padding: 3px 10px; border-radius: 999px;
}

/* 読了の進み。通っただけの点と、読了した点を分ける */
.hdr-read { font-size: 12px; opacity: .75; margin-left: 10px; }
.dots i.done { background: var(--gold); opacity: 1; }

/* 修了証 */
.cert-cond { list-style: none; padding: 0; margin: 12px 0 0; }
.cert-cond li { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; color: var(--sub); }
.cert-cond li.ok { color: var(--ink); }
.cert-cond .mark {
  flex: 0 0 auto; font-size: 12px; font-weight: 700;
  border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px;
}
.cert-cond li.ok .mark { color: var(--ok); }
.cert-name { margin-top: 14px; }
.cert-name input {
  width: 100%; font: inherit; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink);
}
.cert-img { display: block; width: 100%; margin-top: 14px; border-radius: 10px; border: 1px solid var(--line); }
.cert-btns { display: flex; gap: 10px; margin-top: 12px; }
.cert-btns .btn { flex: 1 1 0; }
button.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Xシェア。本文内だけに置き、固定フッターの進行操作とは混ぜない */
button.btn.share { margin-top: 14px; text-align: center; }
.share-card h3 { margin: 0 0 10px; font-size: 16px; }
.share-card input {
  width: 100%; font: inherit; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink);
}

/* 説明ページの箇条書きと対応表 */
ul.points { list-style: none; padding: 0; margin: 14px 0 0; }
ul.points li {
  position: relative; padding: 12px 14px 12px 38px; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
ul.points li::before {
  content: ''; position: absolute; left: 16px; top: 21px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
}
.profile-showcase { display: grid; gap: 14px; margin-top: 14px; }
.profile-showcase-group {
  padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.profile-showcase-group h3 { margin: 0 0 9px; font-size: 16px; }
.profile-showcase-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.profile-work-card {
  display: grid; grid-template-rows: auto auto 1fr; align-content: start; overflow: hidden;
  background: var(--paper); border: 1px solid color-mix(in srgb, var(--part) 45%, var(--line)); border-radius: 9px;
}
.profile-work-name { min-width: 0; margin: 0; padding: 10px 12px; font-size: 14px; font-weight: 700; line-height: 1.45; }
.profile-work-thumbnail { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.profile-work-link {
  display: flex; align-items: center; justify-content: center; align-self: end;
  min-height: 44px; padding: 8px 12px; color: inherit; text-decoration: none;
  border-top: 1px solid var(--line);
}
.profile-work-link:hover { background: color-mix(in srgb, var(--part) 8%, var(--paper)); }
.profile-work-link:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.profile-work-open { color: var(--part); font-size: 12px; font-weight: 700; white-space: nowrap; }
@media (max-width: 420px) {
  .profile-showcase-links { grid-template-columns: 1fr; }
  .profile-work-name { font-size: 16px; }
}
.tablewrap { overflow-x: auto; margin-top: 14px; }
table.twocol { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
table.twocol td:first-child, table.twocol th:first-child { width: 40%; }
table.twocol th, table.twocol td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.twocol th { font-size: 13px; color: var(--sub); white-space: nowrap; }
table.twocol td:first-child { font-weight: 700; }

/* 部ごとの色分け。帯・点・区切りを1色でそろえる */
header { border-bottom: 4px solid var(--part, var(--gold)); }
.hdr-part {
  opacity: 1; font-weight: 700;
  background: var(--part, var(--gold)); color: #fff;
  padding: 2px 10px; border-radius: 999px; font-size: 12px;
}
.dots i.on { background: color-mix(in srgb, var(--c) 55%, transparent); }
.dots i.done { background: var(--c); opacity: 1; }
.dots i.current {
  background: #fff; opacity: 1;
  box-shadow: 0 0 0 2px rgba(255,255,255,.24), 0 0 8px rgba(255,255,255,.55);
}
.progress-koyori {
  position: absolute; left: 50%; bottom: 6px; z-index: 2;
  width: 28px; height: 47px; overflow: hidden;
  transform: translateX(-50%); pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.5));
}
.progress-koyori img {
  display: block; width: 56px; max-width: none; height: auto;
  animation: progressKoyoriWalk .8s steps(1, end) infinite;
}
@keyframes progressKoyoriWalk {
  0%, 24.99% { transform: translate(0, 0); }
  25%, 49.99% { transform: translate(-28px, 0); }
  50%, 74.99% { transform: translate(0, -47px); }
  75%, 100% { transform: translate(-28px, -47px); }
}
.dots i.edge { margin-right: 14px; position: relative; }
.dots i.edge::after {
  content: ''; position: absolute; right: -9px; top: -3px;
  width: 2px; height: 9px; background: rgba(255,255,255,.55);
}
/* 部の終わり */
.partend {
  margin-top: 20px; padding: 14px; text-align: center;
  font-weight: 700; letter-spacing: .04em;
  color: var(--part, var(--gold));
  border: 2px dashed var(--part, var(--gold)); border-radius: 12px;
}
.slip dd.none a.fill { display: inline-block; margin-top: 4px; font-size: 13px; color: var(--accent); text-decoration: underline; }
.card.qr { text-align: center; }
.card.qr img { display: block; margin: 0 auto 8px; width: 200px; height: 200px; border-radius: 8px; background: #fff; padding: 6px; }

/* 画面の中で動かすゲーム。スマホの縦で遊べる高さを取る */
.card.embed iframe {
  display: block; width: 100%; height: 70vh; min-height: 420px; max-height: 720px;
  border: 1px solid var(--line); border-radius: 10px; background: #000; margin: 10px 0;
}
.card.embed .playbtn { margin-top: 6px; }

/* 図のカード。1枚は全幅、複数は横に並べてスクロール */
.card.figure .figs { display: grid; gap: 10px; }
.card.figure figure { margin: 0; }
.card.figure img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.card.figure figcaption { font-size: 12px; color: var(--sub); margin-top: 6px; line-height: 1.5; }
.card.figure.multi .figs { grid-auto-flow: column; grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.card.figure.multi figure { scroll-snap-align: start; }
.card.figure.multi img { aspect-ratio: 3 / 4; object-fit: cover; object-position: top; }

/* わいわいタウンのキャンペーン案内（第3部の対象作品にだけ出る） */
.card.campaign { border: 1px solid var(--gold); background: var(--card); }
.camp-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #fff; background: var(--gold); padding: 2px 10px; border-radius: 999px; margin-bottom: 6px; }
.card.campaign h3 { margin: 0 0 6px; }
.playbtn.camp { background: var(--gold); }

.document-hidden .koyori-blink-eye-sheet { animation-play-state: paused; transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  .progress-koyori img,
  .koyori-blink-eye-sheet { animation: none; transform: translateX(0); }
}
