.image-lightbox {
  width: fit-content;
  height: fit-content;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  box-sizing: border-box;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  color: #fff;
}

.image-lightbox[open] {
  display: block;
}

.image-lightbox::backdrop {
  background: rgba(0, 0, 0, .9);
  backdrop-filter: blur(4px);
}

.image-lightbox .lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  background: transparent;
  object-fit: contain;
}

.image-lightbox .lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0 0 2px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 50%;
  background: rgba(8, 8, 10, .78);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  font-size: 1.55rem;
  font-weight: 300;
  line-height: 1;
}

.image-lightbox .lightbox-close:hover {
  border-color: #fff;
  background: #08080a;
  color: #fff;
}

.image-lightbox .lightbox-close:focus-visible {
  outline: 2px solid #10183d;
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .image-lightbox {
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .image-lightbox .lightbox-image {
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.checkout-item .mini-art {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.card-focus-editor {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(240px, 1fr);
  gap: 12px 28px;
  align-items: center;
}

.card-focus-editor > h2,
.card-focus-editor > p {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.card-focus-preview {
  width: 100%;
  aspect-ratio: 1;
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 1.5px solid #17265a;
  border-radius: 18px;
  box-shadow: 0 4px 7px rgba(13, 25, 65, .25);
}

.focus-controls {
  display: grid;
  gap: 24px;
}

.focus-controls label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 0;
}

.focus-controls input {
  grid-column: 1 / -1;
  width: 100%;
}

@media (max-width: 700px) {
  .card-focus-editor {
    grid-template-columns: 1fr;
  }
}

.shipping-defaults {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 20px;
}

.shipping-defaults label {
  display: grid;
  align-content: start;
  gap: 7px;
}

.shipping-rate-list {
  border: 1px solid #cfd5e5;
  border-radius: 14px;
  overflow: hidden;
}

.shipping-rate-row {
  display: grid;
  grid-template-columns: minmax(190px,1.4fr) repeat(3,minmax(145px,1fr));
  gap: 14px;
  align-items: end;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid #dce1ec;
}

.shipping-rate-row:last-child { border-bottom: 0; }
.shipping-rate-row label { margin: 0; }
.shipping-rate-row small { color: #65708e; }

@media (max-width: 850px) {
  .shipping-defaults,
  .shipping-rate-row { grid-template-columns: 1fr; }
}

.orders-heading,
.fulfilment-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.order-search {
  display: flex;
  align-items: end;
  gap: 8px;
  min-width: min(440px,100%);
}

.order-search label { flex: 1; margin: 0; }

.order-filters {
  display: grid;
  grid-template-columns: minmax(180px,1.1fr) minmax(180px,1.1fr) minmax(120px,.55fr) minmax(150px,.75fr) auto auto;
  gap: 12px;
  align-items: end;
  margin: 28px 0;
  padding: 18px;
  background: #fff;
  border: 1px solid #cfd5e5;
  border-radius: 14px;
}

.order-filters label { margin: 0; }

.fulfilment-summary {
  align-items: center;
  margin: 24px 0 12px;
}

.fulfilment-summary p { margin: 0; }
.fulfilment-summary p b { color: #d15a18; }
.fulfilment-summary div { display: flex; flex-wrap: wrap; gap: 20px; }

.fulfilment-orders {
  border-top: 1px solid #cfd5e5;
}

.fulfilment-order {
  display: grid;
  grid-template-columns: 110px minmax(170px,.9fr) minmax(190px,1fr) minmax(280px,1.5fr) minmax(170px,.8fr);
  gap: 20px;
  padding: 24px 10px;
  border-bottom: 1px solid #cfd5e5;
}

.fulfilment-order:nth-child(even) { background: rgba(255,255,255,.45); }
.fulfilment-order small { display: block; color: #65708e; line-height: 1.45; }
.order-date small { margin-top: 7px; }
.order-buyer { display: grid; align-content: start; gap: 5px; }
.fulfilment-order address { font-style: normal; line-height: 1.5; }

.order-items {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-items li { display: grid; grid-template-columns: auto 1fr; gap: 7px; }
.order-items em { display: block; margin-top: 5px; color: #8b5a18; font-size: 12px; font-weight: 800; font-style: normal; }
.order-actions { display: grid; justify-items: start; align-content: start; gap: 10px; }
.order-actions .button { padding: 9px 14px; }

.status-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8edf8;
  color: #17265a;
  font-size: 12px;
  font-weight: 800;
}

/* Orders use a Bandcamp-like operational list: one scan line per order. */
body.admin-body:has(.orders-page) main.wrap { width: min(1500px,96vw); }
.orders-page .order-filters { margin: 20px 0 14px; padding: 14px 0; background: transparent; border: 0; border-block: 1px solid #cfd5e5; border-radius: 0; }
.order-integrity-compact { display: flex; justify-content: space-between; gap: 14px; margin: 12px 0; padding: 9px 11px; border-left: 3px solid #31785b; background: #f3f8f5; color: #17265a; font-size: .76rem; text-decoration: none; }
.order-integrity-compact.has-warning { border-left-color: #a12034; background: #fff0f2; color: #86182a; }
.order-integrity-compact span { text-decoration: underline; }
.orders-page .fulfilment-summary { margin: 14px 0 10px; }
.orders-column-head,
.orders-page .fulfilment-order { display: grid; grid-template-columns: 120px minmax(180px,.9fr) minmax(220px,1.05fr) minmax(310px,1.55fr) minmax(205px,.85fr); gap: 22px; }
.orders-column-head { padding: 9px 8px; border-block: 1px solid #aeb7cc; color: #56607f; font-size: .7rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.order-date-sort { display: inline-flex; align-items: center; gap: 5px; width: fit-content; color: #17265a; text-decoration: underline; text-underline-offset: 2px; }
.order-date-sort span { font-size: .82rem; line-height: 1; }
.orders-page .fulfilment-orders { border-top: 0; }
.admin-body .orders-page .fulfilment-order { padding: 22px 8px; border-bottom: 1px solid #cfd5e5; border-radius: 0!important; background: transparent; }
.orders-page .fulfilment-order:nth-child(even) { background: transparent; }
.admin-body .orders-page .fulfilment-order.is-shipped,
.orders-page .fulfilment-order.is-shipped:nth-child(even) { background: #f1f8f3; box-shadow: inset 4px 0 0 #2b7a4b; }
.orders-page .order-date b { font-size: .9rem; line-height: 1.3; }
.orders-page .order-buyer b { font-size: .92rem; }
.orders-page .order-buyer a { overflow-wrap: anywhere; font-size: .82rem; }
.orders-page .order-address address { font-size: .86rem; line-height: 1.45; }
.order-address-compact { display: none; }
.order-address-edit { margin-top: 8px; }
.order-address-edit summary { width: fit-content; color: #17265a; cursor: pointer; font-size: .76rem; font-weight: 800; text-decoration: underline; }
.order-address-edit form { display: grid; gap: 7px; margin-top: 10px; padding: 10px; background: #f7f8fb; border: 1px solid #d8ddea; }
.order-address-edit label { display: grid; gap: 3px; margin: 0; color: #56607f; font-size: .68rem; font-weight: 800; }
.order-address-edit input,.order-address-edit select { width: 100%; min-height: 34px; padding: 6px 8px; font-size: .78rem; }
.order-address-edit button { min-height: 36px; padding: 7px 9px; }
.order-address-locked { margin-top: 8px; }
.orders-page .order-items { gap: 13px; }
.orders-page .order-items li { grid-template-columns: 32px minmax(0,1fr); }
.orders-page .order-items b { font-size: .9rem; line-height: 1.3; }
.orders-page .order-quantity { font-weight: 900; }
.orders-page .order-actions { gap: 4px; }
.order-shipped-status { display: grid; justify-items: start; gap: 4px; margin-bottom: 7px; }
.order-shipped-status strong { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 12px; border: 1px solid #1f653d; border-radius: 5px; background: #2b7a4b; color: #fff; font-size: .9rem; font-weight: 950; letter-spacing: .1em; line-height: 1; }
.order-shipped-status time { color: #235d3c; font-size: .76rem; font-weight: 850; line-height: 1.3; }
.orders-page .order-primary-action { min-width: 154px; padding: 10px 13px; background: #10183d; color: #fff; border-color: #10183d; text-align: center; }
.orders-page .order-primary-action:hover { background: #fff; color: #10183d; }
.order-ship-form { margin: 0; }
.orders-page .order-actions small { margin: 0; }
.orders-page .order-detail-link { font-size: .78rem; font-weight: 800; }
.orders-page .order-action-link,.orders-page .order-detail-link,.orders-page .order-note-link { display: inline-flex; align-items: center; width: fit-content; min-height: 30px; padding: 3px 0; border: 0!important; border-radius: 0!important; background: transparent!important; color: #17265a!important; box-shadow: none!important; font-size: .78rem; font-weight: 800; line-height: 1.3; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.orders-page .order-action-link:hover,.orders-page .order-detail-link:hover,.orders-page .order-note-link:hover { color: #a12034!important; background: transparent!important; }
.orders-page .order-refund-action { color: #a12034!important; }
.order-export-form { margin: 0; }
.order-export-form button { width: auto; }
.order-number { padding: 2px 0 3px; font-weight: 800; }
.orders-page .order-ship-form + .order-number { margin-top: 10px; }
.order-exception-warning { padding: 8px 10px; border-left: 3px solid #a12034; background: #fff0f2; color: #86182a; font-size: .72rem; line-height: 1.4; }
.order-note { width: 100%; margin-top: 6px; padding: 10px 11px; border-left: 3px solid #d15a18; background: #fff8ed; }
.order-note b { display: block; color: #17265a; font-size: .72rem; }
.order-note p { margin: 4px 0 6px; color: #27324e; font-size: .8rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.order-note a,.order-note-link { font-size: .76rem; font-weight: 800; }
.order-note-editor { max-width: 680px; }
.order-note-editor form,.order-note-editor label { display: grid; gap: 8px; }
.order-note-editor textarea { width: 100%; resize: vertical; }
.order-note-editor-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.fulfilment-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0 8px; }
.fulfilment-tools .button { min-height: 42px; display: inline-flex; align-items: center; }
.fulfilment-tools form { margin: 0; }
.orders-filter-bar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: center; border-block: 1px solid #cfd5e5; }
.orders-view-toggle { display: inline-flex; align-items: center; gap: 9px; margin: 0; padding: 10px 2px; color: #17265a; font-size: .78rem; font-weight: 900; white-space: nowrap; cursor: pointer; }
.orders-view-toggle input { width: 38px; height: 21px; margin: 0; accent-color: #17265a; cursor: pointer; }

/* Compact is a presentation-only mode: warnings and fulfilment actions stay visible. */
.orders-page.is-compact .orders-column-head,
.orders-page.is-compact .fulfilment-order { grid-template-columns: 90px minmax(135px,.8fr) minmax(170px,1fr) minmax(280px,1.75fr) minmax(170px,.9fr); gap: 14px; }
.admin-body .orders-page.is-compact .fulfilment-order { padding: 9px 8px; }
.orders-page.is-compact .order-buyer { gap: 2px; }
.orders-page.is-compact .order-buyer-email,
.orders-page.is-compact .order-address-detailed,
.orders-page.is-compact .order-address-edit,
.orders-page.is-compact .order-address-locked,
.orders-page.is-compact .order-items small,
.orders-page.is-compact .order-refund-action,
.orders-page.is-compact .order-note,
.orders-page.is-compact .order-note-link { display: none!important; }
.orders-page.is-compact .order-address-compact { display: inline; }
.orders-page.is-compact .order-items { gap: 5px; }
.orders-page.is-compact .order-items li { grid-template-columns: 25px minmax(0,1fr); gap: 4px; }
.orders-page.is-compact .order-items b { font-size: .82rem; line-height: 1.22; }
.orders-page.is-compact .signed-sleeve-flag { margin-top: 3px; padding: 2px 5px; font-size: .62rem; }
.orders-page.is-compact .order-actions { gap: 1px; }
.orders-page.is-compact .order-shipped-status { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }
.orders-page.is-compact .order-shipped-status strong { min-height: 27px; padding: 5px 8px; font-size: .72rem; }
.orders-page.is-compact .order-primary-action { min-width: 132px; min-height: 32px; padding: 6px 9px; font-size: .75rem; }
.orders-page.is-compact .order-number { padding: 1px 0; font-size: .72rem; }
.orders-page.is-compact .order-detail-link { min-height: 25px; padding-block: 1px; font-size: .72rem; }
.orders-page.is-compact .order-exception-warning { padding: 5px 7px; }
@media(max-width:520px){
  .fulfilment-tools { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .fulfilment-tools form,.fulfilment-tools .button,.fulfilment-tools button { width: 100%; min-width: 0; }
  .fulfilment-tools .button,.fulfilment-tools button { justify-content: center; min-height: 44px; padding-inline: 7px; font-size: .72rem; text-align: center; }
}
.simple-shipment { max-width: 920px; }
.simple-shipment .shipment-review { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 18px 0; padding: 16px 0; border-block: 1px solid #d8ddea; }
.simple-shipment address { font-style: normal; line-height: 1.55; }
.simple-shipment form { display: grid; gap: 15px; margin-top: 20px; }
.simple-shipment form label { display: grid; gap: 6px; font-weight: 800; }
.simple-shipment textarea { width: 100%; resize: vertical; }
.simple-shipment form small { color: #65708e; font-weight: 500; }
.technical-order-data summary { cursor: pointer; color: #17265a; font-weight: 900; }

.empty-orders { padding: 50px 20px; text-align: center; }

.packing-slip {
  max-width: 760px;
  min-height: 920px;
  margin: 30px auto;
  padding: 44px;
  background: #fff;
  border: 1px solid #ccd3e2;
}
.packing-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.packing-slip table { width: 100%; margin-top: 28px; border-collapse: collapse; }
.packing-slip td { padding: 15px 0; border-top: 1px solid #ccd3e2; }
.print-toolbar { display: flex; justify-content: space-between; }

@media (max-width: 1000px) {
  .fulfilment-order { grid-template-columns: 100px 1fr 1fr; }
  .order-items { grid-column: 2 / 4; }
  .order-actions { grid-column: 2 / 4; grid-auto-flow: column; justify-content: start; align-items: center; }
}

@media (max-width: 1180px) {
  .orders-page .order-filters { grid-template-columns: repeat(2,minmax(180px,1fr)); }
  .orders-filter-bar { grid-template-columns: 1fr; gap: 0; }
  .orders-view-toggle { justify-self: start; padding: 0 0 12px; }
  .orders-column-head { display: none; }
  .orders-page .fulfilment-order { grid-template-columns: 110px minmax(180px,1fr) minmax(220px,1fr); }
  .orders-page .order-items { grid-column: 2 / 4; }
  .orders-page .order-actions { grid-column: 2 / 4; grid-auto-flow: row; justify-content: start; align-items: start; }
}

@media (max-width: 700px) {
  .orders-heading,
  .fulfilment-summary { align-items: stretch; flex-direction: column; }
  .order-search { min-width: 0; width: 100%; }
  .order-filters,
  .fulfilment-order { grid-template-columns: 1fr; }
  .order-items,
  .order-actions { grid-column: auto; }
  .order-actions { grid-auto-flow: row; }
  .orders-page .fulfilment-order { grid-template-columns: 1fr; }
  .orders-page .order-items,.orders-page .order-actions { grid-column: auto; }
  .orders-page .order-actions { grid-auto-flow: row; }
  .orders-page .order-actions,.orders-page .order-actions>* { width: 100%; max-width: 100%; }
  .orders-page .order-ship-form .order-primary-action { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 42px; text-align: center; }
  .orders-page .order-action-link,.orders-page .order-detail-link,.orders-page .order-note-link { justify-content: flex-start; width: fit-content; min-height: 40px; text-align: left; }
  .orders-page .order-export-form button { width: fit-content; }
  .orders-page .order-note a { display: inline-flex; align-items: center; min-height: 38px; }
  .orders-page.is-compact .fulfilment-order { grid-template-columns: 82px minmax(0,1fr); gap: 5px 10px; padding-block: 9px; }
  .orders-page.is-compact .order-date { grid-column: 1; grid-row: 1; }
  .orders-page.is-compact .order-buyer { grid-column: 2; grid-row: 1; }
  .orders-page.is-compact .order-address { grid-column: 2; grid-row: 2; }
  .orders-page.is-compact .order-items { grid-column: 1/-1; grid-row: 3; padding-top: 6px; }
  .orders-page.is-compact .order-actions { grid-column: 1/-1; grid-row: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-top: 5px; }
  .orders-page.is-compact .order-actions,.orders-page.is-compact .order-actions>* { width: auto; }
  .orders-page.is-compact .order-ship-form .order-primary-action { width: auto; min-height: 34px; }
  .orders-page.is-compact .order-detail-link { min-height: 34px; }
  .orders-page.is-compact .order-shipped-status { width: auto; }
  .orders-page.is-compact .order-exception-warning { width: 100%; }
  .simple-shipment .shipment-review { grid-template-columns: 1fr; }
}

@media print {
  header,.footer,.print-toolbar { display:none!important; }
  body,main.wrap { background:#fff!important; max-width:none!important; margin:0!important; padding:0!important; }
  .packing-slip { page-break-after:always; border:0; margin:0; }
}

@media (max-width: 560px) {
  .checkout-item .mini-art {
    width: 48px;
    height: 48px;
  }
}

/* One standard browser zoom step for the compact admin management screens. */
body:has(.inventory-page-head),
body:has(.inventory-release-title),
body:has(.card-focus-editor) {
  zoom: 1.1;
}

.preorder-timing,
.preorder-line {
  display: block;
  margin-top: 5px;
  color: #8b5a18 !important;
  font-weight: 700;
}

.preorder-notice {
  display: grid;
  gap: 5px;
}

.preorder-notice b { font-size: 1.05rem; }
.preorder-notice span { font-weight: 800; }
.preorder-notice p { margin: 4px 0 0; }

.shipment-fields {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
  margin: 18px 0;
}

@media (max-width: 700px) {
  .shipment-fields { grid-template-columns: 1fr; }
  .admin-table { display: block; overflow-x: auto; }
}

/* Admin inventory controls are compact working controls, not storefront pills. */
body:has(.inventory-page-head) button,
body:has(.inventory-page-head) .button,
body:has(.inventory-release-title) button,
body:has(.inventory-release-title) .button {
  width: auto;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #10183d;
  border-radius: 3px;
  box-shadow: none;
  line-height: 1.15;
}

body:has(.inventory-page-head) .inventory-row-actions .button {
  background: #10183d;
  color: #fff;
}

/* Dense catalogue view: show substantially more releases without scrolling. */
body:has(.inventory-page-head) header {
  min-height: 76px;
  padding-block: 0;
}

body:has(.inventory-page-head) header .brand {
  width: 180px;
  height: 74px;
}

body:has(.inventory-page-head) .wrap {
  width: min(1420px,96vw);
}

body:has(.inventory-page-head) .inventory-page-head {
  align-items: center;
  margin-top: 12px;
}

body:has(.inventory-page-head) .inventory-page-head h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
}

body:has(.inventory-page-head) .inventory-page-head p {
  margin: 5px 0 0;
  font-size: .86rem;
}

body:has(.inventory-page-head) .inventory-filters {
  grid-template-columns: minmax(220px,1.7fr) minmax(130px,.75fr) minmax(135px,.8fr) auto;
  gap: 8px;
  margin: 12px 0;
  font-size: .82rem;
}

body:has(.inventory-page-head) .inventory-filters label {
  gap: 3px;
}

body:has(.inventory-page-head) .inventory-filters input,
body:has(.inventory-page-head) .inventory-filters select {
  min-height: 34px;
  padding: 6px 9px;
  font-size: .86rem;
}

body:has(.inventory-page-head) .inventory-table-wrap {
  border-radius: 4px;
}

body:has(.inventory-page-head) .inventory-catalogue {
  min-width: 760px;
  font-size: .86rem;
}

body:has(.inventory-page-head) .inventory-catalogue th,
body:has(.inventory-page-head) .inventory-catalogue td {
  padding: 7px 10px;
  line-height: 1.2;
}

body:has(.inventory-page-head) .inventory-row-actions {
  gap: 8px;
}

body:has(.inventory-page-head) .inventory-row-actions .button {
  min-height: 29px;
  padding: 5px 9px;
  font-size: .78rem;
}

body:has(.inventory-page-head) .variant-status {
  padding: 3px 6px;
  font-size: .64rem;
}

body:has(.inventory-page-head) .footer {
  padding-block: 18px;
}

/* Dense release editor: prioritise controls and stock over explanatory space. */
body:has(.inventory-release-title) header {
  min-height: 64px;
}

body:has(.inventory-release-title) header .brand {
  width: 155px;
  height: 62px;
}

body:has(.inventory-release-title) header nav {
  gap: 17px;
  font-size: .9rem;
}

body:has(.inventory-release-title) .inventory-release-title {
  margin: 7px 0 9px;
}

body:has(.inventory-release-title) .inventory-release-title h1 {
  font-size: clamp(1.45rem,2.4vw,2rem);
}

body:has(.inventory-release-title) .inventory-release-title .eyebrow {
  font-size: .62rem;
}

body:has(.inventory-release-title) .inventory-release-title p {
  font-size: .82rem;
}

body:has(.inventory-release-title) .admin-product-form > .admin-card:first-of-type {
  display: grid;
  grid-template-columns: auto minmax(180px,300px) auto 1fr;
  align-items: center;
  gap: 6px 14px;
  padding: 9px 14px;
}

body:has(.inventory-release-title) .admin-product-form > .admin-card:first-of-type h2 {
  margin: 0;
  font-size: 1rem;
}

body:has(.inventory-release-title) .admin-product-form > .admin-card:first-of-type label {
  margin: 0;
}

body:has(.inventory-release-title) .admin-product-form > .admin-card:first-of-type p {
  margin: 0;
  font-size: .72rem;
  color: #68718a;
}

body:has(.inventory-release-title) .admin-product-form > .admin-card:nth-of-type(2) {
  padding: 10px 14px;
}

body:has(.inventory-release-title) .admin-product-form > .admin-card:nth-of-type(2) > h2 {
  display: inline;
  margin-right: 10px;
  font-size: 1.05rem;
}

body:has(.inventory-release-title) .admin-product-form > .admin-card:nth-of-type(2) > p {
  display: inline;
  font-size: .72rem;
  color: #68718a;
}

body:has(.inventory-release-title) .inventory-variant-editor {
  margin: 8px 0;
  padding: 8px 10px;
}

body:has(.inventory-release-title) .inventory-variant-visual {
  grid-template-columns: 78px minmax(0,1fr);
  gap: 11px;
}

body:has(.inventory-release-title) .inventory-variant-image,
body:has(.inventory-release-title) .variant-image-placeholder {
  width: 78px;
}

body:has(.inventory-release-title) .inventory-variant-visual > div {
  display: grid;
  grid-template-columns: minmax(185px,.7fr) 82px minmax(430px,1.7fr);
  align-items: end;
  gap: 5px 10px;
}

body:has(.inventory-release-title) .variant-editor-heading {
  align-self: start;
  gap: 8px;
}

body:has(.inventory-release-title) .variant-editor-heading span {
  font-size: .76rem;
}

body:has(.inventory-release-title) .inventory-variant-visual > div > label {
  margin: 0;
  font-size: .72rem;
}

body:has(.inventory-release-title) .stock-editor-grid {
  grid-template-columns: repeat(2,minmax(120px,1fr)) 100px;
  gap: 7px;
  margin: 0;
}

body:has(.inventory-release-title) .stock-editor-grid label,
body:has(.inventory-release-title) .stock-editor-grid label small {
  gap: 1px;
  font-size: .68rem;
}

body:has(.inventory-release-title) .stock-editor-grid input,
body:has(.inventory-release-title) .inventory-variant-visual > div > label input {
  min-height: 31px;
  padding: 4px 7px;
}

body:has(.inventory-release-title) .stock-context {
  padding: 5px 7px;
  gap: 0;
  font-size: .7rem;
}

body:has(.inventory-release-title) .inventory-variant-visual .check-row {
  grid-column: 1 / 3;
  align-self: center;
  font-size: .76rem;
}

body:has(.inventory-release-title) .inventory-variant-visual .muted {
  grid-column: 3;
  margin: 0;
  font-size: .68rem;
  line-height: 1.25;
}

body:has(.inventory-release-title) .inventory-variant-editor > p {
  margin: 4px 0 0 89px;
  font-size: .72rem;
}

body:has(.inventory-release-title) .admin-product-form > button:last-child {
  margin: 0 0 10px;
}

@media (max-width: 950px) {
  body:has(.inventory-release-title) .admin-product-form > .admin-card:first-of-type,
  body:has(.inventory-release-title) .inventory-variant-visual > div {
    grid-template-columns: 1fr;
  }
  body:has(.inventory-release-title) .inventory-variant-visual .check-row,
  body:has(.inventory-release-title) .inventory-variant-visual .muted {
    grid-column: auto;
  }
}

.add-variant-panel {
  margin: 4px 0 14px;
}

.add-variant-panel > summary {
  list-style: none;
}

.add-variant-panel > summary::-webkit-details-marker {
  display: none;
}

.add-variant-panel[open] {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #d3d7e3;
}

.add-variant-panel[open] > summary {
  margin-bottom: 9px;
}

.add-variant-panel form {
  display: grid;
  grid-template-columns: 1.4fr 1fr .7fr .7fr auto auto;
  align-items: end;
  gap: 8px;
}

.add-variant-panel form label {
  display: grid;
  gap: 3px;
  margin: 0;
  font-size: .72rem;
  font-weight: 800;
}

.add-variant-panel form input {
  min-height: 32px;
  padding: 5px 8px;
}

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

/* Match Edit Product to the dense Inventory management scale. */
body:has(.card-focus-editor) header {
  min-height: 64px;
  padding-block: 0;
}

body:has(.card-focus-editor) header .brand {
  width: 155px;
  height: 62px;
}

body:has(.card-focus-editor) header nav {
  gap: 17px;
  font-size: .9rem;
}

body:has(.card-focus-editor) .wrap {
  width: min(1420px,96vw);
}

body:has(.card-focus-editor) main.wrap > a:first-child {
  display: inline-block;
  margin-top: 7px;
  font-size: .78rem;
}

body:has(.card-focus-editor) main.wrap > h1 {
  margin: 7px 0 10px;
  font-size: 1.75rem;
  line-height: 1;
}

body:has(.card-focus-editor) .admin-product-form {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: start;
  gap: 9px;
}

body:has(.card-focus-editor) .admin-product-form > .admin-card {
  margin: 0;
  padding: 10px 13px;
}

body:has(.card-focus-editor) .admin-card h2 {
  margin: 0 0 5px;
  font-size: 1.05rem;
}

body:has(.card-focus-editor) .admin-card p {
  margin: 3px 0 7px;
  font-size: .72rem;
  line-height: 1.3;
}

body:has(.card-focus-editor) .admin-card label {
  gap: 3px;
  margin: 6px 0;
  font-size: .72rem;
}

body:has(.card-focus-editor) input,
body:has(.card-focus-editor) select,
body:has(.card-focus-editor) textarea {
  min-height: 32px;
  padding: 5px 8px;
  font-size: .78rem;
}

body:has(.card-focus-editor) textarea {
  min-height: 56px;
}

body:has(.card-focus-editor) .card-focus-editor {
  display: grid;
  grid-template-columns: 180px minmax(0,1fr);
  align-items: center;
  gap: 5px 12px;
}

body:has(.card-focus-editor) .card-focus-editor h2,
body:has(.card-focus-editor) .card-focus-editor > p {
  grid-column: 1 / -1;
}

body:has(.card-focus-editor) .card-focus-preview {
  width: 180px;
  height: 180px;
  min-height: 0;
}

body:has(.card-focus-editor) .focus-controls {
  gap: 6px;
}

body:has(.card-focus-editor) .variant-admin {
  grid-template-columns: 1fr .75fr 1fr .75fr;
  gap: 8px;
  padding: 7px 0;
  font-size: .75rem;
}

body:has(.card-focus-editor) .admin-product-form > button:last-child {
  justify-self: start;
  width: auto;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 3px;
}

body:has(.card-focus-editor) main.wrap > .admin-card {
  margin: 9px 0;
  padding: 10px 13px;
}

body:has(.card-focus-editor) .variant-image-manager {
  grid-template-columns: 78px minmax(0,1fr);
  gap: 10px;
  padding: 7px 0;
}

body:has(.card-focus-editor) .variant-image-manager .inventory-variant-image,
body:has(.card-focus-editor) .variant-image-manager .variant-image-placeholder {
  width: 78px;
}

body:has(.card-focus-editor) .variant-image-upload {
  grid-template-columns: minmax(150px,.8fr) minmax(180px,1fr) auto;
  gap: 8px;
  padding: 4px 0;
}

body:has(.card-focus-editor) button,
body:has(.card-focus-editor) .button {
  width: auto;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 3px;
  box-shadow: none;
}

body:has(.card-focus-editor) .footer {
  padding-block: 18px;
}

@media (max-width: 850px) {
  body:has(.card-focus-editor) .admin-product-form,
  body:has(.card-focus-editor) .card-focus-editor {
    grid-template-columns: 1fr;
  }
  body:has(.card-focus-editor) .card-focus-editor h2,
  body:has(.card-focus-editor) .card-focus-editor > p {
    grid-column: auto;
  }
}
