/* Spreadsheet / Excel-style product grid */

.sheet-app {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: auto;
}

.sheet-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 8px 0 12px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sheet-toolbar-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.sheet-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sheet-toolbar-actions .btn {
    font-weight: 500;
}

.sheet-toolbar-actions .btn-primary:not(:disabled):not([disabled]) {
    min-width: 5.5rem;
}

.sheet-search {
    width: min(240px, 100%);
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.sheet-meta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 13px;
    color: var(--muted);
    min-width: 0;
    overflow: hidden;
}

.sheet-meta-count {
    flex-shrink: 0;
    font-weight: 500;
    color: var(--text);
}

.sheet-meta-sep {
    flex-shrink: 0;
    color: var(--muted-light);
}

.sheet-meta-file {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}

.sheet-warnings {
    font-size: 13px;
    color: var(--warn);
    background: var(--warn-bg);
    border: 1px solid rgba(217, 115, 13, 0.2);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin: 8px 0;
    flex-shrink: 0;
}

.sheet-warnings summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.sheet-warnings summary::-webkit-details-marker { display: none; }

.sheet-warnings ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.sheet-warnings li { margin: 0.15rem 0; }

.sheet-status {
    font-size: 11px;
    margin-bottom: 0.25rem;
    min-height: 1rem;
    color: var(--muted);
    flex-shrink: 0;
}

.sheet-status.is-success { color: var(--success); }
.sheet-status.is-error { color: var(--danger); font-weight: 600; }

.sheet-scroller {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    margin-top: 8px;
}

.sheet-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 15px;
    min-width: max-content;
    --w-num: 40px;
    --w-act: 92px;
    --w-sku: 112px;
    --w-name: 200px;
    --left-sku: calc(var(--w-num) + var(--w-act));
    --left-name: calc(var(--left-sku) + var(--w-sku));
}

.sheet-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-strong);
    border-right: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: bottom;
    min-width: 110px;
    max-width: 220px;
}

.sheet-table thead th.col-row {
    left: 0;
    z-index: 9;
    min-width: var(--w-num);
    max-width: var(--w-num);
    text-align: center;
}

.sheet-table thead th.col-actions {
    left: var(--w-num);
    z-index: 9;
    min-width: var(--w-act);
    max-width: var(--w-act);
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    vertical-align: middle;
}

.sheet-table thead th.col-sticky-sku {
    left: var(--left-sku);
    z-index: 8;
    min-width: var(--w-sku);
}

.sheet-table thead th.col-sticky-name {
    left: var(--left-name);
    z-index: 8;
    min-width: var(--w-name);
}

.col-key {
    display: none;
}

.col-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    line-height: 1.3;
}

.sheet-table tbody td {
    border-bottom: 1px solid #e8ece8;
    border-right: 1px solid #eef2ee;
    padding: 0;
    vertical-align: top;
    background: #fff;
}

.sheet-table tbody tr:nth-child(even) td {
    background: rgba(55, 53, 47, 0.02);
}

.sheet-table tbody tr.is-dirty td {
    background: var(--warn-bg);
}

.sheet-table tbody tr.is-new td {
    background: rgba(15, 123, 108, 0.06);
}

.sheet-table tbody tr:hover td {
    background: var(--primary-soft);
}

.sheet-table tbody tr:hover td.col-actions {
    background: #e4efe4;
}

/* Colonna azioni fissa a SINISTRA (sempre visibile, espande al hover) */
.sheet-table thead th.col-actions,
.sheet-table tbody td.col-actions {
    position: sticky;
    left: var(--w-num);
    z-index: 5;
    width: var(--w-act);
    min-width: var(--w-act);
    max-width: var(--w-act);
    padding: 0;
    border-right: 1px solid var(--border-strong);
    background: var(--bg-subtle);
    box-shadow: 1px 0 0 var(--border);
}

.sheet-table tbody td.col-actions {
    vertical-align: middle;
    padding: 0.3rem 0.4rem;
}

.row-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0 0.1rem;
    opacity: 1;
    pointer-events: auto;
}

.row-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s;
}

.row-action-btn:hover {
    background: var(--primary-soft);
}

.row-action-variants {
    background: #f8fcf8;
}

.sheet-row.is-dirty td.col-actions {
    background: #fff3c4;
}

.sheet-row.is-new td.col-actions {
    background: #dcedc8;
}

.sheet-row.is-editing td {
    background: #eef6ee !important;
}

.sheet-row.is-editing td.col-actions {
    background: #e0ede0 !important;
}

.sheet-table tbody td.col-row {
    position: sticky;
    left: 0;
    z-index: 4;
    min-width: var(--w-num);
    max-width: var(--w-num);
    background: var(--bg-subtle);
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 0.3rem 0.35rem;
    border-right: 1px solid var(--border);
}

.sheet-table tbody td.col-actions {
    z-index: 6;
}

.sheet-table tbody td.col-sticky-sku {
    position: sticky;
    left: var(--left-sku);
    z-index: 3;
    min-width: var(--w-sku);
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
}

.sheet-table tbody td.col-sticky-name {
    position: sticky;
    left: var(--left-name);
    z-index: 3;
    min-width: var(--w-name);
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
}

.cell-input {
    width: 100%;
    min-width: 80px;
    border: none;
    background: transparent;
    padding: 8px 10px;
    font: inherit;
    font-size: 15px;
    line-height: 1.4;
}

.cell-input:focus {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    background: #fff;
}

.cell-sku {
    font-family: ui-monospace, Consolas, monospace;
    font-weight: 500;
    color: var(--text);
}

.col-long .cell-input {
    min-width: 140px;
}

.cell-editor-dialog {
    width: min(760px, calc(100vw - 2rem));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    font-size: 16px;
}

.cell-editor-dialog::backdrop {
    background: rgba(0,0,0,0.35);
}

.cell-editor-form header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.cell-editor-form footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.cell-editor-help {
    margin: 0;
    padding: 0.75rem 1.25rem 0;
    font-size: 0.85rem;
    color: var(--muted);
}

#cell-editor-input {
    width: calc(100% - 2.5rem);
    margin: 0.75rem 1.25rem;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
}

/* Dialog modifica riga — stessa dimensione su tutte le tab */
.row-editor-dialog {
    width: min(1280px, calc(100vw - 48px));
    height: min(90vh, 920px);
    max-height: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.45;
}

.row-editor-dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.row-editor-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.row-editor-form header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.row-editor-header {
    flex-wrap: nowrap;
    align-items: center;
}

.row-editor-header-main {
    flex: 1;
    min-width: 0;
}

.row-editor-header-main strong {
    display: block;
    font-size: 1.05rem;
    font-family: ui-monospace, Consolas, monospace;
}

.row-editor-progress-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.row-editor-progress-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 2.5rem;
    text-align: right;
}

.row-editor-progress-bar {
    width: 88px;
    height: 6px;
    background: #e0ebe0;
    border-radius: 99px;
    overflow: hidden;
}

.row-editor-progress-fill {
    height: 100%;
    width: 0;
    background: var(--primary);
    border-radius: 99px;
    transition: width 0.2s ease;
}

.row-editor-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

.row-editor-sidebar {
    display: flex;
    flex-direction: column;
    width: 188px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: var(--bg-subtle);
    overflow-y: auto;
    padding: 0.4rem 0;
}

.row-editor-side-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: none;
    border-left: none;
    border-radius: 0;
    background: transparent;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--muted);
    cursor: pointer;
    line-height: 1.25;
}

.row-editor-side-btn .side-icon {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
    width: 1.25rem;
    text-align: center;
}

.row-editor-side-btn .side-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-editor-side-btn .side-pct {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.85;
}

.row-editor-side-btn.is-complete .side-pct {
    color: var(--success);
}

.row-editor-side-btn:hover {
    color: var(--text);
    background: var(--primary-soft);
}

.row-editor-side-btn.is-active {
    color: var(--text);
    font-weight: 500;
    background: var(--surface);
}

.row-editor-panels {
    flex: 1;
    min-width: 0;
    min-height: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.row-editor-panel {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.row-editor-panel.is-active {
    display: flex;
    flex-direction: column;
}

.row-editor-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.panel-heading {
    margin: 0 0 1rem;
    padding: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text, #1a2e1a);
    border: none;
}

.row-editor-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.15rem 1.15rem;
}

#row-editor-panel-variants {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 1rem 1.15rem 1.15rem;
}

#row-editor-panel-variants #variant-editor-root {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#row-editor-panel-variants .variant-editor {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#row-editor-panel-variants .panel-heading {
    flex-shrink: 0;
    margin-bottom: 0.75rem;
}

.row-editor-section {
    margin-bottom: 1.25rem;
}

.row-editor-section h3 {
    margin: 0 0 0.6rem;
    font-size: 0.9rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.row-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
}

.row-editor-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.row-editor-field.is-wide {
    grid-column: 1 / -1;
}

.row-editor-field label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text, #1a2e1a);
}

.row-editor-field .field-key,
.row-editor-field .field-help {
    display: none;
}

.row-editor-field input,
.row-editor-field select,
.row-editor-field textarea {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.row-editor-field textarea {
    min-height: 110px;
    font-family: ui-monospace, Consolas, monospace;
    resize: vertical;
}

.row-editor-field input:read-only {
    background: #f4f4f4;
    color: var(--muted);
}

.row-editor-form footer,
.row-editor-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.btn-row-foot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn-row-foot:hover {
    background: var(--bg-subtle);
}

.btn-row-foot.btn-row-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 1px 2px rgba(45, 106, 79, 0.18);
}

.btn-row-foot.btn-row-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-row-foot.btn-row-muted {
    color: var(--muted);
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.btn-row-foot.btn-row-muted:hover {
    background: var(--primary-soft);
    color: var(--text);
    border-color: transparent;
}

.images-url-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.images-url-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
}

.images-url-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    min-width: 1.75rem;
    text-align: right;
}

.images-url-input {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: ui-monospace, Consolas, monospace;
}

.images-url-remove {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
}

.images-url-remove:hover {
    color: var(--danger, #c62828);
    background: #ffebee;
}

.images-url-add {
    align-self: flex-start;
    margin-top: 0.35rem;
}

.images-url-hint {
    margin: 0.5rem 0 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
}

.images-url-hint a {
    color: var(--text);
    font-weight: 500;
}

.images-url-hint code {
    font-size: 11px;
}

/* Editor varianti dedicato */
.variant-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.variant-editor-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.9rem;
}

.variant-meta-label {
    font-weight: 600;
    color: var(--muted);
}

.variant-editor-meta code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.95rem;
    color: var(--primary);
    background: #f0f5f0;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    width: fit-content;
}

.variant-meta-note {
    font-size: 0.85rem;
    color: var(--muted);
}

.variant-editor-attr {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.variant-editor-attr input,
.variant-editor-attr select {
    min-width: 220px;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}

.variant-editor-attr .ve-attr-custom {
    margin-top: 0.35rem;
}

.variant-editor-toolbar-actions {
    display: flex;
    gap: 0.35rem;
    margin-left: auto;
}

.variant-editor-hint {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0 0 0.85rem;
    line-height: 1.5;
}

.variant-editor-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    flex: 1;
    min-height: 0;
}

.variant-editor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

.variant-editor-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-subtle);
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.variant-editor-table td {
    padding: 4px 5px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.variant-editor-table tr:nth-child(even) td {
    background: rgba(55, 53, 47, 0.02);
}

.variant-editor-table .table-input {
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
}

.variant-editor-table .table-input.mono {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12px;
}

/* Larghezze colonne varianti (13 colonne) */
.variant-editor-table th:nth-child(1),
.variant-editor-table td:nth-child(1) { width: 28px; }

.variant-editor-table th:nth-child(2),
.variant-editor-table td:nth-child(2) { width: 7%; }

.variant-editor-table th:nth-child(3),
.variant-editor-table td:nth-child(3) { width: 6%; }

.variant-editor-table th:nth-child(4),
.variant-editor-table td:nth-child(4) { width: 9%; }

.variant-editor-table th:nth-child(5),
.variant-editor-table td:nth-child(5) { width: 8%; }

.variant-editor-table th:nth-child(6),
.variant-editor-table td:nth-child(6) { width: 16%; }

.variant-editor-table th:nth-child(7),
.variant-editor-table td:nth-child(7) { width: 11%; }

.variant-editor-table th:nth-child(8),
.variant-editor-table td:nth-child(8) { width: 11%; }

.variant-editor-table th:nth-child(9),
.variant-editor-table td:nth-child(9) { width: 6%; }

.variant-editor-table th:nth-child(10),
.variant-editor-table td:nth-child(10) { width: 5%; }

.variant-editor-table th:nth-child(11),
.variant-editor-table td:nth-child(11) { width: 5%; }

.variant-editor-table th:nth-child(12),
.variant-editor-table td:nth-child(12) { width: 5%; }

.variant-editor-table th:nth-child(13),
.variant-editor-table td:nth-child(13) { width: 28px; }

.variant-editor-table .ve-num {
    text-align: center;
    color: var(--muted);
    width: 28px;
}

.variant-editor-table .ve-unit {
    font-size: 0.9rem;
    white-space: nowrap;
    padding: 0 0.5rem;
}

.btn-icon-sm {
    border: none;
    background: transparent;
    color: var(--danger, #c62828);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    line-height: 1;
}

.btn-icon-sm:hover {
    background: #ffebee;
    border-radius: 4px;
}

.variant-editor-raw {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.variant-editor-raw summary {
    cursor: pointer;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.variant-editor-raw label {
    display: block;
    margin-bottom: 0.5rem;
}

.variant-editor-raw textarea {
    width: 100%;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    margin-top: 0.25rem;
}

.btn-icon {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}

body.sheet-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

body.sheet-page .site-header {
    flex-shrink: 0;
}

body.sheet-page main.main-sheet {
    flex: 1;
    width: calc(100% - 2rem);
    max-width: none;
    margin: 0 auto;
    padding: 12px 0 8px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.sheet-page .sheet-app {
    flex: 1;
    min-height: 0;
}

body.sheet-page .alert {
    flex-shrink: 0;
    margin-bottom: 0.35rem;
}

@media (max-width: 720px) {
    .row-editor-grid {
        grid-template-columns: 1fr;
    }

    .row-editor-dialog {
        width: calc(100vw - 16px);
        height: min(92vh, 900px);
    }

    .row-editor-sidebar {
        width: 52px;
    }

    .row-editor-side-btn {
        justify-content: center;
        padding: 0.55rem 0.3rem;
    }

    .row-editor-side-btn .side-label,
    .row-editor-side-btn .side-pct {
        display: none;
    }

    body.sheet-page main.container-wide {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    body.sheet-page {
        overflow: auto;
    }
}

/* Dialog export CSV */
.export-dialog {
    width: min(720px, calc(100vw - 32px));
    max-height: min(88vh, 820px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.export-dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.export-dialog-form {
    display: flex;
    flex-direction: column;
    max-height: min(88vh, 820px);
}

.export-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.export-dialog-header strong {
    display: block;
    font-size: 1.05rem;
}

.export-dialog-subtitle {
    margin: 0.2rem 0 0;
    font-size: 13px;
    color: var(--muted);
}

.export-dirty-count {
    color: var(--accent);
    font-weight: 600;
}

.export-dialog-mode {
    display: grid;
    gap: 0.5rem;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
    flex-shrink: 0;
}

.export-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    cursor: pointer;
}

.export-mode-option:has(input:checked) {
    border-color: rgba(45, 106, 79, 0.35);
    box-shadow: 0 0 0 1px rgba(45, 106, 79, 0.12);
}

.export-mode-option input {
    margin-top: 0.2rem;
    accent-color: var(--accent);
}

.export-mode-option strong {
    display: block;
    font-size: 14px;
}

.export-mode-option small {
    display: block;
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.export-mode-option:has(input:disabled) {
    opacity: 0.55;
    cursor: not-allowed;
}

.export-dialog-body {
    padding: 14px 18px;
    flex-shrink: 0;
}

.export-dialog-body-scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.export-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
