/* ==========================================================================
   Generator Sizing Calculator
   ========================================================================== */

/* Hide the site-wide feedback tab + contact pulse on this page on mobile
   only. They sit on `position: fixed` over the right edge / bottom-right
   corner, and on phones they overlap the calculator's edge-to-edge cards
   and the Calculate button. Desktop keeps both widgets — there's room
   for them and the calculator's own contact CTAs at the same time. */
@media (max-width: 768px) {
    body.page-template-page-generator-calculator .feedback-widget,
    body.page-template-page-generator-calculator #contact-buttons-container {
        display: none !important;
    }
}

/* Square corners across the entire calculator — page chrome, the form, the
   result card, the alternates, the PDF modal, and the dynamically-appended
   tutorial overlay/highlight/popup (which mount on <body>, outside .gencalc-page).
   Single override so individual rules below don't need to drop border-radius
   one by one. */
.gencalc-page,
.gencalc-page *,
.gencalc-page *::before,
.gencalc-page *::after,
.gencalc-tut-overlay,
.gencalc-tut-overlay *,
.gencalc-tut-highlight,
.gencalc-tut-highlight *,
.gencalc-tut-popup,
.gencalc-tut-popup * {
    border-radius: 0 !important;
}

.gencalc-page {
    background: #f7f8fa;
    color: #1a1a1a;
    min-height: 60vh;
}

.gencalc-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ── Hero — PowerMatch lockup ────────────────────────────────────────────────
   A single centred lockup that binds the brand to the tool so the relationship
   reads as one name: PowerMatch™ (the product, in ink) — Generator Sizing
   Calculator (what it is, in quiet grey), joined by one orange dash. The dash
   and the ™ are the entire orange budget. The keyword phrase stays inside the
   H1 for SEO; the dash is aria-hidden so it reads cleanly to assistive tech. */
.gencalc-pagehero {
    padding: 50px 0;
    text-align: center;
    background: #ffffff;
    border-bottom: 1px solid #e7e9ee;
}

/* Power Desk breadcrumb — slim left-aligned bar below the hero, matching
   the PowerConvert page so the two tools read as one suite. */
.gencalc-breadcrumb {
    background: #ffffff;
    border-bottom: 1px solid #eef0f3;
}
.gencalc-breadcrumb .gencalc-container {
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 12.5px;
    color: #9aa1ab;
}
.gencalc-breadcrumb a { color: #9aa1ab; text-decoration: none; }
.gencalc-breadcrumb a:hover { color: #E08F2C; }
.gencalc-breadcrumb .sep { color: #cfd4da; margin: 0 7px; }
.gencalc-breadcrumb .cur { color: #555; }

.gencalc-lockup {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0 16px;
    margin: 0;
    font-family: 'JCBEuro BoldCondensed Regular', Arial, sans-serif;
    font-weight: 400;
    font-size: clamp(22px, 2.6vw, 34px);
    line-height: 1.04;
    letter-spacing: -0.4px;
}

/* The wordmark: mixed-case, two-tone — "Power" in ink, "Match" in orange,
   matching the PowerMatch™ brand lockup. Sized larger than the descriptor so
   the brand name leads and the tool name reads as a quiet subtitle. */
.gencalc-lockup__name {
    color: #111;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.gencalc-lockup__match {
    color: #FAA747;
}

/* Brand mark before the wordmark — nested inside __name so it stays glued to
   "Power" even when the lockup stacks on narrow screens. Sized in em so it
   scales with the responsive heading; nudged up a hair to centre against the
   uppercase caps. */
.gencalc-lockup__icon {
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 0.32em;
    vertical-align: middle;
    position: relative;
    top: -0.05em;
}

.gencalc-lockup__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.gencalc-lockup__tm {
    font-size: 0.46em;
    vertical-align: super;
    letter-spacing: 0;
    margin-left: 2px;
    color: #111;
}

.gencalc-lockup__dash {
    color: #FAA747;
}

/* Supporting descriptor — quiet uppercase tag set against the wordmark. */
.gencalc-lockup__desc {
    color: #888e96;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.9em;
}

/* One-time reveal on load — subtle, accessibility-guarded. */
@media (prefers-reduced-motion: no-preference) {
    .gencalc-lockup {
        opacity: 0;
        transform: translateY(8px);
        animation: gencalc-hero-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
    }
}

@keyframes gencalc-hero-rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Narrow screens — stack the descriptor under the name and drop the dash so
   the long lockup never overflows. */
@media (max-width: 720px) {
    .gencalc-pagehero {
        padding: 38px 0;
    }
    .gencalc-lockup {
        flex-direction: column;
        align-items: center;   /* baseline aligns to the left in a column — centre it */
        gap: 8px;
        font-size: 32px;       /* larger PowerMatch on mobile (clamp otherwise floors at 22px) */
    }
    .gencalc-lockup__dash {
        display: none;
    }
    .gencalc-lockup__desc {
        font-size: 15px;       /* keep the long descriptor readable under the bigger name */
    }
}

/* ── App / wizard container ────────────────────────────────────────────── */
.gencalc-app {
    padding: 32px 0 96px;
}

.gencalc-wizard,
.gencalc-result {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.gencalc-section-label {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a1a1a;
    margin: 0 0 14px;
    padding: 0;
}

.gencalc-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    color: #9aa0a6;
    cursor: help;
    margin-left: 8px;
    outline: none;
    line-height: 1;
    transition: color .15s;
    background: transparent;
    border: 0;
}

.gencalc-help > i.fa-circle-info {
    font-size: 14px;
}

.gencalc-help:hover,
.gencalc-help:focus,
.gencalc-help:focus-within {
    color: #FAA747;
}

.gencalc-help:focus-visible {
    outline: none;
}

/* Custom tooltip — replaces the native title attribute so it works the
   same on Chrome and Firefox. Shows on hover or keyboard focus. */
.gencalc-tooltip {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: 300px;
    padding: 14px 16px 15px;
    background: #1f1f1f;
    color: #f0f0f0;
    /* Body font — JCBEuro is a display/industrial face that reads thin and
       awkward at body sizes on dark backgrounds. Tooltips are body copy,
       so we use a proper system body sans-serif stack with crisp antialiasing.
       Resets inherited uppercase/tracking from the legend ancestor too. */
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text',
                 'Segoe UI', 'Helvetica Neue', Helvetica, system-ui, sans-serif;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.6;
    text-align: left;
    text-transform: none;
    letter-spacing: 0.1px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28),
                0 2px 6px rgba(0, 0, 0, 0.16),
                inset 0 1px 0 rgba(255, 255, 255, 0.04);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    z-index: 50;
    white-space: normal;
}

.gencalc-tooltip strong {
    color: #FAA747;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.1px;
}

/* ── Reusable two-tone definition list ─────────────────────────────────
   Orange keyword + body description, one pair per line. Designed to live
   inside dark tooltips, info popovers, or any context where a quick
   key-value reference helps the reader. The keyword picks up the brand
   orange + bold; the description renders in the inherited body color
   with a soft "=" separator between them.

   Two markup variants are supported so the pattern works inside both
   block contexts (where <dl><dt><dd> is valid) and inline-only contexts
   like tooltips that live inside a <span>:

     Block (preferred — semantic):
       <dl class="gp-deflist">
         <div><dt>Tight</dt><dd>data-centre / IT (everything on at once).</dd></div>
         <div><dt>Standard</dt><dd>events, hotels, mixed use.</dd></div>
       </dl>

     Inline (for tooltips inside <span>):
       <span class="gp-deflist">
         <span class="gp-deflist-row">
           <span class="gp-deflist-term">Tight</span>
           <span class="gp-deflist-desc">data-centre / IT.</span>
         </span>
         …
       </span>

   Modifiers:
     .gp-deflist--compact   — tighter row spacing (default 6px gap)
     .gp-deflist--on-light  — switch separator to dark tone for light BGs */
.gp-deflist {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gp-deflist--compact { gap: 3px; }

/* A row is either a wrapper <div> (block markup) or a <span class="gp-deflist-row">
   (inline markup). Both render the same — keyword auto-width, description fills. */
.gp-deflist > div,
.gp-deflist > .gp-deflist-row {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 8px;
    align-items: baseline;
}

.gp-deflist dt,
.gp-deflist .gp-deflist-term {
    color: #FAA747;
    font-weight: 600;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0.1px;
    position: relative;
}
.gp-deflist dt::after,
.gp-deflist .gp-deflist-term::after {
    content: '=';
    color: rgba(255, 255, 255, 0.4);
    margin-left: 6px;
    font-weight: 400;
}
.gp-deflist dd,
.gp-deflist .gp-deflist-desc {
    margin: 0;
    color: inherit;
}
.gp-deflist.gp-deflist--on-light dt::after,
.gp-deflist.gp-deflist--on-light .gp-deflist-term::after {
    color: rgba(0, 0, 0, 0.32);
}
.gp-deflist-intro {
    display: block;
    margin: 0 0 8px;
    color: inherit;
    font-weight: 400;
}

.gencalc-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a1a1a;
}

.gencalc-help:hover .gencalc-tooltip,
.gencalc-help:focus .gencalc-tooltip,
.gencalc-help:focus-within .gencalc-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
    .gencalc-tooltip {
        width: min(240px, calc(100vw - 40px));
        font-size: 12px;
        padding: 10px 12px;
    }
}

/* ── Toolbar (tutorial trigger) ────────────────────────────────────────── */
.gencalc-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.gencalc-tutorial-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 12.5px;
    cursor: pointer;
    transition: color 0.15s;
}
.gencalc-tutorial-btn i {
    /* Neutral at rest — orange is reserved for primary actions and live
       values; the hover rule below lights the whole control up. */
    color: inherit;
    font-size: 14px;
}
.gencalc-tutorial-btn:hover,
.gencalc-tutorial-btn:focus-visible {
    color: #FAA747;
    outline: none;
}

/* ── Tutorial overlay / highlight / popup ─────────────────────────────── */
.gencalc-tut-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 9997;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.gencalc-tut-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.gencalc-tut-highlight {
    position: fixed;
    z-index: 9998;
    pointer-events: none;
    border-radius: 6px;
    border: 3px solid #FAA747;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.15), 0 0 0 6px rgba(250, 167, 71, 0.25);
    transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease, opacity 0.2s;
    opacity: 0;
}

.gencalc-tut-highlight.is-visible {
    opacity: 1;
}

.gencalc-tut-popup {
    position: fixed;
    z-index: 9999;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    padding: 18px 18px 14px;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    color: #1a1a1a;
    transition: top 0.25s ease, left 0.25s ease, opacity 0.2s;
    opacity: 0;
    pointer-events: none;
}

.gencalc-tut-popup.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.gencalc-tut-popup__count {
    display: inline-block;
    background: rgba(250, 167, 71, 0.15);
    color: #b96a14;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 10px;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.gencalc-tut-popup__title {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 16px;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.gencalc-tut-popup__body {
    font-size: 13px;
    line-height: 1.55;
    color: #444;
    margin: 0 0 16px;
}

.gencalc-tut-popup__body strong {
    color: #1a1a1a;
}

/* CTA button — "Switch to Advanced & continue" (hidden on most steps) */
.gencalc-tut-popup__cta {
    display: block;
    width: 100%;
    background: #FAA747;
    color: #1a1a1a;
    border: 1.5px solid #FAA747;
    border-radius: 4px;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 12px;
    padding: 9px 16px;
    margin-bottom: 12px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, border-color 0.15s;
}

.gencalc-tut-popup__cta:hover {
    background: #e08c2c;
    border-color: #e08c2c;
}

.gencalc-tut-popup__cta[hidden] {
    display: none;
}

.gencalc-tut-popup__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

.gencalc-tut-popup__skip {
    background: none;
    border: 0;
    color: #888;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}

.gencalc-tut-popup__skip:hover { color: #1a1a1a; }

.gencalc-tut-popup__nav {
    display: flex;
    gap: 8px;
}

.gencalc-tut-btn {
    border: 1.5px solid #FAA747;
    background: #fff;
    color: #FAA747;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 12px;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.gencalc-tut-btn:hover:not(:disabled) {
    background: #FAA747;
    color: #1a1a1a;
}

.gencalc-tut-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.gencalc-tut-btn--primary {
    background: #FAA747;
    color: #1a1a1a;
}

.gencalc-tut-btn--primary:hover:not(:disabled) {
    background: #e08c2c;
    border-color: #e08c2c;
}

.gencalc-tut-popup__arrow {
    position: absolute;
    width: 0;
    height: 0;
    border: 8px solid transparent;
}

.gencalc-tut-popup--top    .gencalc-tut-popup__arrow { bottom: -16px; border-top-color: #fff; left: 50%; margin-left: -8px; }
.gencalc-tut-popup--bottom .gencalc-tut-popup__arrow { top: -16px; border-bottom-color: #fff; left: 50%; margin-left: -8px; }
.gencalc-tut-popup--left   .gencalc-tut-popup__arrow { right: -16px; border-left-color: #fff; top: 50%; margin-top: -8px; }
.gencalc-tut-popup--right  .gencalc-tut-popup__arrow { left: -16px; border-right-color: #fff; top: 50%; margin-top: -8px; }

@media (max-width: 600px) {
    .gencalc-tut-popup {
        width: calc(100vw - 32px);
        left: 16px !important;
        right: 16px;
        bottom: 16px !important;
        top: auto !important;
        transform: none !important;
    }
    .gencalc-tut-popup__arrow { display: none; }
    /* 44px tap targets on phone for the nav buttons */
    .gencalc-tut-btn { min-height: 44px; padding: 11px 18px; font-size: 13px; }
    .gencalc-tut-popup__skip { padding: 8px 4px; font-size: 13px; }
    .gencalc-tut-popup__title { font-size: 17px; }
    .gencalc-tut-popup__body { font-size: 13.5px; }
}

/* Mobile / tablet: kill position transitions so the highlight snaps cleanly
   between steps. Opacity alone handles the visual handoff. The smooth-scroll
   in JS continues to provide the sense of movement between distant fields. */
@media (max-width: 768px) {
    .gencalc-tut-highlight {
        transition: opacity 0.18s ease;
    }
    .gencalc-tut-popup {
        transition: opacity 0.18s ease;
    }
}

/* Sample chip — marks tutorial demo rows/zones as tour furniture, not
   user data. Neutral grey, deliberately quieter than the orange accents. */
.gencalc-tut-sample-chip {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 9px;
    background: #6b7280;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    vertical-align: middle;
    pointer-events: none;
}

/* ── Wizard step cards (1 → 2 → 3 path) ──────────────────────────────── */
.gencalc-step {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 18px;
    /* No overflow:hidden — would clip the industry-picker dropdown panel
       and any future popovers. Header tint gets matching top corners
       via its own border-radius below. */
}
.gencalc-step-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #fafbfc;
    border-bottom: 1px solid #f0f1f3;
    border-radius: 12px 12px 0 0;
}
.gencalc-step-number {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #FAA747;
    color: white;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 17px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gencalc-step-titles { flex: 1; min-width: 0; }
.gencalc-step-title {
    margin: 0;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 17px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #1a1a1a;
    line-height: 1.2;
}
.gencalc-step-body {
    padding: 22px 20px;
}
.gencalc-step-body > fieldset:last-child,
.gencalc-step-body > .gencalc-loads:last-child,
.gencalc-step-body > .gencalc-submit-row:last-child,
.gencalc-step-body > details:last-child {
    margin-bottom: 0;
}

/* ── Collapsible step (Section 0: Project Details) ──────────────────── */
.gencalc-step-header-toggle {
    /* Reset native button styling so it visually matches a regular header. */
    width: 100%;
    border: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    /* Reuse the .gencalc-step-header layout — the rule above already gives
       us flex + padding + tinted background. The header-toggle class only
       overlays button-reset rules on top. */
}
.gencalc-step-header-toggle:hover {
    background: #f4f6f8;
}
.gencalc-step-header-toggle:focus-visible {
    outline: 2px solid #FAA747;
    outline-offset: -2px;
}
.gencalc-step-subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    color: #777;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    text-transform: none;
    letter-spacing: 0;
}
.gencalc-step-chevron {
    color: #888;
    transition: transform .2s ease;
    flex-shrink: 0;
    font-size: 14px;
}
.gencalc-step-header-actions {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.gencalc-step-title-muted {
    color: #999;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
    margin-left: 6px;
}
.gencalc-step-collapsible[data-collapsed="true"] .gencalc-step-chevron {
    transform: rotate(-90deg);
}
.gencalc-step-collapsible[data-collapsed="false"] .gencalc-step-header {
    border-radius: 12px 12px 0 0;
}
.gencalc-step-collapsible[data-collapsed="true"] .gencalc-step-header {
    border-bottom-color: transparent;
    border-radius: 12px;
}

/* ── Project Details grid (Section 0 body) ──────────────────────────── */
.gencalc-project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}
.gencalc-project-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.gencalc-project-wide {
    grid-column: 1 / -1;
}
.gencalc-project-grid textarea {
    border: 1.5px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    padding: 9px 12px;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 13.5px;
    color: #1a1a1a;
    box-sizing: border-box;
    width: 100%;
    resize: vertical;
    transition: border-color .15s, box-shadow .15s;
}
.gencalc-project-grid textarea:hover {
    border-color: #b3b6bc;
}
.gencalc-project-grid textarea:focus {
    outline: none;
    border-color: #FAA747;
    box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.15);
}

@media (max-width: 600px) {
    .gencalc-step-header { padding: 14px 16px; gap: 10px; }
    .gencalc-step-number { width: 30px; height: 30px; font-size: 14px; }
    .gencalc-step-title { font-size: 15px; }
    .gencalc-step-body { padding: 18px 16px; }
    .gencalc-project-grid { grid-template-columns: 1fr; }
    .gencalc-project-pair { grid-template-columns: 1fr; gap: 14px; }
}

/* ── Mode toggle ───────────────────────────────────────────────────────── */
.gencalc-mode {
    border: 0;
    padding: 0;
    margin: 0 0 28px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.gencalc-mode-option {
    display: block;
    border: 1.5px solid #e7e7e7;
    border-radius: 6px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.gencalc-mode-option input {
    margin-right: 8px;
    accent-color: #FAA747;
}

.gencalc-mode-option span {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 14px;
}

.gencalc-mode-option:has(input:checked) {
    border-color: #FAA747;
    background: rgba(250, 167, 71, 0.06);
}

/* ── Loads list ────────────────────────────────────────────────────────── */
.gencalc-loads {
    margin-bottom: 28px;
}

.gencalc-load-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

/* Auto-number rows within each list (CSS counter resets per parent) */
.gencalc-load-list,
.gencalc-zone-loads {
    counter-reset: gencalc-load-row;
}

/* Advanced load row — see card-layout section at the bottom of this file
   (search for "Advanced load row — card layout"). Replaced 2026-05-06
   by the nameplate-style card design. */

/* Per-zone diversity selector lives in the zone header next to the name */
.gencalc-zone-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gencalc-zone-header > input[data-field="zone-name"] { flex: 1 1 200px; }
.gencalc-zone-diversity {
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.gencalc-zone-diversity > span {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #777;
}
.gencalc-zone-diversity > select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 6px 26px 6px 10px;
  border: 1.5px solid #d1d5db; border-radius: 6px;
  font-size: 12px; color: #1a1a1a; background-color: white;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M3 4.5l3 3 3-3' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 11px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.gencalc-zone-diversity > select:hover { border-color: #b3b6bc; }
.gencalc-zone-diversity > select:focus {
  outline: none; border-color: #FAA747;
  box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.15);
}

/* Zone-nested load rows: white background to stand out against the
   zone container's tinted background. */
.gencalc-zone-loads .gencalc-load-row {
    background: #fff;
}

.gencalc-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gencalc-field label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #777;
    font-family: 'JCBEuro Bold Regular', sans-serif;
}

.gencalc-field input,
.gencalc-field select,
.gencalc-modal-form input[type="email"] {
    border: 1.5px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    padding: 9px 12px;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 13.5px; color: #1a1a1a;
    box-sizing: border-box;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}

.gencalc-field input:hover,
.gencalc-field select:hover {
    border-color: #b3b6bc;
}

.gencalc-field input:focus,
.gencalc-field select:focus,
.gencalc-modal-form input[type="email"]:focus {
    outline: none;
    border-color: #FAA747;
    box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.15);
}

/* Native select → styled to match the custom industry picker:
   appearance:none + a chevron via inline SVG background.
   Applies to all <select> inside .gencalc-field (row + site conditions). */
.gencalc-field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M3 4.5l3 3 3-3' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
}
.gencalc-field select:hover {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M3 4.5l3 3 3-3' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.gencalc-field select:focus {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M3 4.5l3 3 3-3' stroke='%23FAA747' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.gencalc-field--block input {
    width: 100%;
}

.gencalc-load-remove,
.gencalc-zone-remove {
    align-self: end;
    background: transparent;
    border: 1px solid #ececec;
    border-radius: 4px;
    color: #888;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    height: 36px;
    width: 36px;
    transition: border-color 0.2s, color 0.2s;
}

.gencalc-load-remove:hover,
.gencalc-zone-remove:hover {
    border-color: #d33;
    color: #d33;
}

.gencalc-load-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f1f3;
}

/* ── Zones ─────────────────────────────────────────────────────────────── */
.gencalc-zone {
    border: 1.5px solid #e4e4e4;
    background: #ffffff;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
}

.gencalc-zone-header {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.gencalc-zone-header input {
    flex: 1;
    border: 1px solid #cdd5dd;
    background: #fff;
    border-radius: 4px;
    padding: 8px 10px;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 16px;
}

.gencalc-zone-loads {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

/* Empty-state hint — shown only while the zone has neither sub-zones nor
   loads, so first-time users get an answer before the footer buttons ask
   the question. Pure CSS (:empty) — appears/disappears with no JS. */
.gencalc-zone-subzones:empty + .gencalc-zone-loads:empty::before {
    content: "No loads yet — add one below or pick from the Library.";
    font-size: 13px;
    color: #9aa0a6;
    padding: 14px 2px;
}

/* In-zone toolbar — '+ Add Load to Zone' and 'Library' sit side by side
   so loads picked from the library land in this zone explicitly. */
.gencalc-zone-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

/* Drag handle — a 6-dot CSS grip in the row's left gutter, vertically
   centered against the *main row only* (not the whole row, so it
   doesn't drift when Advanced Mode adds the engineering-details
   sub-row). Negative left offset pushes it out of main-row's box and
   into the row's left padding area, mirroring how × is anchored on
   the right. Dots are CSS-rendered (not FA) for crisp small-size
   rendering. Native HTML5 drag — desktop only. */
.gencalc-load-drag {
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b5b8bc;
    cursor: grab;
    user-select: none;
    background: none;
    border: 0;
    padding: 0;
    transition: color 80ms ease;
}
.gencalc-load-drag-grip {
    display: grid;
    grid-template-columns: 2.5px 2.5px;
    grid-template-rows: repeat(3, 2.5px);
    gap: 2.5px;
}
.gencalc-load-drag-grip > i {
    width: 2.5px;
    height: 2.5px;
    background: currentColor;
    border-radius: 50%;
}
.gencalc-load-drag:hover,
.gencalc-load-drag:focus-visible {
    color: #1a1a1a;
    outline: none;
}
.gencalc-load-drag:active {
    cursor: grabbing;
}
.gencalc-load-row.is-dragging {
    opacity: 0.4;
}
.gencalc-zone-loads.is-drag-over,
#gencalcLoadList.is-drag-over {
    outline: 2px dashed #FAA747;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ── Zone title bar — compact single row ────────────────────────────────────
   Section-header pattern: tag chip + name input on the left, small stat
   readouts on the right (Load · Diversity · Remove). Zone total is shown
   as a stat-line value, NOT a giant orange number — it must not compete
   with the load rows' own kVA values that follow underneath. */
.gencalc-zone-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #ffffff;
    border-bottom: 1px solid #ededed;
    border-radius: 4px 4px 0 0;
    flex-wrap: nowrap;
}
.gencalc-zone-header-chip {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: #1a1a1a;
    padding: 3px 7px;
    border-radius: 3px;
    flex: 0 0 auto;
}
/* Collapse / expand chevron — toggles visibility of the load list and
   per-zone actions; the header stays visible so the user keeps the
   summary (name + Load + Diversity) at a glance even when collapsed. */
.gencalc-zone-collapse {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    color: #555;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 12px;
    line-height: 1;
    border-radius: 3px;
    transition: background 120ms ease;
}
.gencalc-zone-collapse:hover { background: #eef0f2; color: #1a1a1a; }
.gencalc-zone-collapse i { transition: transform 150ms ease; display: inline-block; }
.gencalc-zone.is-collapsed .gencalc-zone-collapse i { transform: rotate(-90deg); }
.gencalc-zone.is-collapsed .gencalc-zone-loads,
.gencalc-zone.is-collapsed .gencalc-zone-actions { display: none; }
.gencalc-zone.is-collapsed .gencalc-zone-subzones { display: none; }
.gencalc-zone.is-collapsed .gencalc-zone-header { border-bottom: 0; border-radius: 4px; }
.gencalc-zone-header > input[data-field="zone-name"] {
    flex: 1 1 auto;
    min-width: 0;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 16px;
    background: transparent;
    border: 0;
    border-bottom: 1px dashed transparent;
    padding: 4px 2px;
    color: #1a1a1a;
}
.gencalc-zone-header > input[data-field="zone-name"]:hover,
.gencalc-zone-header > input[data-field="zone-name"]:focus {
    border-bottom-color: #cdd5dd;
    outline: none;
}
/* Pin the zone-name size against global form resets (e.g. Tailwind preflight's
   input{font-size:100%}, which inflates it to the inherited body size).
   Scoped + descendant + !important so it wins regardless of DOM wrapping. */
.gencalc-page .gencalc-zone-header input[data-field="zone-name"] {
    font-size: 16px !important;
}
.gencalc-zone-header-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}
.gencalc-zone-header-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    font-size: 12px;
    color: #555;
    line-height: 1.2;
}
/* The hidden attribute must always win — author display rules (here and in
   the theme's global resets) otherwise override the UA's [hidden] style and
   leak the per-zone Required stat into site-wide mode. */
.gencalc-zone-header-stat[hidden] {
    display: none !important;
}
.gencalc-zone-header-stat-label {
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #888;
}
.gencalc-zone-header-stat strong {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    color: #1a1a1a;
    font-size: 14px;
}
.gencalc-zone-header-stat-unit {
    font-size: 11px;
    color: #888;
}
.gencalc-zone-diversity-inline select {
    font-size: 12px;
    padding: 2px 4px;
    border: 1px solid #d8dbe0;
    border-radius: 3px;
    background: #fff;
    color: #1a1a1a;
}
/* Keep the Diversity label + its info (i) on one line (the 14px icon was
   wrapping below the 10px uppercase label). */
.gencalc-zone-diversity-inline .gencalc-zone-header-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.gencalc-zone-diversity-inline .gencalc-zone-header-stat-label .gencalc-help { margin-left: 0; }
.gencalc-zone-diversity-inline .gencalc-help > i.fa-circle-info { font-size: 12px; }
.gencalc-zone-header .gencalc-zone-remove {
    background: transparent;
    border: 0;
    color: #888;
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
    border-radius: 3px;
}
.gencalc-zone-header .gencalc-zone-remove:hover {
    background: #fee;
    color: #c33;
}
/* The sole zone keeps no × — zone mode needs at least one zone, so the
   only scaffold can't be destroyed. Adding a second zone (siblings) brings
   the control back on both. */
.gencalc-load-list > .gencalc-zone:only-child .gencalc-zone-header .gencalc-zone-remove {
    display: none;
}
/* Wrap the zone / sub-zone header stats onto a full-width second row across
   the tablet band. The stats group (totals · Diversity/Usage select · ×) is
   flex:0 0 auto and can't shrink, so while the header stays a single nowrap
   row it steals width from the name input (flex:1, min-width:0) — at ~642px
   the zone name shrank to a sliver, truncating "Name this zone" to "Name t…".
   720px (not the old 640px) keeps the name input usable down to where the
   header genuinely needs to stack, and lines up with the load-card reflow. */
@media (max-width: 720px) {
    .gencalc-zone-header { flex-wrap: wrap; }
    .gencalc-zone-header-stats { width: 100%; justify-content: space-between; padding-top: 4px; border-top: 1px dashed #eef0f2; }
    /* Sub-zone header gets the same treatment one tier down. Divider tracks
       the sub-zone palette (#dfe3e9). */
    .gencalc-subzone-header { flex-wrap: wrap; }
    .gencalc-subzone-header-stats { width: 100%; margin-left: 0; justify-content: space-between; padding-top: 4px; border-top: 1px dashed #dfe3e9; }
}

/* ── Sub-zone mini-cards (spec §3, mockup B) ───────────────────────────────
   Nested collapsible cards inside a zone. Same stat/diversity row idiom as
   the zone header, scaled down to 12–13 px text and a lighter border. */
/* 12px bottom matches .gencalc-zone-loads' margin so the last sub-zone card
   never touches the first loose load row; :empty collapses the wrapper so
   zones without sub-zones get zero dead space. */
.gencalc-zone-subzones { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 12px; }
.gencalc-zone-subzones:empty { display: none; }
/* Tinted well: the sub-zone interior sits on a recessed cool gray so child
   load cards read as "inside the container", while zone-level loads stay
   full-width on white (mockup: docs/mockups/subzone-nesting-mockup.html,
   option A). The left indent on -loads/-actions below completes the cue. */
/* No overflow:hidden — would clip the unit/phase picker panel and the
   Usage tooltip that pop out of sub-zone load rows (same trap as
   .gencalc-step above). The header rounds its own top corners instead. */
.gencalc-subzone { border: 1px solid #ccd3db; border-radius: 8px; background: #f1f3f6; }
.gencalc-subzone-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #eceff3;
    border-bottom: 1px solid #e0e4ea;
    border-radius: 7px 7px 0 0;
}
.gencalc-subzone.is-collapsed .gencalc-subzone-header { border-radius: 7px; }
.gencalc-subzone-chip {
    /* Same typography as .gencalc-zone-header-chip; lighter palette keeps
       the tier hierarchy readable at a glance. */
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    background: #dfe3e9;
    border-radius: 3px;
    padding: 3px 7px;
    flex: 0 0 auto;
}
.gencalc-subzone-collapse {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    color: #555;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 11px;
    line-height: 1;
    border-radius: 3px;
    transition: background 120ms ease;
}
.gencalc-subzone-collapse:hover { background: #dfe3e9; color: #1a1a1a; }
.gencalc-subzone-collapse i { transition: transform 150ms ease; display: inline-block; }
.gencalc-subzone.is-collapsed .gencalc-subzone-collapse i { transform: rotate(-90deg); }
.gencalc-subzone-header input[data-field="subzone-name"] {
    flex: 1;
    min-width: 80px;
    border: none;
    border-bottom: 1px dashed transparent;
    background: transparent;
    font-weight: 700;
    font-size: 12.5px;
    color: #374151;
    padding: 2px 2px;
}
.gencalc-subzone-header input[data-field="subzone-name"]:hover,
.gencalc-subzone-header input[data-field="subzone-name"]:focus {
    border-bottom-color: #cdd5dd;
    outline: none;
}
.gencalc-subzone-header-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex: 0 0 auto;
}
/* Collapse body when sub-zone is folded */
.gencalc-subzone.is-collapsed .gencalc-subzone-loads,
.gencalc-subzone.is-collapsed .gencalc-subzone-actions { display: none; }
.gencalc-subzone.is-collapsed .gencalc-subzone-header { border-bottom: 0; }
/* Delete button — scoped override so the × sits flush in the sub-zone
   header stats row (smaller than the zone-level × which is 18 px).
   Button base styles come from .gencalc-zone-remove (shared class). */
.gencalc-subzone-header .gencalc-subzone-delete {
    font-size: 16px;
    align-self: center;
}
.gencalc-subzone-header .gencalc-subzone-delete:hover {
    background: #fee;
    color: #c33;
}
/* Sub-zone load area — inherits gencalc-zone-loads flex layout.
   26px left padding indents child cards off the zone-level card edge —
   the indent (not the tint) carries most of the nesting signal. */
.gencalc-subzone-loads { margin-bottom: 0; padding: 12px 12px 0 26px; }
/* Sub-zone action bar — mirrors gencalc-zone-actions */
/* Roomier footer so the buttons read as their own band, not glued to the
   last load row / card edges; left padding tracks the load indent. */
.gencalc-subzone-actions { padding: 10px 12px 12px 26px; margin-bottom: 0; }

/* ── Live total ────────────────────────────────────────────────────────── */
.gencalc-live-total {
    background: #1a1a1a;
    color: #fff;
    padding: 16px 20px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 28px;
}

.gencalc-live-total-label {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ccc;
}

.gencalc-live-total-value {
    font-family: 'JCBEuro BoldCondensed Regular', sans-serif;
    font-size: 22px;
}

.gencalc-live-total-value strong {
    color: #FAA747;
    font-size: 28px;
}

.gencalc-live-total-secondary {
    color: #999;
    font-size: 14px;
    margin-left: 6px;
    white-space: nowrap;
}

/* Inline info-tip — small "ⓘ" icon shown next to a label that has a
   detail explanation. Hover/focus reveals the tooltip text from
   data-tooltip via native title-attribute fallback (we set both via JS
   for accessibility). Keeps the calculator readable for non-engineers
   without burying engineering rationale. */
.gencalc-info-tip {
    position: relative;
    display: inline-block;
    margin-left: 4px;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    color: #888;
    font-size: 11px;
    cursor: help;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    vertical-align: middle;
}
.gencalc-info-tip:hover, .gencalc-info-tip:focus { color: #fff; outline: none; }
/* Use the shared custom-tooltip popup (reliable on focus/touch) instead of the
   native title attribute, matching the .gencalc-help tips elsewhere. */
.gencalc-info-tip:hover .gencalc-tooltip,
.gencalc-info-tip:focus .gencalc-tooltip,
.gencalc-info-tip:focus-within .gencalc-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Live-total disclosure caption — sits beneath the dark bar. Carries the
   IEEE-141 / NEC §220 nameplate + diversity disclosure and, in Power Plan
   mode, the fleet-total breakdown. Visually subordinate to the headline. */
.gencalc-live-total-disclosure {
    margin: -22px 0 24px 4px;
    font-size: 12px;
    line-height: 1.55;
    color: #666;
}
.gencalc-live-total-disclosure[hidden] { display: none; }
.gencalc-live-total-disclosure > span { display: block; }
.gencalc-live-total-disclosure strong {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    color: #444;
    font-weight: 600;
}
.gencalc-live-total-disclosure em {
    font-style: normal;
    color: #888;
}

@media (max-width: 600px) {
    /* Stack label above value so the readout stays clear at narrow widths
       — centring split the kVA / kW pair across two lines on phones. */
    .gencalc-live-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 14px 16px;
    }
    .gencalc-live-total-value { font-size: 20px; }
    .gencalc-live-total-value strong { font-size: 26px; }
}

/* ── Engineered slider (Safety margin / Diversity factor) ──────────────
   Torque-gauge aesthetic: thin 4px rail, orange fill that animates on snap,
   tick marks at engineering milestones, oversized JCBEuro readout on the
   right. Drag for any value; click a milestone label below the rail to snap.
   Used by both Safety margin and Diversity factor — the wrapper class is
   .gencalc-slider with --margin / --diversity modifiers for any per-control
   tuning. Replaces the older chip-stop control. */
.gencalc-slider {
    --gc-orange:        #FAA747;
    --gc-orange-soft:   rgba(250, 167, 71, 0.18);
    --gc-rail:          #e5e7eb;
    --gc-rail-passed:   #FAA747;
    --gc-thumb-size:    22px;
    --gc-rail-height:   4px;
    --gc-rail-radius:   999px;

    border: 1px solid #ececec;
    border-radius: 12px;
    background: #fff;
    padding: 16px 22px 18px;
    margin: 0 0 30px;
}

/* Strip the card-style box from sliders that now live inside a labeled
   band (Sizing, Site & power). The band itself provides visual
   containment — keeping the border + radius + white fill on every
   fieldset reads as double-framed. Padding stays so content doesn't
   crowd the rail. */
.gencalc-slider--margin,
.gencalc-slider--diversity,
.gencalc-slider--site {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
}

.gencalc-slider-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 22px;
}
.gencalc-slider-head > .gencalc-section-label {
    margin: 0;
    flex: 1 1 auto;
}

.gencalc-slider-readout {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    color: #1a1a1a;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s ease;
}
.gencalc-slider-readout-value {
    font-size: 30px;
    letter-spacing: -1px;
    min-width: 1.6ch;
    text-align: right;
}
.gencalc-slider-readout-unit {
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    margin-left: 5px;
}

/* Rail — relative wrapper hosting track / fill / ticks / native input.
   Margin offset = thumb radius so dragging to the extremes doesn't bleed
   past the milestone labels below. */
.gencalc-slider-rail {
    position: relative;
    height: var(--gc-thumb-size);
    margin: 0 calc(var(--gc-thumb-size) / 2);
}

.gencalc-slider-track,
.gencalc-slider-fill {
    position: absolute;
    top: 50%;
    height: var(--gc-rail-height);
    border-radius: var(--gc-rail-radius);
    pointer-events: none;
    transform: translateY(-50%);
}
.gencalc-slider-track {
    left: 0;
    right: 0;
    background: var(--gc-rail);
}
.gencalc-slider-fill {
    left: 0;
    width: var(--gc-position, 0%);
    background: linear-gradient(90deg, #f59c34 0%, var(--gc-rail-passed) 100%);
    box-shadow: 0 0 0 0.5px rgba(250, 167, 71, .35);
    transition: width .28s cubic-bezier(.2, .8, .2, 1);
}
.gencalc-slider-rail.is-dragging .gencalc-slider-fill {
    transition: none;  /* live drag — no smoothing lag */
}

.gencalc-slider-ticks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.gencalc-slider-tick {
    position: absolute;
    top: 50%;
    left: var(--at);
    width: 2px;
    height: 9px;
    background: #c7cad0;
    border-radius: 1px;
    transform: translate(-50%, -50%);
    transition: background .25s ease;
}
.gencalc-slider-tick.is-passed {
    background: rgba(255, 255, 255, .85);
}

/* Native range input — invisible track, custom thumb. Sits on top so it
   captures pointer events; the visual rail/fill/ticks render underneath. */
.gencalc-slider-input {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    margin: 0;
    cursor: grab;
    z-index: 2;
}
.gencalc-slider-input:active { cursor: grabbing; }
.gencalc-slider-input:focus-visible { outline: none; }

.gencalc-slider-input::-webkit-slider-runnable-track {
    height: var(--gc-thumb-size);
    background: transparent;
    border: 0;
}
.gencalc-slider-input::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: var(--gc-thumb-size);
    height: var(--gc-thumb-size);
    border-radius: 50%;
    background: var(--gc-orange);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .12),
                0 3px 8px rgba(0, 0, 0, .18);
    margin-top: 0;
    transition: transform .14s ease, box-shadow .14s ease;
}
.gencalc-slider-input::-moz-range-track {
    height: var(--gc-thumb-size);
    background: transparent;
    border: 0;
}
.gencalc-slider-input::-moz-range-thumb {
    width: var(--gc-thumb-size);
    height: var(--gc-thumb-size);
    border-radius: 50%;
    background: var(--gc-orange);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .12),
                0 3px 8px rgba(0, 0, 0, .18);
    transition: transform .14s ease, box-shadow .14s ease;
}
.gencalc-slider-input:hover::-webkit-slider-thumb,
.gencalc-slider-input:focus-visible::-webkit-slider-thumb,
.gencalc-slider-input:active::-webkit-slider-thumb {
    transform: scale(1.12);
    box-shadow: 0 0 0 6px var(--gc-orange-soft),
                0 0 0 7px rgba(0, 0, 0, .06),
                0 3px 8px rgba(0, 0, 0, .22);
}
.gencalc-slider-input:hover::-moz-range-thumb,
.gencalc-slider-input:focus-visible::-moz-range-thumb,
.gencalc-slider-input:active::-moz-range-thumb {
    transform: scale(1.12);
    box-shadow: 0 0 0 6px var(--gc-orange-soft),
                0 0 0 7px rgba(0, 0, 0, .06),
                0 3px 8px rgba(0, 0, 0, .22);
}

/* Stops — semantic-name + value labels positioned beneath the rail.
   Each <li> carries an inline --at: NN% so positioning is data-driven from
   the markup, not duplicated in CSS. Click → snap to value. */
.gencalc-slider-stops {
    position: relative;
    list-style: none;
    margin: 4px calc(var(--gc-thumb-size) / 2) 0;
    padding: 0;
    height: 38px;
}
.gencalc-slider-stops > li {
    position: absolute;
    left: var(--at);
    top: 0;
    transform: translateX(-50%);
}
.gencalc-slider-stop {
    position: relative;  /* anchor for the hover tooltip */
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: 0;
    padding: 6px 6px 4px;
    cursor: pointer;
    color: #999;
    transition: color .15s ease;
    font-family: inherit;
    border-radius: 4px;
}
.gencalc-slider-stop:hover { color: #1a1a1a; }
.gencalc-slider-stop:focus-visible {
    outline: 2px solid var(--gc-orange);
    outline-offset: 2px;
    color: #1a1a1a;
}
.gencalc-slider-stop-name {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 10px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}
.gencalc-slider-stop-value {
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 11px;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.gencalc-slider-stop.is-active {
    color: #1a1a1a;
}
.gencalc-slider-stop.is-active .gencalc-slider-stop-name {
    color: var(--gc-orange);
}
.gencalc-slider-stop.is-active .gencalc-slider-stop-value {
    font-family: 'JCBEuro Bold Regular', sans-serif;
}

/* Hover/focus tooltip — describes what the milestone means.
   Copy is industry-aware (set by JS): plain language for events / hotels /
   film / tents; technical for construction / oil & gas / data centers / etc.
   Empty span by default — JS hides the tooltip via .is-empty when no copy.
   Uses the same body-font stack as .gencalc-tooltip so industrial JCBEuro
   doesn't get used at body sizes (thins out on dark BG). */
.gencalc-slider-stop-tip {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: max-content;
    max-width: 260px;
    padding: 12px 14px 13px;
    background: #1f1f1f;
    color: #f0f0f0;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text',
                 'Segoe UI', 'Helvetica Neue', Helvetica, system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.55;
    text-align: left;
    text-transform: none;
    letter-spacing: 0.1px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28),
                0 2px 6px rgba(0, 0, 0, 0.16),
                inset 0 1px 0 rgba(255, 255, 255, 0.04);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 5;
    white-space: normal;
}
.gencalc-slider-stop-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a1a1a;
}
.gencalc-slider-stop-tip:empty,
.gencalc-slider-stop-tip.is-empty {
    display: none;  /* JS clears text → hide entirely so empty industries don't show a black bubble */
}
.gencalc-slider-stop:hover .gencalc-slider-stop-tip,
.gencalc-slider-stop:focus-visible .gencalc-slider-stop-tip,
.gencalc-slider-stop.is-tip-open .gencalc-slider-stop-tip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Edge correction: the rightmost stop on the diversity slider sits at 100%,
   so a centered tooltip would clip past the rail. Anchor its tooltip to the
   right edge of the button instead and shift the arrow accordingly. */
.gencalc-slider-stops > li[style*="--at:100%"] .gencalc-slider-stop-tip,
.gencalc-slider-stops > li[style*="--at: 100%"] .gencalc-slider-stop-tip {
    left: auto;
    right: -4px;
    transform: translateX(0) translateY(6px);
}
.gencalc-slider-stops > li[style*="--at:100%"] .gencalc-slider-stop:hover .gencalc-slider-stop-tip,
.gencalc-slider-stops > li[style*="--at:100%"] .gencalc-slider-stop:focus-visible .gencalc-slider-stop-tip,
.gencalc-slider-stops > li[style*="--at:100%"] .gencalc-slider-stop.is-tip-open .gencalc-slider-stop-tip {
    transform: translateX(0) translateY(0);
}
.gencalc-slider-stops > li[style*="--at:100%"] .gencalc-slider-stop-tip::after {
    left: auto;
    right: 16px;
    transform: translateX(0);
}
/* Same correction for the leftmost stop (Wide 0.70 at --at:40% is fine —
   only true edge cases need this). */
.gencalc-slider-stops > li[style*="--at:0%"] .gencalc-slider-stop-tip {
    left: -4px;
    right: auto;
    transform: translateX(0) translateY(6px);
}
.gencalc-slider-stops > li[style*="--at:0%"] .gencalc-slider-stop-tip::after {
    left: 16px;
    transform: translateX(0);
}

/* Diversity has 5 stops — tighten the typography slightly so they don't run
   into each other on narrower viewports. */
.gencalc-slider--diversity .gencalc-slider-stop-name { font-size: 10px; letter-spacing: 1.2px; }
.gencalc-slider--diversity .gencalc-slider-stop-value { font-size: 10.5px; }

@media (max-width: 600px) {
    .gencalc-slider { padding: 14px 16px 16px; }
    .gencalc-slider-head { margin-bottom: 18px; }
    .gencalc-slider-readout-value { font-size: 26px; }
    .gencalc-slider-stop-name  { font-size: 10px; letter-spacing: 1px; }
    .gencalc-slider-stop-value { font-size: 10.5px; }
    .gencalc-slider--diversity .gencalc-slider-stop-name { font-size: 10px; letter-spacing: .9px; }
}

/* ── Card-based choice grid ─────────────────────────────────────────────
   Replaces engineered sliders for Headroom / Usage factor / (future)
   Site conditions. Sits inside .gencalc-slider fieldset, so the outer
   frame (border, radius, header with readout) is shared. */
.gencalc-choice-grid {
    display: grid;
    gap: 8px;
}
.gencalc-choice-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.gencalc-choice-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.gencalc-choice-grid--cols-5 { grid-template-columns: repeat(5, 1fr); }

.gencalc-choice {
    position: relative;
    display: block;
    padding: 11px 13px 10px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
    transition: border-color .15s, background-color .15s;
}
.gencalc-choice:hover {
    border-color: #FAA747;
    background: #fffaf2;
}
.gencalc-choice:focus-visible {
    outline: 2px solid #FAA747;
    outline-offset: 2px;
}
.gencalc-choice[aria-checked="true"] {
    border-color: #FAA747;
    background: #fff7e6;
}

.gencalc-choice-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 3px;
}
.gencalc-choice-name {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #1a1a1a;
    line-height: 1.2;
}
.gencalc-choice[aria-checked="true"] .gencalc-choice-name { color: #c8820a; }
.gencalc-choice-value {
    font-family: 'JCBEuro BoldCondensed Regular', sans-serif;
    font-size: 16px;
    color: #1a1a1a;
    font-variant-numeric: tabular-nums;
}
.gencalc-choice[aria-checked="true"] .gencalc-choice-value { color: #c8820a; }
.gencalc-choice-desc {
    font-size: 11.5px;
    color: #777;
    line-height: 1.4;
}

/* "Recommended" pill — black background, white text, sits at top-right
   corner of the card. JS sets [hidden] on/off based on which value
   matches the active preset. */
.gencalc-rec-pill {
    position: absolute;
    top: -6px;
    right: 8px;
    background: #1a1a1a;
    color: #fff;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 2px 6px;
}
.gencalc-rec-pill[hidden] { display: none; }

/* Bigger readout for card-driven sliders — matches load-section's bold
   numerals (1200.0 KW). 36px BoldCondensed feels more confident than
   the old 30px Bold. */
.gencalc-slider--margin .gencalc-slider-readout-value,
.gencalc-slider--diversity .gencalc-slider-readout-value {
    font-family: 'JCBEuro BoldCondensed Regular', sans-serif;
    font-size: 36px;
    letter-spacing: -1px;
}

@media (max-width: 600px) {
    .gencalc-choice-grid--cols-3 { grid-template-columns: 1fr; }
    .gencalc-choice-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
    .gencalc-choice-grid--cols-5 { grid-template-columns: repeat(2, 1fr); }
    .gencalc-choice { padding: 10px 12px 9px; }
    .gencalc-choice-name { font-size: 12px; letter-spacing: .4px; }
    .gencalc-choice-value { font-size: 14px; }
    .gencalc-choice-desc { font-size: 11px; }
    .gencalc-rec-pill { top: -8px; }
    .gencalc-slider--margin .gencalc-slider-readout-value,
    .gencalc-slider--diversity .gencalc-slider-readout-value { font-size: 28px; }
}

/* Site conditions readout — value is text ("Normal" / "Custom"), so use
   tighter Bold rather than the 36px BoldCondensed for numeric readouts. */
.gencalc-slider--site .gencalc-slider-readout-value {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 18px;
    letter-spacing: .4px;
    text-transform: uppercase;
}

/* ── Advanced assumptions expander ──────────────────────────────────────
   Wraps raw Site Conditions selects + Project Tolerances. Lives inside
   the Setup section; visibility controlled by <details open> not the
   page-level Advanced toggle. */
.gencalc-advanced-block {
    margin: 0 0 18px;
    border: 1px dashed #d4d8dd;
    border-radius: 8px;
    background: #fafbfc;
}
.gencalc-advanced-block[open] {
    background: #fff;
    border-style: solid;
    border-color: #e5e7eb;
}
.gencalc-advanced-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 16px;
    cursor: pointer;
    list-style: none;
}
.gencalc-advanced-summary::-webkit-details-marker { display: none; }
.gencalc-advanced-summary:hover { background: #f4f6f8; border-radius: 8px 8px 0 0; }
.gencalc-advanced-summary:focus-visible {
    outline: 2px solid #FAA747;
    outline-offset: -2px;
    border-radius: 8px;
}
.gencalc-advanced-summary-text {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.gencalc-advanced-summary-title {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #1a1a1a;
}
.gencalc-advanced-summary-hint {
    font-size: 11.5px;
    color: #888;
    line-height: 1.5;
}
.gencalc-advanced-summary-chevron {
    color: #888; font-size: 11px;
    flex-shrink: 0; margin-top: 4px;
    transition: transform .2s ease;
}
.gencalc-advanced-block[open] .gencalc-advanced-summary-chevron { transform: rotate(180deg); }
.gencalc-advanced-block[open] > :not(summary) {
    padding: 0 16px 16px;
}
.gencalc-advanced-block[open] > .gencalc-site-conditions {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid #f0f1f3;
}

/* ── Legacy chip-stop CSS (kept for back-compat with any third-party reuse) ── */
.gencalc-margin {
    border: 0;
    padding: 0;
    margin: 0 0 24px;
}

.gencalc-margin .gencalc-section-label {
    margin: 0 0 6px;
}

/* Chip row sits below the helper text, full-width */
.gencalc-margin-stops {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* "or" divider — quiet italic label between the preset chips and the
   custom-value pill. Advanced Mode only; hidden in Basic. */
.gencalc-margin-or {
    display: none;
    color: #9aa0a6;
    font-size: 12px;
    font-style: italic;
    margin: 0 6px 0 4px;
    font-family: 'JCBEuro Roman Regular', sans-serif;
}
body.gencalc-advanced-on .gencalc-margin-or { display: inline-block; }

/* Basic mode = zero-experience users: engineering assumptions stay on their
   defaults (hidden inputs still post), controls appear only in Advanced. */
body:not(.gencalc-advanced-on) .gencalc-adv-only {
    display: none !important;
}

/* Custom % input — pill-shaped to match the preset chips. The pill
   itself carries the border + hover/focus styling; the input inside
   is borderless so the whole thing reads as one component. */
.gencalc-margin-custom {
    display: none;
    align-items: center;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 999px;
    padding: 0 14px 0 16px;
    cursor: text;
    transition: border-color .15s, box-shadow .15s;
}
body.gencalc-advanced-on .gencalc-margin-custom { display: inline-flex; }
.gencalc-margin-custom:hover { border-color: #FAA747; }
.gencalc-margin-custom:focus-within {
    border-color: #FAA747;
    box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.2);
}
.gencalc-margin-custom input[type="number"] {
    width: 36px;
    padding: 9px 0;
    border: 0;
    background: transparent;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: right;
    -moz-appearance: textfield;
}
.gencalc-margin-custom input[type="number"]::-webkit-outer-spin-button,
.gencalc-margin-custom input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.gencalc-margin-custom input[type="number"]:focus { outline: none; }
.gencalc-margin-custom input[type="number"]::placeholder {
    color: #c5c8cd;
    font-weight: 400;
}
.gencalc-margin-custom-suffix {
    color: #FAA747;
    font-weight: 700;
    font-size: 13px;
    padding-left: 4px;
}
/* Out-of-range state — red border + red % so the user sees the value
   they typed is outside the accepted [0, 50] range. On blur the value
   snaps to the clamped equivalent and this class is removed. */
.gencalc-margin-custom.is-out-of-range {
    border-color: #c0392b;
    background: #fdecea;
}
.gencalc-margin-custom.is-out-of-range .gencalc-margin-custom-suffix {
    color: #c0392b;
}
.gencalc-margin-custom.is-out-of-range input[type="number"] {
    color: #c0392b;
}

@media (max-width: 480px) {
    .gencalc-margin-or {
        display: none;
    }
    body.gencalc-advanced-on .gencalc-margin-or { display: none; }
    .gencalc-margin-custom {
        flex-basis: 100%;
        margin-top: 4px;
        justify-content: center;
    }
}

.gencalc-margin-stop {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    padding: 9px 18px;
    cursor: pointer;
    border-radius: 999px;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 13.5px;
    color: #1a1a1a;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
    transition: border-color .15s, background .15s, color .15s;
}

.gencalc-margin-stop > span {
    color: #FAA747;
    font-weight: 600;
    font-size: 13px;
}

.gencalc-margin-stop:hover {
    border-color: #FAA747;
    background: #fffaf2;
}

.gencalc-margin-stop:focus-visible {
    outline: none;
    border-color: #FAA747;
    box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.25);
}

.gencalc-margin-stop.is-active {
    border-color: #FAA747;
    background: #FAA747;
    color: white;
}
.gencalc-margin-stop.is-active > span {
    color: rgba(255,255,255,0.9);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.gencalc-btn[hidden] {
    display: none;
}

.gencalc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1.5px solid transparent;
    background: transparent;
    color: #1a1a1a;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 14px;
    padding: 12px 22px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: all 0.2s ease;
}
.gencalc-btn > i {
    font-size: 13px;
    flex-shrink: 0;
}

.gencalc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gencalc-btn--primary {
    background: #FAA747;
    color: #000;
    border-color: #FAA747;
}
.gencalc-btn--primary:hover:not(:disabled) {
    background: #e0942f;
    border-color: #e0942f;
}
/* Idle CTA — at zero loads the Calculate button is disabled and drops to a
   muted state so the page's primary orange isn't spent on a dead end. The
   gray itself is the signal — skip the generic :disabled half-opacity fade.
   #gencalcSubmitHint below the button says why. */
.gencalc-btn--primary.gencalc-btn--idle {
    background: #e8eaed;
    border-color: #e8eaed;
    color: #9aa0a6;
    opacity: 1;
}
.gencalc-submit-hint {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: #9aa0a6;
    text-align: center;
}
.gencalc-submit-hint[hidden] { display: none !important; }

.gencalc-btn--secondary {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}
.gencalc-btn--secondary:hover:not(:disabled) {
    background: #333;
    border-color: #333;
}

.gencalc-btn--ghost {
    background: transparent;
    border-color: #d2d2d2;
    color: #1a1a1a;
}
.gencalc-btn--ghost:hover:not(:disabled) {
    border-color: #FAA747;
    color: #FAA747;
}

.gencalc-btn--accent {
    background: transparent;
    border-color: #d2d2d2;
    color: #1a1a1a;
}
.gencalc-btn--accent > i { color: #FAA747; }
.gencalc-btn--accent:hover:not(:disabled) {
    border-color: #FAA747;
    background: #fff7ec;
    color: #1a1a1a;
}
.gencalc-btn--accent:hover:not(:disabled) > i { color: #FAA747; }

.gencalc-btn--small {
    padding: 8px 14px;
    font-size: 12px;
}

.gencalc-btn--block {
    display: flex;
    width: 100%;
}

.gencalc-submit-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.gencalc-error,
.gencalc-success {
    font-size: 13px;
    margin: 4px 0 0;
    padding: 8px 12px;
    border-radius: 4px;
}
.gencalc-error {
    color: #c0392b;
    background: #fdecea;
    border: 1px solid #f5b7b1;
}
.gencalc-success {
    color: #1e7d3a;
    background: #e8f8ee;
    border: 1px solid #b5e3c4;
}

/* Autosave status — small muted line under the Calculate button. */
.gencalc-save-status {
    margin: 8px 0 0;
    font-size: 11.5px;
    color: #888;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    align-self: flex-start;
}
.gencalc-save-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c8c8c8;
    display: inline-block;
    flex: none;
    transition: background-color .2s ease;
}
.gencalc-save-status[data-state="saved"]  .gencalc-save-status-dot { background: #2f6b3b; }
.gencalc-save-status[data-state="saving"] .gencalc-save-status-dot { background: #b18800; }
.gencalc-save-status[data-state="error"]  .gencalc-save-status-dot { background: #c25a0c; }
.gencalc-save-status[data-state="error"] { color: #b53a17; }

/* ── Result section ────────────────────────────────────────────────────── */
.gencalc-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.gencalc-result-title {
    font-family: 'JCBEuro BoldCondensed Regular', sans-serif;
    font-size: 28px;
    margin: 0;
    color: #000;
    text-transform: uppercase;
}

/* Totals strip styling moved to Phase 7 result-section block below */

/* ── Recommended card ──────────────────────────────────────────────────── */
.gencalc-rec-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    background: #fff;
    border: 2px solid #FAA747;
    border-radius: 8px;
    padding: 22px;
    margin-bottom: 28px;
}

.gencalc-rec-image {
    background: #f0f2f5;
    border-radius: 6px;
    padding: 12px;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gencalc-rec-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gencalc-rec-eyebrow {
    color: #FAA747;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 2px;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    margin: 0 0 6px;
}

.gencalc-rec-name {
    font-family: 'JCBEuro BoldCondensed Regular', sans-serif;
    font-size: 26px;
    margin: 0 0 14px;
    text-transform: uppercase;
}

.gencalc-rec-specs {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
}

.gencalc-rec-specs li {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #ececec;
    padding: 4px 0;
    font-size: 13px;
}

.gencalc-rec-specs li > span {
    color: #777;
}

.gencalc-rec-specs li > strong {
    color: #1a1a1a;
    font-family: 'JCBEuro Bold Regular', sans-serif;
}

.gencalc-rec-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Small-load nudge (load below fleet minimum) ───────────────────────── */
.gencalc-small-load-notice {
    background: #f1f5f9;
    border-left: 4px solid #FAA747;
    padding: 14px 18px;
    margin: 0 0 20px;
    color: #1a1a1a;
    font-family: 'JCBEuro Roman Regular', sans-serif;
}

.gencalc-small-load-notice strong {
    display: block;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 14px;
    margin-bottom: 4px;
}

.gencalc-small-load-notice p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #444;
}

/* ── Sync notice (no fleet match) ──────────────────────────────────────── */
.gencalc-sync-notice {
    background: #fff8eb;
    border: 1.5px solid #FAA747;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 28px;
}

.gencalc-sync-notice h3 {
    font-family: 'JCBEuro BoldCondensed Regular', sans-serif;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.gencalc-sync-notice p {
    margin: 0 0 16px;
    color: #444;
}

/* ── Alternates ────────────────────────────────────────────────────────── */
.gencalc-alternates-title {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #777;
    margin: 0 0 12px;
}

.gencalc-alternates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.gencalc-alt-card {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 14px;
    background: #fafbfc;
    border: 1px solid #ececec;
    border-radius: 6px;
    padding: 14px;
}

.gencalc-alt-image {
    background: #f0f2f5;
    border-radius: 4px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gencalc-alt-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gencalc-alt-body h4 {
    font-family: 'JCBEuro BoldCondensed Regular', sans-serif;
    font-size: 16px;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.gencalc-alt-body p {
    margin: 0 0 6px;
    font-size: 13px;
    color: #666;
}

.gencalc-link {
    color: #FAA747;
    text-decoration: none;
    font-size: 13px;
    font-family: 'JCBEuro Bold Regular', sans-serif;
}
.gencalc-link:hover {
    text-decoration: underline;
}

/* ── Result CTAs ───────────────────────────────────────────────────────── */
.gencalc-result-ctas {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid #ececec;
}

.gencalc-result-ctas .gencalc-btn {
    flex: 1;
    min-width: 220px;
    padding: 16px 24px;
    font-size: 15px;
}

/* ── Modal ─────────────────────────────────────────────────────────────── */
.gencalc-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gencalc-modal[hidden] {
    display: none;
}

.gencalc-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.gencalc-modal-panel {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.gencalc-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}
.gencalc-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.gencalc-modal-title {
    font-family: 'JCBEuro BoldCondensed Regular', sans-serif;
    font-size: 24px;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.gencalc-modal-subtitle {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 24px;
}

.gencalc-modal-form .gencalc-field {
    margin-bottom: 16px;
}

.gencalc-modal-form .cf-turnstile {
    margin: 0 0 16px;
    min-height: 65px;
}

.gencalc-modal-fineprint {
    font-size: 11px;
    color: #888;
    text-align: center;
    margin: 12px 0 0;
}

/* ── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    /* Drop the outer card framing on mobile. The calculator IS the page —
       no shadow, no border, no chunky padding. The inner step cards
       (.gencalc-step) already have their own white surface and border, so
       they become the visible chunks. This kills the "iframe pushed into
       the page" feel. */
    .gencalc-app { padding: 20px 0 32px; }
    .gencalc-app .gencalc-container { padding: 0 12px; }
    .gencalc-wizard, .gencalc-result {
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 0;
        border-radius: 0;
    }

    .gencalc-mode {
        grid-template-columns: 1fr;
    }

    .gencalc-totals {
        grid-template-columns: 1fr;
    }

    .gencalc-rec-card {
        grid-template-columns: 1fr;
    }

    .gencalc-rec-specs {
        grid-template-columns: 1fr;
    }

    .gencalc-alternates-grid {
        grid-template-columns: 1fr;
    }

    .gencalc-modal-panel {
        padding: 24px;
    }
}

/* ── Spreadsheet import modal ──────────────────────────────────────────── */
.gencalc-import-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'JCBEuro Roman Regular', sans-serif;
}

.gencalc-import-modal[hidden] {
    display: none;
}

.gencalc-import-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.gencalc-import-modal__dialog {
    position: relative;
    background: #fff;
    color: #1a1a1a;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 28px 28px 24px;
    border-top: 4px solid #FAA747;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

.gencalc-import-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 0;
    color: #888;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.gencalc-import-modal__close:hover { color: #1a1a1a; background: rgba(0, 0, 0, 0.05); }

.gencalc-import-modal__title {
    font-family: 'JCBEuro BoldCondensed Regular', sans-serif;
    font-size: 22px;
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gencalc-import-modal__body {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

.gencalc-import-modal__intro {
    margin: 0 0 16px;
    color: #444;
}
.gencalc-import-modal__intro--ok    { color: #16a34a; }
.gencalc-import-modal__intro--error { color: #c0392b; }

.gencalc-import-modal__hint {
    font-size: 12px;
    color: #888;
    margin: 8px 0 0;
}

.gencalc-import-modal__zone-prompt {
    padding: 16px 18px;
    background: #fff8eb;
    border-left: 4px solid #FAA747;
}
.gencalc-import-modal__zone-prompt h4 {
    margin: 0 0 8px;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 15px;
    color: #1a1a1a;
}
.gencalc-import-modal__zone-prompt p {
    margin: 0;
    font-size: 13.5px;
    color: #444;
    line-height: 1.5;
}
.gencalc-import-modal__zone-prompt em {
    font-style: italic;
    color: #1a1a1a;
}

/* Gate error block shown when an advanced CSV is rejected in Basic mode. */
.gencalc-import-modal__gate-error {
    padding: 16px;
    background: #fff8f0;
    border-left: 3px solid #FAA747;
    border-radius: 4px;
}
.gencalc-import-modal__gate-error-msg {
    margin: 0 0 10px;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}
.gencalc-import-modal__gate-ctas {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}
.gencalc-import-modal__gate-link {
    color: #FAA747;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    text-decoration: underline;
}

/* ── Upload step: numbered steps ─────────────────────────────────── */
.gencalc-import-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
}
.gencalc-import-step__num {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    color: #fff;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 12px;
}
.gencalc-import-step__label {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #666;
}

/* ── Upload step: type cards ─────────────────────────────────────── */
.gencalc-import-types {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 22px;
}
.gencalc-import-type {
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.gencalc-import-type:hover { border-color: #c9ccd1; }
.gencalc-import-type.is-selected {
    border-color: #FAA747;
    box-shadow: inset 3px 0 0 #FAA747;
    background: #fff8eb;
}
.gencalc-import-type__head {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 15px;
}
.gencalc-import-type__radio {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 2px solid #c4c8cd;
    border-radius: 50%;
    position: relative;
    background: #fff;
}
.gencalc-import-type.is-selected .gencalc-import-type__radio { border-color: #FAA747; }
.gencalc-import-type.is-selected .gencalc-import-type__radio::after {
    content: "";
    position: absolute;
    inset: 2.5px;
    border-radius: 50%;
    background: #FAA747;
}
.gencalc-import-type__text { flex: 1 1 auto; }
.gencalc-import-type__name {
    display: block;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    line-height: 1.2;
}
.gencalc-import-type__desc {
    display: block;
    font-size: 12.5px;
    color: #666;
    margin-top: 3px;
    line-height: 1.4;
}
.gencalc-import-type__body {
    display: none;
    padding: 0 15px 15px 44px;
}
.gencalc-import-type.is-selected .gencalc-import-type__body { display: block; }
.gencalc-import-type__tpl {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.gencalc-import-type__tpl-label {
    font-size: 12px;
    color: #666;
    margin-right: 2px;
}
.gencalc-import-tpl-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid #FAA747;
    background: #fff;
    color: #f29c3a;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 12.5px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.gencalc-import-tpl-btn:hover { background: #FAA747; color: #fff; }
.gencalc-import-tpl-btn svg { display: block; }
.gencalc-import-tpl-btn .ext {
    font-size: 10px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.gencalc-import-type__caption {
    margin: 9px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: #666;
}

/* Dropzone icon for the file-chooser. */
.gencalc-import-modal__file-icon {
    color: #b9bdc3;
    transition: color 0.15s ease;
}
.gencalc-import-modal__file:hover .gencalc-import-modal__file-icon { color: #FAA747; }

.gencalc-import-modal__file {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 20px;
    border: 2px dashed #d1d5db;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.gencalc-import-modal__file:hover {
    border-color: #FAA747;
    background: rgba(250, 167, 71, 0.05);
}
.gencalc-import-modal__file input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
}
.gencalc-import-modal__file-cta {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 14px;
    color: #1a1a1a;
}
.gencalc-import-modal__file-hint {
    font-size: 12px;
    color: #888;
}

.gencalc-import-modal__error {
    margin: 12px 0 0;
    padding: 10px 12px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 13px;
    border-left: 3px solid #c0392b;
}

.gencalc-import-modal__mapping {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 4px 2px;
}

.gencalc-import-modal__map-row {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: #f7f8fa;
    border: 1px solid #e5e7eb;
}

.gencalc-import-modal__map-info strong {
    display: block;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 13px;
    color: #1a1a1a;
    margin-bottom: 2px;
}
.gencalc-import-modal__map-samples {
    font-size: 12px;
    color: #666;
    word-break: break-word;
}

.gencalc-import-modal__map-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
}

.gencalc-import-modal__errors {
    margin: 12px 0 16px;
    padding: 10px 14px 10px 28px;
    background: #fee2e2;
    color: #991b1b;
    border-left: 3px solid #c0392b;
    font-size: 13px;
    max-height: 200px;
    overflow-y: auto;
}
.gencalc-import-modal__errors li {
    margin-bottom: 4px;
}

.gencalc-import-modal__notices {
    margin: 12px 0 16px;
    font-size: 13px;
    color: #555;
}
.gencalc-import-modal__notices summary {
    cursor: pointer;
    color: #16a34a;
    font-family: 'JCBEuro Bold Regular', sans-serif;
}
.gencalc-import-modal__notices ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

/* Settings + Project Details preview blocks (XLSX multi-sheet import). */
.gencalc-import-settings,
.gencalc-import-project {
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #f6f6f6;
    border-left: 3px solid #f29c3a;
    border-radius: 4px;
}
.gencalc-import-settings h4,
.gencalc-import-project h4 {
    margin: 0 0 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
    font-family: 'JCBEuro Bold Regular', sans-serif;
}
.gencalc-import-settings ul,
.gencalc-import-project ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.gencalc-import-setting {
    font-size: 13px;
    padding: 2px 0;
}
.gencalc-import-setting--warn {
    color: #b65b00;
}

.gencalc-import-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}
/* Upload step only: the foot-note's auto right-margin pushes the action
   buttons to the right while it sits left. Steps without a foot-note keep
   the default flex-end right-alignment. */
.gencalc-import-modal__foot-note {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
    margin-right: auto;
}

body.gencalc-import-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .gencalc-import-modal { padding: 12px; }
    .gencalc-import-modal__dialog { padding: 24px 18px 18px; }
    .gencalc-import-modal__map-row { grid-template-columns: 1fr; }
    .gencalc-import-modal__title { font-size: 18px; }
}

/* ── Industry preset cards (Issue #9) ──────────────────────────────── */
.gencalc-industry { margin-bottom: 24px; }

/* Card grid — all 6 cards in a single row on desktop. Tablet + phone
   fall back to 2 columns. */
.gencalc-industry-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.gencalc-industry-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 18px 10px 14px;
  min-height: 44px;
  background: #fff;
  border: 2px solid #e5e7eb;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.gencalc-industry-card:hover {
  border-color: #FAA747;
  background: #fffaf2;
}
.gencalc-industry-card:focus-visible {
  outline: 2px solid #FAA747;
  outline-offset: 2px;
}
.gencalc-industry-card[aria-pressed="true"] {
  border-color: #FAA747;
  background: #fff7e6;
  box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.18);
}

.gencalc-industry-card-icon {
  font-size: 26px;
  line-height: 1;
  display: block;
  color: #FAA747;
  transition: color 0.2s ease;
}
.gencalc-industry-card[aria-pressed="true"] .gencalc-industry-card-icon {
  color: #c8820a;
}
.gencalc-industry-card-label {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.gencalc-industry-card[aria-pressed="true"] .gencalc-industry-card-label {
  color: #c8820a;
}
/* ? help icon — pinned to the top-right corner so it doesn't affect the
   centered icon/label stack. Click bubbles to the card (still selects the
   industry) but tooltip activates on hover/focus. */
.gencalc-industry-card-help {
  position: absolute;
  top: 8px;
  right: 8px;
  margin-left: 0;
}
/* Tooltip pointing down-from-help would clip on the top row of cards.
   Anchor it below the icon instead. */
.gencalc-industry-card-help .gencalc-tooltip {
  bottom: auto;
  top: calc(100% + 8px);
}
.gencalc-industry-card-help .gencalc-tooltip::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #1a1a1a;
}

/* Sub-chip row — appears below the 3 macro cards once a macro is
   selected. Lets the user swap to a specific industry within that
   macro group (e.g. picked Entertainment, can swap from Events to
   Tents / Hotels / Film). */
.gencalc-industry-sub {
  margin: 10px 0 6px;
  padding: 12px 14px;
  background: #fafbfc;
  border: 1px solid #f0f1f3;
  border-left: 3px solid #FAA747;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gencalc-industry-sub[hidden] { display: none; }
.gencalc-industry-sub-label {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9aa0a6;
}
.gencalc-industry-sub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gencalc-industry-subchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #fff;
  border: 1.5px solid #cccfd2;
  border-radius: 999px;
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.gencalc-industry-subchip[hidden] { display: none; }
.gencalc-industry-subchip > i {
  font-size: 14px;
  color: #5a5f63;
}
.gencalc-industry-subchip:hover {
  border-color: #FAA747;
  background: #fffaf2;
}
.gencalc-industry-subchip:focus-visible {
  outline: 2px solid #FAA747;
  outline-offset: 2px;
}
.gencalc-industry-subchip[aria-pressed="true"] {
  border-color: #FAA747;
  background: #FAA747;
  color: #fff;
  font-weight: 600;
}
.gencalc-industry-subchip[aria-pressed="true"] > i {
  color: #fff;
}

/* "Skip" text link below the cards */
.gencalc-industry-skip {
  margin: 4px 0 0;
}
.gencalc-industry-skip-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: #888;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gencalc-industry-skip-btn:hover { color: #555; }

/* 3 macro cards — full width at desktop. Tablet/phone keeps 3 columns
   (cards are roomy at any viewport). Tighter padding at narrow widths. */
@media (max-width: 600px) {
  .gencalc-industry-card { justify-content: center; }
  .gencalc-industry-sub-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .gencalc-industry-subchip {
    justify-content: center;
    padding: 8px 10px;
  }
}
@media (max-width: 480px) {
  .gencalc-industry-cards { gap: 6px; }
  .gencalc-industry-card {
    padding: 12px 8px 10px;
    min-height: 88px;
  }
  .gencalc-industry-card-icon { font-size: 22px; }
  .gencalc-industry-card-label { font-size: 12px; }
}

/* ── Generic custom picker (any <select data-picker>) ──────────────────
   Same aesthetic as the industry picker, abstracted so every dropdown
   on the calculator wears the brand's industrial chrome instead of
   falling back to the OS-default select. */
.gencalc-picker {
    position: relative;
    display: block;
    width: 100%;
}
/* Hide the source <select> once enhanced — keeps it in the form post
   without taking layout space. */
select[data-picker-enhanced] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    clip: rect(0 0 0 0);
    overflow: hidden;
}
.gencalc-picker-trigger {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    /* Match the height of native inputs in .gencalc-field so a row of
       Description/Power/Unit/Phase/Qty all share the same baseline. */
    padding: 9px 12px;
    background: white;
    border: 1.5px solid #d1d5db;
    font-family: inherit;
    font-size: 13.5px;
    color: #1a1a1a;
    text-align: left;
    cursor: pointer;
    line-height: 1.4;
    transition: border-color .12s, box-shadow .12s;
}
.gencalc-picker-trigger:hover { border-color: #999; }
.gencalc-picker--disabled .gencalc-picker-trigger,
.gencalc-picker-trigger:disabled {
    background: #f5f5f5;
    color: #999;
    border-color: #e5e5e5;
    cursor: not-allowed;
}
.gencalc-picker--disabled .gencalc-picker-trigger:hover,
.gencalc-picker-trigger:disabled:hover { border-color: #e5e5e5; }
.gencalc-picker--disabled .gencalc-picker-caret { opacity: 0.4; }
.gencalc-picker-trigger:focus-visible,
.gencalc-picker[data-open="true"] .gencalc-picker-trigger {
    border-color: #FAA747;
    outline: none;
    box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.15);
}
.gencalc-picker-label {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 500;
}
.gencalc-picker-caret {
    color: #999;
    font-size: 10px;
    transition: transform .15s;
    margin-left: auto;
    flex-shrink: 0;
}
.gencalc-picker[data-open="true"] .gencalc-picker-caret { transform: rotate(180deg); }

.gencalc-picker-panel {
    position: absolute; top: calc(100% + 4px); left: 0;
    z-index: 1000;
    min-width: 100%;
    width: max-content;
    max-width: 320px;
    background: white;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    padding: 6px 0;
    max-height: 360px;
    overflow-y: auto;
}
.gencalc-picker-panel[hidden] { display: none; }

.gencalc-picker-group { padding: 2px 0; }
.gencalc-picker-group + .gencalc-picker-group {
    border-top: 1px solid #f0f1f3;
    margin-top: 4px;
    padding-top: 6px;
}
.gencalc-picker-group-label {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 10px;
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 14px 4px;
}
.gencalc-picker-option {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 8px 14px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 13px;
    color: #1a1a1a;
    text-align: left;
    cursor: pointer;
    line-height: 1.2;
    transition: background-color .12s;
}
.gencalc-picker-option:hover { background: #fafbfc; }
.gencalc-picker-option-icon {
    width: 16px; text-align: center;
    color: #888; font-size: 13px;
    flex-shrink: 0;
}
.gencalc-picker-option > span { flex: 1; }
.gencalc-picker-option:hover > .gencalc-picker-option-icon { color: #FAA747; }
.gencalc-picker-check {
    color: #FAA747; font-size: 11px; opacity: 0; flex-shrink: 0;
}
.gencalc-picker-option[aria-selected="true"] { background: #fffaf2; }
.gencalc-picker-option[aria-selected="true"] > .gencalc-picker-option-icon { color: #FAA747; }
.gencalc-picker-option[aria-selected="true"] > span { font-weight: 600; }
.gencalc-picker-option[aria-selected="true"] .gencalc-picker-check { opacity: 1; }

/* Two-line option (data-help on the <option>) — main label on top, a
   muted plain-language gloss below. Used for jargon-heavy fields like
   Start method (DOL / Star-Delta / VFD) where the bare term doesn't
   communicate to non-engineers. */
.gencalc-picker-option--has-help {
    align-items: flex-start;
    padding-top: 9px; padding-bottom: 9px;
}
.gencalc-picker-option-stack {
    display: flex; flex-direction: column; gap: 2px;
    flex: 1;
    min-width: 0;
}
.gencalc-picker-option-label {
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.25;
}
.gencalc-picker-option-help {
    font-size: 11.5px;
    line-height: 1.35;
    color: #6b7280;
    font-weight: 400;
    white-space: normal;
}
.gencalc-picker-option--has-help .gencalc-picker-check {
    margin-top: 3px;
}
.gencalc-picker--compact .gencalc-picker-option-help {
    font-size: 11px;
}

/* Compact variant — same trigger height as the default so a load-row
   stays aligned (Description/Power input ↔ Unit/Phase picker), only
   the panel options use the smaller text since they aren't space-constrained. */
.gencalc-picker--compact .gencalc-picker-trigger {
    padding: 9px 10px;
    gap: 6px;
}
.gencalc-picker--compact .gencalc-picker-option {
    padding: 7px 12px;
    font-size: 12.5px;
}

/* ── Top toolbar (Task 22) ──────────────────────────────────────────── */
.gencalc-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  background: #f7f8fa; padding: 10px 14px; border-radius: 8px;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.gencalc-toolbar-left { display: flex; gap: 8px; flex-wrap: wrap; }
.gencalc-toolbar-right { display: flex; align-items: center; gap: 12px; }

/* Toast — small slide-in notification at the bottom of the viewport. */
/* ── Branded confirm dialog ─────────────────────────────────────────────
   Replaces window.confirm() for destructive actions (Reset). Sharp
   corners, orange accent on the icon strip, danger variant flips the
   confirm button to red. */
.gencalc-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.18s ease;
}
.gencalc-confirm-overlay.is-visible { opacity: 1; }
.gencalc-confirm {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: 4px solid #FAA747;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
    padding: 26px 24px 20px;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.18s ease;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    color: #1a1a1a;
}
.gencalc-confirm-overlay.is-visible .gencalc-confirm {
    transform: translateY(0) scale(1);
}
.gencalc-confirm.is-danger {
    border-top-color: #c0392b;
}
.gencalc-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fffaf2;
    color: #FAA747;
    font-size: 17px;
    margin-bottom: 14px;
}
.gencalc-confirm.is-danger .gencalc-confirm-icon {
    background: #fdecec;
    color: #c0392b;
}
.gencalc-confirm-title {
    margin: 0 0 8px;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 17px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #1a1a1a;
}
.gencalc-confirm-message {
    margin: 0 0 22px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #555;
}
.gencalc-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.gencalc-confirm-btn {
    border: 1.5px solid transparent;
    padding: 10px 18px;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    min-height: 40px;
}
.gencalc-confirm-btn--ghost {
    background: #fff;
    border-color: #d1d5db;
    color: #4a4a4a;
}
.gencalc-confirm-btn--ghost:hover,
.gencalc-confirm-btn--ghost:focus-visible {
    border-color: #1a1a1a;
    color: #1a1a1a;
    outline: none;
}
.gencalc-confirm-btn--primary {
    background: #FAA747;
    border-color: #FAA747;
    color: #1a1a1a;
}
.gencalc-confirm-btn--primary:hover,
.gencalc-confirm-btn--primary:focus-visible {
    background: #e89530;
    border-color: #e89530;
    outline: none;
}
.gencalc-confirm.is-danger .gencalc-confirm-btn--primary {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}
.gencalc-confirm.is-danger .gencalc-confirm-btn--primary:hover,
.gencalc-confirm.is-danger .gencalc-confirm-btn--primary:focus-visible {
    background: #a02f23;
    border-color: #a02f23;
}

@media (max-width: 480px) {
    .gencalc-confirm { padding: 22px 18px 16px; }
    .gencalc-confirm-actions { flex-direction: column-reverse; }
    .gencalc-confirm-btn { width: 100%; min-height: 44px; }
}

.gencalc-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a1a;
    color: #fff;
    padding: 12px 18px;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 12.5px;
    letter-spacing: 0.4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    z-index: 100001;
    opacity: 0;
    transition: opacity .18s, transform .18s;
    max-width: calc(100vw - 32px);
    text-align: center;
}
.gencalc-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.gencalc-toast .gencalc-toast-link {
    color: #FAA747; text-decoration: underline; font-size: 11.5px;
    margin-left: 10px; cursor: pointer; background: none; border: none;
    font-family: inherit; padding: 0;
}

/* Reset link — sharp-cornered industrial chip in the right edge of the
   "Add your loads" step header. JCB-bold uppercase, neutral gray until
   hover, then turns red to signal the destructive action without
   alarming the eye on idle. Wipes localStorage + reloads. */
.gencalc-reset-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 1px solid #d8dadc;
    padding: 6px 11px;
    margin: 0;
    flex-shrink: 0;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a8f96;
    cursor: pointer;
    border-radius: 2px;
    line-height: 1;
    text-decoration: none;
    transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.gencalc-reset-link:hover,
.gencalc-reset-link:focus-visible {
    color: #c0392b;
    border-color: #c0392b;
    background: rgba(192, 57, 43, 0.04);
    outline: none;
}
.gencalc-reset-link i { font-size: 10px; }
.gencalc-tutorial-btn--accent {
  background: #FAA747; color: white; border-color: #FAA747;
}
.gencalc-tutorial-btn--accent:hover { background: #e89530; border-color: #e89530; }

.gencalc-advanced-toggle {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; color: #555;
}
.gencalc-advanced-toggle input { display: none; }
.gencalc-advanced-toggle-slider {
  width: 36px; height: 20px; background: #d1d5db; border-radius: 10px;
  position: relative; transition: background .15s;
}
.gencalc-advanced-toggle-slider::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: white; border-radius: 50%;
  transition: transform .15s;
}
.gencalc-advanced-toggle input:checked ~ .gencalc-advanced-toggle-slider {
  background: #FAA747;
}
.gencalc-advanced-toggle input:checked ~ .gencalc-advanced-toggle-slider::after {
  transform: translateX(16px);
}

@media (max-width: 600px) {
  .gencalc-toolbar { padding: 8px 12px; gap: 8px; }
  .gencalc-toolbar-left, .gencalc-toolbar-right { flex: 0 0 auto; width: auto; }
}

/* ==== Library Modal — tree navigator (mockup C) ====================
   Two-pane file-manager / CAD-library modal. Left pane is a collapsible
   tree of categories with selection counts; right pane is a card grid
   keyed off the active branch. */

:root {
  --gencalc-lib-orange:      #FAA747;
  --gencalc-lib-orange-dark: #E08F2C;
  --gencalc-lib-orange-soft: #FFF4E3;
  --gencalc-lib-ink:         #1a1a1a;
  --gencalc-lib-ink-2:       #2a2a2a;
  --gencalc-lib-ink-3:       #555;
  --gencalc-lib-ink-4:       #888;
  --gencalc-lib-line:        #e5e7eb;
  --gencalc-lib-line-2:      #f0f1f3;
  --gencalc-lib-bg-tree:     #fafbfc;
  --gencalc-lib-bg-tree-hdr: #fff;
  --gencalc-lib-bg-card:     #ffffff;
  --gencalc-lib-bg-pane:     #e8eaed;
  --gencalc-lib-bg-bar:      #f7f8fa;
  /* Counts/badges use the same JCB family as the rest of the calc to
     match the wizard's industrial-warm voice rather than the CAD /
     terminal feel of monospace. */
  --gencalc-lib-mono:        'JCBEuro Bold Regular', sans-serif;

  /* Multi-Genset Load Roles — role color tokens (JCB ink + brand orange) */
  --gencalc-role-primary:        var(--gencalc-lib-ink);
  --gencalc-role-primary-soft:   var(--gencalc-lib-bg-bar);
  --gencalc-role-secondary:      var(--gencalc-lib-orange);
  --gencalc-role-secondary-soft: var(--gencalc-lib-orange-soft);
}

.gencalc-library-modal {
  position: fixed; inset: 0; z-index: 100000; /* above cookie banner + feedback widget */
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  font-family: 'JCBEuro Roman Regular', sans-serif;
  color: var(--gencalc-lib-ink);
}
.gencalc-library-modal[hidden] { display: none; }
.gencalc-library-modal-backdrop {
  position: absolute; inset: 0; background: rgba(15, 17, 20, 0.55);
}
.gencalc-library-modal-frame {
  position: relative; background: #fff;
  width: 100%; max-width: 1200px;
  height: 820px; max-height: calc(100vh - 48px);
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px -10px rgba(0,0,0,0.45);
}

/* ---- Title bar — light tinted strip matching wizard step headers --- */
.gencalc-library-modal-header {
  height: 48px;
  background: var(--gencalc-lib-bg-bar);
  color: var(--gencalc-lib-ink);
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
  border-bottom: 1px solid var(--gencalc-lib-line);
  flex-shrink: 0;
}
.gencalc-library-modal-badge {
  background: var(--gencalc-lib-orange); color: #1a1a1a;
  padding: 4px 10px;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 11px;
  letter-spacing: 1px; text-transform: uppercase;
  border-radius: 2px;
}
.gencalc-library-modal-header h2 {
  margin: 0;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 13px;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--gencalc-lib-ink);
}
.gencalc-library-modal-meta {
  font-size: 12px; color: var(--gencalc-lib-ink-3);
}
.gencalc-library-modal-meta b { color: var(--gencalc-lib-ink); font-weight: 600; }
.gencalc-library-modal-spacer { flex: 1; }
.gencalc-library-modal-close {
  width: 32px; height: 32px;
  background: transparent; color: var(--gencalc-lib-ink-3);
  border: 1.5px solid var(--gencalc-lib-line);
  border-radius: 3px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: border-color .15s, color .15s, background .15s;
}
.gencalc-library-modal-close:hover {
  background: #fff;
  color: #c0392b;
  border-color: #c0392b;
}

/* ---- Body / panes ------------------------------------------------- */
.gencalc-library-modal-body {
  display: flex; flex: 1;
  overflow: hidden; min-height: 0;
}

/* ---- Left tree pane ---------------------------------------------- */
.gencalc-library-tree-pane {
  width: 28%; min-width: 250px;
  background: var(--gencalc-lib-bg-tree);
  border-right: 1px solid var(--gencalc-lib-line);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.gencalc-library-tree-industry {
  background: var(--gencalc-lib-bg-tree-hdr);
  color: var(--gencalc-lib-ink);
  padding: 0 14px;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--gencalc-lib-line);
  flex-shrink: 0;
  box-sizing: border-box;
}
.gencalc-library-tree-industry[hidden] { display: none; }
.gencalc-library-tree-industry-label {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 11px; letter-spacing: 1px;
  color: var(--gencalc-lib-ink-3); text-transform: uppercase;
}
.gencalc-library-tree-industry-name {
  margin-top: 4px;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 14px;
  letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--gencalc-lib-ink);
}
.gencalc-library-tree-industry-stats {
  margin-top: 6px;
  display: flex; gap: 14px;
  font-size: 11.5px; color: var(--gencalc-lib-ink-3);
}
.gencalc-library-tree-industry-stats b {
  color: var(--gencalc-lib-ink); font-weight: 600;
}

.gencalc-library-tree-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.gencalc-library-tree-scroll::-webkit-scrollbar { width: 8px; }
.gencalc-library-tree-scroll::-webkit-scrollbar-track { background: var(--gencalc-lib-bg-tree); }
.gencalc-library-tree-scroll::-webkit-scrollbar-thumb { background: #c5c8cd; border-radius: 0; }

.gencalc-library-tree-group { border-bottom: 1px solid var(--gencalc-lib-line-2); }

.gencalc-library-tree-node {
  display: flex; align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  cursor: pointer;
  user-select: none;
  position: relative;
  font-size: 13.5px;
  color: var(--gencalc-lib-ink-2);
  border-left: 3px solid transparent;
}
.gencalc-library-tree-node:hover { background: #ebedf0; }
.gencalc-library-tree-node:focus-visible {
  outline: none;
  background: #ebedf0;
  box-shadow: inset 0 0 0 1px var(--gencalc-lib-orange);
}
.gencalc-library-tree-node.is-active {
  background: var(--gencalc-lib-orange-soft);
  border-left-color: var(--gencalc-lib-orange);
  color: var(--gencalc-lib-ink);
  font-weight: 600;
}
/* Tree is now two-level — categories can expand to show their
   subcategory leaves below. Chevron sits to the left of the category
   label and toggles open/closed without changing what's active. */
.gencalc-library-tree-chev {
  background: transparent;
  border: 0;
  padding: 2px 2px;
  margin-right: 4px;
  color: var(--gencalc-lib-ink-4);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  flex: 0 0 auto;
  width: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gencalc-library-tree-chev i {
  display: inline-block;
  transition: transform .15s;
}
.gencalc-library-tree-chev[aria-expanded="false"] i {
  transform: rotate(-90deg);
}
.gencalc-library-tree-chev:hover { color: var(--gencalc-lib-ink-2); }
.gencalc-library-tree-chev-spacer {
  flex: 0 0 auto;
  width: 16px;
  margin-right: 4px;
}

/* Subcategory leaf — indented under its parent category, slightly
   quieter type so the hierarchy reads at a glance. */
.gencalc-library-tree-subleaf {
  padding-left: 38px;
  font-size: 12.5px;
  color: var(--gencalc-lib-ink-3);
  min-height: 28px;
}
.gencalc-library-tree-subleaf .gencalc-library-tree-label {
  font-size: 12.5px;
  color: var(--gencalc-lib-ink-3);
  font-weight: 400;
}
.gencalc-library-tree-subleaf .gencalc-library-tree-count {
  font-size: 12px;
}
.gencalc-library-tree-subleaf.is-active {
  background: var(--gencalc-lib-orange-soft);
  border-left-color: var(--gencalc-lib-orange);
  color: var(--gencalc-lib-ink);
}
.gencalc-library-tree-subleaf.is-active .gencalc-library-tree-label {
  color: var(--gencalc-lib-ink);
  font-weight: 600;
}

/* 'All loads' compact pseudo-row — sits at the top of the flat list,
   acts as the reset / unfiltered view affordance. */
.gencalc-library-tree-all {
  min-height: 30px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--gencalc-lib-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  border-bottom: 1px solid var(--gencalc-lib-line-2);
  margin-bottom: 4px;
}
.gencalc-library-tree-all.is-active {
  color: var(--gencalc-lib-orange-dark);
  background: transparent;
}
.gencalc-library-tree-all .gencalc-library-tree-label { font-size: inherit; flex: 1; }
.gencalc-library-tree-all .gencalc-library-tree-count { color: inherit; }


.gencalc-library-tree-label {
  flex: 1;
  color: var(--gencalc-lib-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}
/* Top-level branch label — a touch larger than nested tree labels so the
   category parents read as the stronger tier. */
.gencalc-library-category-label {
  font-size: 14.5px;
}

/* Count is plain text — not a bordered box, so it doesn't read as a
   second clickable element next to the row. Only flares to orange-bold
   when this branch has actual selections. */
.gencalc-library-tree-count {
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 13px;
  color: var(--gencalc-lib-ink-4);
  background: transparent;
  border: 0;
  padding: 0 4px 0 0;
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.gencalc-library-tree-node.has-selection .gencalc-library-tree-count {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  color: var(--gencalc-lib-orange-dark);
}
.gencalc-library-tree-node.is-active .gencalc-library-tree-count {
  color: var(--gencalc-lib-ink);
  font-family: 'JCBEuro Bold Regular', sans-serif;
}

.gencalc-library-tree-children {
  background: #fff;
}
.gencalc-library-tree-children[hidden] { display: none; }


.gencalc-library-tree-foot {
  padding: 8px 10px;
  border-top: 1px solid var(--gencalc-lib-line);
  background: #fff;
  font-family: var(--gencalc-lib-mono);
  font-size: 10px;
  color: var(--gencalc-lib-ink-4);
  flex-shrink: 0;
  display: flex; justify-content: space-between;
}
.gencalc-library-tree-foot b { color: var(--gencalc-lib-ink-2); font-weight: 600; }

/* ---- Right item pane --------------------------------------------- */
.gencalc-library-item-pane {
  flex: 1;
  display: flex; flex-direction: column;
  background: var(--gencalc-lib-bg-pane);
  overflow: hidden;
  min-width: 0;
}
.gencalc-library-item-toolbar {
  padding: 0 16px;
  min-height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--gencalc-lib-line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  box-sizing: border-box;
}
.gencalc-library-breadcrumb {
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 12px;
  color: var(--gencalc-lib-ink-4);
  display: flex; align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  letter-spacing: 0.2px;
}
.gencalc-library-crumb { color: var(--gencalc-lib-ink-3); }
.gencalc-library-crumb--current { color: var(--gencalc-lib-ink-2); font-weight: 600; }
.gencalc-library-crumb-sep { color: var(--gencalc-lib-ink-4); font-size: 12px; }
.gencalc-library-crumb--switch {
  background: none;
  border: 1px solid transparent;
  padding: 3px 8px;
  margin: 0;
  cursor: pointer;
  color: var(--gencalc-lib-ink-2);
  font-weight: 600;
  font-family: inherit;
  font-size: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 2px;
  transition: background 80ms ease, border-color 80ms ease;
}
.gencalc-library-crumb--switch:hover,
.gencalc-library-crumb--switch[aria-expanded="true"] {
  background: var(--gencalc-lib-bg-pane);
  border-color: var(--gencalc-lib-line);
}
.gencalc-library-crumb-caret {
  font-size: 9px;
  color: var(--gencalc-lib-ink-3);
  line-height: 1;
}
.gencalc-library-industry-picker {
  position: absolute;
  top: calc(100% - 1px);
  left: 16px;
  z-index: 5;
  background: #fff;
  border: 1px solid var(--gencalc-lib-line);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  min-width: 260px;
  padding: 4px 0;
  border-radius: 2px;
}
.gencalc-library-industry-picker button {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  background: none; border: 0; cursor: pointer;
  padding: 8px 14px;
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 12.5px;
  color: var(--gencalc-lib-ink-2);
  text-align: left;
}
.gencalc-library-industry-picker button:hover {
  background: var(--gencalc-lib-bg-pane);
}
.gencalc-library-industry-picker button.is-active {
  color: var(--gencalc-lib-orange);
  font-weight: 600;
}
.gencalc-library-industry-picker button.is-active::after {
  content: '✓';
  color: var(--gencalc-lib-orange);
  font-size: 13px;
}
.gencalc-library-industry-divider {
  border-top: 1px solid var(--gencalc-lib-line);
  margin: 4px 0;
}

.gencalc-library-tree-drawer-btn {
  display: none; /* shown on mobile only */
  width: 26px; height: 26px;
  background: #fff;
  border: 1px solid var(--gencalc-lib-line);
  border-radius: 2px;
  color: var(--gencalc-lib-ink-2);
  cursor: pointer;
  font-size: 12px;
  margin-right: 4px;
}

/* Drawer close × + backdrop are mobile-only; the @media block at the
   bottom of this file overrides their display to show them. */
.gencalc-library-tree-close { display: none; }
.gencalc-library-tree-backdrop { display: none; }

.gencalc-library-search {
  position: relative;
  flex-shrink: 0;
  width: 280px;
  max-width: 40%;
}
.gencalc-library-search i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gencalc-lib-ink-4);
  font-size: 12px;
  pointer-events: none;
}
.gencalc-library-search input {
  width: 100%;
  border: 1.5px solid var(--gencalc-lib-line);
  padding: 8px 12px 8px 32px;
  font-size: 12.5px;
  border-radius: 4px;
  font-family: 'JCBEuro Roman Regular', sans-serif;
  background: #fff;
}
.gencalc-library-search input:focus {
  outline: none;
  border-color: var(--gencalc-lib-orange);
  box-shadow: inset 0 0 0 1px var(--gencalc-lib-orange);
}

/* ---- Items grid -------------------------------------------------- */
.gencalc-library-items {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}
.gencalc-library-items::-webkit-scrollbar { width: 10px; }
.gencalc-library-items::-webkit-scrollbar-track { background: var(--gencalc-lib-bg-pane); }
.gencalc-library-items::-webkit-scrollbar-thumb { background: #c5c8cd; }

.gencalc-library-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gencalc-lib-ink-4);
  font-family: var(--gencalc-lib-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* Section header — has more presence now. The previous styling read as
   a small label rather than a section divider. */
.gencalc-library-group-header {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 14px;
  padding: 10px 0;
  border-bottom: 1.5px solid var(--gencalc-lib-line);
}
.gencalc-library-group-header:not(:first-child) { margin-top: 28px; }
.gencalc-library-group-marker {
  width: 4px; height: 22px;
  background: var(--gencalc-lib-orange);
  flex-shrink: 0;
}
.gencalc-library-group-heading {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 14px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--gencalc-lib-ink);
}
.gencalc-library-group-meta {
  margin-left: auto;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 11.5px;
  color: var(--gencalc-lib-ink-3);
  letter-spacing: 0.4px;
}
.gencalc-library-group-meta b { color: var(--gencalc-lib-ink); font-weight: 700; }

/* Sub-category sticky header inside a category section. Sits below the
   bigger category header at a quieter weight — two-level hierarchy
   reads cleanly without a second tree. White surface + ink rule on
   top so each sub-group reads as its own panel, separated from the
   grey items zone above. Top margin gives the previous group's last
   row room to breathe before the next sub-header lands. */
/* Hairline caption — drops the white panel and top rule so the
   sub-bucket name reads as a chapter mark on the items pane rather
   than a wall of chrome. Background matches the items pane so cards
   still get hidden when scrolling behind the stuck header, but the
   visual weight collapses to a thin tracked label + hairline. */
.gencalc-library-subcat-header {
  position: sticky;
  /* Items pane has padding:14px. top:0 pins below that padding
     leaving a strip where cards leak. top:-14px + horizontal -14px
     margins extend the header to fully cover the padding zone. */
  top: -14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 32px 10px;
  margin: 0 -14px;
  background: var(--gencalc-lib-bg-pane);
  border-top: 0;
  border-bottom: 1px solid var(--gencalc-lib-line-2);
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--gencalc-lib-ink-3);
}
/* Spacing between sub-groups lives on the GRID, not the sub-header.
   Margin on a sticky element creates a dead-zone above the stuck box
   where prior cards leak through; pushing the gap onto the preceding
   grid means it scrolls away with the cards. */
.gencalc-library-grid:not(:last-child) {
  margin-bottom: 18px;
}
.gencalc-library-subcat-toggle {
  background: transparent;
  border: 0;
  padding: 2px 4px;
  margin-left: -6px;
  color: var(--gencalc-lib-ink-4);
  cursor: pointer;
  font-size: 9px;
  line-height: 1;
  opacity: 0.7;
}
.gencalc-library-subcat-toggle:hover { opacity: 1; }
.gencalc-library-subcat-toggle i {
  display: inline-block;
  transition: transform .15s;
}
.gencalc-library-subcat-toggle[aria-expanded="false"] i {
  transform: rotate(-90deg);
}
.gencalc-library-subcat-label {
  flex: 1 1 auto;
  min-width: 0;
}
.gencalc-library-subcat-count {
  flex: 0 0 auto;
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-weight: 400;
  font-size: 10.5px;
  color: var(--gencalc-lib-ink-4);
  letter-spacing: 0.06em;
}
.gencalc-library-subcat-count b {
  color: var(--gencalc-lib-orange-dark, #d97706);
  font-family: 'JCBEuro Bold Regular', sans-serif;
}
/* Hidden state — when sub-group is collapsed, hide its grid */
.gencalc-library-grid[data-subcat-collapsed="true"] {
  display: none;
}

.gencalc-library-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  align-items: start;
}
/* Push the first row of cards down from the sub-header that sits
   directly above it — header + cards were touching with no rhythm. */
.gencalc-library-subcat-header + .gencalc-library-grid {
  margin-top: 14px;
}
/* Critical: grid items default to min-width: auto, which lets card
   content (long descriptions, names) push the cell wider than the
   column. Forcing min-width: 0 lets ellipsis truncation actually
   take effect. */
.gencalc-library-grid > * { min-width: 0; }

/* === Load library card ============================================
   Sectioned anatomy (Header → Data → Description, plus Stepper when
   selected). Standard / Advanced views toggled via the data-view
   attribute on the modal root. Visual reference: card-v11 mockup at
   .superpowers/brainstorm/85689-1778048821/content/card-v11.html
   =================================================================== */

.gencalc-library-card {
  --card-ink:        #0f0f0f;
  --card-ink-3:      #555;
  --card-ink-4:      #888;
  --card-ink-5:      #b3b3b3;
  --card-line:       #d6d8dc;
  --card-line-2:     #f0f1f3;
  --card-bg-data:    #fafbfc;
  --card-bg-stepper: #fff4e3;

  --card-sev-low:    #2f6b3b;
  --card-sev-med:    #b18800;
  --card-sev-high:   #c25a0c;
  --card-sev-vhigh:  #b53a17;

  position: relative;
  background: #ffffff;
  border: 1px solid var(--card-line);
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 15, 15, 0.04), 0 1px 1px rgba(15, 15, 15, 0.06);
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
  font-family: 'JCBEuro Roman Regular', sans-serif;
  color: var(--card-ink);
}
.gencalc-library-card::before {
  content: '';
  position: absolute; inset: 0 auto 0 0;
  width: 3px; background: transparent;
  transition: background .14s ease;
  z-index: 1;
}
.gencalc-library-card:hover {
  border-color: var(--card-ink);
  box-shadow: 0 4px 8px rgba(15, 15, 15, 0.06), 0 2px 3px rgba(15, 15, 15, 0.08);
}
.gencalc-library-card:hover::before { background: var(--gencalc-lib-orange); }
.gencalc-library-card:focus-visible {
  outline: none;
  border-color: var(--card-ink);
  box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.18);
}
.gencalc-library-card:focus-visible::before { background: var(--gencalc-lib-orange); }
.gencalc-library-card.is-selected { border-color: var(--gencalc-lib-orange); }
.gencalc-library-card.is-selected::before { background: var(--gencalc-lib-orange); }

/* Sections */
.gencalc-library-card-section {
  padding: 10px 18px;
  border-bottom: 1px solid var(--card-line-2);
}
.gencalc-library-card-section:last-child { border-bottom: 0; }
.gencalc-library-card-header  { padding: 12px 18px 10px; }
.gencalc-library-card-data    { background: var(--card-bg-data); padding: 12px 18px; }
.gencalc-library-card-desc-section { padding: 10px 18px 12px; }

/* Description is hidden by default; chevron at bottom-right toggles it. */
.gencalc-library-card-desc-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.gencalc-library-card-desc-wrap[hidden] {
  display: none;
}
.gencalc-library-card-desc-wrap {
  padding-top: 8px;
}
.gencalc-library-card-desc-toggle {
  align-self: flex-end;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  margin: -2px -6px -4px 0;
  color: var(--gencalc-lib-ink-4);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  transition: color .12s, transform .15s;
}
.gencalc-library-card-desc-toggle:hover { color: var(--gencalc-lib-ink-2); }
.gencalc-library-card-desc-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.gencalc-library-card-desc-toggle i { display: inline-block; transition: transform .15s; }

/* Header (name + power readout) */
.gencalc-library-card-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.gencalc-library-card-head-power {
  flex: 0 0 auto;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  color: var(--gencalc-lib-ink);
  white-space: nowrap;
  line-height: 1;
}
.gencalc-library-card-head-kw {
  font-size: 18px;
}
.gencalc-library-card-head-unit,
.gencalc-library-card-head-per {
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.gencalc-library-card-head-unit { color: var(--gencalc-lib-ink-3); }
.gencalc-library-card-head-per  { color: var(--gencalc-lib-ink-4); }
.gencalc-library-card-name {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 14px;
  line-height: 1.22;
  letter-spacing: -0.018em;
  color: var(--card-ink);
  margin: 0 0 4px;
}
.gencalc-library-card-compat {
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: var(--card-ink-3);
  margin: 0;
}
.gencalc-library-card-compat-sep {
  color: var(--card-ink-5);
  font-weight: 400;
  margin: 0 4px;
}
.gencalc-library-card-compat-phase {
  color: var(--card-ink-3);
  font-weight: 600;
}

/* Standard data row: Power + Inrush meter */
.gencalc-library-card-std-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
}
.gencalc-library-card-power { line-height: 1; }
.gencalc-library-card-label {
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--card-ink-4);
  margin: 0 0 2px;
}
.gencalc-library-card-power-value {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 22px;
  color: var(--card-ink);
  line-height: 1;
}
.gencalc-library-card-power-unit {
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-weight: 400;
  font-size: 11px;
  color: var(--card-ink-3);
  margin-left: 4px;
}

/* Advanced data: 3-col specs + 2-col meters with internal hairline */
.gencalc-library-card-specs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.gencalc-library-card-spec { text-align: center; }
.gencalc-library-card-spec .gencalc-library-card-label { text-align: center; }
.gencalc-library-card-spec-value {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 18px;
  color: var(--card-ink);
  line-height: 1;
  text-align: center;
}
.gencalc-library-card-unit {
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--card-ink-4);
  margin-left: 3px;
}
.gencalc-library-card-data-divider {
  height: 1px;
  background: var(--card-line-2);
  margin: 10px -18px;
}
.gencalc-library-card-meters-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Severity meter (shared) */
.gencalc-library-card-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.gencalc-meter-name {
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--card-ink-4);
}
.gencalc-meter-readout {
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: var(--card-ink);
}
.gencalc-meter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--card-line);
  flex-shrink: 0;
}
.gencalc-meter-dot--low   { background: var(--card-sev-low); }
.gencalc-meter-dot--med   { background: var(--card-sev-med); }
.gencalc-meter-dot--high  { background: var(--card-sev-high); }
.gencalc-meter-dot--vhigh { background: var(--card-sev-vhigh); }
/* --none uses the default gray fallback (var(--card-line)) */

/* Description */
.gencalc-library-card-desc {
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-weight: 400;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--card-ink-3);
  margin: 0;
  min-height: calc(12.5px * 1.45 * 3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Stepper section (selected) */
.gencalc-library-card-stepper-section {
  padding: 12px 18px 14px;
  background: var(--card-bg-stepper);
  border-top: 1px solid var(--card-line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gencalc-library-card-total {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gencalc-lib-orange-dark);
}
.gencalc-library-stepper {
  display: inline-flex;
  border: 1px solid var(--gencalc-lib-orange);
  background: #fff;
  flex-shrink: 0;
  /* No explicit height — the container sizes to its 28px button content
     plus borders. A pinned 28px height left no room for the borders
     (content-box overflowed the box; border-box clipped the buttons). */
}
.gencalc-library-stepper button,
.gencalc-library-stepper .gencalc-library-item-qty {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-weight: 600;
  font-size: 13px;
  width: 28px; height: 28px;
  background: #fff; color: var(--card-ink);
  border: 0; padding: 0;
  box-sizing: border-box;
  line-height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.gencalc-library-stepper button:hover {
  background: var(--gencalc-lib-orange-soft);
  color: var(--gencalc-lib-orange-dark);
}
.gencalc-library-stepper .gencalc-library-item-qty {
  width: 36px;
  text-align: center;
  cursor: text;
  -moz-appearance: textfield;
}
.gencalc-library-stepper .gencalc-library-item-qty::-webkit-outer-spin-button,
.gencalc-library-stepper .gencalc-library-item-qty::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

/* Gear icon + settings menu (modal header).
   Replaces the old inline Standard/Advanced toggle — same behavior, less
   real-estate. Popover anchors to the gear button at the top-right of
   the modal header, dismissed by outside-click / Escape / item-pick. */
.gencalc-library-settings { position: relative; }
.gencalc-library-settings-btn {
  width: 32px; height: 32px;
  background: transparent;
  border: 1.5px solid var(--gencalc-lib-line);
  border-radius: 3px;
  color: var(--gencalc-lib-ink-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: border-color .12s, color .12s, background .12s;
}
.gencalc-library-settings-btn:hover,
.gencalc-library-settings-btn[aria-expanded="true"] {
  color: var(--gencalc-lib-ink);
  border-color: var(--gencalc-lib-ink);
  background: #fff;
}
.gencalc-library-settings-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--gencalc-lib-line);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  padding: 4px 0;
  border-radius: 2px;
}
.gencalc-library-settings-menu[hidden] { display: none; }
.gencalc-library-settings-section-label {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gencalc-lib-ink-4);
  padding: 8px 14px 4px;
}
.gencalc-library-settings-item {
  display: flex; flex-direction: column; align-items: flex-start;
  width: 100%;
  background: none; border: 0; cursor: pointer;
  padding: 8px 14px;
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 13px;
  color: var(--gencalc-lib-ink-2);
  text-align: left;
  gap: 1px;
}
.gencalc-library-settings-item:hover {
  background: var(--gencalc-lib-bg-pane);
}
.gencalc-library-settings-item.is-active {
  color: var(--gencalc-lib-orange-dark);
  font-weight: 600;
}
.gencalc-library-settings-item.is-active::after {
  content: '✓';
  position: absolute;
  right: 14px;
  color: var(--gencalc-lib-orange);
  font-size: 13px;
  align-self: center;
}
.gencalc-library-settings-item { position: relative; padding-right: 32px; }
.gencalc-library-settings-item-meta {
  font-size: 11px;
  color: var(--gencalc-lib-ink-4);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* View visibility — show only the section matching modalRoot[data-view] */
#gencalcLibraryModal[data-view="standard"] .gencalc-library-card-data--advanced { display: none; }
#gencalcLibraryModal[data-view="advanced"] .gencalc-library-card-data--standard { display: none; }
/* Default (no data-view set) behaves like standard */
#gencalcLibraryModal:not([data-view="advanced"]) .gencalc-library-card-data--advanced { display: none; }

/* ---- Footer / bottom bar ----------------------------------------- */
.gencalc-library-modal-footer {
  height: 56px;
  background: var(--gencalc-lib-bg-bar);
  border-top: 1px solid var(--gencalc-lib-line);
  display: flex; align-items: center;
  padding: 0 16px; gap: 14px;
  flex-shrink: 0;
}
.gencalc-library-summary {
  display: flex; align-items: center; gap: 14px; flex: 1;
  min-width: 0;
}
.gencalc-library-summary-stat {
  display: flex; flex-direction: column;
}
.gencalc-library-summary-label {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gencalc-lib-ink-4);
  font-family: var(--gencalc-lib-mono);
}
.gencalc-library-summary-value {
  font-family: var(--gencalc-lib-mono);
  font-size: 16px; font-weight: 700;
  color: var(--gencalc-lib-ink);
  line-height: 1; margin-top: 2px;
}
.gencalc-library-summary-unit {
  font-size: 11px;
  color: var(--gencalc-lib-ink-4);
  font-weight: 500;
  margin-left: 3px;
}
.gencalc-library-summary-divider {
  width: 1px; height: 32px; background: var(--gencalc-lib-line);
  flex-shrink: 0;
}
.gencalc-library-summary-branches {
  display: flex; align-items: center; gap: 14px;
  min-width: 0; overflow: hidden;
}
.gencalc-library-branch-pills {
  display: flex; gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.gencalc-library-branch-pill {
  background: #fff;
  border: 1px solid var(--gencalc-lib-line);
  color: var(--gencalc-lib-ink-2);
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 11.5px;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
}
.gencalc-library-branch-pill:hover {
  border-color: var(--gencalc-lib-orange-dark);
}
.gencalc-library-branch-pill.is-active {
  background: var(--gencalc-lib-orange-soft);
  border-color: var(--gencalc-lib-orange);
  color: var(--gencalc-lib-ink);
}
.gencalc-library-branch-pill.is-empty {
  color: #aaa; cursor: default;
}
.gencalc-library-branch-pill-n {
  color: var(--gencalc-lib-orange-dark);
  font-weight: 700;
}

.gencalc-library-actions {
  display: flex; gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
/* CTA inside the library modal inherits the generic .gencalc-btn--primary
   style (6px corners, JCB Bold 14px, no uppercase) so it visually
   matches the Calculate / Add Load buttons elsewhere in the calculator. */
.gencalc-library-arrow {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 14px;
}

/* ---- Mobile / narrow viewports ----------------------------------- */
@media (max-width: 720px) {
  .gencalc-library-modal { padding: 0; }
  .gencalc-library-modal-frame {
    max-width: 100%;
    height: 100vh; max-height: 100vh;
    border-radius: 0; border: 0;
  }
  .gencalc-library-modal-meta { display: none; }
  .gencalc-library-modal-body { position: relative; }

  /* Header — hide the long uppercase title on phones; the orange "LIBRARY"
     badge + close button already communicate context. Tighten the header
     so the empty space between badge and ⚙ / × doesn't feel barren. */
  .gencalc-library-modal-header {
    height: 44px;
    padding: 0 12px;
    gap: 8px;
  }
  .gencalc-library-modal-header h2 { display: none; }
  .gencalc-library-modal-close,
  .gencalc-library-settings-btn { width: 28px; height: 28px; font-size: 13px; }

  /* Toolbar — stack vertically so breadcrumb / search / view-toggle each
     get the full width instead of fighting for space in one row. */
  .gencalc-library-item-toolbar {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 10px 12px;
    gap: 8px;
  }
  .gencalc-library-breadcrumb {
    flex: 0 0 auto;
    width: 100%;
  }
  .gencalc-library-search {
    width: 100%;
    max-width: none;
  }
  .gencalc-library-industry-picker { left: 12px; right: 12px; min-width: 0; }
  /* Settings popover sticks closer to the right edge of the viewport. */
  .gencalc-library-settings-menu {
    right: -4px;
    min-width: 200px;
  }

  /* Tree pane becomes a slide-in drawer triggered from the right pane
     header. Stacked panes ate too much vertical room on phones; the
     drawer keeps the breadcrumb + items grid as the primary view. */
  .gencalc-library-tree-pane {
    position: absolute;
    inset: 0 auto 0 0;
    width: 82%; max-width: 320px;
    z-index: 3;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: 4px 0 16px rgba(0,0,0,0.12);
  }
  .gencalc-library-tree-pane.is-open { transform: translateX(0); }

  /* Close × inside the drawer — only visible on mobile, anchored top-right
     of the drawer so the user can dismiss without finding the hamburger. */
  .gencalc-library-tree-close {
    display: flex;
    position: absolute; top: 8px; right: 8px;
    z-index: 1;
    width: 32px; height: 32px;
    background: #fff;
    border: 1.5px solid var(--gencalc-lib-line);
    border-radius: 3px;
    color: var(--gencalc-lib-ink-2);
    cursor: pointer;
    align-items: center; justify-content: center;
    font-size: 14px;
  }
  .gencalc-library-tree-close:hover {
    color: #c0392b; border-color: #c0392b;
  }

  /* Backdrop — covers the items pane behind the open drawer; tap to close. */
  .gencalc-library-tree-backdrop {
    display: block;
    position: absolute; inset: 0;
    background: rgba(15, 17, 20, 0.45);
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }
  .gencalc-library-modal-body.is-drawer-open .gencalc-library-tree-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .gencalc-library-tree-drawer-btn { display: inline-flex; align-items: center; justify-content: center; }
  .gencalc-library-item-pane { width: 100%; }

  /* Footer — single row: condensed summary on the left, Add button on
     the right. Stack labels under their values for the summary stats so
     the row stays slim. Branch pills wrap to a second row when present. */
  .gencalc-library-modal-footer {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 10px;
  }
  .gencalc-library-summary {
    flex: 1 1 0;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 12px;
  }
  .gencalc-library-summary-stat { min-width: 0; }
  .gencalc-library-summary-value { font-size: 14px; }
  .gencalc-library-summary-label { font-size: 10px; letter-spacing: 0.12em; }
  .gencalc-library-summary-divider { display: none; }
  .gencalc-library-summary-branches {
    flex: 1 1 100%;
    order: 2; /* drops below the summary + Add row */
  }
  .gencalc-library-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
  }
  .gencalc-library-actions .gencalc-btn {
    padding: 8px 18px;
    font-size: 13px;
  }

  .gencalc-library-grid {
    grid-template-columns: 1fr;
  }
}

/* Phone-callback bubble + feedback tab can sit above the modal's Add
   button on small screens. Hide them while the picker is open. */
body.gencalc-library-open #feedback-widget,
body.gencalc-library-open #contact-buttons-container {
  display: none !important;
}

/* ── Advanced Mode — per-row Load type + Start method ───────────────── */
/* Both fields toggle in lockstep with Advanced Mode. The JS sets the
   `hidden` attribute on the field <div>; the rule below honours it
   (overriding the .gencalc-field { display: flex } default). */
.gencalc-field[hidden] { display: none; }

/* ── Site Conditions (Advanced mode) ────────────────────────────────── */
.gencalc-site-conditions {
  border: 0;
  padding: 0;
  margin: 0 0 24px;
}
.gencalc-site-conditions[hidden] { display: none; }

/* Subsection blocks — group fields by domain (Environment / Electrical)
   under a quiet uppercase label and a hairline divider, so the panel
   reads as two short tables instead of one long unstructured row. */
.gencalc-site-subsection + .gencalc-site-subsection {
  margin-top: 18px;
}
.gencalc-site-subsection-label {
  display: block;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9aa0a6;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f1f3;
}

.gencalc-site-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.gencalc-site-grid label {
  display: flex; flex-direction: column; gap: 4px; font-size: 12px;
}
.gencalc-site-grid label > span { color: #666; font-weight: 500; }
.gencalc-site-grid select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 8px 28px 8px 12px;
  border: 1.5px solid #d1d5db; border-radius: 6px;
  font-size: 13px; color: #1a1a1a; background-color: white;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M3 4.5l3 3 3-3' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.gencalc-site-grid select:hover { border-color: #b3b6bc; }
.gencalc-site-grid select:focus {
  outline: none; border-color: #FAA747;
  box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.15);
}
.gencalc-site-grid .gencalc-static-row {
  display: flex; flex-direction: column; gap: 4px; font-size: 12px;
}
.gencalc-site-grid .gencalc-static-row > span:first-child {
  color: #666; font-weight: 500;
}
.gencalc-static-value {
  padding: 8px 12px;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background-color: #f7f8fa;
  font-size: 13px;
  color: #1a1a1a;
}
.gencalc-static-value small {
  margin-left: 6px;
  color: #888;
  font-weight: 500;
  font-size: 11px;
}

/* ── Project tolerance controls ─────────────────────────────────────── */
.gencalc-site-subsection .gencalc-iso-chips {
  border: none; padding: 0; margin: 0 0 12px 0;
}
.gencalc-iso-chips-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #1a1a1a;
  margin: 0 0 14px;
  padding: 0;
}
.gencalc-iso-chips-row {
  display: inline-flex; gap: 4px; padding: 3px;
  background: #f1f3f5; border-radius: 8px;
}
.gencalc-iso-chip {
  appearance: none; border: none; background: transparent;
  padding: 6px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 600; color: #444; cursor: pointer;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.gencalc-iso-chip:hover { color: #1a1a1a; }
.gencalc-iso-chip[aria-pressed="true"] {
  background: #fff; color: #1a1a1a;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
}
.gencalc-iso-chip--custom[aria-pressed="true"] {
  background: #fff7e8; color: #b46a08;
  box-shadow: 0 1px 2px rgba(180,106,8,.15), 0 0 0 1px rgba(180,106,8,.18);
}

/* Tighten the new project-tolerances subsection's vertical rhythm so
   five fieldsets stack cleanly. */
.gencalc-site-subsection .gencalc-slider {
  margin-bottom: 12px;
}
.gencalc-site-subsection .gencalc-slider:last-child {
  margin-bottom: 0;
}

/* Two-thumb range slider — load band */
.gencalc-slider-rail--range .gencalc-slider-fill {
  left: var(--gc-lo, 0%);
  right: calc(100% - var(--gc-hi, 100%));
  width: auto;
  transition: left .28s cubic-bezier(.2,.8,.2,1), right .28s cubic-bezier(.2,.8,.2,1);
}
.gencalc-slider-rail--range.is-dragging .gencalc-slider-fill {
  transition: none;
}
.gencalc-slider-rail--range .gencalc-slider-input {
  pointer-events: none;
}
.gencalc-slider-rail--range .gencalc-slider-input::-webkit-slider-thumb {
  pointer-events: auto;
}
.gencalc-slider-rail--range .gencalc-slider-input::-moz-range-thumb {
  pointer-events: auto;
}
.gencalc-slider-readout-sep {
  color: #999;
  padding: 0 4px;
  font-weight: 600;
}

/* Load-band danger zones — wet-stacking floor (<30%) and step-load
   ceiling (>85%). Painted as semi-transparent red overlays on the
   track so the safe envelope is always visible. */
.gencalc-slider-rail--range .gencalc-slider-track {
  background: linear-gradient(
    to right,
    rgba(220, 53, 69, 0.22) 0%,
    rgba(220, 53, 69, 0.22) 30%,
    var(--gc-rail) 30%,
    var(--gc-rail) 85%,
    rgba(220, 53, 69, 0.22) 85%,
    rgba(220, 53, 69, 0.22) 100%
  );
}
/* Readout numerals turn red when their thumb is in a danger zone. */
.gencalc-slider-readout-value.is-danger {
  color: #b3261e;
}

/* ── Result Page — three-recommendation cards (RES-A) ───────────────── */
.gencalc-result-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.gencalc-result-title-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
}
.gencalc-result-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: #888; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.7px;
  margin: 0;
}
.gencalc-result-eyebrow[hidden] { display: none; }
.gencalc-result-eyebrow strong { color: #FAA747; font-weight: 700; }
.gencalc-result-eyebrow-icon { color: #FAA747; font-size: 11px; }
.gencalc-result-reference {
  font-size: 12px; color: #666;
}
.gencalc-result-reference code {
  background: #f3f4f6; padding: 2px 6px; border-radius: 3px;
  font-family: Menlo, Consolas, monospace; font-size: 11px;
}
.gencalc-copy-ref {
  background: none; border: none; cursor: pointer; color: #888;
  padding: 2px 4px; margin-left: 4px;
}
.gencalc-copy-ref:hover { color: #FAA747; }

/* ── Banners — "equipment manifest tag" aesthetic ─────────────────────────
 *
 * Replaces the generic info-blue / amber-warn pattern with a refined paper
 * tag look that fits the calculator's industrial-rental character. Brand
 * orange stripe on the left, warm off-white paper background, JCBEuro
 * typography hierarchy, eyebrow label up top ("SIZING TIP" / "ATTENTION")
 * for "knowledgeable advice" framing instead of "system alert."
 *
 * Same shell handles both --info and --warn variants — only accent colour
 * and eyebrow text change. The motor banner (warn) keeps its FontAwesome
 * icon; the info banner has none. */
/* Banners — minimal alert pattern. Flat tinted background, thin left
   border as the only visual cue, title + body, optional CTA on the right.
   No eyebrow tag, no corner ornament — title text carries the meaning. */
.gencalc-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 14px;
  padding: 12px 14px;
  margin: 0 0 10px;
  border-radius: 3px;
  background: #fafaf7;
  border: 1px solid #ebe6dc;
  border-left: 3px solid #FAA747;
  font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
}
.gencalc-banner[hidden] { display: none; }
.gencalc-banner::before,
.gencalc-banner::after { content: none; }
.gencalc-banner i.fa-solid { display: none; }

/* Title strong: only direct children (top-level title) AND the first
   strong inside a wrapper div (title-then-body banners use that pattern).
   This deliberately does NOT match deeper-nested strong tags inside
   spans/paragraphs/text — those stay inline, which lets us bold inline
   values inside body copy (e.g. "DOL start at <strong>211.8 kVA</strong>
   drives capacity") without forcing line breaks. */
.gencalc-banner > strong,
.gencalc-banner > div > strong:first-child,
.gencalc-banner > p > strong:first-child {
  grid-column: 1;
  grid-row: 1;
  display: block;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 14px;
  line-height: 1.35;
  color: #1a1a1a;
  margin: 0 0 2px;
}
.gencalc-banner p {
  grid-column: 1;
  grid-row: 2;
  margin: 3px 0 0;
  font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #5a5550;
}
.gencalc-banner .gencalc-btn {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  flex-shrink: 0;
}

/* When the banner has only a single text node (no <strong>+<p>), let the
   text occupy the full first column without wasted vertical space. */
.gencalc-banner:not(:has(strong)) p,
.gencalc-banner:not(:has(p)) strong { grid-row: 1 / 3; }

/* Variants — only the left border (and a faint background tint for
   warn/critical/success) differentiates them. Same shape, same density. */
.gencalc-banner--info     { border-left-color: #FAA747; }
.gencalc-banner--warn     { border-left-color: #ea580c; background: #fdf6ec; border-color: #f0d9b3; }
.gencalc-banner--critical { border-left-color: #dc2626; background: #fef5f5; border-color: #f4c2c2; }
.gencalc-banner--success  { border-left-color: #16a34a; background: #f0fdf4; border-color: #bbf7d0; }
.gencalc-banner--note     { border-left-color: #9ca3af; background: #fafafa; border-color: #e5e7eb; }
.gencalc-banner--critical strong { color: #7f1d1d; }
.gencalc-banner--warn strong     { color: #7c2d12; }
.gencalc-banner--success strong  { color: #14532d; }
.gencalc-banner--success i       { color: #16a34a; }
.gencalc-banner--note strong     { color: #374151; }
.gencalc-banner--note i          { color: #6b7280; }

/* ── Status panel — single tabbed surface grouping every banner the
   calc might surface. Three category tabs (Errors / Warnings / Notes)
   sit at the top; clicking a tab swaps which banners are visible
   inside the content area. JS counts visible banners per tab, hides
   empty tabs, and auto-selects the highest-severity non-empty tab on
   render. Empty tabs (count=0) hide entirely so the customer never
   sees "Errors (0)" cluttering the chrome. */
.gencalc-status {
  margin: 12px 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}
/* Collapse the whole panel when no tab has any non-hidden banner. */
.gencalc-status:not(:has(.gencalc-status-tab:not([hidden]))) {
  display: none;
}
.gencalc-status-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 0 4px;
}
.gencalc-status-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.gencalc-status-tab[hidden] { display: none; }
.gencalc-status-tab:hover { background: #f3f4f6; color: #374151; }
.gencalc-status-tab[aria-selected="true"] {
  color: #111827;
  border-bottom-color: #FAA747;
  background: #ffffff;
}
.gencalc-status-tab[data-tab="critical"] i { color: #dc2626; }
.gencalc-status-tab[data-tab="warn"] i     { color: #ea580c; }
.gencalc-status-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.gencalc-status-tab[data-tab="critical"][aria-selected="true"] .gencalc-status-tab-count {
  background: #fee2e2; color: #991b1b;
}
.gencalc-status-tab[data-tab="warn"][aria-selected="true"] .gencalc-status-tab-count {
  background: #ffedd5; color: #9a3412;
}

/* Content area — banners-as-rows aesthetic. Each visible banner becomes
   a flat row with a 3px colored left bar (severity marker), no nested
   card chrome. Hairline divider between rows replaces the gap. Tight
   padding for a quote-sheet feel rather than a card-stack.
   Rules below apply equally to the top panel content and the bottom
   notes fold body (.gencalc-notes-fold-body). */
.gencalc-status-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}
.gencalc-status-content > .gencalc-banner,
.gencalc-notes-fold-body > .gencalc-banner {
  margin: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 12px 16px 12px 24px;
  position: relative;
  align-items: start;
  column-gap: 12px;
}
/* 3px colored left bar — severity at a glance, no full-width tint. */
.gencalc-status-content > .gencalc-banner::before,
.gencalc-notes-fold-body > .gencalc-banner::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 2px;
  background: currentColor;
}
.gencalc-status-content > .gencalc-banner[data-severity="critical"],
.gencalc-notes-fold-body > .gencalc-banner[data-severity="critical"] { color: #dc2626; }
.gencalc-status-content > .gencalc-banner[data-severity="warn"],
.gencalc-notes-fold-body > .gencalc-banner[data-severity="warn"]     { color: #ea580c; }
.gencalc-status-content > .gencalc-banner[data-severity="info"],
.gencalc-notes-fold-body > .gencalc-banner[data-severity="info"]     { color: #FAA747; }
.gencalc-status-content > .gencalc-banner[data-severity="success"],
.gencalc-notes-fold-body > .gencalc-banner[data-severity="success"]  { color: #16a34a; }
.gencalc-status-content > .gencalc-banner[data-severity="note"],
.gencalc-notes-fold-body > .gencalc-banner[data-severity="note"]     { color: #9ca3af; }

/* Unified row style — bold title on its own line, muted body underneath.
   Same selector list covers every markup pattern used across banners. */
.gencalc-status-content > .gencalc-banner > strong,
.gencalc-notes-fold-body > .gencalc-banner > strong,
.gencalc-status-content > .gencalc-banner > div > strong:first-child,
.gencalc-notes-fold-body > .gencalc-banner > div > strong:first-child,
.gencalc-status-content > .gencalc-banner > p > strong:first-child,
.gencalc-notes-fold-body > .gencalc-banner > p > strong:first-child {
  display: block;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  color: #111827;
  font-size: 13.5px;
  line-height: 1.4;
  margin: 0 0 3px;
}
.gencalc-status-content > .gencalc-banner > p,
.gencalc-notes-fold-body > .gencalc-banner > p,
.gencalc-status-content > .gencalc-banner > div > span,
.gencalc-notes-fold-body > .gencalc-banner > div > span {
  display: block;
  font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
  color: #4b5563;
  font-size: 12.5px;
  line-height: 1.55;
  margin: 0;
}
/* Inline strong inside body copy stays inline + gets the bold face. */
.gencalc-status-content > .gencalc-banner > p > strong:not(:first-child),
.gencalc-notes-fold-body > .gencalc-banner > p > strong:not(:first-child),
.gencalc-status-content > .gencalc-banner > div > span strong,
.gencalc-notes-fold-body > .gencalc-banner > div > span strong {
  display: inline;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  color: #1f2937;
}

/* Row divider between consecutive visible banners. */
.gencalc-status-content > .gencalc-banner:not([hidden]) + .gencalc-banner:not([hidden]),
.gencalc-notes-fold-body > .gencalc-banner:not([hidden]) + .gencalc-banner:not([hidden]) {
  border-top: 1px solid #e5e7eb;
}

/* Inline CTAs — slim ghost link, no solid orange fill. */
.gencalc-status-content > .gencalc-banner .gencalc-btn,
.gencalc-notes-fold-body > .gencalc-banner .gencalc-btn {
  align-self: center;
  font-size: 12px;
  padding: 6px 4px;
  background: transparent !important;
  color: currentColor !important;
  border: 0;
  box-shadow: none;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  letter-spacing: 0.01em;
}
.gencalc-status-content > .gencalc-banner .gencalc-btn:hover,
.gencalc-notes-fold-body > .gencalc-banner .gencalc-btn:hover {
  background: transparent !important;
  text-decoration: underline;
}

/* Active-tab filter: hide banners that don't belong to the active tab.
   Notes-severity banners are relocated to the bottom fold by JS, so only
   critical and warn filtering is needed here. */
.gencalc-status[data-active-tab="critical"] .gencalc-status-content > .gencalc-banner:not([data-severity="critical"]) {
  display: none;
}
.gencalc-status[data-active-tab="warn"] .gencalc-status-content > .gencalc-banner:not([data-severity="warn"]) {
  display: none;
}

/* ── Notes & assumptions bottom fold ─────────────────────────────────────
   Collapsed by default (<details> without open). JS un-hides this element
   when note count > 0 and resets open=false on every new calc. Banners
   inside inherit the standard .gencalc-banner row styling. */
.gencalc-notes-fold {
  margin: 8px 0 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}
.gencalc-notes-fold[hidden] { display: none; }
.gencalc-notes-fold-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #f9fafb;
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.gencalc-notes-fold-summary::-webkit-details-marker { display: none; }
.gencalc-notes-fold-summary i { color: #9ca3af; font-size: 13px; }
.gencalc-notes-fold[open] .gencalc-notes-fold-summary {
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}
.gencalc-notes-fold-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.gencalc-notes-fold-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

/* Empty state — visible only when every banner is hidden. */
.gencalc-status-empty {
  margin: 0;
  padding: 14px 16px;
  text-align: center;
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 12px;
  color: #6b7280;
  background: #f9fafb;
}

@media (max-width: 640px) {
  .gencalc-banner { grid-template-columns: 1fr; }
  .gencalc-banner .gencalc-btn {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    margin-top: 8px;
  }
}

.gencalc-totals {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 8px;
  margin: 12px 0 16px;
  text-align: center;
}
/* Explicit [hidden] override — the base rule sets display:grid which would
   otherwise win over the [hidden] attribute's default display:none. JS sets
   hidden=true on .gencalc-totals when dual mode renders the two-mini-strip
   layout instead. Without this rule the empty zero-strip would leak through. */
.gencalc-totals[hidden] { display: none; }
.gencalc-totals-cell { padding: 0 8px; border-right: 1px solid #e5e7eb; position: relative; }
.gencalc-totals-cell:last-child { border-right: none; }
.gencalc-totals-label { font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: 0.4px; display: block; margin-bottom: 4px; }
.gencalc-totals-value { font-size: 16px; color: #1a1a1a; }
.gencalc-totals-secondary { font-size: 11px; color: #888; display: block; margin-top: 2px; }
.gencalc-totals-tooltip { position: absolute; top: 4px; right: 6px; cursor: help; color: #888; font-size: 11px; }

/* ════════ RESULTS REDESIGN 2026-05-30 — hero + action zone ════════ */
.gencalc-result-top{display:grid;grid-template-columns:1fr 290px;gap:14px;margin:12px 0 16px}
@media (max-width:760px){.gencalc-result-top{grid-template-columns:1fr}}

.gencalc-hero{background:#fff;border:1px solid #e5e7eb;padding:22px 24px;display:flex;flex-direction:column}
.gencalc-hero-eyebrow{font-size:10px;letter-spacing:.5px;text-transform:uppercase;color:#888;font-family:'JCBEuro Bold Regular',sans-serif}
.gencalc-hero-num{font-family:'JCBEuro Bold Regular',sans-serif;font-size:52px;line-height:1;letter-spacing:-.5px;margin-top:8px;color:#1a1a1a}
.gencalc-hero-num small{font-size:22px;color:#555;margin-left:5px}
.gencalc-hero-sub{font-size:12px;color:#888;margin-top:7px}
.gencalc-hero-sub a{color:#2563eb;text-decoration:none}
.gencalc-hero-sub a:hover{text-decoration:underline}
.gencalc-hero-statline{display:flex;border-top:1px solid #eef0f3;margin-top:16px;flex:1}
.gencalc-hero-stat{flex:1;padding:12px;border-right:1px solid #eef0f3;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}
.gencalc-hero-stat:last-child{border-right:none}
.gencalc-hero-stat-l{font-size:12px;text-transform:uppercase;letter-spacing:.4px;color:#999}
.gencalc-hero-stat-v{font-family:'JCBEuro Bold Regular',sans-serif;font-size:22px;margin-top:6px;color:#1a1a1a}

.gencalc-actionzone{background:#fff;border:1px solid #e5e7eb;padding:16px;display:flex;flex-direction:column;gap:12px}
.gencalc-backup-row{display:flex;align-items:center;gap:10px;justify-content:space-between;padding:11px;border:1px solid #e5e7eb;background:#fafbfc}
.gencalc-backup-txt{font-size:12px;line-height:1.3}
.gencalc-backup-txt b{font-family:'JCBEuro Bold Regular',sans-serif}
.gencalc-backup-txt span{color:#9ca3af;display:block;font-size:11px}

/* toggle switch (rounded by intent — it's a control, not a surface) */
.gencalc-sw{flex:none;width:38px;height:22px;border-radius:22px;background:#cbd0d6;position:relative;cursor:pointer;transition:background .15s;border:none}
.gencalc-sw::after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;transition:transform .15s}
.gencalc-sw.is-on{background:#FAA747}
.gencalc-sw.is-on::after{transform:translateX(16px)}
.gencalc-sw--sm{width:34px;height:20px}
.gencalc-sw--sm::after{width:14px;height:14px}
.gencalc-sw--sm.is-on::after{transform:translateX(14px)}

/* Collapsible wrap — math breakdown + project tolerances, both behind
   a single "Show calculation details" toggle. Stays collapsed by default
   so the result page leads with the recommendation, not the math. */
.gencalc-totals-breakdown-details {
  margin: -8px 0 18px;
  background: #fafbfc;
  border: 1px solid #f0f1f3;
  border-radius: 6px;
}
.gencalc-totals-breakdown-details[hidden] { display: none; }
.gencalc-totals-breakdown-summary {
  cursor: pointer;
  padding: 10px 14px;
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 12px;
  color: #6b7280;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.gencalc-totals-breakdown-summary::-webkit-details-marker { display: none; }
.gencalc-totals-breakdown-summary i {
  font-size: 10px;
  color: #9ca3af;
  transition: transform 140ms ease;
}
.gencalc-totals-breakdown-details[open] .gencalc-totals-breakdown-summary i {
  transform: rotate(90deg);
}
.gencalc-totals-breakdown-summary:hover { color: #1a1a1a; }
.gencalc-totals-breakdown-summary:hover i { color: #FAA747; }
.gencalc-totals-breakdown-body {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gencalc-totals-breakdown {
  padding: 0;
  background: transparent;
  border: 0;
  margin: 0;
  font-size: 12.5px; color: #555;
}
.gencalc-totals-breakdown[hidden] { display: none; }

/* Compact tolerances grid — 4-up inline cells instead of the old
   full-section labelled list. Sits inside the collapsible details. */
.gencalc-totals-breakdown-tols {
  border-top: 1px solid #eef0f3;
  padding-top: 10px;
}
.gencalc-tol-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #eef0f3;
  border: 1px solid #eef0f3;
  border-radius: 3px;
  overflow: hidden;
}
.gencalc-tol-cell {
  background: #fff;
  padding: 8px 10px;
}
.gencalc-tol-cell small {
  display: block;
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 10px;
  color: #9ca3af;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.gencalc-tol-cell strong {
  display: block;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 13px;
  color: #1a1a1a;
  line-height: 1.2;
}
@media (max-width: 720px) {
  .gencalc-tol-grid { grid-template-columns: repeat(2, 1fr); }
}
.gencalc-breakdown-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px dashed #e5e7eb;
}
.gencalc-breakdown-row:last-child { border-bottom: none; }
.gencalc-breakdown-label { color: #666; }
.gencalc-breakdown-label em { color: #999; font-style: normal; font-weight: 400; font-size: 11.5px; }
.gencalc-breakdown-value { color: #1a1a1a; font-variant-numeric: tabular-nums; }
.gencalc-breakdown-row.is-muted { opacity: 0.75; }
.gencalc-breakdown-row.is-muted .gencalc-breakdown-label { font-size: 11.5px; }
.gencalc-breakdown-row.is-subzone { border-bottom-style: dotted; }
.gencalc-breakdown-row.is-subzone .gencalc-breakdown-label { font-size: 11px; color: #6b7280; }
.gencalc-breakdown-row.is-subzone .gencalc-breakdown-value { font-size: 11px; color: #6b7280; }
.gencalc-breakdown-row.is-total {
  margin-top: 4px; padding-top: 8px;
  border-top: 1.5px solid #FAA747;
  border-bottom: none;
}
.gencalc-breakdown-row.is-total .gencalc-breakdown-label,
.gencalc-breakdown-row.is-total .gencalc-breakdown-value {
  color: #1a1a1a; font-weight: 600; font-size: 13px;
}

/* ── Task 13: Project tolerances block ──────────────────────────────────── */
.gencalc-result-tolerances {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: #fafbfc;
  border: 1px solid #f0f1f3;
  border-radius: 6px;
}
.gencalc-result-tolerances[hidden] { display: none; }
.gencalc-result-block-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gencalc-rec-card {
  position: relative;
  border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 18px; background: white; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.gencalc-rec-card:hover {
  border-color: #c7c9ce;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.gencalc-rec-card.is-selected {
  border-color: #FAA747;
  box-shadow: 0 0 0 1px #FAA747, 0 4px 14px rgba(250,167,71,0.12);
  background: white;
}
.gencalc-rec-card-pill {
  font-size: 10px; color: #FAA747; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.gencalc-rec-card-pill--prime    { color: #FAA747; }
.gencalc-rec-card-pill--backup   { color: #1e3a8a; }
.gencalc-rec-card-pill--sync     { color: #10b981; }
.gencalc-rec-card-pill--engineering { color: #b91c1c; }

/* "Recommended for events like yours" — sits below the eyebrow card-pill */
.gencalc-rec-card-recommended-pill {
  align-self: flex-start;
  font-size: 10px; background: #FAA747; color: white;
  padding: 3px 9px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700;
  white-space: nowrap;
  margin-top: -4px;
}
.gencalc-rec-card-recommended-pill[hidden] { display: none; }

.gencalc-rec-card-title { margin: 2px 0 0; font-size: 17px; font-weight: 600; line-height: 1.2; }
.gencalc-rec-card-subtitle { margin: 0; font-size: 12px; color: #777; }

/* Compact image container — proportional, neutral, less imposing */
.gencalc-rec-card-image {
  background: #f7f8fa; height: 110px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  margin: 4px 0 2px;
}
.gencalc-rec-card-image img { max-height: 88px; max-width: 70%; object-fit: contain; }

.gencalc-rec-card-specs {
  list-style: none; padding: 0; margin: 0; font-size: 12.5px;
  display: flex; flex-direction: column;
}
.gencalc-rec-card-specs li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0; color: #555;
  border-bottom: 1px dashed #f0f1f3;
}
.gencalc-rec-card-specs li:last-child { border-bottom: none; }
.gencalc-rec-card-specs li > span { color: #888; }
.gencalc-rec-card-specs li > strong { color: #1a1a1a; font-weight: 600; }

.gencalc-rec-card-note { font-size: 11px; color: #888; font-style: italic; margin: 4px 0 0; line-height: 1.5; }

/* ── Engineering-review state ───────────────────────────────────────────
   Replaces the empty image placeholder with structured content: gap stats
   (when known) + a 'what we'll explore' bullet list. Reads as a real
   recommendation rather than a broken card. */
.gencalc-rec-card.is-engineering-review .gencalc-rec-card-image { display: none; }
.gencalc-rec-card.is-engineering-review .gencalc-rec-card-subtitle {
    margin-bottom: 14px;
}
.gencalc-rec-card.is-engineering-review .gencalc-rec-card-specs {
    margin-top: 0;
}
.gencalc-rec-card.is-engineering-review .gencalc-rec-card-specs li.gencalc-rec-card-gap {
    padding: 6px 0;
    border-bottom: 1px dashed #ececec;
    font-size: 12px;
}
.gencalc-rec-card.is-engineering-review .gencalc-rec-card-specs li.gencalc-rec-card-gap--shortfall > strong {
    color: #c0392b;
}
.gencalc-rec-card.is-engineering-review .gencalc-rec-card-specs li.gencalc-rec-card-explore-divider {
    border: 0;
    height: 8px;
    padding: 0;
}
.gencalc-rec-card.is-engineering-review .gencalc-rec-card-specs li.gencalc-rec-card-explore-header {
    border: 0;
    padding: 0 0 6px;
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-family: 'JCBEuro Bold Regular', sans-serif;
}
.gencalc-rec-card.is-engineering-review .gencalc-rec-card-specs li.gencalc-rec-card-explore-bullet {
    border: 0;
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #1a1a1a;
    font-size: 12.5px;
    line-height: 1.45;
}
.gencalc-rec-card.is-engineering-review .gencalc-rec-card-specs li.gencalc-rec-card-explore-bullet > i {
    color: #FAA747;
    font-size: 11px;
    margin-top: 4px;
    flex-shrink: 0;
}
.gencalc-rec-card-note--engineering {
    font-style: normal !important;
    color: #6b7280 !important;
    background: #fffaf2;
    border-left: 2px solid #FAA747;
    padding: 8px 10px;
    margin-top: 12px !important;
    border-radius: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.gencalc-rec-card-note--engineering i {
    color: #FAA747;
    font-size: 12px;
}
/* Stronger CTA on engineering-review cards so it doesn't read as the
   weakest of three — the only path forward for these states. */
.gencalc-rec-card.is-engineering-review .gencalc-rec-card-cta {
    background: #FAA747;
    border-color: #FAA747;
    color: #1a1a1a;
}
.gencalc-rec-card.is-engineering-review .gencalc-rec-card-cta:hover,
.gencalc-rec-card.is-engineering-review .gencalc-rec-card-cta:focus-visible {
    background: #e89530;
    border-color: #e89530;
}

.gencalc-rec-card-cta {
  margin-top: auto; padding: 9px 12px; font-size: 12.5px;
  background: #f7f8fa; border: 1px solid #e5e7eb;
  font-weight: 600; transition: background .15s, color .15s, border-color .15s;
}
.gencalc-rec-card-cta:hover { background: #eef0f3; }
.gencalc-rec-card.is-selected .gencalc-rec-card-cta {
  background: #FAA747; color: white; border-color: #FAA747;
}

/* Disabled state for gated CTA buttons */
.gencalc-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 720px) {
  .gencalc-totals { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gencalc-totals-cell:nth-child(2n) { border-right: none; }
}

/* Per-zone genset toggle reuses the Power Plan toggle-row styling — see
   `.gencalc-power-plan-toggle-row` below. */

/* ── Per-zone fleet result layout (issue #20) ─────────────────────────── */
.gencalc-fleet-mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #f4f5f7;
  border-radius: 8px;
  margin: 0 0 14px;
}
.gencalc-fleet-mode-tab {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  color: #555;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.gencalc-fleet-mode-tab:hover { color: #1a1a1a; }
.gencalc-fleet-mode-tab.is-active {
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.gencalc-perzone-caveat {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #fff7ed;
  border-left: 3px solid #FAA747;
  border-radius: 4px;
  font-size: 12.5px;
  color: #5a4a30;
  line-height: 1.5;
}
.gencalc-perzone-caveat[hidden] { display: none; }

.gencalc-fleet-summary {
  background: #f7f8fa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: baseline;
}
.gencalc-fleet-summary-headline {
  font-size: 15px; font-weight: 700; color: #1a1a1a; line-height: 1.3;
}
.gencalc-fleet-summary-rollup {
  font-size: 13px; color: #555;
}
.gencalc-fleet-summary-rollup strong { color: #1a1a1a; }

@media (max-width: 720px) {
  .gencalc-fleet-mode-tabs { width: 100%; }
  .gencalc-fleet-mode-tab { flex: 1; text-align: center; }
}

/* ── SEO content section ──────────────────────────────────────────────── */
.gencalc-seo {
  padding: 48px 0 56px;
  background: white;
  border-top: 1px solid #f0f1f3;
}
.gencalc-seo-block {
  max-width: 760px;
  margin: 0 auto 40px;
}
.gencalc-seo-block:last-child { margin-bottom: 0; }
.gencalc-seo-block h2 {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0 0 14px;
  color: #1a1a1a;
}
.gencalc-seo-block h3 {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 15px;
  margin: 18px 0 6px;
  color: #1a1a1a;
}
.gencalc-seo-block p {
  font-size: 14.5px;
  line-height: 1.65;
  color: #4a4a4a;
  margin: 0 0 12px;
}
.gencalc-seo-block ul,
.gencalc-seo-block ol { margin: 8px 0 16px; padding-left: 22px; }
.gencalc-seo-block li { margin-bottom: 8px; font-size: 14.5px; line-height: 1.55; color: #4a4a4a; }
/* Higher specificity than `.gencalc-seo-block ol { padding-left: 22px }`
   (browser default list indent) so the step cards extend the full block. */
.gencalc-seo-block ol.gencalc-seo-steps { list-style: none; padding-left: 0; counter-reset: gcseo-step; }
.gencalc-seo-steps > li {
  counter-increment: gcseo-step;
  background: #fafbfc;
  border: 1px solid #f0f1f3;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.gencalc-seo-steps > li > h3 { margin-top: 0; }

/* Conversion reference table (kVA / kW / amps) */
.gencalc-seo-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 12px;
  font-size: 14px;
}
.gencalc-seo-table caption {
  caption-side: top;
  text-align: left;
  font-size: 12.5px;
  color: #888;
  padding-bottom: 6px;
}
.gencalc-seo-table th {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  text-align: left;
  background: #fafbfc;
}
.gencalc-seo-table th,
.gencalc-seo-table td {
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  color: #4a4a4a;
}
.gencalc-seo-table td:first-child {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  color: #1a1a1a;
}

.gencalc-seo-faq { margin-top: 8px; }
.gencalc-seo-faq-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 10px;
  background: white;
}
.gencalc-seo-faq-item > summary {
  cursor: pointer;
  padding: 14px 18px;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 14.5px;
  color: #1a1a1a;
  list-style: none;
  position: relative;
  padding-right: 36px;
}
.gencalc-seo-faq-item > summary::-webkit-details-marker { display: none; }
.gencalc-seo-faq-item > summary::after {
  content: '+';
  position: absolute;
  right: 16px; top: 14px;
  font-size: 18px; line-height: 1;
  color: #FAA747;
  transition: transform .2s;
}
.gencalc-seo-faq-item[open] > summary::after { content: '−'; }
.gencalc-seo-faq-item > p {
  padding: 0 18px 16px;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #4a4a4a;
}

.gencalc-seo-cta {
  background: #fafbfc;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  border: 1px solid #f0f1f3;
}
.gencalc-seo-cta h2 { margin-bottom: 10px; }
.gencalc-seo-cta .gencalc-btn { margin-top: 10px; max-width: 320px; }

/* ── Mobile responsiveness — tap targets, font sizes ─────────────────── */
@media (max-width: 900px) {
  /* Touch targets ≥44px per Apple HIG */
  .gencalc-margin-stop { min-height: 44px; padding: 11px 16px; font-size: 14px; }
  .gencalc-margin-stop > span { font-size: 13.5px; }
  .gencalc-zone-remove { width: 44px; height: 44px; font-size: 22px; }
  /* The × per-row icon stays compact at the top-right corner. */
  .gencalc-btn { min-height: 44px; padding: 11px 18px; }
  .gencalc-margin-stops { gap: 8px; }
  .gencalc-margin-stops > .gencalc-margin-stop { flex: 1 1 30%; justify-content: center; }

  /* Bump fonts that were 10–10.5px → at least 11.5px on mobile */
  .gencalc-totals-label { font-size: 11.5px; }
  .gencalc-rec-card-pill { font-size: 11px; }
  .gencalc-result-eyebrow { font-size: 11.5px; }

  /* Bigger select chevron on mobile (10px → 14px) */
  .gencalc-field select { background-size: 14px; }
  .gencalc-zone-diversity > select { background-size: 13px; }
  .gencalc-site-grid select { background-size: 14px; }

  /* Step card padding tightens, but headers stay readable */
  .gencalc-step-body { padding: 18px 14px; }
  .gencalc-step-header { padding: 14px 14px; gap: 10px; }

  /* Library modal — bump tap targets in the tree on small screens. */
  .gencalc-library-tree-node { min-height: 44px; }
  .gencalc-library-tree-children .gencalc-library-tree-node { min-height: 42px; }

  /* SEO section — match the wizard's edge-to-edge mobile gutters so the
     two halves of the page feel like one document, not two widgets.
     Container holds an outer 12px gutter (matches wizard); free-flowing
     text gets a small extra inner pad so paragraphs don't crowd the
     screen edge, while card-based blocks (steps, FAQ) extend full-width. */
  .gencalc-seo { padding: 32px 0 40px; }
  .gencalc-seo .gencalc-container { padding: 0 12px; }
  .gencalc-seo-block { margin-bottom: 28px; padding: 0; }
  .gencalc-seo-block > h2,
  .gencalc-seo-block > h3,
  .gencalc-seo-block > p,
  .gencalc-seo-block > ul:not(.gencalc-seo-steps),
  .gencalc-seo-block > ol:not(.gencalc-seo-steps) { padding: 0 6px; }
  .gencalc-seo-block h2 { font-size: 19px; }
  .gencalc-seo-block h3 { font-size: 14.5px; }
}

@media (max-width: 480px) {
  /* Even tighter on phone — reduce hero/wizard padding */
  .gencalc-step-body { padding: 16px 12px; }
  /* Keep the three chips on one row at phone widths — stacking them
     wastes a full screen of vertical space for what is a 3-option choice. */
  .gencalc-margin-stops { flex-wrap: nowrap; gap: 6px; }
  .gencalc-margin-stops > .gencalc-margin-stop {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 8px;
    font-size: 12.5px;
    gap: 5px;
    justify-content: center;
    white-space: nowrap;
  }
  .gencalc-margin-stops > .gencalc-margin-stop > span { font-size: 12px; }
  /* Brief labels (Add Load · Library · Import) fit on a single row even
     at phone widths — full-width stacked buttons made the action bar
     tower over the content. */
  .gencalc-load-actions { gap: 8px; }
  .gencalc-load-actions > .gencalc-btn {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    padding: 11px 8px;
    font-size: 12.5px;
  }
  .gencalc-load-actions > .gencalc-btn i { font-size: 13px; }
  /* Toolbar stays a row even on phones — width: auto handled in 600px band. */
}

/* ── Tier 3 — Alternatives table + engineering-review takeover ────────────
   Surfaces the customer-facing payoff of the viability engine: when an
   oversize pick can be shrunk by a load tweak, list the swaps; when no
   alternative exists and the pick is not_viable, hide the rec grid and
   route the customer to engineering. */

.gencalc-alternatives {
  margin: 12px 0 24px;
  padding: 22px 24px 24px;
  border-radius: 4px;
  background: linear-gradient(180deg, #fdfbf7 0%, #f7f3ea 100%);
  border: 1px solid #e7e0d3;
  border-left: 5px solid #FAA747;
  font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
}
.gencalc-alternatives[hidden] { display: none; }

.gencalc-alternatives-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #e0d6c0;
}

.gencalc-alternatives-title {
  margin: 0;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 16px;
  letter-spacing: 0.005em;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 10px;
}
.gencalc-alternatives-title i {
  color: #c47800;
  font-size: 14px;
}

.gencalc-alternatives-subtitle {
  margin: 0;
  font-size: 13px;
  color: #6b6357;
  line-height: 1.5;
}

.gencalc-alternatives-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gencalc-alt-row {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 18px;
  row-gap: 6px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #ece4d0;
  border-radius: 3px;
  transition: border-color 120ms ease, background 120ms ease;
}
.gencalc-alt-row:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: #FAA747;
}

.gencalc-alt-action {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.gencalc-alt-strategy {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  line-height: 1.35;
}
.gencalc-alt-swap {
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 12px;
  color: #6b6357;
  letter-spacing: 0.02em;
}

.gencalc-alt-result {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  white-space: nowrap;
}
.gencalc-alt-genset {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 15px;
  color: #c47800;
  letter-spacing: 0.005em;
}
.gencalc-alt-meta {
  font-size: 12px;
  color: #6b6357;
}

.gencalc-alt-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px 2px;
  border-radius: 2px;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}
.gencalc-alt-badge--healthy    { background: #e8f3e6; color: #356b2c; border: 1px solid #b5d6ad; }
.gencalc-alt-badge--acceptable { background: #fef6e0; color: #8b6912; border: 1px solid #f0c75e; }
.gencalc-alt-badge--poor_fit   { background: #fbeed0; color: #8a4f0d; border: 1px solid #d97706; }
.gencalc-alt-badge--not_viable { background: #fbe1d6; color: #8a2410; border: 1px solid #c14b29; }

@media (max-width: 640px) {
  .gencalc-alt-row { grid-template-columns: 1fr; }
  .gencalc-alt-result {
    align-items: flex-start;
    border-top: 1px dashed #ece4d0;
    padding-top: 8px;
  }
}

/* Engineering-review takeover — replaces the recommendation grid when
   no viable pick exists. Card-as-page treatment. */
.gencalc-engineering-takeover {
  margin: 12px 0 24px;
  padding: 36px 32px;
  text-align: center;
  border-radius: 4px;
  background: linear-gradient(180deg, #fff8eb 0%, #fbedd0 100%);
  border: 1px solid #f0c75e;
  border-left: 5px solid #d97706;
  font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
}
.gencalc-engineering-takeover[hidden] { display: none; }

.gencalc-engineering-takeover-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  font-size: 22px;
}

.gencalc-engineering-takeover-title {
  margin: 0 0 12px;
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 22px;
  color: #1a1a1a;
  letter-spacing: 0.005em;
}

.gencalc-engineering-takeover-text {
  max-width: 60ch;
  margin: 0 auto 24px;
  font-size: 14px;
  line-height: 1.55;
  color: #4a463d;
}

.gencalc-engineering-takeover-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .gencalc-engineering-takeover { padding: 28px 20px; }
  .gencalc-engineering-takeover-actions .gencalc-btn { width: 100%; }
}

/* ==== Advanced load row — card layout (replaces .gencalc-load-row-main / -advanced)
   Spec: docs/superpowers/specs/2026-05-06-load-row-card-redesign-design.md
   Calm card aesthetic: line-2 border, soft hover/focus, no spine,
   header (badge / drag / title / type-chip / result / ×) over a 5-column
   proportional grid that the specs strip and motor strip share. */

/* ─── Mode gates (Basic / Advanced) ────────────────────────────────────
   Added 2026-05-26. `body.gencalc-mode-basic` / `body.gencalc-mode-advanced`
   are the canonical classes. `body.gencalc-advanced-on` is retained as a
   legacy alias and is set/cleared in lockstep with `mode-advanced`.
   Per-surface hide rules are added in their respective tasks. */

/* Outer card frame — overrides the previous .gencalc-load-row look */
body.gencalc-advanced-on .gencalc-load-row {
    background: #fff;
    border: 1px solid var(--gencalc-lib-line-2);
    border-radius: 0 !important;
    padding: 0;
    margin-bottom: 10px;
    box-shadow: none;
    transition: border-color .12s;
    position: relative;
    display: block;
    overflow: visible;
}
body.gencalc-advanced-on .gencalc-load-row::before {
    /* Spine retired — keep selector to neutralise legacy counter content */
    content: "";
    display: none;
}
body.gencalc-advanced-on .gencalc-load-row:hover {
    border-color: var(--gencalc-lib-ink-4);
}
body.gencalc-advanced-on .gencalc-load-row:focus-within {
    border-color: var(--gencalc-lib-orange);
    box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.15);
}
body.gencalc-advanced-on .gencalc-load-row { counter-reset: none; }

/* The .gencalc-load-card-* classes below only render in advanced mode (the
   template that produces them is gated by Advanced Mode) — no body-class
   guard needed on each rule. */
.gencalc-load-card-body {
    display: flex;
    flex-direction: column;
}

/* ── Header strip (badge / drag / title+type / result / ×) ────────── */
.gencalc-load-card-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px 18px;
    border-bottom: 1px solid var(--gencalc-lib-line);
}
.gencalc-load-card-head > .gencalc-load-card-badge,
.gencalc-load-card-head > .gencalc-load-card-drag,
.gencalc-load-card-head > .gencalc-load-remove {
    flex: 0 0 auto;
}
.gencalc-load-card-head > .gencalc-load-card-desc {
    flex: 1 1 0;
    min-width: 0;
}
.gencalc-load-card-head > .gencalc-load-card-result {
    flex: 0 0 auto;
}
.gencalc-load-card-badge {
    width: 28px; height: 28px;
    background: var(--gencalc-lib-ink);
    color: #fff;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: flex; align-items: center; justify-content: center;
    user-select: none;
    margin-top: 4px;
    border-radius: 0 !important;
}

.gencalc-load-card-drag {
    width: 16px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    color: #b5b8bc;
    cursor: grab; user-select: none;
    background: none; border: 0; padding: 0;
    margin-top: 4px;
    transition: color 80ms ease;
}
.gencalc-load-card-drag:hover { color: var(--gencalc-lib-ink); }
.gencalc-load-card-drag:active { cursor: grabbing; }
.gencalc-load-card-drag-grip {
    display: grid;
    grid-template-columns: 3px 3px;
    grid-template-rows: repeat(3, 3px);
    gap: 3px;
}
.gencalc-load-card-drag-grip > i {
    width: 3px; height: 3px;
    background: currentColor;
    border-radius: 0 !important;
}

.gencalc-load-card-desc {
    display: flex;
    align-items: center;
    min-width: 0;
}
.gencalc-load-card-desc input[data-field="description"] {
    border: 0;
    background: transparent;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.1px;
    color: var(--gencalc-lib-ink);
    padding: 0;
    outline: none;
    line-height: 1.2;
    width: 100%;
    min-width: 0;
    box-shadow: none;
    border-radius: 0 !important;
}
.gencalc-load-card-desc input[data-field="description"]:focus {
    box-shadow: none;
    background: transparent;
}
.gencalc-load-card-desc input[data-field="description"]::placeholder {
    color: var(--gencalc-lib-ink-4);
    font-weight: 500;
}

/* Result block — top-right of header, plain text (no box) */
.gencalc-load-card-result {
    display: flex; flex-direction: column;
    align-items: flex-end;
    padding: 0 4px 0 0;
    margin-top: 2px;
    line-height: 1;
    max-width: 220px;
}
.gencalc-load-card-result-num {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-weight: 700;
    font-size: 19px;
    color: var(--gencalc-lib-ink);
    letter-spacing: -0.4px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}
.gencalc-load-card-result-num .unit {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-weight: 700;
    font-size: 11px;
    color: var(--gencalc-lib-ink-4);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.gencalc-load-card-result-sub {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: var(--gencalc-lib-ink-4);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.1px;
}
.gencalc-load-card-result-lead {
    display: inline-block;
    margin-left: 6px;
    background: var(--gencalc-lib-orange);
    color: var(--gencalc-lib-ink);
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 2px 5px;
    line-height: 1;
    vertical-align: 3px;
    border-radius: 0 !important;
}
.gencalc-load-card-result-lead[hidden] {
    display: none;
}
/* Muted "connected" tag — clarifies the painted row value is nameplate, the
   same vocabulary as the zone header (Required · connected). Deliberately quiet:
   uppercase micro-label, no fill, so it never competes with the value. */
.gencalc-load-card-result-tag {
    margin-left: 6px;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #b3b8bd;
    vertical-align: 1px;
}
/* Complementary "/ kW" value on each result line — smaller and muted so the
   kVA (sizing unit) leads, the kW trails as reference. Fixed size so the kW on
   line 1 (Connected) matches the kW on line 2 (Demand) regardless of the
   different headline vs sub sizing of their lines. */
.gencalc-load-card-result-alt {
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: #9aa0a6;
    letter-spacing: -0.1px;
}
/* Line 2 (Demand) — its own line under the nameplate. The sub already carries
   muted styling; hidden entirely at 100% demand. */
.gencalc-load-card-result-sub[hidden] { display: none; }

/* × button in header */
.gencalc-load-card-head .gencalc-load-remove {
    width: 28px; height: 28px;
    background: transparent;
    border: 1.5px solid var(--gencalc-lib-ink);
    color: var(--gencalc-lib-ink);
    font-size: 17px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    margin-top: 2px;
    border-radius: 0 !important;
    position: static;
    top: auto; right: auto; transform: none;
    transition: color .12s, border-color .12s, background .12s;
}
.gencalc-load-card-head .gencalc-load-remove:hover {
    color: #fff; background: var(--gencalc-lib-ink);
    border-color: var(--gencalc-lib-ink);
}

/* ── Specs strip (Type · Power · Phase · PF · Qty · Demand) and Motor strip
   share the same 6-column proportional grid. Type is wider than PF so the
   load-type label has room to breathe; PF only carries 0.85 + Lag/Lead. */
.gencalc-load-card-specs,
.gencalc-load-card-motor {
    display: grid;
    grid-template-columns: 1.8fr 1.1fr 0.85fr 1fr 0.85fr 1fr;
}

/* TYPE cell — first column of specs strip, faint tint distinguishes it
   as a row-context label rather than a numeric parameter. */
.gencalc-load-card-cell--type {
    background: rgba(0, 0, 0, 0.025);
}
.gencalc-load-card-cell--type select {
    font-size: 14px !important;
    font-weight: 700 !important;
}

.gencalc-load-card-cell {
    display: flex; flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 18px;
    position: relative;
    padding: 18px 24px;
    border-right: 1px solid var(--gencalc-lib-line);
    min-width: 0;
}
.gencalc-load-card-specs .gencalc-load-card-cell:last-child,
.gencalc-load-card-motor .gencalc-load-card-cell:last-child {
    border-right: 0;
}
.gencalc-load-card-cell label {
    /* Roman regular at lighter tracking — recedes against the bold value
       so the eye lands on the data, not the field name. Inline with the
       value via row-flex on the cell. */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: var(--gencalc-lib-ink-4);
    font-weight: 400;
    user-select: none;
    line-height: 1;
    margin: 0;
}
.gencalc-load-card-cell label .gencalc-help {
    margin-left: 0;
}
/* The tooltip popup must use the same system body stack as the rest of
   the calc's tooltips (Setup, Sizing approach, etc.). Without this
   override the popup inherits its label ancestor's uppercase + JCBEuro
   font, breaking visual parity with sections 1 & 2. */
.gencalc-load-card-cell label .gencalc-tooltip {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text',
                 'Segoe UI', 'Helvetica Neue', Helvetica, system-ui, sans-serif !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0.1px !important;
    font-size: 13.5px !important;
    line-height: 1.6 !important;
}
/* Borderless inputs/selects — the !important declarations here defeat
   the .gencalc-field input, .gencalc-field select rule (~line 869) in
   case a card cell is ever wrapped in a .gencalc-field container. */
.gencalc-load-card-cell input,
.gencalc-load-card-cell select {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--gencalc-lib-ink);
    outline: none;
    cursor: text;
    min-height: 24px;
    display: flex;
    align-items: center;
    line-height: 1;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 100%;
    box-sizing: border-box;
}
.gencalc-load-card-cell select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 20px !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M3 4.5l3 3 3-3' stroke='%231a1a1a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 13px;
}
/* Plain (non-combo) inputs/selects size to content so they sit centered
   under the label rather than stretching to fill the cell. Combos keep
   their own widths. Text-align is centered so the value reads as a
   focal point under the cap-tracked label. */
.gencalc-load-card-cell > input,
.gencalc-load-card-cell > select {
    width: auto !important;
    text-align: center;
}
.gencalc-load-card-cell > select {
    text-align-last: center;
}
.gencalc-load-card-cell:hover label { color: var(--gencalc-lib-ink-3); }
.gencalc-load-card-cell:focus-within label { color: var(--gencalc-lib-orange-dark); }
.gencalc-load-card-cell:focus-within { background: rgba(250, 167, 71, 0.05); }

/* PF combo — number input + Lag/Lead direction select */
.gencalc-load-card-pf-combo {
    display: flex; align-items: baseline; gap: 6px;
}
.gencalc-load-card-pf-combo input {
    width: auto; flex: 0 0 auto; min-width: 0; max-width: 60px;
    field-sizing: content;
    text-align: right !important;
}
/* Combo-cell direction/unit dropdown — matches the main value styling
   (same size, weight, family) so "5 kW" reads as one unified pair
   rather than a value and a smaller-faced footnote. */
.gencalc-load-card-pf-combo select,
.gencalc-load-card-pwr-combo select {
    flex: 0 0 auto !important;
    width: auto !important;
    color: var(--gencalc-lib-ink) !important;
    font-family: 'JCBEuro Roman Regular', sans-serif !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: none;
    letter-spacing: 0;
    padding-right: 16px !important;
    background-position: right -2px center !important;
    background-size: 12px !important;
}

/* Power combo — number input + Unit select. Number sits right-aligned
   so it kisses the unit ("5 kW" reads as one pair, not "5     kW"). */
.gencalc-load-card-pwr-combo {
    display: flex; align-items: baseline; gap: 6px;
}
.gencalc-load-card-pwr-combo input {
    width: auto; flex: 0 0 auto; min-width: 0; max-width: 64px;
    field-sizing: content;
    text-align: right !important;
}

/* ── Motor strip — same column grid, soft orange wash, conditional
   on row.dataset.needsStart === "true". MOTOR tag spans columns 1-2. */
.gencalc-load-card-motor {
    background: rgba(250, 167, 71, 0.06);
    border-top: 1px solid rgba(250, 167, 71, 0.30);
}
.gencalc-load-row[data-needs-start="false"] .gencalc-load-card-motor {
    display: none;
}

.gencalc-load-card-motor-tag {
    grid-column: 1 / 3;
    display: flex; align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--gencalc-lib-orange);
    color: var(--gencalc-lib-ink);
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    user-select: none;
    border-right: 1px solid rgba(250, 167, 71, 0.30);
    border-radius: 0 !important;
}
.gencalc-load-card-motor-tag-icon {
    width: 0; height: 0;
    border-style: solid;
    border-width: 6px 0 6px 9px;
    border-color: transparent transparent transparent var(--gencalc-lib-ink);
    border-radius: 0 !important;
}

.gencalc-load-card-motor .gencalc-load-card-cell {
    border-right: 1px solid rgba(250, 167, 71, 0.20);
    padding: 14px 22px;
}
.gencalc-load-card-motor .gencalc-load-card-cell--start  { grid-column: 3 / 5; }
.gencalc-load-card-motor .gencalc-load-card-cell--order  { grid-column: 5; }
.gencalc-load-card-motor .gencalc-load-card-cell--eta    { grid-column: 6; }

.gencalc-load-card-motor .gencalc-load-card-cell label {
    color: var(--gencalc-lib-orange-dark);
    opacity: 0.85;
}
.gencalc-load-card-motor .gencalc-load-card-cell input,
.gencalc-load-card-motor .gencalc-load-card-cell select {
    color: var(--gencalc-lib-ink) !important;
    font-weight: 700 !important;
}
.gencalc-load-card-motor .gencalc-load-card-cell select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M3 4.5l3 3 3-3' stroke='%23B86E1A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.gencalc-load-card-motor .gencalc-load-card-cell:hover label { opacity: 1; }
.gencalc-load-card-motor .gencalc-load-card-cell:focus-within { background: rgba(250, 167, 71, 0.10); }
.gencalc-load-card-motor .gencalc-load-card-cell:focus-within label { opacity: 1; }

/* η (efficiency) only applies to hp input. When the unit isn't hp the field is
   irrelevant — hide it entirely (was a greyed/disabled state, which read as broken). */
.gencalc-load-card-cell--eta[data-disabled="true"] {
    display: none !important;
}

/* ── Override marker: 7×7 orange square at top-right of any cell with
   data-overridden="true". Set/cleared by JS based on data-user-edited-* */
.gencalc-load-card-cell[data-overridden="true"]::before {
    content: "";
    position: absolute;
    top: 8px; right: 8px;
    width: 7px; height: 7px;
    background: var(--gencalc-lib-orange);
    pointer-events: none;
    border-radius: 0 !important;
}

/* ── Custom-picker integration with the new card cells.
   The .gencalc-picker-trigger normally has its own border + padding for
   use inside .gencalc-field. Inside the card cell layout we want it to
   read as inline text matching the surrounding `.gencalc-load-card-cell input`
   appearance (borderless, no padding, value-only). The card cell carries
   the focus ring at its level via :focus-within.

   Since cells are now row-flex (label inline with value), the picker
   itself must size to content rather than stretching to width:100% —
   otherwise the chevron drifts to the cell's right edge while the label
   sits on the left, leaving a yawning gap. */
.gencalc-load-card-cell .gencalc-picker {
    width: auto;
}
.gencalc-load-card-cell .gencalc-picker-trigger {
    width: auto;
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--gencalc-lib-ink);
    min-height: 24px;
    line-height: 1;
    box-shadow: none !important;
    gap: 4px;
}
.gencalc-load-card-cell .gencalc-picker-label {
    flex: 0 0 auto;
    overflow: visible;
}
.gencalc-load-card-cell .gencalc-picker-trigger:hover { border-color: transparent; }
.gencalc-load-card-cell .gencalc-picker-trigger:focus-visible,
.gencalc-load-card-cell .gencalc-picker[data-open="true"] .gencalc-picker-trigger {
    border-color: transparent;
    outline: none;
    box-shadow: none !important;
}
.gencalc-load-card-cell .gencalc-picker-caret {
    font-size: 9px;
    color: var(--gencalc-lib-ink-3);
    margin-left: 0;
}

/* Combo cells need the picker trigger sized to fit alongside the input,
   not stretched to full width. */
.gencalc-load-card-pf-combo .gencalc-picker,
.gencalc-load-card-pwr-combo .gencalc-picker {
    width: auto;
    flex: 0 0 auto;
}
.gencalc-load-card-pf-combo .gencalc-picker-trigger,
.gencalc-load-card-pwr-combo .gencalc-picker-trigger {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gencalc-lib-ink-2);
}

/* Type chip uses the native select (no data-picker), but if it ever
   gets one the chip's existing border + bg should remain — it's not
   inside .gencalc-load-card-cell so the override above doesn't reach it. */

/* ── Basic Mode: hide advanced-only per-row CELLS only. The specs strip
   container itself stays visible — it holds Power/Phase/Qty/Demand
   which are the basic numeric inputs. We only suppress the engineering
   cells (Type, PF) and the motor sub-row.
   Demand factor and the per-row result cell stay visible in Basic. */
body.gencalc-mode-basic .gencalc-load-card-cell--type,
body.gencalc-mode-basic .gencalc-load-card-cell--pf,
body.gencalc-mode-basic .gencalc-load-card-motor {
    display: none !important;
}

/* With Type + PF hidden, the specs strip re-flows to the remaining
   cells (Power / Phase / Qty / Demand). Re-balance the grid using the
   proportions from the default 6-col definition so the visible cells
   keep their original width relationships. */
body.gencalc-mode-basic .gencalc-load-card-specs {
    grid-template-columns: 1.1fr 0.85fr 0.85fr 1fr;
}

/* Basic Mode card — restore a thin border so the row is still visually
   contained. Spine is gone; no grid-column override needed. */
body.gencalc-mode-basic .gencalc-load-row {
    border: 1px solid var(--gencalc-lib-line-2);
    border-radius: 0 !important;
    margin-bottom: 8px;
    background: #fff;
}
body.gencalc-mode-basic .gencalc-load-row::before {
    display: none;
}

/* ── Hide native number-input spinners inside card cells.
   The browser-default up/down arrows feel disconnected from the
   borderless cell style and aren't practical at this density.
   Users type the value or use mouse-wheel; that's enough. */
.gencalc-load-card-cell input[type="number"]::-webkit-outer-spin-button,
.gencalc-load-card-cell input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.gencalc-load-card-cell input[type="number"] {
    -moz-appearance: textfield;
}

/* ── Qty cell with × prefix — semantic visual cue that the value
   is a multiplier, not just a count. Prefix is decorative (aria-hidden);
   the input remains the actual form field with data-field="quantity". */
.gencalc-load-card-qty-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.gencalc-load-card-qty-prefix {
    color: var(--gencalc-lib-ink-4);
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    user-select: none;
    flex: 0 0 auto;
}
.gencalc-load-card-cell--qty input[type="number"] {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    field-sizing: content;
    text-align: left;
}

/* ── Phase D-light: independent / linked motor-group visual toggle ──────────
   A single button under the qty input. Three vertical bars inside the button
   show the current state visually: separated = Independent (each motor starts
   on its own); fused = Linked (all motors fire together as one bank). Click
   flips state. Visible only when qty > 1 AND load_type is varying-motor-family.
   The hidden checkbox sibling carries the engine field simultaneous_bank. */
.gencalc-bank-toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    line-height: 1;
    align-self: flex-start;
}
.gencalc-bank-help {
    /* Slightly smaller help icon to balance the compact glyph button */
    font-size: 12px;
    color: #9ca3af;
    cursor: help;
    display: inline-flex;
    align-items: center;
}
.gencalc-bank-help:hover { color: #1a1a1a; }
.gencalc-bank-toggle-wrap[hidden] { display: none !important; }
.gencalc-bank-toggle-wrap input[type="checkbox"] {
    /* Hidden form mirror — force-hidden regardless of UA defaults */
    display: none !important;
}
.gencalc-bank-glyph {
    appearance: none;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 7px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'JCBEuro Bold Regular', system-ui, sans-serif;
    font-size: 11px;
    letter-spacing: 0.02em;
    color: #2b2b2b;
    transition: border-color 160ms ease, background 160ms ease;
}
.gencalc-bank-glyph:hover {
    background: #f9fafb;
    border-color: #1a1a1a;
}
.gencalc-bank-glyph .bk-marks {
    display: inline-flex;
    align-items: center;
    height: 12px;
}
.gencalc-bank-glyph .bk-marks .bk-mark {
    display: inline-block;
    width: 5px;
    height: 12px;
    background: #1a1a1a;
    border-radius: 1px;
    transition: margin-left 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.gencalc-bank-glyph .bk-marks .bk-mark + .bk-mark { margin-left: 4px; }
.gencalc-bank-glyph[aria-pressed="true"] .bk-marks .bk-mark + .bk-mark { margin-left: 0; }
.gencalc-bank-glyph .bk-state {
    font-size: 11px;
    letter-spacing: 0.02em;
    color: #2b2b2b;
}


/* ── Mobile: stack the 6-col specs strip ──────────────────────────────────
   On phones, the proportional 6-col grid (Type/Power/Phase/PF/Qty/Demand)
   squeezes inputs to ~55px each — dropdowns visually leak into the next
   cell. Re-flow into a 4-row layout: Type full-width, Power full-width,
   then Phase|Qty and PF|Demand as 2-col rows. Header keeps inline result
   but caps result width so the title input has room before truncating. */
@media (max-width: 600px) {
    .gencalc-load-card-specs,
    .gencalc-load-card-motor {
        grid-template-columns: 1fr 1fr;
    }
    .gencalc-load-card-specs .gencalc-load-card-cell--type,
    .gencalc-load-card-specs .gencalc-load-card-cell--power {
        grid-column: 1 / -1;
    }
    /* Reset the motor strip's hardcoded desktop columns */
    .gencalc-load-card-motor .gencalc-load-card-cell--start { grid-column: 1 / -1; }
    .gencalc-load-card-motor .gencalc-load-card-cell--order { grid-column: auto; }
    .gencalc-load-card-motor .gencalc-load-card-cell--eta   { grid-column: auto; }

    /* Border cleanup — every cell gets a bottom rule; the right rule only
       applies to left-column cells in 2-col rows. */
    .gencalc-load-card-cell {
        padding: 12px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--gencalc-lib-line);
    }
    .gencalc-load-card-specs .gencalc-load-card-cell--phase,
    .gencalc-load-card-specs .gencalc-load-card-cell--pf {
        border-right: 1px solid var(--gencalc-lib-line);
    }
    .gencalc-load-card-specs .gencalc-load-card-cell--qty,
    .gencalc-load-card-specs .gencalc-load-card-cell--demand {
        border-bottom: 0;
    }

    /* Header: tighter padding, cap result block width so a long description
       (input value, no ellipsis) has more room before the browser clips it. */
    .gencalc-load-card-head {
        padding: 14px 14px 12px;
        gap: 10px;
    }
    .gencalc-load-card-head > .gencalc-load-card-result {
        max-width: 110px;
    }
    .gencalc-load-card-result-num { font-size: 16px; }
    .gencalc-load-card-result-sub { font-size: 11px; }
    .gencalc-load-card-desc input[data-field="description"] { font-size: 15px; }

    /* Drag handle isn't useful with touch — hide on mobile to free up
       horizontal space for the title input. */
    .gencalc-load-card-head > .gencalc-load-card-drag { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOAD TYPE PICKER MODAL — small centered popup, distinct from the full-screen
   library modal. Tree (left) + card grid (right) mirroring library card design.
   Spec: docs/superpowers/specs/2026-05-06-load-type-picker-modal-design.md
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── B2 breadcrumb trigger on the load card ─────────────────────────────
   Two adjacent segments + separator + chevron. Parent segment is muted,
   kind segment is bold + carries the chevron. Falls back to a single
   "— Pick load type —" parent segment before a selection is made. */
.gencalc-load-type-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 38px;
  padding: 4px 8px 4px 10px;
  border: 1px solid #d4d4d8;
  background: #fff;
  transition: border-color .14s ease;
}
.gencalc-load-type-trigger:hover { border-color: #0f0f0f; }
.gencalc-load-type-trigger:focus-within {
  outline: 2px solid var(--gencalc-lib-orange, #f59e0b);
  outline-offset: -1px;
}
.gencalc-load-type-trigger-seg {
  font-family: inherit;
  border: 0;
  background: transparent;
  padding: 4px 2px;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  color: #6b7280;
  transition: color .12s ease;
}
.gencalc-load-type-trigger-seg:hover { color: #c46a00; }
.gencalc-load-type-trigger-seg--kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0f0f0f;
  font-weight: 600;
}
.gencalc-load-type-trigger-seg--kind[hidden] { display: none; }
.gencalc-load-type-trigger-sep {
  color: #cfcfd2;
  font-size: 14px;
  line-height: 1;
  user-select: none;
}
.gencalc-load-type-trigger-sep[hidden] { display: none; }
.gencalc-load-type-trigger-caret {
  color: #888;
  font-size: 10px;
}
/* Pre-selection state — parent segment doubles as "— Pick load type —"
   placeholder and reads in the kind's bold weight so it's the obvious
   action. */
.gencalc-load-type-trigger:not(:has(.gencalc-load-type-trigger-seg--kind:not([hidden]))) .gencalc-load-type-trigger-seg--parent {
  color: #0f0f0f;
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════════
   LOAD CARD — two-panel redesign (2026-05-30)
   Identity (left) / fields (right). Sharp corners, JCB type, amber accent.
   Reuses the existing JS-hook classes/attrs; this block is placed AFTER the
   legacy header/specs/cell/trigger rules so it wins on equal specificity.
   Spec: docs/superpowers/specs/2026-05-30-gencalc-load-card-two-panel-redesign-design.md
   ════════════════════════════════════════════════════════════════════════ */

/* Card shell → two-panel grid framed by edge gutters:
   col 1 = drag gutter · col 2 = identity · col 3 = fields · col 4 = remove gutter */
.gencalc-load-card-body {
  display: grid;
  grid-template-columns: 18px 296px minmax(0, 1fr) 44px;
  position: relative;
}

/* Drag gutter — its own column; load number above the grip, centred as a group */
.gencalc-load-card-body > .gencalc-load-card-drag {
  grid-column: 1; grid-row: 1;
  position: static; width: auto; height: auto; margin: 0;
  align-self: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #d4d7db; cursor: grab;
}
.gencalc-load-card-body > .gencalc-load-card-drag:hover .gencalc-load-card-drag-grip,
.gencalc-load-row:hover .gencalc-load-card-body > .gencalc-load-card-drag .gencalc-load-card-drag-grip { color: var(--gencalc-lib-ink-4); }

/* Remove × — lives in its own right-edge gutter (col 4), vertically centred so
   it mirrors the drag grip on the left edge. Same placement in every mode
   (basic / advanced / motor) because it tracks the row centre, not a top band. */
.gencalc-load-card-body > .gencalc-load-remove {
  grid-column: 4; grid-row: 1; align-self: center; justify-self: center;
  width: 30px; height: 30px; margin: 0;
  border: 0; background: transparent; box-shadow: none;
  color: #9aa0a6;
  font-size: 19px; line-height: 1; font-weight: 400;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 3; border-radius: 0 !important;
  transition: color .12s, background .12s;
}
.gencalc-load-card-body > .gencalc-load-remove:hover {
  color: #d9342b; background: rgba(217, 52, 43, 0.10);
}

/* Load number hidden from the card face (JS still sets the digit; kept for a
   future toggle). Restyled-but-hidden so re-enabling is a one-line change. */
.gencalc-load-card-drag > .gencalc-load-card-badge {
  display: none;
  background: transparent; color: var(--gencalc-lib-ink-4);
  font-family: 'JCBEuro Bold Regular', sans-serif; font-weight: 700;
  font-size: 11px; letter-spacing: 0.02em; line-height: 1;
  padding: 0; margin: 0; border-radius: 0 !important;
}

/* ── LEFT: identity panel ── */
.gencalc-load-card-id {
  grid-column: 2; grid-row: 1;
  display: flex; flex-direction: column;
  padding: 22px 24px 20px 18px;
  border-right: 1px solid var(--gencalc-lib-line);
  min-width: 0;
}
.gencalc-load-card-id .gencalc-load-card-desc { margin: 0; }
.gencalc-load-card-id .gencalc-load-card-desc input[data-field="description"] { font-size: 18px; }
.gencalc-load-card-id-sp { flex: 1 1 auto; min-height: 18px; }

/* Dual-power role toggle — left-aligned in the identity column (don't let the
   flex-column stretch it to full width), with a small caption above it.
   The caption is a pseudo-element on the toggle, so it only shows when the
   toggle does (dual mode); no markup change needed. */
.gencalc-load-card-id > .gencalc-load-card-roles { align-self: flex-start; margin-top: 0; }
/* "Genset role" caption + info (i) above the dual-power toggle; hidden with the
   toggle in single-genset mode. */
.gencalc-load-card-roles-cap {
  align-self: flex-start; margin: 16px 0 7px;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'JCBEuro Bold Regular', sans-serif; font-weight: 700;
  font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--gencalc-lib-ink-4);
}
body:not(.gencalc-role-dual) .gencalc-load-card-roles-cap { display: none !important; }
.gencalc-load-card-roles-cap .gencalc-help { margin-left: 0; }
.gencalc-load-card-roles-cap .gencalc-tooltip {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI',
               'Helvetica Neue', Helvetica, system-ui, sans-serif !important;
  font-weight: 400 !important; text-transform: none !important;
  letter-spacing: 0.1px !important; font-size: 13.5px !important; line-height: 1.6 !important;
}

/* Result pinned bottom — inline kW / kVA on one baseline */
.gencalc-load-card-id .gencalc-load-card-result {
  flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--gencalc-lib-line);
  padding: 13px 0 0; margin: 0; max-width: none;
}
.gencalc-load-card-id .gencalc-load-card-result-sub { margin-top: 0; }

/* Type chip (legacy .gencalc-load-type-trigger restyled into a chip) */
.gencalc-load-card-id .gencalc-lc-typecell { margin-top: 14px; background: transparent; }
.gencalc-lc-typechip {
  display: inline-flex; align-items: center; flex-wrap: nowrap;
  width: fit-content; max-width: 100%;
  min-height: 0; height: 42px; gap: 0;
  padding: 0 13px 0 0;
  border: 1px solid var(--gencalc-lib-line); background: #fff;
}
.gencalc-lc-typechip:hover { border-color: var(--gencalc-lib-ink-4); }
.gencalc-lc-typechip-icon {
  width: 42px; align-self: stretch; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: var(--gencalc-lib-ink-4);
  border-right: 1px solid var(--gencalc-lib-line);
  background: var(--gencalc-lib-bg-bar);
  margin-right: 12px;
}
.gencalc-lc-typechip-body { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.gencalc-lc-typechip-cap {
  font-family: 'JCBEuro Roman Regular', sans-serif;
  font-size: 9.5px; letter-spacing: 0.7px; text-transform: uppercase;
  color: var(--gencalc-lib-ink-4); margin-bottom: 2px;
}
.gencalc-lc-typechip-segs { display: inline-flex; align-items: baseline; flex-wrap: nowrap; min-width: 0; overflow: hidden; gap: 5px; }
.gencalc-lc-typechip .gencalc-load-type-trigger-seg { padding: 0; font-size: 14px; line-height: 1.1; white-space: nowrap; }
.gencalc-lc-typechip-caret { margin-left: 14px; color: #b8bdc4; font-size: 10px; flex: 0 0 auto; }

/* Once a leaf is chosen, drop the "Parent ›" breadcrumb from the chip face —
   the category is one tap away in the picker, and the inline two-tone crumb
   was getting hard-cropped (mid-word) inside the 296px identity column. Show
   just the bold leaf in a single tone, truncating with a clean ellipsis. */
.gencalc-lc-typechip:has(.gencalc-load-type-trigger-seg--kind:not([hidden])) .gencalc-load-type-trigger-seg--parent,
.gencalc-lc-typechip:has(.gencalc-load-type-trigger-seg--kind:not([hidden])) .gencalc-load-type-trigger-sep {
  display: none;
}
.gencalc-lc-typechip .gencalc-load-type-trigger-seg--kind { min-width: 0; max-width: 100%; color: #1a1a1a; }
.gencalc-lc-typechip .gencalc-load-type-trigger-seg--kind > [data-role="type-kind"] {
  display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── RIGHT: field panel ── */
.gencalc-load-card-fields {
  /* Span the remove gutter (col 3→5) so the grey banner runs under the ×,
     letting the quiet × blend into the grey instead of a white strip. */
  grid-column: 3 / 5; grid-row: 1;
  display: flex; flex-direction: column;
  /* Neutral grey banner — distinct from the white zone/identity, no blue tint. */
  background: #e8e8e8;
  /* No reserved top band; right padding reserves the × zone at the far edge. */
  padding: 26px 56px 20px 40px;
  position: relative; min-width: 0;
}
/* Firmer neutral card border so the row reads as a contained object. */
body.gencalc-advanced-on .gencalc-load-row,
body.gencalc-mode-basic .gencalc-load-row { border-color: #dddddd; }
.gencalc-load-card-fields-top { display: flex; gap: 22px; align-items: flex-start; }
.gencalc-load-card-fields-main {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-wrap: wrap; gap: 16px; align-content: flex-start;
}
.gencalc-load-card-count {
  flex: 0 0 auto; width: 116px;
  display: flex; flex-direction: column; gap: 16px;
  border-left: 1px solid var(--gencalc-lib-line);
  padding-left: 22px;
}

/* Field = bold label above a sharp box */
.gencalc-lc-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; position: relative; }
.gencalc-lc-field--power { flex: 0 0 94px; }
.gencalc-lc-field--unit  { flex: 0 0 78px; }
.gencalc-lc-field--phase { flex: 0 0 72px; }
.gencalc-lc-field--pf    { flex: 0 0 122px; }

.gencalc-lc-lab {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 1.3px;
  color: var(--gencalc-lib-ink-3);
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; line-height: 1; margin: 0; user-select: none;
}
.gencalc-lc-req { color: var(--gencalc-lib-orange); }
/* Help ⓘ inside a field label — keep the tooltip body in the system font
   (not the label's uppercase JCB), matching the calc's other tooltips. */
.gencalc-lc-lab .gencalc-help { margin-left: 1px; text-transform: none; letter-spacing: 0; }
.gencalc-lc-lab .gencalc-tooltip {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI',
               'Helvetica Neue', Helvetica, system-ui, sans-serif !important;
  font-weight: 400 !important; text-transform: none !important;
  letter-spacing: 0.1px !important; font-size: 13.5px !important; line-height: 1.6 !important;
}

.gencalc-lc-box {
  background: #fff; border: 1px solid var(--gencalc-lib-line);
  border-radius: 0 !important;
  height: 42px; padding: 0 11px;
  font-family: 'JCBEuro Roman Regular', sans-serif; font-weight: 400; font-size: 16px;
  color: var(--gencalc-lib-ink);
  display: flex; align-items: center;
  width: 100%; box-sizing: border-box;
  outline: none; box-shadow: none !important;
  transition: border-color .12s;
}
.gencalc-lc-box:hover { border-color: var(--gencalc-lib-ink-4); }
.gencalc-lc-box:focus,
.gencalc-lc-field:focus-within > .gencalc-lc-box,
.gencalc-lc-combo:focus-within .gencalc-lc-box { border-color: var(--gencalc-lib-orange); }
.gencalc-lc-box::placeholder { color: #b8bdc4; }

/* Calculate-time validation — invalid required fields go red until edited. */
.gencalc-lc-box.gencalc-field-invalid {
  border-color: #d9342b !important;
  box-shadow: 0 0 0 2px rgba(217, 52, 43, 0.14) !important;
}
input[data-field="description"].gencalc-field-invalid { box-shadow: inset 0 -2px 0 #d9342b; }
.gencalc-zone-header input[data-field="zone-name"].gencalc-field-invalid {
  border-bottom-color: #d9342b !important; box-shadow: inset 0 -2px 0 #d9342b;
}
/* Advanced mode: load type is required — flag the type chip when unpicked. */
.gencalc-lc-typechip.gencalc-field-invalid {
  border-color: #d9342b !important;
  box-shadow: 0 0 0 2px rgba(217, 52, 43, 0.14) !important;
}


/* Select boxes — custom chevron */
.gencalc-lc-box--sel {
  cursor: pointer; -webkit-appearance: none; appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M3 4.5l3 3 3-3' stroke='%231a1a1a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
}

/* Number spinners off */
.gencalc-lc-box[type="number"] { -moz-appearance: textfield; }
.gencalc-lc-box[type="number"]::-webkit-outer-spin-button,
.gencalc-lc-box[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Power-factor combo (value box + Lag/Lead chip) */
.gencalc-lc-combo { display: flex; gap: 8px; width: 100%; }
.gencalc-lc-box--pfval { flex: 1 1 auto; min-width: 0; }
.gencalc-lc-box--pfdir { flex: 0 0 62px; padding-right: 22px; background-position: right 7px center; }

/* Qty box with × prefix (legacy qty-display reused inside a box) */
.gencalc-load-card-qty-display.gencalc-lc-box { gap: 4px; align-items: center; }
.gencalc-load-card-qty-display input[data-field="quantity"] {
  border: 0; background: transparent; outline: none; box-shadow: none;
  font-family: 'JCBEuro Roman Regular', sans-serif; font-weight: 400; font-size: 16px;
  color: var(--gencalc-lib-ink); padding: 0; flex: 1 1 auto; min-width: 0; width: auto;
  -moz-appearance: textfield;
}
.gencalc-load-card-qty-display input[type="number"]::-webkit-outer-spin-button,
.gencalc-load-card-qty-display input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Override marker intentionally not rendered on the new boxed fields.
   (JS still sets data-overridden for any future use; it just isn't shown.) */

/* ── Motor strip — orange wash, no caption/tag, full-width fields ── */
.gencalc-load-card-motor {
  display: flex; align-items: flex-end; gap: 14px;
  background: rgba(250, 167, 71, 0.06);
  border-top: 1px solid rgba(250, 167, 71, 0.30);
  margin: 24px -22px -20px -40px;
  padding: 28px 22px 20px 40px;
}
/* Start method capped (don't let it sprawl on wide screens); Order/Efficiency
   pushed to the right so they sit under the top row's count column. */
.gencalc-load-card-motor .gencalc-lc-field--start { flex: 0 1 340px; }
.gencalc-load-card-motor .gencalc-lc-field--order { flex: 0 0 130px; margin-left: auto; }
.gencalc-load-card-motor .gencalc-lc-field--eta   { flex: 0 0 110px; }
.gencalc-load-card-motor .gencalc-lc-lab { color: var(--gencalc-lib-orange-dark); }
.gencalc-load-card-motor .gencalc-lc-box--sel {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M3 4.5l3 3 3-3' stroke='%23B86E1A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* Basic mode — Demand beside Qty (one row) → the count column collapses to a
   single row, so the whole load card is shorter. */
body.gencalc-mode-basic .gencalc-load-card-count {
  flex-direction: row; width: auto; gap: 16px; align-items: flex-start;
}
body.gencalc-mode-basic .gencalc-load-card-count .gencalc-lc-field--qty { flex: 0 0 70px; }
body.gencalc-mode-basic .gencalc-load-card-count .gencalc-lc-field--demand { flex: 0 0 96px; }
/* Tighten vertical padding in Basic so the row reads shorter still. */
body.gencalc-mode-basic .gencalc-load-card-fields { padding-top: 22px; padding-bottom: 18px; }
body.gencalc-mode-basic .gencalc-load-card-id { padding-top: 22px; padding-bottom: 18px; }

/* Roomier spacing between load cards inside a zone (single clean gap). */
.gencalc-zone-loads { gap: 18px; }
body.gencalc-advanced-on .gencalc-zone-loads > .gencalc-load-row,
body.gencalc-mode-basic .gencalc-zone-loads > .gencalc-load-row { margin-bottom: 0; }

/* ── Zone-header stats — refined to match the card vocabulary:
   JCB-bold tracked labels, a stronger LOAD value, a hairline divider, and a
   sharp diversity control consistent with the load-card field boxes. */
.gencalc-zone-header-stats { gap: 0; align-items: center; }
.gencalc-zone-header-stat { align-items: baseline; gap: 7px; padding: 0 20px; position: relative; }
.gencalc-zone-header-stats > .gencalc-zone-header-stat:first-child { padding-left: 0; }
.gencalc-zone-header-stat:not([hidden]) + .gencalc-zone-header-stat:not([hidden])::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 16px; background: #e3e3e3;
}
.gencalc-zone-header-stat-label {
  font-family: 'JCBEuro Bold Regular', sans-serif; font-weight: 700;
  font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; color: #9aa0a6;
}
.gencalc-zone-header-stat strong {
  font-family: 'JCBEuro Bold Regular', sans-serif; font-size: 17px; color: #1a1a1a; letter-spacing: -0.2px;
}
.gencalc-zone-header-stat-unit {
  /* No text-transform — "kVA" must keep its engineering casing. */
  font-size: 10.5px; color: #9aa0a6; letter-spacing: 0.5px;
}
/* Per-zone mode: Required is the lead figure (its value carries the reserved
   orange so the eye lands on the summable number); connected is demoted to a
   muted, smaller secondary so the header reads "Required … · connected …". */
.gencalc-zone-header-stat--required strong { color: #FAA747; }
.gencalc-zone-header-stat--muted .gencalc-zone-header-stat-label { color: #b3b8bd; }
.gencalc-zone-header-stat--muted strong {
  font-size: 13px; color: #9aa0a6; font-family: 'JCBEuro Roman Regular', sans-serif;
}
.gencalc-zone-header-stat--muted .gencalc-zone-header-stat-unit { font-size: 9.5px; }
/* Diversity control — sharp box. Raw <select> fallback gets a CSS chevron;
   the enhanced custom picker keeps its own caret (no double chevron). */
.gencalc-zone-diversity-inline select {
  border: 1px solid #dcdcdc; border-radius: 0; background: #fff;
  height: 30px; padding: 0 26px 0 10px;
  font-family: 'JCBEuro Roman Regular', sans-serif; font-size: 14px; color: #1a1a1a;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M3 4.5l3 3 3-3' stroke='%231a1a1a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 11px;
}
.gencalc-zone-diversity-inline .gencalc-picker { width: auto; }
.gencalc-zone-diversity-inline .gencalc-picker-trigger {
  width: auto; min-width: 64px; border: 1px solid #dcdcdc; border-radius: 0;
  padding: 0 10px; height: 30px; gap: 6px;
  font-family: 'JCBEuro Roman Regular', sans-serif; font-size: 14px;
}
.gencalc-zone-diversity-inline .gencalc-picker-caret { color: #1a1a1a; }

/* Mobile — stack the two panels */
/* Base reflow: stack the load card to a single column once the two-column
   grid runs out of room. Flat (simple-list) cards span the page and fit the
   two-column form down to ~712px, so 720px is the right breakpoint for them.
   Nested cards (inside a zone / sub-zone) need a higher breakpoint — see the
   .gencalc-zone reflow block below. Keep the declarations here and there in
   sync; load-card-reflow-breakpoint.test.js guards both. */
@media (max-width: 720px) {
  .gencalc-load-card-body { grid-template-columns: 1fr; }
  .gencalc-load-card-body > .gencalc-load-card-drag { display: none; }
  /* Single-column stack: drop the explicit column placement so panels flow,
     and re-corner the × on the card (the gutter collapses). */
  .gencalc-load-card-id,
  .gencalc-load-card-fields { grid-column: 1; grid-row: auto; }
  .gencalc-load-card-body > .gencalc-load-remove {
    position: absolute; top: 12px; right: 14px; grid-column: auto; grid-row: auto;
    align-self: auto; justify-self: auto;
  }
  .gencalc-load-card-fields { border-right: 0; }
  .gencalc-load-card-id { border-right: 0; border-bottom: 1px solid var(--gencalc-lib-line); padding-left: 24px; }
  .gencalc-load-card-fields { padding: 30px 18px 18px; }
  .gencalc-load-card-fields-top { flex-wrap: wrap; }
  .gencalc-load-card-count { width: 100%; border-left: 0; padding-left: 0; flex-direction: row; }
  .gencalc-load-card-motor { margin: 20px -18px -18px; padding: 22px 18px 18px; flex-wrap: wrap; }
  .gencalc-load-card-motor .gencalc-lc-field--start { flex: 1 1 100%; }
}

/* Nested reflow: load cards inside a zone / sub-zone lose ~115px of width to
   the surrounding chrome (paddings, indents, borders), so the 296px fixed
   name column starves the fields panel — Power/Unit/Phase stack and cluster
   top-left, and the grey panel stretches tall and empty beside the name
   column. A *balanced* two-column needs ~1005px viewport when nested, so stack
   nested cards to a single clean column up to 1024px; flat cards keep their
   720px breakpoint above. Declarations mirror the base block — keep in sync. */
@media (max-width: 1024px) {
  .gencalc-zone .gencalc-load-card-body { grid-template-columns: 1fr; }
  .gencalc-zone .gencalc-load-card-body > .gencalc-load-card-drag { display: none; }
  .gencalc-zone .gencalc-load-card-id,
  .gencalc-zone .gencalc-load-card-fields { grid-column: 1; grid-row: auto; }
  .gencalc-zone .gencalc-load-card-body > .gencalc-load-remove {
    position: absolute; top: 12px; right: 14px; grid-column: auto; grid-row: auto;
    align-self: auto; justify-self: auto;
  }
  .gencalc-zone .gencalc-load-card-fields { border-right: 0; }
  .gencalc-zone .gencalc-load-card-id { border-right: 0; border-bottom: 1px solid var(--gencalc-lib-line); padding-left: 24px; }
  .gencalc-zone .gencalc-load-card-fields { padding: 30px 18px 18px; }
  .gencalc-zone .gencalc-load-card-fields-top { flex-wrap: wrap; }
  .gencalc-zone .gencalc-load-card-count { width: 100%; border-left: 0; padding-left: 0; flex-direction: row; }
  .gencalc-zone .gencalc-load-card-motor { margin: 20px -18px -18px; padding: 22px 18px 18px; flex-wrap: wrap; }
  .gencalc-zone .gencalc-load-card-motor .gencalc-lc-field--start { flex: 1 1 100%; }
}

/* ── Modal frame ──────────────────────────────────────────────────────── */
.gencalc-type-modal[hidden] { display: none; }
.gencalc-type-modal {
  position: fixed; inset: 0; z-index: 100001;
  display: flex; align-items: center; justify-content: center;
}
.gencalc-type-modal-backdrop {
  position: absolute; inset: 0; background: rgba(15, 15, 15, 0.5);
}
.gencalc-type-modal-frame {
  position: relative;
  width: min(1080px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 32px));
  background: #fafafa; border: 1px solid #d4d4d8;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 32px rgba(15,15,15,.18);
  font-family: 'JCBEuro Roman Regular', sans-serif;
}
.gencalc-type-modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #fff;
  border-bottom: 1px solid #d4d4d8; flex: 0 0 auto;
}
.gencalc-type-modal-badge {
  background: var(--gencalc-lib-orange, #f59e0b); color: #fff;
  font-weight: 700; padding: 3px 9px; font-size: 11px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.gencalc-type-modal-title {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 14px; color: #0f0f0f; margin: 0;
}
.gencalc-type-modal-spacer { flex: 1; }
.gencalc-type-modal-close {
  background: transparent; border: 0; cursor: pointer;
  width: 28px; height: 28px; color: #525252;
  display: flex; align-items: center; justify-content: center;
}
.gencalc-type-modal-close:hover { color: #0f0f0f; }
.gencalc-type-modal-body {
  display: flex; flex: 1 1 auto; min-height: 0; overflow: hidden;
}

/* ── Tree (left) ──────────────────────────────────────────────────────── */
.gencalc-type-tree-pane {
  width: 190px; padding: 12px 6px;
  background: #f4f4f5; border-right: 1px solid #d4d4d8;
  overflow-y: auto; flex: 0 0 auto;
}
.gencalc-type-tree { display: flex; flex-direction: column; gap: 1px; }
.gencalc-type-tree-section-label {
  font-size: 11px; text-transform: uppercase; color: #737373;
  letter-spacing: 0.06em; padding: 8px 10px 4px; font-weight: 600;
}
.gencalc-type-tree-item {
  padding: 7px 10px; cursor: pointer; font-size: 13px; color: #404040;
  display: flex; justify-content: space-between; align-items: center;
  margin: 1px 4px;
}
.gencalc-type-tree-item:hover { background: #ececef; }
.gencalc-type-tree-item.is-active {
  background: #fef3c7;
  font-weight: 700; color: #171717;
}
.gencalc-type-tree-item-count { color: #a3a3a3; font-weight: 400; font-size: 12px; }
.gencalc-type-tree-item.is-active .gencalc-type-tree-item-count {
  color: #b45309; font-weight: 700;
}

/* ── Right pane: grid or form ─────────────────────────────────────────── */
.gencalc-type-pane {
  flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.gencalc-type-grid {
  flex: 1 1 auto; overflow-y: auto;
  padding: 14px; background: #f4f4f5;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  align-content: start;
}
@media (max-width: 760px) {
  .gencalc-type-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .gencalc-type-grid { grid-template-columns: 1fr; }
}
.gencalc-type-grid[hidden] { display: none; }

/* ── Mobile: tree → horizontal chip strip above the cards ───────────────
   The 190px sidebar leaves cards too narrow; titles wrap to 2-3 lines.
   On phones we stack the modal body vertically and lay the tree out as
   a single scroll-x row of pill chips, freeing the full viewport width
   for the cards below. */
@media (max-width: 600px) {
  .gencalc-type-modal-body {
    flex-direction: column;
  }
  .gencalc-type-tree-pane {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid #d4d4d8;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .gencalc-type-tree {
    flex-direction: row;
    gap: 6px;
    flex-wrap: nowrap;
    width: max-content;
  }
  .gencalc-type-tree-section-label {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: #9aa0a6;
  }
  .gencalc-type-tree-item {
    margin: 0;
    padding: 6px 12px;
    border: 1.5px solid #d8dadc;
    background: #fff;
    border-radius: 999px;
    flex: 0 0 auto;
    gap: 6px;
    font-size: 12.5px;
    color: #1a1a1a;
    white-space: nowrap;
  }
  .gencalc-type-tree-item:hover { background: #fffaf2; border-color: #FAA747; }
  .gencalc-type-tree-item.is-active {
    background: #FAA747;
    border-color: #FAA747;
    color: #fff;
  }
  .gencalc-type-tree-item-count {
    font-size: 11px;
    color: #888;
  }
  .gencalc-type-tree-item.is-active .gencalc-type-tree-item-count {
    color: #fff;
    font-weight: 600;
  }
}

/* ── Type card — compact, single-surface, inline meta line ────────────── */
.gencalc-type-card {
  position: relative; background: #fff; border: 1px solid #d6d8dc;
  cursor: pointer;
  padding: 12px 14px 10px;
  display: flex; flex-direction: column;
  min-height: 132px;
  box-shadow: 0 1px 2px rgba(15,15,15,.04);
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.gencalc-type-card:hover {
  border-color: #888;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15,15,15,.07);
}
.gencalc-type-card.is-selected {
  border-color: var(--gencalc-lib-orange, #f59e0b);
  box-shadow: 0 0 0 1px var(--gencalc-lib-orange, #f59e0b);
}

.gencalc-type-card-name {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-weight: 700; font-size: 13.5px; line-height: 1.22;
  letter-spacing: -0.005em; color: #0f0f0f; margin: 0 0 6px;
  padding-right: 38px; /* leave room for hover Edit button on custom cards */
}
.gencalc-type-card-mine-star {
  color: var(--gencalc-lib-orange, #f59e0b);
  font-size: 12px; margin-left: 6px; vertical-align: 1px;
}
.gencalc-type-card-edit {
  position: absolute; top: 8px; right: 9px;
  background: #fff; border: 1px solid #d4d4d8;
  font-size: 10px; padding: 2px 7px; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.04em; color: #525252;
  font-weight: 600; opacity: 0; transition: opacity .12s ease;
}
.gencalc-type-card:hover .gencalc-type-card-edit,
.gencalc-type-card:focus-within .gencalc-type-card-edit { opacity: 1; }
.gencalc-type-card-edit:hover { color: #0f0f0f; border-color: #0f0f0f; }

.gencalc-type-card-desc {
  margin: 0 0 auto; padding: 0;
  font-size: 12px; line-height: 1.42; color: #555;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.gencalc-type-card-meta {
  margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed #e5e5e5;
  font-size: 11.5px; color: #888;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; line-height: 1.4;
}
.gencalc-type-card-meta-item {
  display: inline-flex; align-items: center; gap: 4px;
}
.gencalc-type-card-meta-key { color: #888; }
.gencalc-type-card-meta-val { color: #0f0f0f; font-weight: 600; }
.gencalc-type-card-meta-sep { color: #d6d6d6; }

.gencalc-type-thd-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 1px;
  margin-right: 1px; vertical-align: 0;
}
.gencalc-type-thd-dot--low  { background: #2f6b3b; }
.gencalc-type-thd-dot--medium { background: #b18800; }
.gencalc-type-thd-dot--high { background: #c25a0c; }

/* ── "+ New custom type" tile ─────────────────────────────────────────── */
.gencalc-type-card-add {
  border: 1px dashed var(--gencalc-lib-orange, #f59e0b);
  background: #fffbef;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 18px; cursor: pointer;
  color: #b45309; font-weight: 700; font-size: 13px;
  letter-spacing: 0.02em; min-height: 132px;
}
.gencalc-type-card-add:hover { background: #fef3c7; }
.gencalc-type-card-add::before { content: '+ '; }

/* ── Custom-type form (right pane) ────────────────────────────────────── */
.gencalc-type-form {
  flex: 1 1 auto; overflow-y: auto;
  padding: 18px 22px; background: #fff;
  display: flex; flex-direction: column; gap: 16px;
}
.gencalc-type-form[hidden] { display: none; }
.gencalc-type-form-title {
  font-family: 'JCBEuro Bold Regular', sans-serif;
  font-size: 16px; font-weight: 700; color: #0f0f0f; margin: 0 0 4px;
}
.gencalc-type-form-sub { font-size: 12px; color: #737373; margin: 0; }
.gencalc-type-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px;
}
.gencalc-type-field { display: flex; flex-direction: column; gap: 4px; }
.gencalc-type-field--full { grid-column: 1 / -1; }
.gencalc-type-field-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: #525252; font-weight: 600;
}
.gencalc-type-field-help {
  font-size: 11px; color: #888; margin-top: 2px; line-height: 1.4;
}
.gencalc-type-field-error { font-size: 11px; color: #b53a17; margin-top: 2px; }
.gencalc-type-input,
.gencalc-type-select,
.gencalc-type-textarea {
  border: 1px solid #d4d4d8; background: #fff;
  padding: 8px 10px; font-size: 13px; color: #171717;
  border-radius: 0; font-family: inherit;
}
.gencalc-type-input:focus,
.gencalc-type-select:focus,
.gencalc-type-textarea:focus {
  outline: 2px solid var(--gencalc-lib-orange, #f59e0b);
  outline-offset: -1px; border-color: var(--gencalc-lib-orange, #f59e0b);
}
.gencalc-type-input--num { font-variant-numeric: tabular-nums; }
.gencalc-type-pf-combo,
.gencalc-type-inrush-combo { display: grid; grid-template-columns: 1fr auto; gap: 6px; }

/* Segmented THD */
.gencalc-type-seg {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  border: 1px solid #d4d4d8;
}
.gencalc-type-seg-opt {
  padding: 8px 10px; text-align: center; cursor: pointer;
  font-size: 12px; font-weight: 600; color: #525252;
  background: #fff; border-right: 1px solid #d4d4d8;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.gencalc-type-seg-opt:last-child { border-right: 0; }
.gencalc-type-seg-opt.is-active {
  background: #fef3c7; color: #b45309;
}

/* Form actions */
.gencalc-type-form-actions {
  border-top: 1px solid #f0f1f3; padding-top: 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.gencalc-type-btn {
  padding: 8px 14px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.gencalc-type-btn--primary {
  background: var(--gencalc-lib-orange, #f59e0b); color: #fff;
}
.gencalc-type-btn--primary[disabled] { opacity: .55; cursor: not-allowed; }
.gencalc-type-btn--ghost {
  background: #fff; color: #525252; border-color: #d4d4d8;
}
.gencalc-type-btn--danger {
  background: #fff; color: #b53a17; border-color: transparent; padding-left: 0;
}
.gencalc-type-btn--danger[disabled] { color: #c0c0c0; cursor: not-allowed; }

/* ── 8-parent grid (replaces the 13-type grid) ───────────────────────── */
.gencalc-type-card--parent {
  cursor: pointer;
  padding: 18px 16px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 88px;
  transition: border-color .14s ease, box-shadow .14s ease, transform .1s ease;
}
.gencalc-type-card--parent:hover {
  border-color: #0f0f0f;
}
.gencalc-type-card--parent:hover .gencalc-type-card-icon {
  background: #FAA747;
}
.gencalc-type-card--parent .gencalc-type-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #0f0f0f;
  background: #faf6ec;
  color: #0f0f0f;
  font-size: 20px;
  flex-shrink: 0;
}
.gencalc-type-card--parent .gencalc-type-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.gencalc-type-card--parent .gencalc-type-card-body .gencalc-type-card-name,
.gencalc-type-card--parent .gencalc-type-card-body .gencalc-type-card-desc {
  margin: 0;
}

/* ── Kind step ───────────────────────────────────────────────────────── */
.gencalc-type-kind-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 14px;
  flex: 1 1 auto;
  overflow-y: auto;
  background: #fff;
}
.gencalc-type-kind-step[hidden] { display: none; }
.gencalc-type-kind-step-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid #e5e7eb;
}
.gencalc-type-kind-back {
  border: 1px solid #d4d4d8;
  background: #fff;
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
}
.gencalc-type-kind-back:hover { border-color: #0f0f0f; }
.gencalc-type-kind-step-title {
  display: flex; flex-direction: column; gap: 2px;
}
.gencalc-type-kind-step-parent {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.01em;
  color: #0f0f0f;
  line-height: 1.1;
}
.gencalc-type-kind-step-sub {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-top: 4px;
}
.gencalc-type-kind-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gencalc-type-kind-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 44px 16px 18px;
  border: 1.5px solid #d4d4d8;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: #0f0f0f;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, transform .1s ease, box-shadow .12s ease;
}
.gencalc-type-kind-row::after {
  content: '\f054';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 11px;
  color: #cfcfd2;
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  transition: color .12s ease, transform .12s ease;
}
.gencalc-type-kind-row:hover {
  border-color: #0f0f0f;
  background: #faf6ec;
}
.gencalc-type-kind-row:hover::after {
  color: #c46a00;
  transform: translateY(-50%) translateX(3px);
}
.gencalc-type-kind-row.is-default { border-color: #0f0f0f; }
.gencalc-type-kind-row-label {
  /* let the label wrap if needed without pushing into the tag/chevron */
  flex: 1 1 auto;
  min-width: 0;
}
.gencalc-type-kind-row-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  color: #0f0f0f;
  background: #FAA747;
  border: 1.5px solid #FAA747;
  padding: 3px 8px;
  line-height: 1;
  margin-right: 22px; /* leave room for the chevron */
}

/* ─────────────────────────────────────────────────────────────────────────
   Multi-Genset Load Roles
   ───────────────────────────────────────────────────────────────────────── */

/* Setup-section Power Plan group */
.gencalc-power-plan-toggle-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px; align-items: center;
    padding: 12px 14px; background: var(--gencalc-lib-bg-bar);
    border: 1px solid var(--gencalc-lib-line);
    margin-bottom: 14px;
}
.gencalc-switch {
    position: relative; display: inline-block;
    width: 38px; height: 22px;
}
.gencalc-switch input { opacity: 0; width: 0; height: 0; }
.gencalc-switch-track {
    position: absolute; inset: 0;
    background: var(--gencalc-lib-ink-3);
    border-radius: 14px;
    transition: background 120ms ease;
}
.gencalc-switch-track::after {
    content: ''; position: absolute;
    left: 3px; top: 3px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: left 120ms ease, background 120ms ease;
}
.gencalc-switch input:checked + .gencalc-switch-track { background: var(--gencalc-lib-ink); }
.gencalc-switch input:checked + .gencalc-switch-track::after { left: 19px; background: var(--gencalc-lib-orange); }

.gencalc-power-plan-toggle-text strong {
    display: block;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 14px; color: var(--gencalc-lib-ink);
}
.gencalc-power-plan-toggle-text small {
    display: block; margin-top: 2px;
    font-size: 12px; color: var(--gencalc-lib-ink-3);
}

/* When the labelset is open, the toggle-row + labelset visually merge into
   one card so the Label set / Custom inputs read as nested children of the
   Power Plan toggle above (not as a sibling section).
   The :has() selector strips the toggle-row's bottom seam; the labelset
   picks up the same bg/border + a hairline divider on top. */
.gencalc-power-plan-toggle-row:has(+ .gencalc-power-plan-labelset:not([hidden])) {
    margin-bottom: 0;
    border-bottom: 0;
}
.gencalc-power-plan-labelset {
    padding: 0;
    background: var(--gencalc-lib-bg-bar);
    border: 1px solid var(--gencalc-lib-line);
    border-top: 1px dashed var(--gencalc-lib-line);
    margin-bottom: 14px;
}
.gencalc-power-plan-labelset:not([hidden]) {
    padding: 14px;
}
.gencalc-power-plan-labelset[hidden] {
    display: none;
}
.gencalc-power-plan-labelset-label {
    display: block; margin-bottom: 8px;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 11px; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--gencalc-lib-ink-4);
}
.gencalc-power-plan-labelset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}
.gencalc-power-plan-labelopt {
    display: block; cursor: pointer;
    border: 1px solid var(--gencalc-lib-line);
    background: #fff; padding: 10px 12px;
    transition: border-color 120ms ease, background 120ms ease;
}
.gencalc-power-plan-labelopt input { display: none; }
.gencalc-power-plan-labelopt.is-on,
.gencalc-power-plan-labelopt:has(input:checked) {
    border-color: var(--gencalc-lib-ink);
    background: var(--gencalc-lib-bg-bar);
}
.gencalc-power-plan-labelopt .opt-pair {
    display: block;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 13px; color: var(--gencalc-lib-ink);
}
.gencalc-power-plan-labelopt .opt-meta {
    display: block; margin-top: 3px;
    font-size: 11px; color: var(--gencalc-lib-ink-3);
}

.gencalc-power-plan-custom {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    margin-top: 10px;
}
.gencalc-power-plan-custom label {
    display: flex; flex-direction: column;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 11px; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--gencalc-lib-ink-4);
}
.gencalc-power-plan-custom input {
    margin-top: 4px;
    border: 1px solid var(--gencalc-lib-line);
    padding: 8px 10px;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 13px; color: var(--gencalc-lib-ink-2);
}

/* Per-row paired toggle */
.gencalc-load-card-roles {
    display: inline-flex;
    border: 1.5px solid var(--gencalc-lib-ink);
    background: #fff;
    flex: 0 0 auto;
}
body:not(.gencalc-role-dual) .gencalc-load-card-roles { display: none !important; }

.gencalc-role-btn {
    display: inline-flex; align-items: center; gap: 8px;
    border: 0; background: transparent;
    padding: 0 14px; height: 36px;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 11px; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--gencalc-lib-ink-4);
    cursor: pointer; border-right: 1px solid var(--gencalc-lib-ink);
    transition: background 120ms ease, color 120ms ease;
}
.gencalc-role-btn:last-child { border-right: 0; }
.gencalc-role-btn-led {
    width: 8px; height: 8px;
    background: var(--gencalc-lib-line);
    border-radius: 50%;
    transition: background 120ms ease, box-shadow 120ms ease;
}
.gencalc-role-btn[data-role-flag="primary"].is-on   {
    background: var(--gencalc-role-primary);
    color: #fff;
}
.gencalc-role-btn[data-role-flag="primary"].is-on .gencalc-role-btn-led {
    background: var(--gencalc-lib-orange);
    box-shadow: 0 0 0 2px rgba(250,167,71,0.25);
}
.gencalc-role-btn[data-role-flag="secondary"].is-on {
    background: var(--gencalc-role-secondary);
    color: var(--gencalc-lib-ink);
}
.gencalc-role-btn[data-role-flag="secondary"].is-on .gencalc-role-btn-led {
    background: var(--gencalc-lib-ink);
    box-shadow: 0 0 0 2px rgba(26,26,26,0.18);
}
.gencalc-role-btn-flash {
    animation: gencalc-role-btn-flash-anim 600ms ease-out;
}
@keyframes gencalc-role-btn-flash-anim {
    0%   { box-shadow: 0 0 0 0   rgba(250,167,71,0); }
    35%  { box-shadow: 0 0 0 3px rgba(250,167,71,0.55); }
    100% { box-shadow: 0 0 0 0   rgba(250,167,71,0); }
}

/* Mobile: at narrow widths the head row can't fit description + role-pair +
   result on one line. Wrap the role-pair to its own full-width row above the
   rest of the head, matching the spec strip's 2-column rhythm. */
@media (max-width: 600px) {
    .gencalc-load-card-head { flex-wrap: wrap; }
    body.gencalc-role-dual .gencalc-load-card-head > .gencalc-load-card-roles {
        order: -1;
        width: 100%;
        flex: 1 1 100%;
        margin: 0 0 8px;
    }
    body.gencalc-role-dual .gencalc-load-card-head > .gencalc-load-card-roles .gencalc-role-btn {
        flex: 1 1 50%;
        justify-content: center;
    }
}

/* ── Secondary-cleared Undo toast ──────────────────────────────────────────── */
.gencalc-toast {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--gencalc-lib-ink); color: #fff;
    padding: 12px 16px;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 13px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.16);
    opacity: 0;
    pointer-events: none;
    transition: transform 200ms ease, opacity 200ms ease;
    z-index: 1000;
    display: flex; align-items: center; gap: 14px;
}
.gencalc-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.gencalc-toast strong { font-family: 'JCBEuro Bold Regular', sans-serif; }
.gencalc-toast-undo {
    background: var(--gencalc-lib-orange);
    color: var(--gencalc-lib-ink);
    border: 0;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 11px; letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 5px 11px;
    cursor: pointer;
}

/* Dual-mode totals strip — two side-by-side mini-strips (Pri | Sec).
   Replaces .gencalc-totals when the engine returns a dual payload. Each
   half mirrors the single-mode strip's 4-cell grid (Total Load / Margin
   / Required / Loads) but with role-specific values. Black border-top on
   Primary, orange on Secondary — matches the dual-panel role accents. */
.gencalc-totals-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}
.gencalc-totals-dual-half {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-top-width: 3px;
    border-top-color: #1a1a1a;
    padding: 12px 14px;
    border-radius: 6px;
}
.gencalc-totals-dual-half[data-role-accent="secondary"] {
    border-top-color: #e07b00;
}
.gencalc-totals-dual-eyebrow {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #1a1a1a;
    margin-bottom: 10px;
}
.gencalc-totals-dual-half[data-role-accent="secondary"] .gencalc-totals-dual-eyebrow {
    color: #e07b00;
}
.gencalc-totals-dual-empty {
    font-size: 12px;
    color: #888;
    padding: 8px 0;
}
.gencalc-totals-dual-cells {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}
.gencalc-totals-dual-cells .gencalc-totals-cell {
    padding: 0 6px;
    border-right: 1px solid #e5e7eb;
}
.gencalc-totals-dual-cells .gencalc-totals-cell:last-child {
    border-right: none;
}
.gencalc-totals-dual-cells .gencalc-totals-value {
    font-size: 15px;
}
.gencalc-totals-dual-cells .gencalc-totals-value > span {
    font-size: 11px;
    color: #888;
    margin-left: 2px;
}
@media (max-width: 720px) {
    .gencalc-totals-dual { grid-template-columns: 1fr; }
}

/* Dual-mode role-section heading row inside the breakdown table.
   Renders as a thin orange-bordered title separator between the Primary
   sizing block and the Secondary sizing block, with no value column. */
.gencalc-breakdown-row.is-section {
    border-bottom: 0;
    border-top: 1px solid #e07b00;
    margin-top: 10px;
    padding-top: 10px;
    align-items: center;
}
.gencalc-breakdown-row.is-section .gencalc-breakdown-label {
    font-size: 12.5px;
    color: #1a1a1a;
}
.gencalc-breakdown-row.is-section .gencalc-breakdown-label strong {
    color: #e07b00;
}
.gencalc-breakdown-row.is-section + .gencalc-breakdown-row {
    border-top: 0;
}

/* ─── Power Plan (dual mode) — replace single rec-grid with dual panels ─────
   Dual mode keeps the upper-summary (eyebrow, ref code, totals strip,
   breakdown, confidence, calc log button, project tolerances) so the
   user sees the same context as single-mode. Only the recommendation-card
   surfaces are swapped: single rec-grid + fleet-mode tabs hide, dual panels
   (or per-zone × dual zone-blocks) take over. */
body.gencalc-result-mode-dual #gencalcRecGrid,
body.gencalc-result-mode-dual #gencalcFleetModeTabs,
body.gencalc-result-mode-dual #gencalcFleetSummary,
body.gencalc-result-mode-dual #gencalcPerZoneCaveat {
    display: none !important;
}
/* In per-zone × dual layout, top-level dual panels are suppressed
   (zone-blocks render into #gencalcZonesResult instead). */
body.gencalc-result-mode-dual-per-zone #gencalcDualResult {
    display: none !important;
}
body.gencalc-result-mode-dual-per-zone #gencalcZonesResult {
    display: block;
}

/* ===========================================================================
 * Optimise Sequencing modal
 * Compact, dense, JCB-industrial. Reuses the project's existing button +
 * pill patterns. Mobile collapses to a full-screen sheet.
 * =========================================================================== */

.gencalc-btn.has-suggestion::after {
    content: '';
    width: 6px; height: 6px;
    background: #e07b00;
    border-radius: 50%;
    display: inline-block;
    margin-left: 6px;
    vertical-align: top;
    margin-top: 2px;
}

.gencalc-optimise-modal {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.gencalc-optimise-modal[hidden] { display: none; }
.gencalc-optimise-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.gencalc-optimise-dialog {
    position: relative;
    background: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    width: 100%;
    max-width: 580px;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.gencalc-optimise-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e2e2;
    background: #fafafa;
}
.gencalc-optimise-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.gencalc-optimise-close {
    background: none; border: 0; font-size: 16px; color: #555; cursor: pointer;
    padding: 4px 8px;
}
.gencalc-optimise-body {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
}
.gencalc-optimise-intro {
    margin: 0 0 12px;
    font-size: 12px;
    color: #555;
    line-height: 1.5;
}
.gencalc-optimise-section { margin-bottom: 12px; }
.gencalc-optimise-section-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #777;
    margin-bottom: 6px;
}
.gencalc-optimise-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.gencalc-optimise-pill {
    padding: 6px 12px;
    border: 1px solid #d4d4d4;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
    color: #333;
}
.gencalc-optimise-pill.is-active {
    background: #e07b00;
    color: #fff;
    border-color: #c46a00;
    font-weight: 600;
}
.gencalc-optimise-pill:disabled {
    opacity: 0.35; cursor: not-allowed;
}
.gencalc-optimise-preview {
    background: #f5f5f5;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 12px;
}
.gencalc-optimise-preview-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 2px 0;
}
.gencalc-optimise-preview-label { color: #555; }
.gencalc-optimise-preview-value { font-weight: 600; }
.gencalc-optimise-preview-savings {
    margin-left: 8px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
}
.gencalc-optimise-preview-savings.is-good { background: #d4ecd4; color: #1a7a1a; }
.gencalc-optimise-preview-savings.is-modest { background: #fff3d4; color: #8a6500; }
.gencalc-optimise-preview-savings.is-none { background: #ececec; color: #777; }

.gencalc-optimise-steps-wrap { overflow-x: auto; }
.gencalc-optimise-steps {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.gencalc-optimise-steps thead {
    background: #f4f4f4;
}
.gencalc-optimise-steps th,
.gencalc-optimise-steps td {
    padding: 5px 8px;
    border-bottom: 1px solid #ececec;
}
.gencalc-optimise-steps th { text-align: left; font-weight: 600; color: #555; }
.gencalc-optimise-steps tr.is-worst {
    background: #fff7e6;
    font-weight: 600;
}
.gencalc-optimise-steps-loads {
    color: #666;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gencalc-optimise-disabled-reason {
    margin: 12px 0 0;
    padding: 8px 10px;
    background: #ffeaea;
    border-left: 3px solid #cc6060;
    font-size: 11px;
    color: #8a1010;
    line-height: 1.55;
    border-radius: 0 4px 4px 0;
}
.gencalc-optimise-disabled-reason[hidden] { display: none; }

.gencalc-optimise-disclaimer {
    margin: 12px 0 0;
    padding: 8px 10px;
    background: #fff8e6;
    border-left: 3px solid #e0c060;
    font-size: 11px;
    color: #664400;
    line-height: 1.5;
}
.gencalc-optimise-disclaimer i { margin-right: 6px; }

/* Modal title's ? help icon — uses the same pattern as the wizard's
   inline help icons so the tooltip styling carries over. */
.gencalc-optimise-head h3 .gencalc-help {
    margin-left: 6px;
    font-size: 12px;
    color: #888;
    cursor: help;
    position: relative;
}
.gencalc-optimise-head h3 .gencalc-help:hover,
.gencalc-optimise-head h3 .gencalc-help:focus {
    color: #555;
}
.gencalc-optimise-foot {
    padding: 10px 16px;
    border-top: 1px solid #e2e2e2;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #fafafa;
}

@media (max-width: 480px) {
    .gencalc-optimise-modal { padding: 0; }
    .gencalc-optimise-dialog { max-width: 100vw; max-height: 100vh; border-radius: 0; height: 100vh; }
    .gencalc-optimise-pills { gap: 3px; }
    .gencalc-optimise-pill { padding: 5px 9px; font-size: 11px; }
    .gencalc-optimise-steps-loads { max-width: 120px; }
}

/* ─────────────────────────────────────────────────────────────────────
   Clean recommendation block — used by per-zone view and Power Plan
   dual-genset role panels. Replaces the legacy 3-card grid where two of
   the three cards were unactionable "Talk to engineering" CTAs and the
   real answer (Sync, usually) was buried as the third card.

   Layout:
     [Headline card]  full-width, brand-orange left rail
     [Alternatives]   compact footer, one line per non-headline config
   ───────────────────────────────────────────────────────────────────── */
.gencalc-clean-rec {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #FAA747;
    margin-bottom: 14px;
    overflow: hidden;
}

/* Tight headline — image left, title + facts right, CTA below.
   No pills, no 3-card metric strip, no "OTHER OPTIONS CONSIDERED" formal
   eyebrow. The customer reads one paragraph and clicks one button. */
.gencalc-clean-rec-headline {
    padding: 16px 20px 14px;
}
.gencalc-clean-rec-headline--engineering {
    border-left: 0;
    background: #fff8ec;
}

.gencalc-clean-rec-body {
    display: flex;
    gap: 16px;
    align-items: center;
}

.gencalc-clean-rec-image {
    flex: 0 0 96px;
    width: 96px;
    height: 70px;
    object-fit: contain;
    background: #f7f8fa;
    border: 1px solid #e5e7eb;
    padding: 4px;
}

.gencalc-clean-rec-info {
    flex: 1 1 auto;
    min-width: 0;
}

.gencalc-clean-rec-rec {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #047857;
    font-family: 'JCBEuro BoldCondensed Regular', Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.gencalc-clean-rec-rec i { font-size: 9px; }
.gencalc-clean-rec-rec--warn { color: #b45309; }

.gencalc-clean-rec-title {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 2px 0;
    line-height: 1.1;
    letter-spacing: -0.005em;
}

.gencalc-clean-rec-facts {
    color: #555;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

/* Inline N+1 / dip-review chips next to the facts line. */
.gencalc-clean-rec-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.gencalc-clean-rec-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    padding: 2px 7px;
    letter-spacing: 0.02em;
    font-family: 'JCBEuro Roman Regular', sans-serif;
}
.gencalc-clean-rec-badge i { font-size: 9px; }
.gencalc-clean-rec-badge--ok   { background: #ecfdf5; color: #047857; }
.gencalc-clean-rec-badge--info { background: #eff6ff; color: #1e40af; }

/* Single-line wet-stacking warning — inline under the facts. */
.gencalc-clean-rec-wetstack {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 10px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    border-left: 2px solid #f59e0b;
}
.gencalc-clean-rec-wetstack i { font-size: 11px; }

/* Per-zone CTAs intentionally removed — the customer is choosing ONE
   fleet, not a configuration per zone. Selector class kept hidden as a
   safety net in case any builder forgets to strip it. */
.gencalc-clean-rec-cta { display: none; }
.gencalc-clean-rec-headline--engineering .gencalc-clean-rec-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #1a1a1a;
    color: #FAA747;
    font-family: 'JCBEuro BoldCondensed Regular', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    margin-top: 8px;
}

/* Fleet-level CTA was removed per 2026-05-14 user feedback — too dominant,
   selection happens via the Get Quote modal elsewhere in the page. */

/* ─────────────────────────────────────────────────────────────────────
   Inrush context note — bridges the "running 1 MVA → required 2.65 MVA"
   gap that's the #1 customer-confusion moment. Shown when sized_for_inrush
   is true (the step-load drove the genset size up beyond running load).
   ───────────────────────────────────────────────────────────────────── */
.gencalc-inrush-context {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 6px 0 18px;
    padding: 10px 14px;
    background: #fff8ec;
    border-left: 3px solid #FAA747;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 12px;
    color: #4b5563;
    line-height: 1.5;
}
.gencalc-inrush-context[hidden] { display: none; }
.gencalc-inrush-context > i {
    color: #FAA747;
    font-size: 14px;
    margin-top: 1px;
    flex-shrink: 0;
}
.gencalc-inrush-context strong {
    color: #1a1a1a;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-weight: 700;
}

/* Alternatives — one inline footer line. No structured list, no
   "OTHER OPTIONS CONSIDERED" formal heading. Conversational. */
.gencalc-clean-rec-alts {
    padding: 10px 20px;
    border-top: 1px solid #eef0f3;
    background: #fafafa;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.5;
}
.gencalc-clean-rec-alts-prefix {
    color: #9ca3af;
    font-family: 'JCBEuro BoldCondensed Regular', Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.gencalc-clean-rec-alts strong {
    color: #1a1a1a;
    font-weight: 600;
    font-family: 'JCBEuro Roman Regular', sans-serif;
}
.gencalc-clean-rec-alts a {
    color: #FAA747;
    text-decoration: none;
}
.gencalc-clean-rec-alts a:hover { color: #b96a14; text-decoration: underline; }

@media (max-width: 720px) {
    .gencalc-clean-rec-title { font-size: 18px; }
    .gencalc-clean-rec-image { flex: 0 0 72px; width: 72px; height: 54px; }
    .gencalc-clean-rec-cta { margin: 12px 12px 0; }
    .gencalc-clean-rec-alts { padding: 8px 12px; font-size: 10px; }
    .gencalc-clean-rec-headline { padding: 12px 14px; }
}

/* ─────────────────────────────────────────────────────────────────────
   Phase Balance card (IEEE-141 §3.6) — R/Y/B panel-style breakdown.
   Pure CSS, JCB font stack only (no new design tokens).
   ───────────────────────────────────────────────────────────────────── */
.gencalc-phase-balance {
    margin: 0 0 16px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'JCBEuro Roman Regular', sans-serif;
}
.gencalc-phase-balance[hidden] { display: none; }
.gencalc-phase-balance-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.gencalc-phase-balance-title {
    margin: 0;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 13px;
    color: #1a1a1a;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}
.gencalc-phase-balance-title i { color: #FAA747; }
.gencalc-phase-balance-mode-pill {
    font-family: 'JCBEuro BoldCondensed Regular', Arial, sans-serif;
    font-size: 10px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.gencalc-phase-balance-empty {
    margin: 0;
    padding: 12px;
    color: #6b7280;
    font-size: 12px;
    text-align: center;
    background: #f9fafb;
    border-radius: 3px;
}
.gencalc-phase-balance-empty[hidden] { display: none; }
.gencalc-phase-balance-body[hidden] { display: none; }
.gencalc-phase-balance-legs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.gencalc-phase-balance-leg {
    padding: 12px 8px;
    text-align: center;
    background: #f9fafb;
    border-top: 3px solid transparent;
    border-radius: 3px 3px 2px 2px;
}
.gencalc-phase-balance-leg--R { border-top-color: #dc2626; }
.gencalc-phase-balance-leg--Y { border-top-color: #f59e0b; }
.gencalc-phase-balance-leg--B { border-top-color: #2563eb; }
.gencalc-phase-balance-leg-label {
    display: block;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 12px;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}
.gencalc-phase-balance-leg--R .gencalc-phase-balance-leg-label { color: #dc2626; }
.gencalc-phase-balance-leg--Y .gencalc-phase-balance-leg-label { color: #f59e0b; }
.gencalc-phase-balance-leg--B .gencalc-phase-balance-leg-label { color: #2563eb; }
.gencalc-phase-balance-leg-value {
    display: block;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 22px;
    color: #1a1a1a;
    line-height: 1.1;
}
.gencalc-phase-balance-leg-unit {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.gencalc-phase-balance-leg.is-worst {
    background: #fff7ed;
}
.gencalc-phase-balance-leg.is-worst .gencalc-phase-balance-leg-value { color: #1a1a1a; }
.gencalc-phase-balance-meta {
    margin: 0;
    display: grid;
    gap: 4px;
}
.gencalc-phase-balance-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-top: 1px solid #f1f3f5;
    font-size: 12px;
}
.gencalc-phase-balance-meta-row dt { color: #6b7280; }
.gencalc-phase-balance-meta-row dd {
    margin: 0;
    color: #1a1a1a;
    font-family: 'JCBEuro Bold Regular', sans-serif;
}
.gencalc-phase-balance-factor-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 10px;
    font-family: 'JCBEuro BoldCondensed Regular', Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.gencalc-phase-balance-factor-pill.is-good    { background: #ecfdf5; color: #047857; }
.gencalc-phase-balance-factor-pill.is-warning { background: #fffbeb; color: #b45309; }
.gencalc-phase-balance-factor-pill.is-danger  { background: #fef2f2; color: #b91c1c; }
.gencalc-phase-balance-mode-note {
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 6px;
    font-size: 11px;
}

/* Panel-schedule-style per-load assignment table — collapsed by default. */
.gencalc-phase-balance-table-wrap {
    margin-top: 14px;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
}
.gencalc-phase-balance-table-wrap[hidden] { display: none; }
.gencalc-phase-balance-table-summary {
    cursor: pointer;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-weight: 500;
    font-size: 12px;
    color: #4b5563;
    list-style: none;
    padding: 4px 0;
    user-select: none;
}
.gencalc-phase-balance-table-summary::-webkit-details-marker { display: none; }
.gencalc-phase-balance-table-summary i {
    transition: transform 0.15s ease;
    margin-right: 6px;
    font-size: 10px;
    color: #9ca3af;
}
.gencalc-phase-balance-table-wrap[open] .gencalc-phase-balance-table-summary i {
    transform: rotate(90deg);
}
.gencalc-phase-balance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-family: 'JCBEuro Roman Regular', sans-serif;
    font-size: 12px;
}
.gencalc-phase-balance-table th,
.gencalc-phase-balance-table td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}
.gencalc-phase-balance-table th {
    font-weight: 500;
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f9fafb;
}
.gencalc-phase-balance-table th.num,
.gencalc-phase-balance-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.gencalc-phase-balance-leg-cell {
    font-weight: 600;
    text-align: center;
    width: 70px;
    border-radius: 3px;
}
.gencalc-phase-balance-leg-cell--R { background: #fef2f2; color: #b91c1c; }
.gencalc-phase-balance-leg-cell--Y { background: #fffbeb; color: #b45309; }
.gencalc-phase-balance-leg-cell--B { background: #eff6ff; color: #1d4ed8; }
.gencalc-phase-balance-leg-cell--all { background: #f3f4f6; color: #4b5563; }

/* ── Setup tab — Band wrappers (2026-05-21 rethink) ─────────────────────
   Two visually-bounded bands that group Setup controls by intent. Replace
   the old scattered fieldsets (Power Plan, Sizing strategy, Project
   Tolerances, Site Conditions). Pure presentation — no semantics. */
.gencalc-setup-band {
    border: 1px solid var(--gp-stroke-soft, #e2e4e7);
    border-radius: 6px;
    padding: 18px 20px 14px;
    margin: 0 0 16px;
    background: #fff;
}
.gencalc-setup-band-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gp-ink-mute, #7b7e84);
    margin: 0 0 12px;
}

/* ── Collapsible band variant ──
   When .gencalc-setup-band is rendered as a <details>, hide the native
   marker (already removed from .gencalc-advanced-block — re-use the
   pattern) and add a chevron that rotates 180° when open. Default state
   when [open] is set in markup is "expanded"; closing the details
   collapses everything except the summary row. */
.gencalc-setup-band--collapsible {
    /* normalize details element to look the same as a non-collapsible band */
    display: block;
}
.gencalc-setup-band--collapsible > .gencalc-setup-band-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    user-select: none;
    margin-bottom: 18px;
}
.gencalc-setup-band--collapsible > .gencalc-setup-band-summary::-webkit-details-marker {
    display: none;
}
.gencalc-setup-band--collapsible > .gencalc-setup-band-summary > .gencalc-setup-band-label {
    /* keep the band label visually identical to non-collapsible bands */
    margin: 0;
}
.gencalc-setup-band-chevron {
    color: #6b7280;
    font-size: 12px;
    transition: transform .2s ease;
}
.gencalc-setup-band--collapsible[open] > .gencalc-setup-band-summary > .gencalc-setup-band-chevron {
    transform: rotate(180deg);
}
.gencalc-setup-band--collapsible > .gencalc-setup-band-summary:hover > .gencalc-setup-band-chevron {
    color: #0f0f0f;
}

/* Preset-applied badge on collapsible band summaries. Small circle with
   the count of fields the active Industry preset wrote into this band.
   Hidden via the `hidden` attribute when count = 0 or no preset active. */
.gencalc-setup-band-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    margin-left: auto;
    background: #FAA747;
    color: #0f0f0f;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 12px;
    line-height: 1;
    border-radius: 999px;
}
.gencalc-setup-band-badge[hidden] {
    display: none;
}

/* Sizing approach — 3-chip row (Single / Primary+Backup / Per-zone).
   Reuses the existing .gencalc-iso-chip style; this rule only adds the
   disabled state used when Per-zone is gated on Loads mode = By zone. */
.gencalc-iso-chip[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
}
.gencalc-iso-chip[aria-disabled="true"]:hover {
    background: inherit;
}

/* Engineering overrides fold — "modified" dot on the summary when the user
   has changed a default inside the fold while it is closed. */
.gencalc-advanced-summary[data-modified="1"] .gencalc-advanced-summary-title::after {
    content: "•";
    color: var(--gp-orange, #ff7a00);
    margin-left: 6px;
    font-size: 18px;
    line-height: 0;
    vertical-align: middle;
}

/* Manual override subhead — peer of Voltage standard / Phase balance /
   Stagger motor starts inside the Site & Power band. JCB Bold uppercase
   tracked to match the other section labels. */
.gencalc-manual-override-subhead {
    display: block;
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a1a1a;
    margin: 0 0 14px;
    padding: 0;
}

/* Auto-revert toast (Per-zone → Simple list). Mirrors the existing
   .gencalc-auto-advanced-notice palette but slimmer — single-line. */
.gencalc-revert-toast {
    margin: 10px 0;
    padding: 8px 12px;
    background: #fff8e6;
    border: 1px solid #f0c75e;
    border-radius: 4px;
    font-size: 13px;
    color: #5c4a18;
    display: flex;
    align-items: center;
    gap: 10px;
}
.gencalc-revert-toast button {
    background: transparent;
    border: 0;
    font-size: 16px;
    color: #5c4a18;
    cursor: pointer;
    padding: 0 4px;
    margin-left: auto;
}
/* /Setup tab rethink */

/* ── Setup tab — outlined-pill chip variant (2026-05-21 rethink follow-up) ─
   The existing .gencalc-iso-chip pattern is a segmented-control (chips on
   a shared #f1f3f5 pill bar). When promoted to the main Setup surface it
   reads as a tab strip. Override for the three Setup chip groups so each
   chip is its own outlined pill with clear separation. Phase balance keeps
   the segmented look (it stays inside the Engineering overrides fold). */
[data-sizing-approach-chips],
[data-power-factor-chips],
[data-voltage-standard-chips],
[data-phase-balance-chips],
[data-stagger-chips] {
    border: 0;
    padding: 16px 0 18px;
    margin: 0 0 30px;
}
[data-sizing-approach-chips] > .gencalc-iso-chips-label,
[data-power-factor-chips] > .gencalc-iso-chips-label,
[data-voltage-standard-chips] > .gencalc-iso-chips-label,
[data-phase-balance-chips] > .gencalc-iso-chips-label,
[data-stagger-chips] > .gencalc-iso-chips-label {
    margin-bottom: 22px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}


[data-sizing-approach-chips] .gencalc-iso-chips-row,
[data-power-factor-chips] .gencalc-iso-chips-row,
[data-voltage-standard-chips] .gencalc-iso-chips-row,
[data-phase-balance-chips] .gencalc-iso-chips-row,
[data-stagger-chips] .gencalc-iso-chips-row {
    background: transparent;
    padding: 0;
    gap: 10px;
    flex-wrap: wrap;
}
[data-sizing-approach-chips] .gencalc-iso-chip,
[data-power-factor-chips] .gencalc-iso-chip,
[data-voltage-standard-chips] .gencalc-iso-chip,
[data-phase-balance-chips] .gencalc-iso-chip,
[data-stagger-chips] .gencalc-iso-chip {
    background: #fff;
    border: 1px solid #d1d5db;
    padding: 10px 18px;
    min-width: 92px;
    font-size: 14px;
    text-align: center;
}
[data-sizing-approach-chips] .gencalc-iso-chip:hover,
[data-power-factor-chips] .gencalc-iso-chip:hover,
[data-voltage-standard-chips] .gencalc-iso-chip:hover,
[data-phase-balance-chips] .gencalc-iso-chip:hover,
[data-stagger-chips] .gencalc-iso-chip:hover {
    background: #f9fafb;
    border-color: #6b7280;
}
[data-sizing-approach-chips] .gencalc-iso-chip[aria-pressed="true"],
[data-power-factor-chips] .gencalc-iso-chip[aria-pressed="true"],
[data-voltage-standard-chips] .gencalc-iso-chip[aria-pressed="true"],
[data-phase-balance-chips] .gencalc-iso-chip[aria-pressed="true"],
[data-stagger-chips] .gencalc-iso-chip[aria-pressed="true"] {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
    box-shadow: none;
}
[data-sizing-approach-chips] .gencalc-iso-chip[aria-pressed="true"]:hover,
[data-power-factor-chips] .gencalc-iso-chip[aria-pressed="true"]:hover,
[data-voltage-standard-chips] .gencalc-iso-chip[aria-pressed="true"]:hover,
[data-phase-balance-chips] .gencalc-iso-chip[aria-pressed="true"]:hover,
[data-stagger-chips] .gencalc-iso-chip[aria-pressed="true"]:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}
[data-sizing-approach-chips] .gencalc-iso-chip[aria-disabled="true"],
[data-sizing-approach-chips] .gencalc-iso-chip[aria-disabled="true"]:hover {
    background: #fff;
    border-color: #d1d5db;
}

/* Engineering overrides fold — drop the heavy card framing on the
   Stagger motor starts row so it sits flush with the surrounding chip
   rows. The .gencalc-power-plan-toggle-row class was originally designed
   as a standalone card for the (now-deleted) Power Plan section. Inside
   the fold we want a flat layout. */
#gencalcAdvancedBlock .gencalc-power-plan-toggle-row {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0 0 18px;
}
/* /Setup tab chip outlined variant */



/* ═══════════════════════════════════════════════════════════════════════════
   PROJECT DETAILS — Spec-sheet letterhead (2026-05-25)
   Label-left / value-right rows in a white card. Matches the website's
   form/card tokens: 8px radius, #e5e7eb hairlines, 12x16 input padding,
   #d1d5db borders, orange #FAA747 only on the primary CTA.
   ═══════════════════════════════════════════════════════════════════════════ */
.gencalc-spec {
    --gs-col-label: 160px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
}

/* Headline — Project name */
.gencalc-spec-headline {
    padding: 14px 32px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gencalc-spec-field-label {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 11px;
    color: #6b7280;
}
.gencalc-spec-name {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1.1;
    color: #0a0a0a;
    background: transparent;
    border: 0;
    outline: none;
    width: 100%;
    padding: 2px 0;
}
.gencalc-spec-name::placeholder {
    color: #9ca3af;
    font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
    font-weight: normal;
}
.gencalc-spec-name:focus { background: rgba(250, 167, 71, 0.04); }

/* Spec rows */
.gencalc-spec-rows { display: grid; }
.gencalc-spec-row {
    display: grid;
    grid-template-columns: var(--gs-col-label) 1fr;
    align-items: stretch;
    border-bottom: 1px solid #e5e7eb;
    min-height: 72px;
}
.gencalc-spec-row:last-of-type { border-bottom: 0; }
.gencalc-spec-label {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: #6b7280;
    padding: 20px 28px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.gencalc-spec-label-text {
    /* keeps the text and the help icon visually aligned on the same row */
    line-height: 1.2;
}
/* The .gencalc-help icon inside spec labels inherits its global styling
   (inline-flex + fa-circle-info). Override font-size to match the
   smaller label scale. */
.gencalc-spec-label .gencalc-help {
    font-size: 12px;
}
.gencalc-spec-value {
    padding: 16px 32px 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.gencalc-spec-value--inline2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex-wrap: nowrap;
}

/* Inputs */
.gencalc-spec-input {
    font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
    font-size: 14px;
    color: #0a0a0a;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px 16px;
    outline: none;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gencalc-spec-input::placeholder { color: #9ca3af; }
.gencalc-spec-input:focus {
    border-color: #FAA747;
    box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.15);
}
/* Validation states — red border + inline error message */
.gencalc-spec-input.is-invalid {
    border-color: #a02f23;
}
.gencalc-spec-input.is-invalid:focus {
    border-color: #a02f23;
    box-shadow: 0 0 0 3px rgba(160, 47, 35, 0.15);
}
.gencalc-spec-input-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.gencalc-spec-error {
    display: block;
    font-size: 12px;
    color: #a02f23;
    margin-top: 4px;
    line-height: 1.3;
}
.gencalc-spec-error[hidden] { display: none; }
.gencalc-spec-error--inline {
    /* Wraps to its own line below the Project window inputs */
    flex-basis: 100%;
    margin-top: 8px;
}
.gencalc-spec-input--inline {
    width: auto;
    max-width: 180px;
}
.gencalc-spec-arrow {
    color: #9ca3af;
    font-size: 14px;
    line-height: 1;
}

/* Meta chip (duration, status) */
.gencalc-spec-meta {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 11px;
    color: #6b7280;
    padding: 6px 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    line-height: 1;
    margin-left: auto;
    white-space: nowrap;
}
.gencalc-spec-meta--accent {
    /* Computed value, not an action — plain accent text, no fill, so it
       can't be mistaken for a button. Darker orange for AA contrast. */
    background: transparent;
    border-color: transparent;
    color: #B86E1A;
    padding-left: 0;
    padding-right: 0;
}

/* Location row */
.gencalc-spec-loc {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 16px;
    align-items: center;
    width: 100%;
}
.gencalc-spec-loc-thumb {
    width: 88px;
    height: 56px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gencalc-spec-loc-thumb--filled {
    background: linear-gradient(135deg, #e6eadd 0%, #d6dccc 50%, #dfe4d3 100%);
}
.gencalc-spec-loc-thumb--filled::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(0deg, transparent 49%, rgba(0,0,0,.05) 49%, rgba(0,0,0,.05) 51%, transparent 51%),
        linear-gradient(90deg, transparent 49%, rgba(0,0,0,.05) 49%, rgba(0,0,0,.05) 51%, transparent 51%);
    background-size: 14px 14px;
}
.gencalc-spec-loc-thumb-pin {
    position: relative;
    font-size: 28px;
    line-height: 1;
    z-index: 1;
}
.gencalc-spec-loc-thumb--empty .gencalc-spec-loc-thumb-pin { color: #9ca3af; }
.gencalc-spec-loc-thumb--filled .gencalc-spec-loc-thumb-pin {
    color: #FAA747;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,.18));
}
.gencalc-spec-loc-text {
    font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
    font-size: 14px;
    color: #0a0a0a;
    line-height: 1.45;
    min-width: 0;
}
.gencalc-spec-loc-text small {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}
.gencalc-spec-loc-text-empty { color: #9ca3af; }
.gencalc-spec-loc-text-empty[hidden],
.gencalc-spec-loc-text-filled[hidden],
.gencalc-spec-loc-action-empty[hidden],
.gencalc-spec-loc-action-filled[hidden] {
    display: none;
}

/* Secondary action — ghost button. Orange fill is reserved for the page's
   primary CTA (Calculate); a map pin inside an optional section shouldn't
   outshout it. Hover borrows the .gencalc-btn--ghost orange-line idiom. */
.gencalc-spec-loc-action {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 13px;
    color: #0a0a0a;
    background: transparent;
    padding: 10px 16px;
    border: 1px solid #d2d2d2;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.gencalc-spec-loc-action:hover { border-color: #FAA747; color: #FAA747; }
/* Filled state: button becomes a ghost "Change" — apply when the .gencalc-spec-loc
   wrapper has data-empty="false" */
.gencalc-spec-loc[data-empty="false"] .gencalc-spec-loc-action {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}
.gencalc-spec-loc[data-empty="false"] .gencalc-spec-loc-action:hover {
    background: #f9fafb;
    color: #0a0a0a;
    border-color: #9ca3af;
}

/* Description row */
.gencalc-spec-row--desc { min-height: 120px; align-items: start; }
.gencalc-spec-row--desc .gencalc-spec-value {
    padding: 16px 32px 16px 0;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
}
.gencalc-spec-desc {
    width: 100%;
    font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: #0a0a0a;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px 16px;
    outline: none;
    resize: vertical;
    min-height: 72px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gencalc-spec-desc::placeholder { color: #9ca3af; }
.gencalc-spec-desc:focus {
    border-color: #FAA747;
    box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.15);
}
.gencalc-spec-desc-hint {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 720px) {
    .gencalc-spec-row {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .gencalc-spec-label {
        padding: 14px 20px 6px;
    }
    .gencalc-spec-value,
    .gencalc-spec-row--desc .gencalc-spec-value {
        padding: 0 20px 16px;
    }
    .gencalc-spec-value--inline2 { grid-template-columns: 1fr; }
    .gencalc-spec-loc { grid-template-columns: 1fr; }
    .gencalc-spec-loc-thumb { width: 100%; height: 120px; }
    .gencalc-spec-headline { padding: 22px 20px 18px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAP PIN PICKER — Project Details map modal (Google Maps).
   ═══════════════════════════════════════════════════════════════════════════ */

.gencalc-map-modal[hidden] { display: none; }
.gencalc-map-modal {
    position: fixed; inset: 0; z-index: 100002;
    display: flex; align-items: center; justify-content: center;
}
.gencalc-map-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 15, 15, 0.5);
}
.gencalc-map-modal-frame {
    position: relative;
    width: min(960px, calc(100vw - 32px));
    height: min(720px, calc(100vh - 32px));
    background: #fff;
    border: 1px solid #d4d4d8;
    box-shadow: 0 24px 48px -16px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}
.gencalc-map-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #faf6ec;
}
.gencalc-map-modal-badge {
    font-family: 'JCBEuro BoldCondensed Regular', sans-serif;
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: 11px;
    padding: 5px 10px;
    background: #FAA747;
    color: #0f0f0f;
    line-height: 1;
}
.gencalc-map-modal-title {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 16px;
    margin: 0;
}
.gencalc-map-modal-spacer { flex: 1; }
.gencalc-map-modal-close {
    background: none; border: 0; cursor: pointer;
    font-size: 22px; color: #888;
    padding: 0 4px;
}
.gencalc-map-modal-close:hover { color: #0f0f0f; }
.gencalc-map-modal-body {
    flex: 1 1 auto;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.gencalc-map-canvas {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
}
.gencalc-map-no-key {
    padding: 40px;
    text-align: center;
    color: #6b7280;
    font-family: inherit;
}
.gencalc-map-no-key i {
    font-size: 32px;
    color: #FAA747;
    margin-bottom: 12px;
}
.gencalc-map-no-key h3 {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 16px;
    color: #0f0f0f;
    margin: 0 0 10px;
}
.gencalc-map-no-key p {
    margin: 8px 0;
    font-size: 13px;
}
.gencalc-map-no-key pre {
    background: #f4f4f5;
    padding: 12px;
    margin: 12px auto;
    max-width: 480px;
    text-align: left;
    font-size: 12px;
    border: 1px solid #e5e7eb;
}
.gencalc-map-no-key code {
    font-family: 'SF Mono', Consolas, monospace;
}
.gencalc-map-no-key-tip {
    font-size: 11px;
    color: #9ca3af;
    max-width: 480px;
    margin: 16px auto 0;
}
.gencalc-map-error {
    padding: 40px;
    text-align: center;
    color: #a02f23;
    font-family: inherit;
}
.gencalc-map-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}
.gencalc-map-address-preview {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.gencalc-map-address-preview-label {
    font-family: 'JCBEuro BoldCondensed Regular', sans-serif;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 10px;
    color: #6b7280;
}
.gencalc-map-address-preview-value {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    font-size: 13px;
    color: #0f0f0f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gencalc-map-modal-actions {
    display: flex;
    gap: 8px;
}
.gencalc-map-btn {
    border: 1px solid #d4d4d8;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    padding: 8px 14px;
    transition: background .12s, border-color .12s;
}
.gencalc-map-btn:hover { border-color: #0f0f0f; }
.gencalc-map-btn--primary {
    background: #FAA747;
    color: #0f0f0f;
    border-color: #FAA747;
    font-family: 'JCBEuro Bold Regular', sans-serif;
}
.gencalc-map-btn--primary:hover {
    background: #c46a00;
    border-color: #c46a00;
    color: #fff;
}
.gencalc-map-btn--primary:disabled {
    background: #f4f4f5;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
}
.gencalc-map-btn--ghost {
    background: transparent;
}

@media (max-width: 720px) {
    .gencalc-map-modal-frame {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
    }
    .gencalc-map-modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .gencalc-map-modal-actions {
        justify-content: flex-end;
    }
}

/* Map modal — Places Autocomplete search bar above the canvas */
.gencalc-map-search {
    position: relative;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    flex-shrink: 0;
}
.gencalc-map-search[hidden] { display: none; }
.gencalc-map-search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
}
.gencalc-map-search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
    font-size: 14px;
    color: #0a0a0a;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gencalc-map-search-input::placeholder { color: #9ca3af; }
.gencalc-map-search-input:focus {
    border-color: #FAA747;
    box-shadow: 0 0 0 3px rgba(250, 167, 71, 0.15);
}
/* The Google Places Autocomplete dropdown — light theming so it
   doesn't clash with the calculator's palette. The .pac-container is
   appended to <body> by Google's SDK at runtime. */
.pac-container {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
    font-family: 'JCBEuro Roman Regular', system-ui, sans-serif;
    z-index: 100003;  /* sit above the modal's z-index: 100002 */
}
.pac-item {
    padding: 8px 12px;
    font-size: 13px;
    border-top: 1px solid #f3f4f6;
    cursor: pointer;
}
.pac-item:first-child { border-top: 0; }
.pac-item:hover { background: #fafafa; }
.pac-item-query {
    font-family: 'JCBEuro Bold Regular', sans-serif;
    color: #0a0a0a;
    font-size: 13px;
}
.pac-matched { color: #c46a00; }
.pac-icon { display: none; }  /* drop the default magnifier icon — we have our own */
/* /Map Pin Picker */

/* ─── Toolbar mode toggle (Basic / Advanced) ──────────────────────────── */
.gencalc-mode-toggle {
    display: inline-flex;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 12px;
    background: #fff;
}
.gencalc-mode-toggle [role="radio"] {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 6px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    line-height: 1.2;
}
.gencalc-mode-toggle [role="radio"] + [role="radio"] {
    border-left: 1px solid #d0d0d0;
}
.gencalc-mode-toggle [role="radio"]:hover { color: #1a1a1a; }
.gencalc-mode-toggle [role="radio"].is-active {
    background: #1a1a1a;
    color: #fff;
}
.gencalc-mode-toggle [role="radio"]:focus-visible {
    outline: 2px solid #f7931e;
    outline-offset: -2px;
}

/* ─── Downgrade modal + toast ─────────────────────────────────────────── */
.gencalc-modal { position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center; }
.gencalc-modal[hidden] { display: none; }
.gencalc-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.gencalc-modal-panel { position: relative; background: #fff; border-radius: 6px;
    max-width: 480px; width: 92%; padding: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25); }
.gencalc-modal-title { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.gencalc-modal-body { margin: 0 0 12px; color: #333; line-height: 1.45; }
.gencalc-modal-offenders { margin: 0 0 18px; padding: 0 0 0 18px;
    color: #444; font-size: 14px; line-height: 1.55; }
.gencalc-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.gencalc-btn-secondary, .gencalc-btn-danger {
    padding: 8px 16px; border-radius: 4px; font: inherit; font-weight: 500;
    cursor: pointer; border: 1px solid transparent;
}
.gencalc-btn-secondary { background: #fff; color: #333; border-color: #c0c0c0; }
.gencalc-btn-secondary:hover { background: #f5f5f5; }
.gencalc-btn-danger { background: #c0392b; color: #fff; }
.gencalc-btn-danger:hover { background: #a93226; }

.gencalc-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: #2c2c2c; color: #fff; padding: 10px 14px; border-radius: 4px;
    display: flex; align-items: center; gap: 12px;
    z-index: 10001; box-shadow: 0 4px 16px rgba(0,0,0,0.3); font-size: 14px; }
.gencalc-toast[hidden] { display: none; }
.gencalc-toast-undo { background: transparent; border: 0; color: #f7931e;
    font: inherit; font-weight: 600; cursor: pointer; padding: 2px 4px; }
.gencalc-toast-undo:hover { color: #ffae50; }

/* ─── Results tab: Basic-mode hide rules (Task 8) ───────────────────────── */
body.gencalc-mode-basic .gencalc-phase-balance,
body.gencalc-mode-basic #gencalcPhaseBalance,
body.gencalc-mode-basic .gencalc-iso-explainer,
body.gencalc-mode-basic #gencalcProjectTolerances,
body.gencalc-mode-basic #gencalcTotalsBreakdownWrap,
/* Optimise sequencing is an Advanced-only engineering tool. */
body.gencalc-mode-basic #gencalcOptimiseLoads {
    display: none !important;
}

/* ─── Basic mode: hide Site & Power overrides + Tolerances (Task 13) ──── */
/* Primary anchors — actual IDs found in wizard.php */
body.gencalc-mode-basic #gencalcSitePowerBlock,
/* Speculative fallbacks — harmless no-ops if selectors don't exist */
body.gencalc-mode-basic .gencalc-site-power-band,
body.gencalc-mode-basic [data-band="site-power"],
body.gencalc-mode-basic .gencalc-site-conditions,
body.gencalc-mode-basic .gencalc-tolerances-band,
body.gencalc-mode-basic [data-band="tolerances"],
body.gencalc-mode-basic .gencalc-tolerances {
    display: none !important;
}

/* Headroom + Usage factor are surfaced in Basic mode (per request) — the
   two fieldsets above are no longer hidden. Add separating space above the
   Headroom fieldset so it doesn't crowd the Dual power section above it. */
.gencalc-slider--margin { margin-top: 24px; }

/* ════ RESULTS REDESIGN — Task 1.2 · result-zone buttons ════ */
/* result-zone buttons — sentence case, ranked by weight */
.gencalc-act-primary{background:#FAA747;border:1px solid #FAA747;color:#1a1a1a;font-family:'JCBEuro Bold Regular',sans-serif;font-size:14px;padding:13px;cursor:pointer;text-align:center;width:100%}
.gencalc-act-primary:hover{background:#f59a30}
.gencalc-act-secondary{background:#fff;border:1px solid #1a1a1a;color:#1a1a1a;font-family:'JCBEuro Bold Regular',sans-serif;font-size:13px;padding:12px;cursor:pointer;text-align:center;width:100%}
.gencalc-act-secondary:hover{background:#1a1a1a;color:#fff}
.gencalc-act-ghost{background:none;border:none;color:#6b7280;font-family:'JCBEuro Bold Regular',sans-serif;font-size:12.5px;padding:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:7px}
.gencalc-act-ghost:hover{color:#1a1a1a}
.gencalc-act-fineprint{font-size:12px;color:#6b7280;margin:6px 0 0}

/* ════ RESULTS REDESIGN — Task 1.3 · result card (single + sync) ════ */
/* one-suggestion result card — horizontal (image left, specs right) */
.gencalc-result-card{background:#fff;border:1px solid #e5e7eb;display:grid;grid-template-columns:200px 1fr;margin-bottom:14px}
@media (max-width:680px){.gencalc-result-card{grid-template-columns:1fr}}
.gencalc-result-card-img{background:#f7f8fa;border-right:1px solid #eef0f3;display:flex;align-items:center;justify-content:center;padding:16px}
.gencalc-result-card-img img{max-width:100%;max-height:130px;object-fit:contain}
.gencalc-result-card-body{padding:18px 22px}
.gencalc-result-card-eyebrow{font-size:10px;letter-spacing:.5px;text-transform:uppercase;color:#FAA747;font-family:'JCBEuro Bold Regular',sans-serif}
.gencalc-result-card-title{font-family:'JCBEuro Bold Regular',sans-serif;font-size:21px;margin:6px 0 2px;color:#1a1a1a}
.gencalc-result-card-subtitle{font-size:12.5px;color:#777;margin:0 0 12px}
.gencalc-result-card-specs{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:1fr 1fr;gap:0 28px;border-top:1px solid #eef0f3}
@media (max-width:680px){.gencalc-result-card-specs{grid-template-columns:1fr}}
.gencalc-result-card-specs li{display:flex;justify-content:space-between;align-items:baseline;padding:8px 0;border-bottom:1px dashed #f0f1f3;font-size:12.5px}
.gencalc-result-card-specs li span{color:#999}
.gencalc-result-card-specs li strong{font-family:'JCBEuro Bold Regular',sans-serif;color:#1a1a1a;font-weight:normal}
/* synced variant — green banner instead of orange eyebrow */
.gencalc-sync-banner{display:inline-flex;align-items:center;gap:7px;background:#ecfdf5;border:1px solid #a7f3d0;color:#047857;font-size:11px;font-family:'JCBEuro Bold Regular',sans-serif;text-transform:uppercase;letter-spacing:.3px;padding:4px 10px;margin-bottom:8px}
/* [hidden] overrides — these elements set an explicit display that would
   otherwise beat the HTML hidden attribute, leaking when JS sets .hidden=true */
.gencalc-sync-banner[hidden]{display:none}
.gencalc-result-top[hidden]{display:none}
.gencalc-site-total[hidden]{display:none}
.gencalc-backup-row[hidden]{display:none}

/* ════ RESULTS REDESIGN — Task 1.4 · backup pair + ATS node ════ */
/* Primary + Backup — side-by-side N+1 pair */
.gencalc-pair{border:1px solid #e5e7eb;background:#fff;margin-bottom:14px}
.gencalc-pair-head{display:flex;align-items:center;gap:10px;background:#1a1a1a;color:#fff;padding:10px 16px;font-family:'JCBEuro Bold Regular',sans-serif;font-size:11px;letter-spacing:.5px;text-transform:uppercase}
.gencalc-pair-head .gencalc-ats-badge{margin-left:auto;background:#FAA747;color:#1a1a1a;padding:3px 9px;font-size:10px}
.gencalc-pair-grid{display:grid;grid-template-columns:1fr 1fr;position:relative}
@media (max-width:680px){.gencalc-pair-grid{grid-template-columns:1fr}}
.gencalc-pair-col{padding:16px 18px}
.gencalc-pair-col+.gencalc-pair-col{border-left:1px solid #eef0f3}
@media (max-width:680px){.gencalc-pair-col+.gencalc-pair-col{border-left:none;border-top:1px solid #eef0f3}}
.gencalc-pair-role{font-size:10px;text-transform:uppercase;letter-spacing:.4px;font-family:'JCBEuro Bold Regular',sans-serif}
.gencalc-pair-role--primary{color:#FAA747}
.gencalc-pair-role--backup{color:#2563eb}
.gencalc-pair-img{background:#f7f8fa;height:80px;display:flex;align-items:center;justify-content:center;margin:8px 0 10px}
.gencalc-pair-img img{max-height:64px;max-width:80%;object-fit:contain}
.gencalc-pair-title{font-family:'JCBEuro Bold Regular',sans-serif;font-size:16px;margin:0 0 2px;color:#1a1a1a}
.gencalc-pair-sub{font-size:11.5px;color:#777;margin:0 0 8px}
.gencalc-pair-specs{list-style:none;margin:0;padding:0}
.gencalc-pair-specs li{display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px dashed #f0f1f3;font-size:12px}
.gencalc-pair-specs li:last-child{border-bottom:none}
.gencalc-pair-specs li span{color:#999}
.gencalc-pair-specs li strong{font-family:'JCBEuro Bold Regular',sans-serif;font-weight:normal;color:#1a1a1a}

/* ════ RESULTS REDESIGN — Task 1.5 · role sub-panel, zone card, site-total ════ */
/* site-total bar (per-zone mode) */
.gencalc-site-total{display:flex;align-items:center;gap:20px;background:#fff;border:1px solid #e5e7eb;padding:16px 22px;margin-bottom:14px;flex-wrap:wrap}
.gencalc-site-total-num{font-family:'JCBEuro Bold Regular',sans-serif;font-size:30px;line-height:1;color:#1a1a1a}
.gencalc-site-total-num small{font-size:15px;color:#555}
.gencalc-site-total-meta{border-left:1px solid #eef0f3;padding-left:20px;font-size:12px;color:#888}
.gencalc-site-total-meta a{color:#2563eb;text-decoration:none}
.gencalc-site-total-actions{margin-left:auto;display:flex;gap:8px;align-items:center}

/* zone card */
.gencalc-zone-card{border:1px solid #d6dae0;background:#fff;margin-bottom:14px}
.gencalc-zone-card-head{display:flex;align-items:center;gap:14px;padding:13px 18px;border-bottom:1px solid #eef0f3;background:#f1f3f5;flex-wrap:wrap}
.gencalc-zone-card-name{font-family:'JCBEuro Bold Regular',sans-serif;font-size:15px;color:#1a1a1a}
.gencalc-zone-card-req{font-size:12px;color:#888;margin-left:auto}
.gencalc-zone-card-req strong{font-family:'JCBEuro Bold Regular',sans-serif;color:#1a1a1a}
.gencalc-zone-card-toggle{display:flex;align-items:center;gap:8px;font-size:11px;color:#555;font-family:'JCBEuro Bold Regular',sans-serif;text-transform:uppercase;letter-spacing:.3px;padding-left:14px;border-left:1px solid #d6dae0}
.gencalc-zone-card-body{padding:14px}

/* role sub-panel (primary/secondary, nestable in zones) */
.gencalc-role{border-left:3px solid #FAA747;padding-left:14px;margin:4px 0 16px}
.gencalc-role:last-child{margin-bottom:4px}
.gencalc-role--secondary{border-left-color:#6b7280}
.gencalc-role-head{display:flex;align-items:center;gap:12px;margin-bottom:10px;flex-wrap:wrap}
.gencalc-role-name{font-family:'JCBEuro Bold Regular',sans-serif;font-size:12.5px;text-transform:uppercase;letter-spacing:.4px}
.gencalc-role--primary .gencalc-role-name{color:#b9791f}
.gencalc-role--secondary .gencalc-role-name{color:#4b5563}
.gencalc-role-scope{font-size:11px;color:#9ca3af}
.gencalc-role-req{font-size:12px;color:#888;margin-left:auto}
.gencalc-role-req strong{font-family:'JCBEuro Bold Regular',sans-serif;color:#1a1a1a;font-size:14px}
.gencalc-role-toggle{display:flex;align-items:center;gap:7px;font-size:10px;color:#666;font-family:'JCBEuro Bold Regular',sans-serif;text-transform:uppercase;letter-spacing:.3px}
/* Single (combined) result: the Backup toggle now sits on the card head, top-
   right, matching the dual / per-zone role cards instead of a separate row. */
.gencalc-single-head{display:flex;justify-content:flex-end;align-items:center;margin-bottom:10px}
/* "Add backup generator" info popup — reuses the .gencalc-help / .gencalc-tooltip
   pattern, but with an inline-SVG icon (the result card is built dynamically, so a
   FontAwesome <i> would not get processed). The toggle sits near the card's right
   edge, so open the popup toward the left to avoid overflowing off-screen. */
.gencalc-backup-help{margin-left:5px}
.gencalc-backup-help .gencalc-tooltip{left:auto;right:-2px;transform:translateY(4px)}
.gencalc-backup-help:hover .gencalc-tooltip,
.gencalc-backup-help:focus .gencalc-tooltip,
.gencalc-backup-help:focus-within .gencalc-tooltip{transform:translateY(0)}
.gencalc-backup-help .gencalc-tooltip::after{left:auto;right:12px;transform:none}

/* ════ RESULTS REDESIGN — Task 1.6 · accept-on-click liability modal ════ */
/* accept-on-click liability modal */
.gencalc-accept-ov{position:fixed;inset:0;background:rgba(17,18,20,.55);display:none;align-items:center;justify-content:center;z-index:1000;padding:20px}
.gencalc-accept-ov.is-open{display:flex}
.gencalc-accept-modal{background:#fff;border:1px solid #e5e7eb;max-width:460px;width:100%}
.gencalc-accept-head{padding:18px 22px;border-bottom:1px solid #eef0f3}
.gencalc-accept-eyebrow{font-size:10px;letter-spacing:.5px;text-transform:uppercase;color:#888;font-family:'JCBEuro Bold Regular',sans-serif;display:block;margin-bottom:5px}
.gencalc-accept-title{font-family:'JCBEuro Bold Regular',sans-serif;font-size:17px;margin:0;color:#1a1a1a}
.gencalc-accept-body{padding:18px 22px;font-size:12.5px;color:#555;line-height:1.55;max-height:240px;overflow:auto}
.gencalc-accept-body p{margin:0 0 9px}
.gencalc-accept-body b{color:#1a1a1a}
.gencalc-accept-ack{display:flex;align-items:flex-start;gap:10px;padding:14px 22px;border-top:1px solid #eef0f3;font-size:12.5px;color:#374151;cursor:pointer}
.gencalc-accept-ack input{margin-top:2px;width:16px;height:16px;accent-color:#FAA747;flex:none}
.gencalc-accept-foot{display:flex;gap:10px;justify-content:flex-end;padding:14px 22px;background:#fafbfc;border-top:1px solid #eef0f3}
.gencalc-accept-cancel{background:none;border:1px solid #d1d5db;color:#374151;font-family:'JCBEuro Bold Regular',sans-serif;font-size:13px;padding:11px 18px;cursor:pointer}
.gencalc-accept-go{background:#FAA747;border:1px solid #FAA747;color:#1a1a1a;font-family:'JCBEuro Bold Regular',sans-serif;font-size:13px;padding:11px 20px;cursor:pointer;opacity:.45;pointer-events:none}
.gencalc-accept-go.is-enabled{opacity:1;pointer-events:auto}

/* ── Share with a colleague — popup modal ─────────────────────────────── */
.gencalc-share-modal[hidden]{display:none}
.gencalc-share-modal{position:fixed;inset:0;z-index:100001;display:flex;align-items:center;justify-content:center}
.gencalc-share-modal-backdrop{position:absolute;inset:0;background:rgba(15,15,15,.5)}
.gencalc-share-modal-frame{position:relative;width:min(420px,calc(100vw - 32px));background:#fafafa;border:1px solid #d4d4d8;display:flex;flex-direction:column;box-shadow:0 12px 32px rgba(15,15,15,.18);font-family:'JCBEuro Roman Regular',sans-serif}
.gencalc-share-modal-header{display:flex;align-items:center;gap:10px;padding:10px 14px;background:#fff;border-bottom:1px solid #d4d4d8;flex:0 0 auto}
.gencalc-share-modal-badge{background:var(--gencalc-lib-orange,#f59e0b);color:#fff;font-weight:700;padding:3px 9px;font-size:11px;letter-spacing:.04em;text-transform:uppercase}
.gencalc-share-modal-title{font-family:'JCBEuro Bold Regular',sans-serif;font-size:14px;color:#0f0f0f;margin:0}
.gencalc-share-modal-spacer{flex:1}
.gencalc-share-modal-close{background:transparent;border:0;cursor:pointer;width:28px;height:28px;color:#525252;display:flex;align-items:center;justify-content:center}
.gencalc-share-modal-close:hover{color:#0f0f0f}
.gencalc-share-modal-body{padding:18px 18px 20px}
.gencalc-share-modal-sub{margin:0 0 14px;font-size:12.5px;color:#555;line-height:1.5}
.gencalc-share-channels{display:flex;gap:10px}
.gencalc-share-channel{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;padding:12px 10px;border:1px solid #d4d4d8;background:#fff;color:#1a1a1a;text-decoration:none;font-family:'JCBEuro Bold Regular',sans-serif;font-size:13px;cursor:pointer;transition:background .12s,border-color .12s}
.gencalc-share-channel i{font-size:17px}
.gencalc-share-channel:hover{border-color:#9ca3af;background:#f3f4f6}
.gencalc-share-wa i{color:#25d366}
.gencalc-share-em i{color:#FAA747}
.gencalc-share-or{display:flex;align-items:center;gap:10px;margin:16px 0 12px;color:#9ca3af;font-size:11px;text-transform:uppercase;letter-spacing:.05em}
.gencalc-share-or::before,.gencalc-share-or::after{content:"";flex:1;height:1px;background:#e5e7eb}
.gencalc-share-linkrow{display:flex;gap:8px}
.gencalc-share-linkinput{flex:1;min-width:0;border:1px solid #d4d4d8;background:#fff;padding:10px 12px;font-size:12px;color:#374151;font-family:Menlo,Consolas,monospace}
.gencalc-share-copybtn{flex:0 0 auto;display:flex;align-items:center;gap:7px;border:1px solid #FAA747;background:#FAA747;color:#1a1a1a;font-family:'JCBEuro Bold Regular',sans-serif;font-size:12.5px;padding:10px 14px;cursor:pointer;white-space:nowrap}
.gencalc-share-copybtn:hover{background:#f59327;border-color:#f59327}
.gencalc-share-copybtn.is-copied{background:#16a34a;border-color:#16a34a;color:#fff}
@media (max-width:420px){.gencalc-share-channels{flex-direction:column}}

/* ── Live collaboration bar (presence + expiry notice) ────────────────── */
.gencalc-collab-bar{position:sticky;top:0;z-index:90;display:flex;align-items:center;gap:10px;padding:10px 14px;background:#fff7ed;border:1px solid #fed7aa;border-left:4px solid #FAA747;color:#7c2d12;font-family:'JCBEuro Roman Regular',sans-serif;font-size:13px;margin:0 0 14px}
.gencalc-collab-bar[hidden]{display:none}
.gencalc-collab-bar-icon{font-size:15px;line-height:1}
.gencalc-collab-bar-msg{flex:1}
.gencalc-collab-bar-action{flex:0 0 auto;border:1px solid #FAA747;background:#FAA747;color:#1a1a1a;font-family:'JCBEuro Bold Regular',sans-serif;font-size:12px;padding:7px 12px;cursor:pointer}
.gencalc-collab-bar-action:hover{background:#f59327;border-color:#f59327}

/* ──────────────────────────────────────────────────────────────────
   Explore-the-fleet internal links — appended below the result so the
   sizing tool routes intent to the rentable equipment pages.
   ────────────────────────────────────────────────────────────────── */
.gencalc-fleet-links {
    margin: 28px 0 8px;
    padding: 24px;
    background: #f7f8fa;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
}

.gencalc-fleet-links-title {
    margin: 0 0 4px;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #14181f;
}

.gencalc-fleet-links-sub {
    margin: 0 0 16px;
    font-size: 0.875rem;
    color: #5a6573;
}

.gencalc-fleet-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gencalc-fleet-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: #ffffff;
    border: 1px solid #d8dce2;
    border-radius: 7px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #14181f;
    text-decoration: none;
    transition: all 0.18s ease;
}

.gencalc-fleet-link i {
    font-size: 0.7rem;
    color: #FAA747;
    transition: transform 0.18s ease;
}

.gencalc-fleet-link:hover {
    background: #14181f;
    border-color: #14181f;
    color: #ffffff;
}

.gencalc-fleet-link:hover i {
    transform: translateX(3px);
}
