:root { color-scheme: light; font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", system-ui, sans-serif; color: #173b52; background: #f4f7f8; }
.mobile-result, .lesson-toggle { display: none; }
* { box-sizing: border-box; }
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: 34px 0 30px; }
.back-nav { margin-bottom: 24px; }
.back-nav a { color: #087c86; font-weight: 750; text-underline-offset: 4px; }
.hero { max-width: 750px; 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.2rem); line-height: 1.18; }
h1 span { color: #087c86; }
.hero > p:last-child { margin-bottom: 0; color: #496373; font-size: 1.06rem; 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,.95); 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; margin-top: 24px; font-weight: 750; }
output { color: #087c86; font-weight: 800; }
input[type=range] { width: 100%; accent-color: #078898; cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; color: #71848d; font-size: .76rem; }
button { min-height: 42px; border: 0; border-radius: 10px; padding: 9px 14px; color: white; 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: 18px 0 0; color: #607783; font-size: .84rem; 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; }
#volume-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, .result-caption, .result-detail { fill: #395b68; font-size: 17px; font-weight: 700; }
.depth-scale { stroke: #8ba2ad; stroke-width: 3; }
.block { fill: #f3b34b; stroke: #9a5f13; stroke-width: 4; transform-box: fill-box; transform-origin: center; }
.block-label { fill: #593600; font-size: 17px; font-weight: 800; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.pressure-arrow { stroke: #1298a7; stroke-width: 5; stroke-linecap: round; marker-end: url(#water-arrowhead); }
.displaced-outline { fill: none; stroke: #0c9ba7; stroke-width: 3; stroke-dasharray: 7 6; opacity: .65; }
.float-arrow { stroke: #188b58; stroke-width: 9; stroke-linecap: round; }
.float-tip { fill: #188b58; }
.float-label { fill: #15764a; font-size: 18px; font-weight: 850; text-anchor: middle; }
.result-value { fill: #087c86; font-size: 28px; font-weight: 850; }
.result-note { fill: #315461; font-size: 15px; font-weight: 800; }
.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: 28px; color: #71848d; font-size: .82rem; text-align: center; }
.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}.simulator-layout:fullscreen{overflow:auto;padding:28px;background:#f4f7f8}.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}
@media (max-width:760px){.keyword-grid{grid-template-columns:1fr}}
.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) { .page-shell { width: min(100% - 22px,1120px); padding-top: 26px; } .simulator-layout,.learning-grid { grid-template-columns: 1fr; } .scene-heading { align-items: flex-start; flex-direction: column; } .scene-heading p { text-align: left; } #volume-scene { min-height: 290px; } .water-surface-label,.depth-label,.result-caption,.result-detail { font-size: 20px; } .result-value { font-size: 34px; } }

/* Phone layout: keep the experiment beside its controls in the reading flow. */
@media (max-width: 600px) {
  .page-shell { width: calc(100% - 24px); padding-top: 12px; }
  .back-nav { margin-bottom: 10px; font-size: .875rem; }
  .back-nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .page-actions { justify-content: flex-start; margin: 16px 0 12px; flex-wrap: wrap; }
  .small-action { min-height: 44px; font-size: .875rem; }
  .hero { margin-bottom: 14px; }
  .eyebrow { font-size: .875rem; letter-spacing: 0; }
  h1 { font-size: 1.5rem; line-height: 1.35; margin-bottom: 8px; }
  .hero > p:last-child { font-size: 1rem; line-height: 1.5; }
  .simulator-layout { gap: 10px; }
  .experiment-card { grid-row: 1; padding: 10px; border-radius: 14px; }
  .scene-heading { gap: 0; }
  .scene-heading h2 { font-size: 1rem; }
  .scene-heading p { display: none; }
  #volume-scene { min-height: 0; height: 230px; margin-top: 4px; }
  .mobile-layout .result-caption, .mobile-layout .result-value,
  .mobile-layout .result-detail, .mobile-layout .result-note { display: none; }
  .water-surface-label, .depth-label, .float-label { font-size: 27px; }
  .block-label { display: none; }
  .mobile-layout .mobile-result { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; margin: 4px 0 0; padding: 8px 10px; background: #e9f8fa; border-radius: 8px; font-size: 1rem; }
  .mobile-result strong { color: #087c86; font-size: 1.125rem; }
  #mobile-result-detail { grid-column: 1 / -1; font-size: .875rem; }
  .control-panel { padding: 14px; border-radius: 14px; }
  .control-panel h2 { font-size: 1rem; margin-bottom: 4px; }
  .control-panel label { margin-top: 10px; font-size: 1rem; gap: 8px; }
  input[type=range] { display: block; height: 44px; margin: 0; }
  input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border: 3px solid #fff; border-radius: 50%; background: #087c86; box-shadow: 0 0 0 1px #087c86; }
  input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; }
  input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: #b9dde0; }
  input[type=range]::-webkit-slider-thumb { margin-top: -10px; }
  input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: #b9dde0; }
  input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border: 3px solid #fff; border-radius: 50%; background: #087c86; box-shadow: 0 0 0 1px #087c86; }
  .range-labels { font-size: .875rem; }
  .experiment-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
  .experiment-actions button, .control-panel .experiment-actions .secondary-button { min-height: 48px; margin: 0; padding: 10px 6px; font-size: .875rem; }
  .control-panel .control-note { margin-top: 12px; font-size: .875rem; }
  .control-panel #fullscreen-button { margin: 12px 0 0; min-height: 44px; font-size: .875rem; }
  .lesson-toggle:not([hidden]) { display: block; width: 100%; min-height: 52px; margin-top: 16px; border: 1px solid #087c86; color: #087c86; background: #fff; text-align: left; font-size: 1rem; }
  #lesson-details[hidden] { display: none; }
  .keyword-hint, .keyword-answer { font-size: .875rem; }
  .questions-link-card { flex-direction: column; align-items: flex-start; gap: 8px; }
  .simulator-layout:fullscreen { padding: 12px; }
}

/* Keep the scene in sight while adjusting either slider on a tall phone. */
@media (max-width: 600px) and (min-height: 700px) {
  .experiment-card { position: sticky; top: 0; z-index: 2; background: #fff; }
}
