:root {
  --ink: #20314f;
  --muted: #667085;
  --cream: #fff9e9;
  --paper: #ffffff;
  --yellow: #ffe58f;
  --yellow-deep: #ffc93d;
  --mint: #daf4ef;
  --aqua: #7bd1d8;
  --line: #263958;
  --shadow: #263958;
  --success: #18856d;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.75;
}

button, textarea, input { font: inherit; }

a { color: inherit; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 380px;
  padding: 34px max(24px, calc((100vw - 1080px) / 2)) 72px;
  background:
    linear-gradient(153deg, var(--yellow) 0 43%, transparent 43.2%),
    var(--cream);
}

.hero::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: 5vw;
  top: 42px;
  border: 2px solid rgba(32,49,79,.15);
  border-radius: 50%;
  box-shadow: 28px 22px 0 rgba(123,209,216,.2);
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  transform: rotate(-7deg);
  box-shadow: 2px 2px 0 var(--ink);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin-top: 44px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--mint);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 800px;
  margin-bottom: 18px;
  font-size: clamp(2.3rem, 6vw, 4.8rem);
  line-height: 1.18;
  letter-spacing: .035em;
}

.hero-copy {
  max-width: 720px;
  margin-bottom: 0;
  font-weight: 650;
  font-size: clamp(1rem, 2vw, 1.14rem);
}

.page-shell {
  width: min(1080px, calc(100% - 36px));
  margin: -34px auto 90px;
  position: relative;
  z-index: 2;
}

.panel {
  padding: clamp(24px, 5vw, 46px);
  border: 2px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 8px 9px 0 var(--shadow);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin-bottom: 4px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.section-heading p { margin-bottom: 0; color: var(--muted); }

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.chapter-card {
  display: block;
  min-height: 148px;
  padding: 24px;
  border: 2px solid #c8cfdb;
  border-radius: 18px;
  background: #fff;
  text-decoration: none;
}

.chapter-card.active {
  border-color: var(--line);
  box-shadow: 5px 5px 0 var(--aqua);
  transition: transform .18s ease, box-shadow .18s ease;
}

.chapter-card.active:hover,
.chapter-card.active:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--aqua);
}

.chapter-card.soon { background: #f7f7f5; color: #7c8492; }

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.chapter-no { font-size: .86rem; font-weight: 850; letter-spacing: .08em; }

.status {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--mint);
  color: #176e63;
  font-size: .78rem;
  font-weight: 800;
}

.soon .status { background: #e8e9ea; color: #6f7783; }

.chapter-card h3 { margin-bottom: 5px; font-size: 1.25rem; }
.chapter-card p { margin-bottom: 0; font-size: .94rem; }

.sheet-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.sheet-link {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 24px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 5px 6px 0 var(--shadow);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}

.sheet-link:hover, .sheet-link:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 8px 9px 0 var(--shadow);
}

.sheet-number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 26px;
  border-radius: 50%;
  background: var(--yellow);
  font-weight: 900;
}

.sheet-link h3 { margin-bottom: 8px; font-size: 1.35rem; }
.sheet-link p { color: var(--muted); }
.sheet-link .go { margin-top: auto; color: var(--ink); font-weight: 850; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  font-size: .88rem;
  font-weight: 750;
}

.breadcrumb a { text-underline-offset: 4px; }

.sheet-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 34px;
}

.sheet-header h2 { margin-bottom: 8px; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.35; }
.sheet-header p { margin-bottom: 0; color: var(--muted); }

.progress-badge {
  flex: 0 0 auto;
  min-width: 86px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--aqua);
  color: #fff;
  text-align: center;
  font-weight: 900;
  line-height: 1.3;
}

.question-list { display: grid; gap: 26px; }

.question-card {
  padding: 24px;
  border: 1.5px solid #aab5c5;
  border-radius: 16px;
  background: #fffdfa;
}

.question-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  font-size: 1.08rem;
  font-weight: 850;
}

.question-index {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--yellow);
}

.example { display: block; margin-top: 3px; color: var(--muted); font-size: .9rem; font-weight: 500; }

textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 16px;
  border: 2px solid #b8c1cf;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
  outline: none;
}

textarea:focus { border-color: var(--aqua); box-shadow: 0 0 0 4px rgba(123,209,216,.24); }

.save-status {
  min-height: 1.5em;
  margin: 18px 0 0;
  color: var(--success);
  font-size: .9rem;
  font-weight: 750;
}

.action-bar {
  position: sticky;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  box-shadow: 5px 6px 0 var(--shadow);
  backdrop-filter: blur(10px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 850;
}

.button.secondary { background: var(--yellow); color: var(--ink); }
.button.ghost { background: #fff; color: var(--ink); }
.button:hover { filter: brightness(.98); transform: translateY(-1px); }

.privacy-note {
  margin: 24px 0 0;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--mint);
  font-size: .88rem;
}

.footer {
  padding: 30px 20px 54px;
  color: #687386;
  text-align: center;
  font-size: .85rem;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: 4px 4px 0 var(--aqua);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
  .hero { min-height: 330px; padding-top: 24px; }
  .hero::after { opacity: .5; }
  .chapter-grid, .sheet-list { grid-template-columns: 1fr; }
  .section-heading, .sheet-header { display: block; }
  .progress-badge { display: inline-block; margin-top: 18px; }
  .action-bar { position: static; }
  .button { width: 100%; }
}

@media print {
  body { background: #fff; font-size: 11pt; }
  .hero { min-height: 0; padding: 12mm 15mm 8mm; background: #fff; }
  .hero::after, .brand, .breadcrumb, .action-bar, .privacy-note, .footer, .save-status { display: none !important; }
  .hero-inner { margin-top: 0; }
  .hero h1 { font-size: 24pt; }
  .page-shell { width: auto; margin: 0 15mm; }
  .panel { padding: 0; border: 0; box-shadow: none; }
  .question-list { gap: 7mm; }
  .question-card { break-inside: avoid; background: #fff; }
  textarea { min-height: 35mm; border-color: #777; overflow: visible; }
}
