:root {
  color-scheme: light;
  --ink: #1b291e;
  --muted: #4e6053;
  --accent: #b8ee4a;
  --forest: #172b20;
  --paper: #fffef9;
  --surface: #f8f8f0;
  --line: #dce1d6;
  font: 16px/1.55 "Inter", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--surface);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
h1 { font-size: clamp(2.6rem, 6vw, 5.4rem); }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.5rem); }
h3 { font-size: 1.16rem; }
:focus-visible { outline: 3px solid #397522; outline-offset: 4px; }
.wrap { width: min(1200px, calc(100% - 72px)); margin-inline: auto; }
.skip { position: absolute; top: -100px; left: 1rem; background: white; padding: .75rem; z-index: 2; }
.skip:focus { top: .5rem; }
.header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; gap: 0; align-items: center; text-decoration: none; font-weight: 800; font-size: 1.45rem; letter-spacing: -.06em; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; height: 32px; width: 32px; border-radius: 8px; margin-right: 9px; color: var(--ink); background: var(--accent); font-family: Georgia, serif; }
.brand-dot { color: #487525; }
nav { display: flex; gap: clamp(12px, 2.3vw, 32px); flex-wrap: wrap; }
nav a { text-decoration: none; font-size: .89rem; font-weight: 650; }
nav a:hover, nav a[aria-current] { text-decoration: underline; text-underline-offset: .35em; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 12px; border: 1px solid transparent; padding: 11px 17px; border-radius: 8px; font-weight: 700; text-decoration: none; font-size: .9rem; }
.button:hover { filter: brightness(.94); }
.header-action, .secondary { border-color: var(--line); background: var(--paper); color: var(--ink); }
.primary { background: var(--accent); color: #172416; }
.hero { color: #f8faef; background: var(--forest); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(26px, 5vw, 80px); padding-block: clamp(44px, 7.5vw, 102px); }
.hero h1 span { color: var(--accent); }
.hero p { max-width: 35ch; color: #d5e1d7; font-size: clamp(1rem, 2vw, 1.19rem); margin-top: 19px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 25px; }
.hero .secondary { color: white; background: transparent; border-color: #81988a; }
.hero :focus-visible { outline-color: var(--accent); }
.sample-stage { padding: clamp(13px, 3vw, 31px); background: #264032; border-radius: 18px; }
.paper { padding: clamp(18px, 3vw, 34px); border-radius: 9px; border: 1px solid var(--line); background: white; color: var(--ink); font-size: .75rem; box-shadow: 0 14px 28px #10271624; }
.paper-top, .paper-meta, .paper-total { display: flex; justify-content: space-between; gap: 12px; }
.paper-brand { font-size: .95rem; font-weight: 800; }
.sample, .tag { font-weight: 700; font-size: .68rem; border-radius: 4px; padding: 3px 7px; color: #37522f; background: #e9f1e2; align-self: start; }
.paper h2 { margin: 24px 0 16px; font-size: clamp(1.25rem, 3vw, 2.2rem); }
.paper-meta { justify-content: flex-start; gap: 30px; }
.paper-meta span, .paper-meta strong { display: block; }
.paper-meta span { font-size: .62rem; color: var(--muted); letter-spacing: .06em; }
.paper table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.paper th, .paper td { text-align: left; padding: 7px 5px; border-bottom: 1px solid var(--line); }
.paper th { background: #f0f4ed; }
.paper th:last-child, .paper td:last-child { text-align: right; }
.paper-total { margin-top: 12px; justify-content: flex-end; align-items: center; }
.paper-total strong { font-size: .99rem; }
.paper-note { margin-top: 18px; color: var(--muted); font-size: .65rem; }
.section { padding-block: 58px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 25px; }
.section-head p, .page-title p { color: var(--muted); margin-top: 9px; }
.text-link { font-weight: 700; text-underline-offset: .2em; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card { position: relative; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.card:hover, a.entry:hover { border-color: #7b9b64; background: #fcfff5; }
.doc-icon { display: inline-grid; place-items: center; border: 1px solid #c9dabd; border-radius: 8px; width: 36px; height: 36px; font: 750 .78rem/1 "IBM Plex Mono", monospace; background: #edf3e5; margin-bottom: 17px; }
.card p, .entry p { margin-top: 8px; color: var(--muted); font-size: .88rem; }
.card-arrow { position: absolute; top: 20px; right: 18px; }
.band { background: #ecf1e6; border-block: 1px solid var(--line); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.directory { display: grid; gap: 10px; margin-top: 18px; }
.entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); text-decoration: none; }
.inner { padding-block: clamp(36px, 6vw, 78px); min-height: 65vh; }
.page-title { margin-bottom: 32px; max-width: 760px; }
.page-title h1 { font-size: clamp(2.25rem, 5vw, 4rem); }
.page-title p { font-size: 1.12rem; }
.breadcrumb { display: inline-block; margin-bottom: 16px; }
.detail.has-sample, .calculator-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.fields { margin-top: 16px; padding-left: 22px; }
.fields li { margin-block: 7px; }
.more, .formula { margin-top: 20px; }
.prose h2 { font-size: 1.45rem; margin-top: 22px; }
.prose p { margin-top: 10px; max-width: 70ch; }
.calculator-layout { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
.calculator, .result { padding: clamp(14px, 2vw, 24px); border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.carton-group { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.carton-group legend { font-weight: 800; margin-bottom: 7px; }
.carton-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.carton-fields label, .carton-weight-field { min-width: 0; display: grid; gap: 5px; font-size: .8rem; font-weight: 650; }
.carton-fields input, .carton-fields select, .carton-weight-field input { min-width: 0; width: 100%; padding: 8px 4px; border: 1px solid #9baa9e; border-radius: 6px; background: white; color: var(--ink); }
.carton-weight-field { max-width: 15rem; margin-top: 10px; }
.carton-breakdown { margin: 14px 0; padding-top: 12px; border-top: 1px solid var(--line); }
.carton-breakdown h3 { font-size: 1rem; }
#carton-results > div { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.carton-breakdown h4 { margin: 0; font-size: .9rem; }
.carton-breakdown dl { display: grid; gap: 5px; margin: 8px 0 0; font-size: .85rem; }
.carton-breakdown dl > div { display: flex; justify-content: space-between; gap: 8px; }
.carton-breakdown dd { margin: 0; font-weight: 700; text-align: end; overflow-wrap: anywhere; }
.remove-carton { display: block; margin-top: 8px; background: transparent; color: var(--ink); border: 0; text-decoration: underline; }
.result { background: #e9f2de; }
.result h2 { font-size: 1.2rem; }
.result output { display: block; margin: 10px 0; font-size: 1.8rem; font-weight: 800; overflow-wrap: anywhere; }
.result p { margin-bottom: 10px; }
footer { border-top: 1px solid var(--line); padding-block: 23px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.footer-inner > span { color: var(--muted); font-size: .85rem; }
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-action { display: none; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { min-height: auto; align-items: flex-start; flex-direction: column; gap: 10px; padding-block: 12px; }
  .hero-grid, .split, .detail.has-sample, .calculator-layout { grid-template-columns: 1fr; }
  .section { padding-block: 36px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .card { padding: 14px; }
  .card-arrow { top: 14px; right: 12px; }
  .carton-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media print {
  @page { margin: 16mm; }
  body { background: white; }
  .header, .skip, footer, .breadcrumb, .page-title, .detail > div { display: none !important; }
  .wrap, .inner { width: 100%; margin: 0; padding: 0; min-height: 0; }
  .detail.has-sample { display: block; }
  .paper { border: 0; box-shadow: none; padding: 0; }
}
.remove-carton[hidden] { display: none; }
