.owner-content {
  min-width: 0;
  max-width: 1500px;
}

.owner-menu-toggle,
.owner-menu-backdrop {
  display: none;
}

.owner-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: normal;
}

.owner-brand img {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  object-fit: contain;
  padding: 5px;
  border-radius: 14px;
  background: #fff;
}

.owner-brand span {
  font-size: 18px;
  line-height: 1.25;
}

[data-owner-view][hidden] {
  display: none !important;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.buyer-privacy-note { margin: 12px 0 20px; color: #667085; }
.buyer-list { display: grid; gap: 10px; }
.buyer-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #dfe5ee;
  border-radius: 12px;
  background: #fff;
}
.buyer-row-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #eef4e5;
  color: #557725;
  font-size: 22px;
  font-weight: 800;
}
.buyer-row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.buyer-row-avatar img[hidden], .buyer-row-avatar span[hidden] { display: none; }
.buyer-row strong { display: block; margin-bottom: 5px; }
.buyer-row p { margin: 0 0 4px; color: #475467; overflow-wrap: anywhere; }
.buyer-row code { font-size: 12px; }
.buyer-row small { color: #667085; }

.owner-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.owner-form label,
.upload-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.owner-form input,
.owner-form select,
.owner-form textarea,
.inline-form input,
.inline-form select,
.upload-form input,
.import-table button {
  width: 100%;
  padding: 10px;
  border: 1px solid #d5dce5;
  background: #fff;
}

.owner-form textarea {
  min-height: 80px;
}

.owner-form .wide {
  grid-column: 1 / -1;
}

.owner-form .check {
  display: flex;
  align-items: center;
}

.owner-form .check input {
  width: auto;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: end;
}

.upload-form,
.inline-form {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  margin: 18px 0;
}

.upload-form label {
  min-width: 260px;
}

.product-image-editor {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid #dfe5ee;
  border-radius: 14px;
  background: #f8fafc;
}

.product-image-frame {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border: 1px dashed #c7d0df;
  border-radius: 12px;
  background: #fff;
  color: #98a2b3;
  font-size: 13px;
}

.product-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-image-frame img[hidden],
.product-image-frame span[hidden],
.product-thumb-empty[hidden] {
  display: none;
}

.product-image-controls {
  min-width: 0;
}

.product-image-controls h3 {
  margin: 0;
  font-size: 18px;
}

.product-image-controls p {
  margin: 8px 0;
  font-size: 13px;
}

.product-image-controls .upload-form {
  margin: 14px 0 8px;
}

.product-image-controls .form-status {
  min-height: 1.5em;
  color: #667085;
}

.image-url-form input {
  min-width: min(460px, 60vw);
}

.product-image-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.product-image-summary strong {
  font-size: 13px;
}

.product-image-gallery-wrap {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 2px;
  border-top: 1px solid #dfe5ee;
}

.product-image-gallery-wrap h4,
.catalog-imports h4 {
  margin: 16px 0 10px;
}

.product-image-gallery,
.pending-product-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.gallery-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px dashed #c7d0df;
  border-radius: 10px;
  text-align: center;
}

.product-gallery-item,
.pending-gallery-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dfe5ee;
  border-radius: 12px;
  background: #fff;
}

.product-gallery-item.is-primary {
  border-color: #6d8f31;
  box-shadow: 0 0 0 1px #6d8f31;
}

.product-gallery-item figure,
.pending-gallery-item figure {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  background: #f4f7fc;
}

.product-gallery-item img,
.pending-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-image-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #98a2b3;
  font-size: 12px;
}

.gallery-image-error[hidden] {
  display: none;
}

.product-gallery-item figcaption,
.pending-gallery-item figcaption {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgb(20 34 59 / 82%);
  color: #fff;
  font-size: 11px;
}

.gallery-item-url {
  display: block;
  margin: 8px 10px;
  overflow: hidden;
  color: #667085;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-item-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 10px 10px;
}

.gallery-item-actions button {
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid #d5dce5;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}

.gallery-item-actions button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.pending-product-images {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed #c7d0df;
  border-radius: 12px;
}

.pending-product-images[hidden] {
  display: none;
}

.pending-product-images::before {
  content: "待上传预览";
  grid-column: 1 / -1;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.catalog-imports {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid #dfe5ee;
}

.catalog-imports > p {
  margin: 8px 0;
}

.import-batch-form {
  padding: 18px;
  border: 1px solid #dfe5ee;
  border-radius: 12px;
  background: #f8fafc;
}

.import-batch-form textarea {
  min-height: 150px;
  resize: vertical;
}

.import-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  background: #fff;
}

.import-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12px;
}

.import-table th,
.import-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e8edf3;
  text-align: left;
  vertical-align: top;
}

.import-table th {
  background: #f8fafc;
  color: #475467;
  white-space: nowrap;
}

.import-table td {
  overflow-wrap: anywhere;
}

.import-table tbody tr:last-child td {
  border-bottom: 0;
}

.import-table button {
  width: auto;
  padding: 7px 9px;
  cursor: pointer;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid #dfe5ee;
  padding: 14px;
  background: #fff;
}

.admin-row p,
.admin-row small {
  margin: 4px 0;
  color: #667085;
}

.admin-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-row-actions button,
.admin-row-actions select {
  padding: 7px 9px;
  border: 1px solid #d5dce5;
  background: #fff;
  cursor: pointer;
}

.product-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.product-summary > div:last-child {
  min-width: 0;
}

.product-summary small {
  display: block;
  overflow-wrap: anywhere;
}

.product-thumb-frame {
  display: grid;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  background: #f4f7fc;
}

.product-thumb {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-thumb-empty {
  grid-area: 1 / 1;
  color: #98a2b3;
  font-size: 12px;
}

.danger {
  color: #a22;
}

.compact-list .admin-row {
  padding: 10px 14px;
}

.logistics-form {
  display: grid;
  grid-template-columns: repeat(5, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.logistics-form input {
  padding: 8px;
  border: 1px solid #d5dce5;
}

.order-admin-card > div:first-child { width: 100%; min-width: 0; }
.order-admin-card h4 { margin: 22px 0 10px; }
.manual-shipment-form {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #d9e4cd;
  border-radius: 14px;
  background: #f7faef;
}
.manual-shipment-form label { flex: 1; margin: 0; }
.logistics-note { color: #697064; font-size: 12px; }
.contact-settings-form { margin-top: 24px; }
.contact-qr-editor { display: grid; grid-column: 1 / -1; grid-template-columns: 180px minmax(0, 1fr); align-items: center; gap: 20px; }
.contact-qr-editor figure { display: grid; place-items: center; width: 180px; aspect-ratio: 1; margin: 0; overflow: hidden; border: 1px dashed #c9d5bc; border-radius: 18px; background: #f7faef; color: #78816e; }
.contact-qr-editor img { width: 100%; height: 100%; object-fit: contain; }

.owner-gate form {
  max-width: 420px;
  display: grid;
  gap: 12px;
}

.owner-gate form[hidden]{display:none}

.owner-gate label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.owner-gate input {
  width: 100%;
  padding: 11px;
  border: 1px solid #d5dce5;
}

.owner-gate .form-status {
  min-height: 1.5em;
  color: #667085;
}

.owner-gate .secondary {
  justify-self: start;
}

.owner-forgot-password {
  justify-self: start;
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: #557725;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.owner-forgot-password:disabled { opacity: .55; cursor: wait; }

@media (max-width: 900px) {
  .owner-form {
    grid-template-columns: 1fr 1fr;
  }

  .logistics-form {
    grid-template-columns: 1fr 1fr;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .owner-form {
    grid-template-columns: 1fr;
  }

  .owner-form .wide {
    grid-column: auto;
  }

  .inline-form,
  .upload-form,
  .product-image-editor {
    display: grid;
  }

  .product-image-editor {
    grid-template-columns: 1fr;
  }

  .upload-form label {
    min-width: 0;
  }

  .image-url-form input {
    min-width: 0;
  }

  .product-image-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .product-image-summary .secondary {
    width: 100%;
  }

  .product-image-frame {
    max-width: 240px;
  }

  .product-image-gallery,
  .pending-product-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-thumb-frame {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }

  .logistics-form {
    grid-template-columns: 1fr;
  }

  .manual-shipment-form { align-items: stretch; flex-direction: column; }
  .contact-qr-editor { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .owner aside {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 31;
    display: flex;
    width: min(82vw, 300px);
    overflow-y: auto;
    box-shadow: 18px 0 48px rgb(20 34 59 / 24%);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .owner aside.is-open {
    transform: translateX(0);
  }

  .owner-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
    width: 100%;
    border: 0;
    background: rgb(20 34 59 / 52%);
    cursor: pointer;
  }

  .owner-menu-backdrop[hidden] {
    display: none;
  }

  .owner-menu-toggle {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border: 1px solid #d5dce5;
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
  }

  .owner-content header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
  }

  .owner-content header > div {
    min-width: 0;
  }

  .owner-content h1 {
    font-size: clamp(26px, 8vw, 35px);
  }

  .owner.owner-menu-open {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .owner aside {
    transition: none;
  }
}
/* Sensitive data is never placed in the normal order list. */
#customsDialog{width:min(480px,calc(100vw - 40px));box-sizing:border-box;padding:24px;border:1px solid #dce3ed;border-radius:16px;}
#customsDialog::backdrop{background:rgba(10,20,35,.55);}
#customsIdentity{font:600 20px monospace;overflow-wrap:anywhere;}
