/* Deeper lesson structure: one case, explicit reasoning, changed-condition practice */
.hero { min-height: 420px; align-items: stretch; }
.hero-grid { min-height: 420px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); }
.hero-content { display: flex; flex-direction: column; justify-content: center; padding: 48px 52px; }
.hero h1 { max-width: 680px; font-size: clamp(27px, 3.1vw, 38px); }
.hero-lead { max-width: 690px; color: #dce7f4; font-size: 17px; }
.hero-promise { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.18); color: #fff; font-weight: 800; }
.hero-scene { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 36px; border-left: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.045); }
.hero-scene-label { color: #9fc5d1; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.hero-scene strong { color: #fff; font-size: 20px; line-height: 1.55; }
.hero-scene p { margin: 0; color: #cddbea; font-size: 14px; line-height: 1.75; }
.hero-mini-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-mini-flow span { padding: 7px 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 7px; color: #fff; font-size: 11px; font-weight: 800; }
.hero-mini-flow b { color: #8fb8c7; }

.deep-map-wrap { min-width: 0; display: grid; place-items: center; padding: 30px 24px; overflow-x: auto; }
.deep-map { width: 100%; min-width: 690px; display: grid; grid-template-columns: 1.15fr .25fr 1.65fr .25fr 1.05fr .25fr 1.05fr .25fr 1.1fr; align-items: center; gap: 8px; }
.deep-map .concept-group { transition: opacity .25s ease, filter .25s ease; }
.concept-deck.deck-ready .deep-map .concept-group { opacity: .16; }
.concept-deck.deck-ready .deep-map .concept-group.is-context { opacity: .46; }
.concept-deck.deck-ready .deep-map .concept-group.is-focus { opacity: 1; filter: drop-shadow(0 4px 8px rgba(16,35,63,.1)); }
.map-node { min-width: 0; min-height: 112px; display: grid; align-content: center; padding: 12px; border: 1px solid #cbd5da; border-radius: 12px; background: #fff; text-align: center; overflow-wrap: anywhere; }
.map-node.dark { border-color: var(--navy); background: var(--navy); color: #fff; }
.map-node strong { color: inherit; font-size: 14px; line-height: 1.45; }
.map-node small { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.map-node.dark small { color: #cbd9e5; }
.map-arrow { color: var(--blue); text-align: center; font-size: 22px; font-weight: 900; }
.map-stack { display: grid; gap: 8px; }
.map-record { padding: 9px; border: 1px solid #cbd5da; border-radius: 8px; background: #fff; color: var(--navy); font-size: 10px; font-weight: 800; }
.map-record.denied { border-color: #dcb0ae; color: #9b302d; background: #fff5f4; }
.focus-insights { display: grid; gap: 12px; margin-top: 18px; }
.focus-insight { padding-top: 12px; border-top: 1px solid var(--line); }
.focus-insight p { margin: 4px 0 0; font-size: 13px; line-height: 1.65; }

.quiz-q .feedback { display: none; margin: 8px 0 0 28px; color: #405166; font-size: 13px; }
.quiz-q.graded .feedback { display: block; }

/* Lesson 1: every topic is one full-screen slide on desktop. */
.lesson-deck-page { overflow: hidden; }
.lesson-topbar .topbar-inner { max-width: none; min-height: 63px; padding: 8px 24px; }
.lesson-topbar .brand { flex: 0 0 auto; white-space: nowrap; }
.lesson-topbar .topbar-spacer { flex: 1 1 18px; }
.lesson-topbar .concept-deck-head { min-width: 0; max-width: min(42vw, 620px); flex: 0 1 auto; padding: 0; border: 0; background: transparent; }
.lesson-topbar .concept-deck-head strong { min-width: 0; color: var(--navy); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.lesson-topbar .concept-deck-head span { flex: 0 0 auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.lesson-presentation-shell { width: 100%; max-width: none; display: block; padding: 0; }
.lesson-presentation-shell main { width: 100%; }
.lesson-presentation { height: calc(100dvh - 64px); min-height: 650px; padding: 16px 24px; border-bottom: 0; }
.lesson-story-deck { height: 100%; min-height: 0; display: flex; flex-direction: column; margin: 0; border-radius: 18px; box-shadow: 0 12px 30px rgba(16,35,63,.08); }
.lesson-story-deck .concept-deck-head { flex: 0 0 auto; min-height: 50px; padding: 12px 20px; }
.lesson-story-deck .concept-deck-body { flex: 1 1 auto; min-height: 0; grid-template-columns: minmax(0,1.62fr) minmax(320px,.82fr); }
.lesson-story-deck .master-map-wrap { min-height: 0; padding: 12px 20px; overflow: hidden; }
.lesson-story-deck .master-network-map { width: 100%; height: 100%; max-height: none; }
.lesson-story-deck .deep-map-wrap { min-height: 0; padding: 10px 18px; overflow: hidden; }
.lesson-story-deck .deep-map-wrap:has(.story-evidence) { display: grid; grid-template-rows: auto minmax(0,1fr) auto; place-items: stretch center; gap: 15px; align-content: center; padding: 22px 24px; }
.lesson-story-deck .story-case { width: min(100%,900px); display: flex; align-items: baseline; gap: 10px; margin: 0; padding-bottom: 9px; border-bottom: 1px solid #cbd5da; color: var(--navy); }
.lesson-story-deck .story-case span { flex: 0 0 auto; color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.lesson-story-deck .story-case strong { min-width: 0; font-size: 12px; line-height: 1.45; }
.lesson-story-deck .deep-map { width: min(100%, 900px); min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px; }
.lesson-story-deck .deep-map .map-node,
.lesson-story-deck .deep-map .map-stack { min-width: 0; flex: 1 1 0; }
.lesson-story-deck .deep-map .map-node { min-height: 112px; padding: 11px 9px; }
.lesson-story-deck .deep-map .map-node strong { font-size: 12px; }
.lesson-story-deck .deep-map .map-node small { margin-top: 4px; font-size: 9px; }
.lesson-story-deck .deep-map .map-arrow { flex: 0 0 21px; height: auto; transform: none; font-size: 18px; line-height: 1; }
.lesson-story-deck .deep-map .map-stack { gap: 5px; }
.lesson-story-deck .deep-map .map-record { padding: 7px 6px; font-size: 9px; overflow-wrap: anywhere; }
.lesson-story-deck .story-evidence { width: min(100%, 760px); min-height: 118px; display: grid; align-content: center; gap: 10px; padding: 18px 22px; border: 1px solid #b9c9cf; border-left: 4px solid var(--blue); border-radius: 11px; background: #fff; }
.lesson-story-deck .story-evidence[data-kind="failure"] { border-left-color: #b8413e; background: #fff9f8; }
.lesson-story-deck .story-evidence[data-kind="change"] { border-left-color: #6c7d50; background: #fbfcf8; }
.lesson-story-deck .story-evidence[data-kind="estimate"] { border-left-color: var(--navy); background: #f7f9fb; }
.lesson-story-deck .story-evidence-label { color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.lesson-story-deck .story-evidence[data-kind="failure"] .story-evidence-label { color: #9b302d; }
.lesson-story-deck .story-evidence-value { margin: 0; color: var(--navy); font: 800 14px/1.65 ui-monospace,SFMono-Regular,Menlo,"Noto Sans JP",monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.lesson-story-deck.has-story-evidence .focus-example { display: none; }
.lesson-story-deck .focus-panel { min-height: 0; justify-content: center; overflow: auto; padding: 22px 26px; }
.lesson-story-deck .focus-panel h3 { margin: 7px 0 10px; font-size: clamp(20px,2vw,25px); line-height: 1.42; white-space: pre-line; }
.lesson-story-deck .focus-panel > p { margin: 0 0 10px; font-size: 14px; line-height: 1.68; }
.lesson-story-deck .focus-example { margin-top: 10px; padding: 12px 14px; font-size: 12px; line-height: 1.55; }
.lesson-story-deck .focus-insights { gap: 8px; margin-top: 10px; }
.lesson-story-deck .focus-insight { padding-top: 0; border-top: 0; }
.lesson-story-deck .focus-insight p { margin: 0; font-size: 13px; line-height: 1.65; }
.lesson-story-deck .focus-test[hidden], .lesson-story-deck .focus-insights[hidden] { display: none; }
.lesson-story-deck .focus-test { display: grid; gap: 8px; margin-top: 10px; }
.lesson-story-deck .focus-test-question { margin: 0; color: var(--navy); font-size: 13px; font-weight: 800; line-height: 1.55; }
.lesson-story-deck .focus-test-options { display: grid; gap: 6px; }
.lesson-story-deck .focus-test-option { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 12px; line-height: 1.45; text-align: left; cursor: pointer; }
.lesson-story-deck .focus-test-option:hover { border-color: var(--blue); }
.lesson-story-deck .focus-test-option.is-correct { border-color: #6da995; background: #eef7f3; }
.lesson-story-deck .focus-test-option.is-wrong { border-color: #c9827f; background: #fff5f4; }
.lesson-story-deck .focus-test-feedback { min-height: 2.8em; margin: 0; color: #8b3431; font-size: 11.5px; line-height: 1.5; }
.lesson-story-deck .focus-test-feedback.is-correct { color: #17614f; }
.lesson-story-deck .focus-demo { display: grid; gap: 9px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.lesson-story-deck .focus-demo[hidden] { display: none; }
.lesson-story-deck .focus-demo p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.lesson-story-deck .focus-demo-link { width: fit-content; text-decoration: none; }
.lesson-story-deck .concept-deck-nav { flex: 0 0 auto; min-height: 54px; padding: 9px 18px; }
.lesson-story-deck.deck-ready .master-network-map .concept-group { opacity: .08; }
.lesson-story-deck.deck-ready .master-network-map .concept-group.is-context { opacity: .38; }
.lesson-story-deck.deck-ready .master-network-map .concept-group.is-focus { opacity: 1; }
.lesson-story-deck .alternate-concept { opacity: 0; }
.lesson-story-deck.deck-ready .alternate-concept:not(.is-focus):not(.is-context) { opacity: 0; }
.lesson-story-deck.is-shared-sheet [data-concept="server"],
.lesson-story-deck.is-shared-sheet [data-concept="database"],
.lesson-story-deck.is-shared-sheet [data-concept="storage-path"] { opacity: 0 !important; }
.lesson-story-deck [data-slide-state="valid-only"] { opacity: 0; }
.lesson-story-deck.is-valid-input [data-slide-state="invalid-only"] { opacity: 0 !important; }
.lesson-story-deck.is-valid-input [data-slide-state="valid-only"] { opacity: 1; }

@media (max-width: 1120px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-scene { border-top: 1px solid rgba(255,255,255,.13); border-left: 0; }

  .lesson-presentation { padding: 12px 16px; }
  .lesson-topbar .topbar-inner { padding: 7px 16px; gap: 9px; }
  .lesson-topbar .brand { font-size: 13px; }
  .lesson-topbar .concept-deck-head { max-width: 38vw; }
  .lesson-topbar .concept-deck-head strong { font-size: 12.5px; }
  .lesson-story-deck .concept-deck-head { min-height: 46px; padding: 9px 16px; }
  .lesson-story-deck .concept-deck-body { grid-template-columns: minmax(0,1.35fr) minmax(370px,.92fr); }
  .lesson-story-deck .master-map-wrap { padding: 8px 12px; }
  .lesson-story-deck .deep-map-wrap { padding: 6px 12px; }
  .lesson-story-deck .deep-map-wrap:has(.story-evidence) { grid-template-rows: auto minmax(0,1fr) auto; gap: 6px; padding: 8px 12px; }
  .lesson-story-deck .story-case { width: min(100%,430px); gap: 6px; padding-bottom: 5px; }
  .lesson-story-deck .story-case span { font-size: 7.5px; }
  .lesson-story-deck .story-case strong { font-size: 9px; line-height: 1.3; }
  .lesson-story-deck .deep-map { width: min(100%, 430px); display: grid; grid-template-columns: 1fr; gap: 3px; }
  .lesson-story-deck .deep-map .map-node { min-height: 52px; padding: 5px 9px; }
  .lesson-story-deck .deep-map .map-node strong { font-size: 10px; line-height: 1.3; }
  .lesson-story-deck .deep-map .map-node small { margin-top: 2px; font-size: 8px; line-height: 1.25; }
  .lesson-story-deck .deep-map .map-arrow { width: 12px; height: 12px; justify-self: center; transform: rotate(90deg); font-size: 15px; line-height: 12px; }
  .lesson-story-deck .deep-map .map-stack { gap: 2px; }
  .lesson-story-deck .deep-map .map-record { padding: 3px 6px; font-size: 8px; line-height: 1.3; }
  .lesson-story-deck .story-evidence { width: min(100%,430px); min-height: 78px; gap: 5px; padding: 9px 12px; }
  .lesson-story-deck .story-evidence-value { font-size: 10px; line-height: 1.45; }
  .lesson-story-deck .focus-panel { padding: 14px 18px; }
  .lesson-story-deck .focus-panel h3 { margin: 4px 0 7px; font-size: 19px; line-height: 1.34; }
  .lesson-story-deck .focus-panel > p { margin-bottom: 6px; font-size: 12.5px; line-height: 1.5; }
  .lesson-story-deck .focus-example { margin-top: 6px; padding: 8px 10px; font-size: 11px; line-height: 1.45; }
  .lesson-story-deck .focus-insights { gap: 5px; margin-top: 6px; }
  .lesson-story-deck .focus-insight { padding-top: 0; }
  .lesson-story-deck .focus-insight p { font-size: 11.5px; line-height: 1.52; }
  .lesson-story-deck .focus-demo { gap: 6px; margin-top: 6px; padding-top: 6px; }
  .lesson-story-deck .focus-demo p { font-size: 10.5px; line-height: 1.45; }
  .lesson-story-deck .focus-demo-link { padding: 7px 10px; font-size: 10.5px; }
  .lesson-story-deck .concept-deck-nav { min-height: 48px; padding: 6px 14px; }
  .lesson-story-deck .deck-steps { gap: 5px; }
  .lesson-story-deck .deck-step { width: 8px; height: 8px; }
  .lesson-story-deck .deck-step.active { width: 22px; }
}

@media (max-width: 650px) {
  .hero-grid { min-height: 0; }
  .hero-content { padding: 34px 24px; }
  .hero-scene { padding: 25px 24px; }
}
