@font-face {
  font-family: Manrope;
  src: url("manrope.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: Manrope, system-ui, sans-serif;
  --paper: #f7f5ec;
  --surface: #fffefa;
  --tint: #edeee2;
  --ink: #172b22;
  --muted: #48564c;
  --line: #ccd1c2;
  --field-line: #7b897a;
  --forest: #19372b;
  --forest-hover: #294b3b;
  --gauge-ink: #edf3df;
  --lime: #deeba9;
  --peach: #f5bb99;
  --alert: #8b3523;
  --alert-bg: #faebe2;
  --success: #215337;
  --success-bg: #e5eee0;
  --radius: .875rem;
  --measure: ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body { margin: 0; color: var(--ink); background: var(--paper); font-size: 1rem; line-height: 1.55; }
::selection { color: var(--ink); background: var(--lime); }
:focus-visible { outline: 3px solid #276b4c; outline-offset: 3px; }
a { color: inherit; text-underline-offset: .25em; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button, a, input, select { -webkit-tap-highlight-color: #d7e8d5; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.13; letter-spacing: -.035em; font-weight: 800; }
p { color: var(--muted); }
.wrap { width: min(100% - 5rem, 76rem); margin-inline: auto; }
.skip-link { position: fixed; z-index: 3; inset: .75rem auto auto .75rem; padding: .6rem .85rem; background: var(--surface); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }
.wordmark { display: inline-flex; align-items: center; gap: .63rem; font-size: 1.28rem; font-weight: 800; text-decoration: none; letter-spacing: -.04em; }
.mark { position: relative; width: 1.65rem; height: 1.25rem; background: var(--forest); border-radius: .18rem; overflow: hidden; flex: 0 0 auto; }
.mark::before { content: ""; position: absolute; width: .98rem; height: .98rem; left: .34rem; top: -.59rem; transform: rotate(45deg); border: 1.5px solid var(--lime); border-radius: .18rem; }
nav { display: flex; gap: 1.75rem; align-items: center; font-size: .91rem; font-weight: 750; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; }

.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(19rem, .9fr); align-items: center; gap: 2.65rem; padding-block: 3.1rem 3.3rem; }
.hero h1 { font-size: 5rem; line-height: .98; letter-spacing: -.04em; }
.hero p { max-width: 34rem; margin-top: .95rem; }
.hero .button { margin-top: 1.35rem; }
.button { min-height: 2.65rem; display: inline-flex; justify-content: center; align-items: center; padding: .53rem .88rem; border-radius: .45rem; border: 1px solid transparent; text-decoration: none; font-weight: 800; font-size: .89rem; line-height: 1.2; text-align: center; transition: background-color 150ms ease, border-color 150ms ease; }
.button.primary { background: var(--forest); color: #fff; padding-inline: 1.05rem; }
.button.primary:hover { background: var(--forest-hover); }
.button.secondary { background: var(--surface); border-color: var(--field-line); }
.button.secondary:hover, .button.plain:hover { background: var(--tint); }
.button.plain { background: transparent; }
.button.remove { color: var(--alert); }

.gauge { border-radius: var(--radius); padding: 1.35rem 1.5rem 1.18rem; background: var(--forest); color: var(--gauge-ink); }
.gauge-heading { display: flex; justify-content: space-between; align-items: baseline; gap: .65rem; }
.gauge h2 { font-size: 1.25rem; }
.gauge-heading > span, .gauge p { color: #c4d4c5; font-size: .82rem; }
.gauge p { margin-top: .85rem; }
.gauge-body { margin-top: 1.05rem; }
.gauge-track { position: relative; height: 5.25rem; border-radius: .25rem; overflow: hidden; border-bottom: 1px solid #74917d; background: repeating-linear-gradient(to right, #6a8c76 0 1px, transparent 1px 10%) repeat-x left bottom / 100% .47rem; }
.gauge-limit { position: absolute; z-index: 2; inset: .07rem auto .4rem 75%; border-left: 1px dashed #faf9e9; box-shadow: 1px 0 0 1px var(--ink); transition: left 200ms ease; }
.gauge-bar { position: absolute; height: .92rem; inset-inline-start: 0; min-width: 0; border-radius: 0 .15rem .15rem 0; transition: width 200ms ease; }
.bar-a { top: .7rem; width: 82%; background: var(--peach); }
.bar-b { top: 2.45rem; width: 70%; background: var(--lime); }
.gauge-caption { display: flex; gap: 1.35rem; flex-wrap: wrap; margin-top: .65rem; font-size: .87rem; }
.gauge-caption span { display: flex; align-items: center; gap: .34rem; }
.gauge-caption i { width: .58rem; height: .58rem; border-radius: .12rem; margin-right: .1rem; }
.legend-a { background: var(--peach); }
.legend-b { background: var(--lime); }
.gauge-caption strong { font-family: var(--measure); font-weight: 500; }

.section { scroll-margin-top: 1.2rem; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: .85rem 1.5rem; margin-bottom: 1rem; }
.section-heading h2 { font-size: 1.85rem; }
.section-heading p { margin-top: .34rem; font-size: .91rem; }
.draft-actions { display: flex; align-items: center; gap: .37rem; flex-shrink: 0; }
#workbench { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.settings { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem 1.25rem; padding: 1rem 1.3rem; background: var(--tint); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.market-field { flex: 0 1 15.8rem; }
.quantity-field { width: 9rem; align-self: flex-start; }
.source-link { margin-inline-start: auto; align-self: center; font-size: .87rem; font-weight: 800; color: var(--forest); }
.source-link:hover, .guide-body a:hover { color: var(--alert); }
label { min-width: 0; display: block; font-size: .86rem; font-weight: 750; }
label > span:first-child { display: block; margin-bottom: .25rem; }
label small { color: var(--muted); font-size: .76rem; font-weight: 550; }
input, select { width: 100%; min-width: 0; min-height: 2.72rem; padding: .41rem .55rem; border: 1px solid var(--field-line); border-radius: .34rem; background: var(--surface); outline-offset: 1px; font-size: 1rem; font-weight: 650; caret-color: var(--forest); }
input::placeholder { color: #626d61; font-weight: 500; }
input:hover, select:hover { border-color: #506b58; }
input[type=number] { appearance: textfield; font-variant-numeric: tabular-nums; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { appearance: none; margin: 0; }
select { appearance: none; padding-right: 1.75rem; background-image: linear-gradient(45deg, transparent 50%, var(--forest) 50%), linear-gradient(135deg, var(--forest) 50%, transparent 50%); background-position: right .77rem center, right .47rem center; background-size: .32rem .32rem; background-repeat: no-repeat; }
.invalid { border-color: var(--alert); background-color: var(--alert-bg); }
.field-error { display: block; font-size: .81rem; color: var(--alert); margin-top: .2rem; }
.unit-field { display: flex; position: relative; }
.unit-field input { padding-right: 2.05rem; }
.unit-field > span { position: absolute; inset: 50% .42rem auto auto; transform: translateY(-50%); color: var(--muted); font-size: .76rem; pointer-events: none; }
.quantity-field .unit-field input { padding-right: 3.05rem; }

.work-grid { display: grid; grid-template-columns: minmax(0, .72fr) repeat(2, minmax(0, 1.24fr)); }
.item-panel, .option-panel { padding: 1.25rem 1.25rem 1.35rem; min-width: 0; }
.option-panel { border-inline-start: 1px solid var(--line); }
.work-grid h3 { font-size: 1.26rem; }
.item-panel > p { margin-top: .35rem; font-size: .85rem; }
.item-panel .full-field { margin-top: 1rem; }
.item-dims { display: grid; gap: .66rem; margin-top: .75rem; }
.item-panel .measurement-note { margin-top: 1.15rem; font-size: .81rem; }
.option-heading { display: flex; gap: .55rem; align-items: center; margin-bottom: .65rem; }
.option-tag { display: grid; place-content: center; width: 1.75rem; height: 1.75rem; flex: 0 0 auto; font-family: var(--measure); font-size: .9rem; border-radius: .25rem; background: var(--peach); }
.option-tag.b { background: var(--lime); }
.option-name input { font-weight: 750; }
fieldset { min-width: 0; padding: 0; margin: .85rem 0 0; border: 0; }
legend { font-size: .87rem; font-weight: 800; padding: 0; margin-bottom: .2rem; }
.three-fields, .two-fields { display: grid; gap: .52rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.supplemental { margin-top: .63rem; }
.field-caption { font-size: .8rem; color: var(--muted); margin-top: .43rem; }
.postal-details { margin-top: .65rem; }
.postal-details > summary { cursor: pointer; font-size: .86rem; font-weight: 800; padding-block: .2rem; }
.postal-details .two-fields { align-items: start; margin-top: .3rem; }
.postal-details select { font-size: .82rem; }
.measure-check { display: flex; gap: .47rem; align-items: center; color: var(--muted); font-size: .82rem; margin-top: .6rem; }
.measure-check input { flex: 0 0 auto; width: 1.05rem; min-height: 0; height: 1.05rem; margin: 0; accent-color: var(--forest); }
.option-result { margin-top: .9rem; padding: .65rem .72rem; border-radius: .45rem; background: var(--tint); color: var(--ink); }
.option-result[data-tone=pass] { background: var(--success-bg); color: var(--success); }
.option-result[data-tone=warn] { background: var(--alert-bg); color: var(--alert); }
.option-result strong { display: block; font-size: .94rem; }
.option-result p { color: inherit; font-size: .82rem; margin-top: .17rem; }
.option-actions { display: flex; justify-content: flex-start; margin-top: .6rem; }
.option-actions .button { min-height: 2.45rem; }

.summary { display: grid; grid-template-columns: minmax(0, .72fr) repeat(2, minmax(0, 1.24fr)); gap: .45rem 0; padding: 1.1rem 0 .9rem; border-top: 1px solid var(--line); background: var(--tint); border-radius: 0 0 var(--radius) var(--radius); }
.summary > * { padding-inline: 1.25rem; }
.summary h3 { font-size: 1.15rem; }
.summary p { margin-top: .25rem; font-size: .85rem; }
.summary-amount { align-self: start; }
.summary-amount span { display: block; font-size: .86rem; font-weight: 750; overflow-wrap: anywhere; }
.summary-amount strong { font-family: var(--measure); line-height: 1.15; font-size: 1.9rem; font-weight: 600; display: block; margin-top: .24rem; overflow-wrap: anywhere; }
.summary .difference { grid-column: 2 / -1; color: var(--forest); font-weight: 800; }
.action-status { color: var(--forest); font-size: .86rem; font-weight: 750; margin-top: .45rem; }
.action-status:empty { margin-top: 0; }
.no-script { padding: .62rem; background: var(--alert-bg); color: var(--alert); }

.saved-section, .guide-section { padding-top: 2.8rem; margin-top: 2.8rem; border-top: 1px solid var(--line); }
.saved-empty { padding: .9rem 0; font-size: .9rem; }
.saved-list { list-style: none; padding: 0; margin: 0; }
.saved-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem 1.5rem; align-items: center; padding: .85rem 0; border-top: 1px solid var(--line); }
.saved-list strong, .saved-list span { display: block; overflow-wrap: anywhere; }
.saved-list span { font-size: .86rem; color: var(--muted); }
.saved-actions { display: flex; gap: .35rem; }
.guide-list > details { border-top: 1px solid var(--line); }
.guide-list > details:last-child { border-bottom: 1px solid var(--line); }
.guide-list > details > summary { cursor: pointer; padding: .9rem 0; font-weight: 800; }
.guide-body { max-width: 72ch; padding-bottom: 1.05rem; }
.guide-body p + p { margin-top: .55rem; }
.guide-body a { color: var(--forest); font-weight: 750; }
.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); }
.footer-inner p { font-size: .84rem; }

@media (max-width: 64rem) {
  .wrap { width: calc(100% - 3rem); }
  .item-panel, .option-panel { padding-inline: .9rem; }
  .work-grid { grid-template-columns: minmax(0, .77fr) repeat(2, minmax(0, 1.22fr)); }
  .three-fields { gap: .3rem; }
}
@media (max-width: 53rem) {
  .item-panel { grid-column: 1 / -1; }
  .work-grid, .summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .item-dims { grid-template-columns: repeat(3, minmax(0,1fr)); max-width: 32rem; }
  .item-panel .full-field { max-width: 32rem; }
  .option-panel { border-top: 1px solid var(--line); }
  #option-a { border-inline-start: 0; }
  .summary-explainer, .summary .difference { grid-column: 1 / -1; }
  .hero { gap: 1.3rem; }
  .hero h1 { font-size: 4rem; }
}
@media (max-width: 36rem) {
  .wrap { width: calc(100% - 2rem); }
  .header-inner { min-height: 3.65rem; gap: .7rem; }
  .wordmark { gap: .35rem; font-size: 1.08rem; }
  .mark { width: 1.4rem; height: 1.1rem; }
  .mark::before { left: .23rem; }
  nav { gap: .61rem; font-size: .77rem; }
  nav a { padding-block: .55rem; }
  .hero { display: block; padding-block: 2.25rem 2.2rem; }
  .hero h1 { font-size: 3.3rem; }
  .hero .button { margin-top: 1rem; }
  .gauge { margin-top: 1.45rem; padding: 1rem; }
  .gauge-track { height: 4.45rem; }
  .bar-b { top: 2.15rem; }
  .gauge p { margin-top: .55rem; }
  .section-heading { flex-wrap: wrap; }
  .section-heading h2 { font-size: 1.65rem; }
  .settings { padding: .8rem .85rem; gap: .6rem .7rem; }
  .market-field { flex-basis: 100%; }
  .source-link { margin-inline-start: 0; }
  .work-grid { display: block; }
  .option-panel { border-inline-start: 0; }
  .item-dims { gap: .35rem; }
  .summary > * { padding-inline: .85rem; }
  .summary-amount strong { font-size: 1.5rem; }
  .saved-section, .guide-section { margin-top: 2rem; padding-top: 1.8rem; }
  .saved-list li { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .footer-inner { padding-block: .8rem; align-items: flex-start; flex-direction: column; gap: .35rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
