:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --ink: #1c2534;
  --muted: #76808f;
  --line: #e2e8f0;
  --soft: #f1f5f9;
  --accent: #2f8cff;
  --accent-ink: #1267d6;
  --tint: #e9f3ff;
  --ok: #12a37f;
  --ng: #e5484d;
  --radius: 14px;
  --sans: "Inter", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

.logo { font-weight: 900; font-size: 17px; letter-spacing: .06em; }
.logo small { font-weight: 700; font-size: 13px; color: var(--muted); letter-spacing: .04em; margin-left: 8px; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 13px 38px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(47, 140, 255, .3);
  transition: background .15s, opacity .2s, box-shadow .2s;
}
.btn:hover { background: var(--accent-ink); }
.btn:disabled { opacity: .3; cursor: default; box-shadow: none; background: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); padding: 13px 20px; box-shadow: none; }
.btn.ghost:hover { color: var(--ink); }
.btn.pop { animation: pop .4s; }
@keyframes pop { 50% { transform: scale(1.08); } }

/* ---------- トップ ---------- */
.site { background: var(--surface); border-bottom: 1px solid var(--line); }
.site .wrap { display: flex; align-items: center; height: 60px; }
.site-link { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--muted); }
.site-link:hover { color: var(--accent); }
.top { padding-top: 36px; padding-bottom: 90px; }

.book {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 36px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 34px;
}
.cover {
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 6px 12px 12px 6px;
  padding: 20px 18px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .16) 0 2px, transparent 2px 10px, rgba(0, 0, 0, .12) 10px 11px, transparent 11px),
    linear-gradient(155deg, #1c2534 0%, #24467c 55%, #2f8cff 100%);
  box-shadow: 0 14px 30px rgba(28, 37, 52, .28);
}
.cover b { font-size: 30px; font-weight: 900; letter-spacing: .1em; line-height: 1.25; margin: auto 0; }
.cover small { font-size: 12px; font-weight: 700; opacity: .85; }
.book h1 { font-size: clamp(24px, 4.4vw, 34px); line-height: 1.4; font-weight: 900; margin: 0 0 10px; }
.book h1 span { color: var(--accent); }
.book p { color: var(--muted); margin: 0 0 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; }
.meta li { background: var(--soft); border-radius: 999px; padding: 1px 13px; font-size: 13px; font-weight: 700; color: var(--muted); }

.part { font-size: 20px; font-weight: 900; margin: 52px 0 6px; }
.chap { display: flex; align-items: baseline; gap: 12px; font-size: 16px; font-weight: 800; margin: 26px 0 10px; }
.chap span { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .08em; }

.lesson-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.lesson-list li + li { border-top: 1px solid var(--line); }
.lesson-card { display: flex; align-items: center; gap: 16px; padding: 15px 20px; font-weight: 700; transition: background .15s; }
.lesson-card:hover { background: #f8fafc; }
.lesson-card .n { width: 2em; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.lesson-card.is-done .n { color: var(--ok); font-size: 16px; font-weight: 900; }
.lesson-card .t { flex: 1; }
.lesson-card .go { color: #c3ccd8; transition: color .15s, transform .15s; }
.lesson-card:hover .go { color: var(--accent); transform: translateX(3px); }

/* ---------- レッスン ---------- */
body.lesson { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-in { display: flex; align-items: center; gap: 12px; max-width: 860px; height: 56px; margin: 0 auto; padding: 0 20px; }
.bar .close { display: grid; place-items: center; width: 32px; height: 32px; margin-left: -8px; border-radius: 8px; font-size: 24px; line-height: 1; color: var(--muted); }
.bar .close:hover { background: var(--soft); color: var(--ink); }
.bar-t { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-n { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.track { height: 3px; margin-bottom: -1px; }
.track span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 0 3px 3px 0; transition: width .4s; }

/* 「つぎへ」はカードのすぐ下に置く。カードが画面より長いときだけ、画面の下に張りつく */
.stage { display: flex; padding: 28px 0 8px; }
.means-q { color: var(--muted); font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.means { font-size: clamp(18px, 3.4vw, 22px); font-weight: 800; line-height: 1.5; margin: 0; }
.stage .wrap { width: 100%; }
.screen {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 38px;
  min-height: 420px;
  animation: in .35s;
}
.screen:first-child, .screen.clear { display: flex; flex-direction: column; justify-content: center; }
.screen.clear { align-items: center; }
@keyframes in { from { opacity: 0; transform: translateY(10px); } }

.big {
  font-size: clamp(24px, 4.6vw, 36px);
  font-weight: 900;
  line-height: 1.55;
  margin: 0;
}
.big em { font-style: normal; color: var(--accent); }
.ask { font-size: clamp(17px, 3.2vw, 21px); font-weight: 800; line-height: 1.5; margin: 0 0 22px; }

.foot { padding: 10px 20px 26px; text-align: center; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 40%); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* ブラウザ風の枠 */
.browser { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.browser-bar { display: flex; gap: 5px; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.browser-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }

/* HTML の行 */
.code {
  background: var(--soft);
  border-radius: 12px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: auto;
}
.code .tg { color: var(--muted); }
.code-line {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  font-size: inherit;
}
.code-line:hover { background: #fff; }
.code-line.is-hot { background: var(--accent); color: #fff; }
.code-line.is-hot .tg { color: #fff; }

.part-info { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; min-height: 2.6em; margin: 18px 0 0; }
.part-info b { font-size: 20px; font-weight: 900; line-height: 1.3; }
.part-info span { color: var(--muted); font-size: 15px; }
.dots { display: flex; gap: 8px; margin-top: 12px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: background .2s, transform .2s; }
.dots i.on { background: var(--ok); transform: scale(1.2); }

/* 見比べ */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare .mark { font-size: 26px; font-weight: 900; line-height: 1; color: var(--muted); }
.compare .good .mark { color: var(--ok); }
.bubble {
  background: var(--soft);
  border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
  margin: 10px 0 12px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.6;
  min-height: 4.2em;
  display: flex;
  align-items: center;
}
.compare .cap { font-weight: 900; margin: 10px 0 0; color: var(--muted); }
.compare .good .cap { color: var(--ok); }
.tiny { font-size: 12px; color: var(--muted); margin: 12px 0 0; }

/* クイズ */
.choice {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s;
}
.choice:hover { border-color: var(--accent); }
.choice.right { border-color: var(--ok); background: #e9f8f3; }
.choice.wrong { border-color: var(--ng); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.quiz-feedback { min-height: 1.7em; margin: 6px 0 0; color: var(--muted); font-weight: 700; font-size: 15px; }

/* クリア */
.clear { text-align: center; }
.clear .big { color: var(--ok); margin-bottom: 20px; }
.words { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 0 0 34px; list-style: none; }
.words li { background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 16px; font-weight: 700; font-size: 15px; }

/* CSS の遊び場 */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 17px;
  cursor: pointer;
  margin-bottom: 20px;
}
.switch input { position: absolute; opacity: 0; }
.switch .knob { width: 58px; height: 32px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; }
.switch .knob::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s;
}
.switch input:checked + .knob { background: var(--ok); }
.switch input:checked + .knob::after { transform: translateX(26px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--ink); outline-offset: 3px; }

.controls { border: 0; padding: 0; margin: 0; min-width: 0; transition: opacity .2s; }
.controls:disabled { opacity: .25; }
.control { display: block; margin-bottom: 12px; font-weight: 700; font-size: 15px; }
.control input[type=range] { display: block; width: 100%; height: 22px; margin: 2px 0 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.control input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--line); }
.control input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line); }
.control input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(16, 24, 40, .2); }
.control input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(16, 24, 40, .2); }
.control input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 999px; }
.swatches { display: flex; gap: 10px; margin: 0 0 16px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; padding: 0; }
.swatch.is-on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.say { background: var(--soft); border-radius: 14px 14px 14px 4px; padding: 12px 16px; margin: 18px 0 0; font-weight: 700; font-size: 15px; }
.say b { color: var(--accent); }

/* 紙吹雪 */
.confetti { position: fixed; top: -12px; width: 9px; height: 13px; z-index: 50; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- 見本ページ（サイト側のデザインを切り離す） ---------- */
.demo-page, .demo-page * { all: revert; }
.demo-page {
  display: block;
  font: 16px/1.4 "Times New Roman", "Yu Mincho", "Hiragino Mincho ProN", serif;
  color: #000;
  background: #fff;
  text-align: left;
  letter-spacing: normal;
  padding: 8px;
  min-height: 250px;
}
.demo-page.styled {
  font-family: "Zen Maru Gothic", "Yu Gothic UI", sans-serif;
  line-height: 1.7;
  background: #fff7e8;
  color: #3b2a1a;
  text-align: center;
  padding: var(--d-pad, 24px);
}
.demo-page.styled h1 { font-size: var(--d-h1, 28px); line-height: 1.3; margin: 0 0 8px; color: #7a3e12; }
.demo-page.styled p { margin: 0 0 14px; }
.demo-page.styled img { display: block; margin: 0 auto 14px; }
.demo-page.styled a { display: block; margin: 0 0 14px; color: #b4530f; }
.demo-page.styled button {
  background: var(--d-btn, #e8590c);
  color: #fff;
  border: 0;
  border-radius: var(--d-radius, 12px);
  padding: 12px 28px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
}
.demo-page.styled.fancy { background: #1b1b2f; color: #e9d8ff; font-family: "Yu Mincho", serif; text-align: left; }
.demo-page.styled.fancy h1 { color: #ff7ad9; font-style: italic; letter-spacing: .18em; font-size: 22px; }
.demo-page.styled.fancy img { margin-left: 0; border: 4px double #ff7ad9; }
.demo-page.styled.fancy a { color: #7afcff; }
.demo-page.styled.fancy button { background: linear-gradient(90deg, #ff7ad9, #7afcff); color: #1b1b2f; border-radius: 999px; }

.demo-page.inspectable [data-part] { cursor: pointer; }
.demo-page.inspectable [data-part].is-hot { outline: 3px solid #2f8cff; outline-offset: 3px; }

/* ---------- 操作の部品 ---------- */
.control > span { display: block; margin-bottom: 6px; }
.control { margin-bottom: 16px; }
.seg-row { display: flex; flex-wrap: wrap; gap: 8px; }
.seg {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.seg:hover { border-color: var(--accent); }
.seg.is-on { background: var(--tint); border-color: var(--accent); color: var(--accent-ink); }
.seg:disabled { opacity: .3; cursor: default; border-color: var(--line); }
.seg.wrong { animation: shake .3s; border-color: var(--ng); }
.swatch { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
[data-css="off"] .controls { opacity: .25; pointer-events: none; }
[data-css="off"] .say { visibility: hidden; }

.sort-item {
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 900;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  margin: 0 0 16px;
}
.center { justify-content: center; }

.inline-code {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--mono);
  font-size: clamp(15px, 3.4vw, 22px);
}
.inline-code .code-line { width: auto; background: var(--soft); padding: 10px 12px; }
.inline-code.err .code-line { color: #c62828; }
.inline-code .code-line.is-hot { background: var(--accent); color: #fff; }

.report, .reply {
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  padding: 12px 16px;
  margin: 0 0 18px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.7;
}
.reply { margin: 0; min-height: 5.6em; }
.report span, .reply span {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  padding: 0 8px;
  margin-right: 10px;
  font-size: 12px;
}
.report code { font-family: var(--mono); background: var(--soft); border-radius: 6px; padding: 2px 6px; }

.serp { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 2px; min-height: 6.6em; align-content: start; }
.s-url { font-size: 12px; color: var(--muted); }
.s-title { color: #1a0dab; font-size: 18px; font-weight: 500; line-height: 1.4; }
.s-desc { font-size: 13px; color: #4d5156; }

.meter { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; width: calc(var(--d-q, 100) * 1%); background: var(--accent); }

.browser-bar .url { flex: 1; margin-left: 6px; font-size: 11px; line-height: 1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser.resizable { width: var(--d-w, 100%); margin: 0 auto; container-type: inline-size; }
.browser.phone { width: 62%; margin: 0 auto; }

/* ---------- 見本ページの追加の見た目 ---------- */
.demo-page.styled.left { text-align: left; }
.demo-page.styled.flush { padding: 0; }
.demo-page.styled h2 { font-size: 19px; margin: 14px 0 4px; color: #7a3e12; }
.demo-page.styled h3 { font-size: 15px; margin: 8px 0 2px 1em; }
.demo-page.styled ul, .demo-page.styled ol { display: inline-block; text-align: left; margin: 0 0 14px; padding-left: 1.4em; }
.demo-page.styled table { margin: 0 auto 14px; border-collapse: collapse; }
.demo-page.styled td, .demo-page.styled th { border: 1px solid #e0c9a6; padding: 4px 14px; }
.demo-page.styled input[type=text], .demo-page.styled select {
  display: block;
  width: 80%;
  margin: 0 auto 12px;
  padding: 8px;
  border: 1px solid #d9c3a0;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}
.demo-page.styled label { display: block; margin: 0 0 14px; }
.demo-page.styled header { display: flex; justify-content: space-between; align-items: center; background: #7a3e12; color: #fff; padding: 10px 14px; }
.demo-page.styled nav { font-size: 13px; }
.demo-page.styled nav a { display: inline; margin: 0 0 0 10px; color: inherit; }
.demo-page.styled nav a.is-on { font-weight: 700; text-decoration: none; }
.demo-page.styled main { display: block; padding: 18px 14px; }
.demo-page.styled footer { background: #f0e0c4; padding: 10px; font-size: 12px; }
.demo-page:not([data-open]) .menu { display: none; }

.demo-page.styled .cards { display: grid; grid-template-columns: repeat(var(--d-cols, 3), 1fr); gap: 8px; }
.demo-page.styled .card { background: #fff; border: 1px solid #e0c9a6; border-radius: 10px; padding: 10px 4px; font-size: 13px; }
.demo-page.styled .card small { font-family: ui-monospace, Consolas, monospace; font-size: 10px; color: #a08a70; }
[data-target="all"] .demo-page.styled .card,
[data-target="one"] .demo-page.styled .card.osusume { background: #ffd9cf; border-color: #ff5a36; }
.demo-page.styled .stack .card { padding: var(--d-in, 8px); margin-bottom: var(--d-out, 6px); }
.demo-page.styled .solo {
  background: #fff;
  border: var(--d-bw, 1px) solid #7a3e12;
  border-radius: var(--d-rad, 10px);
  box-shadow: 0 calc(var(--d-sh, 0) * .4px) calc(var(--d-sh, 0) * 1px) rgba(0, 0, 0, .28);
  padding: 22px;
  margin: 16px;
}
.demo-page.styled .row { display: flex; gap: var(--d-gap2, 8px); }
.demo-page.styled .row .card { padding: 10px 12px; }
[data-dir="col"] .demo-page.styled .row { flex-direction: column; }
[data-align="l"] .demo-page.styled .row { justify-content: flex-start; align-items: flex-start; }
[data-align="c"] .demo-page.styled .row { justify-content: center; align-items: center; }
[data-align="r"] .demo-page.styled .row { justify-content: flex-end; align-items: flex-end; }
@container (max-width: 300px) {
  .demo-page.styled.resp .cards { grid-template-columns: 1fr; }
}
.demo-page.styled.tint { color: var(--d-fg, #3b2a1a); background: var(--d-bg, #fff7e8); }
.demo-page.styled.tint h1 { color: inherit; }
.demo-page.styled.type p { text-align: left; font-size: var(--d-fs, 16px); font-weight: var(--d-fw, 400); line-height: var(--d-lh, 1.7); }
.demo-page.styled.hov button:hover { background: #18a058; transform: scale(1.08); }
.demo-page.styled.smooth button { transition: all .4s; }
.demo-page.styled.spin button { animation: spin 1.2s linear infinite; }
.demo-page.styled.grow button { transition: transform .3s; }
.demo-page.styled.grow button:hover { transform: scale(1.12); }
@keyframes spin { to { transform: rotate(360deg); } }
.demo-page.styled .photo { width: 200px; height: 150px; filter: blur(max(0px, (60 - var(--d-q, 100)) * .1px)); }

/* ---------- 仕組み編の部品 ---------- */
.step-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 32px;
  font-weight: 900;
  cursor: pointer;
  margin-bottom: 16px;
  transition: opacity .2s;
}
.step-btn:disabled { opacity: .3; cursor: default; }
.step-row { margin-bottom: 16px; }
/* 済んだボタンは、押せないボタンと見分けがつくように緑にする */
.seg[data-step-btn].is-on:disabled { opacity: 1; background: #e9f8f3; border-color: var(--ok); color: var(--ok); }

/* 中身が短い歩でも幅が変わらないように、部品の幅を決めておく */
[data-steps].narrow, [data-hash], [data-tok] { max-width: 560px; }

.nodes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.node {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 14px;
  font-weight: 900;
  font-size: 14px;
  color: var(--muted);
  transition: border-color .2s, color .2s, background .2s;
}
.node.is-hot { border-color: var(--accent); color: var(--accent-ink); background: var(--tint); }

.wire { display: grid; gap: 8px; }
.msg {
  display: grid;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  animation: in .3s;
}
.msg b { font-size: 12px; font-weight: 700; }
.msg.is-now { border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 3px var(--tint); }
.msg.is-now b { color: var(--muted); }

.panel { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; }
.panel-t { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.mono {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.mono.bad { color: #c62828; font-weight: 700; }
.mono.good { color: var(--ok); font-weight: 700; }
.mono small { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-left: 12px; }
.reply code, .choice code, .ask code { font-family: var(--mono); background: var(--soft); border-radius: 6px; padding: 2px 6px; }
.term {
  background: var(--ink);
  color: #d6f5e6;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 14px;
}

.field {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  background: #fff;
}
.field:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 2.2em; }
.chip { background: var(--tint); border-radius: 6px; padding: 2px 7px; font-weight: 700; white-space: pre; }
.chip:nth-child(even) { background: #e3f5ef; }
.count { font-weight: 900; margin: 14px 0 0; }
.count b { font-size: 24px; color: var(--accent); margin-right: 4px; }

.race { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.race .panel { margin: 0; }
.num { display: block; font-size: clamp(18px, 4vw, 26px); font-weight: 900; line-height: 1.5; }
.num.ok { color: var(--ok); }

.cron { display: flex; flex-wrap: wrap; gap: 8px; }
.cron span {
  display: grid;
  justify-items: center;
  background: var(--soft);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 3.2em;
}
.cron b { font-family: var(--mono); font-size: 20px; line-height: 1.4; }
.cron small { font-size: 11px; color: var(--muted); font-weight: 700; }

.snaps { display: grid; gap: 8px; margin: 0 0 4px; }
.snap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 14px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  animation: in .3s;
}
.snap code { font-family: var(--mono); color: var(--muted); }
.snap:hover { border-color: var(--accent); }
.snap.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.snap.is-on::after { content: "いまここ"; margin-left: auto; font-size: 12px; color: var(--ok); }
.demo-page.styled[data-v="2"] button { background: #18a058; }
.demo-page.styled[data-v="3"] button { background: #2563eb; }

@media (max-width: 720px) {
  .split, .compare { grid-template-columns: 1fr; }
  .stage { align-items: flex-start; padding-top: 16px; }
  .screen { padding: 24px 18px; min-height: 0; border-radius: 16px; }
  .screen:first-child { min-height: 46vh; }
  .wrap { padding-left: 14px; padding-right: 14px; }
  .top { padding-top: 20px; }
  .book { grid-template-columns: 1fr; gap: 22px; padding: 24px 20px; }
  .cover { width: 120px; padding: 14px 12px; }
  .cover b { font-size: 19px; }
  .cover small { font-size: 10px; }
  .bubble { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 会員 (課金が入っているときだけ lesson-pay.php が使う) ---------- */
.site-link + .site-link { margin-left: 18px; }
.lock { display: none; font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--tint); border-radius: 999px; padding: 1px 10px; }
body[data-pay="on"]:not([data-member]) .lesson-card[data-paid] .lock { display: inline-block; }
.pay .big { margin-bottom: 14px; }
.pay-t { color: var(--muted); font-weight: 700; margin: 0 0 24px; }
.pay form { margin: 0 0 20px; }
.pay .field { max-width: 420px; }
.pay .tiny a { text-decoration: underline; margin-right: 14px; }
.screen.plain { display: block; }
.legal { margin: 0; }
.legal dt { font-size: 13px; font-weight: 800; color: var(--muted); margin-top: 16px; }
.legal dd { margin: 2px 0 0; font-weight: 500; }
