:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: #f7f9f8;
  color: #172b27;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.shell { width: min(100% - 32px, 440px); min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; }
.brand { display: flex; gap: 10px; align-items: center; padding: 28px 4px 24px; font-size: 13px; font-weight: 750; letter-spacing: .12em; }
.brand-mark { color: #287363; font-size: 29px; line-height: 1; }
.calculator { background: #fff; border: 1px solid #e3eae6; border-radius: 22px; padding: 28px 22px 22px; box-shadow: 0 8px 28px rgba(13, 41, 33, .035); }
.eyebrow { margin: 0 0 9px; color: #526660; font-weight: 700; font-size: 11px; letter-spacing: .15em; }
h1 { margin: 0; font-size: clamp(22px, 5.4vw, 28px); font-weight: 750; letter-spacing: -.015em; line-height: 1.35; }
.intro { margin: 9px 0 25px; color: #526660; font-size: 13px; line-height: 1.7; }
.field { margin-bottom: 20px; }
label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.input-wrap { display: flex; align-items: center; gap: 12px; border: 1px solid #b4c5bd; border-radius: 12px; padding: 0 15px; background: #fff; }
.input-wrap:focus-within { border-color: #287363; outline: 3px solid #e19c24; outline-offset: 3px; }
input { min-width: 0; width: 100%; min-height: 56px; padding: 10px 0; border: 0; outline: none; background: transparent; color: #172b27; font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
input::placeholder { color: #73847d; font-weight: 400; }
.input-wrap > span { color: #526660; font-size: 14px; flex: 0 0 auto; }
.hint { margin: 6px 0 0; color: #526660; font-size: 12px; }
.error { color: #a02e30; font-size: 13px; line-height: 1.7; margin: 7px 0 0; overflow-wrap: anywhere; }
input[aria-invalid="true"] { color: #a02e30; }
.calculate { width: 100%; min-height: 56px; background: #287363; color: #fff; border: 1px solid #287363; border-radius: 14px; font-size: 17px; font-weight: 750; cursor: pointer; }
.calculate:hover { background: #205c50; }
button:focus-visible, summary:focus-visible, .result:focus-visible { outline: 3px solid #e19c24; outline-offset: 3px; }
.result { margin-top: 24px; padding: 24px 16px 18px; background: #f5f8f6; border: 1px solid #e0e9e4; border-radius: 18px; scroll-margin-top: 16px; }
h2 { font-size: 13px; color: #526660; text-align: center; font-weight: 600; margin: 0 0 7px; }
.readout { display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 7px; margin: 0; }
#base { font-size: clamp(32px, 10vw, 48px); font-weight: 750; line-height: 1.3; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; max-width: 100%; }
.readout > span { font-size: 16px; }
.remainder { margin: 13px 0 16px; font-size: 12px; line-height: 1.7; text-align: center; color: #526660; overflow-wrap: anywhere; }
.allocation { border-top: 1px solid #dce5df; padding-top: 7px; }
.allocation p { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 11px 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.allocation strong { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.allocation span { flex: 0 0 auto; color: #526660; font-size: 13px; }
.sum { padding-top: 12px; margin: 14px 0 0; border-top: 1px solid #dce5df; font-size: 12px; line-height: 1.7; color: #315d52; text-align: center; overflow-wrap: anywhere; }
.reset { display: block; margin: 10px auto 0; border: 0; border-radius: 12px; background: transparent; color: #315d52; min-height: 48px; padding: 0 20px; font-size: 14px; cursor: pointer; }
.reset:hover { background: #f1f6f3; }
details { margin-top: 8px; border-top: 1px solid #eef2ef; font-size: 12px; color: #526660; }
summary { min-height: 48px; padding: 16px 0 12px; cursor: pointer; line-height: 1.6; }
details p { margin: 0 0 12px; line-height: 1.9; overflow-wrap: anywhere; }
.notice { border-top: 1px solid #eef2ef; margin: 0; padding-top: 15px; text-align: center; color: #526660; font-size: 11px; line-height: 1.8; }
footer { margin-top: auto; padding: 30px 8px 26px; text-align: center; font-size: 11px; color: #526660; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 360px) {
  .shell { width: calc(100% - 24px); }
  .calculator { padding: 23px 16px 19px; }
  .result { padding-left: 12px; padding-right: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .12s ease; }
}
