body[data-view="import"] { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; background: #f5f3ed; }
.import-page, .import-shell, .import-main, .import-side { min-height: 0; }
.import-page { display: flex; flex: 1 1 auto; flex-direction: column; gap: 14px; width: min(100%, 1500px); margin: 0 auto; padding: 18px 22px 22px; color: #242925; }
.import-page[hidden], .toolbar[hidden] { display: none !important; }
.import-page [hidden] { display: none !important; }
.import-head { flex: 0 0 auto; padding-bottom: 12px; border-bottom: 1px solid #d8dbd2; }
.import-head h1 { margin: 0; font: 700 22px "Trebuchet MS", "Microsoft YaHei", sans-serif; }
.import-head p { margin: 5px 0 11px; color: #737b73; font-size: 12px; }
.import-steps { display: flex; gap: 18px; color: #949b91; font-size: 12px; }
.import-steps span { padding: 5px 0; border-bottom: 2px solid transparent; }
.import-steps span.active { color: #a24f30; border-color: #b85f3d; font-weight: 700; }
.import-shell { display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) 290px; gap: 15px; }
.import-main, .import-side { border: 1px solid #d8dbd2; border-radius: 12px; background: #fbfaf6; }
.import-main { display: grid; place-items: center; overflow: hidden; }
.import-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; width: min(82%, 540px); min-height: 290px; padding: 28px; border: 1px dashed #b6bdb1; border-radius: 10px; background: #f8f8f2; text-align: center; cursor: pointer; }
.import-drop:hover, .import-drop.dragging { border-color: #b85f3d; background: #f8f3ed; }
.import-drop strong { font-size: 19px; }
.import-drop span { max-width: 350px; color: #737b73; font-size: 12px; line-height: 1.6; }
.import-drop button { margin-top: 8px; }
.import-image-wrap, .import-result-wrap { display: flex; align-items: flex-start; justify-content: center; width: 100%; height: 100%; overflow: auto; padding: 12px; background-color: #e9ebe7; background-image: linear-gradient(45deg, #e1e4de 25%, transparent 25%), linear-gradient(-45deg, #e1e4de 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e1e4de 75%), linear-gradient(-45deg, transparent 75%, #e1e4de 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.import-image-wrap canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 4px 20px #20272029; cursor: crosshair; touch-action: none; }
.import-result-wrap canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; image-rendering: pixelated; box-shadow: 0 4px 20px #20272029; }
.import-result-wrap { position: relative; }
.import-result-wrap.is-zoomed canvas { max-width: none; max-height: none; }
#import-preview-zoom { position: sticky; top: 10px; right: 10px; z-index: 1; flex: 0 0 auto; margin-left: -94px; align-self: flex-start; background: #fbfaf6; }
.import-side { overflow: auto; padding: 16px; }
.import-file-name { overflow-wrap: anywhere; font-size: 12px; font-weight: 700; }
#import-reselect-button { height: 28px; margin-top: 7px; padding: 0 9px; font-size: 11px; }
.import-status { min-height: 40px; margin: 8px 0 16px; color: #69756a; font-size: 12px; line-height: 1.5; }
.import-status.is-busy::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 7px; border: 2px solid #d1d9d0; border-top-color: #b85f3d; border-radius: 50%; animation: list-spin .75s linear infinite; vertical-align: -2px; }
.import-grid-controls h2, .import-review h2 { margin: 0 0 8px; font-size: 15px; }
.import-grid-controls p, .import-review p { margin: 8px 0 12px; color: #737b73; font-size: 11px; line-height: 1.6; }
.import-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.import-field-grid label, .import-legend-label { display: block; color: #40483f; font-size: 11px; font-weight: 650; }
.import-field-grid input, .import-legend-label input { box-sizing: border-box; width: 100%; height: 34px; margin-top: 4px; padding: 0 8px; border: 1px solid #cfd5cb; border-radius: 6px; background: #fff; color: #242925; font: inherit; }
.import-field-grid input:focus, .import-legend-label input:focus { outline: 2px solid #b9c7b6; outline-offset: 1px; }
.import-legend-label { margin-top: 15px; }
.import-grid-controls > button, .import-review > button { width: 100%; min-height: 36px; margin-top: 6px; }
.import-materials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; max-height: 38dvh; overflow: auto; }
.import-material { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; padding: 6px; border: 1px solid #e1e4dc; border-radius: 6px; background: #fff; font-size: 11px; }
.import-material.is-mismatch { border-color: #d99a52; background: #fff9ef; }
.import-material i { width: 14px; height: 14px; flex: 0 0 14px; border: 1px solid #cdd2c8; border-radius: 3px; }
.import-material b { margin-left: auto; color: #667167; font-size: 10px; white-space: nowrap; }
.import-material small { width: 100%; padding-left: 20px; color: #7c827a; font-size: 9px; line-height: 1.3; }
.import-material.is-mismatch small { color: #a24f30; font-weight: 650; }
@media (max-width: 800px) {
  .import-page { padding: 10px; }
  .import-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(220px, 1fr) minmax(180px, auto); gap: 8px; }
  .import-side { max-height: 34dvh; }
  .import-head h1 { font-size: 18px; }
  .import-head p { font-size: 11px; }
  .import-steps { gap: 9px; font-size: 10px; }
}
