/* =========================================================
   学習画面の共通スタイル（新受講システム）
   色・文字・余白の約束は :root にまとめる。
   講座ごとの違いは「テーマ色」（.u-theme-it など）だけ。
   ========================================================= */

:root {
  --ink: #121a2a;
  --ink-2: #47526a;
  --ink-3: #8590a5;
  --canvas: #f3f5f9;
  --paper: #ffffff;
  --line: #e1e6ee;
  --tint: #f5f7fb;
  --hl: #ffe14d;
  --ok: #0f9f6e;
  --ok-soft: #e2f6ee;
  --ng: #e2445c;
  --ng-soft: #fdeaed;

  --theme: #1f6fe5;
  --theme-ink: #1553b4;
  --theme-soft: #e7f0fe;
  --theme-deep: #0c2d5e;   /* 表紙の地 */

  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --num: "Outfit", var(--font);
  --side-w: 288px;
  --sheet: 1080px;
  --measure: 38em;        /* 本文1行の長さ */
}
/* 広い画面（1920×1080 など）では、教材の幅と本文1行の長さを広げる（2026-11-17。1366×768 は今までどおり） */
@media (min-width: 1500px) { :root { --sheet: 1280px; --measure: 44em; } }

.u-theme-it { --theme: #1f6fe5; --theme-ink: #1553b4; --theme-soft: #e7f0fe; --theme-deep: #0c2d5e; }
.u-theme-ip { --theme: #5458e0; --theme-ink: #3b3eb2; --theme-soft: #ecedfd; --theme-deep: #1f2160; }
.u-theme-ai { --theme: #e14a62; --theme-ink: #b02f46; --theme-soft: #fdeaed; --theme-deep: #5a1422; }
.u-theme-pc { --theme: #138f84; --theme-ink: #0c6c63; --theme-soft: #e0f3f1; --theme-deep: #0b3b37; }
.u-theme-py, .u-theme-pz, .u-theme-pa { --theme: #34557f; --theme-ink: #233c5d; --theme-soft: #e6ecf3; --theme-deep: #152238; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding: 80px 0 120px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 2; }
img { max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
.u-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--theme); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* =========================================================
   骨組み
   ========================================================= */
.l-app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.l-app.is-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.l-app.is-collapsed .l-sidebar { visibility: hidden; }

/* ---------- 左メニュー（色は使わず、今いる場所だけテーマ色） ---------- */
.l-sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--paper); border-right: 1px solid var(--line);
  padding: 20px 14px 32px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.l-sidebar__back {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 8px;
  color: var(--ink-3); text-decoration: none; font-size: 13.5px; font-weight: 700;
}
.l-sidebar__back::before { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); }
.l-sidebar__back:hover { color: var(--ink); }
.l-sidebar__lesson { display: flex; gap: 12px; align-items: center; margin: 18px 8px 16px; }
.l-sidebar__thumb { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; }
.l-sidebar__code { margin: 0; font-family: var(--num); font-weight: 700; font-size: 13px; color: var(--theme-ink); line-height: 1.4; }
.l-sidebar__title { margin: 0; font-size: 20px; font-weight: 900; line-height: 1.35; }
.l-sidebar__progress { display: flex; align-items: center; gap: 10px; margin: 0 8px 14px; }
.l-sidebar__meter { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.l-sidebar__meter i { display: block; height: 100%; width: 0; background: var(--theme); border-radius: 3px; transition: width .4s ease; }
.l-sidebar__progress p { margin: 0; font-size: 12.5px; color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.l-sidebar__progress b { font-family: var(--num); font-size: 15px; color: var(--ink); }

.l-sidebar__list { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); }
.l-sidebar__list li { margin: 0; }
.l-sidebar__list a {
  position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center;
  padding: 7px 10px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 14.5px; line-height: 1.45; font-weight: 500;
}
.l-sidebar__list a:hover { background: var(--tint); color: var(--ink); }
.l-sidebar__list .l-sidebar__icon { width: 26px; height: 26px; display: grid; place-items: center; color: var(--ink-3); }
.l-sidebar__list .l-sidebar__icon svg { width: 19px; height: 19px; }
.l-sidebar__list li.is-done .l-sidebar__icon { color: var(--theme); }
.l-sidebar__list li.is-now a { background: var(--theme-soft); color: var(--theme-ink); font-weight: 700; }
.l-sidebar__list li.is-now a::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--theme); }
.l-sidebar__list li.is-now .l-sidebar__icon { color: var(--theme); }
.l-sidebar__list li.is-final { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; }

/* ---------- 上のバー ---------- */
.l-main { min-width: 0; display: flex; flex-direction: column; }
.l-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 58px; padding: 0 28px 0 14px;
  background: rgba(243, 245, 249, .88); backdrop-filter: blur(10px);
}
.l-topbar__menu { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; display: grid; place-items: center; }
.l-topbar__menu:hover { background: #e3e8f0; }
.l-topbar__menu span, .l-topbar__menu span::before, .l-topbar__menu span::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); content: ""; }
.l-topbar__menu span { position: relative; }
.l-topbar__menu span::before { position: absolute; top: -6px; }
.l-topbar__menu span::after { position: absolute; top: 6px; width: 12px; }
.l-topbar__where { margin: 0; flex: 1; min-width: 0; display: flex; gap: 10px; align-items: baseline; white-space: nowrap; overflow: hidden; }
.l-topbar__code { font-family: var(--num); font-weight: 700; color: var(--theme-ink); font-size: 14px; }
.l-topbar__title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.l-app:not(.is-collapsed) .l-topbar__where { visibility: hidden; }
.l-topbar__count { margin: 0; font-size: 13.5px; color: var(--ink-3); font-weight: 700; }
.l-topbar__count b { font-family: var(--num); font-size: 20px; color: var(--ink); font-weight: 800; }

/* ---------- 教材 ---------- */
.l-stage { flex: 1; padding: 8px 32px 140px; }
.l-sheet { max-width: var(--sheet); margin: 0 auto; }

.p-sheet-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 16px; min-height: 40px; }
.p-sheet-head__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--ink); color: #fff; flex: none; }
.p-sheet-head__icon svg { width: 20px; height: 20px; }
.p-sheet-head__title { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink-2); flex: 1; }
.p-sheet-head__pages { display: flex; gap: 6px; align-items: center; }
.p-sheet-head__pages i { width: 26px; height: 6px; border-radius: 3px; background: #d6dce6; transition: background .2s ease, width .2s ease; }
.p-sheet-head__pages i.is-done { background: color-mix(in srgb, var(--theme) 45%, white); }
.p-sheet-head__pages i.is-now { background: var(--theme); width: 40px; }
.p-sheet-head__pages span { font-family: var(--num); font-weight: 700; font-size: 14px; color: var(--ink-3); margin-left: 6px; }

.p-lesson-step { display: none; }
.p-lesson-step.is-now { display: block; }

/* 1画面＝1つの話題（スライドを見出しごとに分けた単位） */
.c-chunk, .p-lesson-step:not([data-type="slide"]) { background: var(--paper); border-radius: 24px; padding: 44px 56px 48px; }
.p-lesson-step[data-type="slide"] { background: none; padding: 0; }
.c-chunk { display: none; }
.c-chunk.is-now { display: block; animation: enter .3s ease-out; }
.p-lesson-step.is-now:not([data-type="slide"]) { animation: enter .3s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.c-chunk.has-media.is-now { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 0 48px; align-items: start; }
.c-chunk__text { min-width: 0; }
.c-chunk__media { position: sticky; top: 80px; display: grid; gap: 14px; }
.c-chunk__media img { margin: 0 auto; width: auto; max-height: 360px; object-fit: contain; border-radius: 16px; background: var(--tint); }
.c-chunk__media .c-credit { margin: -6px 0 6px; }

/* キーワード */
.p-lesson-step .c-keywords { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 26px; padding: 0; list-style: none; max-width: none; }
.c-keywords::before { content: "この画面のキーワード"; font-size: 12.5px; font-weight: 700; color: var(--ink-3); margin-right: 4px; }
.c-keywords li { margin: 0; padding: 2px 12px; border-radius: 8px; background: #fff6c2; font-weight: 700; font-size: 14.5px; line-height: 1.8; max-width: none; }

/* 見出し・本文 */
.p-lesson-step h2 { font-size: 34px; line-height: 1.4; font-weight: 900; margin: 0 0 26px; letter-spacing: .01em; }
.p-lesson-step h3 { font-size: 30px; line-height: 1.4; font-weight: 900; margin: 0 0 22px; letter-spacing: .01em; }
.c-chunk h2 + h3 { font-size: 22px; margin-top: 36px; }
.p-lesson-step:not([data-type="slide"]) h3 { font-size: 22px; margin: 44px 0 14px; }
.p-lesson-step h4 { font-size: 19px; line-height: 1.6; font-weight: 900; margin: 36px 0 10px; display: flex; align-items: center; gap: 10px; }
.p-lesson-step h4::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--theme); flex: none; }
.p-lesson-step h2 + h4, .p-lesson-step h3 + h4 { margin-top: 8px; }
.p-lesson-step p, .p-lesson-step li { max-width: var(--measure); }
.p-lesson-step p { margin: 0 0 16px; }
.c-chunk__text > p:first-of-type, .c-chunk > p:first-of-type { font-size: 18.5px; font-weight: 500; }
.p-lesson-step ul, .p-lesson-step ol { margin: 0 0 20px; padding-left: 1.4em; }
.p-lesson-step li { margin: 4px 0; }
.p-lesson-step li::marker { color: var(--theme); }
.p-lesson-step a { color: var(--theme-ink); text-underline-offset: 3px; }
.p-lesson-step strong { font-weight: 900; }

.p-lesson-step mark {
  color: inherit; font-weight: 900;
  background: linear-gradient(transparent 58%, var(--hl) 58%, var(--hl) 92%, transparent 92%);
  padding: 0 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.p-lesson-step ol.c-goal-list { list-style: none; padding: 0; counter-reset: pt; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; max-width: none; }
.p-lesson-step ol.c-goal-list > li {
  counter-increment: pt; margin: 0; max-width: none;
  padding: 20px 22px 22px; border-radius: 18px; background: var(--theme-soft);
  font-weight: 900; font-size: 19px; line-height: 1.55;
}
.p-lesson-step ol.c-goal-list > li::before {
  content: counter(pt, decimal-leading-zero); display: block; margin-bottom: 10px;
  font-family: var(--num); font-weight: 800; font-size: 30px; line-height: 1; color: var(--theme);
}

.p-lesson-step img { display: block; margin: 16px 0 26px; border-radius: 14px; }
.p-lesson-step img.c-ext-image { outline: 2px dashed var(--ng); outline-offset: 4px; }
.p-lesson-step .c-credit { font-size: 12px; line-height: 1.7; color: var(--ink-3); margin-top: -14px; word-break: break-all; }

.p-lesson-step .c-data-table { overflow-x: auto; margin: 10px 0 28px; border-radius: 16px; border: 1px solid var(--line); max-width: none; }
.p-lesson-step table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.75; }
.p-lesson-step th, .p-lesson-step td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.p-lesson-step tr:last-child > * { border-bottom: 0; }
.p-lesson-step thead th { background: var(--ink); color: #fff; font-weight: 700; white-space: nowrap; }
.p-lesson-step tbody th, .p-lesson-step tbody td:first-child { font-weight: 900; background: var(--tint); white-space: nowrap; }

.p-lesson-step .c-box { background: var(--tint); border-radius: 18px; padding: 20px 24px; margin: 20px 0 26px; }
.p-lesson-step .c-box > :last-child { margin-bottom: 0; }
.p-lesson-step .c-box h4:first-child { margin-top: 0; }
.p-lesson-step .c-frame { border: 2px solid var(--line); border-radius: 18px; padding: 20px 24px; margin: 20px 0 26px; }
.p-lesson-step .c-tip { display: grid; grid-template-columns: auto 1fr; gap: 0 18px; align-items: start; background: #fff8d6; border-radius: 18px; padding: 20px 24px; margin: 28px 0; }
.p-lesson-step .c-tip::before {
  content: "ポイント"; writing-mode: vertical-rl; font-size: 14px; font-weight: 900; letter-spacing: .2em;
  padding: 12px 6px; border-radius: 10px; background: var(--ink); color: var(--hl); grid-row: span 9;
}
.p-lesson-step .c-tip > * { grid-column: 2; }
.p-lesson-step .c-tip > :last-child { margin-bottom: 0; }
.p-lesson-step .c-embed { position: relative; aspect-ratio: 16 / 9; margin: 10px 0 14px; border-radius: 18px; overflow: hidden; background: #000; max-width: 760px; }
.p-lesson-step .c-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* =========================================================
   キャラクター
   ========================================================= */
.c-speech { --face: none; }
.c-speech__who { display: block; font-size: 13px; line-height: 1.4; font-weight: 700; color: var(--ink-3); margin: 0 0 6px; }
.c-bust { display: block; border-radius: 50%; background: #fff var(--face) center 10% / 115% no-repeat; flex: none; }

/* 本文中の一言 */
.p-lesson-step:not([data-type="chat"]) .c-speech { display: grid; grid-template-columns: 104px 1fr; gap: 0 20px; align-items: center; margin: 4px 0 30px; max-width: 46em; }
.p-lesson-step:not([data-type="chat"]) .c-speech::before {
  content: ""; width: 104px; height: 104px; border-radius: 50%;
  background: #fff var(--face) center 10% / 115% no-repeat; box-shadow: 0 0 0 4px var(--theme-soft);
}
.p-lesson-step:not([data-type="chat"]) .c-speech > .c-speech__body {
  position: relative; max-width: none;
  background: var(--theme-soft); border-radius: 22px; padding: 16px 24px; line-height: 1.9; font-weight: 700; font-size: 17.5px;
}
.p-lesson-step:not([data-type="chat"]) .c-speech > .c-speech__body::before {
  content: ""; position: absolute; left: -10px; top: 50%; margin-top: -10px; border: 10px solid transparent; border-right-color: var(--theme-soft); border-left: 0;
}

/* 会話 */
.c-cast { display: flex; align-items: flex-end; gap: 18px; padding: 0 0 26px; margin: 0 0 28px; border-bottom: 1px solid var(--line); }
.c-cast figure { margin: 0; text-align: center; }
.c-cast .c-bust { width: 92px; height: 92px; margin: 0 auto 8px; box-shadow: 0 0 0 4px var(--paper), 0 0 0 6px var(--line); transition: transform .2s ease, box-shadow .2s ease; }
.c-cast figcaption { font-size: 13px; font-weight: 700; color: var(--ink-3); line-height: 1.3; }
.c-cast figure.is-talking .c-bust { transform: translateY(-6px) scale(1.08); box-shadow: 0 0 0 4px var(--paper), 0 0 0 6px var(--theme); }
.c-cast figure.is-talking figcaption { color: var(--ink); }
.c-cast__note { margin: 0 0 0 auto; font-size: 13.5px; color: var(--ink-3); align-self: center; font-weight: 500; }

.p-lesson-step[data-type="chat"] .c-speech { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 0 16px; margin: 0 0 20px; max-width: 760px; }
.p-lesson-step[data-type="chat"] .c-speech::before {
  content: ""; grid-row: span 3; width: 72px; height: 72px; border-radius: 50%;
  background: #fff var(--face) center 10% / 115% no-repeat; box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--line);
}
.p-lesson-step[data-type="chat"] .c-speech .c-speech__body {
  justify-self: start; max-width: none;
  background: var(--tint); border-radius: 6px 24px 24px 24px; padding: 14px 20px; margin: 0;
  font-size: 18px; line-height: 1.85; font-weight: 500;
}
.p-lesson-step[data-type="chat"] .c-speech[data-who="memori"] .c-speech__body,
.p-lesson-step[data-type="chat"] .c-speech[data-who="suta"] .c-speech__body { background: var(--theme-soft); }
.p-lesson-step[data-type="chat"] .c-speech[data-who="user"] { grid-template-columns: minmax(0, 1fr); margin-left: auto; justify-items: end; }
.p-lesson-step[data-type="chat"] .c-speech[data-who="user"]::before { display: none; }
.p-lesson-step[data-type="chat"] .c-speech[data-who="user"] .c-speech__who { text-align: right; }
.p-lesson-step[data-type="chat"] .c-speech[data-who="user"] .c-speech__body { justify-self: end; background: var(--theme); color: #fff; font-weight: 700; border-radius: 24px 6px 24px 24px; }
.p-lesson-step[data-type="chat"] .c-speech.is-later { display: none; }
.p-lesson-step .c-speech.is-off { display: none !important; }   /* data-if で、選んだ答えに合わない発言 */
.p-lesson-step[data-type="chat"] .c-speech.is-new { animation: pop .3s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.p-lesson-step .c-choices { list-style: none; margin: 14px 0 2px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; max-width: none; }
.c-choices li { margin: 0; }
.c-choices button { border: 2px solid var(--theme); background: var(--paper); color: var(--theme-ink); border-radius: 99px; padding: 8px 24px; font-weight: 900; cursor: pointer; line-height: 1.5; }
.c-choices button:hover { background: var(--theme-soft); }
.c-choices.is-answered { display: none; }
.c-chat-more { display: flex; justify-content: center; padding: 8px 0 0; }
.c-chat-replay { border: 2px solid var(--line); background: var(--paper); border-radius: 99px; padding: 7px 20px; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.c-chat-replay:hover { border-color: var(--ink-3); }

/* =========================================================
   回の表紙（ステップ1）
   ========================================================= */
.p-cover { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: stretch; margin: 0 0 18px; border-radius: 24px; overflow: hidden; background: var(--theme-deep); color: #fff; }
.p-cover__body { padding: 40px 44px 34px; display: flex; flex-direction: column; }
.p-cover__part { margin: 0 0 4px; font-size: 14px; color: rgba(255, 255, 255, .7); font-weight: 500; line-height: 1.6; max-width: none; }
.p-cover__code { font-family: var(--num); font-weight: 700; color: #fff; margin-right: 10px; }
.p-cover__title { margin: 0 0 22px; font-size: 64px; line-height: 1.1; font-weight: 900; letter-spacing: .01em; }
.p-lesson-step .p-cover__mix { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 auto; padding: 0; list-style: none; max-width: none; }
.p-cover__mix li { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .85); max-width: none; }
.p-cover__mix svg { width: 17px; height: 17px; opacity: .8; }
.p-cover__mix b { font-family: var(--num); font-size: 17px; color: #fff; }
.p-cover__cast { display: flex; align-items: center; margin-top: 30px; }
.p-cover__cast .c-bust { width: 64px; height: 64px; box-shadow: 0 0 0 3px var(--theme-deep); margin-right: -10px; }
.p-cover__cast p { margin: 0 0 0 22px; font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, .85); max-width: none; }
.p-cover__image { position: relative; min-height: 300px; }
.p-cover__image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; }
.p-cover__image::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, var(--theme-deep), transparent 24%); }

/* =========================================================
   動画
   ========================================================= */
.c-video { position: relative; aspect-ratio: 16 / 9; background: #0b1220; border-radius: 18px; overflow: hidden; }
.c-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.c-video__note { font-size: 14.5px; color: var(--ink-3); margin: 16px 0 0; }

/* =========================================================
   確認（クイズ）
   ========================================================= */
.p-lesson-step[data-type="quiz"] { counter-reset: q; }
.c-quiz { counter-increment: q; border-top: 1px solid var(--line); padding: 28px 0 10px; margin: 0; }
.c-quiz:first-of-type { margin-top: 24px; }
.c-quiz::before { content: "Q" counter(q); display: block; margin-bottom: 6px; font-family: var(--num); font-weight: 800; font-size: 26px; line-height: 1.2; color: var(--theme); }
.c-quiz > p { font-weight: 900; font-size: 19px; margin-bottom: 16px; max-width: none; }
.c-quiz .c-quiz__options { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: opt; max-width: 760px; }
.c-quiz .c-quiz__options li { margin: 0; counter-increment: opt; max-width: none; }
.c-quiz .c-quiz__options button {
  width: 100%; text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: center;
  border: 2px solid var(--line); background: var(--paper); border-radius: 16px; padding: 11px 18px; line-height: 1.6; font-weight: 500;
  transition: border-color .15s ease, background .15s ease;
}
.c-quiz .c-quiz__options button::before {
  content: counter(opt, upper-alpha); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--tint); font-family: var(--num); font-weight: 800; font-size: 16px; color: var(--ink-2);
}
.c-quiz .c-quiz__options button:hover { border-color: var(--theme); }
.c-quiz .c-quiz__options button[aria-pressed="true"] { border-color: var(--theme); background: var(--theme-soft); }
.c-quiz .c-quiz__options button[aria-pressed="true"]::before { background: var(--theme); color: #fff; }
.c-quiz.is-checked .c-quiz__options button { cursor: default; }
.c-quiz .c-quiz__options button.is-right { border-color: var(--ok); background: var(--ok-soft); }
.c-quiz .c-quiz__options button.is-right::before { background: var(--ok); color: #fff; }
.c-quiz .c-quiz__options button.is-wrong { border-color: var(--ng); background: var(--ng-soft); }
.c-quiz .c-quiz__options button.is-wrong::before { background: var(--ng); color: #fff; }
.c-quiz .c-quiz__explain { display: none; margin-top: 14px; padding: 14px 20px; border-radius: 16px; background: var(--tint); font-size: 15.5px; line-height: 1.85; max-width: 760px; }
.c-quiz.is-checked .c-quiz__explain { display: block; }
.c-quiz .c-quiz__verdict { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 16px; }
.c-quiz.is-right .c-quiz__verdict { color: var(--ok); }
.c-quiz.is-wrong .c-quiz__verdict { color: var(--ng); }
.c-quiz.is-right .c-quiz__verdict::before { content: "○"; }
.c-quiz.is-wrong .c-quiz__verdict::before { content: "×"; }
.c-quiz .c-quiz__explain ul { padding-left: 0; list-style: none; margin: 4px 0; }

/* 答え合わせの結果（1問目の上。2026-11-17）：答え合わせのあと、ここまでもどって上から見なおす */
.c-quiz__summary { margin: 0 0 22px; padding: 14px 20px; border-radius: 16px; background: var(--theme-soft, var(--tint)); scroll-margin-top: 84px; outline: none; }
.c-quiz__summary[hidden] { display: none; }
.p-lesson-step .c-quiz__summary p { margin: 0; max-width: none; }
.p-lesson-step .c-quiz__summary .c-quiz__summary-score { font-weight: 900; font-size: 18px; color: var(--ink); }
.c-quiz__summary-score b { font-family: var(--num); font-size: 24px; margin: 0 2px; color: var(--theme-ink, var(--ink)); }
.c-quiz__summary.is-perfect .c-quiz__summary-score b { color: var(--ok); }
.p-lesson-step .c-quiz__summary .c-quiz__summary-text { margin-top: 4px; font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.c-quiz__bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 28px 0 0; padding: 18px 24px; border-radius: 20px; background: var(--tint); }
.c-quiz__score { font-weight: 700; color: var(--ink-2); margin-right: auto; }
.c-quiz__score b { font-family: var(--num); font-size: 36px; font-weight: 800; color: var(--theme); margin: 0 3px; }
.c-quiz__bar.is-perfect b { color: var(--ok); }
/* 先生のリアクション */
.c-reaction { display: none; align-items: center; gap: 16px; flex-basis: 100%; order: -1; }
.c-reaction.is-on { display: flex; animation: pop .35s ease-out; }
.c-reaction .c-bust { width: 100px; height: 100px; box-shadow: 0 0 0 4px var(--paper); }
.c-reaction p { margin: 0; background: var(--paper); border-radius: 20px; padding: 12px 20px; font-weight: 700; font-size: 17px; line-height: 1.7; position: relative; max-width: none; }
.c-reaction p::before { content: ""; position: absolute; left: -9px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-right-color: var(--paper); border-left: 0; }

/* =========================================================
   書く（フォーム）
   ========================================================= */
.c-field { display: block; margin: 14px 0 22px; max-width: 46em; }
.c-field > span { display: block; font-size: 15.5px; font-weight: 900; color: var(--ink); margin-bottom: 8px; line-height: 1.5; }
.c-field input:not([type="file"]), .c-field textarea {
  width: 100%; font: inherit; font-size: 17px; line-height: 1.7; color: var(--ink);
  border: 2px solid var(--line); border-radius: 14px; padding: 12px 16px; background: var(--tint);
  transition: border-color .15s ease, background .15s ease;
}
.c-field textarea { min-height: 160px; resize: vertical; }
.c-field input:focus, .c-field textarea:focus { outline: none; border-color: var(--theme); background: var(--paper); box-shadow: 0 0 0 4px var(--theme-soft); }
.c-field .c-field__count { display: block; text-align: right; font-family: var(--num); font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.c-save-state { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; font-size: 14px; font-weight: 700; color: var(--ink-3); }
.c-save-state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.c-save-state.is-saved { color: var(--ok); }
.c-save-state.is-saved::before { background: var(--ok); }

/* =========================================================
   クリア画面
   ========================================================= */
.p-done { text-align: center; position: relative; overflow: hidden; padding-top: 56px; }
.p-done__cast { display: flex; justify-content: center; align-items: flex-end; margin: 0 0 22px; position: relative; z-index: 1; }
.p-done__cast .c-bust { width: 116px; height: 116px; margin: 0 -12px; box-shadow: 0 0 0 5px var(--paper); }
.p-done__cast .c-bust:nth-child(2) { width: 150px; height: 150px; z-index: 1; }
.p-done__label { display: inline-block; margin: 0 0 12px; padding: 6px 26px; border-radius: 99px; max-width: none; background: var(--hl); color: var(--ink); font-weight: 900; font-size: 20px; letter-spacing: .3em; text-indent: .3em; }
.p-done h2 { margin: 0 0 26px; font-size: 30px; }
.p-lesson-step .p-done__stats { list-style: none; padding: 0; margin: 0 auto 30px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; max-width: 720px; }
.p-done__stats li { margin: 0; padding: 14px 10px; border-radius: 18px; background: var(--tint); flex: 1; min-width: 104px; max-width: none; }
.p-done__stats b { display: block; font-family: var(--num); font-size: 32px; font-weight: 800; line-height: 1.2; color: var(--theme); }
.p-done__stats small { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.p-done__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.p-done__burst { position: absolute; inset: 0; pointer-events: none; }
.p-done__burst i { position: absolute; width: 10px; height: 10px; border-radius: 3px; opacity: 0; animation: fall 1.6s ease-out forwards; }
@keyframes fall { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)); } }

/* =========================================================
   ボタン・ページ送り
   ========================================================= */
.c-button {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 128px; padding: 12px 26px; border-radius: 14px;
  font-weight: 900; font-size: 16px; line-height: 1.35; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.c-button:active { transform: translateY(1px); }
.c-button--primary, .p-lesson-step a.c-button--primary { background: var(--theme); color: #fff; }
.c-button--primary:hover { background: var(--theme-ink); }
.c-button--ghost { background: var(--paper); border-color: var(--line); color: var(--ink-2); }
.c-button--ghost:hover { border-color: var(--ink-3); }
.c-button[disabled] { opacity: .45; cursor: not-allowed; }
.p-lesson-step a.c-button { text-decoration: none; }

.l-pager { position: fixed; left: var(--side-w); right: 0; bottom: 0; z-index: 10; pointer-events: none; }
.l-app.is-collapsed .l-pager { left: 0; }
.l-pager__inner {
  max-width: calc(var(--sheet) + 64px); margin: 0 auto; padding: 22px 32px calc(18px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; align-items: end; gap: 12px; pointer-events: auto;
  background: linear-gradient(rgba(243, 245, 249, 0), var(--canvas) 40%);
}
.l-pager__next { min-width: 240px; box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--theme) 80%, transparent); }
.l-pager__sub { font-size: 12px; font-weight: 500; opacity: .85; }
.l-pager__sub:empty { display: none; }
.c-scrim { position: fixed; inset: 0; z-index: 30; background: rgba(18, 26, 42, .4); }

/* =========================================================
   タブレット・スマートフォン
   ========================================================= */
@media (max-width: 1180px) {
  .c-chunk.has-media.is-now { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 0 32px; }
  .p-cover { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 1023px) {
  .l-app, .l-app.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .l-sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: min(var(--side-w), 86vw); transform: translateX(-100%); transition: transform .25s ease; visibility: hidden; }
  .l-app.is-open .l-sidebar { transform: none; visibility: visible; }
  .l-app .l-topbar__where { visibility: visible !important; }
  .l-pager, .l-app.is-collapsed .l-pager { left: 0; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .l-topbar { padding: 0 14px 0 6px; }
  .l-topbar__code { display: none; }
  .l-stage { padding: 0 10px 130px; }
  .c-chunk, .p-lesson-step:not([data-type="slide"]) { padding: 28px 20px 32px; border-radius: 18px; }
  .c-chunk.has-media.is-now { display: block; }
  .c-chunk__media { position: static; margin: 10px 0 0; }
  .p-cover { grid-template-columns: 1fr; }
  .p-cover__image { aspect-ratio: 16 / 9; min-height: 0; order: -1; }
  .p-cover__image::before { background: linear-gradient(0deg, var(--theme-deep), transparent 40%); }
  .p-cover__body { padding: 8px 22px 24px; }
  .p-cover__title { font-size: 40px; }
  .p-lesson-step h2 { font-size: 25px; }
  .p-lesson-step h3 { font-size: 23px; }
  .p-lesson-step:not([data-type="chat"]) .c-speech { grid-template-columns: 72px 1fr; gap: 0 14px; }
  .p-lesson-step:not([data-type="chat"]) .c-speech::before { width: 72px; height: 72px; }
  .p-lesson-step:not([data-type="chat"]) .c-speech > .c-speech__body { font-size: 16px; padding: 12px 16px; }
  .p-lesson-step[data-type="chat"] .c-speech { grid-template-columns: 56px minmax(0, 1fr); gap: 0 12px; }
  .p-lesson-step[data-type="chat"] .c-speech::before { width: 56px; height: 56px; }
  .p-lesson-step[data-type="chat"] .c-speech .c-speech__body { font-size: 16.5px; }
  .c-cast { gap: 12px; }
  .c-cast .c-bust { width: 64px; height: 64px; }
  .c-cast__note { display: none; }
  .p-sheet-head__pages i { width: 14px; }
  .p-sheet-head__pages i.is-now { width: 24px; }
  .p-sheet-head__pages span { display: none; }
  .l-pager__inner { padding: 14px 12px calc(12px + env(safe-area-inset-bottom)); }
  .c-button { min-width: 0; padding: 11px 18px; }
  .l-pager__next { min-width: 0; flex: 1; }
  .c-reaction .c-bust { width: 72px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 画面の途中に出てくる見出し（短い画面をまとめたとき） */
.c-chunk > h3:not(:first-child), .c-chunk__text > h3:not(:first-child) { font-size: 24px; margin-top: 44px; }
.c-chunk > h2:not(:first-child), .c-chunk__text > h2:not(:first-child) { font-size: 28px; margin-top: 44px; }

.p-lesson-step .c-continue-label { font-size: 14px; font-weight: 700; color: var(--theme-ink); margin: 0 0 8px; }
.p-lesson-step .c-continue-label + h4 { margin-top: 0; font-size: 26px; }

/* 変換で残した要素 */
.p-lesson-step .c-emphasis { font-weight: 900; }
.p-lesson-step .c-heading { font-weight: 900; margin-bottom: 8px; }
.p-lesson-step pre { background: #0f1729; color: #e6edf7; border-radius: 14px; padding: 16px 20px; overflow-x: auto; font-size: 14.5px; line-height: 1.7; max-width: none; }
.p-lesson-step code { font-family: "SFMono-Regular", Consolas, "Courier New", monospace; }
.p-lesson-step :not(pre) > code { background: var(--tint); border-radius: 6px; padding: 1px 6px; font-size: .92em; }
.p-lesson-step video.c-clip, .p-lesson-step .c-video__box video { display: block; width: 100%; max-width: 760px; border-radius: 14px; background: #000; margin: 12px 0 22px; }
.p-lesson-step audio { display: block; margin: 10px 0 18px; }
.p-lesson-step svg { max-width: 100%; height: auto; }
.p-lesson-step a[download] { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.p-lesson-step a[download]::before { content: "⬇"; }
.c-field select { width: 100%; font: inherit; font-size: 17px; border: 2px solid var(--line); border-radius: 14px; padding: 11px 14px; background: var(--tint); }
.c-net-error { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 50; background: var(--ng); color: #fff; font-weight: 700; padding: 10px 20px; border-radius: 12px; box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.c-file-name { display: block; margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--ok); }

/* =========================================================
   使いやすさの部品（lesson-tools.js）
   ========================================================= */
/* コピー */
.c-codebox { position: relative; margin: 14px 0 18px; }
.c-codebox > pre { margin: 0; padding-right: 108px; }
.c-codebox.is-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.c-codebox.is-line > code.c-command { flex: 1 1 auto; margin: 0; }
.c-copy-button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: #fff; font: 700 13px/1 var(--font); padding: 8px 12px; border-radius: 999px; cursor: pointer; transition: background .15s ease, transform .1s ease; }
.c-copy-button:hover { background: rgba(255,255,255,.2); }
.c-copy-button:active { transform: scale(.96); }
.c-codebox > .c-copy-button { position: absolute; top: 10px; right: 10px; }
.c-codebox.is-line > .c-copy-button, .c-copy-button.is-small { position: static; background: var(--theme-soft); color: var(--theme-ink); border-color: transparent; padding: 6px 11px; font-size: 12.5px; }
.c-codebox.is-line > .c-copy-button:hover, .c-copy-button.is-small:hover { background: color-mix(in srgb, var(--theme) 22%, white); }
.c-copy-button.is-done { background: #16a34a !important; color: #fff !important; border-color: transparent; }
.c-copy-button__icon { width: 13px; height: 13px; border: 2px solid currentColor; border-radius: 3px; position: relative; flex: none; }
.c-copy-button__icon::after { content: ""; position: absolute; left: 2px; top: -6px; width: 9px; height: 9px; border: 2px solid currentColor; border-radius: 3px; border-bottom-color: transparent; border-left-color: transparent; }
.c-copy-button.is-done .c-copy-button__icon { border: 0; width: 14px; }
.c-copy-button.is-done .c-copy-button__icon::after { left: 1px; top: -1px; width: 10px; height: 5px; border-width: 0 0 2.5px 2.5px; border-color: currentColor; border-radius: 0; transform: rotate(-45deg); }
.c-copy-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--tint); border: 1px solid var(--line); font-family: var(--mono, ui-monospace, monospace); font-weight: 700; }
.c-copy-chip .c-copy-button { margin-left: 2px; }

/* 画像の拡大 */
.l-sheet img.is-zoomable { cursor: zoom-in; }
.c-zoom { position: fixed; inset: 0; z-index: 90; background: rgba(10, 16, 28, .9); display: grid; grid-template-rows: 1fr auto; }
.c-zoom[hidden] { display: none; }
.c-zoom__body { overflow: auto; display: grid; place-items: center; padding: 56px 24px 8px; }
.c-zoom__body img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 10px; background: #fff; cursor: zoom-in; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.c-zoom.is-actual .c-zoom__body { place-items: start center; }
.c-zoom.is-actual .c-zoom__body img { max-width: none; max-height: none; cursor: zoom-out; }
.c-zoom__close { position: absolute; top: 14px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); cursor: pointer; z-index: 1; }
.c-zoom__close::before, .c-zoom__close::after { content: ""; position: absolute; left: 12px; right: 12px; top: 21px; height: 2.5px; background: #fff; border-radius: 2px; transform: rotate(45deg); }
.c-zoom__close::after { transform: rotate(-45deg); }
.c-zoom__hint { margin: 0; padding: 10px 16px 16px; text-align: center; color: rgba(255,255,255,.7); font-size: 13px; }
html.is-zoom, html.is-zoom body { overflow: hidden; }

/* 外部ツール */
a.c-tool-link::after { content: "↗"; display: inline-block; margin-left: 3px; font-size: .85em; }
a.c-tool-link.is-button { display: inline-flex; align-items: center; gap: 8px; margin: 6px 8px 6px 0; padding: 11px 18px; border-radius: 12px; background: var(--theme); color: #fff; font-weight: 700; text-decoration: none; box-shadow: 0 4px 0 var(--theme-ink); transition: transform .1s ease, box-shadow .1s ease; }
a.c-tool-link.is-button:hover { transform: translateY(-1px); }
a.c-tool-link.is-button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--theme-ink); }
a.c-tool-link.is-button + .c-copy-button { vertical-align: middle; }
.c-guide { position: fixed; inset: 0; z-index: 95; background: rgba(10,16,28,.55); display: grid; place-items: center; padding: 16px; }
.c-guide[hidden] { display: none; }
.c-guide__card { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 20px; padding: 26px 26px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.c-guide__close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--tint); cursor: pointer; }
.c-guide__close::before, .c-guide__close::after { content: ""; position: absolute; left: 10px; right: 10px; top: 17px; height: 2px; background: var(--ink-2); transform: rotate(45deg); }
.c-guide__close::after { transform: rotate(-45deg); }
.c-guide__kicker { margin: 0; color: var(--theme-ink); font-weight: 700; font-size: 13px; }
.c-guide h2 { margin: 4px 0 16px; font-size: 22px; }
.c-guide__figure { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; height: 120px; padding: 8px; border-radius: 12px; background: #1d2433; margin-bottom: 16px; }
.c-guide__figure > div { border-radius: 8px; display: grid; place-content: center; text-align: center; font-weight: 900; font-size: 15px; }
.c-guide__figure small { display: block; font-weight: 500; font-size: 12px; opacity: .8; }
.c-guide__pane--tool { background: #e9eef7; color: #1d2433; }
.c-guide__pane--text { background: var(--theme); color: #fff; }
.c-guide__steps { margin: 0 0 16px; padding-left: 1.4em; line-height: 1.8; }
.c-guide__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.c-guide__actions button { font: 700 15px/1 var(--font); padding: 14px 20px; border-radius: 12px; border: 0; cursor: pointer; }
.c-button--beside { background: var(--theme); color: #fff; flex: 1; }
.c-button--later { background: var(--tint); color: var(--ink-2); }
.c-guide__more { margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.c-guide__more summary { cursor: pointer; font-weight: 700; }
.c-guide__more kbd { display: inline-block; padding: 1px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--tint); font-family: var(--font); font-size: 13px; }
.c-guide__skip { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--ink-3); }
.c-beside-note { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; background: var(--ink); color: #fff; border-radius: 14px; padding: 14px 20px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.c-beside-note p { margin: 0; font-size: 14px; line-height: 1.7; }

/* 手順のチェック */
ul.c-procedure.is-check { list-style: none; padding: 0; margin: 16px 0 22px; display: grid; gap: 10px; }
ul.c-procedure.is-check > li { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; align-items: start; padding: 14px 16px 14px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .2s ease, background .2s ease; }
ul.c-procedure.is-check > li > :not(.c-procedure__check) { grid-column: 2; }
ul.c-procedure.is-check > li > .c-number { margin: 2px 0 4px; font-family: var(--num); font-weight: 800; font-size: 13px; color: var(--theme-ink); }
ul.c-procedure.is-check > li p { margin: 0 0 6px; }
ul.c-procedure.is-check > li > :last-child { margin-bottom: 0; }
.c-procedure__check { grid-column: 1; grid-row: 1 / span 9; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #c7cfdc; background: #fff; cursor: pointer; position: relative; transition: background .15s ease, border-color .15s ease, transform .1s ease; }
.c-procedure__check:hover { border-color: var(--theme); }
.c-procedure__check:active { transform: scale(.9); }
.c-procedure__check::after { content: ""; position: absolute; left: 10px; top: 7px; width: 8px; height: 14px; border: solid transparent; border-width: 0 3px 3px 0; transform: rotate(45deg); }
li.is-checked > .c-procedure__check { background: var(--theme); border-color: var(--theme); }
li.is-checked > .c-procedure__check::after { border-color: #fff; }
ul.c-procedure.is-check > li.is-checked { border-color: color-mix(in srgb, var(--theme) 40%, white); background: color-mix(in srgb, var(--theme-soft) 55%, white); }
ul.c-procedure.is-complete { animation: steps-done .6s ease; }
@keyframes steps-done { 0% { transform: scale(1); } 40% { transform: scale(1.015); } 100% { transform: scale(1); } }

/* スマホを使うステップ */
.c-device { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; }
.c-device__tag { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 14px; border-radius: 999px; background: #fff4e0; color: #8a4b00; font-size: 14px; font-weight: 700; }
.c-device__qr-button { border: 1.5px solid #f0c27a; background: #fff; color: #8a4b00; font: 700 13.5px/1 var(--font); padding: 9px 14px; border-radius: 999px; cursor: pointer; }
.c-device__qr { flex-basis: 100%; display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); }
.c-device__qr[hidden] { display: none; }
.c-device__qr svg { width: 160px; height: 160px; flex: none; }
.c-device__qr p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* 狭い窓（ツールと並べて右1/3で使うとき） */
@media (max-width: 760px) {
  .c-codebox > pre { padding-right: 20px; padding-top: 48px; }
  .c-codebox > .c-copy-button { top: 8px; right: 8px; }
  ul.c-procedure.is-check > li { grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; padding: 12px; }
  .c-procedure__check { width: 30px; height: 30px; }
  .c-procedure__check::after { left: 9px; top: 6px; }
  .c-guide h2 { font-size: 19px; }
  .c-guide__figure { height: 90px; }
}

/* STAR Colabで選ぶメニュー */
.c-colab-path { margin: 14px 0 6px; padding: 14px 16px; border-radius: 14px; background: var(--theme-soft); }
.c-colab-path__title { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--theme-ink); }
.c-colab-path ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px 6px; }
.c-colab-path li { display: flex; flex-direction: column; justify-content: center; padding: 8px 14px; border-radius: 10px; background: #fff; border: 1.5px solid color-mix(in srgb, var(--theme) 30%, white); line-height: 1.35; }
.c-colab-path li + li::before { content: none; }
.c-colab-path li:not(:last-child) { margin-right: 18px; position: relative; }
.c-colab-path li:not(:last-child)::after { content: "›"; position: absolute; right: -17px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 700; color: var(--theme); }
.c-colab-path small { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.c-colab-path b { font-size: 15px; }

/* 回の完了待ち */
.p-done__wait { margin: 18px auto 0; max-width: 520px; padding: 16px 20px; border-radius: 16px; background: #fff4e0; color: #7a4300; text-align: center; }
.p-done__wait p { margin: 0 0 8px; }
.p-done__wait-message { font-weight: 900; font-size: 17px; }
.p-done__wait-sub { font-size: 13.5px; }
.p-done.is-pending .p-done__actions .c-button--primary { display: none; }
.l-topbar__mode { margin: 0 12px 0 0; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.l-topbar__mode.is-mode-classroom { background: #e2f6ee; color: #0b7a55; }
.l-topbar__mode.is-mode-home { background: #fff1dc; color: #a35a00; }
.l-topbar__mode.is-mode-online { background: #e3efff; color: #1f5fbf; }

/* ---------- 書く・提出する ---------- */
.c-privacy-note { margin: 10px 0 18px; max-width: 46em; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); background: var(--tint); border-radius: 12px; padding: 10px 14px; }
.c-privacy-note a { font-weight: 700; }
.c-drop { border: 2px dashed var(--line); border-radius: 18px; padding: 14px; background: var(--paper); transition: border-color .15s, background .15s; }
.c-drop.has-items { border-style: solid; }
.c-drop.is-over { border-color: var(--theme); background: var(--theme-soft); }
.c-drop.is-busy { opacity: .6; pointer-events: none; }
.c-drop__items { display: grid; gap: 10px; }
.c-drop__items:not(:empty) { margin-bottom: 12px; }
.c-drop__item { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; background: var(--tint); border-radius: 14px; padding: 8px; position: relative; }
.c-drop__thumb { width: 72px; height: 56px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--theme-soft); text-decoration: none; }
.c-drop__thumb img { width: 100%; height: 100%; object-fit: contain; }
.c-drop__ext { font-family: var(--num); font-weight: 800; font-size: 15px; color: var(--theme-ink, var(--ink)); }
.c-drop__name { display: grid; gap: 2px; min-width: 0; }
.c-drop__name b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-drop__name small { font-size: 12.5px; color: var(--ok); font-weight: 700; }
.c-drop__delete { font: inherit; font-size: 12.5px; font-weight: 700; border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.c-drop__delete:hover { background: var(--paper); color: var(--ng); }
.c-drop__actions, .c-post__actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.c-drop__button, .c-post__button { font: inherit; font-weight: 900; font-size: 15px; border: 0; border-radius: 99px; padding: 11px 22px; background: var(--theme); color: #fff; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.c-drop__button:hover, .c-post__button:hover { filter: brightness(1.06); }
.c-drop__button[hidden], .c-post__button[hidden] { display: none; }
.c-drop__hint, .c-post__hint { font-size: 12.5px; color: var(--ink-3); }
.c-drop__message { margin: 8px 0 0; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.c-drop__message:empty { display: none; }
.c-drop__message.is-ng { color: var(--ng); }
.c-ask { margin-top: 10px; background: #fff8d6; border-radius: 14px; padding: 12px 14px; grid-column: 1 / -1; }
.c-ask p { margin: 0 0 8px; font-size: 14px; }
.c-ask__buttons { display: flex; gap: 8px; }
.c-ask__buttons button { font: inherit; font-weight: 700; font-size: 14px; border-radius: 99px; padding: 7px 16px; cursor: pointer; border: 2px solid var(--line); background: var(--paper); }
.c-ask__buttons .c-ask__yes { background: var(--ink); color: #fff; border-color: var(--ink); }
.c-selfcheck { display: flex; gap: 10px; flex-wrap: wrap; }
.c-selfcheck button { font: inherit; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 16px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; transition: transform .12s, border-color .12s; }
.c-selfcheck button span { font-size: 24px; line-height: 1; }
.c-selfcheck button:hover { transform: translateY(-2px); }
.c-selfcheck button.is-on { border-color: var(--theme); background: var(--theme-soft); color: var(--theme-ink, var(--ink)); }
.c-post__items { display: grid; gap: 8px; margin-bottom: 10px; }
.c-post__items:empty { display: none; }
.c-post__item { background: var(--tint); border-radius: 14px; padding: 10px 14px; }
.c-post__item p { margin: 0 0 2px; line-height: 1.75; }
.c-post__item small { font-size: 12px; color: var(--ink-3); }
.c-field--keep-add textarea, .c-field--keep-once textarea { margin-bottom: 10px; }
.c-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 99px; font-weight: 700; font-size: 15px; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: transform .25s, opacity .25s; z-index: 200; white-space: nowrap; }
.c-toast.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.c-toast a { color: #ffe27a; margin-left: 10px; }
.l-topbar__mode.is-mode-preview { background: #ede7ff; color: #5b3cc4; }
.c-drop__thumb { position: relative; }
.c-drop__thumb.is-video::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 18px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.c-drop__actions[hidden] { display: none; }
.c-confirm { display: grid; gap: 10px; background: var(--tint); border-radius: 14px; padding: 12px 14px; }
.c-confirm__file { margin: 0; font-size: 14px; word-break: break-all; }
.c-confirm__row { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.c-confirm__row textarea { font: inherit; font-weight: 400; font-size: 15px; border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; resize: vertical; background: var(--paper); }
.c-confirm__share { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.c-confirm__share small { flex-basis: 100%; font-weight: 500; font-size: 12.5px; color: var(--ink-3); padding-left: 24px; }
.c-confirm__once { margin: 0; font-size: 13.5px; color: #8a6400; }
.c-confirm__actions { display: flex; gap: 8px; }
.c-confirm__go { font: inherit; font-weight: 900; font-size: 15px; border: 0; border-radius: 99px; padding: 10px 22px; background: var(--theme); color: #fff; cursor: pointer; }
.c-confirm__no { font: inherit; font-weight: 700; font-size: 14px; border: 2px solid var(--line); border-radius: 99px; padding: 8px 16px; background: var(--paper); cursor: pointer; }
.c-drop__share { font-style: normal; color: #0b7a55; background: #e2f6ee; border-radius: 99px; padding: 0 8px; margin-left: 6px; }
.c-drop__comment { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-field .c-confirm__share input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; border: 0; background: none; box-shadow: none; flex: none; position: relative; top: 3px; accent-color: var(--theme); }
.c-field .c-confirm__row textarea { min-height: 64px; }

/* =========================================================
   ステラの一言（自由記述の欄の下）。指示書 26.11
   ========================================================= */
.c-stella { display: flex; gap: 14px; align-items: flex-start; max-width: 46em; margin: 6px 0 26px; }
.c-stella__face { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--theme-soft); border: 3px solid var(--paper); box-shadow: 0 2px 10px rgba(18, 26, 42, .12); transition: transform .3s ease; }
.c-stella.is-busy .c-stella__face { animation: stella-bob 1s ease-in-out infinite; }
@keyframes stella-bob { 50% { transform: translateY(-4px) rotate(-3deg); } }
.c-stella__body { flex: 1; min-width: 0; position: relative; background: var(--paper); border: 2px solid var(--theme-soft); border-radius: 4px 18px 18px 18px; padding: 10px 16px 12px; }
.c-stella__name { margin: 0; font-family: var(--num); font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--theme-ink); }
.c-stella__result { margin: 4px 0 8px; }
.c-stella__result p { margin: 6px 0; font-size: 15.5px; line-height: 1.75; }
.c-stella__good, .c-stella__next { display: flex; gap: 10px; align-items: baseline; }
.c-stella__good b, .c-stella__next b { flex: none; font-size: 12px; font-weight: 900; padding: 1px 10px; border-radius: 99px; line-height: 1.8; }
.c-stella__good b { background: var(--ok-soft); color: var(--ok); }
.c-stella__next b { background: var(--theme-soft); color: var(--theme-ink); }
.c-stella__result strong { background: linear-gradient(transparent 62%, var(--hl) 62%); font-weight: 900; }
.c-stella__think { color: var(--ink-3); font-weight: 700; }
.c-stella__think span { display: inline-block; animation: stella-dots 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; width: 0; }
@keyframes stella-dots { to { width: 1.2em; } }
.c-stella__caution { background: var(--tint); border-radius: 12px; padding: 8px 12px; }
.c-stella__mock { font-size: 12.5px !important; color: var(--ink-3); }
.c-stella__ask { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.c-stella__button { border: 0; cursor: pointer; font-weight: 900; font-size: 14.5px; color: #fff; background: var(--theme); border-radius: 99px; padding: 6px 18px 6px 16px; line-height: 1.6; transition: transform .12s ease, background .15s ease; }
.c-stella__button::before { content: "\2726"; margin-right: 6px; }
.c-stella__button:hover { background: var(--theme-ink); }
.c-stella__button:active { transform: scale(.97); }
.c-stella__button:disabled { opacity: .55; cursor: default; }
.c-stella__left { font-size: 12.5px; color: var(--ink-3); font-family: var(--num); }
.c-stella__message { margin: 6px 0 0; font-size: 13.5px; color: var(--ng); }
.c-stella__message:empty { display: none; }
.c-stella.is-stale .c-stella__result { opacity: .55; }
@media (max-width: 640px) {
  .c-stella__face { width: 46px; height: 46px; }
  .c-stella__good, .c-stella__next { flex-direction: column; gap: 2px; }
}

/* =========================================================
   2026-10 デザイン刷新「方眼ノートとステッカー」
   - 机＝方眼紙、教材＝白いノート、ステップ名＝ノートのインデックス（見出しタブ）
   - キャラクターは「切り抜きステッカー」（白ふち＋細い線）
   - 進み具合は左の「スタンプカード」。クリアで先生のハンコ
   - 目立たせるのは「ステッカー」と「スタンプ」だけ。ほかは静かに
   ========================================================= */
:root {
  --ink: #18213a;
  --ink-2: #45506a;
  --ink-3: #7d879c;
  --canvas: #e9edf3;
  --grid: rgba(24, 33, 58, .055);
  --line: #d9e0ea;
  --tint: #f2f5f9;
  --hl: #ffe24a;
  --stamp: #e5484d;
  --display: "Dela Gothic One", var(--font);
  --num: "Dela Gothic One", var(--font);
}
body {
  background-color: var(--canvas);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
}
.l-topbar { background: color-mix(in srgb, var(--canvas) 86%, transparent); }

/* ---- 見出しの文字（太いディスプレイ書体は見出しと数字だけ） ---- */
.p-lesson-step h2, .p-cover__title, .p-done h2, .l-sidebar__title { font-family: var(--display); font-weight: 400; letter-spacing: .02em; }
.p-lesson-step h2 { font-size: 32px; line-height: 1.45; }
.p-lesson-step h3 { font-weight: 900; font-size: 26px; padding-bottom: 6px; background: linear-gradient(var(--theme), var(--theme)) left bottom / 56px 4px no-repeat; }
.c-chunk h2 + h3 { font-size: 21px; background: none; padding-bottom: 0; }
.p-lesson-step:not([data-type="slide"]) h3 { font-size: 21px; }
.l-sidebar__title { font-size: 18px; line-height: 1.5; }

/* ---- ノートの紙とインデックス（ステップ名）---- */
.c-chunk, .p-lesson-step:not([data-type="slide"]) { border: 1.5px solid var(--line); border-radius: 6px 22px 22px 22px; }
.p-lesson-step[data-type="slide"] { border: 0; }
.p-sheet-head { margin: 10px 0 -1.5px; min-height: 0; gap: 0; align-items: flex-end; position: relative; z-index: 1; }
.p-sheet-head__icon { width: auto; height: 42px; padding: 0 12px 0 14px; border-radius: 14px 0 0 0; background: var(--theme); color: #fff; }
.p-sheet-head__title {
  flex: 0 1 auto; height: 42px; display: flex; align-items: center; padding: 0 22px 0 4px;
  background: var(--theme); color: #fff; border-radius: 0 14px 0 0; font-size: 15px; font-weight: 900;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%;
}
.p-sheet-head__pages { margin-left: auto; padding-bottom: 10px; }
.p-sheet-head__pages i { background: #cfd7e3; }
.p-sheet-head__pages span { font-size: 13px; letter-spacing: .04em; }
.p-sheet-head + .p-lesson-step, .p-sheet-head ~ .p-lesson-step { margin-top: 0; }

/* ---- 本文のメリハリ ---- */
.c-chunk__text > p:first-of-type, .c-chunk > p:first-of-type { font-size: 18px; }
.p-lesson-step mark { background: linear-gradient(100deg, transparent 2%, var(--hl) 4%, var(--hl) 96%, transparent 98%) 0 72% / 100% 46% no-repeat; }
.p-lesson-step .c-keywords::before { content: "キーワード"; }
.c-keywords li { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 999px; padding: 0 12px; font-size: 14px; box-shadow: 2px 2px 0 var(--hl); }
.p-lesson-step ol.c-goal-list > li { background: var(--paper); border: 1.5px solid var(--line); border-top: 5px solid var(--theme); border-radius: 6px 6px 16px 16px; }
.p-lesson-step ol.c-goal-list > li::before { font-weight: 400; font-size: 26px; }
.p-lesson-step .c-tip { background: #fff7cc; border-radius: 4px 18px 18px 18px; }
.p-lesson-step .c-box { border: 1.5px solid var(--line); border-radius: 16px; }
.p-lesson-step thead th { background: var(--ink); }

/* ---- ステッカー（キャラクター） ---- */
.c-bust { box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px var(--ink) !important; }
.p-lesson-step:not([data-type="chat"]) .c-speech::before { box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px var(--ink); transform: rotate(-4deg); }
.p-lesson-step:not([data-type="chat"]) .c-speech:nth-of-type(even)::before { transform: rotate(3deg); }
.p-lesson-step:not([data-type="chat"]) .c-speech > .c-speech__body { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 20px; }
.p-lesson-step:not([data-type="chat"]) .c-speech > .c-speech__body::before { left: -11px; border-right-color: var(--ink); }
.p-lesson-step:not([data-type="chat"]) .c-speech > .c-speech__body::after { content: ""; position: absolute; left: -8px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-right-color: var(--paper); border-left: 0; }
/* 吹き出しの中に画像・リスト・表があるとき（顔は上にそろえる） */
.p-lesson-step:not([data-type="chat"]) .c-speech:has(> .c-speech__body img, > .c-speech__body .c-data-table, > .c-speech__body pre) { align-items: start; }
.p-lesson-step:not([data-type="chat"]) .c-speech:has(> .c-speech__body img, > .c-speech__body .c-data-table, > .c-speech__body pre) > .c-speech__body::before,
.p-lesson-step:not([data-type="chat"]) .c-speech:has(> .c-speech__body img, > .c-speech__body .c-data-table, > .c-speech__body pre) > .c-speech__body::after { top: 52px; }
.c-speech > .c-speech__body > :first-child { margin-top: 0; }
.c-speech > .c-speech__body > :last-child { margin-bottom: 0; }
.c-speech > .c-speech__body img { margin: 12px 0 4px; max-height: 420px; width: auto; }
.c-speech > .c-speech__body ul, .c-speech > .c-speech__body ol { margin: 6px 0 6px; }
.c-speech > .c-speech__body p { margin: 0 0 6px; max-width: none; }
.c-speech > .c-speech__body .c-data-table { margin: 10px 0; background: var(--paper); }
.c-speech > .c-speech__body pre { font-weight: 500; }

.c-cast { border-bottom: 1.5px dashed var(--line); }
.c-cast .c-bust { transform: rotate(-3deg); }
.c-cast figure:nth-child(even) .c-bust { transform: rotate(3deg); }
.c-cast figure.is-talking .c-bust { transform: translateY(-6px) scale(1.1) rotate(0); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--theme) !important; }
.p-lesson-step[data-type="chat"] .c-speech::before { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4px var(--ink); }
.p-lesson-step[data-type="chat"] .c-speech .c-speech__body { background: var(--tint); border: 1.5px solid transparent; }
.p-lesson-step[data-type="chat"] .c-speech[data-who="memori"] .c-speech__body, .p-lesson-step[data-type="chat"] .c-speech[data-who="memori-hs"] .c-speech__body,
.p-lesson-step[data-type="chat"] .c-speech[data-who="suta"] .c-speech__body { background: var(--theme-soft); }
.p-lesson-step[data-type="chat"] .c-speech[data-who="user"] .c-speech__body { background: var(--ink); color: #fff; }

/* チャットで自分の考えを書く */
.c-chat-answer { margin: 12px 0 2px; display: grid; gap: 8px; max-width: 560px; }
.c-chat-answer textarea { width: 100%; font: inherit; font-size: 17px; line-height: 1.7; border: 2px solid var(--ink); border-radius: 18px 4px 18px 18px; padding: 10px 16px; background: var(--paper); resize: vertical; min-height: 76px; }
.c-chat-answer textarea:focus { outline: none; box-shadow: 0 0 0 4px var(--theme-soft); }
.c-chat-answer__act { display: flex; align-items: center; gap: 12px; }
.c-chat-answer__act small { color: var(--ink-3); font-size: 13px; }
.c-chat-send { border: 2px solid var(--ink); background: var(--theme); color: #fff; border-radius: 999px; padding: 7px 22px; font-weight: 900; cursor: pointer; box-shadow: 2px 3px 0 var(--ink); }
.c-chat-send:active { transform: translate(1px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.c-chat-send[disabled] { opacity: .45; cursor: not-allowed; }
.c-chat-answer.is-answered { display: none; }

/* ---- ボタン：押せるものだけ、線と影でくっきり ---- */
.c-button--primary, .p-lesson-step a.c-button--primary { border-color: var(--ink); box-shadow: 3px 4px 0 var(--ink); }
.c-button--primary:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.c-button--ghost { border-color: var(--ink); color: var(--ink); }
.l-pager__next { box-shadow: 3px 4px 0 var(--ink); }
.c-choices button { border-color: var(--ink); color: var(--ink); box-shadow: 2px 3px 0 var(--ink); }
.c-choices button:hover { background: var(--hl); }
.c-choices button:active { transform: translate(1px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ---- 左：スタンプカード（％の表示はスタンプの数に置きかえ） ---- */
.l-sidebar__progress { display: none; }
.l-sidebar { background: var(--paper); }
.l-sidebar__stamps { display: flex; align-items: baseline; gap: 8px; margin: 0 8px 12px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.l-sidebar__stamps b { font-family: var(--num); font-weight: 400; font-size: 22px; color: var(--ink); }
.l-sidebar__list a { grid-template-columns: 30px 1fr; }
.l-sidebar__list .l-sidebar__icon { width: 30px; height: 30px; border-radius: 50%; border: 1.5px dashed #b9c3d2; color: var(--ink-3); transition: transform .25s ease; }
.l-sidebar__list .l-sidebar__icon svg { width: 16px; height: 16px; }
.l-sidebar__list li.is-done .l-sidebar__icon { border: 2px solid var(--stamp); color: var(--stamp); background: color-mix(in srgb, var(--stamp) 8%, white); transform: rotate(-12deg); }
.l-sidebar__list li.is-done:nth-child(3n+1) .l-sidebar__icon { transform: rotate(8deg); }
.l-sidebar__list li.is-done:nth-child(3n+2) .l-sidebar__icon { transform: rotate(-4deg); }
.l-sidebar__list li.is-done .l-sidebar__icon svg { stroke-width: 3; }
.l-sidebar__list li.is-now .l-sidebar__icon { border: 2px solid var(--theme); color: var(--theme); background: var(--paper); transform: none; }
.l-sidebar__list li.is-now a { background: var(--theme-soft); }
.l-sidebar__list li.is-final .l-sidebar__icon { border-style: solid; }
.l-sidebar__list li.is-stamped .l-sidebar__icon { animation: stamp-in .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stamp-in { 0% { transform: scale(2.2) rotate(-30deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(-12deg); } }

/* ---- 回の表紙 ---- */
.p-cover { border: 1.5px solid var(--ink); border-radius: 6px 22px 22px 22px; }
.p-cover__title { font-size: 44px; line-height: 1.25; margin-bottom: 16px; }
.p-cover__body { padding: 30px 40px 26px; }
.p-cover__image { min-height: 220px; }
.p-cover__cast { margin-top: 20px; }
.p-cover__cast .c-bust { width: 56px; height: 56px; }
.p-cover__cast .c-bust { box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px var(--ink) !important; margin-right: -6px; }
.p-cover__cast .c-bust:nth-child(odd) { transform: rotate(-5deg); }
.p-cover__cast .c-bust:nth-child(even) { transform: rotate(4deg) translateY(-4px); }

/* ---- 確認問題 ---- */
.c-quiz::before { font-family: var(--num); font-weight: 400; }
.c-quiz .c-quiz__options button { border-width: 1.5px; }
.c-quiz .c-quiz__options button::before { font-weight: 400; }
.c-quiz .c-quiz__options button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 2px 3px 0 var(--ink); }
.c-quiz__score b { font-weight: 400; }
.c-quiz > .c-quiz__text { display: block; font-weight: 900; font-size: 19px; line-height: 1.7; margin: 0 0 14px; max-width: 760px; }
/* ヒント（ふせん） */
.c-quiz details.c-hint { margin: 12px 0 4px; max-width: 760px; }
.c-quiz details.c-hint > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 900; color: var(--ink-2); padding: 4px 14px; border-radius: 999px; border: 1.5px dashed var(--ink-3); }
.c-quiz details.c-hint > summary::-webkit-details-marker { display: none; }
.c-quiz details.c-hint > summary::before { content: "💡"; }
.c-quiz details.c-hint[open] > summary { border-style: solid; border-color: var(--ink); background: var(--hl); color: var(--ink); }
.c-quiz details.c-hint > :not(summary) { background: #fff7cc; margin: 10px 0 0; padding: 12px 18px; border-radius: 2px 14px 14px 14px; font-size: 15.5px; line-height: 1.8; box-shadow: 2px 3px 0 #f1dc7a; }
.c-quiz details.c-hint p:last-child { margin-bottom: 0; }
.c-quiz.is-right details.c-hint { display: none; }

/* ---- 書く ---- */
.c-field input:not([type="file"]), .c-field textarea, .c-field select { border-width: 1.5px; background-color: var(--paper); }
/* 書く欄：ノートの罫線。行の高さと罫線の間隔を同じ数値（32px）にして、文字と線がずれないようにする。
   background-attachment: local で、スクロールしても罫線が文字と一緒に動く */
.c-field textarea {
  --rule: 32px;
  font-size: 17px; line-height: var(--rule); padding: 8px 16px;
  background-color: var(--paper);
  background-image: linear-gradient(transparent calc(var(--rule) - 1px), #e3e8f0 calc(var(--rule) - 1px));
  background-size: 100% var(--rule); background-position: 0 8px; background-origin: padding-box; background-attachment: local;
  min-height: calc(var(--rule) * 5 + 16px);
}
.c-field textarea:focus {   /* 入力中も罫線を残す（上の :focus の background 指定で消えないように） */
  background-image: linear-gradient(transparent calc(var(--rule) - 1px), #e3e8f0 calc(var(--rule) - 1px));
  background-size: 100% var(--rule); background-position: 0 8px; background-attachment: local;
}

/* ---- めくり式（共通テストの問題ページ） ---- */
.c-flipbook { margin: 18px 0 28px; max-width: none; }
.c-flipbook.is-ready { display: grid; gap: 12px; }
.c-flipbook__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: sticky; top: 64px; z-index: 5; padding: 10px 12px; border-radius: 16px; background: var(--ink); color: #fff; }
.c-flipbook__bar button { border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 900; font-size: 14px; border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.c-flipbook__bar button:hover:not([disabled]) { background: rgba(255, 255, 255, .24); }
.c-flipbook__bar button[disabled] { opacity: .35; cursor: default; }
.c-flipbook__count { font-family: var(--num); font-size: 18px; min-width: 4.5em; text-align: center; }
.c-flipbook__count small { font-size: 13px; opacity: .7; }
.c-flipbook__thumbs { display: flex; gap: 6px; margin-left: auto; overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
.c-flipbook__thumbs button { padding: 0; width: 34px; height: 46px; flex: none; border-radius: 4px; overflow: hidden; background: #fff; border: 2px solid transparent; opacity: .55; }
.c-flipbook__thumbs button.is-now { border-color: var(--hl); opacity: 1; }
.c-flipbook__thumbs img { width: 100%; height: 100%; object-fit: cover; object-position: top; margin: 0; border-radius: 0; display: block; }
.c-flipbook.is-ready .c-flipbook__page { display: none; }
.c-flipbook.is-ready .c-flipbook__page.is-now { display: block; animation: flip .25s ease-out; }
.c-flipbook__page img { display: block; width: 100%; max-width: 820px; margin: 0 auto; border-radius: 4px; border: 1.5px solid var(--line); background: #fff; box-shadow: 4px 6px 0 rgba(24, 33, 58, .08); }
@keyframes flip { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* ---- クリア：先生のハンコ ---- */
.p-done { border: 1.5px solid var(--ink); }
.p-done__label {
  position: relative; display: inline-grid; place-items: center; width: 132px; height: 132px; padding: 0; margin: 0 0 18px;
  border-radius: 50%; background: transparent; color: var(--stamp); border: 5px double var(--stamp);
  font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: .1em; text-indent: .1em; transform: rotate(-12deg);
  animation: hanko .5s cubic-bezier(.2, 1.5, .4, 1) .35s both;
}
@keyframes hanko { 0% { transform: scale(2.4) rotate(-30deg); opacity: 0; } 70% { opacity: 1; } 100% { transform: scale(1) rotate(-12deg); } }
.p-done__stats li { background: var(--paper); border: 1.5px solid var(--line); }
.p-done__stats b { font-weight: 400; font-size: 28px; }
.p-done__cast .c-bust:nth-child(1) { transform: rotate(-6deg); }
.p-done__cast .c-bust:nth-child(3) { transform: rotate(6deg); }

@media (max-width: 760px) {
  .p-cover__title { font-size: 34px; }
  .p-lesson-step h2 { font-size: 25px; }
  .p-sheet-head__title { max-width: 62%; font-size: 14px; }
  .c-flipbook__thumbs { display: none; }
  .c-flipbook__bar { top: 56px; flex-wrap: nowrap; justify-content: space-between; padding: 8px; }
  .c-flipbook__bar button { padding: 8px 14px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .p-done__label, .l-sidebar__list li.is-stamped .l-sidebar__icon, .c-flipbook.is-ready .c-flipbook__page.is-now { animation: none; }
}

/* ---- 「次へ」の連打を防ぐ（2026-10） ----
   はじめてのステップでは、ページ送りを内容のいちばん下に置く（is-inline）。
   読む時間のあいだは、ボタンの中のゲージがたまってから押せる */
.l-pager.is-inline { position: static; left: auto; right: auto; pointer-events: auto; margin-top: 22px; }
.l-pager.is-inline .l-pager__inner { max-width: none; padding: 0; background: none; }
.l-pager__next { position: relative; overflow: hidden; }
.l-pager__next.is-pending { opacity: 1 !important; cursor: progress !important; background: color-mix(in srgb, var(--theme) 35%, white); }
.l-pager__next.is-pending::before {
  content: ""; position: absolute; inset: 0; background: var(--theme); transform-origin: left center;
  animation: wait-fill var(--wait, 3s) linear forwards;
}
.l-pager__next.is-pending > * { position: relative; }
@keyframes wait-fill { from { transform: scaleX(var(--from, 0)); } to { transform: scaleX(1); } }
.l-pager .c-ask { position: absolute; right: 0; bottom: calc(100% + 10px); width: min(420px, 100%); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 16px; padding: 14px 16px; box-shadow: 3px 4px 0 var(--ink); }
.l-pager__inner { position: relative; }
.l-pager .c-ask p { margin: 0 0 10px; font-weight: 700; }
.l-pager .c-ask__buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.l-pager .c-ask__buttons button { font: 900 14px/1 var(--font); padding: 10px 14px; border-radius: 10px; cursor: pointer; border: 1.5px solid var(--ink); background: var(--paper); }
.l-pager .c-ask__back { background: var(--theme) !important; color: #fff; }
/* 会話の「入力中…」 */
.p-lesson-step[data-type="chat"] .c-speech.is-typing .c-speech__body { display: inline-flex; gap: 5px; align-items: center; padding: 16px 20px; }
.c-speech.is-typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); animation: typing 1s infinite ease-in-out; }
.c-speech.is-typing i:nth-child(2) { animation-delay: .15s; }
.c-speech.is-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .l-pager__next.is-pending::before { animation-duration: .01s; animation-delay: var(--wait, 3s); } .c-speech.is-typing i { animation: none; } }
/* まだ開けないステップ（前のステップを終えると開く） */
.l-sidebar__list li.is-ahead a { color: var(--ink-3); cursor: not-allowed; }
.l-sidebar__list li.is-ahead a:hover { background: none; color: var(--ink-3); }
.l-sidebar__list li.is-shake a { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.l-pager .c-ask__yes { color: var(--ink); }

/* ---- 読む画面：まとまりを下に足していく（2026-10） ----
   はじめては「続きを読む」で1つずつ下に現れる。終えたステップ・復習では全部を並べ、上に目次を出す */
.p-lesson-step[data-type="slide"] .c-chunk { scroll-margin-top: 72px; }
.p-lesson-step[data-type="slide"] .c-chunk.is-now ~ .c-chunk.is-now { margin-top: 18px; border-radius: 22px; }
.c-chunk.is-now { animation: none; }
.c-chunk.is-new { animation: enter .45s ease-out; }
.p-lesson-step__toc { display: none; }
.p-lesson-step.is-open > .p-lesson-step__toc {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; padding: 12px 16px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 6px 18px 18px 18px;
}
.p-lesson-step.is-open > .p-lesson-step__toc::before { content: "目次"; font-size: 12.5px; font-weight: 900; color: var(--ink-3); margin-right: 4px; }
.p-lesson-step__toc button { border: 1.5px solid var(--line); background: var(--tint); border-radius: 999px; padding: 4px 14px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; line-height: 1.6; }
.p-lesson-step__toc button:hover { border-color: var(--ink); color: var(--ink); background: var(--hl); }
.p-lesson-step.is-open > .p-lesson-step__toc + .c-chunk { border-radius: 22px; }
/* 選択肢のボタンの中身（文・複数行・図） */
.c-quiz .c-quiz__options button p { margin: 0; max-width: none; }
.c-quiz .c-quiz__options button p + p, .c-quiz .c-quiz__options button div + p { margin-top: 2px; }
.c-quiz .c-quiz__options button img, .c-quiz .c-quiz__options button svg { display: block; margin: 4px 0; max-height: 220px; width: auto; max-width: 100%; border-radius: 8px; }
.c-quiz .c-quiz__options.is-visual { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); max-width: 900px; }
.c-quiz .c-quiz__options.is-visual button { grid-template-columns: 1fr; justify-items: center; padding: 12px; }
.c-quiz .c-quiz__options.is-visual button::before { justify-self: start; }

/* ================= ノベル表示（novel.js・2026-10-12 試作。チャット表示と切り替え） =================
   上が場面（背景＋立ち絵）、下が文章の枠の台。立ち絵は場面の下はしに立たせ、枠には食いこませない（2026-11-12）。枠の高さは固定（--nv-box）。
   選ぶボタン・書く欄・画像は、枠の上（背景の上）に出す。操作は「画面を押す」か、下の大きいボタン（つぎへ）の1つだけ。 */
.p-lesson-step[data-type="chat"] { position: relative; }
.p-novel__toggle { position: absolute; top: 12px; right: 16px; z-index: 6; display: flex; padding: 3px; border-radius: 99px; background: var(--tint, #f5f7fb); border: 1.5px solid var(--line); }
.p-novel__toggle button { border: 0; background: none; padding: 3px 14px; border-radius: 99px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink-3, #8590a5); cursor: pointer; line-height: 1.6; }
.p-novel__toggle button.is-on { background: var(--ink); color: #fff; }
.p-novel__place, .p-novel__busts, .p-novel__tools, .p-novel__picture, .p-novel-log { display: none; }

.p-lesson-step.is-now.is-novel {
  --nv-box: 182px;                 /* 文章の枠の高さ（4行まで入る。2026-11-17 に 172→182px。もっと長いセリフは枠の中でスクロール） */
  --nv-gap: 14px;
  --nv-scene: calc(var(--nv-gap) + var(--nv-box) * .55);   /* 背景の下はし：文章の枠の上の方までは背景、枠の下からは白い台（背景をのぞかせない） */
  --nv-stand: calc(var(--nv-box) + var(--nv-gap) - 28px);   /* 立ち絵の足もと：文章の枠に少しだけかくれる */
  position: relative; display: block; padding: 0; overflow: hidden;
  height: clamp(460px, calc(100vh - 210px), 700px); border-radius: 24px;
  background: var(--paper, #fff);
  cursor: pointer; user-select: none;
}
/* 場面（背景）：文章の枠の下には出さない（2026-11-12：枠の下に背景がのぞいて、立ち絵が浮いて見えたため）。枠の上の方は背景にかぶせてよい */
.p-lesson-step.is-now.is-novel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: var(--nv-scene); z-index: 0; pointer-events: none;
  background: var(--nv-bg, none) center / cover no-repeat, linear-gradient(180deg, #dfe9f7 0%, #eef3fa 62%, #d9cfbf 62.2%, #e8dfd1 100%);
  box-shadow: inset 0 -1px 0 rgba(18, 26, 42, .12); }
.p-lesson-step.is-novel.is-novel-memory { filter: sepia(.35) saturate(.85); }
.p-lesson-step.is-novel.is-novel-memory::after { content: "回想"; position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5; font-size: 12px; font-weight: 900; letter-spacing: .2em; color: #fff; background: rgba(60, 40, 20, .55); padding: 2px 14px; border-radius: 99px; }
/* ノベルでは、いま見ている発言・その返事と、ノベルの部品だけを出す */
.p-lesson-step.is-novel > *:not(.p-novel__busts):not(.is-novel-current):not(.p-novel__reply):not(.p-novel__tools):not(.p-novel__toggle):not(.p-novel__place):not(.p-novel__picture):not(.p-novel-log):not(.c-chat-more) { display: none !important; }
.p-lesson-step.is-novel:not(.is-novel-end) > .c-chat-more { display: none !important; }
.p-lesson-step.is-novel .p-novel__toggle { background: rgba(255, 255, 255, .88); backdrop-filter: blur(4px); }

.p-lesson-step.is-novel .p-novel__place { display: block; position: absolute; top: 14px; left: 16px; z-index: 5; margin: 0; max-width: calc(100% - 200px);
  padding: 3px 14px 3px 30px; border-radius: 99px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(4px);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2, #47526a); line-height: 1.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-lesson-step.is-novel .p-novel__place::before { content: ""; position: absolute; left: 12px; top: 50%; width: 9px; height: 9px; margin-top: -6px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--theme); }
.p-lesson-step.is-novel.is-novel-nobg .p-novel__place::after { content: "（背景は準備中）"; color: var(--ink-3, #8590a5); font-weight: 500; }
.p-lesson-step.is-novel .p-novel__place[hidden] { display: none; }

/* 立ち絵：文章の枠の上にそろえて立たせる（枠には少しだけかくれる。1人でも浮かないよう大きめに） */
.p-lesson-step.is-novel .p-novel__busts { display: flex; position: absolute; left: 0; right: 0; bottom: var(--nv-stand); top: 0; z-index: 1; justify-content: center; align-items: flex-end; padding: 0 6%; pointer-events: none; }
.p-novel__bust { height: min(96%, 470px); width: auto; flex: 0 1 auto; min-width: 0; object-fit: contain; object-position: bottom;
  transition: filter .25s ease, transform .25s ease, opacity .3s ease; transform-origin: 50% 100%; }
.p-novel__busts[data-n="2"] .p-novel__bust { margin: 0 -1%; height: min(92%, 420px); }
.p-novel__busts[data-n="3"] .p-novel__bust { margin: 0 -2%; height: min(86%, 360px); }
.p-novel__bust.is-quiet { filter: brightness(.72) saturate(.85); transform: scale(.95); }
.p-novel__bust.is-talking { z-index: 2; }
.p-novel__bust.is-enter { opacity: 0; transform: translateY(18px); }
.p-novel__bust.is-icon { height: 132px; width: 132px; border-radius: 50%; margin-bottom: 18px; box-shadow: 0 0 0 4px #fff, 0 6px 18px rgba(0, 0, 0, .18); }

/* 文章の枠（いまの発言）：場面の下に重ねる。高さは固定 */
.p-lesson-step.is-novel > .c-speech.is-novel-current { position: absolute; left: 16px; right: 16px; bottom: var(--nv-gap); height: var(--nv-box); z-index: 3; display: block; max-width: none; margin: 0; padding: 26px 26px 14px;
  background: #fff; border: 1.5px solid var(--ink); border-radius: 18px; box-shadow: 0 8px 24px rgba(18, 26, 42, .18);   /* 背景がすけないように白 */
  animation: none; cursor: pointer; }
.p-lesson-step.is-novel > .c-speech.is-novel-current::before { display: none; }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-speech__who { position: absolute; top: -14px; left: 18px; margin: 0; padding: 2px 16px; border-radius: 99px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 900; line-height: 1.7; z-index: 1; text-align: left; }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-speech__body { display: block; justify-self: stretch; width: auto; height: 100%; overflow-y: auto; overscroll-behavior: contain; background: none !important; border: 0 !important; padding: 0 4px 0 0; border-radius: 0;
  color: var(--ink); font-weight: 500; font-size: 18.5px; line-height: 1.85; }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-speech__body img, .p-lesson-step.is-novel > .c-speech.is-novel-current .c-speech__body iframe, .p-lesson-step.is-novel > .c-speech.is-novel-current .c-speech__body video { display: none; }   /* 画像は枠の上に出す（.p-novel__picture） */
.p-lesson-step.is-novel > .c-speech.is-novel-current[data-who="user"] .c-speech__who { background: var(--theme); }
.p-lesson-step.is-novel > .c-speech.is-novel-current[data-who="memori"] .c-speech__who, .p-lesson-step.is-novel > .c-speech.is-novel-current[data-who="memori-hs"] .c-speech__who, .p-lesson-step.is-novel > .c-speech.is-novel-current[data-who="suta"] .c-speech__who { background: var(--theme-ink, var(--theme)); }
.p-lesson-step.is-novel > .c-speech.is-novel-current.is-new .c-speech__body { animation: nvIn .25s ease-out; }
@keyframes nvIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* 押すと進めるときの合図 */
.p-lesson-step.is-novel.is-novel-next > .c-speech.is-novel-current::after { content: "▼"; position: absolute; right: 18px; bottom: 8px; font-size: 13px; color: var(--theme); animation: nvBlink 1s ease-in-out infinite; }
@keyframes nvBlink { 50% { opacity: .2; transform: translateY(3px); } }

/* 選ぶボタン・書く欄：枠の上（背景の上）に出す */
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-choices { position: absolute; left: 0; right: 0; bottom: calc(100% + 18px); margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-choices button { font-size: 16.5px; padding: 10px 26px; box-shadow: 0 6px 18px rgba(18, 26, 42, .22), 0 3px 0 var(--ink); animation: nvPulse 1.6s ease-out infinite; }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-choices li:nth-child(2) button { animation-delay: .2s; }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-choices li:nth-child(3) button { animation-delay: .4s; }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-choices li:nth-child(4) button { animation-delay: .6s; }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-choices button:hover { animation: none; transform: translateY(-2px); }
/* 選ぶ・書くの合図（光の輪が広がる＋見出し） */
@keyframes nvPulse { 0% { box-shadow: 0 6px 18px rgba(18, 26, 42, .22), 0 3px 0 var(--ink), 0 0 0 0 color-mix(in srgb, var(--theme) 70%, transparent); }
  70% { box-shadow: 0 6px 18px rgba(18, 26, 42, .22), 0 3px 0 var(--ink), 0 0 0 14px color-mix(in srgb, var(--theme) 0%, transparent); }
  100% { box-shadow: 0 6px 18px rgba(18, 26, 42, .22), 0 3px 0 var(--ink), 0 0 0 0 transparent; } }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-choices::before { content: "あなたはどうする？ えらんでね"; flex-basis: 100%; margin-bottom: 2px; padding: 2px 0; border-radius: 99px; background: linear-gradient(var(--ink), var(--ink)) center / 250px 100% no-repeat; color: #fff; text-align: center; font-size: 13px; font-weight: 900; letter-spacing: .05em; line-height: 1.7; }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-chat-answer:not(.is-answered) { animation: nvPulseBox 1.8s ease-out infinite; }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-chat-answer::before { content: "あなたの考えを書いてね"; display: block; margin-bottom: 8px; font-size: 13px; font-weight: 900; color: var(--theme); }
@keyframes nvPulseBox { 0% { box-shadow: 0 8px 24px rgba(18, 26, 42, .2), 0 0 0 0 color-mix(in srgb, var(--theme) 60%, transparent); } 70%, 100% { box-shadow: 0 8px 24px rgba(18, 26, 42, .2), 0 0 0 16px transparent; } }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-chat-answer { position: absolute; left: 8%; right: 8%; bottom: calc(100% + 18px); margin: 0; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .96); border: 1.5px solid var(--ink); box-shadow: 0 8px 24px rgba(18, 26, 42, .2); cursor: default; }
.p-lesson-step.is-novel > .c-speech.is-novel-current .c-choices.is-answered, .p-lesson-step.is-novel > .c-speech.is-novel-current .c-chat-answer.is-answered { display: none; }

/* 画像：場面の真ん中に出す（次のセリフで消える）。押すと大きく */
.p-lesson-step.is-novel .p-novel__picture { display: flex; position: absolute; left: 16px; right: 16px; top: 52px; bottom: calc(var(--nv-box) + var(--nv-gap) + 18px); z-index: 4; align-items: center; justify-content: center; pointer-events: none; }
.p-lesson-step.is-novel.has-novel-choices .p-novel__picture { bottom: calc(var(--nv-box) + var(--nv-gap) + 118px); }
.p-lesson-step.is-novel.has-novel-ask .p-novel__picture { bottom: calc(var(--nv-box) + var(--nv-gap) + 190px); }
.p-lesson-step.is-novel .p-novel__picture[hidden] { display: none; }
.p-novel__picture img { max-width: min(100%, 620px); max-height: 100%; width: auto; height: auto; padding: 8px; background: #fff; border-radius: 14px; box-shadow: 0 0 0 1.5px var(--ink), 0 14px 36px rgba(18, 26, 42, .35); cursor: zoom-in; pointer-events: auto; animation: nvPic .2s ease-out; }
/* ノベル表示のセリフの中の動画（2026-11-17）：画像と同じく場面の真ん中に出す。押しても会話は進まない */
.p-lesson-step.is-novel .p-novel__picture video, .p-lesson-step.is-novel .p-novel__picture iframe { display: block; width: auto; max-width: min(100%, 760px); max-height: 100%; margin: 0; border: 0; border-radius: 14px; background: #000; box-shadow: 0 0 0 1.5px var(--ink), 0 14px 36px rgba(18, 26, 42, .35); pointer-events: auto; animation: nvPic .2s ease-out; }
.p-lesson-step.is-novel .p-novel__picture iframe { width: min(100%, 760px); height: auto; aspect-ratio: 16 / 9; }
@keyframes nvPic { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* 自分の答え（選んだ・書いた答え）：枠の右上に */
.p-lesson-step.is-novel > .c-reply.p-novel__reply { display: none !important; position: absolute; right: 22px; bottom: calc(var(--nv-box) + var(--nv-gap) + 12px); z-index: 4; display: flex; align-items: center; gap: 8px; margin: 0; max-width: 70%; }
.p-lesson-step.is-novel > .c-reply.p-novel__reply::before { display: none; }
.p-lesson-step.is-novel > .c-reply.p-novel__reply .c-speech__who { font-size: 12.5px; font-weight: 700; color: var(--ink-2); background: rgba(255, 255, 255, .9); padding: 0 10px; border-radius: 99px; white-space: nowrap; }
.p-lesson-step.is-novel > .c-reply.p-novel__reply .c-speech__body { background: var(--theme) !important; color: #fff; font-size: 15.5px; font-weight: 700; padding: 6px 16px; border-radius: 16px 16px 4px 16px; box-shadow: 0 6px 16px rgba(18, 26, 42, .22); }
.p-novel__mine { display: none; }
/* 自分の答え：選んだ直後は「自分のセリフ」として枠に出す（左上にニックネーム。相手のセリフと同じ形） */
.p-lesson-step.is-novel > .c-speech.is-novel-current.has-novel-mine > .c-speech__who, .p-lesson-step.is-novel > .c-speech.is-novel-current.has-novel-mine > .c-speech__body { display: none; }
.p-lesson-step.is-novel > .c-speech.is-novel-current .p-novel__mine { display: block; height: 100%; }
.p-novel__mine-who { position: absolute; top: -14px; left: 18px; padding: 2px 16px; border-radius: 99px; background: var(--theme); color: #fff; font-size: 14px; font-weight: 900; line-height: 1.7; }
.p-novel__mine-text { margin: 0; height: 100%; overflow-y: auto; color: var(--ink); font-weight: 500; font-size: 18.5px; line-height: 1.85; animation: nvIn .25s ease-out; white-space: pre-wrap; }
.p-lesson-step.is-novel > .c-speech.is-novel-current.has-novel-mine { border-color: var(--theme); background: color-mix(in srgb, var(--theme) 6%, rgba(255, 255, 255, .97)); }
.p-lesson-step.is-novel.is-novel-end > .c-chat-more { position: absolute; left: 0; right: 0; top: 52px; z-index: 4; display: flex; justify-content: center; }

/* 枠の右上の小さいボタン（もどる・ログ） */
.p-lesson-step.is-novel .p-novel__tools { display: flex; position: absolute; right: 22px; bottom: calc(var(--nv-box) + var(--nv-gap) - 13px); z-index: 5; align-items: center; gap: 6px; }
.p-novel__tools button, .p-novel__tools .p-novel__count { font: inherit; font-size: 12.5px; font-weight: 800; line-height: 1.6; border-radius: 99px; padding: 1px 12px; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); }
.p-novel__tools button { cursor: pointer; }
.p-novel__tools button:hover:not(:disabled) { background: var(--ink); color: #fff; }
.p-novel__tools button:disabled { opacity: .45; cursor: default; }
.p-novel__tools .p-novel__count { font-family: var(--num); border-color: transparent; background: rgba(255, 255, 255, .85); color: var(--ink-2); }
.p-lesson-step.is-novel > .c-speech.is-novel-current { padding-right: 26px; }

/* ログ（ここまでの会話）：場面を暗くして、チャットの形で並べる */
.p-lesson-step.is-novel .p-novel-log { display: flex; flex-direction: column; position: absolute; inset: 0; z-index: 8; background: rgba(12, 18, 32, .86); backdrop-filter: blur(3px); cursor: default; user-select: text; }
.p-lesson-step.is-novel .p-novel-log[hidden] { display: none; }
.p-novel-log__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; color: #fff; font-weight: 900; font-size: 15px; }
.p-novel-log__close { font: inherit; font-size: 13px; font-weight: 800; color: #fff; background: rgba(255, 255, 255, .14); border: 1.5px solid rgba(255, 255, 255, .5); border-radius: 99px; padding: 3px 16px; cursor: pointer; }
.p-novel-log__list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.p-novel-log__row { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; max-width: 760px; }
.p-novel-log__row img.p-novel-log__face { width: 44px; height: 44px; border-radius: 50%; background: #fff; object-fit: cover; }
.p-novel-log__name { font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, .7); margin-bottom: 2px; }
.p-novel-log__text { width: fit-content; max-width: 100%; background: rgba(255, 255, 255, .95); color: var(--ink); border-radius: 4px 14px 14px 14px; padding: 8px 14px; font-size: 15px; line-height: 1.75; }
.p-novel-log__text img { display: block; max-height: 110px; width: auto; max-width: 100%; margin-top: 6px; border-radius: 8px; cursor: zoom-in; }
.p-novel-log__row.is-user { align-self: flex-end; grid-template-columns: 1fr; text-align: right; }
.p-novel-log__row.is-user .p-novel-log__text { background: var(--theme); color: #fff; border-radius: 14px 4px 14px 14px; font-weight: 700; display: inline-block; text-align: left; }
.p-novel-log__row.is-now .p-novel-log__text { box-shadow: 0 0 0 3px var(--theme); }

@media (max-width: 720px) {
  .p-lesson-step.is-now.is-novel { --nv-box: 160px; --nv-gap: 10px; height: clamp(440px, calc(100vh - 190px), 620px); border-radius: 18px; }
  .p-lesson-step.is-novel > .c-speech.is-novel-current { left: 10px; right: 10px; padding: 24px 18px 12px; }
  .p-lesson-step.is-novel > .c-speech.is-novel-current .c-speech__body { font-size: 16.5px; }
  .p-lesson-step.is-novel .p-novel__place { max-width: calc(100% - 170px); }
  .p-novel__toggle button { padding: 3px 10px; }
  .p-novel__bust { height: min(90%, 300px); }
}
/* 先生があずかり中の作品（2026-11-14）：画像のかわりに表紙と理由を出す */
.c-drop__item.is-held { background: #fff7e6; align-items: start; }
.c-drop__held { display: grid; place-items: center; text-align: center; font-size: 11.5px; font-weight: 900; line-height: 1.9; color: #8a5a00; background: repeating-linear-gradient(135deg, #fff1d6 0 10px, #ffe9c2 10px 20px); }
.c-drop__held-text { display: grid; gap: 4px; margin-top: 4px; font-size: 13.5px; line-height: 2; color: var(--ink); }
.c-drop__held-note { background: var(--paper); border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.c-drop__held-text > span { display: block; }
.c-drop__held-from { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.c-drop__held-fix { color: #8a5a00; font-weight: 700; }
.c-drop__thumb.c-drop__held { height: auto; min-height: 64px; padding: 4px 0; }

/* 選びなおす・書きなおす（自分の答えから会話を巻き戻す。2026-11-16） */
.c-reply__redo { grid-column: 1 / -1; justify-self: end; margin-top: 4px; padding: 2px 12px; border: 1.5px solid var(--line); border-radius: 99px; background: var(--paper); color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.c-reply__redo:hover { border-color: var(--ink-3); color: var(--ink); }
.c-reply__ask { display: flex; justify-content: flex-end; }
.c-reply__ask .c-ask { max-width: 420px; }
.p-novel__redo { position: absolute; right: 14px; bottom: 10px; z-index: 2; padding: 3px 14px; border: 1.5px solid var(--line); border-radius: 99px; background: rgba(255, 255, 255, .95); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.p-novel__redo:hover { border-color: var(--ink-3); color: var(--ink); }
.p-novel__redo-ask { position: absolute; right: 14px; bottom: 46px; z-index: 3; width: min(360px, calc(100% - 28px)); padding: 12px 14px; border-radius: 14px; background: #fff8d6; box-shadow: 0 6px 16px rgba(18, 26, 42, .18); }
.p-novel__redo-ask p { margin: 0 0 8px; font-size: 14px; font-weight: 700; line-height: 1.6; }
.p-novel__redo-ask div { display: flex; gap: 8px; }
.p-novel__redo-ask button { padding: 5px 14px; border-radius: 99px; border: 1.5px solid var(--ink); background: var(--paper); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.p-novel__redo-ask .is-yes { background: var(--ink); color: #fff; }

/* キーワード（2026-11-16）：ステップの中で最初に出てくる1か所。押すと説明。NEW は初めて見たときだけ */
.c-kw { display: inline; margin: 0; padding: 0 1px; border: 0; border-bottom: 2px dotted var(--theme); border-radius: 0; background: none; color: var(--theme-ink, var(--theme)); font: inherit; font-weight: 700; line-height: inherit; cursor: pointer; text-align: inherit; }
.c-kw:hover, .c-kw:focus-visible { background: var(--theme-soft, rgba(0,0,0,.05)); outline: none; }
.c-kw.is-new::after { content: "NEW"; display: inline-block; margin-left: 3px; padding: 0 5px; border-radius: 99px; background: var(--theme); color: #fff; font-size: 10px; font-weight: 900; line-height: 1.6; vertical-align: super; }
.c-kw-pop { position: fixed; z-index: 200; width: min(360px, calc(100vw - 16px)); padding: 14px 16px 12px; border-radius: 16px; background: var(--paper, #fff); border: 1.5px solid var(--ink); box-shadow: 0 10px 30px rgba(18, 26, 42, .2); }
.c-kw-pop__label { margin: 0; font-size: 12px; font-weight: 900; color: var(--theme-ink, var(--theme)); }
.c-kw-pop__new { margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--theme); color: #fff; font-size: 10.5px; }
.c-kw-pop__term { margin: 2px 0 6px; font-size: 19px; font-weight: 900; line-height: 1.4; }
.c-kw-pop__desc { margin: 0; font-size: 15px; line-height: 1.8; white-space: pre-line; }
.c-kw-pop__from { margin: 8px 0 0; font-size: 12.5px; font-weight: 700; color: var(--ink-3, #8590a5); }
.c-kw-pop__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.c-kw.is-guide { background: var(--theme-soft, rgba(0,0,0,.06)); border-radius: 4px; box-shadow: 0 0 0 3px var(--theme-soft, rgba(0,0,0,.06)); }
/* 講座の先生の最初の案内（初めてキーワードが見えたときに1回だけ） */
.c-kw-guide { --arrow: 50%; position: fixed; z-index: 190; display: flex; gap: 12px; align-items: flex-start; width: min(420px, calc(100vw - 16px)); padding: 14px 16px; border-radius: 18px; background: var(--paper, #fff); border: 2px solid var(--theme); box-shadow: 0 10px 30px rgba(18, 26, 42, .18); animation: c-kw-guide-in .25s ease-out; }
.c-kw-guide::before { content: ""; position: absolute; top: -9px; left: var(--arrow); width: 14px; height: 14px; margin-left: -7px; background: var(--paper, #fff); border-left: 2px solid var(--theme); border-top: 2px solid var(--theme); transform: rotate(45deg); }
.c-kw-guide.is-above::before { top: auto; bottom: -9px; transform: rotate(225deg); }
.c-kw-guide__face { flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--theme-soft, #eef1f6) center / cover no-repeat; }
.c-kw-guide__body { flex: 1; min-width: 0; }
.c-kw-guide__who { margin: 0; font-size: 12.5px; font-weight: 900; color: var(--theme-ink, var(--theme)); }
.c-kw-guide__text { margin: 2px 0 10px; font-size: 15px; line-height: 1.8; white-space: pre-line; }
.c-kw-guide__ok { display: block; margin-left: auto; padding: 6px 18px; border: 0; border-radius: 99px; background: var(--theme); color: #fff; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.c-kw-guide__ok:hover, .c-kw-guide__ok:focus-visible { filter: brightness(1.08); outline: none; }
@keyframes c-kw-guide-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .c-kw-guide { animation: none; } }
.c-kw-pop__book { font-size: 13.5px; font-weight: 700; color: var(--theme-ink, var(--theme)); }
.c-kw-pop__close { margin-left: auto; padding: 4px 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--paper, #fff); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
