/* 勉強の資料室 study.mizu-yoshi.com — 方眼の紙・黒インク＋赤ペン1色。影なし・角なし。スマホが前提 */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { background: var(--paper); color: var(--ink); font: 500 16px/1.65 var(--font); -webkit-text-size-adjust: 100%; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2 { margin: 0; overflow-wrap: break-word; min-width: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button { font: inherit; color: inherit; }

.top, .hero-in, .tabs-in, main, .foot { max-width: 640px; margin-inline: auto; padding-inline: 18px; }
.top { display: flex; justify-content: space-between; align-items: center; padding-block: 12px; }
.who { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.top-line { font-size: 13px; font-weight: 700; text-decoration: none; padding: 6px 12px; }

.hero { position: relative; }
.hero-in { position: relative; padding-block: 22px 18px; }
h1 { font-size: 40px; line-height: 1.2; font-weight: 900; letter-spacing: 0; }
.lead { margin: 12px 0 0; font-size: 14.5px; line-height: 1.75; }
.count { margin: 10px 0 0; font-size: 13px; }
.count b { font-size: 22px; font-weight: 900; margin-right: 2px; }

.tabs { position: sticky; top: 0; z-index: 5; }
.tabs-in { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.tabs-in::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: 0; background: none; font-weight: 700; font-size: 14px; cursor: pointer; }

.grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.card[hidden] { display: none; }
.clink { display: block; text-decoration: none; color: inherit; }
.sheet { display: block; aspect-ratio: 150 / 118; overflow: hidden; }
.sheet img { width: 100%; }
.cbody { display: block; padding-top: 8px; }
.tag { display: block; font-size: 11.5px; font-weight: 700; }
.ttl { display: block; font-size: 14.5px; line-height: 1.4; font-weight: 700; }
.ex { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 700; }
.card--soon { grid-column: 1 / -1; padding: 14px 16px; }
.soon { display: block; margin-top: 4px; font-size: 13px; line-height: 1.6; }

.consult { margin-top: 32px; padding: 22px 18px; }
.consult h2 { font-size: 22px; font-weight: 900; }
.consult p { margin: 6px 0 0; font-size: 14px; }
.terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 0 16px; }
.terms div { padding: 8px 0; text-align: center; }
.terms dt { font-size: 11.5px; }
.terms dd { margin: 0; font-weight: 900; font-size: 15px; }
.btn { display: flex; align-items: center; justify-content: center; min-height: 52px; font-weight: 900; font-size: 15.5px; text-decoration: none; }

.foot { padding-block: 26px 18px; font-size: 12px; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.dock .btn { max-width: 560px; margin: 0 auto; min-height: 48px; }

/* 記入例の画面（下から出る） */
.sheetview { width: 100%; max-width: 640px; max-height: 92vh; margin: auto auto 0; padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); border: 0; overflow-y: auto; }
.sheetview::backdrop { background: rgb(0 0 0 / .45); }
.sv-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sv-head h2 { font-size: 19px; font-weight: 900; line-height: 1.35; }
.sv-head p { margin: 2px 0 0; font-size: 13px; }
.sv-close { flex: 0 0 auto; min-height: 40px; padding: 0 12px; border: 0; background: none; font-weight: 700; font-size: 13px; cursor: pointer; }
.sv-seg { display: flex; margin-top: 12px; }
.sv-seg[hidden] { display: none; }
.sv-seg button { flex: 1 1 0; min-height: 40px; border: 0; font-weight: 700; font-size: 14px; cursor: pointer; }
.sv-fig { margin: 12px 0 0; }
.sv-fig img { width: 100%; max-width: 360px; margin: 0 auto; }
.sv-fig figcaption { margin-top: 6px; font-size: 12px; text-align: center; }
.sv-note { margin: 8px 0 0; font-size: 12px; }
#sv-pdf { margin-top: 14px; }

@media (min-width: 760px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dock { display: none; } body { padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* 案1 先生のノート：方眼の紙・黒インク＋赤ペン1色。影なし・角なし */
:root {
  --paper: #fbfaf6; --grid: #e3e8ee; --ink: #1d2433; --ink-2: #4a5160; --rule: #c9ced6;
  --red: #c8322b; --focus: #c8322b;
  --font: "Zen Kaku Gothic New", sans-serif; --hand: "Klee One", serif;
}
body { background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px; background-position: -1px -1px; }
.top-line { color: var(--ink); border: 1.5px solid var(--ink); }
.hero-in { padding-top: 18px; }
h1 { color: var(--ink); }
h1 .red { color: var(--red); }
.lead { color: var(--ink-2); }
.hero-in::after { content: attr(data-stamp); position: absolute; right: 22px; bottom: 16px; font: 600 15px/1 var(--hand); color: var(--red); transform: rotate(-6deg); border: 1.5px solid var(--red); padding: 6px 8px; }
.tabs { background: var(--paper); border-bottom: 1.5px solid var(--ink); }
.tab { color: var(--ink-2); border-bottom: 3px solid transparent; }
.tab[aria-pressed="true"] { color: var(--red); border-bottom-color: var(--red); }
.sheet { background: #fff; border: 1px solid var(--rule); }
.tag { color: var(--ink-2); }
.ttl { color: var(--ink); }
.ex { font-family: var(--hand); font-weight: 600; color: var(--red); border-bottom: 1.5px solid var(--red); }
.card--soon { border: 1.5px dashed var(--ink-2); background: var(--paper); }
.soon { color: var(--ink-2); }
.consult { background: var(--paper); border: 2px solid var(--red); }
.consult h2 { color: var(--red); }
.consult h2::before { content: "相談"; display: block; font: 600 13px/1.4 var(--hand); color: var(--ink-2); }
.terms { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.terms div + div { border-left: 1px solid var(--rule); }
.terms dt { color: var(--ink-2); }
.btn { background: var(--ink); color: #fff; }
.foot { color: var(--ink-2); }
.dock { background: var(--paper); border-top: 1px solid var(--rule); }
.sheetview { background: var(--paper); color: var(--ink); border-top: 3px solid var(--ink); }
.sv-close { color: var(--ink-2); text-decoration: underline; }
.sv-seg { border-bottom: 1.5px solid var(--ink); }
.sv-seg button { background: none; color: var(--ink-2); border-bottom: 3px solid transparent; }
.sv-seg button[aria-selected="true"] { color: var(--red); border-bottom-color: var(--red); }
.sv-fig img { border: 1px solid var(--rule); background: #fff; }
.sv-fig figcaption { font-family: var(--hand); color: var(--red); }
.sv-note { color: var(--ink-2); }
