#gtinImportPanel { display:grid; gap:20px; padding-top:18px; }
#gtinImportPanel[hidden] { display:none; }
#gtinImportPanel .card { padding:24px; overflow:hidden; }
#gtinImportPanel h2 { font-size:21px; line-height:1.35; margin:0 0 12px; }
#gtinImportPanel h3 { margin:0 0 14px; }
#gtinImportPanel p { line-height:1.55; margin:12px 0; }
#gtinImportPanel button { font:inherit; font-size:13px; font-weight:600; border:1px solid #dce3ed; border-radius:9px; padding:9px 13px; background:#fff; color:#334155; cursor:pointer; }
#gtinImportPanel button:hover { background:#f1f5f9; border-color:#94a3b8; }
#gtinImportPanel button:focus-visible, #gtinImportPanel input:focus-visible, #gtinImportPanel select:focus-visible { outline:2px solid #f97316; outline-offset:2px; }
#gtinImportPanel button:disabled { opacity:.5; cursor:wait; }
#gtinImportPanel button[data-generate], #gtinImportPanel button[data-confirm], #gtinImportPanel button[type=submit] { background:#f97316; border-color:#f97316; color:white; }
#gtinImportPanel button[aria-pressed=true] { color:#c2410c; border-color:#fdba74; background:#fff7ed; }
#gtinImportPanel input:not([type=checkbox]), #gtinImportPanel select { font:inherit; font-size:14px; color:#0f172a; border:1px solid #cbd5e1; border-radius:8px; padding:9px 11px; background:#fff; max-width:100%; box-sizing:border-box; }
#gtinImportPanel input:disabled { background:#f1f5f9; }
#gtinImportPanel input[type=file] { border:0; padding:0; width:230px; }
#gtinImportPanel input[type=file]::file-selector-button { display:none; }
#gtinImportPanel input[type=checkbox] { accent-color:#f97316; margin-right:7px; }
#gtinImportPanel [data-field] { display:block; margin:6px 0; }
#gtinImportPanel td { vertical-align:top; }
#gtinImportPanel td button { font-size:12px; padding:7px 9px; margin:2px 0; }
#gtinImportPanel td:last-child { min-width:112px; }
#gtinImportPanel th, #gtinImportPanel td { padding:14px 11px; }
#gtinImportPanel details { margin-top:14px; }
#gtinImportPanel summary { cursor:pointer; color:#64748b; font-size:13px; }
#gtinImportPanel pre { font-size:12px; padding:12px; background:#f8fafc; border-radius:8px; max-height:320px; overflow:auto; }
#gtinImportPanel [data-error]:empty { display:none; }
#gtinImportPanel dialog { padding:28px; box-shadow:0 24px 80px #0f172a40; color:#0f172a; }
#gtinImportPanel dialog::backdrop { background:#0f172a70; backdrop-filter:blur(3px); }
#gtinImportPanel dialog small { display:block; max-width:100%; overflow-wrap:anywhere; line-height:1.5; color:#64748b; }
#gtinImportPanel dialog input[type=number] { width:100px; }
#gtinImportPanel [data-structure] { border-color:#fdba74; background:#fff7ed; color:#9a3412; }
@media(max-width:700px) {
 #gtinImportPanel .card { padding:16px; }
 #gtinImportPanel dialog { padding:18px; }
 #gtinImportPanel h2 { font-size:18px; }
 #gtinImportPanel [data-work] .gtin-table { min-width:1000px; }
}

/* Shared menus for all GTIN selects, including dynamically rendered forms. */
.gtin-custom-select{display:block;position:relative;min-width:0;width:100%}
.gtin-select-native{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;clip-path:inset(50%)!important;padding:0!important;margin:0!important}
.gtin-select-trigger{display:flex!important;align-items:center;justify-content:space-between;gap:14px;width:100%;min-height:44px;padding:11px 14px!important;border:1px solid var(--stroke)!important;border-radius:11px!important;background:var(--card)!important;color:var(--ink)!important;text-align:left;font:inherit;cursor:pointer;box-shadow:none!important}
.gtin-select-trigger span{min-width:0;overflow-wrap:anywhere}
.gtin-select-trigger i{font-style:normal;font-size:21px;color:var(--ai)}
.gtin-select-trigger:hover,.gtin-select-trigger[aria-expanded=true]{border-color:var(--ai)!important;background:var(--ai-dim)!important}
.gtin-select-trigger:focus-visible{outline:3px solid var(--ai);outline-offset:2px}
.gtin-select-trigger:disabled{opacity:.55;cursor:wait}
.gtin-org-select-wrap:after{display:none}
.gtin-org-select-wrap .gtin-select-trigger{border-color:var(--ai)!important;font-weight:700;min-height:48px}
.gtin-select-menu{position:fixed;z-index:20000;box-sizing:border-box;overflow:auto;padding:6px;background:var(--card,#fff);color:var(--ink,#172033);border:1px solid var(--stroke,#dbe2ed);border-radius:14px;box-shadow:0 14px 40px rgba(15,23,42,.18)}
.gtin-select-menu .gtin-select-option{display:block;width:100%;box-sizing:border-box;padding:12px 34px 12px 12px;border:0;border-radius:9px;background:transparent;color:inherit;text-align:left;white-space:normal;overflow-wrap:anywhere;font:inherit;font-size:14px;cursor:pointer;position:relative}
.gtin-select-option:hover,.gtin-select-option:focus{background:var(--field,#f1f5f9);outline:none}
.gtin-select-option[aria-selected=true]{background:var(--ai-dim,#edf1ff);color:var(--ai,#315bff);font-weight:700}
.gtin-select-option[aria-selected=true]:after{content:'✓';position:absolute;right:12px;top:12px}
.gtin-select-option:disabled{opacity:.45;cursor:not-allowed}
.gtin-select-search{box-sizing:border-box;width:100%;padding:10px 12px;border:1px solid var(--stroke,#dbe2ed);border-radius:9px;margin-bottom:6px;font:inherit;background:var(--card,#fff);color:inherit}
.gtin-select-empty{padding:12px;color:var(--muted,#64748b);font-size:13px}

/* Consistent import editor and product table layout. */
#gtinImportPanel dialog[open]{position:fixed;inset:0;margin:auto!important;width:min(1040px,calc(100vw - 32px))!important;max-width:calc(100vw - 32px);max-height:calc(100dvh - 48px)!important;box-sizing:border-box;border:1px solid var(--stroke);border-radius:18px;overflow:auto}
#gtinImportPanel .gi-editor-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px 16px;align-items:start}
#gtinImportPanel .gi-editor-field{display:block;min-width:0;font-size:13px;font-weight:600}
#gtinImportPanel .gi-editor-field>span{display:block;min-height:20px}
#gtinImportPanel .gi-editor-field input{width:100%;min-height:42px}
#gtinImportPanel .gi-editor-field details{margin-top:6px;font-weight:400}
#gtinImportPanel .gi-required-star{color:#dc2626}
#gtinImportPanel .gi-field-missing input,#gtinImportPanel .gi-field-missing .gtin-select-trigger{border-color:#f59e0b!important;background:#fffbeb!important}
#gtinImportPanel .gi-required-note{padding:14px 16px;border:1px solid #fde68a;background:#fffbeb;border-radius:12px;margin-bottom:20px;font-size:13px}
#gtinImportPanel .gi-required-note p{margin:6px 0}
#gtinImportPanel .gi-dialog-footer{display:flex;align-items:center;justify-content:flex-end;gap:10px;position:sticky;bottom:-28px;margin:24px -8px -8px;padding:14px 8px;background:#fff;border-top:1px solid #e2e8f0;z-index:2}
#gtinImportPanel .gi-toolbar,#gtinImportPanel .gi-filters{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:16px 0}
#gtinImportPanel .gi-toolbar button,#gtinImportPanel .gi-filters button{min-height:40px;margin:0}
#gtinImportPanel .gi-table-scroll{overflow:auto;border:1px solid #e2e8f0;border-radius:12px}
#gtinImportPanel .gi-products-table{min-width:1180px;width:100%;table-layout:fixed}
#gtinImportPanel .gi-products-table th,#gtinImportPanel .gi-products-table td{vertical-align:middle;line-height:1.5;padding:14px 12px;overflow-wrap:anywhere}
#gtinImportPanel .gi-products-table th{background:#f8fafc;font-size:10px;letter-spacing:.04em}
#gtinImportPanel .gi-products-table th:nth-child(3),#gtinImportPanel .gi-products-table th:nth-child(7){width:15%}
#gtinImportPanel .gi-products-table th:last-child{width:120px}
#gtinImportPanel .gi-row-actions{display:grid;gap:8px}
#gtinImportPanel .gi-row-actions button{width:100%;min-height:36px;margin:0;white-space:nowrap}
#gtinImportPanel .gi-translation-note{font-size:13px;color:#475569;padding:10px 12px;background:#f1f5f9;border-radius:10px}
@media(max-width:800px){#gtinImportPanel .gi-editor-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:540px){#gtinImportPanel .gi-editor-grid{grid-template-columns:1fr}#gtinImportPanel dialog[open]{max-height:calc(100dvh - 24px)!important;width:calc(100vw - 24px)!important}#gtinImportPanel .gi-dialog-footer{bottom:-18px}}
#gtinImportPanel .gi-products-table{min-width:1600px}
#gtinImportPanel .gi-products-table th:nth-child(1){width:145px}
#gtinImportPanel .gi-products-table th:nth-child(2){width:120px}
#gtinImportPanel .gi-products-table th:nth-child(3){width:210px}
#gtinImportPanel .gi-products-table th:nth-child(4){width:100px}
#gtinImportPanel .gi-products-table th:nth-child(5){width:125px}
#gtinImportPanel .gi-products-table th:nth-child(6){width:105px}
#gtinImportPanel .gi-products-table th:nth-child(7){width:215px}
#gtinImportPanel .gi-products-table th:nth-child(8){width:140px}
#gtinImportPanel .gi-products-table th:nth-child(9){width:150px}
#gtinImportPanel .gi-products-table th:nth-child(10){width:120px}
#gtinImportPanel .gi-products-table td:nth-child(2),#gtinImportPanel .gi-products-table td:nth-child(5),#gtinImportPanel .gi-products-table td:nth-child(6),#gtinImportPanel .gi-products-table td:nth-child(9){white-space:nowrap;overflow-wrap:normal;font-variant-numeric:tabular-nums}
#gtinImportPanel .gi-toolbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch}
#gtinImportPanel .gi-toolbar button{min-height:46px}
@media(max-width:700px){#gtinImportPanel .gi-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:440px){#gtinImportPanel .gi-toolbar{grid-template-columns:1fr}}
#gtinImportPanel .gi-component-row{display:grid;grid-template-columns:minmax(0,1fr) 144px;align-items:center;gap:18px;padding:14px 0;border-bottom:1px solid #e2e8f0}
#gtinImportPanel .gi-component-row>label{display:flex;gap:10px;align-items:center;min-width:0}
#gtinImportPanel .gi-component-row b{font-size:14px}
#gtinImportPanel .gi-stepper{display:flex;align-items:center;gap:4px}
#gtinImportPanel .gi-stepper input[type=number]{width:60px;text-align:center;appearance:textfield;-moz-appearance:textfield}
#gtinImportPanel .gi-stepper input::-webkit-inner-spin-button,#gtinImportPanel .gi-stepper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
#gtinImportPanel .gi-stepper button{width:36px;height:38px;padding:0;font-size:20px;flex:none}
#gtinImportPanel .gi-original{margin:0 0 18px}
@media(max-width:480px){#gtinImportPanel .gi-component-row{grid-template-columns:1fr;gap:10px}.gi-stepper{justify-content:flex-end}}

#gtinImportPanel,#gtinImportPanel>[data-work],#gtinImportPanel .card,#gtinImportPanel .gi-table-scroll{min-width:0;max-width:100%;box-sizing:border-box}
#gtinImportPanel .gi-tnved-status{display:block;margin-top:5px;color:#64748b;font-size:11px;white-space:normal}
#gtinImportPanel .gi-tnved-summary{padding:11px 13px;border-radius:10px;background:#eef2ff;color:#3730a3;font-size:13px}
#gtinImportPanel .gi-tnved-review{margin:0 0 18px;padding:14px 16px;border:1px solid #cbd5e1;border-radius:12px;background:#f8fafc}
#gtinImportPanel .gi-tnved-review p{margin:7px 0;font-size:13px}
#gtinImportPanel .gi-tnved-match,#gtinImportPanel .gi-tnved-accepted{border-color:#86efac;background:#f0fdf4}
#gtinImportPanel .gi-tnved-proposed,#gtinImportPanel .gi-tnved-needs_data{border-color:#fdba74;background:#fff7ed}
#gtinImportPanel .gi-tnved-no_match,#gtinImportPanel .gi-tnved-unavailable{border-color:#fca5a5;background:#fef2f2}

/* Видимая обратная связь по длительным операциям (перевод, проверка ТН ВЭД с AI). */
#gtinImportPanel .gi-toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:30000;max-width:min(680px,calc(100vw - 32px));padding:13px 18px;border-radius:12px;font-size:13px;font-weight:600;line-height:1.45;box-shadow:0 14px 40px rgba(15,23,42,.22);border:1px solid #cbd5e1;background:#0f172a;color:#fff}
#gtinImportPanel .gi-toast-ok{background:#166534;border-color:#166534}
#gtinImportPanel .gi-toast-error{background:#b91c1c;border-color:#b91c1c}
#gtinImportPanel .gi-toast[hidden]{display:none}

/* Рабочая область импорта и редактор позиции — на всю ширину экрана. */
#gtinImportPanel{width:100%;max-width:none}
#gtinImportPanel .card{max-width:none}
#gtinImportPanel .gi-products-table{min-width:100%;width:100%;table-layout:auto}
#gtinImportPanel .gi-products-table th{width:auto!important}
#gtinImportPanel dialog[open]{width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;height:calc(100dvh - 32px);max-height:calc(100dvh - 32px)!important}
#gtinImportPanel .gi-editor-grid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
