@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --primary: #0dbb74;
    --brand-green: #16d889;
    --brand-green-dark: #0dbb74;
    --brand-green-soft: #eafbf3;
    --brand-ink: #06150d;
    --brand-muted: #59675f;
    --brand-navy: #003874;
    --brand-bg: #f6fbf8;
    --brand-border: rgba(6, 21, 13, 0.11);
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Step Content Transitions */
.step-content {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease-out;
}
.step-content.block {
    opacity: 1;
    transform: translateY(0);
}

/* iOS Style Toggle Switch */
input:checked ~ .toggle-bg { background-color: var(--primary); }
input:checked ~ .dot { transform: translateX(100%); }

/* Custom Slider */
.range-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

/* Table Row Highlights */
.margin-row { transition: all 0.2s; cursor: pointer; }
.margin-row:hover { background-color: #f8fafc; }
.margin-row.selected { background-color: #eff6ff; border-left: 3px solid var(--primary); }

/* Indicators */
.indicator { height: 8px; border-radius: 4px; width: 30px; display: inline-block; }
.ind-green { background-color: #22c55e; }
.ind-orange { background-color: #f59e0b; }
.ind-red { background-color: #ef4444; }

#charger-price-card strong {
    font-variant-numeric: tabular-nums;
}

.custom-extra-panel {
    width: 100%;
}

.custom-extra-fields {
    grid-template-columns: minmax(14rem, 1fr) minmax(9rem, 11rem) auto;
}

.custom-extra-vat {
    white-space: nowrap;
}

.custom-extra-remove {
    min-width: 4.75rem;
}

/* Hide summary native arrow */
details > summary::-webkit-details-marker { display: none; }

.mobile-margins {
    display: none;
}

@media (max-width: 900px) {
    html,
    body {
        min-height: 100%;
    }

    body {
        height: auto;
        min-height: 100vh;
        display: block;
        overflow: auto;
        background: #f3f6f9;
    }

    body > aside {
        width: 100%;
        position: sticky;
        top: 0;
        z-index: 40;
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
    }

    body > aside > div:first-child {
        padding: 0.85rem 1rem;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        gap: 0.75rem;
    }

    body > aside > div:first-child img {
        width: 3rem;
        height: 3rem;
        border-width: 1px;
        box-shadow: none;
    }

    body > aside > div:first-child h1 {
        font-size: 0.95rem;
        line-height: 1.15rem;
    }

    body > aside nav {
        padding: 0.75rem 1rem;
        overflow-x: auto;
    }

    body > aside nav .absolute {
        display: none;
    }

    #step-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(6.5rem, 1fr));
        gap: 0.5rem;
        min-width: 21rem;
    }

    #step-nav li {
        align-items: center;
        gap: 0.5rem;
        padding: 0.55rem 0.65rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        background: #fff;
    }

    #step-nav .step-indicator {
        width: 1.75rem;
        height: 1.75rem;
        flex: 0 0 1.75rem;
        box-shadow: none;
        ring-width: 0;
    }

    #step-nav p {
        font-size: 0.75rem;
        line-height: 1rem;
    }

    body > aside > div:last-child {
        display: none;
    }

    body > main {
        width: 100%;
        min-height: auto;
        overflow: visible;
        padding: 0.75rem;
    }

    body > main > div {
        max-width: none;
        min-height: calc(100vh - 9rem);
        border-radius: 0.75rem;
        overflow: visible;
    }

    body > main > div > div:first-child {
        padding: 1rem 1rem 8.5rem;
    }

    h2 {
        font-size: 1.25rem !important;
        line-height: 1.65rem !important;
        margin-bottom: 1rem !important;
        padding-bottom: 0.8rem !important;
    }

    #step-1 .grid,
    #step-2 .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin-bottom: 1rem !important;
    }

    #step-3 > .flex {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    #inp_horas_mo,
    #inp_descuento {
        width: 100%;
    }

    #tabla-margenes-container {
        border-radius: 0.6rem;
    }

    #tabla-margenes-container {
        border: 0;
        box-shadow: none;
        background: transparent;
        display: none;
    }

    .mobile-margins {
        display: grid !important;
        gap: 0.65rem;
        margin-bottom: 1rem;
    }

    .mobile-margin-card {
        display: grid !important;
        grid-template-columns: 2rem 1fr;
        gap: 0.5rem 0.75rem;
        width: 100%;
        padding: 0.85rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.75rem;
        background: #fff;
        box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
        text-align: left;
        color: #0f172a;
    }

    .mobile-margin-card.selected {
        border-left: 4px solid var(--primary);
        border-color: #bfdbfe;
        background: #eff6ff;
    }

    .mobile-margin-radio {
        width: 1rem;
        height: 1rem;
        margin-top: 0.2rem;
        border: 2px solid #cbd5e1;
        border-radius: 999px;
        grid-row: 1 / span 2;
    }

    .mobile-margin-card.selected .mobile-margin-radio {
        border-color: #0ea5e9;
        box-shadow: inset 0 0 0 3px #fff;
        background: #0ea5e9;
    }

    .mobile-margin-head {
        display: flex;
        flex-direction: column;
        gap: 0.05rem;
    }

    .mobile-margin-title {
        font-size: 1rem;
        font-weight: 800;
    }

    .mobile-margin-recommended {
        color: #64748b;
        font-size: 0.75rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    .mobile-margin-line {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        grid-column: 2;
        min-width: 0;
    }

    .mobile-margin-line span {
        color: #64748b;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        flex: 0 0 auto;
    }

    .mobile-margin-line strong {
        font-weight: 600;
    }

    .mobile-margin-indicator {
        grid-column: 2;
        width: 2.1rem;
    }

    #selected-budget-summary > div {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    #desglose-container .flex {
        gap: 0.75rem;
        align-items: flex-start;
    }

    #desglose-container .flex span:first-child {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    body > main > div > div:last-child {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0.75rem;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.65rem;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
    }

    body > main > div > div:last-child > div {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    body > main > div > div:last-child > div:last-child {
        grid-template-columns: 1fr;
    }

    #btn-prev,
    #btn-new-budget,
    #btn-next,
    #btn-generate {
        width: 100%;
        min-height: 2.75rem;
        justify-content: center;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    #btn-generate-wrapper {
        width: 100%;
    }

    input,
    select,
    button {
        font-size: 1rem !important;
    }

    #charger-price-card {
        padding: 0.75rem;
    }

    #charger-price-card .charger-price-values {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    #charger-price-card .charger-price-values > span.text-blue-300 {
        display: none;
    }

    .custom-extra-fields {
        grid-template-columns: 1fr !important;
    }

    .custom-extra-remove {
        width: 100%;
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    .custom-extra-fields {
        grid-template-columns: 1fr !important;
    }

    .custom-extra-remove {
        width: 100%;
    }
}

@media (max-width: 420px) {
    body > aside > div:first-child h1 {
        font-size: 0.82rem;
    }

    #step-nav {
        min-width: 19rem;
    }

    #step-nav li {
        padding: 0.45rem 0.5rem;
    }

    body > main {
        padding: 0.5rem;
    }

    body > main > div > div:first-child {
        padding: 0.85rem 0.85rem 9rem;
    }
}

/* Selector principal de herramientas */
.tool-switch {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    background: #f3f6f4;
}
.tool-switch-option {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 54px;
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #4b5563;
    text-align: left;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.tool-switch-option:hover:not(.active) {
    background: rgba(255, 255, 255, .82);
    color: var(--brand-ink);
}
.tool-switch-option:focus-visible {
    outline: 3px solid rgba(13, 187, 116, .2);
    outline-offset: 2px;
}
.tool-switch-option__code {
    display: grid;
    width: 36px;
    height: 32px;
    place-items: center;
    border: 1px solid rgba(6, 21, 13, .1);
    border-radius: 7px;
    background: #fff;
    color: var(--brand-navy);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
}
.tool-switch-option__copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}
.tool-switch-option__copy strong {
    overflow: hidden;
    font-size: 0.7812rem;
    font-weight: 800;
    line-height: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tool-switch-option__copy small {
    overflow: hidden;
    color: #7a857e;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: .9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tool-switch-option.active {
    background: var(--brand-ink);
    color: #fff;
    box-shadow: 0 5px 14px rgba(6, 21, 13, .16);
}
.tool-switch-option.active .tool-switch-option__code {
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .12);
    color: #78e5ba;
}
.tool-switch-option.active .tool-switch-option__copy small {
    color: rgba(255, 255, 255, .68);
}

/* Legalizacion IRVE */.legal-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}
.legal-field { grid-column: span 4; }
.legal-field-wide { grid-column: span 6; }
.legal-field-full { grid-column: 1 / -1; }
.legal-field-small { grid-column: span 2; }
.legal-field-xsmall { grid-column: span 1; }
.legal-offer-grid {
    grid-column: 1 / -1;
    width: 100%;
}
.legal-offer-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #dbe4ee;
}
.legal-offer-summary > div {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
}
.legal-offer-summary span { color: #526174; }
.legal-offer-summary strong { color: #071d3d; white-space: nowrap; }
.legal-offer-summary .legal-offer-summary__total { background: #edf5ff; }
.legal-label {
    display: block;
    margin-bottom: .45rem;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.legal-input,
.legal-select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d3d8e0;
    border-radius: 8px;
    background: #fff;
    padding: .65rem .75rem;
    color: #1f2937;
    font-size: 0.8438rem;
    outline: none;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.legal-input:focus,
.legal-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.legal-input[readonly],
.legal-auto-field {
    background: #f4f6f9;
}
.legal-section-title {
    grid-column: 1 / -1;
    margin-top: .35rem;
    padding-top: 1rem;
    border-top: 1px solid #eef1f5;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.legal-info {
    grid-column: 1 / -1;
    border: 1px solid #dbe7ff;
    border-radius: 11px;
    background: #eef4ff;
    padding: .9rem 1rem;
    color: #1d4ed8;
    font-size: 0.8125rem;
}
.legal-doc-card {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid #e6e9ee;
    border-radius: 11px;
    background: #fff;
}
.legal-doc-card.selected {
    border-color: #c9d6ef;
    background: #f6f9fe;
}
.legal-tag {
    display: inline-flex;
    align-items: center;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}
.legal-tag-blue { background: #eaf2ff; color: #1d4ed8; }
.legal-tag-green { background: #eafaf1; color: #15803d; }
.legal-tag-gray { background: #f3f4f6; color: #6b7280; }
.legal-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.5rem;
}
.legal-summary-pair {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 0;
    border-bottom: 1px dashed #d3d8e0;
}
.legal-success {
    border: 1px solid #c9ecd6;
    border-radius: 12px;
    background: #eafaf1;
    padding: 1rem;
    color: #166534;
}
@media (max-width: 900px) {
    body > aside > div:first-child .tool-switch {
        flex: 1 1 22rem;
        max-width: none;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .tool-switch-option {
        grid-template-columns: 30px minmax(0, 1fr);
        min-height: 48px;
        padding: 6px 8px;
        gap: 7px;
    }
    .tool-switch-option__code {
        width: 30px;
        height: 28px;
    }
    #legal-step-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(7.5rem, 1fr));
        gap: .5rem;
        min-width: 39rem;
    }
    .legal-form-grid,
    .legal-summary-grid { grid-template-columns: 1fr; }
    .legal-field,
    .legal-field-wide,
    .legal-field-small,
    .legal-field-xsmall { grid-column: 1 / -1; }
    .legal-offer-summary { grid-template-columns: 1fr; }
}
#legal-step-nav.hidden,
#solar-step-nav.hidden,
#step-nav.hidden,
#legal-resumen-container.hidden,
#solar-resumen-container.hidden,
#resumen-container.hidden {
    display: none !important;
}

/* Mosal corporate identity and action dock */
body {
    background: var(--brand-bg) !important;
    color: var(--brand-ink);
    font-family: var(--fuente);
}

body > aside {
    border-color: var(--brand-border) !important;
    box-shadow: 10px 0 30px rgba(6, 21, 13, 0.035);
}

body > main > div {
    border-color: var(--brand-border) !important;
    box-shadow: 0 18px 50px rgba(6, 21, 13, 0.065) !important;
}

body > main > div > div:first-child {
    padding-bottom: 15rem;
}

.step-indicator.bg-blue-600 {
    background-color: var(--brand-green-dark) !important;
    box-shadow: 0 0 0 4px rgba(22, 216, 137, 0.13) !important;
}

.step-indicator.bg-green-500 {
    background-color: var(--brand-navy) !important;
}

.tool-switch-option.active {
    background: var(--brand-ink);
    box-shadow: 0 4px 12px rgba(6, 21, 13, 0.18);
}

.action-dock {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-areas:
        "proposal proposal"
        "nav controls";
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 20px;
    padding: 16px 24px 18px;
    border-top: 1px solid var(--brand-border);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -18px 44px rgba(6, 21, 13, 0.08);
    backdrop-filter: blur(16px);
}

/* The expanded proposal card must follow the result table instead of covering it. */
body > main > div:has(> .action-dock > .proposal-card:not(.hidden)) > div:first-child {
    padding-bottom: 1rem;
}

body > main > div:has(> .action-dock > .proposal-card:not(.hidden)) > .action-dock {
    position: static;
}

.action-dock__nav {
    grid-area: nav;
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-dock__controls {
    grid-area: controls;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.action-dock__final {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.action-dock__final.hidden,
.action-dock.hidden,
.proposal-card.hidden,
.action-button.hidden {
    display: none !important;
}

.action-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 17px;
    font-size: 0.8438rem;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.action-button svg,
.proposal-card svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.action-button:focus-visible,
.proposal-field input:focus-visible,
.proposal-field select:focus-visible,
.test-mode-control:focus-within {
    outline: 3px solid rgba(22, 216, 137, 0.22);
    outline-offset: 2px;
}

.action-button--quiet {
    border-color: #e2e8e4;
    background: #f4f7f5;
    color: #34423a;
}

.action-button--quiet:hover:not(:disabled) {
    background: #eaf0ec;
}

.action-button--secondary {
    border-color: rgba(0, 56, 116, 0.18);
    background: #fff;
    color: var(--brand-navy);
    box-shadow: 0 4px 14px rgba(0, 56, 116, 0.08);
}

.action-button--secondary:hover:not(:disabled) {
    border-color: rgba(0, 56, 116, 0.34);
    background: #f4f8fc;
}

.action-button--primary {
    background: var(--brand-navy);
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 56, 116, 0.2);
}

.action-button--primary:hover:not(:disabled) {
    background: #002d5e;
    box-shadow: 0 13px 28px rgba(0, 56, 116, 0.26);
}

.action-button--primary:disabled {
    border-color: #dce3df;
    background: #e8edeb;
    color: #91a098;
    box-shadow: none;
    cursor: not-allowed;
}

.action-button--proposal {
    min-width: 168px;
    background: linear-gradient(135deg, var(--brand-green), var(--brand-green-dark));
    color: #021009;
    box-shadow: 0 10px 24px rgba(22, 216, 137, 0.22);
}

.action-button--proposal:hover:not(:disabled) {
    box-shadow: 0 13px 28px rgba(22, 216, 137, 0.3);
}

.action-button--next {
    min-width: 145px;
}

.action-button--pdf {
    min-width: 218px;
}

.proposal-card {
    grid-area: proposal;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) auto;
    grid-template-areas:
        "heading fields footer"
        "options options options"
        "result result result";
    align-items: end;
    gap: 12px 18px;
    padding: 14px;
    border: 1px solid rgba(13, 187, 116, 0.24);
    border-left: 4px solid var(--brand-green-dark);
    border-radius: 8px;
    background: linear-gradient(115deg, #f4fdf8 0%, #ffffff 68%);
    box-shadow: 0 8px 26px rgba(6, 21, 13, 0.055);
}

.proposal-card__heading {
    grid-area: heading;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.proposal-card__icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--brand-ink);
    color: var(--brand-green);
}

.proposal-card__title {
    margin: 0;
    color: var(--brand-ink);
    font-size: 0.875rem;
    font-weight: 800;
}

.proposal-card__subtitle {
    margin: 2px 0 0;
    color: var(--brand-muted);
    font-size: 0.75rem;
    line-height: 1.3;
}

.proposal-card__state {
    margin: 4px 0 0;
    color: #68766e;
    font-size: 0.75rem;
    line-height: 1.35;
}

.action-button--proposal:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    box-shadow: none;
}
.proposal-card__badge {
    align-self: start;
    border-radius: 999px;
    padding: 4px 7px;
    background: #e1f8ec;
    color: #08784a;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.proposal-card__fields {
    grid-area: fields;
    display: grid;
    grid-template-columns: 1.45fr 0.72fr 0.82fr 0.9fr;
    gap: 8px;
    min-width: 0;
}

.proposal-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.proposal-field > span {
    color: #647169;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.proposal-field input,
.proposal-field select {
    width: 100%;
    min-width: 0;
    height: 38px;
    border: 1px solid #d9e3dd;
    border-radius: 7px;
    background: #fff;
    padding: 0 10px;
    color: var(--brand-ink);
    font-size: 0.75rem;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.proposal-field input:focus,
.proposal-field select:focus {
    border-color: var(--brand-green-dark);
    box-shadow: 0 0 0 3px rgba(22, 216, 137, 0.12);
}

.proposal-field input::placeholder {
    color: #9aa7a0;
}

.proposal-card__footer {
    grid-area: footer;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.proposal-result {
    grid-area: result;
    min-width: 0;
    color: #214132;
    font-size: 0.75rem;
}

.proposal-result:empty {
    display: none;
}

.proposal-result__content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(13, 187, 116, 0.15);
}

.proposal-result__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #08784a;
    font-weight: 750;
}

.proposal-result__status svg,
.proposal-result__action svg {
    width: 15px;
    height: 15px;
}

/* Aviso de mano de obra: alternativa recalculada o descartada. Ambar para que no
   se confunda con el verde de "Propuesta creada". */
.proposal-result__aviso {
    flex-basis: 100%;
    /* En la rejilla de la vista previa ocupa toda la fila: no es una opcion mas. */
    grid-column: 1 / -1;
    margin: 4px 0;
    padding: 9px 12px;
    border: 1px solid #f0c36d;
    border-radius: 6px;
    background: #fff7e6;
    color: #6b4400;
    font-size: 0.9em;
    line-height: 1.4;
}

.proposal-result__aviso ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

.proposal-result__actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.proposal-result__action {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 5px;
    border: 1px solid #cfe0d6;
    border-radius: 6px;
    background: #fff;
    padding: 0 10px;
    color: #175a3b;
    font-size: 0.75rem;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.proposal-result__action:hover {
    border-color: var(--brand-green-dark);
    background: #f2fbf6;
}

.proposal-result__action--contract {
    border-color: var(--brand-navy);
    background: var(--brand-navy);
    color: #fff;
}

.proposal-result__action--contract:hover {
    border-color: #002d5e;
    background: #002d5e;
}
.proposal-result__action--whatsapp {
    border-color: #128c5e;
    background: #128c5e;
    color: #fff;
}

.proposal-result__action--whatsapp:hover {
    border-color: #08784a;
    background: #08784a;
}

.proposal-result__contact,
.proposal-result__notice {
    flex-basis: 100%;
    font-size: 0.75rem;
    line-height: 1.35;
}

.proposal-result__contact {
    color: #52665b;
    font-weight: 650;
}

.proposal-result__notice {
    border-left: 3px solid #d97706;
    padding-left: 8px;
    color: #92400e;
}

.proposal-result__expiry {
    margin-left: auto;
    color: #728078;
    white-space: nowrap;
}

.test-mode-control {
    position: relative;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    border: 1px solid #f1d584;
    border-radius: 8px;
    background: #fffaf0;
    padding: 0 11px;
    color: #925300;
    font-size: 0.75rem;
    font-weight: 750;
    cursor: pointer;
}

.test-mode-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.test-mode-control__check {
    display: inline-flex;
    width: 17px;
    height: 17px;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #dba423;
    border-radius: 4px;
    background: #fff;
}

.test-mode-control input:checked + .test-mode-control__check {
    border-color: #d48a00;
    background: #e99a00;
    box-shadow: inset 0 0 0 3px #fff;
}

.test-mode-control small {
    color: #a47422;
    font-size: 0.75rem;
    font-weight: 650;
    text-transform: uppercase;
}

.action-tooltip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: 260px;
    border-radius: 6px;
    background: var(--brand-ink);
    padding: 7px 10px;
    color: #fff;
    font-size: 0.75rem;
    box-shadow: 0 8px 20px rgba(6, 21, 13, 0.2);
}

@media (max-width: 1100px) {
    .proposal-card {
        grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
        grid-template-areas:
            "heading footer"
            "fields fields"
            "options options"
            "result result";
    }

    .proposal-card__footer {
        align-self: center;
    }
}

@media (max-width: 900px) {
    body > main > div > div:first-child {
        padding-bottom: 1rem;
    }

    body > main > div > .action-dock {
        position: static;
        display: grid;
        grid-template-areas:
            "proposal"
            "controls"
            "nav";
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
        box-shadow: 0 -8px 24px rgba(6, 21, 13, 0.06);
    }

    body > main > div > .action-dock > .action-dock__nav,
    body > main > div > .action-dock > .action-dock__controls,
    body > main > div > .action-dock .action-dock__final {
        display: flex;
        width: 100%;
        grid-template-columns: none;
    }

    body > main > div > .action-dock > .proposal-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .action-dock__nav,
    .action-dock__controls,
    .action-dock__final {
        gap: 8px;
    }

    .action-dock__nav > *,
    .action-dock__controls > *,
    .action-dock__final > * {
        flex: 1 1 0;
    }

    .proposal-card {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "heading"
            "fields"
            "options"
            "footer"
            "result";
        gap: 12px;
        padding: 12px;
    }

    .proposal-card__fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .proposal-card__footer,
    .proposal-card__footer .action-button,
    .action-button--pdf,
    .action-button--next {
        width: 100%;
    }

    .proposal-card__footer .action-button {
        min-width: 0;
    }

    .proposal-result__content {
        align-items: flex-start;
    }

    .proposal-result__actions {
        width: 100%;
    }

    .proposal-result__action {
        flex: 1 1 auto;
        justify-content: center;
    }

    .proposal-result__expiry {
        width: 100%;
        margin-left: 0;
    }

    .test-mode-control {
        justify-content: center;
    }
}

@media (max-width: 520px) {
    .action-dock__final,
    .action-dock__nav {
        flex-wrap: wrap;
    }

    .action-dock__final > *,
    .action-dock__nav > * {
        flex-basis: 100%;
    }
}
@media (max-width: 360px) {
    .proposal-card__fields {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 640px) {
    body > aside > div:first-child {
        flex-wrap: wrap;
        gap: .65rem;
        padding-inline: .85rem;
    }
    body > aside > div:first-child img {
        width: 2.75rem;
        height: 2.75rem;
    }
    body > aside > div:first-child h1 {
        flex: 1 1 0;
        min-width: 0;
        font-size: .78rem;
        line-height: 1rem;
    }
    body > aside > div:first-child .tool-switch {
        width: 100% !important;
        flex: 0 0 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        padding: 5px;
    }
    .tool-switch-option {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        min-height: 52px;
        padding: 6px 3px;
        gap: 4px;
        text-align: center;
    }
    .tool-switch-option__code {
        width: 29px;
        height: 23px;
        font-size: 0.75rem;
    }
    .tool-switch-option__copy strong {
        font-size: 0.75rem;
        line-height: .8rem;
    }
    .tool-switch-option__copy small {
        display: none;
    }
}
.proposal-options-preview {
    grid-area: options;
    margin-top: 0;
    padding: 16px 18px;
    border: 1px solid #dbe7e1;
    border-radius: 14px;
    background: #f7fbf9;
}
.proposal-options-preview__heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.proposal-options-preview__badge {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    color: #087f5b;
    background: #dff7eb;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.proposal-options-preview__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.proposal-options-preview__item,
.proposal-options-preview__empty {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #dbe7e1;
    border-radius: 10px;
    color: #14352a;
    background: #fff;
    font-size: 0.8125rem;
}
.proposal-options-preview__item strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.proposal-options-preview__item small {
    color: #6c7c75;
}
/* Spacious quote controls: the content should use the available canvas. */
@media (min-width: 901px) {
    #step-2 > .grid {
        grid-template-columns: minmax(0, 1.12fr) minmax(22rem, .88fr);
        column-gap: 2.5rem;
    }

    #step-2 #extras_container {
        display: grid;
        gap: .65rem;
    }

    #step-2 #extras_container .extra-row {
        min-height: 3.65rem;
        padding: .85rem 1rem;
        border: 1px solid #e6edf0;
        background: #fff;
    }

    #step-2 #extras_container .extra-row > label {
        font-size: .95rem;
    }

    #step-2 .custom-extra-panel {
        padding: 1.25rem;
    }

    #step-2 .custom-extra-row {
        padding: 1rem;
    }
}

.proposal-options-preview {
    padding: 1.25rem 1.4rem;
}

.proposal-options-preview__list {
    gap: .75rem;
}

.proposal-options-preview__item,
.proposal-options-preview__empty {
    min-height: 4.5rem;
    padding: .85rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: .95rem;
}

.proposal-options-preview__item strong {
    font-size: 1rem;
}
/* The public proposal is a full-width product comparison, not a narrow list. */
.charger-stack {
    width: 100%;
    max-width: none;
}

.charger-row {
    min-height: 12rem;
    padding: 2rem 2.25rem;
    gap: 2rem;
}

.charger-img-sm {
    width: 168px;
    height: 168px;
}

.charger-info h3 {
    font-size: 1.25rem;
}

.charger-info .subtitle {
    font-size: .95rem;
    line-height: 1.55;
}

.charger-info li {
    font-size: .82rem;
    padding: .45rem .7rem;
}

.charger-price {
    min-width: 190px;
}

.charger-price .price {
    font-size: 2rem;
}

@media (max-width: 980px) {
    .charger-row {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    #step-2 #extras_container .extra-row {
        min-height: 3.35rem;
        padding: .75rem .8rem;
    }

    #step-2 #extras_container .extra-row > label {
        font-size: .95rem;
    }

    .charger-row {
        min-height: 0;
        padding: 1.25rem;
    }

    .charger-img-sm {
        width: 100%;
        height: 210px;
    }

    .charger-info h3 {
        font-size: 1.1rem;
    }

    .charger-price .price {
        font-size: 1.75rem;
    }
}
@media (max-width: 720px) {
    .proposal-options-preview__heading { flex-direction: column; }
    .proposal-options-preview__list { grid-template-columns: 1fr; }
}
/* Full-width extras and proposal composition. */
@media (min-width: 901px) {
    body > main > div {
        width: 100%;
        max-width: 1400px !important;
    }

    #step-2 .extras-section {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(22rem, .85fr);
        gap: 1.5rem;
        padding: 1.5rem;
        border: 1px solid #dbe7e1;
        border-radius: 14px;
        background: linear-gradient(135deg, #f8fcfa 0%, #ffffff 74%);
    }

    #step-2 .extras-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .75rem;
        margin-top: 1rem;
    }

    #step-2 .extras-list .extra-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        gap: .75rem;
        min-height: 4rem;
        margin: 0;
        padding: .85rem 1rem;
        border: 1px solid #e1e9e5;
        border-radius: 10px;
        background: #fff;
    }

    #step-2 .extras-list .extra-row > label:first-child {
        min-width: 0;
        font-size: .95rem;
    }

    #step-2 .custom-extra-panel {
        min-width: 0;
        margin: 0;
        padding: 1.25rem;
        border: 1px solid #beddff;
        border-radius: 12px;
        background: #f4f9ff;
    }

    #step-2 .custom-extra-fields {
        grid-template-columns: minmax(0, 1fr) minmax(9.5rem, 11rem) auto auto;
    }

    .proposal-card {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "heading footer"
            "fields fields"
            "options options"
            "result result";
        align-items: start;
        gap: 1rem 1.5rem;
        padding: 1.35rem 1.5rem;
    }

    .proposal-card__heading {
        grid-template-columns: 42px minmax(0, 1fr) auto;
    }

    .proposal-card__title {
        font-size: 1rem;
    }

    .proposal-card__subtitle,
    .proposal-card__state {
        font-size: .78rem;
    }

    .proposal-card__fields {
        grid-template-columns: minmax(12rem, 1.35fr) repeat(3, minmax(8rem, 1fr));
        gap: .85rem;
    }

    .proposal-options-preview {
        padding: 1.15rem 1.25rem;
    }

    .proposal-options-preview__list {
        gap: .9rem;
    }

    .proposal-options-preview__item,
    .proposal-options-preview__empty {
        min-height: 5rem;
        padding: 1rem 1.1rem;
    }
}

.extras-section__heading,
.custom-extra-panel__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.extras-section__title {
    margin: 0;
    color: var(--brand-ink);
    font-size: .95rem;
    font-weight: 800;
}

.extras-section__subtitle {
    margin: .25rem 0 0;
    color: #637269;
    font-size: .78rem;
    line-height: 1.45;
}

.custom-extra-add {
    display: inline-flex;
    min-height: 2.5rem;
    flex: 0 0 auto;
    align-items: center;
    gap: .45rem;
    border: 1px solid #9dc9fb;
    border-radius: 8px;
    background: #fff;
    padding: 0 .85rem;
    color: #075aa6;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(20, 98, 180, .08);
}

.custom-extra-add:hover {
    border-color: #5fa6ea;
    background: #edf6ff;
}

.custom-extra-add svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

@media (max-width: 900px) {
    #step-2 .extras-section {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
        padding: 1rem;
        border: 1px solid #dbe7e1;
        border-radius: 12px;
        background: #f8fcfa;
    }

    #step-2 .extras-list {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: .65rem;
        margin-top: .85rem;
    }

    #step-2 .extras-list .extra-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: .65rem;
        min-height: 3.75rem;
        margin: 0;
        padding: .75rem;
        border: 1px solid #e1e9e5;
        border-radius: 9px;
        background: #fff;
    }

    #step-2 .custom-extra-panel {
        margin: 0;
        padding: 1rem;
        border-radius: 10px;
    }

    #step-2 .custom-extra-fields {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .custom-extra-add {
        min-height: 2.35rem;
        padding-inline: .7rem;
    }
}

@media (max-width: 480px) {
    #step-2 .extras-list .extra-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    #step-2 .extras-list .extra-gift-wrap {
        grid-column: 2;
        justify-self: end;
    }

    .extras-section__heading,
    .custom-extra-panel__heading {
        align-items: stretch;
        flex-direction: column;
    }

    .custom-extra-add {
        justify-content: center;
        width: 100%;
    }
}
/* Extras desktop: catalogue first, custom entry below. */
@media (min-width: 901px) {
    #step-2 .extras-section {
        display: block;
    }

    #step-2 .extras-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #step-2 .custom-extra-panel {
        width: 100%;
        margin-top: 1.25rem;
    }
}

@media (min-width: 901px) and (max-width: 1080px) {
    #step-2 .extras-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.legal-fixed-case-card {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1rem 1.1rem;
    border: 1px solid #cfe0f5;
    border-radius: 12px;
    background: #f5f9ff;
    color: #003874;
}
.legal-fixed-case-card__eyebrow {
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.legal-fixed-case-card__title {
    font-size: 1.05rem;
    font-weight: 800;
}
.legal-fixed-case-card__meta {
    color: #526784;
    font-size: .9rem;
}

.whatsapp-link-access {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid #cce8dc;
    border-radius: 8px;
    background: #f1faf6;
    color: #12382a;
    text-align: left;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.whatsapp-link-access.hidden {
    display: none;
}

.whatsapp-link-access:hover {
    border-color: #16a36a;
    background: #e8f8f0;
    box-shadow: 0 4px 12px rgba(18, 117, 78, .12);
}

.whatsapp-link-access:focus-visible {
    outline: 3px solid rgba(22, 163, 106, .25);
    outline-offset: 2px;
}

.whatsapp-link-access__icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #16a36a;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
}

.whatsapp-link-access strong,
.whatsapp-link-access small {
    display: block;
}

.whatsapp-link-access strong {
    font-size: 0.75rem;
    line-height: 1.25;
}

.whatsapp-link-access small {
    margin-top: 2px;
    color: #587066;
    font-size: 0.75rem;
    line-height: 1.25;
}

/* Espacio de trabajo: conserva los tokens y la tipografía de Mosal. */
.workspace-label {
    color: var(--brand-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.workspace-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 80rem;
    margin: 0 auto 28px;
}
.workspace-heading h2 {
    color: var(--brand-ink);
    font-size: clamp(26px, 3vw, 40px);
    font-weight: 600;
    letter-spacing: -.04em;
    line-height: 1.2;
    margin: 12px 0;
}
#workspace-description { color: var(--brand-muted); font-size: 0.875rem; }
.workspace-brand { color: var(--brand-navy); font-size: 0.75rem; letter-spacing: .12em; white-space: nowrap; }
.workspace-brand strong { color: var(--brand-green-dark); }
body > aside { overflow-y: auto; }
body > aside > div:first-child { align-items: stretch; text-align: left; }
body > aside > div:first-child img { width: 76px; height: 76px; align-self: center; }
body > aside > div:first-child h1 { text-align: center; }
body > main { min-width: 0; }
/* Almacen y Clientes se abren empotrados en el portal: ocupan el area de
   trabajo entera, sin pasos ni resumen, y comparten toolbar y marco. */
body.stock-active > aside > nav,
body.stock-active > aside > div:nth-of-type(2),
body.clientes-active > aside > nav,
body.clientes-active > aside > div:nth-of-type(2) { display: none; }
body.stock-active > main > div,
body.clientes-active > main > div { max-width: 80rem; min-height: 0; }
body.stock-active > main > div > div:first-child,
body.clientes-active > main > div > div:first-child { padding: 0; }
.stock-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 24px; border-bottom: 1px solid var(--brand-border); }
.stock-toolbar h3 { font-size: 1.125rem; font-weight: 600; color: var(--brand-ink); }
.stock-toolbar p { margin-top: 4px; color: var(--brand-muted); font-size: 0.75rem; }
.stock-toolbar__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stock-toolbar--actions { justify-content: flex-end; }
.stock-action { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 10px 14px; border: 1px solid var(--brand-border); border-radius: 8px; color: var(--brand-navy); background: white; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.stock-action:hover { background: var(--brand-green-soft); }
.stock-action:disabled { opacity: .55; cursor: wait; }
.stock-action:focus-visible { outline: 3px solid var(--brand-green-dark); outline-offset: 2px; }
.stock-status { margin: 20px 24px; padding: 16px; background: var(--brand-green-soft); color: var(--brand-ink); border-radius: 8px; font-size: 0.875rem; }
#stock-frame, #clientes-frame, #administracion-frame, #formacion-frame { width: 100%; height: max(680px, calc(100dvh - 250px)); border: 0; background: white; }
#administracion-frame[hidden], #administracion-retry[hidden] { display: none; }
#stock-frame[hidden], #clientes-frame[hidden], .stock-status[hidden] { display: none; }
@media (max-width: 900px) {
    body > aside > div:first-child .tool-switch { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .workspace-heading { margin: 8px 0 20px; }
    .workspace-brand { display: none; }
    body > aside > div:first-child > .workspace-label { display: none; }
    .stock-toolbar { padding: 16px; }
}
@media (max-width: 640px) {
    body > aside > div:first-child img { width: 44px; height: 44px; }
    body > aside > div:first-child .tool-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool-switch-option { grid-template-columns: 29px minmax(0, 1fr); text-align: left; justify-items: start; gap: 6px; padding: 8px; }
    .tool-switch-option__copy strong { white-space: normal; overflow: visible; }
    .workspace-heading { padding: 12px 8px 0; }
    .workspace-heading h2 { margin: 8px 0; }
    #workspace-description { font-size: 0.75rem; }
    #stock-frame, #clientes-frame, #administracion-frame, #formacion-frame { height: 78dvh; min-height: 620px; }
}

/* «Bandeja clara» (15/10): asistente de presupuesto. Los pasos son botones (aria-current="step"), cada campo tiene su
   etiqueta y su error al lado (no ventanas del navegador) y «Cambiar estado» es un menú con los estados posibles. Colores
   de public/ui/tokens.css. */
#step-nav .wizard-step { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
#step-nav .wizard-step[aria-disabled="true"] { cursor: default; }
#step-nav .wizard-step .pt-1 { padding-top: 0; }
#step-nav .wizard-step .pt-1 > span { font-size: 1rem; }
#step-nav .wizard-step[aria-current="step"] .pt-1 > span { font-weight: 700; color: var(--m-text); }
#step-nav .wizard-step:focus-visible { outline: 3px solid var(--m-focus); outline-offset: 2px; border-radius: 8px; }
.wizard-required-note { margin: 0 0 16px; font-size: 0.875rem; color: var(--m-text-2); }
.wizard-required { color: var(--m-block-ink); font-weight: 700; }
.wizard-field-hint { margin: 6px 0 0; font-size: 0.875rem; color: var(--m-muted); }
.wizard-field-error { margin: 6px 0 0; font-size: 0.875rem; font-weight: 600; line-height: 1.35; color: var(--m-block-ink); }
.wizard-field-error[hidden] { display: none; }
/* portal-unified.css colorea el borde con (0,5,1): el error de un campo manda (!important solo en este estado). */
.wizard-field.is-invalid :is(input, select) { border-color: var(--m-block-line) !important; box-shadow: inset 0 0 0 1px var(--m-block-line); }
.quote-save-btn { min-height: 44px; }
.quote-delete-btn { margin-left: auto; }
.quote-status-menu { position: relative; }
.quote-status-menu > summary { display: inline-flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.quote-status-menu > summary::-webkit-details-marker { display: none; }
.quote-status-menu > summary::after { content: ""; width: 7px; height: 7px; margin-top: -3px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.quote-status-menu[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.quote-status-menu > summary:focus-visible { outline: 3px solid var(--m-focus); outline-offset: 2px; }
.quote-status-menu__list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; display: grid; gap: 2px; min-width: 18rem; padding: 6px;
  background: var(--m-surface); border: 1px solid var(--m-line-strong); border-radius: var(--m-r-md); box-shadow: var(--m-shadow-pop); }
.quote-status-menu__item { display: grid; gap: 2px; width: 100%; min-height: 44px; margin: 0; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--m-text); font: inherit; text-align: left; cursor: pointer; }
.quote-status-menu__item:hover { background: var(--m-hover); }
.quote-status-menu__item:focus-visible { outline: 3px solid var(--m-focus); outline-offset: -3px; background: var(--m-hover); }
.quote-status-menu__item strong { font-size: 0.9375rem; font-weight: 600; }
.quote-status-menu__item span { font-size: 0.875rem; color: var(--m-text-2); }
.quote-status-menu__note { margin: 4px 10px 6px; font-size: 0.875rem; color: var(--m-text-2); }
@media (max-width: 640px) {
    .quote-status-menu { flex-basis: 100%; }
    .quote-status-menu__list { position: static; margin-top: 6px; box-shadow: none; }
    .quote-delete-btn { margin-left: 0; }
}
/* Coste y margen: ocultos hasta marcar «Ver coste y margen» (app.js, setInternalDataVisible). */
body.ocultar-internos .dato-interno { display: none !important; }
.internal-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; font-size: 0.9375rem; font-weight: 600; color: var(--m-text-2); cursor: pointer; }
.internal-toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--m-text); }

/* Formación (29/10): la academia trae su propio menú y su barra; el marco ocupa el alto que deja la miga de pan. */
#formacion-frame { height: calc(100dvh - 110px); min-height: 620px; }
