.panel-detail:has(.import-desk) {
  padding: clamp(16px, 1.7vw, 30px);
  background: #f6f8f7;
}
.import-desk {
  --ink: #21382e;
  --soft-ink: #596c61;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  color: var(--ink);
  font-size: 14px;
}
.imp-head, .imp-section-head, .imp-modes, .imp-mode, .imp-link,
.imp-back, .imp-primary, .imp-notice, .imp-nochange, .imp-source-name {
  display: flex;
  align-items: center;
}
.imp-head { gap: 12px; margin: 2px 0 22px; }
.imp-title-icon {
  display: grid; place-items: center; flex: none; width: 45px; height: 45px;
  border-radius: 15px; color: #245e46; background: #e2eee7; border: 1px solid #cfdfd5;
}
.imp-title-icon .icon { width: 24px; height: 24px; }
.imp-head h2 { display: block; margin: 0; font-size: 23px; font-weight: 680; line-height: 1.3; }
.imp-head p { margin-top: 3px; color: var(--soft-ink); font-size: 12px; overflow-wrap: anywhere; }
.imp-head p span { margin: 0 3px; color: #83968a; }
.imp-back, .imp-link {
  flex: none; justify-content: center; gap: 5px; padding: 5px 7px; border-radius: 7px; font-size: 12px;
}
.imp-back { margin-left: auto; color: var(--soft-ink); }
.imp-link { color: var(--accent); font-weight: 600; }
.imp-back .icon, .imp-link .icon { width: 15px; height: 15px; }
.imp-back:hover, .imp-link:hover { background: var(--accent-soft); }
.imp-form fieldset { display: grid; gap: 14px; min-width: 0; padding: 0; border: 0; margin: 0; }
.imp-card, .imp-spec {
  min-width: 0; padding: 18px; border: 1px solid #dbe4de; border-radius: 16px;
  background: #fff; box-shadow: 0 2px 5px #1c3c2605;
}
.imp-section-head { justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
.imp-section-head h3 { font-size: 15px; font-weight: 670; }
.imp-section-head > span, .imp-format-hint, .imp-spec p { color: var(--soft-ink); font-size: 12px; }
.imp-modes {
  gap: 3px; padding: 3px; border-radius: 10px; margin: 14px 0 12px; background: #f0f3f1;
}
.imp-mode {
  flex: 1; justify-content: center; gap: 7px; padding: 7px 4px; min-height: 34px;
  color: var(--soft-ink); border: 1px solid transparent; border-radius: 8px; font-size: 13px;
}
.imp-mode[aria-pressed="true"] {
  color: var(--ink); background: white; border-color: #dbe3dd; box-shadow: 0 1px 3px #16392212; font-weight: 650;
}
.imp-mode:hover { color: var(--accent); }
.imp-mode .icon { width: 16px; height: 16px; }
.imp-drop {
  position: relative; width: 100%; min-height: 174px; padding: 18px; border: 1px dashed #96b6a4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 11px; color: var(--ink); isolation: isolate;
  background: radial-gradient(ellipse at 50% 58%, #fafdfa 14%, transparent 78%), #eff7f2;
}
.imp-drop::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background-image: radial-gradient(#61997c4f .7px, transparent .85px); background-size: 11px 11px;
  mask-image: linear-gradient(110deg, #000, transparent 40%, transparent 60%, #000);
}
.imp-drop:hover, .imp-drop.is-over { background-color: #e3f2e9; border-color: #3c805b; }
.imp-drop.is-over { outline: 2px solid #79ad8c; outline-offset: 2px; }
.imp-drop strong { max-width: 100%; overflow-wrap: anywhere; font-size: 16px; }
.imp-drop > span:last-child { color: var(--accent); font-size: 12px; }
.imp-sheet {
  position: relative; width: 43px; height: 49px; margin: 4px 0 11px; border-radius: 8px;
  border: 1px solid #6c9c83; background: #fff; box-shadow: 0 4px 8px #1a50341a;
}
.imp-sheet::before {
  content: ""; position: absolute; inset: -4px 3px 3px -4px; z-index: -1; transform: rotate(-10deg);
  border-radius: 8px; border: 1px solid #9bb9a8; background: #d6e9dd;
}
.imp-sheet i {
  position: absolute; inset: 9px 7px 8px; border-radius: 2px; border: 1px solid #adc6b8; border-top: 6px solid #5b9071;
  background: repeating-linear-gradient(0deg, transparent 0 6px, #c9dcd1 6px 7px),
              linear-gradient(90deg, transparent 42%, #c9dcd1 42% 47%, transparent 47%);
}
.imp-sheet b {
  position: absolute; right: -9px; bottom: -3px; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 7px; border: 2px solid #f4faf6; color: white; background: var(--accent);
}
.imp-sheet b .icon { width: 13px; height: 13px; stroke-width: 2; }
.imp-format-hint { margin-top: 9px; }
.imp-target-store { margin-top: 16px; }
.imp-template-links { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.imp-workbook h3 { margin-bottom: 12px; font-size: 15px; }
.imp-workbook label { display: grid; gap: 5px; min-width: 0; color: var(--soft-ink); font-size: 12px; }
.imp-workbook select { width: 100%; min-width: 0; }
.catalog-barcode { display: block; margin-top: 3px; color: var(--soft-ink); font-size: 11px; }
.product-field-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.product-field-grid input { width: 100%; min-width: 0; }
.receipt-facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,155px),1fr)); gap: 10px; margin: 0; }
.receipt-facts div { padding: 9px 10px; background: var(--surface-soft); border-radius: 9px; min-width: 0; }
.receipt-facts dt { color: var(--soft-ink); font-size: 12px; }
.receipt-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.imp-worksheet { max-width: 340px; }
.imp-mapping { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),1fr)); gap: 10px; margin-top: 12px; }
.imp-paste { min-height: 174px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--soft-ink); }
.imp-paste textarea {
  display: block; width: 100%; min-height: 142px; flex: 1; resize: vertical; padding: 12px;
  background: #fafcfb; color: var(--ink); border: 1px solid #b5c8bc; border-radius: 10px; font-size: 14px;
}
.imp-columns { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.imp-columns > span {
  padding: 2px 8px; border: 1px solid #e2e9e4; border-radius: 5px; background: #f7f9f8; font-size: 12px;
}
.imp-columns small { margin-left: 5px; color: var(--soft-ink); font-size: 11px; }
.imp-primary {
  justify-content: center; gap: 10px; width: 100%; min-height: 42px; padding: 8px 14px;
  background: var(--accent); border-radius: 10px; color: white; font-weight: 650; font-size: 14px;
}
.imp-primary:hover:not(:disabled) { background: var(--accent-hover); }
.imp-primary:disabled { background: #e4eae6; color: #5c6d61; opacity: 1; cursor: default; }
.imp-primary .icon { width: 16px; height: 16px; }
.imp-notice, .imp-nochange, .imp-source-name { gap: 7px; color: var(--soft-ink); font-size: 12px; overflow-wrap: anywhere; }
.imp-notice { margin-top: 12px; }
.imp-notice .icon, .imp-source-name .icon { width: 15px; height: 15px; }
.imp-error { margin: 0; padding: 9px 12px; border-radius: 7px; background: #fcf0ed; }
.imp-error:empty { display: none; }
.imp-review + .imp-error:not(:empty) { margin: 12px 0; }
.imp-review { margin-bottom: 14px; }
.imp-source-name { margin: 8px 0; }
.imp-metrics {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 16px 0 20px; padding: 13px 0;
  border: 1px solid #dfe8e2; background: #f5f8f6; border-radius: 10px;
}
.imp-metrics > div { padding: 0 12px; }
.imp-metrics > div + div { border-left: 1px solid #d8e3dc; }
.imp-metrics dt { color: var(--soft-ink); font-size: 12px; }
.imp-metrics dd { margin: 2px 0 0; font-size: 25px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.imp-metrics > div:nth-child(2) dd { color: var(--accent); }
.imp-table { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; max-width: 100%; }
.imp-table table { font-size: 12px; }
.imp-table th { background: #f5f7f6; }
.imp-table th, .imp-table td { padding: 8px 9px; }
.imp-table tr:last-child td { border-bottom: 0; }
.imp-status { border-radius: 5px; padding: 2px 6px; color: #24583c; background: #e6f2e9; }
.imp-status.skip { color: #715624; background: #f8f0e0; }
.imp-nochange { padding: 10px 12px; border: 1px solid #dce6df; border-radius: 9px; }
.stock-photo-controls { display: flex; align-items: center; gap: 12px; }
.stock-photo-field h3 { margin-bottom: 10px; font-size: 15px; }
.stock-photo-thumb { display: grid; place-items: center; width: 64px; height: 72px; flex: none; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.stock-photo-thumb img { width: 100%; height: 100%; object-fit: contain; }
.stock-photo-field .stock-photo-picker { position: relative; width: fit-content; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; color: var(--accent); font-size: 13px; border: 1px solid var(--accent-line); border-radius: 8px; background: var(--accent-soft); overflow: hidden; }
.stock-photo-picker:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.stock-photo-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.stock-photo-controls small { display: block; margin-top: 4px; font-size: 12px; }
.photo-feedback:not(:empty) { margin-top: 8px; font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 440px) {
  .panel-detail:has(.import-desk) { padding: 15px 12px; }
  .imp-card, .imp-spec { padding: 14px; }
  .imp-head { margin-bottom: 16px; }
}
