.commerce-tools { min-height: 70vh; padding-block: 24px 64px; letter-spacing: 0; }
.commerce-tools * { letter-spacing: 0; }
.ct-heading, .ct-actions, .ct-status-line { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.ct-heading h1 { font-size: 1.6rem; line-height: 1.3; margin: 0; }
.commerce-tools h2 { font-size: 1.25rem; margin: 0 0 12px; line-height: 1.35; }
.commerce-tools h3 { font-size: 1rem; margin: 0 0 10px; }
.ct-actions { justify-content: flex-start; }
.ct-actions a, .ct-footer a { color: var(--cyan); font-size: .85rem; text-underline-offset: 3px; }
.ct-tabs { position: sticky; top: var(--site-header-height, 82px); z-index: 40; display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-block: -24px 24px; overflow-x: auto; background: rgba(5,6,21,.97); padding-block: 8px; }
.ct-tabs a { flex: 0 0 auto; padding: 12px 16px; border-bottom: 3px solid transparent; color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 750; }
.ct-tabs a[aria-current="page"] { border-color: var(--electric); color: var(--electric); }
.ct-status-line { min-height: 64px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.ct-status-line p { flex: 1; margin: 0; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.ct-status-line p[data-state="error"], .ct-error { color: #ff9aac; }
.ct-status-line p[data-state="success"] { color: var(--mint); }
.ct-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 1px solid var(--line); border-radius: 5px; background: #111321; color: var(--ink); padding: 9px 13px; font: inherit; font-size: .82rem; font-weight: 750; cursor: pointer; text-decoration: none; text-align: center; }
.ct-button.ct-primary { color: #050615; background: var(--electric); border-color: var(--electric); }
.ct-button:hover:enabled { border-color: var(--cyan); }
.ct-icon { width: 42px; height: 42px; padding: 0; flex: 0 0 42px; font-size: 1.3rem; }
.commerce-tools :is(a,button,input,select,textarea):focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.commerce-tools :disabled { opacity: .5; cursor: not-allowed; }
.ct-form { display: grid; gap: 14px; margin-block: 16px 24px; }
.ct-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.ct-fields.ct-four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.ct-form label, .ct-field { display: grid; gap: 6px; font-size: .78rem; color: var(--muted); font-weight: 700; min-width: 0; }
.commerce-tools :is(input,select,textarea) { width: 100%; min-width: 0; min-height: 44px; padding: 9px 10px; color: var(--ink); background: #080a12; border: 1px solid var(--line); border-radius: 5px; font: inherit; font-size: .88rem; }
.commerce-tools textarea { resize: vertical; }
.commerce-tools option { background: #080a12; }
.ct-muted, .ct-empty { font-size: .83rem; color: var(--muted); line-height: 1.6; }
.ct-warning { color: var(--gold); font-size: .84rem; line-height: 1.6; }
.ct-warning a { color: inherit; }
.ct-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: 32px; }
.ct-list { display: grid; gap: 12px; margin-block: 16px; }
.ct-record { border: 1px solid var(--line); border-radius: 6px; padding: 16px; min-width: 0; background: rgba(8,10,18,.6); }
.ct-record p { margin: 6px 0 12px; }
.ct-record strong, .ct-record p, .ct-record a, .ct-heading, .ct-summary dd { overflow-wrap: anywhere; }
.ct-section { padding-block: 20px; border-top: 1px solid var(--line); min-width: 0; }
.ct-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-block: 1px solid var(--line); margin: 14px 0; }
.ct-summary > div { min-width: 0; padding: 12px 10px; }
.ct-summary dt { color: var(--muted); font-size: .74rem; }
.ct-summary dd { margin: 4px 0 0; font-size: 1rem; font-weight: 800; color: var(--mint); }
.ct-line-editor { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 75px 42px; gap: 8px; align-items: end; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ct-line-editor label:first-child { grid-column: span 2; }
.ct-line-editor label:nth-child(3) { grid-column: 1 / 3; grid-row: 2; }
.ct-line-editor label:nth-child(4) { grid-column: 3 / 5; grid-row: 2; }
.ct-line-editor .ct-icon { grid-column: 4; grid-row: 1; }
.ct-offer-line { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.6fr) 80px 42px; gap: 10px; align-items: end; padding-block: 10px; border-bottom: 1px solid var(--line); }
.ct-mode { border: 0; padding: 0; margin: 0 0 20px; display: flex; gap: 16px; }
.ct-mode label { display: flex; gap: 8px; align-items: center; font-size: .85rem; }
.ct-mode input { width: 18px; min-height: 18px; accent-color: var(--cyan); }
.ct-item { display: grid; grid-template-columns: 60px minmax(0,1fr) auto; gap: 12px; align-items: center; padding-block: 12px; border-bottom: 1px solid var(--line); }
.ct-item img { width: 60px; height: 84px; object-fit: contain; background: #030407; }
.ct-item p { margin: 4px 0; }
.ct-item:not(:has(img)) { grid-template-columns: minmax(0,1fr) auto; }
.ct-item input { width: 84px; }
.ct-packing-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 32px; }
.ct-order-list { display: grid; align-content: start; gap: 8px; margin-block: 12px; }
.ct-order-list button { display: block; text-align: left; width: 100%; overflow-wrap: anywhere; }
.ct-order-list button[aria-pressed="true"] { border-color: var(--mint); }
.ct-order-list small { display: block; color: var(--muted); }
.ct-progress { width: 100%; height: 10px; accent-color: var(--mint); }
.ct-unexpected { display: flex; align-items: center; gap: 8px; color: #ff9aac; font-size: .84rem; margin-block: 8px; overflow-wrap: anywhere; }
.ct-search { display: flex; gap: 8px; align-items: end; margin-block: 16px; }
.ct-search label { flex: 1; min-width: 0; }
.ct-stock-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.ct-qr { display: grid; gap: 12px; grid-template-columns: 140px minmax(0,1fr); align-items: center; margin-top: 14px; }
.ct-qr img { width: 140px; height: 140px; background: white; }
.ct-qr input { font-size: .75rem; }
.ct-detail { display: grid; grid-template-columns: minmax(180px,.7fr) minmax(0,1fr); gap: 32px; }
.ct-product-photo { width: 100%; height: 400px; object-fit: contain; background: #030407; }
.ct-photo { max-width: 100%; width: 300px; height: 200px; object-fit: contain; margin-block: 12px; }
.ct-dialog { color: var(--ink); background: #080a12; border: 1px solid var(--line); border-radius: 6px; width: min(520px,calc(100% - 24px)); padding: 16px; }
.ct-dialog::backdrop { background: rgba(0,0,0,.8); }
.ct-dialog video { display: block; width: 100%; aspect-ratio: 4/3; background: #000; margin-top: 12px; }
.ct-footer { display: flex; gap: 20px; flex-wrap: wrap; padding-block: 24px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
@media (max-width: 900px) {
  .ct-split, .ct-packing-layout { grid-template-columns: 1fr; }
  .ct-order-list { grid-template-columns: repeat(2,minmax(0,1fr)); max-height: 230px; overflow: auto; }
}
@media (max-width: 600px) {
  .commerce-tools { padding-top: 24px; }
  .ct-tabs a { font-size: .78rem; padding-inline: 10px; }
  .ct-fields, .ct-stock-grid, .ct-detail { grid-template-columns: 1fr; }
  .ct-fields.ct-four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ct-offer-line { grid-template-columns: minmax(0,1fr) 72px 42px; }
  .ct-offer-line label:first-child { grid-column: 1 / -1; }
  .ct-line-editor { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 42px; }
  .ct-line-editor label:first-child { grid-column: 1 / 3; }
  .ct-line-editor label:nth-child(2) { grid-column: 1; grid-row: 2; }
  .ct-line-editor label:nth-child(3) { grid-column: 1 / -1; grid-row: 3; }
  .ct-line-editor label:nth-child(4) { grid-column: 2 / 4; grid-row: 2; }
  .ct-line-editor .ct-icon { grid-column: 3; }
  .ct-summary { grid-template-columns: 1fr; }
  .ct-summary > div { padding: 8px 0; display: flex; justify-content: space-between; gap: 12px; }
  .ct-summary dd { margin: 0; }
  .ct-product-photo { height: 300px; }
  .ct-search { flex-wrap: wrap; }
  .ct-search label { flex-basis: calc(100% - 60px); }
  .ct-qr { grid-template-columns: 100px minmax(0,1fr); }
  .ct-qr img { width: 100px; height: 100px; }
}
@media print {
  body { background: white; color: black; }
  .site-header, .ct-tabs, .ct-status-line, .ct-footer, .ct-search, .ct-record .ct-actions, .ct-heading { display: none; }
  .ct-record { break-inside: avoid; background: white; color: black; border-color: #999; }
  .ct-record p { color: black; }
  .ct-stock-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
