:root {
  font-family: "DM Sans", system-ui, sans-serif;
  color: #24251c;
  background: #faf7ef;
  line-height: 1.6;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; }
fieldset { min-inline-size: 0; margin: 0; }
[hidden] { display: none !important; }
a { color: #694021; text-underline-offset: .19em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #a53f22; outline-offset: 3px; }
.wrap { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #dfd6c6;
  padding-block: 1rem;
}
.brand { color: #24251c; font-size: 1.2rem; font-weight: 750; text-decoration: none; }
.brand span { display: block; font-size: .75rem; font-weight: 500; color: #685b4b; }
.intro { padding-block: clamp(2rem, 6vw, 4.5rem) 2.3rem; max-width: 51rem; }
.kicker { color: #694021; font-size: .85rem; font-weight: 750; letter-spacing: .06em; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h1 { font-family: "Instrument Serif", Georgia, serif; font-size: clamp(2.3rem, 6.1vw, 4.5rem); letter-spacing: -.025em; }
html[lang="ja"] h1 { font-family: "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif; font-size: clamp(1.85rem, 5vw, 3.55rem); line-height: 1.4; }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
h3 { font-size: 1.12rem; overflow-wrap: anywhere; }
.intro > p:not(.kicker) { max-width: 45rem; font-size: 1.09rem; }
.start { margin-top: .25rem; }
.calculator { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.sheet, .results { padding: clamp(1rem, 3vw, 1.9rem); border-radius: 1.2rem; min-width: 0; }
.sheet { background: #fffdfa; border: 1px solid #e0d4bd; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.quiet, .footer button { background: #fffbf4; border: 1px solid #bdb197; color: #553723; border-radius: .5rem; min-height: 44px; padding: .45rem .8rem; font-weight: 650; }
.quiet:disabled { background: #ebe8dd; color: #685f53; cursor: default; }
.muted { color: #645b4e; font-size: .89rem; }
.supplier, .recipe { border: 1px solid #e3d7c3; border-radius: .65rem; padding: .7rem .8rem; margin: .9rem 0; }
legend { padding-inline: .4rem; font-weight: 750; color: #493b2b; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.recipe .field-grid, .supplier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.field:has([data-field="name"]) { grid-column: 1 / -1; }
.field > input { margin-top: auto; }
.name-help { font-size: .84rem; margin: 0; }
.currency-control {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid #e3d7c3;
}
.currency-control select { width: auto; min-width: 5.6rem; }
.currency-control p { flex: 1 1 11rem; margin: 0; }
.unit-help { margin-block: .7rem 0; }
.field-error { color: #862f22; font-size: .82rem; line-height: 1.35; margin: .15rem 0 0; }
.field-grid label { display: flex; flex-direction: column; gap: .25rem; font-size: .86rem; font-weight: 650; justify-content: space-between; }
.field-grid input, .field-grid select {
  min-height: 44px;
  width: 100%;
  padding: .35rem .45rem;
  border: 1px solid #b8a88d;
  border-radius: .35rem;
  color: #24251c;
  background: #fff;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.field-grid input[aria-invalid="true"] { border: 2px solid #a53f22; }
details.recipe > summary { cursor: pointer; color: #493b2b; font-weight: 700; min-height: 44px; padding: .55rem 0; overflow-wrap: anywhere; }
.details-help { margin-block: .3rem .65rem; }
.primary { display: inline-block; min-height: 46px; padding: .65rem 1rem; background: #613b23; color: #fff9ee; border: 1px solid #613b23; border-radius: .5rem; font-weight: 750; text-decoration: none; }
.primary:hover { background: #4c2b17; }
.calculate { width: 100%; }
.results { background: #e9eddd; border: 1px solid #c6d0b3; }
#input-title, #result-title { scroll-margin-top: .75rem; }
.edit-inputs { display: inline-flex; min-height: 44px; align-items: center; font-size: .9rem; font-weight: 700; }
.results > p { margin-block: .75rem; }
.result { margin-top: .65rem; padding: .8rem .9rem; border-radius: .65rem; background: #fbfcf5; border: 1px solid #d1d7c3; }
.result dl { margin: .65rem 0 0; }
.result dl div { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; border-top: 1px solid #e0e4d5; padding: .25rem 0; }
.result dt { font-size: .85rem; }
.result dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.result [data-output="guidance"] { color: #285137; }
.result [data-output="note"] { color: #6e3e2b; font-size: .82rem; margin: .35rem 0 0; }
.method { color: #4e5944; font-size: .84rem; }
.download-comparison { min-width: min(100%, 12rem); }
.stale, .message { padding: .7rem; border-radius: .4rem; background: #fcece1; color: #703a27; }
.worked-example { margin-block: 1.5rem 0; max-width: 52rem; padding: 1rem 1.2rem; border: 1px solid #dfd6c6; border-radius: .75rem; }
.worked-example p:last-child { margin-bottom: 0; }
.upgrade { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.3rem; margin-block: 2rem; border: 1px solid #e0d4bd; border-radius: 1.1rem; background: #f4e8d3; padding: clamp(1rem, 3vw, 2rem); }
.upgrade .kicker { margin-top: 0; }
.purchase p { margin-block: .55rem; font-size: .91rem; }
.faq { max-width: 52rem; }
.faq details { border-bottom: 1px solid #dfd6c6; padding: .6rem .1rem; }
.faq summary { cursor: pointer; font-weight: 680; min-height: 44px; padding-block: .52rem; }
.footer { margin-block: 2.25rem; padding-block: 1rem; border-top: 1px solid #dfd6c6; color: #5d5043; font-size: .86rem; }
.footer h2 { font-size: 1rem; }
.footer button { margin: .2rem .35rem .2rem 0; }
.footer button[aria-pressed="true"] { border: 2px solid #0d592e; }
.footer button:disabled { opacity: .55; cursor: default; }
.sr-only { position: absolute; height: 1px; width: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 48rem) {
  .calculator, .upgrade { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 26rem) {
  .wrap { width: calc(100% - 1.25rem); }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .currency-control p { flex-basis: 100%; }
  .results-head { column-gap: .7rem; row-gap: 0; }
}
