/* SyncStructure create/edit dialog. */
.ui-dialog.app-wide-dialog { width: min(1180px, calc(100vw - 32px)) !important; max-width: calc(100vw - 32px); }
.ui-dialog.app-wide-dialog:has(.sync-structure-form) { height: auto !important; max-height: calc(100vh - 32px); }
.ui-dialog.app-wide-dialog:has(.sync-structure-form) .ui-dialog-content { height: auto !important; max-height: none; }
.ui-dialog.app-wide-dialog:has(.sync-structure-form) .ui-dialog-content:has(> .sync-structure-form) { display: block; min-height: auto; overflow: hidden; }
.ui-dialog.app-wide-dialog .ui-dialog-content { max-height: none; overflow: hidden; padding: 0 20px; }
.sync-structure-form { padding-top: 2px; }
.sync-structure-form > .app-dialog-body { max-height: none; overflow: visible; padding-top: 12px; scrollbar-gutter: stable; }
.sync-structure-card { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.sync-structure-dialog-layout { display: grid; grid-template-columns: minmax(330px, .82fr) minmax(0, 1.68fr); gap: 18px; align-items: start; }
.sync-structure-panel { min-width: 0; }
.sync-structure-settings-panel, .sync-structure-mapping-panel { padding: 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .035); }
.sync-structure-settings-panel { background: linear-gradient(180deg, #fbfdff 0%, #fff 62%); }
.sync-structure-section-heading { display: flex; width: 100%; box-sizing: border-box; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 10px; padding: 0 0 9px; border-bottom: 1px solid #e7edf5; }
.sync-structure-heading-main { display: flex; min-width: 0; align-items: center; gap: 10px; }
.sync-structure-heading-icon { display: inline-grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border: 1px solid #dbe7ff; border-radius: 10px; background: linear-gradient(145deg, #eef5ff 0%, #f7faff 100%); color: var(--color-primary-600); }
.sync-structure-heading-icon .app-icon { width: 16px; height: 16px; stroke-width: 1.8; }
.sync-structure-heading-copy { min-width: 0; }
.sync-structure-heading-active { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; min-height: 32px; padding: 4px 7px 4px 10px; border: 1px solid #dbe4ef; border-radius: 999px; background: #fbfdff; color: var(--color-gray-700); font-size: 11px; font-weight: 650; }
.sync-structure-heading-active .catalog-switch { margin: 0; }
.sync-structure-heading-active .catalog-switch-track { width: 36px; height: 20px; }
.sync-structure-heading-active .catalog-switch-track::after { top: 2px; left: 2px; width: 16px; height: 16px; }
.sync-structure-heading-active .catalog-switch input:checked + .catalog-switch-track::after { transform: translateX(16px); }
.sync-structure-status-label { white-space: nowrap; }
.sync-structure-section-heading h2 { margin: 0 0 2px; color: var(--color-gray-900); font-size: 15px; line-height: 21px; letter-spacing: -.01em; }
.sync-structure-section-heading p { margin: 0; color: var(--color-gray-500); font-size: 11px; line-height: 17px; overflow-wrap: anywhere; }
.sync-structure-segment-count { display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: #f1f5f9; color: var(--color-gray-600); font-size: 11px; font-weight: 650; white-space: nowrap; }
.sync-structure-info-grid { grid-template-columns: minmax(0, 1fr) 100px; gap: 10px 12px; }
.sync-structure-info-grid .app-field { margin: 0; }
.sync-structure-info-grid .app-field > label { margin-bottom: 6px; font-size: 12px; }
.sync-structure-name-field { grid-column: 1; grid-row: 1; }
.sync-structure-description-field { grid-column: 1 / -1; grid-row: 2; }
.sync-structure-type-grid { display: grid; grid-column: 1 / -1; grid-row: 3; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; min-width: 0; }
.sync-structure-priority-field { grid-column: 2; grid-row: 1; width: 100px; max-width: 100%; }
.sync-structure-template-heading { margin-top: 14px; }
.sync-structure-template-field { margin-bottom: 0 !important; }
.sync-structure-template-field textarea { min-height: 48px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; }
.sync-structure-template-label-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.sync-structure-template-label-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.sync-structure-template-label-copy label { margin: 0; }
.sync-structure-description-field textarea { min-height: 72px; resize: vertical; }
.sync-structure-parse-button { min-height: 28px; padding: 4px 9px; font-size: 11px; }
.sync-structure-parse-button .app-icon { width: 12px; height: 12px; }
.sync-structure-template-feedback { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; line-height: 15px; }
.sync-structure-template-feedback .app-icon { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; }
.sync-structure-template-feedback > div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.sync-structure-template-feedback strong, .sync-structure-template-feedback-message { display: block; }
.sync-structure-template-feedback strong { font-size: 11px; line-height: 15px; }
.sync-structure-template-feedback-message { font-size: 11px; line-height: 16px; }
.sync-structure-mapping-heading { margin-top: 0; }
.sync-structure-table-wrap { border-radius: 9px; box-shadow: none; }
.sync-structure-table-wrap .app-table { width: 100%; min-width: 0; table-layout: fixed; }
.sync-structure-table-wrap th, .sync-structure-table-wrap td { padding: 5px 8px; font-size: 12px; }
.sync-structure-table-wrap th:nth-child(1) { width: 25%; }
.sync-structure-table-wrap th:nth-child(2) { width: 25%; }
.sync-structure-table-wrap th:nth-child(3), .sync-structure-table-wrap th:nth-child(4) { width: 25%; }
.sync-structure-table-wrap select, .sync-structure-table-wrap input { box-sizing: border-box; width: 100%; min-width: 0; height: 30px; }
.sync-structure-segment-value { color: var(--color-gray-800); font-weight: 600; overflow-wrap: anywhere; }
.sync-structure-table-wrap td:first-child { overflow-wrap: anywhere; }
.sync-structure-empty-row td { padding: 42px 16px; text-align: center; color: var(--color-gray-500); }
.sync-structure-empty-row strong, .sync-structure-empty-row small { display: block; }
.sync-structure-empty-row strong { margin-top: 5px; color: var(--color-gray-700); font-size: 13px; }
.sync-structure-empty-row small { margin-top: 3px; font-size: 11px; }
.sync-structure-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--color-primary-50); color: var(--color-primary-600); font-size: 18px; }
.sync-structure-form-actions { align-items: center; flex: 0 0 auto; margin: 0; padding: 12px 0 14px; border-top: 1px solid var(--color-gray-200); }
.sync-structure-actions-hint { margin-right: auto; color: var(--color-gray-500); font-size: 11px; }
.ui-dialog.app-wide-dialog:has(.sync-structure-form) .sync-structure-form-actions { flex: 0 0 auto; margin-top: 0 !important; padding: 12px 0 14px; }
@media (max-width: 900px) { .ui-dialog.app-wide-dialog:has(.sync-structure-form) .ui-dialog-content { max-height: calc(100vh - 90px); } .sync-structure-form > .app-dialog-body { max-height: calc(100vh - 175px); overflow: auto; } .sync-structure-dialog-layout { grid-template-columns: 1fr; } .sync-structure-settings-panel, .sync-structure-mapping-panel { padding: 14px; } }
@media (max-width: 560px) {
    .ui-dialog.app-wide-dialog .ui-dialog-content { padding-inline: 12px; }
    .sync-structure-template-label-row { align-items: flex-start; }
    .sync-structure-template-note { font-size: 9.5px; }
    .sync-structure-section-heading { align-items: flex-start; gap: 10px; }
    .sync-structure-heading-icon { flex-basis: 30px; width: 30px; height: 30px; border-radius: 9px; }
    .sync-structure-heading-active { gap: 6px; min-height: 30px; padding: 3px 6px 3px 8px; }
    .sync-structure-heading-copy p { font-size: 10.5px; }
    .sync-structure-segment-count { padding-inline: 7px; font-size: 10px; }
    .sync-structure-info-grid { grid-template-columns: 1fr; }
    .sync-structure-name-field, .sync-structure-description-field, .sync-structure-type-grid, .sync-structure-priority-field { grid-column: 1; grid-row: auto; }
    .sync-structure-type-grid { grid-template-columns: 1fr; }
    .sync-structure-form-actions { margin-inline: 0; padding-inline: 0; }
}
