.product-spec-editor { width: min(1360px, 96vw); max-height: 94vh; }
.product-spec-editor .product-spec-fields { display: block; border: 0; padding: 0; margin: 0; min-width: 0; }
.product-spec-editor .product-description textarea { min-height: 140px; }
.product-spec-editor .product-spec-mode { display: flex; align-items: center; gap: 20px; margin: 24px 0; }
.product-spec-editor .product-spec-mode label { display: inline-flex; align-items: center; gap: 7px; }
.product-spec-editor .product-spec-mode input { width: auto; min-height: auto; }
.product-spec-table-wrap { overflow-x: auto; width: 100%; }
.product-spec-editor table.product-spec-table, .product-spec-detail table.product-spec-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
.product-spec-table th, .product-spec-table td { padding: 12px 9px; text-align: left; border-bottom: 1px solid #edf1f5; overflow-wrap: anywhere; }
.product-spec-table th { background: #f6faff; color: #334d5c; font-size: 12px; }
.product-spec-table th:first-child { width: 90px; }
.product-spec-editor .product-spec-table input:not([type=file]) { box-sizing: border-box; width: 100%; min-width: 0; height: 34px; border: 1px solid #d5e1ed; border-radius: 3px; padding: 5px 8px; }
.product-spec-editor .product-spec-image-upload { position: relative; display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; background: #f5f7fa; border: 1px dashed #c6d7e2; color: #6c8596; cursor: pointer; }
.product-spec-editor .product-spec-image-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.product-spec-image-upload img, .product-spec-thumbnail img { width: 52px; height: 52px; object-fit: cover; }
.product-spec-editor .product-spec-image-upload span { font-size: 11px; white-space: nowrap; }
.product-spec-editor .product-spec-mode button, .product-spec-table td > button { border: 1px solid #d5e1ed; background: white; color: #168cf2; border-radius: 3px; padding: 5px 10px; cursor: pointer; }
.product-spec-editor .product-spec-table input { font: inherit; }
.product-spec-editor .product-spec-remove-image { display: block; margin: 5px 0; font-size: 11px; border: 0; color: #e45a5a; background: none; }
.product-spec-hint { display: block; color: #8a9aa5; margin: 14px 0; }
.product-catalog-error { color: #d73838; background: #fff1f0; padding: 10px; white-space: pre-wrap; }
.product-legacy-notice { color: #946928; background: #fff8e8; padding: 10px; font-size: 12px; }
.product-legacy-notice button { color: #168cf2; background: none; border: 0; cursor: pointer; }
.inventory-detail-drawer.product-spec-detail { width: min(1000px, 96vw); overflow: hidden; }
.product-spec-detail > section { min-width: 0; overflow: auto; }
.product-spec-information { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 24px 0; }
.product-spec-information p { display: flex; margin: 0; padding: 8px 0; gap: 12px; overflow-wrap: anywhere; min-width: 0; }
.product-spec-information p > span:first-child { flex-shrink: 0; color: #8192a0; }
.product-spec-information .wide { grid-column: 1/-1; }
.product-spec-description { white-space: pre-wrap; }
.product-spec-thumbnail { border: 0; background: #f5f7fa; padding: 0; cursor: zoom-in; }
.product-spec-no-image { display: flex; align-items: center; justify-content: center; width: 60px; height: 54px; background: #f7f8fa; color: #acb5be; font-size: 10px; }
.product-spec-preview { position: fixed; inset: 0; z-index: 4000; background: #132431cc; display: flex; align-items: center; justify-content: center; }
.product-spec-preview img { max-width: 90vw; max-height: 88vh; object-fit: contain; }
.product-spec-preview button { position: absolute; top: 20px; right: 30px; border: 0; color: white; background: transparent; font-size: 30px; cursor: pointer; }
@media(max-width: 800px) { .product-spec-information { grid-template-columns: 1fr; } .product-spec-editor table.product-spec-table { min-width: 680px; } }

/* Category persistence and explicit legacy-data review. */
.category-editor form > fieldset { display: block; border: 0; padding: 0; margin: 0; min-width: 0; }
.category-editor form > fieldset > div { display: grid; gap: 16px; padding: 18px 28px 24px; }
.category-editor form > fieldset > div > label { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; }
.catalog-legacy-review { margin: 12px 20px; padding: 10px 14px; background: #fff8e6; border: 1px solid #f4d99a; border-radius: 8px; display: flex; align-items: center; gap: 12px; }
.catalog-migration-dialog { background: white; width: min(920px, 94vw); max-height: 85vh; padding: 20px; border-radius: 12px; display: flex; flex-direction: column; color: #123; }
.catalog-migration-dialog header, .catalog-migration-dialog footer { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.catalog-migration-dialog main { overflow: auto; min-height: 0; margin: 12px 0; }
.catalog-migration-dialog table { width: 100%; border-collapse: collapse; }
.catalog-migration-dialog th, .catalog-migration-dialog td { padding: 10px; text-align: left; border-bottom: 1px solid #e3eaf3; }
.catalog-migration-dialog button, .catalog-legacy-review button { padding: 6px 12px; border: 1px solid #d7e3ef; border-radius: 4px; background: #fff; color: #1677d2; cursor: pointer; }
.catalog-migration-dialog button:disabled { opacity: .5; cursor: default; }

.catalog-migration-dialog th, .catalog-migration-dialog td { white-space: normal; overflow-wrap: anywhere; overflow: visible; }
.catalog-migration-dialog th:last-child { width: 180px; }

.category-editor form > fieldset > div > label::before { display: none; content: none; }

/* Keep history details visible without the generic inventory table minimum width. */
.catalog-legacy-review { flex-wrap: wrap; }
.catalog-legacy-reviewed { background: transparent; border-color: transparent; color: #64748b; }
.catalog-migration-dialog { box-sizing: border-box; width: min(1040px, 96vw); }
.catalog-migration-dialog main table { table-layout: fixed; width: 100%; min-width: 0; }
.catalog-migration-dialog main th, .catalog-migration-dialog main td { min-width: 0; width: auto; white-space: normal; overflow-wrap: anywhere; }
.catalog-migration-dialog main th:first-child { width: 56px; }
.catalog-migration-dialog footer { flex-wrap: wrap; justify-content: flex-end; }
.catalog-ignore-confirm { padding: 12px; background: #fff8e6; }
@media (max-width: 600px) { .catalog-migration-dialog { padding: 12px; } .catalog-migration-dialog main th, .catalog-migration-dialog main td { padding: 6px 3px; font-size: 12px; } }
