.ep-tool { margin-top: 24px; }
.article .ep-tool h2 { margin-top: 0; }
.ep-page #calculator { scroll-margin-top: 88px; }
.ep-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ep-fields > div { min-width: 0; }
.ep-fields label { display: block; margin-bottom: 6px; font-weight: 600; }
.ep-fields input, .ep-fields select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.ep-help { font-size: 14px; line-height: 1.55; }
.ep-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.ep-actions button { min-height: 48px; white-space: normal; }
.ep-actions button:disabled { opacity: .5; cursor: not-allowed; }
.ep-message { color: #923d20; margin-top: 16px; }
.ep-message:empty { display: none; }
.ep-result { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.ep-tool [hidden] { display: none; }
.ep-result p, .ep-fields label, .ep-help { overflow-wrap: anywhere; }
.ep-checks { border: 0; margin: 18px 0 0; padding: 0; min-width: 0; }
.ep-checks legend { font-weight: 700; margin-bottom: 12px; }
.ep-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.ep-envelope { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 3px 6px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; cursor: pointer; min-width: 0; background: #fff; }
.ep-envelope input { width: 18px; height: 18px; margin: 0; accent-color: #286558; }
.ep-envelope:focus-within { outline: 2px solid #286558; outline-offset: 2px; }
.ep-number { font-size: 13px; }
.ep-amount, .ep-state { grid-column: 1 / -1; overflow-wrap: anywhere; }
.ep-amount { font-size: 14px; font-variant-numeric: tabular-nums; }
.ep-state { color: var(--ink-soft); font-size: 12px; }
.ep-envelope:has(input:checked) { background: #eaf4ee; border-color: #286558; }
.ep-print-title, .ep-print-empty { display: none; }
/* The working surface follows the site's paper and deep-teal palette. */
.ep-page .article { max-width: 960px; padding-top: 34px; }
.ep-intro { max-width: 720px; margin-bottom: 26px; }
.ep-page .ep-eyebrow { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 10px; }
.ep-page .ep-intro h1 { font-size: clamp(32px, 5vw, 48px); margin-bottom: 12px; }
.ep-page .ep-intro .lede { font-size: 17px; line-height: 1.5; margin: 0 0 10px; }
.ep-page .ep-intro-note { font-size: 12px; margin: 0; color: var(--ink-soft); }
.ep-tool { border-top: 3px solid var(--accent); background: #fffdf8; }
.ep-page #ep-title { font-size: 25px; margin-bottom: 22px; }
.ep-fields { gap: 12px 20px; }
.ep-fields label { font-size: 13px; }
.ep-fields input, .ep-fields select { min-height: 48px; background: #fffefa; border-color: #d8dace; font-variant-numeric: tabular-nums; }
.ep-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ep-presets > span { font-size: 12px; color: var(--ink-soft); margin-right: 4px; }
.ep-presets button, .ep-clear { font: inherit; font-size: 13px; min-height: 44px; cursor: pointer; }
.ep-presets button { border: 1px solid #d8dace; border-radius: 8px; background: transparent; color: var(--ink); padding: 8px 14px; }
.ep-presets button[aria-pressed="true"] { border-color: var(--accent); background: #e8f1eb; color: #164b47; box-shadow: inset 0 0 0 1px var(--accent); }
.ep-presets button:disabled, .ep-clear:disabled { opacity: .45; cursor: default; }
.ep-date-fields { margin-top: 20px; }
.ep-page #ep-unit-help, .ep-page #ep-window-help { margin: 7px 0 0; font-size: 12px; }
.ep-generate-row { align-items: center; margin-top: 22px; }
.ep-generate-row > span { font-size: 12px; }
.ep-generate-row .btn { min-width: 215px; justify-content: space-between; gap: 28px; }
.ep-details { margin-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.ep-details summary { cursor: pointer; min-height: 44px; padding: 12px 0; box-sizing: border-box; color: var(--ink-soft); }
.ep-details p { margin: 0 0 10px; line-height: 1.6; }
.ep-page .ep-result { padding-top: 28px; margin-top: 22px; }
.ep-page #ep-result-title { font-size: 28px; margin: 0 0 20px; scroll-margin-top: 88px; }
.ep-print-summary { display: none; }
.ep-metrics { display: grid; grid-template-columns: 1.3fr 1fr .8fr; margin: 0 0 14px; border: 1px solid #cdd8d0; border-radius: 12px; overflow: hidden; background: #f2f5ed; }
.ep-metrics > div { padding: 18px; min-width: 0; }
.ep-metrics > div + div { border-left: 1px solid #cdd8d0; }
.ep-metrics dt { font-size: 12px; color: #45615a; margin-bottom: 8px; }
.ep-metrics dd { margin: 0; font-size: clamp(18px, 2.4vw, 24px); font-weight: 650; letter-spacing: -.025em; line-height: 1.2; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ep-metric-total { background: #174b47; color: #fffdf4; }
.ep-metric-total dt { color: #d8e8df; }
.ep-page .ep-dates { font-size: 13px; line-height: 1.5; margin: 0 0 18px; }
.ep-page #ep-progress { font-size: 13px; margin: 6px 0 8px; }
.ep-page #ep-progress-meter { display: block; width: 100%; height: 7px; appearance: none; border: none; border-radius: 8px; overflow: hidden; background: #e5e9df; accent-color: var(--accent); }
.ep-page #ep-progress-meter::-webkit-progress-bar { background: #e5e9df; }
.ep-page #ep-progress-meter::-webkit-progress-value { background: var(--accent); border-radius: 8px; }
.ep-page #ep-progress-meter::-moz-progress-bar { background: var(--accent); }
.ep-result > .ep-help { font-size: 12px; margin: 8px 0; }
.ep-page #ep-handoff-note { max-width: 660px; line-height: 1.5; }
.ep-grid-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; }
.ep-grid-heading > span { font: 600 20px/1.2 var(--serif); }
.ep-clear { background: transparent; border: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; padding: 8px; flex-shrink: 0; }
.ep-checks { margin-top: 6px; }
.ep-checks legend { font-size: 12px; font-weight: 400; color: var(--ink-soft); margin-bottom: 10px; }
.ep-envelope { padding: 12px; gap: 5px 6px; min-height: 88px; box-sizing: border-box; background: #fffefa; border-color: #dbded4; transition: border-color .15s ease, background-color .15s ease; }
.ep-number { color: #587069; }
.ep-state { font-size: 11px; }
.ep-envelope:has(input:checked) { background: #e5efe6; border-color: #418074; box-shadow: inset 0 0 0 1px #418074; }
.ep-envelope:has(input:checked) .ep-state { color: #164b47; font-weight: 650; }
.ep-page :is(button, input, select, summary):focus-visible { outline: 3px solid #357d75; outline-offset: 3px; }
.ep-page #ep-result-title:focus-visible { outline: 2px solid #357d75; outline-offset: 5px; border-radius: 2px; }
.ep-page .ep-explainer { max-width: 760px; margin: 36px auto 0; }
@media (hover: hover) {
  .ep-presets button:not(:disabled):hover, .ep-envelope:hover { border-color: var(--accent); background: #f0f5ec; }
}
@media (prefers-reduced-motion: reduce) {
  .ep-page *, .ep-page *::before, .ep-page *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 640px) {
  .ep-page .article { padding-top: 24px; }
  .ep-intro { margin-bottom: 18px; }
  .ep-page .ep-intro .lede { font-size: 15px; }
  .ep-page #ep-title { font-size: 22px; margin-bottom: 16px; }
  .ep-tool { padding: 18px 14px; margin-top: 0; }
  .ep-fields { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 10px; }
  .ep-fields input, .ep-fields select { font-size: 16px; padding-inline: 8px; }
  .ep-date-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
  .ep-presets { gap: 6px; }
  .ep-presets button { padding-inline: 12px; }
  .ep-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ep-envelope { padding: 10px 8px; }
  .ep-amount { font-size: 13px; }
  .ep-actions button { flex: 1 1 100%; }
  .ep-generate-row > span { display: none; }
  .ep-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ep-metrics > div { padding: 13px; }
  .ep-metrics > .ep-metric-total { grid-column: 1 / -1; }
  .ep-metrics > div:nth-child(2) { border-left: 0; }
  .ep-metric-total dd { font-size: 30px; }
  .ep-grid-heading > span { font-size: 18px; }
}
@media (max-width: 380px) {
  .ep-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ep-presets > span { flex-basis: 100%; }
}
@media print {
  body.ep-page { background: #fff; color: #000; }
  .ep-page .site-head, .ep-page .site-foot, .ep-page .ep-intro, .ep-page .ep-explainer,
  .ep-page #ep-form, .ep-page .ep-actions, .ep-page .ep-message, .ep-page #ep-handoff-note,
  .ep-page .ep-tool > h2, .ep-page .ep-tool > .ep-help, .ep-page .ep-screen-only,
  .ep-page iframe, .ep-page ins.adsbygoogle { display: none !important; }
  .ep-page .article { width: 100%; max-width: none; padding: 0; }
  .ep-page .ep-tool { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .ep-page .ep-result { border: 0; margin: 0; padding: 0; }
  .ep-page .ep-print-summary { display: block; }
  .ep-page .ep-print-title { display: block; margin: 0 0 4pt; }
  .ep-page #ep-result-title { font-size: 16pt; line-height: 1.2; margin: 0 0 6pt; }
  .ep-page .ep-checks { margin-top: 8pt; }
  .ep-page .ep-checks legend { font-size: 10pt; line-height: 1.2; margin-bottom: 5pt; }
  .ep-page .ep-result[hidden] + .ep-print-empty { display: block; }
  .ep-page .ep-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .ep-page .ep-envelope { min-height: 0; box-shadow: none; transition: none; break-inside: avoid; border: 1px solid #777; border-radius: 0; padding: 4px; gap: 2px 6px; line-height: 1.2; background: #fff; }
  .ep-page .ep-number, .ep-page .ep-amount { font-size: 9pt; color: #000; }
  .ep-page .ep-state { font-size: 8pt; color: #000; }
  .ep-page .ep-envelope:has(input:checked) { background: #fff; border-color: #777; box-shadow: none; }
  .ep-page .ep-envelope:has(input:checked) .ep-state { color: #000; }
  .ep-page #ep-progress, .ep-page .ep-result p { font-size: 10pt; line-height: 1.25; margin: 0 0 5pt; }
}
