.termo-page {
  --termo-ink: #243437;
  --termo-blue: #245c86;
  --termo-orange: #aa4d26;
  --termo-paper: #faf6ec;
  --termo-line: #b8c3bc;
  color: var(--termo-ink);
  background: var(--termo-paper);
}
.termo-page [hidden] { display: none !important; }
.termo-shell { padding-block: 1.2rem 4rem; }
.termo-back { color: var(--termo-ink); font-size: .93rem; font-weight: 700; }
.termo-hero { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 1.1rem 3rem; padding-block: 1.1rem 1.5rem; }
.termo-hero .eyebrow { margin: 0 0 .4rem; color: #7e4b2b; }
.termo-hero h1 { margin: 0; font-size: clamp(2.9rem, 6.4vw, 5.6rem); line-height: .98; }
.termo-hero h1 em { color: var(--termo-orange); }
.termo-subtitle { margin: .46rem 0 0; font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 730; }
.termo-intro h2 { margin: 0 0 .4rem; font-size: clamp(1.3rem, 2.6vw, 2.1rem); line-height: 1.12; }
.termo-intro p { margin: 0; line-height: 1.45; }
.termo-game { border: 1px solid #9fafaa; border-radius: 1rem; overflow: clip; background: #f0f2e9; }
.termo-game-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .72rem 1rem; color: #fff8e6; background: #263e40; }
.termo-modes, .termo-actions, .termo-share-actions, .termo-book-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.termo-page button, .termo-share-action { min-height: 2.75rem; padding: .48rem .8rem; border: 1px solid #78908b; border-radius: .5rem; font: inherit; font-size: .93rem; font-weight: 730; cursor: pointer; }
.termo-modes button { color: #fff8e6; background: transparent; }
.termo-modes button[aria-pressed="true"] { color: #293b35; background: #f4d478; border-color: #f4d478; }
.termo-progress { margin: 0; color: #f2e8c7; font-size: .88rem; font-weight: 650; }
.termo-workspace { padding: clamp(.75rem, 2vw, 1.4rem); }
.termo-challenge-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; margin-bottom: .75rem; }
.termo-challenge-controls label { font-size: .86rem; font-weight: 720; }
.termo-page select { width: auto; max-width: 100%; min-height: 2.75rem; color: var(--termo-ink); background: #fffef6; border: 1px solid #8ca099; border-radius: .45rem; padding: .35rem .5rem; font: inherit; font-size: .94rem; }
.termo-task-heading { margin-bottom: 1rem; }
.termo-task-heading h2 { margin: 0 0 .32rem; font-size: clamp(1.4rem, 2.8vw, 2.05rem); line-height: 1.12; }
.termo-task-heading p { margin: 0; line-height: 1.4; }
.termo-reference { margin: -.3rem 0 .8rem; padding: .5rem .7rem; border-left: .2rem solid #96652c; background: #fff0d2; font-size: .9rem; }
.termo-bench { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: clamp(.6rem, 1.7vw, 1.25rem); }
.termo-source-card, .termo-result-card { min-width: 0; border: 1px solid var(--termo-line); border-radius: .7rem; padding: .85rem .9rem; background: #fffcf3; }
.termo-source-card.termo-a { border-top: .25rem solid #367ba2; }
.termo-source-card.termo-b { border-top: .25rem solid #bc643d; }
.termo-result-card { border-top: .25rem solid #477969; background: #e8eee1; }
.termo-source-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .15rem .3rem; }
.termo-source-heading h3 { margin: 0; font-size: 1.02rem; }
.termo-source-heading>span { font-size: 1.18rem; font-weight: 760; white-space: nowrap; }
.termo-a .termo-source-heading>span { color: var(--termo-blue); }
.termo-b .termo-source-heading>span { color: var(--termo-orange); }
.termo-vessel {
  --fill: 0%;
  --water-color: #a5cfb0;
  position: relative;
  width: min(100%, 10rem);
  height: 9.3rem;
  margin: .8rem auto .9rem;
  border: 2px solid #78928f;
  border-top: 0;
  border-radius: 0 0 .7rem .7rem;
  background: linear-gradient(90deg, #ffffff30, #e2ece630 65%, #ffffff90);
  overflow: hidden;
  box-shadow: 0 .25rem .2rem #2846380b;
}
.termo-water { position: absolute; inset: auto 0 0; height: var(--fill); background: var(--water-color); border-top: 2px solid #354e5a57; transition: height .65s ease, background-color .4s; }
.termo-graduations { position: absolute; inset: 0; display: grid; grid-template-rows: repeat(4, 1fr); text-align: right; }
.termo-graduations span { position: relative; padding: .12rem .3rem 0 0; color: #263f3e; font-size: .64rem; line-height: 1; }
.termo-graduations span::before { content: ""; position: absolute; top: 0; right: 0; width: .8rem; border-top: 1px solid #3d5f5670; }
.termo-vessel-mass { position: absolute; inset: auto 0 .35rem; color: #203e42; text-align: center; font-size: .95rem; font-weight: 750; }
.termo-mass-label { display: block; margin-bottom: .28rem; font-size: .81rem; font-weight: 720; }
.termo-source-card select { width: 100%; }
.termo-temperature-controls { margin-top: .7rem; }
.termo-temperature-controls label { display: block; font-size: .78rem; font-weight: 700; }
.termo-temperature-controls input { width: 100%; min-height: 2.2rem; margin: .15rem 0 0; accent-color: #315e65; }
.termo-reading { min-height: 2.8rem; text-align: center; line-height: 1; }
.termo-reading>span { font-size: clamp(1.75rem, 3.8vw, 2.7rem); font-weight: 760; font-variant-numeric: tabular-nums; }
.termo-thermometer { position: relative; height: .65rem; margin-top: .25rem; border: 1px solid #889990; border-radius: .4rem; overflow: hidden; background: #fff8ed; }
.termo-thermometer span { display: block; width: var(--temperature, 0%); height: 100%; background: linear-gradient(90deg, #5d9bc1, #d69a65); transition: width .65s ease; }
.termo-thermometer-scale { display: flex; justify-content: space-between; margin-top: .1rem; font-size: .65rem; color: #3b5751; }
.termo-result-caption { margin: .35rem 0 0; font-size: .78rem; line-height: 1.3; text-align: center; }
.termo-actions { margin-top: 1rem; }
.termo-actions button { color: #263e40; background: #fffcf3; }
.termo-actions .termo-primary { color: #fff8eb; background: #305f61; border-color: #305f61; padding-inline: 1.3rem; }
.termo-actions .termo-next { background: #f4d478; border-color: #ac8e3d; }
.termo-actions button:hover { filter: brightness(.95); }
.termo-actions button:disabled { opacity: .65; cursor: progress; }
.termo-feedback, .termo-hint-text { margin: .65rem 0 0; padding: .65rem .75rem; border: 1px solid #adc0ac; border-left: .24rem solid #7a9582; border-radius: .5rem; background: #faf9e9; line-height: 1.4; }
.termo-feedback:empty { padding: 0; margin: 0; border: 0; }
.termo-feedback[data-state="success"] { border-left-color: #3b7050; background: #e4f0d9; }
.termo-feedback[data-state="try"] { border-left-color: #b07736; background: #fff0d6; }
.termo-history-panel { border-top: 1px solid #b7c3b6; margin-top: .8rem; padding-top: .65rem; }
.termo-page summary { cursor: pointer; min-height: 1.8rem; font-weight: 700; }
.termo-history-panel summary { font-size: .87rem; }
.termo-history-panel p { margin: .45rem 0 0; font-size: .86rem; }
.termo-history { margin: .6rem 0 0; padding-left: 1.4rem; font-size: .88rem; line-height: 1.5; }
.termo-history li+li { margin-top: .35rem; }
.termo-page :is(a,button,select,input,summary,textarea):focus-visible { outline: 3px solid #264ab6; outline-offset: 3px; }
.termo-modes button:focus-visible { outline-color: #fff4a7; }
.termo-science { margin-top: 1.5rem; max-width: 49rem; }
.termo-science h2, .termo-share h2, .termo-book h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2.25rem); line-height: 1.12; }
.termo-science p, .termo-book p { margin: .65rem 0; line-height: 1.55; }
.termo-science details, .termo-share details { border: 1px solid #bbc7b9; border-radius: .5rem; padding: .55rem .75rem; }
.termo-share, .termo-book { margin-top: 1.3rem; padding: clamp(.85rem, 2.5vw, 1.5rem); border: 1px solid #bfccbc; border-radius: .8rem; background: #f0f2e5; }
.termo-share blockquote { margin: .65rem 0; font-size: 1rem; }
.termo-share-action { display: inline-flex; align-items: center; color: #294747; background: #fffbed; text-decoration: none; }
.termo-share p { margin: .5rem 0; font-size: .88rem; }
.termo-share [role="status"]:empty { margin: 0; }
.termo-share textarea { display: block; width: 100%; max-width: 38rem; margin: .6rem 0 .1rem; padding: .5rem; font: inherit; }
.termo-book { display: grid; grid-template-columns: minmax(4.5rem,7rem) minmax(0,1fr); align-items: center; gap: clamp(.8rem,2vw,1.5rem); }
.termo-book img { display: block; width: 100%; height: auto; border-radius: .3rem; }
.termo-book .eyebrow { color: #7b4d2b; margin: 0 0 .4rem; }
@media (max-width: 720px) {
  .termo-hero { grid-template-columns: 1fr; gap: .8rem; padding-bottom: 1.1rem; }
  .termo-bench { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
  .termo-source-card { padding: .65rem .65rem .7rem; }
  .termo-result-card { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: .1rem .7rem; padding: .65rem .8rem; }
  .termo-result-card .termo-source-heading { grid-column: 1 / -1; }
  .termo-result-vessel { grid-row: 2 / 6; height: 6rem; margin: .45rem auto .1rem; width: 6rem; }
  .termo-result-card .termo-reading { padding-top: .4rem; min-height: 2.2rem; }
  .termo-result-card .termo-graduations { font-size: .58rem; }
  .termo-source-heading>span { font-size: 1rem; }
  .termo-source-heading h3 { font-size: .95rem; }
  .termo-source-card .termo-vessel { height: 6.8rem; margin-block: .6rem; }
  .termo-result-caption { font-size: .74rem; }
  .termo-actions { margin-top: .7rem; }
}
@media (max-width: 420px) {
  .termo-shell { padding-top: 1rem; }
  .termo-hero h1 { font-size: 3rem; }
  .termo-modes button { padding-inline: .62rem; }
  .termo-game-top { padding: .6rem .72rem; }
  .termo-progress { font-size: .77rem; }
  .termo-workspace { padding: .65rem; }
  .termo-book { grid-template-columns: minmax(4.3rem,5.3rem) minmax(0,1fr); align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  .termo-water, .termo-thermometer span { transition: none; }
}
