/* Final Listing UI overrides. Code-only; this file does not touch shared DB data. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* 20260719 final-v2: dense Listing editor/ledger hardening.
   Data-safe: presentation only. */
html,
body {
  max-width: 100% !important;
  overflow-x: clip !important;
}

body:not(.home-mode):not(.purchase-mode) .app-shell,
body:not(.home-mode):not(.purchase-mode) .main-area,
body:not(.home-mode):not(.purchase-mode) .listing-workspace,
body:not(.home-mode):not(.purchase-mode) .ledger-panel,
body:not(.home-mode):not(.purchase-mode) .workflow-panel {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Ledger: fit the PC table in one viewport and keep edit/delete visible. */
body:not(.home-mode):not(.purchase-mode) .ledger-scroll {
  width: 100% !important;
  overflow-x: hidden !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table colgroup {
  display: none !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th,
body:not(.home-mode):not(.purchase-mode) .ledger-table td {
  padding: 5px 6px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(1),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(1) {
  width: 20% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(2),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(2) {
  width: 10% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(3),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(3) {
  width: 32% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(4),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(4) {
  width: 10% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(5),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(5) {
  width: 10% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(6),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(6) {
  width: 7% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(7),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(7) {
  width: 5% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(8),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(8) {
  width: 6% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-title,
body:not(.home-mode):not(.purchase-mode) .ledger-title strong {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-purchase-fields {
  display: grid !important;
  grid-template-columns: minmax(70px, 0.95fr) minmax(72px, 0.85fr) !important;
  gap: 4px !important;
  align-items: center !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table input,
body:not(.home-mode):not(.purchase-mode) .ledger-table select {
  width: 100% !important;
  min-width: 0 !important;
  height: 26px !important;
  min-height: 26px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
  border-radius: 7px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-actions {
  display: flex !important;
  gap: 3px !important;
  align-items: center !important;
  justify-content: flex-end !important;
  white-space: nowrap !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-edit,
body:not(.home-mode):not(.purchase-mode) .ledger-delete,
body:not(.home-mode):not(.purchase-mode) .ledger-actions button {
  min-width: 34px !important;
  height: 26px !important;
  min-height: 26px !important;
  padding: 2px 5px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  border-radius: 999px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-delete,
body:not(.home-mode):not(.purchase-mode) .ledger-mobile-delete {
  color: #b42318 !important;
  background: #fff7f5 !important;
  border-color: #ffd2c7 !important;
}

/* Editor sticky header stack: counts -> selected ledger row -> steps -> status. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
  position: sticky !important;
  background: #f7fbff !important;
  border-radius: 0 !important;
  margin: 0 !important;
  box-shadow: 0 1px 0 #cfe3f4 !important;
  box-sizing: border-box !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar {
  top: 0 !important;
  z-index: 80 !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 4px 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip {
  top: 34px !important;
  z-index: 79 !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) !important;
  gap: 6px !important;
  min-height: 40px !important;
  padding: 5px 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-chip {
  min-height: 30px !important;
  height: 30px !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
  border-radius: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-chip strong,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-chip .count-value {
  font-size: 20px !important;
  line-height: 1 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar {
  top: 74px !important;
  z-index: 78 !important;
  min-height: 54px !important;
  padding: 6px 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row-label {
  margin: 0 0 3px !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  color: #58718a !important;
  font-weight: 800 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row {
  display: grid !important;
  grid-template-columns: 150px 90px minmax(220px, 1fr) 86px 112px 74px 74px !important;
  gap: 5px !important;
  align-items: stretch !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-cell {
  min-width: 0 !important;
  min-height: 34px !important;
  padding: 4px 7px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-cell strong,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-title {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper {
  top: 128px !important;
  z-index: 77 !important;
  min-height: 48px !important;
  padding: 4px 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
  top: 176px !important;
  z-index: 76 !important;
  min-height: 54px !important;
  padding: 6px 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global h3,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global .status-title {
  font-size: 18px !important;
  line-height: 1.1 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-actions {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(96px, 1fr)) !important;
  gap: 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-actions button,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .status-action {
  min-height: 30px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  border-radius: 999px !important;
}

/* Compact form controls to increase information density. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .workflow-body {
  padding-top: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .step-section,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .form-card,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) fieldset {
  gap: 7px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .form-grid {
  gap: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) input,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) select,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) textarea {
  min-height: 34px !important;
  padding: 6px 10px !important;
  font-size: 14px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .purchase-card,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .purchase-info-card {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

/* AI recognition: four compact actions on one row. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .start-card,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-inline-card,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-recognition-card {
  padding: 8px !important;
  gap: 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-card-head p,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .start-card p,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-paste-hint {
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 5px !important;
  align-items: center !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row > *,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row button,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row .upload-box,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row .file-button {
  width: 100% !important;
  min-width: 0 !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row button[id*="recognize" i],
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) #recognizeSelectedBtn,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) #recognizeAiImageBtn {
  color: #fff !important;
  background: #b42318 !important;
  border-color: #b42318 !important;
  font-weight: 900 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-preview-row,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-result-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-preview-box,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-result-box {
  min-height: 42px !important;
  padding: 6px !important;
  font-size: 12px !important;
}

/* Accessories: keep text readable without clipping. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .accessory-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr)) !important;
  gap: 5px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .accessory-grid button,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) button.accessory {
  min-width: 0 !important;
  min-height: 30px !important;
  height: auto !important;
  padding: 4px 6px !important;
  font-size: 11.5px !important;
  line-height: 1.15 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
  border-radius: 8px !important;
}

/* Appearance / optics / function controls: compact but still tappable. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .condition-groups,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .option-grid,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .button-grid {
  gap: 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .condition-groups fieldset,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .choice-group,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .function-check-fieldset {
  padding: 8px !important;
  gap: 5px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .pill,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .choice-btn,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .condition-groups button {
  min-height: 30px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
  border-radius: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .note-chip-row button {
  min-height: 24px !important;
  padding: 2px 7px !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  border-radius: 999px !important;
}

/* Film/body-only visibility. Hidden fields must stay hidden for lenses/accessories. */
[data-body-only-field][hidden],
[data-body-check-field][hidden],
[data-body-function-field][hidden],
[data-lens-function-field][hidden],
[data-film-camera-field][hidden],
[data-body-only-field].is-hidden,
[data-body-check-field].is-hidden,
[data-body-function-field].is-hidden,
[data-lens-function-field].is-hidden,
[data-film-camera-field].is-hidden {
  display: none !important;
}

body:not(.listing-item-camera-body) [data-body-only-field],
body:not(.listing-item-camera-body) [data-body-check-field],
body:not(.listing-item-camera-body) [data-body-function-field],
body:not(.listing-item-film-camera) [data-film-camera-field],
body.listing-item-lens-only [data-body-only-field],
body.listing-item-lens-only [data-body-check-field],
body.listing-item-lens-only [data-body-function-field],
body.listing-item-lens-only [data-film-camera-field],
body.listing-item-accessory [data-body-only-field],
body.listing-item-accessory [data-body-check-field],
body.listing-item-accessory [data-body-function-field],
body.listing-item-accessory [data-lens-function-field],
body.listing-item-accessory [data-film-camera-field] {
  display: none !important;
}

/* Live preview: copy buttons only, preview gets the room. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-copy-stack {
  display: none !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .copy-output-details,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .html-code-details,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .copy-output-textarea:not(.live-hidden-source),
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .html-output:not(.live-hidden-source) {
  display: none !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-panel {
  padding: 8px !important;
  gap: 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin: 0 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-head .eyebrow,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-head h3 {
  margin: 0 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-head h3 {
  font-size: 18px !important;
  line-height: 1.15 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-copy-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .compact-copy,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-copy-actions button {
  min-height: 30px !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-frame-card {
  padding: 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-shell {
  min-height: 640px !important;
}

#salesReferencePanel,
.sales-reference-panel,
.sales-reference-card,
.past-sales-panel,
.sold-history-panel,
[data-section="past-sales"] {
  display: none !important;
}

@media (max-width: 700px) {
  html,
  body {
    overflow-x: hidden !important;
  }

  body:not(.home-mode):not(.purchase-mode) .app-shell {
    padding: 0 8px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .hero {
    min-height: 0 !important;
    padding: 12px 12px !important;
    border-radius: 12px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .hero h1 {
    font-size: 36px !important;
    line-height: 1 !important;
  }

  body:not(.home-mode):not(.purchase-mode) .hero p {
    display: none !important;
  }

  body:not(.home-mode):not(.purchase-mode) .hero-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .hero-actions a,
  body:not(.home-mode):not(.purchase-mode) .hero-actions button {
    min-height: 34px !important;
    padding: 5px 7px !important;
    font-size: 12px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .status-grid,
  body:not(.home-mode):not(.purchase-mode) .summary-cards {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    overflow: visible !important;
  }

  body:not(.home-mode):not(.purchase-mode) .status-card {
    min-height: 50px !important;
    padding: 6px 8px !important;
    border-radius: 8px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .status-card strong {
    font-size: 20px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-panel {
    padding: 10px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-panel-header,
  body:not(.home-mode):not(.purchase-mode) .ledger-tools {
    gap: 6px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-search {
    min-height: 34px !important;
    font-size: 13px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-panel .filters,
  body:not(.home-mode):not(.purchase-mode) .ledger-filter-row,
  body:not(.home-mode):not(.purchase-mode) .side-panel .filters {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .filter-chip,
  body:not(.home-mode):not(.purchase-mode) .filter-btn {
    min-height: 28px !important;
    padding: 3px 6px !important;
    font-size: 12px !important;
    border-radius: 999px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table,
  body:not(.home-mode):not(.purchase-mode) .ledger-table tbody {
    display: grid !important;
    width: 100% !important;
    gap: 6px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table thead {
    display: none !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table tr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 3px !important;
    margin: 0 !important;
    padding: 7px !important;
    background: #fff !important;
    border: 1px solid #cfe3f4 !important;
    border-radius: 10px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table td {
    padding: 0 !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table td:not(.ledger-title):not(.ledger-actions) {
    display: none !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table td.ledger-title {
    display: grid !important;
    gap: 4px !important;
    width: 100% !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-title,
  body:not(.home-mode):not(.purchase-mode) .ledger-title strong {
    display: block !important;
    margin: 0 0 4px !important;
    font-size: 15px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-meta {
    display: grid !important;
    grid-template-columns: 68px 70px 40px 54px 40px !important;
    gap: 4px !important;
    align-items: center !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-chip,
  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-status,
  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-edit,
  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-delete {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    height: 24px !important;
    min-height: 24px !important;
    padding: 1px 4px !important;
    font-size: 10.5px !important;
    line-height: 1 !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-status {
    background: #f6f0df !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table td.ledger-actions {
    display: none !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar {
    top: 0 !important;
    min-height: 34px !important;
    height: 34px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip {
    top: 34px !important;
    grid-template-columns: repeat(5, 78px) !important;
    overflow-x: auto !important;
    min-height: 40px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar {
    top: 74px !important;
    min-height: 56px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row {
    grid-template-columns: minmax(0, 1fr) 70px 62px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row .editor-ledger-cell:nth-child(1),
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row .editor-ledger-cell:nth-child(2),
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row .editor-ledger-cell:nth-child(5),
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row .editor-ledger-cell:nth-child(7) {
    display: none !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper {
    top: 130px !important;
    min-height: 46px !important;
    overflow-x: auto !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
    top: 176px !important;
    min-height: 54px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .purchase-card,
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .purchase-info-card,
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-preview-row,
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-result-row {
    grid-template-columns: 1fr !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .accessory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-copy-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-shell {
    min-height: 420px !important;
  }
}

/* 20260720 ledger final fit: keep date/status/actions readable after all overrides. */
body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table {
  table-layout: fixed !important;
}

body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table th:nth-child(1),
body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table td:nth-child(1) {
  width: 178px !important;
  min-width: 178px !important;
  max-width: 178px !important;
}

body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table th:nth-child(2),
body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table td:nth-child(2) {
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
}

body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table th:nth-child(7),
body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table td:nth-child(7) {
  width: 136px !important;
  min-width: 136px !important;
  max-width: 136px !important;
  text-align: center !important;
}

body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table th:nth-child(8),
body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table td:nth-child(8) {
  width: 112px !important;
  min-width: 112px !important;
  max-width: 112px !important;
  text-align: center !important;
}

body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table .ledger-date-input {
  width: 164px !important;
  min-width: 164px !important;
  max-width: 164px !important;
  box-sizing: border-box !important;
}

body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table .status-badge {
  min-width: 120px !important;
  max-width: none !important;
  padding-inline: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table .ledger-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
}

body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-table .ledger-actions button {
  min-width: 50px !important;
}

/* 20260719 final override: this block must stay at EOF so later mobile rules cannot leak into the PC ledger. */
@media (min-width: 701px) {
  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-mobile-meta,
  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-mobile-edit,
  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-mobile-delete {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-title {
    position: static !important;
    display: table-cell !important;
    overflow: hidden !important;
    vertical-align: middle !important;
  }

  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-title strong {
    display: block !important;
    margin: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-actions {
    position: static !important;
    display: flex !important;
    gap: 6px !important;
    justify-content: center !important;
    align-items: center !important;
    min-width: 104px !important;
    white-space: nowrap !important;
  }

  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-actions button {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    margin: 0 !important;
    min-height: 30px !important;
    padding: 4px 10px !important;
    font-size: 13px !important;
  }
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .sync-panel,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
  position: sticky !important;
  background: #eef8ff !important;
  box-shadow: 0 1px 0 rgba(148, 185, 210, 0.35) !important;
  transform: translateZ(0);
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar {
  top: 0 !important;
  z-index: 1250 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip {
  top: 48px !important;
  z-index: 1240 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar {
  top: 104px !important;
  z-index: 1230 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .sync-panel {
  top: 178px !important;
  z-index: 1220 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper {
  top: 246px !important;
  z-index: 1210 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
  top: 318px !important;
  z-index: 1200 !important;
}

@media (max-width: 700px) {
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar {
    top: 0 !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip {
    top: 36px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar {
    top: 78px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .sync-panel {
    top: 126px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper {
    top: 172px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
    top: 220px !important;
  }
}

/* 20260719 ledger/edit hotfix: keep mobile-only ledger controls out of PC rows. */
@media (min-width: 701px) {
  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-mobile-meta,
  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-mobile-edit,
  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-mobile-delete {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-title {
    position: static !important;
    display: table-cell !important;
    overflow: hidden !important;
    vertical-align: middle !important;
  }

  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-title strong {
    display: block !important;
    margin: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-actions {
    position: static !important;
    display: flex !important;
    gap: 6px !important;
    justify-content: center !important;
    align-items: center !important;
    min-width: 104px !important;
    white-space: nowrap !important;
  }

  body:not(.home-mode):not(.purchase-mode) #listingLedger .ledger-actions button {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    margin: 0 !important;
    min-height: 30px !important;
    padding: 4px 10px !important;
    font-size: 13px !important;
  }
}

/* 20260719 editor header hotfix: pin the editor context so the active item and step do not disappear while scrolling. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .sync-panel,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
  position: sticky !important;
  background: #eef8ff !important;
  box-shadow: 0 1px 0 rgba(148, 185, 210, 0.35) !important;
  transform: translateZ(0);
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar {
  top: 0 !important;
  z-index: 1250 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip {
  top: 48px !important;
  z-index: 1240 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar {
  top: 104px !important;
  z-index: 1230 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .sync-panel {
  top: 178px !important;
  z-index: 1220 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper {
  top: 246px !important;
  z-index: 1210 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
  top: 318px !important;
  z-index: 1200 !important;
}

@media (max-width: 700px) {
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar {
    top: 0 !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip {
    top: 36px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar {
    top: 78px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .sync-panel {
    top: 126px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper {
    top: 172px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
    top: 220px !important;
  }
}

/* 20260719 final-v3: compact ledger/editor overrides kept in one final layer. */
body:not(.home-mode):not(.purchase-mode) .ledger-panel,
body:not(.home-mode):not(.purchase-mode) .ledger-card {
  width: 100% !important;
  max-width: none !important;
  overflow: hidden !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-scroll,
body:not(.home-mode):not(.purchase-mode) .ledger-table-wrap {
  overflow-x: hidden !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th,
body:not(.home-mode):not(.purchase-mode) .ledger-table td {
  padding: 5px !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(1),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(1) {
  width: 160px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(2),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(2) {
  width: 110px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(3),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(3) {
  width: auto !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(4),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(4) {
  width: 118px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(5),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(5) {
  width: 120px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(6),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(6) {
  width: 72px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(7),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(7) {
  width: 82px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(8),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(8) {
  width: 82px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-purchase-fields {
  display: grid !important;
  grid-template-columns: minmax(70px, 1fr) minmax(68px, 1fr) !important;
  gap: 4px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-edit-input,
body:not(.home-mode):not(.purchase-mode) .ledger-order-input {
  min-height: 28px !important;
  padding: 3px 6px !important;
  font-size: 11.5px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-title strong {
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-actions {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 3px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-edit,
body:not(.home-mode):not(.purchase-mode) .ledger-delete {
  min-height: 26px !important;
  height: 26px !important;
  padding: 0 6px !important;
  font-size: 11px !important;
  white-space: nowrap !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-delete {
  color: #a32626 !important;
  border-color: #f2c6c6 !important;
  background: #fff7f7 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
  position: sticky !important;
  background: #eef8ff !important;
  box-shadow: 0 1px 0 rgba(180, 210, 230, 0.75) !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar {
  top: 0 !important;
  z-index: 210 !important;
  min-height: 36px !important;
  height: 36px !important;
  padding: 5px 12px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip {
  top: 36px !important;
  z-index: 209 !important;
  padding: 4px 10px !important;
  gap: 7px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar {
  top: 78px !important;
  z-index: 208 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  padding: 5px 10px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper {
  top: 132px !important;
  z-index: 207 !important;
  min-height: 46px !important;
  border-radius: 0 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
  top: 178px !important;
  z-index: 206 !important;
  margin: 0 !important;
  padding: 5px 10px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .form-section {
  scroll-margin-top: 232px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row {
  grid-template-columns: 126px 92px minmax(240px, 1fr) 110px 104px 88px 92px !important;
  gap: 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-cell {
  min-height: 36px !important;
  padding: 5px 7px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-cell span {
  font-size: 10px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-cell strong {
  font-size: 13px !important;
}

[data-body-only-field][hidden],
[data-body-check-field][hidden],
[data-body-function-field][hidden],
[data-lens-function-field][hidden],
[data-film-camera-field][hidden],
[data-body-only-field].is-hidden,
[data-body-check-field].is-hidden,
[data-body-function-field].is-hidden,
[data-lens-function-field].is-hidden,
[data-film-camera-field].is-hidden,
body.listing-item-lens-only [data-body-only-field],
body.listing-item-lens-only [data-body-check-field],
body.listing-item-lens-only [data-body-function-field],
body.listing-item-lens-only [data-film-camera-field],
body.listing-item-accessory [data-body-only-field],
body.listing-item-accessory [data-body-check-field],
body.listing-item-accessory [data-body-function-field],
body.listing-item-accessory [data-lens-function-field],
body.listing-item-accessory [data-film-camera-field],
body:not(.listing-item-film-camera) [data-film-camera-field],
body:not(.listing-item-body-controls) [data-body-only-field],
body:not(.listing-item-function-body-controls) [data-body-check-field],
body:not(.listing-item-function-body-controls) [data-body-function-field],
body:not(.listing-item-function-lens-controls) [data-lens-function-field] {
  display: none !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .basic-fast-card,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .form-card,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-inline-card {
  padding: 10px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .choice,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .grade,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .check-button,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .radio-card {
  min-height: 34px !important;
  padding: 5px 8px !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row > *,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row button,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row label {
  min-height: 30px !important;
  padding: 4px 7px !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}

#aiAnalyzeQueuedBtn,
#aiAnalyzeQueuedBtnAssist {
  border-color: #ef4444 !important;
  color: #991b1b !important;
  background: #fee2e2 !important;
  font-weight: 800 !important;
}

#aiAnalyzeQueuedBtn:not(:disabled),
#aiAnalyzeQueuedBtnAssist:not(:disabled) {
  color: #fff !important;
  background: #dc2626 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-paste-hint,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-inline-card .hint {
  margin: 4px 0 !important;
  font-size: 11px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-preview,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-result {
  min-height: 32px !important;
  padding: 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .accessory-grid {
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)) !important;
  gap: 4px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .accessory,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .accessory-grid button {
  min-height: 28px !important;
  padding: 3px 4px !important;
  font-size: 10.5px !important;
  line-height: 1.1 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: keep-all !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .copy-output-details,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .html-code-details,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-hidden-source,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) #salesReferencePanel {
  display: none !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-panel {
  padding: 10px !important;
  gap: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-copy-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 120px)) !important;
  justify-content: end !important;
  gap: 6px !important;
  margin: 0 0 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-copy-actions button {
  min-height: 30px !important;
  padding: 0 8px !important;
  font-size: 12px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-shell {
  min-height: 560px !important;
}

@media (max-width: 720px) {
  body:not(.home-mode):not(.purchase-mode) .ledger-status-filters {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-status-filters button {
    min-height: 28px !important;
    padding: 3px 5px !important;
    font-size: 11px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table thead {
    display: none !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table tbody {
    display: grid !important;
    gap: 6px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table tr {
    display: block !important;
    padding: 6px !important;
    border: 1px solid #cfe3f4 !important;
    border-radius: 9px !important;
    background: #fff !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table td:not(.ledger-title):not(.ledger-actions) {
    display: none !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table td.ledger-title,
  body:not(.home-mode):not(.purchase-mode) .ledger-table td.ledger-actions {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-title strong {
    margin: 0 0 4px !important;
    font-size: 13.5px !important;
    line-height: 1.18 !important;
    white-space: normal !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-meta {
    display: grid !important;
    grid-template-columns: minmax(56px, 1fr) minmax(52px, 0.9fr) auto auto auto !important;
    gap: 3px !important;
    align-items: center !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-meta > *,
  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-edit,
  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-delete {
    min-height: 22px !important;
    padding: 2px 5px !important;
    font-size: 10px !important;
    border-radius: 999px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar {
    top: 0 !important;
    min-height: 34px !important;
    height: 34px !important;
    padding: 4px 8px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip {
    top: 34px !important;
    grid-template-columns: repeat(5, 72px) !important;
    overflow-x: auto !important;
    padding: 4px 8px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar {
    top: 72px !important;
    padding: 5px 8px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row {
    grid-template-columns: minmax(0, 1fr) 68px 58px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row .editor-ledger-cell:nth-child(1),
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row .editor-ledger-cell:nth-child(2),
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row .editor-ledger-cell:nth-child(5),
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row .editor-ledger-cell:nth-child(7) {
    display: none !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper {
    top: 128px !important;
    min-height: 44px !important;
    overflow-x: auto !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
    top: 172px !important;
    padding: 5px 8px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .form-section {
    scroll-margin-top: 226px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .accessory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-copy-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

body:not(.home-mode):not(.purchase-mode) * {
  box-sizing: border-box;
}

/* Ledger: keep every action visible inside one viewport on desktop. */
body:not(.home-mode):not(.purchase-mode) .ledger-panel,
body:not(.home-mode):not(.purchase-mode) .ledger-card {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

body:not(.home-mode):not(.purchase-mode) .ledger-scroll,
body:not(.home-mode):not(.purchase-mode) .ledger-table-wrap {
  max-width: 100%;
  overflow-x: hidden !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th,
body:not(.home-mode):not(.purchase-mode) .ledger-table td {
  padding: 4px 6px !important;
  font-size: 13px !important;
  vertical-align: middle;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(1),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(1) {
  width: 20% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(2),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(2) {
  width: 9% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(3),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(3) {
  width: 31% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(4),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(4) {
  width: 10% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(5),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(5) {
  width: 9% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(6),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(6) {
  width: 7% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(7),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(7) {
  width: 6% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table th:nth-child(8),
body:not(.home-mode):not(.purchase-mode) .ledger-table td:nth-child(8) {
  width: 8% !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-table input,
body:not(.home-mode):not(.purchase-mode) .ledger-table select {
  width: 100% !important;
  min-width: 0 !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 3px 6px !important;
  font-size: 13px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-title,
body:not(.home-mode):not(.purchase-mode) .ledger-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.home-mode):not(.purchase-mode) .ledger-actions {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

body:not(.home-mode):not(.purchase-mode) .ledger-edit,
body:not(.home-mode):not(.purchase-mode) .ledger-delete,
body:not(.home-mode):not(.purchase-mode) .ledger-actions button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 42px !important;
  min-height: 28px !important;
  padding: 3px 7px !important;
  font-size: 12px !important;
}

body:not(.home-mode):not(.purchase-mode) .ledger-delete,
body:not(.home-mode):not(.purchase-mode) .ledger-mobile-delete {
  color: #b42318 !important;
}

/* Editor fixed header: counts, selected ledger row, stepper, and current status stay visible. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
  position: sticky !important;
  border-bottom: 1px solid #cfe3f4;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar {
  top: 0 !important;
  z-index: 1005;
  min-height: 40px !important;
  padding: 6px 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip {
  top: 40px !important;
  z-index: 1004;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(96px, 1fr)) !important;
  gap: 6px !important;
  padding: 6px 8px !important;
  background: #eef8ff !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-chip {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 34px !important;
  padding: 5px 8px !important;
  border-radius: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-chip span {
  font-size: 12px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-chip strong {
  font-size: 19px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar {
  top: 86px !important;
  z-index: 1003;
  padding: 6px 8px !important;
  background: #fff8d9 !important;
  border-radius: 0 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row-label {
  margin: 0 0 3px !important;
  font-size: 11px !important;
  color: #5f7386 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row {
  display: grid !important;
  grid-template-columns: 150px 92px minmax(220px, 1fr) 96px 96px 78px 78px !important;
  gap: 6px !important;
  align-items: stretch;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-cell {
  min-height: 36px !important;
  padding: 4px 7px !important;
  overflow: hidden;
  border-radius: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-cell span {
  font-size: 10px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-cell strong {
  display: block;
  overflow: hidden;
  font-size: 14px !important;
  line-height: 1.15 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper {
  top: 142px !important;
  z-index: 1002;
  min-height: 52px !important;
  padding: 6px 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .step {
  min-height: 40px !important;
  gap: 3px !important;
  padding: 3px 4px !important;
  font-size: 12px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .step span {
  width: 24px !important;
  height: 24px !important;
  font-size: 12px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
  top: 194px !important;
  z-index: 1001;
  gap: 8px !important;
  padding: 6px 8px !important;
  background: #f4fbff !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global > div:first-child {
  min-width: 118px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) #listingStatusText {
  font-size: 20px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-actions {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(90px, 1fr)) !important;
  gap: 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-btn {
  min-height: 32px !important;
  padding: 4px 8px !important;
  font-size: 13px !important;
  border-radius: 999px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .sync-panel {
  display: grid !important;
  grid-template-columns: minmax(180px, 1fr) auto !important;
  gap: 8px !important;
  padding: 6px 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .sync-note {
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .sync-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  justify-content: flex-end !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .sync-actions button {
  min-height: 30px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
}

/* Compact form controls. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .form-section {
  padding-top: 10px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .section-heading {
  margin-bottom: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .basic-grid,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .basic-card-grid {
  gap: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .basic-fast-card,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) fieldset,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .html-copy-card,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-panel {
  border-radius: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .choice-grid button,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .condition-options button,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .condition-grid button,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) fieldset button,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .type-option,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .grade-option {
  min-height: 32px !important;
  padding: 5px 9px !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
  border-radius: 8px !important;
}

/* AI recognition: keep 撮影 / 写真 / 認識 / 削除 on one compact line. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .start-card,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-drop-zone {
  gap: 8px !important;
  padding: 10px 12px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .start-card h4 {
  margin: 0 0 2px !important;
  font-size: 18px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .start-card p {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px !important;
  align-items: center;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row > *,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row button,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row .upload-box {
  width: 100% !important;
  min-width: 0 !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 3px 8px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-queue-analyze,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-recognize-btn {
  color: #fff !important;
  font-weight: 800 !important;
  background: #d92d20 !important;
  border-color: #d92d20 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-queue-analyze:disabled,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-recognize-btn:disabled {
  color: #fff !important;
  opacity: 1 !important;
  background: #f4b4ae !important;
  border-color: #f4b4ae !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-paste-hint {
  margin: 4px 0 !important;
  font-size: 12px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-preview-grid {
  gap: 6px !important;
}

/* Accessories: stop clipping and keep compact. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .accessory-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)) !important;
  gap: 5px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .accessory-grid button,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) button.accessory {
  min-width: 0 !important;
  min-height: 30px !important;
  height: auto !important;
  padding: 4px 6px !important;
  overflow: visible !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
  text-overflow: clip !important;
  white-space: normal !important;
  border-radius: 7px !important;
}

/* Photo folder import: make the folder-first workflow compact and visible. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .photo-url-list {
  gap: 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .photo-url-row {
  gap: 6px !important;
  padding: 6px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .photo-folder-note {
  font-size: 12px !important;
}

/* Backstop for item-type-specific fields. */
body.listing-item-lens-only [data-body-only-field],
body.listing-item-lens-only [data-body-check-field],
body.listing-item-lens-only [data-body-function-field],
body.listing-item-lens-only [data-film-camera-field],
body.listing-item-accessory [data-body-only-field],
body.listing-item-accessory [data-body-check-field],
body.listing-item-accessory [data-body-function-field],
body.listing-item-accessory [data-lens-function-field],
body.listing-item-accessory [data-film-camera-field],
body:not(.listing-item-film-camera) [data-film-camera-field] {
  display: none !important;
}

/* Summary/output: only copy actions stay visible; use the space for preview. */
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .copy-output-details,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .html-code-details,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) #salesReferencePanel,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .sales-reference-panel {
  display: none !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-copy-stack {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .html-copy-card {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 44px !important;
  gap: 8px !important;
  padding: 8px 10px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .html-copy-card h4,
body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .html-copy-card p {
  margin: 0 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .html-copy-card p {
  display: none !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .compact-copy {
  min-height: 32px !important;
  padding: 5px 12px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-panel {
  gap: 8px !important;
  padding: 10px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 0 !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-head h3 {
  margin: 0 !important;
  font-size: 20px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-copy-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-frame-card {
  padding: 8px !important;
}

body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-shell {
  min-height: 560px !important;
}

@media (max-width: 700px) {
  body:not(.home-mode):not(.purchase-mode) .app-shell {
    padding: 0 8px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .hero {
    min-height: 0 !important;
    padding: 16px 14px !important;
    border-radius: 12px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .hero h1 {
    font-size: 40px !important;
    line-height: 1 !important;
  }

  body:not(.home-mode):not(.purchase-mode) .hero p {
    display: none !important;
  }

  body:not(.home-mode):not(.purchase-mode) .hero-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .hero-actions a,
  body:not(.home-mode):not(.purchase-mode) .hero-actions button {
    min-height: 36px !important;
    padding: 5px 8px !important;
    font-size: 13px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .status-grid,
  body:not(.home-mode):not(.purchase-mode) .summary-cards {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    overflow: visible !important;
  }

  body:not(.home-mode):not(.purchase-mode) .status-card {
    min-height: 54px !important;
    padding: 7px 8px !important;
    border-radius: 8px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .status-card strong {
    font-size: 20px !important;
  }

  /* Mobile ledger cards: title plus compact one-line controls. */
  body:not(.home-mode):not(.purchase-mode) .ledger-table {
    display: block !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table thead {
    display: none !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table tbody {
    display: grid !important;
    gap: 6px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table tr {
    display: block !important;
    margin: 0 !important;
    padding: 8px !important;
    background: #fff !important;
    border: 1px solid #cfe3f4 !important;
    border-radius: 10px !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table td:not(.ledger-title):not(.ledger-actions) {
    display: none !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-table td.ledger-title,
  body:not(.home-mode):not(.purchase-mode) .ledger-table td.ledger-actions {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-title,
  body:not(.home-mode):not(.purchase-mode) .ledger-title strong {
    display: block !important;
    margin: 0 0 6px !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-meta {
    display: grid !important;
    grid-template-columns: minmax(72px, 1fr) minmax(82px, 1fr) auto auto auto !important;
    gap: 4px !important;
    align-items: center !important;
  }

  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-meta > *,
  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-edit,
  body:not(.home-mode):not(.purchase-mode) .ledger-mobile-delete {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 24px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    border-radius: 999px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-editor-toolbar {
    top: 0 !important;
    min-height: 36px !important;
    height: 36px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-count-strip {
    top: 36px !important;
    grid-template-columns: repeat(5, 82px) !important;
    overflow-x: auto !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-selected-item-bar {
    top: 78px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row {
    grid-template-columns: minmax(0, 1fr) 74px 64px !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row .editor-ledger-cell:nth-child(1),
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row .editor-ledger-cell:nth-child(2),
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row .editor-ledger-cell:nth-child(5),
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .editor-ledger-row .editor-ledger-cell:nth-child(7) {
    display: none !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .stepper {
    top: 138px !important;
    min-height: 48px !important;
    overflow-x: auto !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-panel--global {
    top: 186px !important;
    display: block !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-status-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .sync-panel {
    grid-template-columns: 1fr !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .ai-action-row {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .accessory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .listing-copy-stack,
  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-copy-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.listing-editor-mode:not(.home-mode):not(.purchase-mode) .live-preview-shell {
    min-height: 420px !important;
  }
}
body.safety-test-mode::before {
  content: "安全確認モード / 共有DB通信なし / テスト商品2件";
  display: block;
  position: sticky;
  top: 0;
  z-index: 10000;
  box-sizing: border-box;
  width: 100%;
  padding: 10px 16px;
  border-bottom: 2px solid #f5c542;
  background: #7a2500;
  color: #ffffff;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}
