: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; justify-content:flex-end; gap:10px; margin:-8px 0 18px; }
.small-action { min-height:36px; padding:7px 11px; border:1px solid #087c86; border-radius:10px; color:#087c86; background:#fff; font-size:.84rem; cursor:pointer; }
.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; }
.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 {
  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; }

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: 28px; }
.control-panel .secondary-button { margin-top: 10px; border: 1px solid #087c86; color: #087c86; background: #fff; }
.control-panel .secondary-button:hover { color: #fff; background: #087c86; }
.simulator-layout:fullscreen { overflow:auto; padding:28px; background:#f4f7f8; }
.control-panel .secondary-button {
  margin-top: 10px;
  border: 1px solid #087c86;
  color: #087c86;
  background: #fff;
}
.control-panel .secondary-button:hover { color: #fff; background: #087c86; }
.buoyancy-controls {
  margin-top: 18px;
  border-top: 1px solid #d8e3e7;
  padding-top: 4px;
}
.buoyancy-controls label { margin-top: 16px; }
.force-status { margin: 10px 0 0; color: #315461; font-size: .86rem; line-height: 1.55; }

.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; }
#pressure-scene { display: block; width: 100%; margin-top: 12px; }
#force-layer[hidden] { display: none; }
.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, .summary-caption, .summary-detail {
  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; }
.block { fill: #f3b34b; stroke: #9a5f13; stroke-width: 4; }
.block-label { fill: #593600; font-size: 17px; font-weight: 800; text-anchor: middle; dominant-baseline: middle; }
.pressure-arrow { stroke: #0b8492; stroke-width: 6; stroke-linecap: round; marker-end: url(#arrowhead); }
#arrowhead path { fill: #0b8492; }
.prediction-mode .pressure-arrow { stroke-dasharray: 7 7; opacity: .82; }
.buoyancy-mode .side-pressure { opacity: .16; }
.buoyancy-mode .top-pressure, .buoyancy-mode .bottom-pressure { opacity: 1; }
.buoyancy-result-arrow { stroke: #188b58; stroke-width: 9; stroke-linecap: round; }
.weight-result-arrow { stroke: #c55b39; stroke-width: 9; stroke-linecap: round; }
.buoyancy-result-tip { fill: #188b58; }
.weight-result-tip { fill: #c55b39; }
.buoyancy-result-label, .weight-result-label {
  font-size: 18px;
  font-weight: 850;
  paint-order: stroke;
  stroke: #f5fafb;
  stroke-width: 5px;
  stroke-linejoin: round;
}
.buoyancy-result-label { fill: #15764a; }
.weight-result-label { fill: #a3482d; }
.summary-value { fill: #087c86; font-size: 27px; font-weight: 850; }
.summary-result { fill: #315461; font-size: 16px; font-weight: 850; }

.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); }
#answer-text { margin: 14px 0 0; color: #315461; line-height: 1.7; }
#answer-text:not([hidden]) { display: block; }
footer { padding-top: 24px; color: #71848d; font-size: .82rem; text-align: center; }
.keyword-section { margin-top:20px; padding:22px; border:1px solid #d8e3e7; border-radius:18px; background:#fff; }
.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}
@media (max-width:760px){.keyword-grid{grid-template-columns:1fr}}

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