/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --green-900: #14532D;   /* primary: header logo, headings, main buttons */
  --green-800: #166534;   /* borders on the dark band */
  --green-700: #15803D;   /* links, section labels */
  --green-600: #16A34A;   /* focus ring, active borders (not for text) */
  --green-300: #86EFAC;
  --green-200: #BBF7D0;
  --green-100: #DCFCE7;
  --green-50:  #F0FDF4;   /* light sections, result highlights */
  --text:      #0F172A;
  --text-2:    #334155;
  --muted:     #475569;   /* labels, notes (passes contrast on white and mint) */
  --border:    #E2E8F0;
  --border-2:  #CBD5E1;   /* inputs */
  --row-line:  #F1F5F9;
  --bg:        #FFFFFF;
  --bg-page:   #F8FAFC;   /* calculator page background */
  --amber-bg:  #FFFBEB;  --amber-border: #FDE68A;  --amber-text: #78350F;  --amber-icon: #B45309;
  --error:     #B91C1C;
  --radius-sm: 8px; --radius: 10px; --radius-md: 12px; --radius-lg: 14px; --radius-card: 16px;
  --font: Inter, system-ui, sans-serif;
  --font-display: 'Space Grotesk', Inter, sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}
body.page-calculator { background: var(--bg-page); }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-900); text-decoration: underline; }
input, select, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { max-width: 1200px; padding: 0 24px; margin: 0 auto; }

.skip-link { position: absolute; left: 12px; top: -48px; background: var(--green-900); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm); z-index: 10; }
.skip-link:focus { top: 12px; color: #fff; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius);
  font-weight: 600; font-size: 16px; border: 1px solid transparent; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--green-900); color: #fff; }
.btn--primary:hover { background: #0F3F22; color: #fff; }
.btn--primary:disabled { background: #4B7A5C; }
.btn--secondary { background: #fff; color: var(--green-900); border-color: var(--green-200); }
.btn--secondary:hover { border-color: var(--green-300); color: var(--green-900); }
.btn--small { min-height: 44px; padding: 0 18px; font-size: 15px; border-radius: var(--radius-sm); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header { border-bottom: 1px solid var(--border); background: #fff; }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--green-900); font-family: var(--font-display); font-weight: 700; font-size: 20px; min-height: 44px; }
.brand:hover { color: var(--green-900); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.nav a:not(.btn) { color: var(--text-2); padding: 10px 0 6px; border-bottom: 2px solid transparent; }
.nav a:not(.btn):hover { color: var(--green-900); text-decoration: none; border-bottom-color: var(--border-2); }
.nav a[aria-current="page"] { color: var(--green-900); font-weight: 600; border-bottom-color: var(--green-600); }
.menu-button {
  display: none; width: 44px; height: 44px; border: 1px solid var(--border-2); border-radius: var(--radius);
  background: #fff; color: var(--green-900); align-items: center; justify-content: center;
}

@media (max-width: 767.98px) {
  .js .menu-button { display: inline-flex; }
  .js .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 8px; }
  .js .nav.is-open { display: flex; }
  .js .nav a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .js .nav a[aria-current="page"] { border-bottom: 2px solid var(--green-600); }
  .js .nav .btn { margin-top: 12px; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { border-top: 1px solid var(--border); background: #fff; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; padding-top: 32px; padding-bottom: 32px; font-size: 14px; color: var(--muted); }
.site-footer__inner p { max-width: 640px; line-height: 1.6; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer nav a { display: inline-block; padding: 10px 0; }

/* ==========================================================================
   Shared pieces
   ========================================================================== */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-card); }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.kv { display: flex; justify-content: space-between; gap: 12px; }
.kv > :first-child { color: var(--muted); }
.kv > :last-child { text-align: right; white-space: nowrap; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.badge--grey { color: var(--text-2); background: var(--row-line); }
.badge--amber { color: var(--amber-text); background: var(--amber-border); }
.badge--soon { color: var(--muted); background: var(--border); font-weight: 600; }
.section-title { font-family: var(--font-display); font-size: 34px; line-height: 1.15; color: var(--green-900); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-form .input { flex: 1 1 240px; min-width: 0; }
.form-success { color: var(--green-900); font-weight: 600; }

/* ==========================================================================
   Home
   ========================================================================== */
.hero { background: var(--green-50); border-bottom: 1px solid var(--green-100); }
.hero__inner { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; padding-top: 80px; padding-bottom: 88px; }
.hero__copy { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.pill { align-self: flex-start; display: inline-flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--green-200); color: var(--green-900); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.hero h1 { font-family: var(--font-display); font-size: 54px; line-height: 1.08; letter-spacing: -0.02em; color: var(--green-900); }
.lead { font-size: 19px; line-height: 1.6; color: var(--text-2); max-width: 520px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.example-card { flex: 1 1 420px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.example-card__head { display: flex; flex-direction: column; gap: 4px; }
.example-card__meta { font-size: 15px; color: var(--muted); }
.example-card__value { font-family: var(--font-display); font-size: 44px; font-weight: 700; color: var(--text); line-height: 1.15; }
.example-card__rows { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.example-card__link { font-weight: 600; font-size: 15px; }

.section { padding-top: 88px; padding-bottom: 88px; display: flex; flex-direction: column; gap: 40px; }
.cards-row { display: flex; flex-wrap: wrap; gap: 24px; }
.step-card, .tool-card { flex: 1 1 280px; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.step-card h3, .tool-card h3 { font-size: 19px; }
.step-card p, .tool-card p { color: var(--muted); line-height: 1.6; }
.step-num { width: 36px; height: 36px; border-radius: 9px; background: var(--green-100); color: var(--green-900); font-weight: 700; display: flex; align-items: center; justify-content: center; }
a.tool-card { color: var(--text); }
a.tool-card:hover { border-color: var(--green-300); text-decoration: none; color: var(--text); }
.tool-card__cta { color: var(--green-700); font-weight: 600; }
.tool-card--soon { border-style: dashed; border-color: var(--border-2); background: var(--bg-page); }
.tool-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.data-band { background: var(--green-900); color: #fff; }
.data-band__inner { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; padding-top: 72px; padding-bottom: 72px; }
.data-band__copy { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.data-band h2 { font-family: var(--font-display); font-size: 34px; }
.data-band__copy p { color: var(--green-100); line-height: 1.6; font-size: 17px; }
.data-grid { flex: 1 1 520px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 0; }
.data-item { border: 1px solid var(--green-800); border-radius: var(--radius-md); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.data-item dt { color: var(--green-200); font-size: 13px; }
.data-item dd { margin: 0; font-weight: 600; }

.signup { background: var(--green-50); border-top: 1px solid var(--green-100); }
.signup__inner { max-width: 760px; margin: 0 auto; padding: 72px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.signup h2 { font-family: var(--font-display); font-size: 30px; color: var(--green-900); }
.signup p { color: var(--text-2); line-height: 1.6; }
.signup .inline-form { justify-content: center; width: 100%; margin-top: 6px; }
.signup .inline-form .input { flex: 1 1 280px; max-width: 360px; }

/* ==========================================================================
   Placeholder page
   ========================================================================== */
.placeholder { padding-top: 96px; padding-bottom: 120px; display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.placeholder h1 { font-family: var(--font-display); font-size: 42px; color: var(--green-900); }
.placeholder p { color: var(--muted); font-size: 17px; line-height: 1.6; }

/* ==========================================================================
   Calculator: layout
   ========================================================================== */
.calc { padding-top: 48px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 28px; }
.calc__head { display: flex; flex-direction: column; gap: 8px; }
.calc__head h1 { font-family: var(--font-display); font-size: 38px; line-height: 1.15; color: var(--green-900); }
.calc__head p { color: var(--muted); font-size: 17px; }
.calc__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
@media (min-width: 900px) {
  .calc__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
}

/* ==========================================================================
   Calculator: form
   ========================================================================== */
.calc-form { padding: 28px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 479.98px) { .calc-form { padding: 20px 16px; } }
.group { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.group > legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 10px; }
.group > legend span { font-weight: 400; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border: 1px solid var(--border-2); border-radius: 999px; background: #fff; color: var(--text-2); font-size: 14px; font-weight: 500; }
.chip:hover { border-color: var(--green-600); }
.chip[aria-pressed="true"] { border-color: var(--green-900); background: var(--green-900); color: #fff; font-weight: 600; }

.status { font-size: 14px; color: var(--muted); }
.status--error { color: var(--error); font-weight: 600; }

.shipments { display: flex; flex-direction: column; gap: 12px; }
.shipment { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.shipment__head { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.shipment__title { font-size: 13px; font-weight: 600; color: var(--muted); }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: var(--radius-sm); background: var(--row-line); color: var(--muted); font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--border); color: var(--text); }
.icon-btn[hidden] { display: none; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field__label { font-size: 12px; color: var(--muted); }
.field--big > label { font-size: 14px; font-weight: 600; color: var(--text); }
.field-row { display: flex; flex-wrap: wrap; gap: 10px; }
.field-row > .field { flex: 1 1 140px; }
.field-row > .field--mass { flex: 1 1 90px; }
@media (max-width: 479.98px) { .field-row > .field:first-child { flex-basis: 100%; } }
.input, .select {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--radius);
  font-size: 15px; background: #fff; color: var(--text);
}
.select { padding: 0 8px; }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--green-600); outline-offset: 0; border-color: var(--green-600); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--error); }
.field-hint { font-size: 12px; color: var(--muted); }
.field-hint:empty, .field-error:empty { display: none; }
.field-error { font-size: 13px; color: var(--error); font-weight: 500; }

.row-more { font-size: 13px; }
.row-more > summary { cursor: pointer; color: var(--green-700); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.row-more[open] > summary { margin-bottom: 6px; }
.row-more .field { max-width: 260px; }

.add-btn { min-height: 44px; border: 1px dashed var(--green-300); border-radius: var(--radius); background: var(--green-50); color: var(--green-900); font-weight: 600; font-size: 15px; }
.add-btn:hover:not(:disabled) { border-color: var(--green-600); }
.add-btn:disabled { border-color: var(--border-2); background: var(--bg-page); color: var(--muted); }
.note { font-size: 13px; color: var(--muted); }

.advanced { border-top: 1px solid var(--border); padding-top: 16px; }
.advanced > summary { cursor: pointer; font-size: 15px; font-weight: 600; color: var(--green-900); min-height: 44px; display: flex; align-items: center; }
.advanced__body { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }

.btn-calc { min-height: 52px; font-size: 17px; width: 100%; }
.form-error { font-size: 14px; color: var(--error); font-weight: 600; }
.form-error:empty { display: none; }

/* Combobox */
.combo { position: relative; }
.combo__list {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--border-2); border-radius: var(--radius); max-height: 320px; overflow-y: auto;
}
.combo__list[hidden] { display: none; }
.combo__option { padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.combo__option[aria-selected="true"], .combo__option:hover { background: var(--green-50); }
.combo__option[aria-selected="true"] { outline: 1px solid var(--green-600); }
.combo__code { font-weight: 600; font-size: 14px; }
.combo__name { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.combo__empty { padding: 8px 10px; font-size: 13px; color: var(--muted); }

/* ==========================================================================
   Calculator: result
   ========================================================================== */
.result { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.result-empty { padding: 40px 28px; text-align: center; color: var(--muted); border-style: dashed; border-color: var(--border-2); background: transparent; }

.total-card { padding: 28px; display: flex; flex-direction: column; gap: 6px; }
.total-card h2 { font-family: var(--font); }
.total-card h2:focus { outline: none; }
.total-card h2:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; }
.total-card__value { font-family: var(--font-display); font-size: 52px; font-weight: 700; color: var(--green-900); line-height: 1.1; overflow-wrap: anywhere; }
.total-card__meta { font-size: 16px; color: var(--muted); }
@media (max-width: 479.98px) { .total-card__value { font-size: 40px; } .total-card { padding: 22px 18px; } }

.year-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.year-card { flex: 1 1 240px; min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.year-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.year-card__title { font-weight: 700; font-size: 17px; }
.year-card p { font-size: 14px; line-height: 1.5; color: var(--muted); }
.year-card--exceeded { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-text); }
.year-card--exceeded p { color: var(--amber-text); }

.panel { padding: 24px 28px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 479.98px) { .panel { padding: 20px 16px; } }
.panel h2 { font-size: 19px; }

.table-wrap { overflow-x: auto; }
.ship-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.ship-table th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 6px; }
.ship-table td { padding: 10px 6px; border-top: 1px solid var(--row-line); vertical-align: top; }
.ship-table th:first-child, .ship-table td:first-child { padding-left: 0; }
.ship-table th:last-child, .ship-table td:last-child { padding-right: 0; }
.ship-table .num { text-align: right; white-space: nowrap; }
.ship-table .row-muted td { color: var(--muted); }
.ship-table .row-total td { border-top: 2px solid var(--green-100); font-weight: 700; color: var(--green-900); }
.ship-table .row-sub td { border-top: 0; padding-top: 0; font-size: 13px; color: var(--muted); text-align: right; }
.ship-table .cell-error { color: var(--amber-text); background: var(--amber-bg); font-size: 14px; }
.ship-table .row-year td { border-top: 0; padding-top: 16px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.breakdown { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px 16px; }
.breakdown > summary { cursor: pointer; font-weight: 600; font-size: 15px; min-height: 44px; display: flex; align-items: center; padding: 6px 0; }
.breakdown--muted > summary { color: var(--muted); }
.breakdown__body { display: flex; flex-direction: column; gap: 9px; margin: 8px 0 14px; font-size: 15px; }
.bk-line { display: flex; justify-content: space-between; gap: 16px; }
.bk-line > :first-child { color: var(--muted); }
.bk-line > :last-child { text-align: right; white-space: nowrap; }
.bk-line--strong { font-weight: 600; }
.bk-line--strong > :first-child { color: var(--text); }
.bk-line--cost { font-weight: 700; color: var(--green-900); border-top: 2px solid var(--green-100); padding-top: 10px; }
.bk-line--cost > :first-child { color: var(--green-900); }
.bk-text { color: var(--muted); }

.warning { display: flex; gap: 10px; align-items: flex-start; background: var(--amber-bg); border: 1px solid var(--amber-border); color: var(--amber-text); border-radius: var(--radius-md); padding: 14px 16px; font-size: 14px; line-height: 1.5; }
.warning svg { flex: none; color: var(--amber-icon); margin-top: 1px; }

.pdf-box { background: var(--green-50); border: 1px solid var(--green-200); border-radius: var(--radius-card); padding: 22px 24px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.pdf-box__copy { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.pdf-box__copy strong { color: var(--green-900); }
.pdf-box__copy span { font-size: 14px; color: var(--muted); }
.pdf-box .inline-form { flex: 1 1 300px; flex-wrap: nowrap; }
@media (max-width: 479.98px) { .pdf-box .inline-form { flex-wrap: wrap; } }

.notes { font-size: 13px; color: var(--muted); line-height: 1.6; display: flex; flex-direction: column; gap: 6px; }

/* ==========================================================================
   Phone tweaks
   ========================================================================== */
@media (max-width: 599.98px) {
  .hero__inner { padding-top: 48px; padding-bottom: 56px; gap: 32px; }
  .hero h1 { font-size: 38px; }
  .lead { font-size: 17px; }
  .section { padding-top: 56px; padding-bottom: 56px; gap: 28px; }
  .section-title, .data-band h2 { font-size: 28px; }
  .data-band__inner { padding-top: 56px; padding-bottom: 56px; gap: 28px; }
  .example-card { padding: 22px 18px; }
  .example-card__value { font-size: 36px; }
  .calc { padding-top: 32px; }
  .calc__head h1 { font-size: 30px; }
  .data-grid { grid-template-columns: minmax(0, 1fr); }
}
