/* ==========================================================================
   PocketCalcs refreshed design ("v2")

   A page opts in with $design = 'v2' before the header include. That puts
   class="v2" on <body> and loads this file last, after base.css, the theme and
   the page's own styles.css, so the rules here restyle the shared parts of the
   page (header, form fields, buttons, results, guide, FAQ, footer) without the
   page's markup or script having to change.

   Everything is scoped to .v2, so pages that have not opted in are untouched.

   Building blocks a converted page can use:
     .page-kicker, .page-lede       section link and one-line summary around the h1
     .tool-layout / .tool-form      form beside the results on wide screens
     .field-box / .field-affix      a field with its unit inside ($, %, ft)
     select[data-segmented]         a short select shown as a toggle (v2.js)
     .field-presets                 quick-fill buttons under a field (v2.js)
     .result-hero                   the headline answer, on navy
     .result-card / .result-rows    supporting figures as label and value rows
     .split-bar / .split-legend     a two-part share bar
     .radio-toggle                  a pair or trio of radios shown as a toggle
     .field-row                     two or three fields side by side
     .result-unit                   the unit beside a headline figure
     .result-card-title / -note     a small heading and a footnote inside a result card
     .result-table                  a figures table inside a result card (wrap in .result-table-wrap)
     .result-tiles                  two to four secondary figures as tiles
     .note-card                     a short explanatory note as its own card
     .form-error                    a message block above the buttons
     .checkbox-row                  a checkbox with its label, as one 44px row
     .inset-block                   a quiet block for optional or dependent fields
     .form-section-title            a heading that divides a long form
     .diagram-frame                 the frame around a shape diagram
     .add-row-button / .icon-button add and remove buttons for repeated rows (rooms, areas)
     .result-badge                  a pill beside a result (add .is-quiet for the grey one)
     tr.is-current                  the highlighted row of a .result-table
   ========================================================================== */

body.v2 {
    /* Refresh tokens */
    --v2-navy: #003049;
    --v2-yellow: #fcbf49;
    --v2-page: #eef2f5;
    --v2-card: #ffffff;
    --v2-ink: #0b2433;
    --v2-heading: #003049;
    --v2-muted: #4d5f6b;
    --v2-line: #e1e8ed;
    --v2-field: #ffffff;
    --v2-field-border: #b9c5ce;
    --v2-track: #e6ecf0;
    --v2-chip: #d9e4eb;
    --v2-selected: #003049;
    --v2-selected-text: #ffffff;
    --v2-hero: #003049;
    --v2-hero-line: rgba(255, 255, 255, 0.16);
    --v2-hero-muted: #b7cbd6;
    --v2-hero-second: #3e7c9a;
    --v2-header: #003049;
    --v2-link: #00527a;
    --v2-focus: #003049;
    --v2-note-bg: #fff4d6;
    --v2-note-text: #5c4306;
    --v2-radius-card: 20px;
    --v2-radius-field: 14px;
    /* Headings and figures use the device's own font. To bring in a display face later, name it first here. */
    --v2-font-display: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --v2-arrow: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23003049' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    /* The base tokens, pointed at the refresh, so older rules that read them follow along */
    --color-primary: var(--v2-navy);
    --color-primary-hover: #00436a;
    --color-accent: var(--v2-yellow);
    --color-header-bg: var(--v2-header);
    --color-bg-body: var(--v2-page);
    --color-bg-card: var(--v2-card);
    --color-text-primary: var(--v2-ink);
    --color-text-secondary: var(--v2-muted);
    --color-text-muted: var(--v2-muted);
    --color-border: var(--v2-line);
    --color-input-bg: var(--v2-field);
    --color-results-from: var(--v2-card);
    --color-results-to: var(--v2-card);
    --color-results-border: var(--v2-line);
    --color-results-text: var(--v2-heading);
    --color-faq-from: var(--v2-card);
    --color-faq-to: var(--v2-card);
    --color-faq-border: var(--v2-line);
    --color-faq-heading: var(--v2-heading);
    --radius-sm: 12px;
    --radius-md: 20px;
    --shadow-md: none;

    background: var(--v2-page);
    color: var(--v2-ink);
}

@media (prefers-color-scheme: dark) {
    body.v2 {
        --v2-page: #06202e;
        --v2-card: #0d3044;
        --v2-ink: #f1f6f9;
        --v2-heading: #f1f6f9;
        --v2-muted: #a9becb;
        --v2-line: #1d4a63;
        --v2-field: #082636;
        --v2-field-border: #3a6b85;
        --v2-track: #082636;
        --v2-chip: #123d55;
        --v2-selected: #e8f1f6;
        --v2-selected-text: #003049;
        --v2-hero: #0f3b55;
        --v2-hero-second: #4c8dad;
        --v2-header: #021722;
        --v2-link: #8fd0f2;
        --v2-focus: #fcbf49;
        --v2-note-bg: #3a2f0f;
        --v2-note-text: #f7e3a6;
        --v2-arrow: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23f1f6f9' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        --color-primary: #8fd0f2;
        --color-primary-hover: #c4e6f8;
    }
}

.v2 .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.v2 a {
    color: var(--v2-link);
}

.v2 :focus-visible {
    outline: 2px solid var(--v2-focus);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.v2 .header {
    background: var(--v2-header);
    box-shadow: none;
}

.v2 .header-container {
    max-width: 1128px;
    padding: 0 24px;
}

.v2 .header-content {
    height: 64px;
    gap: 32px;
}

.v2 .logo-link {
    gap: 8px;
}

.v2 .logo-icon {
    width: 28px;
    height: 28px;
}

.v2 .logo-text {
    font-family: var(--v2-font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.v2 .site-nav {
    display: none;
    flex: 1 1 auto;
    gap: 24px;
}

.v2 .site-nav a {
    color: #c9dae3;
    font-size: 14px;
    font-weight: 500;
    line-height: 44px;
    text-decoration: none;
    white-space: nowrap;
}

.v2 .site-nav a:hover,
.v2 .site-nav a[aria-current] {
    color: var(--v2-yellow);
}

.v2 .header-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: -10px;
}

.v2 .header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    list-style: none;
}

.v2 .header-icon::-webkit-details-marker {
    display: none;
}

.v2 .header-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.v2 .header :focus-visible {
    outline-color: var(--v2-yellow);
}

.v2 .site-menu {
    position: relative;
}

.v2 .site-menu-panel {
    position: absolute;
    top: 52px;
    right: 0;
    z-index: 70;
    display: flex;
    flex-direction: column;
    width: 240px;
    padding: 8px;
    border: 1px solid var(--v2-line);
    border-radius: 16px;
    background: var(--v2-card);
    box-shadow: 0 12px 32px rgba(0, 20, 31, 0.25);
}

.v2 .site-menu-panel a {
    padding: 0 12px;
    border-radius: 10px;
    color: var(--v2-ink);
    font-size: 16px;
    font-weight: 500;
    line-height: 44px;
    text-decoration: none;
}

.v2 .site-menu-panel a:hover {
    background: var(--v2-track);
}

.v2 .site-menu-panel .site-menu-support {
    margin-top: 4px;
    border-top: 1px solid var(--v2-line);
    border-radius: 0 0 10px 10px;
    color: var(--v2-muted);
}

@media (min-width: 900px) {
    .v2 .site-nav {
        display: flex;
    }
}

@media (max-width: 640px) {
    .v2 .header-container {
        padding: 0 16px;
    }

    .v2 .header-content {
        height: 56px;
    }

    .v2 .logo-icon {
        width: 24px;
        height: 24px;
    }

    .v2 .logo-text {
        font-size: 18px;
    }
}

/* --------------------------------------------------------------------------
   Page frame and heading
   -------------------------------------------------------------------------- */
.v2 .container {
    max-width: 640px;
    padding: 0 16px;
}

.v2 .calculator-wrapper {
    margin-top: 20px;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.v2 h1,
.v2 h2,
.v2 h3 {
    font-family: var(--v2-font-display);
    color: var(--v2-heading);
}

.v2 .calculator-wrapper h1 {
    margin: 0 0 6px;
    padding: 0;
    border-radius: 0;
    background: none;
    font-size: 28px;
    font-weight: 700;
    line-height: 34px;
    letter-spacing: -0.6px;
    text-align: left;
}

.v2 .page-kicker {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--v2-chip);
    color: var(--v2-heading);
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    text-decoration: none;
}

.v2 .page-kicker:hover {
    text-decoration: underline;
}

.v2 .page-lede {
    margin: 0 0 16px;
    color: var(--v2-muted);
    font-size: 15px;
    line-height: 22px;
}

/* --------------------------------------------------------------------------
   Form card and fields
   -------------------------------------------------------------------------- */
.v2 .tool-form,
.v2 .tool-card {
    padding: 20px;
    border-radius: var(--v2-radius-card);
    background: var(--v2-card);
}

.v2 .form-group {
    margin-bottom: 16px;
}

.v2 .form-group label,
.v2 .form-label {
    margin-bottom: 6px;
    color: var(--v2-heading);
    font-size: 14px;
    font-weight: 600;
}

.v2 .form-input,
.v2 .input-control {
    min-height: 52px;
    padding: 0 14px;
    border: 1.5px solid var(--v2-field-border);
    border-radius: var(--v2-radius-field);
    background-color: var(--v2-field);
    color: var(--v2-ink);
    font-size: 17px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.v2 .form-input::placeholder,
.v2 .input-control::placeholder {
    color: var(--v2-muted);
    font-weight: 400;
    opacity: 0.75;
}

.v2 textarea.form-input,
.v2 textarea.input-control,
.v2 .form-textarea {
    padding: 12px 14px;
}

.v2 .form-input:hover,
.v2 .input-control:hover {
    border-color: var(--v2-focus);
    box-shadow: none;
}

.v2 .form-input:focus,
.v2 .input-control:focus {
    border-color: var(--v2-focus);
    box-shadow: 0 0 0 3px rgba(252, 191, 73, 0.55);
    outline: none;
}

.v2 select.form-input,
.v2 select.input-control {
    padding-right: 40px;
    background: var(--v2-field) var(--v2-arrow) no-repeat right 14px center;
}

.v2 .input-control.error,
.v2 .form-input.error {
    border-color: var(--color-error);
}

.v2 .input-container {
    flex-direction: row;
    gap: 8px;
}

.v2 .input-container > .input-control,
.v2 .input-container > .field-box {
    flex: 1 1 0;
    min-width: 0;
}

/* A select beside a typed field is only as wide as it needs; selects on their own share the row */
.v2 .input-container > .input-control:not(select) ~ select.input-control,
.v2 .input-container > .field-box ~ select.input-control {
    flex: 0 1 auto;
    width: auto;
    min-width: 96px;
}

/* A field with its unit inside: <div class="field-box"><span class="field-affix">$</span><input class="input-control"></div> */
.v2 .field-box {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 52px;
    padding: 0 14px;
    border: 1.5px solid var(--v2-field-border);
    border-radius: var(--v2-radius-field);
    background: var(--v2-field);
}

.v2 .field-box:hover {
    border-color: var(--v2-focus);
}

.v2 .field-box:focus-within {
    border-color: var(--v2-focus);
    box-shadow: 0 0 0 3px rgba(252, 191, 73, 0.55);
}

.v2 .field-box:has(.error) {
    border-color: var(--color-error);
}

.v2 .field-box .input-control,
.v2 .field-box .form-input {
    flex: 1 1 0;
    min-width: 0;
    min-height: 49px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.v2 .field-affix {
    flex: none;
    color: var(--v2-muted);
    font-size: 17px;
}

.v2 .field-hint {
    margin: 6px 0 0;
    color: var(--v2-muted);
    font-size: 13px;
}

.v2 .error-message {
    margin-top: 6px;
    font-size: 14px;
}

.v2 input[type="checkbox"],
.v2 input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--v2-selected);
}

/* A short select shown as a toggle. v2.js builds the buttons and keeps the select in step. */
.v2 .segmented {
    display: flex;
    flex: none;
    gap: 4px;
    min-height: 52px;
    padding: 4px;
    border-radius: var(--v2-radius-field);
    background: var(--v2-track);
}

.v2 .segmented.segmented-wide {
    flex: 1 1 auto;
}

.v2 .segmented button {
    flex: 1 1 0;
    min-width: 48px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--v2-heading);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.v2 .segmented button[aria-pressed="true"] {
    background: var(--v2-selected);
    color: var(--v2-selected-text);
    font-weight: 600;
}

/* Quick-fill buttons under a field */
.v2 .field-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.v2 .field-presets button {
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--v2-track);
    color: var(--v2-heading);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.v2 .field-presets button[aria-pressed="true"] {
    background: var(--v2-selected);
    color: var(--v2-selected-text);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.v2 .btn-primary,
.v2 .calculate-button,
.v2 .calculator-form .submit-button {
    min-height: 54px;
    padding: 0 24px;
    border: 0;
    border-radius: var(--v2-radius-field);
    background: var(--v2-yellow);
    color: #003049;
    font-family: var(--v2-font-display);
    font-size: 18px;
    font-weight: 700;
}

.v2 .btn-primary:hover,
.v2 .calculate-button:hover,
.v2 .calculator-form .submit-button:hover {
    background: #ffd166;
    box-shadow: none;
    transform: none;
}

.v2 .btn-secondary,
.v2 .reset-button,
.v2 .secondary-button,
.v2 .share-trigger-btn {
    min-height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--v2-field-border);
    border-radius: var(--v2-radius-field);
    background: transparent;
    color: var(--v2-heading);
    font-size: 15px;
    font-weight: 600;
}

.v2 .btn-secondary:hover,
.v2 .reset-button:hover,
.v2 .secondary-button:hover,
.v2 .share-trigger-btn:hover {
    border-color: var(--v2-focus);
    background: var(--v2-track);
    color: var(--v2-heading);
}

/* Calculate on its own row, the quieter buttons side by side under it */
.v2 .button-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
}

.v2 .button-group > .btn-primary,
.v2 .button-group > .calculate-button,
.v2 .button-group > .submit-button,
.v2 .button-group > :only-child,
.v2 .button-group > :is(.btn-primary, .calculate-button, .submit-button) ~ :last-child:nth-child(even) {
    grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   Results
   -------------------------------------------------------------------------- */
.v2 .results {
    margin-top: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
}

.v2 .results.result-card,
.v2 .result-card {
    margin-top: 12px;
    padding: 20px;
    border: 0;
    border-radius: var(--v2-radius-card);
    background: var(--v2-card);
}

.v2 .results-title {
    padding-bottom: 0;
    border-bottom: 0;
    font-family: var(--v2-font-display);
    font-size: 18px;
    font-weight: 700;
}

.v2 .results-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.v2 .result-hero {
    padding: 24px 20px 20px;
    border-radius: var(--v2-radius-card);
    background: var(--v2-hero);
    color: #ffffff;
}

.v2 .result-label {
    margin: 0;
    color: var(--v2-hero-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
}

.v2 .result-value {
    color: var(--v2-yellow);
    font-family: var(--v2-font-display);
    font-size: 46px;
    font-weight: 700;
    line-height: 54px;
    letter-spacing: -1.4px;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* The base stylesheet sets the font on every element, so nested spans are told to inherit */
.v2 .result-value * {
    font-family: inherit;
}

.v2 .result-value.result-value-second {
    color: #ffffff;
    font-size: 32px;
    line-height: 40px;
    letter-spacing: -0.8px;
}

.v2 .result-sub {
    color: var(--v2-hero-muted);
    font-size: 14px;
}

.v2 .result-hero-part + .result-hero-part {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--v2-hero-line);
}

.v2 .result-hero-rows {
    margin-top: 12px;
}

.v2 .result-hero-rows > * {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
    color: var(--v2-hero-muted);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* A two-part share bar. The first part is the yellow one. */
.v2 .split-bar {
    display: flex;
    gap: 3px;
    height: 12px;
    margin-top: 20px;
}

.v2 .split-bar > * {
    min-width: 6px;
    border-radius: 6px;
    background: var(--v2-hero-second);
}

.v2 .split-bar > :first-child {
    background: var(--v2-yellow);
}

.v2 .split-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 16px;
    margin-top: 10px;
    color: var(--v2-hero-muted);
    font-size: 13px;
}

.v2 .split-legend > * {
    display: flex;
    align-items: center;
    gap: 6px;
}

.v2 .split-legend > *::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: var(--v2-hero-second);
}

.v2 .split-legend > :first-child::before {
    background: var(--v2-yellow);
}

/* Label and value rows */
.v2 .result-rows {
    padding-top: 4px;
    padding-bottom: 4px;
}

.v2 .result-rows > * {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 16px;
    margin: 0;
    padding: 13px 0;
    font-size: 15px;
}

.v2 .result-rows > * + * {
    border-top: 1px solid var(--v2-line);
}

.v2 .result-rows > * > :first-child {
    color: var(--v2-muted);
}

.v2 .result-rows > * > :last-child {
    color: var(--v2-heading);
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.v2 .result-note {
    margin: 12px 4px 0;
    color: var(--v2-muted);
    font-size: 14px;
    line-height: 1.5;
}

.v2 .results-flash {
    border-radius: var(--v2-radius-card);
}

.v2 .pc-chart {
    margin-top: 12px;
    padding: 16px;
    border: 0;
    border-radius: var(--v2-radius-card);
}

.v2 .pc-result-bar {
    border-top-color: var(--v2-yellow);
    background: var(--v2-navy);
}

@media (prefers-color-scheme: dark) {
    .v2 .pc-chart {
        --chart-1: #6fb1ff;
        --chart-2: #ff9a6b;
        --chart-3: #4fd3a0;
        --chart-4: #fcbf49;
    }

    .v2 .pc-chart-grid {
        stroke: #1d4a63;
    }

    .v2 .pc-chart-axis,
    .v2 .pc-chart-cross {
        stroke: #6f93a8;
    }
}

/* --------------------------------------------------------------------------
   Guide, FAQ, related links, notes
   -------------------------------------------------------------------------- */
.v2 .guide-section,
.v2 .related-tools,
.v2 .faq-section {
    margin-top: 16px;
    padding: 20px;
    border-radius: var(--v2-radius-card);
    background: var(--v2-card);
    box-shadow: none;
}

.v2 .guide-section h2,
.v2 .related-tools h2,
.v2 .faq-section h2 {
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: 700;
    line-height: 28px;
    letter-spacing: -0.3px;
    text-align: left;
}

.v2 .guide-section h3 {
    margin: 20px 0 8px;
    font-size: 17px;
}

.v2 .guide-section p,
.v2 .guide-section li {
    font-size: 16px;
    line-height: 1.65;
}

.v2 .guide-table th,
.v2 .guide-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--v2-line);
    font-size: 15px;
    white-space: nowrap;
}

.v2 .guide-table th {
    color: var(--v2-muted);
    font-size: 13px;
    font-weight: 600;
}

.v2 .faq-list {
    gap: 0;
}

.v2 .faq-item {
    border: 0;
    border-top: 1px solid var(--v2-line);
    border-radius: 0;
    background: none;
}

.v2 .faq-question {
    min-height: 52px;
    padding: 14px 0;
    font-size: 16px;
}

.v2 .faq-question:hover {
    background: none;
    color: var(--v2-link);
}

.v2 .faq-answer {
    padding: 0 0 16px;
    font-size: 15px;
}

.v2 .related-tools ul {
    gap: 8px;
}

.v2 .related-tools a {
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--v2-track);
    color: var(--v2-heading);
    font-size: 15px;
    font-weight: 500;
}

.v2 .related-tools a:hover,
.v2 .related-tools a:focus-visible {
    background: var(--v2-chip);
    text-decoration: none;
}

.v2 .safety-note {
    margin-top: 16px;
    padding: 14px 16px;
    border: 0;
    border-radius: 16px;
    background: var(--v2-note-bg);
    color: var(--v2-note-text);
    font-size: 14px;
}

.v2 .pc-inline-alert {
    border: 0;
    background: var(--v2-note-bg);
    color: var(--v2-note-text);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.v2 .footer {
    margin-top: 40px;
    background: var(--v2-header);
}

.v2 .footer a {
    color: rgba(255, 255, 255, 0.8);
}

.v2 .footer-wordmark {
    font-family: var(--v2-font-display);
}

/* --------------------------------------------------------------------------
   Wide screens: the form beside the results
   -------------------------------------------------------------------------- */
@media (min-width: 1000px) {
    .v2 .container {
        max-width: 1128px;
        padding: 0 24px;
    }

    .v2 .calculator-wrapper {
        margin-top: 36px;
    }

    .v2 .calculator-wrapper h1 {
        font-size: 40px;
        line-height: 46px;
        letter-spacing: -1.1px;
    }

    .v2 .page-lede {
        margin-bottom: 24px;
        font-size: 17px;
        line-height: 26px;
    }

    .v2 .tool-form {
        padding: 28px;
    }

    .v2 .tool-layout {
        display: grid;
        grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
        column-gap: 20px;
        align-items: start;
    }

    .v2 .tool-layout > .tool-form {
        grid-column: 1;
        grid-row: 1 / span 40;
    }

    .v2 .tool-layout > :not(.tool-form) {
        grid-column: 2;
    }

    .v2 .tool-layout > .results:first-of-type,
    .v2 .tool-layout > .tool-form + * {
        margin-top: 0;
    }

    /* Until there is an answer, the results column says where it will appear */
    .v2 .tool-layout::after {
        content: "Your result will show here.";
        grid-column: 2;
        grid-row: 1;
        padding: 48px 28px;
        border: 1.5px dashed var(--v2-field-border);
        border-radius: var(--v2-radius-card);
        color: var(--v2-muted);
        font-size: 16px;
        text-align: center;
    }

    .v2 .tool-layout:has(> .results:not(.hidden))::after,
    .v2 .tool-layout.has-result::after {
        display: none;
    }

    .v2 .result-hero {
        padding: 32px;
    }

    .v2 .result-value {
        font-size: 64px;
        line-height: 72px;
        letter-spacing: -2.2px;
    }

    .v2 .result-value.result-value-second {
        font-size: 36px;
        line-height: 44px;
    }

    .v2 .results.result-card,
    .v2 .result-card {
        padding: 24px 28px;
    }

    .v2 .guide-section,
    .v2 .related-tools,
    .v2 .faq-section,
    .v2 .safety-note {
        max-width: 760px;
        margin-left: auto;
        margin-right: auto;
    }

    .v2 .guide-section,
    .v2 .related-tools,
    .v2 .faq-section {
        padding: 28px 32px;
    }
}

/* --------------------------------------------------------------------------
   More building blocks, shared by converted pages
   -------------------------------------------------------------------------- */

/* Radios shown as a toggle:
   <div class="radio-toggle"><label><input type="radio" name="unit" checked><span>Metric</span></label>...</div> */
.v2 .radio-toggle {
    display: flex;
    gap: 4px;
    min-height: 52px;
    padding: 4px;
    border-radius: var(--v2-radius-field);
    background: var(--v2-track);
}

.v2 .radio-toggle label {
    position: relative;
    display: flex;
    flex: 1 1 0;
    margin: 0;
    cursor: pointer;
}

.v2 .radio-toggle input[type="radio"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.v2 .radio-toggle span {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 10px;
    color: var(--v2-heading);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

.v2 .radio-toggle input:checked + span {
    background: var(--v2-selected);
    color: var(--v2-selected-text);
    font-weight: 600;
}

.v2 .radio-toggle input:focus-visible + span {
    outline: 2px solid var(--v2-focus);
    outline-offset: 2px;
}

/* Fields side by side. Each child is a .form-group. */
.v2 .field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0 12px;
}

.v2 .result-value .result-unit {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
}

.v2 .result-card-title {
    margin: 0 0 4px;
    color: var(--v2-heading);
    font-family: var(--v2-font-display);
    font-size: 16px;
    font-weight: 700;
}

.v2 .result-card-note {
    margin: 8px 0 0;
    color: var(--v2-muted);
    font-size: 13px;
    line-height: 1.5;
}

.v2 .result-table-wrap {
    overflow-x: auto;
}

.v2 .result-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.v2 .result-table th,
.v2 .result-table td {
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--v2-line);
    background: none;
    color: var(--v2-ink);
    font-size: 15px;
    text-align: right;
    white-space: nowrap;
}

.v2 .result-table th {
    color: var(--v2-muted);
    font-size: 13px;
    font-weight: 600;
}

.v2 .result-table th:first-child,
.v2 .result-table td:first-child {
    padding-left: 0;
    text-align: left;
}

.v2 .result-table th:last-child,
.v2 .result-table td:last-child {
    padding-right: 0;
}

.v2 .result-table tbody tr:last-child td {
    border-bottom: 0;
}

.v2 .result-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.v2 .result-tiles > * {
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--v2-card);
}

.v2 .result-tile-label {
    display: block;
    color: var(--v2-muted);
    font-size: 13px;
}

.v2 .result-tile-value {
    display: block;
    color: var(--v2-heading);
    font-family: var(--v2-font-display);
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.v2 .note-card {
    margin-top: 12px;
    padding: 16px 20px;
    border-radius: var(--v2-radius-card);
    background: var(--v2-card);
    color: var(--v2-ink);
    font-size: 15px;
    line-height: 1.55;
}

.v2 .form-error {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--color-error-light);
    color: var(--v2-ink);
    font-size: 15px;
    font-weight: 500;
}

/* A checkbox with its label: <label class="checkbox-row"><input type="checkbox"> Add fees</label> */
.v2 .checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 4px 0 12px;
    color: var(--v2-heading);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.v2 .inset-block {
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 16px;
    background: var(--v2-page);
}

.v2 .inset-block > :last-child,
.v2 .inset-block .form-group:last-child {
    margin-bottom: 0;
}

.v2 .form-section-title {
    margin: 20px 0 12px;
    padding-top: 16px;
    border-top: 1px solid var(--v2-line);
    color: var(--v2-heading);
    font-family: var(--v2-font-display);
    font-size: 16px;
    font-weight: 700;
}

.v2 .form-section-title:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.v2 .diagram-frame {
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 16px;
    background: var(--v2-page);
    text-align: center;
}

.v2 .diagram-frame svg {
    max-width: 100%;
    height: auto;
    overflow: visible;
}

.v2 .add-row-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    border: 1.5px dashed var(--v2-field-border);
    border-radius: var(--v2-radius-field);
    background: transparent;
    color: var(--v2-heading);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.v2 .add-row-button:hover {
    border-color: var(--v2-focus);
    background: var(--v2-track);
}

.v2 .icon-button {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--v2-muted);
    cursor: pointer;
}

.v2 .icon-button:hover {
    background: var(--v2-track);
    color: var(--v2-heading);
}

.v2 .result-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--v2-yellow);
    color: #003049;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    white-space: nowrap;
}

.v2 .result-badge.is-quiet {
    background: var(--v2-chip);
    color: var(--v2-heading);
}

.v2 .result-table tr.is-current td {
    color: var(--v2-heading);
    font-weight: 700;
}

.v2 .result-hero .result-label,
.v2 .result-hero .result-value,
.v2 .result-hero .result-sub {
    display: block;
}

.v2 .result-note.note-card {
    margin: 12px 0 0;
}

.v2 .field-box:has(.invalid),
.v2 .form-input.invalid,
.v2 .input-control.invalid {
    border-color: var(--color-error);
}

.v2 .form-message-error {
    border: 0;
    background: var(--color-error-light);
    color: var(--v2-ink);
}

@media (prefers-color-scheme: dark) {
    body.v2 {
        --color-error: #ff8a80;
        --color-error-light: rgba(255, 138, 128, 0.16);
    }
}

/* --------------------------------------------------------------------------
   Section (hub) pages
   -------------------------------------------------------------------------- */
.v2 .main-content {
    padding: 24px 0 0;
}

.v2 .container.interior-container {
    max-width: 808px;
}

.v2 .page-title {
    margin-bottom: 8px;
    color: var(--v2-heading);
    font-size: 30px;
    line-height: 36px;
    letter-spacing: -0.7px;
}

.v2 .page-description {
    margin-bottom: 8px;
    color: var(--v2-muted);
    font-size: 16px;
    line-height: 1.6;
}

.v2 .interior-container .guide-section,
.v2 .interior-container .safety-note {
    max-width: none;
}

.v2 .hub-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.v2 .hub-tools li {
    position: relative;
    margin: 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--v2-page);
}

.v2 .hub-tools li:hover {
    box-shadow: inset 0 0 0 1.5px var(--v2-focus);
}

.v2 .hub-tools a {
    display: block;
    color: var(--v2-heading);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

/* The whole tile is the link */
.v2 .hub-tools a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
}

.v2 .hub-tool-desc {
    display: block;
    margin-top: 2px;
    color: var(--v2-muted);
    font-size: 14px;
    line-height: 20px;
}

@media (min-width: 640px) {
    .v2 .hub-tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v2 .page-title {
        font-size: 40px;
        line-height: 46px;
        letter-spacing: -1.1px;
    }
}

@media print {
    body.v2 {
        --v2-page: #ffffff;
    }

    .v2 .header-actions,
    .v2 .site-nav {
        display: none;
    }
}

/* The base stylesheet lays .input-group out as a row (a field and its unit). Where a page uses the
   same class on a whole field with its label, the label goes back above the field. */
.v2 .form-group.input-group {
    display: block;
}
