/* Museを、自分の相棒にしよう — 自習用Webページ共通スタイル */
:root {
  --pink: #ECE6DC;
  --pink-deep: #D8CFC2;
  --pink-ink: #A84B24;        /* アクセント：オレンジ（深め。白地・グレージュ地でも文字が読める濃さ） */
  --accent-soft: #E8B49A;     /* アクセントの淡色：差し色の枠線・ボタンの影 */
  --accent-shadow: #6E2F15;   /* オレンジ塗りボタンの影 */
  --cream: #F7F5F1;
  --card: #FFFFFF;
  --ink: #3F3934;
  --ink-soft: #6E665E;
  --line: #E2DCD2;
  --note: #FFF4D9;
  --note-line: #F0DDA8;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(207, 198, 185, .45), 0 10px 24px rgba(111, 98, 85, .12);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  background: linear-gradient(180deg, var(--pink) 0, var(--cream) 520px) fixed;
  background-color: var(--cream);
  overflow-wrap: anywhere;
  word-break: normal;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--pink-ink); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 64px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 760px; margin: 0 auto; padding: 14px 16px;
  font-size: 14px; font-weight: 700;
}
.topbar a { text-decoration: none; color: var(--ink-soft); }
.topbar .series { color: var(--pink-ink); }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  margin: 0 0 28px;
}
@media (min-width: 640px) { .card { padding: 32px 36px; } }

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding-top: 28px;
  background: linear-gradient(180deg, #fff 0, #fff 70%, var(--cream) 100%);
}
.hero .kicker {
  display: inline-block; padding: 4px 16px; border-radius: 999px;
  background: var(--pink); color: var(--pink-ink); font-weight: 800; font-size: 15px;
  letter-spacing: .05em;
}
.hero h1 {
  font-size: clamp(24px, 6.4vw, 34px); line-height: 1.45; margin: 14px 0 6px; font-weight: 800;
}
.hero .series-title { font-size: 15px; color: var(--ink-soft); margin: 0 0 8px; font-weight: 700; }
.hero img { width: min(100%, 420px); margin: 8px auto 0; border-radius: 18px; }

/* ---------- headings ---------- */
.step-head { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.step-no {
  flex: none; min-width: 64px; padding: 6px 12px; border-radius: 16px;
  background: var(--pink); color: var(--pink-ink); font-weight: 800; font-size: 17px; text-align: center;
  box-shadow: inset 0 -3px 0 var(--pink-deep);
}
.step-head h2 { margin: 0; font-size: clamp(20px, 5.2vw, 24px); line-height: 1.45; font-weight: 800; }
h2.plain { font-size: clamp(20px, 5.2vw, 24px); margin: 0 0 14px; font-weight: 800; }
.label { font-weight: 800; margin: 22px 0 6px; }
.label + p { margin-top: 0; }

p { margin: 0 0 14px; }
strong { font-weight: 800; background: linear-gradient(transparent 62%, var(--pink) 62%); }

ul.dots, ol.nums { padding-left: 1.4em; margin: 0 0 16px; }
ul.dots li, ol.nums li { margin: 4px 0; }

.rule {
  text-align: center; font-size: 19px; margin: 10px 0 18px; padding: 14px; border-radius: 18px;
  background: var(--pink);
}

/* ---------- figure ---------- */
.fig { margin: 4px auto 20px; max-width: 360px; }
.fig img { border-radius: 18px; }
/* 図解：本文幅いっぱいに表示（見せ方は .fig と同じ） */
.fig.wide { max-width: none; }
.fig.wide img { width: 100%; }

.figs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 4px auto 20px; max-width: 560px; }
.figs.three { grid-template-columns: repeat(3, 1fr); }
.figs figure { margin: 0; }
.figs img { border-radius: 14px; }

/* ---------- 見本・例文（引用） ---------- */
.quote {
  margin: 6px 0 18px; padding: 14px 16px; border-radius: 18px; background: var(--cream);
  border-left: 6px solid var(--accent-soft);
}
.quote p:last-child { margin-bottom: 0; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; margin: 6px 0 18px; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.6; }
.table-wrap th, .table-wrap td { border: 1.5px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.table-wrap th { background: var(--pink); color: var(--pink-ink); font-weight: 800; }

h3.sub { font-size: 18px; margin: 24px 0 8px; font-weight: 800; }

/* ---------- 要確認 note ---------- */
.check-note {
  font-size: 14px; color: #8A6A2A; background: var(--note); border: 1.5px dashed var(--note-line);
  border-radius: 14px; padding: 8px 12px; margin: 0 0 14px;
}

/* ---------- ten bubble ---------- */
.ten {
  display: flex; gap: 12px; align-items: flex-start; margin: 20px 0 4px;
}
.ten .who {
  flex: none; width: 52px; height: 52px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; font-weight: 800; color: var(--pink-ink); font-size: 15px;
  overflow: hidden; box-shadow: 0 0 0 2px var(--pink-deep);
}
/* 先生コメントの顔アイコン：てんの顔画像を丸く切り抜く */
.ten .who img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; border-radius: 50%; }
.ten .say {
  position: relative; background: var(--cream); border: 2px solid var(--line);
  border-radius: 18px; padding: 10px 14px; font-weight: 700;
}

/* ---------- prompt box ---------- */
.prompt {
  margin: 10px 0 18px; border-radius: 18px; background: #FAF8F5; border: 2px solid var(--line);
  overflow: hidden;
}
.prompt-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px 8px 14px; background: var(--pink); font-size: 13px; font-weight: 800; color: var(--pink-ink);
}
.prompt pre {
  margin: 0; padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: inherit; font-size: 16px; line-height: 1.8; color: var(--ink);
}
.copy {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-size: 14px; font-weight: 800;
  min-height: 40px; padding: 6px 16px; border-radius: 999px; background: #fff; color: var(--pink-ink);
  box-shadow: 0 3px 0 var(--accent-soft); transition: transform .08s;
}
.copy:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-soft); }
.copy.done { background: var(--pink-ink); color: #fff; box-shadow: 0 3px 0 var(--accent-shadow); }

/* ---------- checklist ---------- */
ul.checklist, ol.checklist { list-style: none; padding: 0; margin: 0 0 16px; }
.checklist li { margin: 8px 0; }
.checklist label {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  background: var(--cream); border: 2px solid var(--line); border-radius: 16px; padding: 10px 14px;
  min-height: 48px; transition: background .15s, border-color .15s;
}
.checklist input { position: absolute; opacity: 0; pointer-events: none; }
.checklist .box {
  flex: none; width: 26px; height: 26px; margin-top: 2px; border-radius: 9px; background: #fff;
  border: 2.5px solid var(--accent-soft); display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 900;
}
.checklist input:checked + .box { background: var(--pink-ink); border-color: var(--pink-ink); }
.checklist input:checked + .box::after { content: "✓"; }
.checklist input:checked ~ .txt { color: var(--ink-soft); }
.checklist li:has(input:checked) label { background: var(--pink); border-color: var(--pink-deep); }
.checklist input:focus-visible + .box { outline: 3px solid var(--pink-ink); outline-offset: 2px; }
.check-hint { font-size: 13px; color: var(--ink-soft); margin: -6px 0 10px; }

/* ---------- prompt collection ---------- */
.collection h3 { font-size: 16px; margin: 22px 0 4px; font-weight: 800; }

/* ---------- next / toc ---------- */
.next { text-align: center; }
.next .small { font-size: 14px; color: var(--ink-soft); margin: 0 0 4px; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 800; color: #fff; background: var(--pink-ink);
  padding: 12px 24px; border-radius: 999px; box-shadow: 0 4px 0 var(--accent-shadow); margin: 8px 4px;
}
.btn.ghost { background: #fff; color: var(--pink-ink); box-shadow: 0 4px 0 var(--accent-soft); }

.toc { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0 0 16px; }
.toc a {
  display: block; text-decoration: none; color: var(--ink); background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 18px 16px;
}
.toc .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.toc .no { font-weight: 800; color: var(--pink-ink); }
.badge { font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.badge.free { background: #E3F2E1; color: #4C7A47; }
.badge.paid { background: var(--pink); color: var(--pink-ink); }
.toc .t { font-size: 18px; font-weight: 800; line-height: 1.5; margin: 0 0 4px; }
.toc .d { font-size: 15px; color: var(--ink-soft); line-height: 1.7; margin: 0; }
.section-title { font-size: 18px; font-weight: 800; margin: 8px 4px 14px; color: var(--pink-ink); }

footer { text-align: center; font-size: 13px; color: var(--ink-soft); padding: 20px 0 32px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 15px; font-weight: 700;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 10;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 見本デザインの要素（トップ＋第1章から採用） ---------- */
.marker { background:linear-gradient(transparent 62%, var(--accent-soft) 62%); padding:0 2px; }
.pillrow { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 12px; }
.pill { display:inline-block; padding:3px 14px; border-radius:999px; background:#fff; border:2px solid var(--pink-deep); color:var(--ink); font-size:13px; font-weight:800; line-height:1.6; }
.pill.hot { background:var(--pink-ink); border-color:var(--pink-ink); color:#fff; }
.cta-row { display:grid; gap:10px; margin:16px 0 4px; }
@media (min-width: 560px) { .cta-row { grid-template-columns:1fr 1fr; } .cta-row.single { grid-template-columns:1fr; } }
.cta { display:block; text-align:center; text-decoration:none; padding:13px 16px; border-radius:999px; font-weight:900; font-size:16px; background:var(--pink-ink); color:#fff; box-shadow:0 4px 0 var(--accent-shadow); }
.cta.ghost { background:#fff; color:var(--pink-ink); border:2px solid var(--pink-ink); box-shadow:0 4px 0 var(--accent-soft); }
.chars { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:16px 0 4px; }
.char-card { background:var(--cream); border:2px solid var(--line); border-radius:18px; padding:14px 12px; text-align:center; }
.char-card img { width:84px; height:84px; object-fit:cover; border-radius:50%; margin:0 auto 8px; background:#fff; box-shadow:0 0 0 2px var(--pink-deep); }
.char-card .role { display:inline-block; padding:1px 12px; border-radius:999px; background:var(--pink-ink); color:#fff; font-size:12px; font-weight:800; line-height:1.6; }
.char-card .nm { display:block; margin:6px 0 0; font-weight:900; font-size:16px; }
.char-card .ds { display:block; margin:2px 0 0; font-size:13px; color:var(--ink-soft); line-height:1.6; }
.ba { margin:14px 0; }
.ba .row { display:flex; align-items:center; gap:10px; padding:10px 14px; border-radius:14px; font-weight:800; line-height:1.6; }
.ba .before { background:#EFEAE2; color:var(--ink-soft); }
.ba .after { background:var(--pink-ink); color:#fff; }
.ba .row .tag { flex:none; font-size:12px; padding:1px 10px; border-radius:999px; background:#fff; color:var(--ink); border:1.5px solid var(--line); line-height:1.6; }
.ba .after .tag { border-color:transparent; color:var(--pink-ink); }
.ba .arrow { text-align:center; font-size:16px; color:var(--pink-ink); line-height:1.3; font-weight:900; }
.tiles { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:14px 0 0; }
.tile { appearance:none; font:inherit; cursor:pointer; border:2px solid var(--pink-deep); background:linear-gradient(180deg, #fff, var(--cream)); border-radius:18px; padding:16px 10px 12px; box-shadow:0 4px 0 var(--pink-deep); font-weight:900; font-size:17px; color:var(--ink); }
.tile small { display:block; margin:4px 0 0; font-size:12px; font-weight:700; color:var(--ink-soft); }
.tile[aria-pressed="true"] { background:var(--pink); border-color:var(--pink-ink); box-shadow:0 4px 0 var(--accent-soft); }
.tile-panel { margin:10px 0 0; padding:14px 16px; border-radius:16px; background:#FAF8F5; border:2px dashed var(--pink-deep); }
.tile-panel .tp-t { font-weight:900; margin:0 0 4px; }
.tile-panel .tp-b { margin:0 0 8px; }
.tile-panel .tp-a { font-weight:800; }
.flow { list-style:none; padding:0; margin:12px 0 0; display:grid; gap:10px; }
.flow li { display:flex; gap:12px; align-items:flex-start; background:var(--cream); border:2px solid var(--line); border-radius:16px; padding:12px 14px; }
.flow .n { flex:none; width:30px; height:30px; border-radius:50%; background:var(--pink-ink); color:#fff; font-weight:900; display:flex; align-items:center; justify-content:center; font-size:15px; }
.flow .tx { font-weight:700; line-height:1.7; }
.flow .tx small { display:block; color:var(--ink-soft); font-weight:700; font-size:13px; }
