/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-background);
    font-size: 16px;
}

:root {
    --brand-green: #00c853;
    --brand-green-rgb: 0, 200, 83;
    --brand-green-contrast: #008631;
    --brand-green-contrast-rgb: 0, 134, 49;
    --brand-green-contrast-hover: #00742a;
    --brand-green-contrast-active: #006221;
    --brand-green-tint: #e8f5e9;
    --brand-green-tint-strong: #d0ebd6;
    --brand-green-border: #a4d9b8;
    --brand-green-selection-surface: var(--brand-green-tint);
    --brand-green-selection-surface-strong: var(--brand-green-tint-strong);
    --brand-green-selection-surface-subtle: color-mix(in srgb, var(--brand-green-selection-surface) 55%, var(--color-surface));
    --brand-green-selection-border: var(--brand-green-border);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 32px;
    background: var(--color-surface);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.logo {
    height: 70px;
    width: auto;
    object-fit: contain;
}

h1 {
    font-size: 28px;
    font-weight: 400;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    color: var(--color-text-secondary);
}

/* Progress Bar */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 24px;
    gap: 16px;
}

.progress-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    position: relative;
    padding: 8px 0;
}

.progress-step::after {
    content: '';
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    width: calc(100% - 16px);
    max-width: 120px;
    height: 1px;
    background: var(--color-border);
    transform: translateY(-50%);
    opacity: 0.6;
}

.progress-step:last-child::after {
    display: none;
}

.progress-step:not(.active) {
    opacity: 0.55;
}

.progress-step[data-reachable="true"] {
    cursor: pointer;
}

.progress-step[data-reachable="false"] {
    cursor: not-allowed;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.progress-step.active .step-number {
    border-color: var(--brand-green-contrast);
    background: var(--brand-green-contrast);
    color: #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-green-contrast) 20%, transparent);
}

.step-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-step.active .step-label {
    color: var(--color-text-primary);
}

@media (max-width: 640px) {
    .progress-bar {
        flex-wrap: wrap;
        gap: 8px 16px;
        padding: 0;
    }

    .progress-step {
        flex: 0 0 calc(50% - 8px);
    }

    .progress-step::after {
        display: none;
    }
}

/* Wizard Container */
.wizard-container {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 48px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.wizard-layout {
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 4vw, 32px);
    align-items: stretch;
}

.wizard-main {
    min-width: 0;
}


/* Wizard Steps */
.step {
    display: none;
}

.step.is-active {
    display: block;
}

.wizard-step {
    display: none;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.wizard-step.active,
.wizard-step.is-active,
.wizard-step.entering,
.wizard-step.leaving {
    display: block;
}

.wizard-step.active,
.wizard-step.is-active {
    opacity: 1;
    transform: translateY(0);
}

.wizard-step.entering {
    opacity: 0;
    transform: translateY(16px);
}

.wizard-step.leaving {
    opacity: 0;
    transform: translateY(-16px);
}

.wizard-step h2 {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 32px;
    color: var(--color-text-primary);
}

.wizard-step__content {
    display: contents;
}

.wizard-step__error {
    margin-top: 16px;
}

.wizard-step__error[hidden] {
    display: none;
}

.wizard-step__error .btn {
    margin-top: 16px;
}

.wizard-step__error details {
    margin-top: 16px;
    text-align: left;
}

.wizard-step__error .error-stack {
    margin-top: 8px;
    padding: 12px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    color: #202124;
    max-height: 200px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Option Grid */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.module-status-bar {
    margin-bottom: 24px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--color-surface-soft);
    border: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.module-status-bar::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-border);
    flex: 0 0 auto;
}

.module-status-bar strong {
    color: var(--color-text-primary);
}

.module-status-bar.is-success {
    border-color: color-mix(in srgb, var(--success) 45%, var(--color-border));
    background: color-mix(in srgb, var(--success) 16%, var(--color-surface-soft));
    color: color-mix(in srgb, var(--success) 70%, var(--color-text-primary));
}

.module-status-bar.is-success::before {
    background: var(--success);
}

.module-status-bar.is-warning {
    border-color: var(--warning-border);
    background: var(--warning-surface);
    color: var(--warning-text);
}

.module-status-bar.is-warning::before {
    background: var(--warning);
}

.module-status-bar.is-error {
    border-color: var(--danger-border);
    background: var(--danger-surface);
    color: var(--danger-text);
}

.module-status-bar.is-error::before {
    background: var(--danger);
}

.module-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    margin: 6px 8px 0 0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border: 1px solid var(--color-border-subtle);
    background: var(--chip-bg);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.module-tag--success {
    background: color-mix(in srgb, var(--success) 20%, var(--chip-bg));
    color: color-mix(in srgb, var(--success) 75%, var(--color-text-primary));
    border-color: color-mix(in srgb, var(--success) 35%, var(--color-border-subtle));
}

.module-tag--info {
    background: color-mix(in srgb, var(--accent) 16%, var(--chip-bg));
    color: color-mix(in srgb, var(--accent) 80%, var(--color-text-primary));
    border-color: color-mix(in srgb, var(--accent) 30%, var(--color-border-subtle));
}

.module-tag--error {
    background: color-mix(in srgb, var(--danger) 20%, var(--chip-bg));
    color: color-mix(in srgb, var(--danger) 75%, var(--color-text-primary));
    border-color: color-mix(in srgb, var(--danger) 40%, var(--color-border-subtle));
}

.option-card {
    display: block;
    cursor: pointer;
    position: relative;
}

.option-card.is-unavailable {
    cursor: not-allowed;
}

.option-card.is-unavailable .option-content {
    border-color: var(--color-border-subtle);
    background: color-mix(in srgb, var(--color-surface-muted) 90%, transparent);
    color: var(--color-text-tertiary);
}

.option-card.is-unavailable .option-title {
    background: color-mix(in srgb, var(--color-border-subtle) 80%, transparent);
    color: var(--color-text-tertiary);
}

.option-card.is-unavailable .option-description {
    color: var(--color-text-tertiary);
}

.option-card.is-unavailable:hover .option-content {
    border-color: var(--color-border-subtle);
    background: color-mix(in srgb, var(--color-surface-muted) 90%, transparent);
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option-content {
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.option-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.option-info-button {
    --option-info-size: 26px;
    width: var(--option-info-size);
    height: var(--option-info-size);
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
    background: color-mix(in srgb, var(--color-surface) 85%, white 15%);
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.option-info-button span[aria-hidden="true"] {
    display: inline-block;
    transform: translateY(1px);
}

.option-info-button:hover,
.option-info-button:focus-visible {
    background: var(--brand-green-selection-surface-subtle);
    border-color: var(--brand-green-border);
    color: var(--brand-green-contrast);
}

.option-info-button[aria-expanded="true"] {
    background: var(--brand-green-selection-surface);
    border-color: var(--brand-green-contrast);
    color: var(--brand-green-contrast);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-green) 20%, transparent);
}

.option-info-popover {
    position: absolute;
    z-index: 80;
    max-width: min(360px, calc(100vw - 32px));
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
    background: var(--color-surface, #fff);
    box-shadow:
        0 18px 45px -20px color-mix(in srgb, var(--color-shadow, rgba(15, 23, 42, 0.45)) 70%, transparent),
        0 8px 24px -18px color-mix(in srgb, var(--color-shadow, rgba(15, 23, 42, 0.35)) 60%, transparent);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.option-info-popover[hidden] {
    display: none;
}

.option-info-popover__inner {
    position: relative;
    padding: 1.25rem 1.5rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.option-info-popover__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-secondary, #475569);
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.option-info-popover__close:hover,
.option-info-popover__close:focus-visible {
    background: var(--brand-green-selection-surface-subtle, #e6f4ff);
    border-color: var(--brand-green-border, #93c5fd);
    color: var(--brand-green-contrast, #004282);
    outline: none;
}

.option-info-popover__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary, #0f172a);
}

.option-info-popover__summary {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-secondary, #475569);
}

.option-info-popover__summary[hidden] {
    display: none;
}

.option-info-popover__sections {
    display: grid;
    gap: 0.85rem;
}

.option-info-popover__section {
    border-top: 1px solid color-mix(in srgb, var(--color-border-subtle, #e2e8f0) 85%, transparent);
    padding-top: 0.85rem;
}

.option-info-popover__section-title {
    margin: 0 0 0.45rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-text-tertiary, #64748b);
}

.option-info-popover__list {
    margin: 0;
    padding-left: 1.15rem;
    display: grid;
    gap: 0.45rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-primary, #0f172a);
}

.option-card:hover .option-content {
    border-color: var(--brand-green);
    background: var(--color-surface-muted);
}

.option-card input[type="radio"]:checked + .option-content {
    border-color: var(--brand-green-contrast);
    background: var(--brand-green-selection-surface);
}

.option-status {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.45;
    color: color-mix(in srgb, var(--danger) 75%, var(--color-text-primary));
    text-align: center;
}

/* Module badge styling */
.option-title {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-primary);
    background: var(--color-surface-muted);
    margin-bottom: 8px;
}

/* None module badge */
.option-card input[value="none"] + .option-content .option-title {
    background: var(--color-surface-muted);
    color: var(--color-text-primary);
}

/* Base module badge */
.option-card input[value="base"] + .option-content .option-title {
    background: var(--brand-green-contrast);
    color: white;
}

/* Pro module badge */
.option-card input[value="pro"] + .option-content .option-title {
    background: var(--brand-green-contrast);
    color: white;
}

.option-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.option-icon svg {
    width: 48px;
    height: 48px;
}

.option-icon.power-icon img {
    width: 140px;
    height: auto;
    object-fit: contain;
}

/* This will be overridden by the badge styling above */

.option-description {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* Module layout */
.module-step-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.module-step-grid__main {
    grid-column: span 9;
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0;
}

.module-step-grid__summary {
    grid-column: span 3;
    position: relative;
}

.module-step-grid__summary .module-summary-card {
    position: sticky;
    top: 24px;
}

body.has-wizard-sidebar .module-step-grid__main {
    grid-column: 1 / -1;
}

body.has-wizard-sidebar .module-step-grid__summary--inline {
    display: none;
}

@media (max-width: 1200px) {
    .module-step-grid__main {
        grid-column: span 8;
    }

    .module-step-grid__summary {
        grid-column: span 4;
    }

    body.has-wizard-sidebar .module-step-grid__main {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1024px) {
    .module-step-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .module-step-grid__main,
    .module-step-grid__summary {
        grid-column: span 6;
    }

    .module-step-grid__summary .module-summary-card {
        position: static;
    }

    body.has-wizard-sidebar .module-step-grid__main {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .module-step-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
    }

    .module-step-grid__main,
    .module-step-grid__summary {
        grid-column: span 4;
    }

    body.has-wizard-sidebar .module-step-grid__main {
        grid-column: span 4;
    }

    body.has-wizard-sidebar .module-step-grid__summary--inline {
        display: block;
        grid-column: span 4;
    }
}

.module-collection {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.module-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.module-group__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--color-surface) 94%, var(--color-border) 6%);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.module-group__summary-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}

.module-group__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.35;
}

.module-group__description {
    font-size: 16px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.module-group__summary-label {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.module-group__summary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 10px 20px;
}

.module-group__body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

[data-module-group-body][hidden] {
    display: none !important;
}

.module-group[data-expanded="true"] .module-group__summary {
    border-color: var(--brand-green-contrast);
    box-shadow: 0 10px 28px rgba(var(--brand-green-contrast-rgb), 0.16);
    background: var(--brand-green-selection-surface-subtle);
}

.module-group[data-expanded="true"] .module-group__summary-label {
    color: var(--brand-green-contrast);
}

.module-group[data-expanded="true"] .module-group__summary-button {
    border-color: color-mix(in srgb, var(--brand-green-contrast) 35%, var(--color-border));
}

@media (max-width: 720px) {
    .module-group__summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .module-group__summary-button {
        width: 100%;
        padding: 12px 18px;
    }
}

.module-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.module-card {
    position: relative;
    display: block;
}

.module-card input[type="radio"] {
    position: absolute;
    inset: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.module-card__inner {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 24px;
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.module-card:hover .module-card__inner,
.module-card:focus-within .module-card__inner {
    border-color: color-mix(in srgb, var(--brand-green-contrast) 45%, var(--color-border));
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.module-card:focus-within .module-card__inner {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.module-card input[type="radio"]:checked + .module-card__inner {
    border-color: var(--brand-green-contrast);
    box-shadow: 0 10px 28px rgba(var(--brand-green-contrast-rgb), 0.18);
    transform: translateY(-2px);
}

.module-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.module-card__titles {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.module-card__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    background: color-mix(in srgb, var(--brand-green-selection-surface) 60%, var(--color-surface-soft));
    color: color-mix(in srgb, var(--brand-green-contrast) 85%, var(--color-text-primary));
    border: 1px solid color-mix(in srgb, var(--brand-green-selection-border) 70%, var(--color-border-subtle));
    white-space: nowrap;
    margin-left: auto;
}

.module-card .option-title {
    padding: 0;
    border-radius: 0;
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.module-card .option-description {
    font-size: 16px;
    color: var(--color-text-secondary);
    text-align: left;
}

.module-card__state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 600;
    background: var(--color-surface-soft);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-subtle);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.module-card__state-label--active {
    display: none;
}

.module-card input[type="radio"]:checked + .module-card__inner .module-card__state {
    background: var(--brand-green-selection-surface);
    border-color: color-mix(in srgb, var(--brand-green-contrast) 55%, var(--color-border));
    color: color-mix(in srgb, var(--brand-green-contrast) 80%, #fff);
}

.module-card input[type="radio"]:checked + .module-card__inner .module-card__state-label--default {
    display: none;
}

.module-card input[type="radio"]:checked + .module-card__inner .module-card__state-label--active {
    display: inline;
}

.module-card__specs {
    display: grid;
    gap: 12px;
}

.module-card__spec {
    display: grid;
    grid-template-columns: minmax(0, 80px) 1fr;
    gap: 12px;
    align-items: start;
}

.module-card__spec dt {
    font-size: 14px;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.module-card__spec dd {
    margin: 0;
    font-size: 16px;
    color: var(--color-text-primary);
    line-height: 1.5;
}

.module-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 8px;
}

.module-card__badge {
    display: none;
    visibility: hidden;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: var(--danger-surface);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
    white-space: nowrap;
}

.module-card__badge.is-active {
    display: inline-flex;
    visibility: visible;
    background: color-mix(in srgb, var(--danger) 35%, #fff);
    border-color: color-mix(in srgb, var(--danger) 65%, var(--danger-border));
    color: color-mix(in srgb, var(--danger) 85%, #000);
}

.option-card.is-unavailable .module-card__inner {
    border-style: dashed;
    opacity: 0.6;
    box-shadow: none;
}

.option-card.is-unavailable .module-card__state {
    opacity: 0.6;
}

.module-summary-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.module-summary-card__header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.module-summary-card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.module-summary-card__subtitle {
    margin: 0;
    font-size: 16px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.module-summary-card__body {
    display: grid;
    gap: 16px;
}

.module-summary-card__item {
    display: grid;
    gap: 4px;
}

.module-summary-card__body > * {
    display: grid;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-subtle);
}

.module-summary-card__body > *:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.module-summary-card__item-label {
    font-size: 14px;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.module-summary-card__item-value {
    font-size: 16px;
    color: var(--color-text-primary);
    line-height: 1.5;
}

.module-summary-card__warning {
    margin: -8px 0 0;
    font-size: 14px;
    color: var(--danger-text);
    background: var(--danger-surface);
    border-radius: 12px;
    padding: 12px 16px;
}

.module-summary-card__hardware {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    display: grid;
    gap: 12px;
    background: var(--color-surface-soft);
}

.module-summary-card__hardware-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.module-summary-card__hardware-empty {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.module-summary-card__hardware-core {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.5;
}

.module-summary-card__hardware-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.module-summary-card__hardware-list li {
    line-height: 1.4;
}

.module-summary-card__firmware {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--color-surface-soft);
}

.module-summary-card__firmware-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.module-summary-card__firmware-empty {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.module-summary-card__firmware-meta {
    display: grid;
    gap: 4px;
}

.module-summary-card__firmware-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.module-summary-card__firmware-size {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.module-summary-card__install {
    align-self: flex-start;
}

.module-summary-card__install:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.module-summary-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.module-summary-card__actions .btn {
    flex: 1 1 auto;
    min-width: 120px;
}

.wizard-summary__drawer .module-summary-card {
    box-shadow: none;
}

.wizard-summary__drawer .module-summary-card__actions {
    gap: 10px;
}

.wizard-summary__drawer .module-summary-card__actions .btn {
    flex: 1 1 45%;
}

@media (max-width: 480px) {
    .module-summary-card__actions {
        flex-direction: column;
    }

    .wizard-summary__drawer .module-summary-card__actions .btn {
        flex: 1 1 auto;
        width: 100%;
    }

    .module-card__spec {
        grid-template-columns: 1fr;
    }
}

.module-detail {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 24px;
    background: var(--color-surface);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.module-detail__header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.module-detail__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--color-text-primary);
}

.module-detail__summary {
    margin: 0;
    font-size: 16px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.module-detail__variants {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.module-variant-card {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px 20px;
    background: var(--color-surface-soft);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.module-variant-card.is-highlighted {
    border-color: color-mix(in srgb, var(--brand-green-contrast) 45%, var(--color-border));
    background: color-mix(in srgb, var(--brand-green-selection-surface) 45%, var(--color-surface-soft));
}

.module-variant-card.is-selected {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand-green-contrast) 50%, transparent);
}

.module-variant-card__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.module-variant-card__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.module-variant-card__meta {
    display: grid;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.module-variant-card__meta span {
    display: flex;
    gap: 8px;
}

.module-variant-card__meta strong {
    font-weight: 600;
    color: var(--color-text-primary);
    min-width: 108px;
}

.module-variant-card__meta-value {
    color: var(--color-text-primary);
    line-height: 1.5;
}

.module-variant-card__meta-value--muted {
    color: var(--color-text-tertiary);
}

.module-variant-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.module-variant-card__badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: var(--danger-surface);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
    white-space: nowrap;
}

.module-variant-card__badge.is-active {
    background: color-mix(in srgb, var(--danger) 35%, #fff);
    border-color: color-mix(in srgb, var(--danger) 65%, var(--danger-border));
}

.module-variant-card__accordion {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.module-variant-card__accordion:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.module-variant-card__accordion::after {
    content: '\25BC';
    font-size: 10px;
    transition: transform 0.2s ease;
}

.module-variant-card__accordion[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.module-variant-card__panel {
    border-top: 1px solid var(--color-border-subtle);
    padding-top: 12px;
    display: grid;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.module-variant-card__panel[hidden] {
    display: none;
}

.module-variant-card__panel-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 8px;
}

.module-requirements-panel__placeholder {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 16px;
    line-height: 1.5;
}

.module-hint-details {
    margin: 12px 0 0;
    padding-left: 1.2rem;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

.module-hint-details li + li {
    margin-top: 4px;
}

.preset-panel {
    margin-top: 32px;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface-muted);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preset-panel__header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preset-panel__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--color-text-primary);
}

.preset-panel__description {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

.preset-panel__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preset-panel__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
}

.preset-panel__item-name {
    font-weight: 600;
    color: var(--color-text-primary);
    flex: 1;
}

.preset-panel__actions {
    display: flex;
    gap: 8px;
}

.preset-panel__action-button {
    border: none;
    background: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.preset-panel__action-button:hover,
.preset-panel__action-button:focus-visible {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent-stronger, var(--accent));
}

.preset-panel__empty {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.preset-panel__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preset-panel__label {
    font-weight: 600;
    color: var(--color-text-primary);
}

.preset-panel__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.preset-panel__controls input[type="text"] {
    flex: 1 1 220px;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid var(--color-border-stronger);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text-primary);
}

.preset-panel__controls input[type="text"]:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
    outline-offset: 2px;
}

.preset-panel__hint {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.checkbox-card {
    display: block;
    cursor: pointer;
    position: relative;
}

.checkbox-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.checkbox-content {
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.checkbox-card:hover .checkbox-content {
    border-color: var(--brand-green);
    background: var(--color-surface);
}

.checkbox-card input[type="checkbox"]:checked + .checkbox-content {
    border-color: var(--brand-green-contrast);
    background: var(--brand-green-selection-surface);
}

.checkbox-title {
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.checkbox-description {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* Wizard Actions */
.wizard-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: var(--color-surface-muted);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-weight: 500;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-copy:hover:not(:disabled) {
    background: color-mix(in srgb, var(--color-text-primary) 8%, var(--color-surface-muted));
    border-color: color-mix(in srgb, var(--color-text-primary) 12%, var(--color-border));
}

.btn-copy:active:not(:disabled) {
    background: color-mix(in srgb, var(--color-text-primary) 12%, var(--color-surface-muted));
    border-color: color-mix(in srgb, var(--color-text-primary) 20%, var(--color-border));
}

.btn-copy:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.btn-copy.is-ready {
    background: color-mix(in srgb, var(--brand-green-contrast) 22%, var(--color-surface-muted));
    color: color-mix(in srgb, var(--brand-green-contrast) 90%, var(--color-text-primary));
    border-color: color-mix(in srgb, var(--brand-green-contrast) 55%, var(--color-border));
}

.btn-copy.is-ready:hover:not(:disabled) {
    background: color-mix(in srgb, var(--brand-green-contrast) 32%, var(--color-surface-muted));
    border-color: color-mix(in srgb, var(--brand-green-contrast) 65%, var(--color-border));
}

.btn-copy.is-ready:active:not(:disabled) {
    background: color-mix(in srgb, var(--brand-green-contrast) 40%, var(--color-surface-muted));
    border-color: color-mix(in srgb, var(--brand-green-contrast) 75%, var(--color-border));
}

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

.btn-primary {
    background: var(--brand-green-contrast);
    color: white;
}

.btn-primary.is-ready {
    background: var(--brand-green-contrast-hover);
    box-shadow: 0 0 0 0 rgba(var(--brand-green-contrast-rgb), 0.45);
    color: #fff;
}

.btn-primary.is-ready:hover:not(:disabled) {
    background: var(--brand-green-contrast-active);
}

.btn-primary.is-ready:focus-visible {
    outline: 3px solid rgba(var(--brand-green-contrast-rgb), 0.45);
    outline-offset: 2px;
}

.primary-action-group,
.firmware-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.primary-action-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ready-helper {
    font-size: 14px;
    color: var(--brand-green-contrast);
    margin: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    min-height: 1em;
    text-align: right;
}

.ready-helper.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ready-helper.is-warning {
    color: var(--danger);
}

@keyframes readyPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--brand-green-contrast-rgb), 0.45);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(var(--brand-green-contrast-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--brand-green-contrast-rgb), 0);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .btn-primary.is-ready {
        animation: readyPulse 2.4s ease-in-out infinite;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-primary.is-ready {
        animation: none;
        box-shadow: 0 0 0 4px rgba(var(--brand-green-contrast-rgb), 0.25);
    }
}

.app-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: color-mix(in srgb, var(--danger) 72%, black);
    color: var(--surface);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 2000;
    font-size: 14px;
    letter-spacing: 0.1px;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.btn-primary:hover:not(:disabled) {
    background: var(--brand-green-contrast-hover);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-surface-muted);
    border-color: var(--color-text-secondary);
}

.btn-tertiary {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    box-shadow: none;
    padding-inline: 1.25rem;
}

.btn-tertiary:hover {
    background: var(--color-surface-muted);
    color: var(--color-text-primary);
}

/* Configuration Summary */
.configuration-summary {
    background: var(--color-surface-muted);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 32px;
}

.configuration-summary h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--color-text-primary);
}

.hardware-detection {
    background: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.hardware-detection__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.hardware-detection__summary {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 12px;
}

.hardware-detection__body {
    display: flex;
    flex-direction: column;
}

.hardware-detection__list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--color-border-subtle);
    background: var(--color-surface-muted);
}

.hardware-detection__list li {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border-subtle);
    font-size: 14px;
    color: var(--color-text-secondary);
}

.hardware-detection__list li:last-child {
    border-bottom: none;
}

.hardware-detection__guidance {
    font-size: 14px;
    color: var(--color-text-tertiary);
}

.hardware-detection__guidance strong {
    color: var(--danger);
    font-weight: 600;
}

/* Pre-Flash Checklist */
.pre-flash-checklist {
    background: var(--brand-green-selection-surface);
    border: 1px solid var(--brand-green-selection-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(var(--brand-green-rgb), 0.12);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.pre-flash-checklist[data-diagnostics-state="running"] {
    border-color: color-mix(in srgb, var(--brand-green-contrast) 45%, var(--brand-green-selection-border));
    box-shadow: 0 3px 9px rgba(var(--brand-green-rgb), 0.16);
}

.pre-flash-checklist .checklist-header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pre-flash-checklist .checklist-header__text {
    flex: 1 1 240px;
    min-width: 200px;
}

.pre-flash-checklist .checklist-heading {
    margin-bottom: 6px;
    font-size: 18px;
    font-weight: 600;
    color: var(--brand-green-contrast);
}

.pre-flash-checklist .checklist-subtitle {
    font-size: 14px;
    color: var(--color-text-tertiary);
}

.pre-flash-checklist .checklist-refresh {
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    background: var(--brand-green-contrast);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.pre-flash-checklist .checklist-refresh:focus-visible,
.pre-flash-checklist .checklist-refresh:hover {
    background: var(--brand-green-contrast-hover);
}

.pre-flash-checklist .checklist-refresh[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.serial-detection-panel .serial-detection-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.serial-detection-panel .serial-detection-list[hidden] {
    display: none;
}

.serial-detection-panel .serial-detection-list li + li {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid color-mix(in srgb, var(--brand-green-selection-border) 65%, transparent);
}

.serial-detection-panel .serial-detection-guidance {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-tertiary);
}

.pre-flash-checklist .checklist-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.pre-flash-checklist .checklist-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border-subtle);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.pre-flash-checklist .status-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.pre-flash-checklist .status-icon::before {
    content: '\2022';
}

.pre-flash-checklist .item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pre-flash-checklist .item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.pre-flash-checklist .item-text {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

.pre-flash-checklist .item-tip {
    font-size: 13px;
    color: var(--brand-green-contrast-active);
    margin: 0;
}

.pre-flash-checklist .item-tip[hidden] {
    display: none;
}

.pre-flash-checklist .diagnostic-error {
    margin-top: 16px;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--danger) 18%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--color-border));
    color: color-mix(in srgb, var(--danger) 75%, #000);
}

.pre-flash-checklist .diagnostic-error[hidden] {
    display: none;
}

.pre-flash-checklist .checklist-item[data-status="pass"] {
    background: var(--brand-green-selection-surface-subtle);
    border-color: var(--brand-green-selection-border);
}

.pre-flash-checklist .checklist-item[data-status="pass"] .status-icon {
    background: var(--brand-green-contrast);
    border-color: var(--brand-green-contrast);
    color: #fff;
}

.pre-flash-checklist .checklist-item[data-status="pass"] .status-icon::before {
    content: '\2713';
}

.pre-flash-checklist .checklist-item[data-status="warn"] {
    background: color-mix(in srgb, var(--warning) 16%, var(--color-surface));
    border-color: color-mix(in srgb, var(--warning) 45%, var(--color-border));
}

.pre-flash-checklist .checklist-item[data-status="warn"] .status-icon {
    background: color-mix(in srgb, var(--warning) 55%, white);
    border-color: color-mix(in srgb, var(--warning) 65%, var(--color-border));
    color: color-mix(in srgb, var(--warning) 80%, black);
}

.pre-flash-checklist .checklist-item[data-status="warn"] .status-icon::before {
    content: '\26A0';
}

.pre-flash-checklist .checklist-item[data-status="warn"] .item-tip {
    color: color-mix(in srgb, var(--warning) 65%, black);
}

.pre-flash-checklist .checklist-item[data-status="fail"] {
    background: color-mix(in srgb, var(--danger) 18%, var(--color-surface));
    border-color: color-mix(in srgb, var(--danger) 45%, var(--color-border));
}

.pre-flash-checklist .checklist-item[data-status="fail"] .status-icon {
    background: color-mix(in srgb, var(--danger) 60%, white);
    border-color: color-mix(in srgb, var(--danger) 70%, var(--color-border));
    color: color-mix(in srgb, var(--danger) 90%, black);
}

.pre-flash-checklist .checklist-item[data-status="fail"] .status-icon::before {
    content: '\2715';
}

.pre-flash-checklist .checklist-item[data-status="fail"] .item-tip {
    color: color-mix(in srgb, var(--danger) 65%, black);
}

.pre-flash-checklist .checklist-item[data-status="info"] .status-icon,
.pre-flash-checklist .checklist-item[data-status="pending"] .status-icon {
    animation: pulseNeutral 1.6s ease-in-out infinite;
}

.pre-flash-checklist .checklist-item[data-status="pending"] .status-icon::before {
    content: '\2026';
    transform: translateY(-1px);
}

.pre-flash-checklist .checklist-item[data-status="info"] {
    background: color-mix(in srgb, var(--brand-green-selection-surface) 35%, var(--color-surface));
    border-color: color-mix(in srgb, var(--brand-green-selection-border) 50%, var(--color-border));
}

@keyframes pulseNeutral {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pre-flash-checklist .checklist-refresh,
    .pre-flash-checklist .checklist-item,
    .pre-flash-checklist .status-icon {
        transition: none;
        animation: none;
    }
}

.summary-grid {
    display: grid;
    gap: 16px;
}

.summary-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 500;
    color: var(--color-text-secondary);
}

.summary-value {
    color: var(--color-text-primary);
}

.summary-sensors {
    grid-column: 2;
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* Firmware Section */
.firmware-section {
    margin-bottom: 32px;
}

.firmware-section h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--color-text-primary);
}

.firmware-selector {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-muted);
}

.firmware-selector:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
}

.firmware-selector-label {
    font-weight: 600;
    color: var(--color-text-primary);
}

.firmware-selector-control {
    flex: 1 1 220px;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--color-border-stronger);
    border-radius: 6px;
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-size: 14px;
}

.firmware-selection-placeholder {
    padding: 16px;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-muted);
    color: var(--color-text-secondary);
    font-size: 14px;
}

.btn-small {
    padding: 10px 20px;
    font-size: 14px;
}

#compatible-firmware {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rescue-install {
    margin-top: 32px;
    padding: 24px;
    border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 6%, transparent 94%);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rescue-install__heading {
    margin: 0;
}

.rescue-install__intro {
    margin: 0;
    color: var(--color-text-tertiary);
    font-size: 14px;
}

.firmware-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.firmware-item {
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.firmware-card.is-selected .firmware-item,
.firmware-item:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.firmware-item:focus-within {
    outline: none;
}

.firmware-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

@media (min-width: 600px) {
    .firmware-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.firmware-actions esp-web-install-button {
    display: inline-flex;
}

.firmware-name {
    font-weight: 500;
    color: var(--color-text-primary);
}

.firmware-details {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--color-text-secondary);
    flex-wrap: wrap;
}

.firmware-description {
    font-size: 14px;
    color: var(--color-text-tertiary);
    margin: 12px 0 0;
}

.firmware-channel-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--chip-bg);
    color: var(--color-text-secondary);
}

.firmware-channel-tag.is-stable,
.firmware-channel-tag.is-general {
    background: color-mix(in srgb, var(--success) 18%, transparent);
    color: color-mix(in srgb, var(--success) 55%, var(--color-text-primary));
}

.firmware-channel-tag.is-preview {
    background: color-mix(in srgb, var(--warning) 22%, transparent);
    color: color-mix(in srgb, var(--warning) 55%, black);
}

.firmware-channel-tag.is-beta {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: color-mix(in srgb, var(--accent) 55%, var(--accent-contrast));
}

.firmware-channel-tag.is-rescue {
    background: color-mix(in srgb, var(--danger) 18%, transparent);
    color: color-mix(in srgb, var(--danger) 60%, white);
}

.firmware-channel-tag.is-dev {
    background: color-mix(in srgb, var(--danger) 18%, transparent);
    color: color-mix(in srgb, var(--danger) 60%, white);
}

/* Firmware not available styles */
.firmware-not-available,
.firmware-error {
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}

.firmware-not-available {
    background-color: var(--warning-surface);
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
}

.firmware-error {
    background-color: var(--danger-surface);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
}

.firmware-not-available h4,
.firmware-error h4 {
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 500;
}

.firmware-not-available h4 {
    color: var(--warning-strong);
}

.firmware-error h4 {
    color: var(--danger-strong);
}

.firmware-not-available p,
.firmware-error p {
    margin: 8px 0;
    font-size: 14px;
}

.firmware-not-available p {
    color: var(--warning-text);
}

.firmware-error p {
    color: var(--danger-text);
}

.config-string {
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    background-color: var(--color-surface);
    padding: 12px 16px;
    border-radius: 4px;
    display: inline-block;
    margin: 16px 0;
    border: 1px solid var(--color-border-strong);
}

.help-text {
    font-size: 14px;
    margin-top: 16px;
    color: var(--color-text-secondary);
}

.post-flash-guidance {
    margin-top: 24px;
    max-width: 640px;
}

.post-flash-guidance a {
    color: var(--brand-green-contrast);
    text-decoration: none;
}

.post-flash-guidance a:hover {
    color: var(--brand-green-contrast-hover);
    text-decoration: underline;
}

/* Release notes styles */
.firmware-info {
    flex: 1;
}

.release-notes-link {
    color: var(--brand-green-contrast);
    text-decoration: none;
    font-size: 14px;
    margin-left: 16px;
}

.release-notes-link:hover {
    color: var(--brand-green-contrast-hover);
    text-decoration: underline;
}

.release-notes-section {
    background-color: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 24px;
    margin-top: 16px;
}

.firmware-metadata {
    margin-top: 24px;
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .firmware-metadata {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

.firmware-meta-section {
    background-color: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.firmware-meta-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.firmware-meta-section ul {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.firmware-meta-section li {
    font-size: 14px;
    color: var(--color-text-tertiary);
    line-height: 1.5;
}

.release-notes-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-primary);
    max-height: 600px;
    overflow-y: auto;
}

.release-notes-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border-strong);
    padding-bottom: 8px;
}

.release-notes-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 12px 0;
    color: var(--color-text-primary);
}

.release-notes-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 8px 0;
    color: var(--color-text-primary);
}

.release-notes-content p {
    margin: 8px 0;
    line-height: 1.6;
}

.release-notes-content ul {
    margin: 8px 0;
    padding-left: 24px;
    list-style-type: disc;
}

.release-notes-content li {
    margin: 6px 0;
    line-height: 1.5;
}

.release-notes-content .loading {
    text-align: center;
    color: var(--color-text-secondary);
    padding: 20px;
}

.release-notes-content .no-notes,
.release-notes-content .error {
    text-align: center;
    color: var(--color-text-secondary);
    padding: 20px;
    font-style: italic;
}

/* Browser Warning */
.browser-warning {
    background: var(--warning-surface);
    border: 1px solid var(--warning-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    color: var(--warning-text);
}

.browser-warning h3 {
    color: var(--warning-strong);
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .wizard-container {
        padding: 24px;
    }

    .option-grid {
        grid-template-columns: 1fr;
    }

    .progress-bar {
        padding: 0 24px;
    }

    .step-label {
        font-size: 12px;
    }

    .summary-item {
        grid-template-columns: 1fr;
    }

    .wizard-actions {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
    }

    .primary-action-group,
    .firmware-actions {
        width: 100%;
        align-items: stretch;
    }

.primary-action-group .ready-helper,
.firmware-actions .ready-helper {
    text-align: center;
}
}

.firmware-parts {
    margin-top: 8px;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.firmware-parts-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.firmware-parts-toggle:hover,
.firmware-parts-toggle:focus-visible {
    background: color-mix(in srgb, var(--color-text-primary) 8%, var(--color-surface-muted));
    border-color: color-mix(in srgb, var(--color-text-primary) 12%, var(--color-border));
}

.firmware-parts-toggle:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.firmware-parts-toggle.is-expanded,
.firmware-parts-toggle[aria-expanded="true"] {
    background: color-mix(in srgb, var(--brand-green-contrast) 10%, var(--color-surface-muted));
    border-color: color-mix(in srgb, var(--brand-green-contrast) 35%, var(--color-border));
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.firmware-parts-toggle-icon {
    font-size: 16px;
    line-height: 1;
    width: 1.25em;
    text-align: center;
}

.firmware-parts-toggle-label {
    display: inline-block;
}

.firmware-parts-content[hidden] {
    display: none;
}

.firmware-parts-content:not([hidden]) {
    border-top: 1px solid var(--color-border);
    padding: 16px 0 0;
}

.firmware-parts h4 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.firmware-parts-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.firmware-part-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    font-size: 13px;
    color: var(--color-text-secondary);
    flex-wrap: wrap;
    row-gap: 4px;
}

.firmware-part-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
}

.firmware-part-code {
    font-family: 'Roboto Mono', 'Menlo', 'Consolas', monospace;
    overflow-wrap: anywhere;
    word-break: break-word;
    flex: 1 1 200px;
}

.firmware-part-name {
    font-weight: 500;
    color: var(--color-text-primary);
    word-break: break-all;
}

.firmware-part-offset {
    font-family: 'Roboto Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: var(--color-text-tertiary);
}

.firmware-parts[data-multi-part="true"] .firmware-parts-hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--color-text-tertiary);
}

.multi-part-modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(17, 24, 39, 0.55);
    z-index: 1100;
}

.multi-part-modal {
    background: var(--color-surface, #ffffff);
    color: var(--color-text-primary, #111827);
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.multi-part-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 16px;
    border-bottom: 1px solid var(--color-border, #d1d5db);
}

.multi-part-modal__header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.multi-part-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-tertiary, #6b7280);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.multi-part-modal__body {
    padding: 18px 22px;
    overflow-y: auto;
}

.multi-part-modal__intro {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.multi-part-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.multi-part-modal__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--color-surface-muted, #f3f4f6);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    padding: 12px 14px;
}

.multi-part-modal__item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.multi-part-modal__item-name {
    font-weight: 600;
    word-break: break-all;
}

.multi-part-modal__item-offset {
    font-size: 12px;
    color: var(--color-text-tertiary);
    font-family: 'Roboto Mono', 'Menlo', 'Consolas', monospace;
}

.multi-part-modal__item-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.multi-part-modal__item-actions a {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent, #2563eb);
    text-decoration: none;
}

.multi-part-modal__footer {
    padding: 16px 22px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid var(--color-border, #d1d5db);
}

.multi-part-modal-backdrop[hidden] {
    display: none;
}

.multi-part-modal__footer .btn {
    min-width: 140px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.option-tooltip-popover {
    position: absolute;
    z-index: 1000;
    max-width: min(320px, calc(100vw - 32px));
    background: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 12px, 0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.option-tooltip-popover::after {
    content: '';
    position: absolute;
    top: -8px;
    left: var(--tooltip-arrow-left, calc(50% - 8px));
    width: 16px;
    height: 16px;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    border-top: 1px solid var(--color-border);
    transform: rotate(45deg);
    box-shadow: -2px -2px 6px rgba(15, 23, 42, 0.08);
}

.option-tooltip-popover[data-visible="true"] {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
}

.option-tooltip__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.option-tooltip__summary {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.option-tooltip__section {
    text-align: left;
    margin-bottom: 12px;
}

.option-tooltip__section:last-of-type {
    margin-bottom: 0;
}

.option-tooltip__section-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    margin-bottom: 6px;
}

.option-tooltip__list,
.option-tooltip__measurements {
    margin-left: 18px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.option-tooltip__list li,
.option-tooltip__measurements li {
    margin-bottom: 6px;
}

.option-tooltip__list li:last-child,
.option-tooltip__measurements li:last-child {
    margin-bottom: 0;
}

.option-tooltip__footer {
    margin-top: 12px;
    text-align: left;
}

.option-tooltip__learn-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--brand-green-contrast);
    text-decoration: none;
}

.option-tooltip__learn-more:hover,
.option-tooltip__learn-more:focus-visible {
    text-decoration: underline;
}

.option-tooltip--above {
    transform: translate3d(0, -12px, 0);
}

.option-tooltip--above::after {
    top: auto;
    bottom: -8px;
    transform: rotate(225deg);
}
.option-tooltip--above::after {
    border-left: none;
    border-top: none;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
