/* Small planning tools share the site's type and color tokens. */
.tool-shell { max-width: 1240px; }
.tool-heading { padding: 30px 0 24px; max-width: 850px; }
.tool-heading h1 { font-size: clamp(1.8rem, 3.5vw, 2.55rem); letter-spacing: -.045em; }
.tool-heading .intro { max-width: 720px; font-size: 1.0625rem; }
.tool-kicker { font-size: .8125rem; color: var(--muted); margin-bottom: 10px; }
.tool-kicker a { color: var(--muted); }
.tool-workspace { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(310px, .87fr); align-items: start; gap: 28px; }
.tool-form { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 24px; }
.tool-form fieldset { margin: 0 0 24px; padding: 0; border: 0; }
.tool-form fieldset:last-of-type { margin-bottom: 12px; }
.tool-form legend { display: block; width: 100%; border-bottom: 1px solid var(--line); padding: 0 0 12px; margin: 0 0 18px; font-size: 1rem; font-weight: 650; }
.tool-form legend span { color: var(--blue); margin-right: 10px; font-size: .875rem; }
.tool-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tool-field { min-width: 0; }
.tool-field.full { grid-column: 1 / -1; }
.tool-field label { display: block; font-size: .875rem; line-height: 1.4; font-weight: 600; margin-bottom: 7px; }
.tool-label { display: flex; align-items: baseline; gap: 6px; }
.tool-label label { flex: 1; }
.tool-help { border: 1px solid #a5b5c0; border-radius: 50%; width: 15px; height: 15px; min-width: 15px; padding: 0; font-size: 11px; line-height: 13px; font-weight: 600; color: var(--muted); background: transparent; position: relative; margin-right: 5px; }
.tool-help::after { content: ''; position: absolute; inset: -6px; }
.tool-help[aria-expanded="true"] { color: #145d43; border-color: #145d43; }
.tool-help-note { margin: 9px 0 0; padding: 10px 12px; background: #eaf5ef; border: 1px solid #cfe6da; border-radius: 6px; font-size: .875rem; color: #254e3e; }
.tool-input { display: flex; align-items: center; background: #fff; border: 1px solid #b8c7d3; border-radius: 6px; overflow: hidden; min-height: 46px; }
.tool-input input { width: 100%; min-width: 0; border: 0; background: transparent; padding: 10px 12px; color: var(--ink); font-size: 1rem; outline-offset: -3px; }
.tool-input span { flex: 0 0 auto; color: var(--muted); padding: 0 12px 0 0; font-size: .875rem; }
.tool-field select { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #b8c7d3; background: #fff; border-radius: 6px; color: var(--ink); padding: 10px; font-size: .9375rem; }
.tool-input:focus-within { outline: 2px solid #72b7e9; outline-offset: 1px; }
.tool-input input:focus { outline: none; }
.tool-input:has([aria-invalid="true"]) { border-color: var(--negative); }
.tool-error { display: block; color: var(--negative); font-size: .8125rem; margin-top: 5px; }
.field-hint { margin: 6px 0 0; font-size: .875rem; line-height: 1.45; color: var(--muted); }
.tool-form-note { font-size: .875rem; color: var(--muted); margin-bottom: 18px; }
.tool-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.tool-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--blue); border-radius: 6px; padding: 11px 18px; background: var(--blue); color: #fff; font-size: .9375rem; font-weight: 600; text-decoration: none; min-height: 46px; }
.tool-button:hover { background: #104b7a; color: #fff; }
.tool-button.secondary { color: var(--blue); background: #fff; }
.tool-link-button { border: 0; background: transparent; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; font-size: .875rem; }
.tool-results { position: sticky; top: 24px; min-width: 0; }
.tool-summary { background: #edf5fa; border: 1px solid #cfe0ee; border-radius: 12px; padding: 24px; }
.tool-summary .metric-label { font-size: .875rem; color: var(--muted); font-weight: 500; margin: 0; }
.tool-summary .metric-main { font-size: clamp(2rem, 4vw, 3.05rem); font-weight: 650; letter-spacing: -.055em; line-height: 1.1; margin: 7px 0 10px; font-variant-numeric: tabular-nums; }
.tool-summary .metric-unit { font-size: .875rem; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.tool-summary .result-explanation { font-size: .9375rem; margin-top: 10px; }
.tool-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid #cfdfeb; margin-top: 20px; padding-top: 18px; }
.tool-metrics strong { display: block; margin-top: 3px; font-size: 1.35rem; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tool-metrics small { display: block; font-size: .8125rem; color: var(--muted); margin-top: 3px; }
.tool-breakdown { padding: 20px 0 0; }
.tool-breakdown h2 { font-size: 1rem; margin-bottom: 12px; }
.tool-breakdown dl { margin: 0; }
.tool-breakdown dl > div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 9px 0; font-size: .875rem; }
.tool-breakdown dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.tool-breakdown dt { color: var(--muted); }
.tool-breakdown .is-subtotal { border-top: 1px solid #b8c7d3; font-weight: 600; }
.tool-breakdown .is-subtotal dt { color: var(--ink); }
.tool-note { font-size: .875rem; line-height: 1.55; color: var(--muted); margin-top: 12px; }
.tool-warning { background: #fff6e8; color: #744600; border: 1px solid #efd7ae; border-radius: 6px; padding: 12px 14px; font-size: .9375rem; margin-top: 16px; }
.tool-issue { background: #fff1f2; border: 1px solid #efcbd0; padding: 18px; border-radius: 8px; color: var(--negative); }
.tool-cta { margin-top: 20px; border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.tool-cta p { margin: 8px 0 14px; color: var(--muted); font-size: .9375rem; }
.tool-next { font-size: .8125rem; color: var(--muted); margin-top: 9px; }
.tool-cta .tool-handoff { font-size: .875rem; margin: 12px 0 0; }
.tool-cta .tool-next { font-size: .8125rem; margin: 9px 0 0; }
.tool-summary { scroll-margin-top: 18px; }
.tool-summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.tool-content { margin: 42px 0 56px; display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(310px, .87fr); gap: 28px; }
.tool-content section { min-width: 0; }
.tool-content h2 { font-size: 1.2rem; margin: 0 0 14px; letter-spacing: -.025em; }
.tool-content h3 { font-size: 1rem; margin: 20px 0 8px; }
.tool-content p { margin: 0 0 14px; color: var(--muted); font-size: .9375rem; line-height: 1.7; }
.tool-content .formula { padding: 16px; border-left: 3px solid var(--blue); background: var(--surface); color: var(--ink); font-family: ui-monospace, SFMono-Regular, monospace; font-size: .875rem; overflow-wrap: anywhere; }
.tool-content details { border-top: 1px solid var(--line); padding: 15px 0; }
.tool-content details:last-child { border-bottom: 1px solid var(--line); }
.tool-content summary { cursor: pointer; font-size: .9375rem; font-weight: 600; padding-right: 8px; }
.tool-content details p { margin: 10px 0 0; }
.tool-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; margin: 14px 0; }
.tool-table { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
.tool-table caption { text-align: left; font-size: .875rem; padding: 12px; color: var(--muted); background: var(--surface); }
.tool-table th, .tool-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tool-table th { font-weight: 600; background: var(--surface); }
.tool-table th:first-child, .tool-table td:first-child { text-align: left; }
.tool-table tr:last-child td { border-bottom: 0; }
.tool-table tr.is-current td { background: #edf5fa; font-weight: 600; }
.tool-related { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 20px 0; border-top: 1px solid var(--line); font-size: .875rem; }
.tool-footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: .8125rem; }
.tool-footer .shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
.component { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 15px; margin-bottom: 12px; }
.component-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.component-head input { min-width: 0; width: 100%; padding: 7px 0; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.component-head button { color: var(--muted); background: none; border: 0; padding: 6px; font-size: .8125rem; text-decoration: underline; }
.component .tool-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.component .tool-field label { font-size: .8125rem; font-weight: 500; }
.component-result { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: .875rem; color: var(--muted); }
.component-result strong { color: var(--ink); font-weight: 600; }
.component input { font-size: .9375rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (max-width: 880px) {
  .tool-workspace, .tool-content { grid-template-columns: minmax(0, 1fr); }
  .tool-results, #tool-result-content { display: contents; }
  .tool-summary, .tool-issue { grid-row: 1; }
  .tool-form { grid-row: 2; }
  .tool-content { margin-top: 32px; }
}
@media (max-width: 560px) {
  .tool-shell { padding: 0 18px; }
  .tool-form, .tool-summary { padding: 18px; }
  .tool-fields { gap: 16px 12px; }
  .tool-heading { padding-top: 24px; }
  .tool-cta { padding: 18px; }
  .component .tool-fields { grid-template-columns: 1fr 1fr; }
  .component .tool-fields .tool-field:last-child { grid-column: 1 / -1; }
  .tool-metrics { gap: 12px; }
}
@media (max-width: 360px) { .tool-fields { grid-template-columns: 1fr; } }
/* Optional extra units stay out of the duplex form until needed. */
.strategy-extra { margin: 0 0 24px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.strategy-extra summary { cursor: pointer; font-size: .875rem; font-weight: 600; }
.strategy-extra[open] summary { margin-bottom: 18px; }
.tool-table tbody th { background: transparent; font-weight: 400; }
.tool-table tr.is-current th { background: #edf5fa; font-weight: 600; }
