@font-face {
  font-family: DM Sans;
  src: url("fonts/dm-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: Space Mono;
  src: url("fonts/space-mono-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  --paper: #eff1e8;
  --white: #fafbf5;
  --ink: #172720;
  --muted: #536158;
  --rule: #c8d0bf;
  --green: #163b2c;
  --acid: #d6ef83;
  --sans: "DM Sans", Arial, sans-serif;
  --mono: "Space Mono", "Consolas", monospace;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  min-width: 280px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
  text-underline-offset: 0.19em;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #487947;
  outline-offset: 3px;
}
[tabindex="-1"]:focus {
  outline: none;
}
h1,
h2,
h3,
p,
fieldset,
legend,
dl,
dd {
  margin: 0;
}
.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  z-index: 9;
  top: 0.5rem;
  left: 0.5rem;
  background: white;
  color: var(--ink);
  padding: 0.7rem;
}
.page {
  width: min(1200px, calc(100% - clamp(36px, 9vw, 150px)));
  min-height: 100svh;
  margin: auto;
  display: flex;
  flex-direction: column;
}
.mast,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.mast {
  height: clamp(76px, 7vw, 102px);
  border-bottom: 1px solid var(--rule);
  flex: none;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-size: 1.7rem;
  line-height: 1;
  font-weight: 750;
  letter-spacing: -0.075em;
}
.brand img {
  width: 37px;
  height: 37px;
}
.help-button,
.secondary,
.close {
  background: transparent;
  border: 1px solid var(--rule);
}
.help-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.88rem;
  min-height: 39px;
  padding: 0.4rem 0.85rem;
}
.help-button:hover,
.secondary:hover,
.close:hover {
  background: #e5eade;
}
.help-symbol {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
}
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4.6vw, 74px) 0 clamp(39px, 5.8vw, 84px);
}
.intro {
  margin-bottom: clamp(24px, 2.8vw, 39px);
}
h1 {
  font-size: clamp(2.7rem, 5.3vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.075em;
  font-weight: 620;
}
h1 > span {
  color: #60813f;
}
.intro p {
  margin-top: 0.76rem;
  font-size: clamp(1rem, 1.4vw, 1.23rem);
  color: var(--muted);
}
.console {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(310px, 1fr);
  align-items: stretch;
  border: 1px solid var(--rule);
  border-radius: 22px;
  background: var(--white);
  overflow: hidden;
}
.display-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #dce2d3;
  padding: clamp(16px, 2.55vw, 37px);
  border-right: 1px solid var(--rule);
}
.display-surface {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 7% 4%, #234737, transparent 64%), linear-gradient(115deg, #19382e, #122c24);
  border: 1px solid #102c22;
  border-radius: 13px;
  color: var(--acid);
  min-height: 310px;
  overflow: hidden;
}
.display-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(213, 237, 197, 0.18) 0.8px, transparent 1px);
  background-position: 4px 4px;
  background-size: 11px 11px;
  opacity: 0.65;
  pointer-events: none;
}
.display-top,
.display-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: clamp(15px, 1.8vw, 25px);
}
.display-top {
  padding-bottom: 0;
}
.display-bottom {
  padding-top: 0;
  color: #c0cfc1;
  font-size: 0.85rem;
}
.display-label,
.screen-mode,
.display-bottom,
.round-spec dd,
.breakdown p {
  font-variant-numeric: tabular-nums;
}
.display-label {
  font-size: 0.75rem;
  font-weight: 680;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #e1eacb;
}
.screen-mode {
  font-size: 0.79rem;
  color: #d4ddcf;
}
.readout {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0.8rem 5%;
  min-height: 0;
  container-type: inline-size;
}
.number {
  font: 700 min(clamp(4rem, 10.5vw, 9rem), calc(142cqw / var(--chars, 2))) / 1.12 var(--mono);
  letter-spacing: -0.09em;
  padding-right: 0.09em;
  overflow-wrap: anywhere;
  text-align: center;
}
.number.word {
  font: 650 clamp(2rem, 4.8vw, 3.8rem) / 1.1 var(--sans);
  letter-spacing: -0.055em;
}
.indicator {
  width: 26px;
  height: 12px;
  background: repeating-linear-gradient(90deg, var(--acid) 0 4px, transparent 4px 8px);
  opacity: 0.76;
}
.meter {
  padding: 15px 3px 0;
}
.meter-ticks {
  display: flex;
  gap: 4px;
  height: 4px;
}
.meter-ticks i {
  flex: 1;
  background: #b9c5b3;
  border-radius: 2px;
}
.meter-ticks i.seen {
  background: #577653;
}
.controller {
  padding: clamp(22px, 3vw, 45px);
  min-width: 0;
  align-self: center;
}
h2 {
  font-size: clamp(1.5rem, 2.45vw, 2.16rem);
  line-height: 1.07;
  letter-spacing: -0.058em;
  font-weight: 630;
}
.mode-group {
  padding: 0;
  border: 0;
  margin-top: 1.4rem;
  min-inline-size: 0;
}
.mode-group legend,
.field > label,
.field > span,
.breakdown h3 {
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: -0.014em;
}
.mode-group legend {
  padding: 0;
  margin-bottom: 0.4rem;
}
.modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: #eaf0e1;
}
.modes label {
  position: relative;
  min-width: 0;
}
.modes input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.modes span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 35px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 560;
  white-space: nowrap;
}
.modes b {
  font-size: 1.03rem;
  line-height: 1;
}
.modes input:checked + span {
  background: var(--green);
  color: #f9fbef;
}
.modes input:focus-visible + span {
  outline: 3px solid #678854;
  outline-offset: -2px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin: 1.15rem 0 1.45rem;
}
.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.field input {
  border: 1px solid #a7b3a2;
  border-radius: 6px;
  background: #fffef9;
  width: 100%;
  min-width: 0;
  height: 40px;
  font-variant-numeric: tabular-nums;
  padding: 0.35rem 0.68rem;
  font-weight: 500;
}
.field small,
.unit {
  font-size: 0.75rem;
  line-height: 1.25;
  color: #58645a;
  font-weight: 450;
}
.joined {
  display: flex;
  position: relative;
}
.joined input {
  padding-right: 42px;
}
.joined button {
  position: absolute;
  right: 2px;
  inset-block: 2px;
  width: 35px;
  background: #edf1e6;
  border: 0;
  border-left: 1px solid #c6cebf;
  border-radius: 0 5px 5px 0;
  font-size: 1.08rem;
  line-height: 1;
}
.primary,
.secondary {
  min-height: 44px;
  width: 100%;
  border-radius: 7px;
  font-weight: 640;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.68rem;
}
.primary {
  border: 1px solid var(--green);
  color: #f9fbee;
  background: var(--green);
  box-shadow: 0 2px 0 #0b241a;
  transition: background 0.18s;
}
.primary:hover {
  background: #24513c;
}
.primary:active {
  box-shadow: none;
}
.play-mark {
  width: 0;
  height: 0;
  border-block: 5px solid transparent;
  border-left: 8px solid #d6ef83;
}
.explain {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.99rem;
}
.round-spec {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin: 1.4rem 0 1.8rem;
  padding: 1rem 0;
  border-block: 1px solid var(--rule);
}
.round-spec dt {
  font-size: 0.78rem;
  color: var(--muted);
}
.round-spec dd {
  font-size: 1.15rem;
  font-weight: 650;
}
.stack {
  display: grid;
  gap: 9px;
}
.answer-field {
  margin: 1.25rem 0 1.7rem;
}
.answer-field input {
  font-size: 1.55rem;
  height: 53px;
}
.breakdown {
  margin: 1.2rem 0 1.6rem;
  border-block: 1px solid var(--rule);
  padding: 0.7rem 0;
  max-height: 160px;
  overflow: auto;
}
.breakdown h3 {
  margin-bottom: 0.25rem;
}
.breakdown p,
.result-note {
  overflow-wrap: anywhere;
}
.no-script {
  padding: 8px;
  background: #f7e4bb;
  margin-bottom: 12px;
}
footer {
  border-top: 1px solid var(--rule);
  padding: 19px 0 21px;
  color: var(--muted);
  font-size: 0.85rem;
}
footer a:hover {
  color: var(--green);
}
dialog {
  width: min(445px, calc(100% - 36px));
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 25px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 24px 80px #132a1f45;
}
dialog::backdrop {
  background: #12251dc2;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.close {
  font-size: 1.35rem;
  width: 35px;
  height: 35px;
  line-height: 1;
  border-radius: 50%;
}
dialog p {
  margin: 10px 0;
  line-height: 1.52;
}
dialog .keys {
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 20px;
}
kbd {
  font: 600 0.81em var(--mono);
  padding: 0.06rem 0.26rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #ecf0e5;
}
@media (max-width: 780px) {
  .page {
    width: calc(100% - 36px);
    max-width: 620px;
  }
  .mast {
    height: 61px;
  }
  .brand {
    font-size: 1.47rem;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
  .help-button {
    min-height: 36px;
  }
  main {
    padding: 22px 0 30px;
    justify-content: flex-start;
  }
  .intro {
    margin-bottom: 17px;
  }
  h1 {
    font-size: clamp(2.12rem, 6.2vw, 3.4rem);
  }
  .intro p {
    font-size: 0.94rem;
    line-height: 1.4;
    margin-top: 0.44rem;
  }
  .console {
    grid-template-columns: 1fr;
    border-radius: 15px;
  }
  .display-side {
    padding: 12px 12px 9px;
    border: 0;
    border-bottom: 1px solid var(--rule);
  }
  .display-surface {
    min-height: 164px;
    height: clamp(164px, 33vw, 205px);
    flex: none;
    border-radius: 9px;
  }
  .display-top,
  .display-bottom {
    padding: 10px 15px;
  }
  .display-top {
    padding-bottom: 0;
  }
  .display-bottom {
    padding-top: 0;
    font-size: 0.76rem;
  }
  .display-label,
  .screen-mode {
    font-size: 0.71rem;
  }
  .number {
    font-size: min(clamp(3.6rem, 14vw, 6.9rem), calc(142cqw / var(--chars, 2)));
  }
  .meter {
    padding: 8px 2px 0;
  }
  .meter-ticks {
    height: 3px;
  }
  .controller {
    padding: 17px 18px 19px;
  }
  .mode-group {
    margin-top: 0.75rem;
  }
  .fields {
    margin: 0.8rem 0 1rem;
    gap: 0.6rem 0.85rem;
  }
  .modes span {
    min-height: 33px;
  }
  .field input {
    height: 37px;
  }
  .field small {
    font-size: 0.71rem;
  }
  .field {
    gap: 3px;
  }
  footer {
    font-size: 0.78rem;
    padding: 13px 0 15px;
  }
}
@media (max-width: 370px) {
  .page {
    width: calc(100% - 24px);
  }
  .controller {
    padding: 14px;
  }
  .fields {
    gap: 0.5rem 0.65rem;
  }
  .display-surface {
    min-height: 150px;
    height: 150px;
  }
  .help-button {
    font-size: 0.8rem;
  }
  footer {
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  .modes span {
    font-size: 0.79rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
