:root {
  color-scheme: light;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", system-ui, sans-serif;
  color: #173b52;
  background: #f4f7f8;
}

* { box-sizing: border-box; }
.page-shell > nav { margin-bottom: 24px; }
.page-shell > nav a { color: #087c86; font-weight: 700; text-underline-offset: 4px; }
.page-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin: -8px 0 18px; }
.small-action { min-height: 36px; padding: 7px 11px; border: 1px solid #087c86; color: #087c86; background: #fff; font-size: .84rem; }
.small-action:hover { color: #fff; background: #087c86; }
.action-status { color: #087c86; font-size: .82rem; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 90% 0%, #dff5f6 0, transparent 30rem),
    #f4f7f8;
}

button, input { font: inherit; }

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 32px;
}

.hero { max-width: 720px; margin-bottom: 28px; }

.eyebrow, .card-kicker {
  margin: 0 0 8px;
  color: #087c86;
  font-weight: 800;
  font-size: .84rem;
  letter-spacing: .06em;
}

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

h1 {
  margin-bottom: 12px;
  color: #12364b;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
}

.hero > p:last-child {
  margin-bottom: 0;
  color: #496373;
  font-size: 1.1rem;
  line-height: 1.7;
}

.simulator-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
.simulator-layout:fullscreen { overflow: auto; padding: 28px; background: #f4f7f8; }

.control-panel, .experiment-card, .observation-card, .question-card {
  border: 1px solid #d8e3e7;
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 12px 30px rgba(29, 63, 78, .08);
}

.control-panel { padding: 22px; }
.control-panel h2, .experiment-card h2, .question-card h2 { margin-bottom: 12px; }

.control-panel label:not(.toggle-row) {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  font-weight: 750;
}

output {
  color: #007d8a;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: #078898;
  cursor: pointer;
}

.range-note {
  margin: 7px 0 0;
  color: #607783;
  font-size: .84rem;
  line-height: 1.45;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 28px;
  cursor: pointer;
  font-weight: 700;
}

.toggle-row input { width: 18px; height: 18px; accent-color: #078898; }

button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  color: #fff;
  background: #087c86;
  cursor: pointer;
  font-weight: 750;
}

button:hover { background: #056a73; }
button:focus-visible, input:focus-visible { outline: 3px solid #f2b84b; outline-offset: 3px; }

.control-panel button { width: 100%; margin-top: 22px; }
.control-panel .secondary-button { margin-top: 10px; border: 1px solid #087c86; color: #087c86; background: #fff; }
.control-panel .secondary-button:hover { color: #fff; background: #087c86; }
.control-note { margin: 12px 0 0; color: #607783; font-size: .84rem; line-height: 1.5; }

.experiment-card { padding: 18px; overflow: hidden; }
.scene-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.scene-heading h2 { margin-bottom: 0; }
.scene-heading p { margin: 0; color: #607783; font-size: .83rem; text-align: right; }

#water-scene { display: block; width: 100%; margin-top: 12px; }
.scene-background { fill: #f5fafb; }
.water-fill { fill: #bdebf0; opacity: .88; }
.tank-outline { fill: none; stroke: #2d5d70; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.water-line { stroke: #078898; stroke-width: 5; }
.water-surface-label, .depth-label, .pressure-caption, .pressure-detail, .comparison-text {
  fill: #395b68;
  font-size: 17px;
  font-weight: 700;
}
.depth-scale { stroke: #8ba2ad; stroke-width: 3; }
.depth-guide { stroke: #ed9e30; stroke-width: 3; stroke-dasharray: 8 7; opacity: .9; }
.hole { fill: #164456; stroke: #fff; stroke-width: 3; }
.water-jet { fill: none; stroke: #1196a4; stroke-width: 13; stroke-linecap: round; opacity: .92; }
.water-jet.prediction-jet { stroke-width: 9; stroke-dasharray: 10 10; opacity: .42; }
.pressure-value { fill: #087c86; font-size: 32px; font-weight: 850; }
.comparison-jet { fill: none; stroke: #5e8895; stroke-width: 7; stroke-linecap: round; opacity: .85; }
.comparison-hole { fill: #315967; }
.comparison-text { font-size: 15px; }

.learning-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.observation-card { padding: 18px; }
.observation-card h2 { margin-bottom: 7px; font-size: 1.1rem; }
.observation-card p:last-child { margin-bottom: 0; color: #496373; line-height: 1.65; }
.observation-card.emphasis { border-color: #69bfc7; background: #eefbfc; }

.question-card { margin-top: 20px; padding: 22px; }
.question-card h2 { font-size: clamp(1.15rem, 3vw, 1.45rem); }
.question-card button { margin-right: 12px; }
#answer-text { margin: 14px 0 0; color: #315461; line-height: 1.7; }
#answer-text:not([hidden]) { display: block; }
.keyword-section { margin-top: 20px; padding: 22px; border: 1px solid #d8e3e7; border-radius: 18px; background: rgba(255, 255, 255, .94); box-shadow: 0 12px 30px rgba(29, 63, 78, .08); }
.keyword-section h2 { margin-bottom: 14px; font-size: 1.25rem; }
.keyword-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keyword-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 124px; padding: 15px; border: 1px solid #c8e4e7; border-radius: 13px; color: #173b52; background: #f3fbfc; text-align: left; cursor: pointer; }
.keyword-card:hover, .keyword-card.is-open { border-color: #087c86; background: #e9f8fa; }
.keyword-question { color: #087c86; font-weight: 800; line-height: 1.45; }
.keyword-answer { margin-top: 10px; color: #315461; line-height: 1.55; font-size: .92rem; }
.keyword-hint { margin-top: auto; padding-top: 10px; color: #71848d; font-size: .76rem; }
.questions-link-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 16px 18px; border: 1px solid #087c86; border-radius: 13px; color: #087c86; background: #fff; text-decoration: none; }
.questions-link-card:hover { color: #fff; background: #087c86; }
.questions-link-title { font-weight: 800; }
.questions-link-text { font-size: .9rem; }
.question-item { margin: 12px 0; padding: 16px 18px; border: 1px solid #c8e4e7; border-radius: 13px; background: #f3fbfc; }
.question-item summary { color: #087c86; font-weight: 800; cursor: pointer; }
.question-item p { margin: 12px 0 0; color: #315461; line-height: 1.6; }
footer { padding-top: 24px; color: #71848d; font-size: .82rem; text-align: center; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 22px, 1120px); padding-top: 28px; }
  .simulator-layout, .learning-grid, .keyword-grid { grid-template-columns: 1fr; }
  .scene-heading { align-items: flex-start; flex-direction: column; }
  .scene-heading p { text-align: left; }
  #water-scene { min-height: 280px; }
  .water-surface-label, .depth-label, .pressure-caption, .pressure-detail, .comparison-text { font-size: 20px; }
  .pressure-value { font-size: 36px; }
}
