/* Common offer/inventory interactions across every marketplace and theme. */
html[data-theme] .ui-modal.offer-price-only .modal-surface { max-width:640px; }
html[data-theme] .offer-price-only .offer-card-heading { min-height:44px; padding-right:56px; margin-bottom:16px; }
html[data-theme] .offer-price-only :is(.offer-card-facts,.offer-card-inventory,.offer-card-availability,.offer-card-tools,#k4g-offer-capability-note) { display:none !important; }
html[data-theme] #g2a-offer-dialog.offer-price-only .offer-card-availability { display:block !important; }
html[data-theme] #g2a-offer-dialog.offer-price-only :is(.offer-card-availability h3,#g2a-activate,#g2a-deactivate) { display:none !important; }
html[data-theme] #g2a-offer-dialog.offer-price-only .offer-card-availability:not(:has(#g2a-job-check:not([hidden]))) { display:none !important; }
html[data-theme] .offer-price-only .offer-read-state:empty { display:none !important; }
html[data-theme] .offer-quick-price-limit { display:none; }
html[data-theme] .offer-price-only .offer-quick-price-limit { display:block; grid-column:1/-1; margin:0; }
html[data-theme] .offer-price-link { font:inherit; font-variant-numeric:tabular-nums; text-align:left; white-space:nowrap; }
html[data-theme] [data-open-bound-inventory] { margin-left:8px; }
html[data-theme] .inventory-choice-list { display:flex; flex-direction:column; gap:4px; max-height:340px; overflow:auto; padding:6px; }
html[data-theme] .inventory-choice-row { display:grid; flex:0 0 auto; grid-template-columns:minmax(180px,1fr) auto 64px; gap:14px; align-items:center; width:100%; min-height:44px; padding:10px 12px; text-align:left; font:inherit; font-size:12px; color:var(--ui-text,#273242); background:var(--ui-surface,#fff); border:1px solid var(--ui-border,#dbe5e8); border-radius:var(--ui-radius,12px); cursor:pointer; }
html[data-theme] .inventory-choice-row:hover:not(:disabled),html[data-theme] .inventory-choice-row.selected { border-color:var(--ui-accent,#6849db); background:var(--ui-surface-alt,#f2eefb); }
html[data-theme] .inventory-choice-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
html[data-theme] .inventory-choice-stats { display:flex; gap:14px; color:var(--ui-muted,#52636c); }
html[data-theme] .inventory-choice-stats>span { display:flex; gap:5px; white-space:nowrap; }
html[data-theme] .inventory-choice-stats b { color:var(--ui-text,#273242); font-weight:600; }
html[data-theme] .inventory-choice-check { color:var(--ui-accent,#6849db); font-weight:600; text-align:right; }
html[data-theme] .inventory-choice-row:disabled { opacity:.65; cursor:default; }
html[data-theme] .inventory-binding-surface .binding-current-card { padding:14px 16px; margin:0; }
html[data-theme] .ui-modal .inventory-binding-surface > h2 { min-height:44px; margin:0 0 16px; padding-right:60px; line-height:1.3; }
html[data-theme] .ui-modal .inventory-binding-surface .pagination { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin:14px 0 0; min-height:44px; }
html[data-theme] .ui-modal .inventory-binding-surface .pagination > .button { margin:0; flex:0 0 auto; }
html[data-theme] .inventory-binding-body { display:contents; }
html[data-theme] .inventory-binding-surface .binding-current-card p { margin:8px 0 0; }
html[data-theme] .inventory-binding-surface .binding-search-label { display:grid; gap:8px; margin-block:14px; }
html[data-theme] .inventory-binding-surface .binding-save-bar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:16px; }
html[data-theme] .inventory-binding-surface .binding-save-bar .help { flex:1 1 100%; margin:0; }
html[data-theme] .binding-read-status { min-height:1.5em; margin:8px 0; font-size:12px; color:var(--ui-muted,#52636c); }
html[data-theme] .binding-read-status.error { color:var(--ui-danger,#a52334); }
html[data-theme] :is(#kinguin-offer-dialog,#eneba-offer-dialog,#k4g-offer-dialog,#g2a-offer-dialog) .offer-card .offer-read-state { min-height:22px; border:0; padding:0; margin:8px 0 0; font-size:12px; line-height:22px; }
html[data-theme] .offer-card .offer-read-state p { margin:0; }
html[data-theme] .offer-card .offer-read-skeleton { display:none; }
html[data-theme] .offer-card .offer-pricing-quota { min-height:1.45em; }
html[data-theme] .ui-modal .offer-card .offer-pricing-feedback { min-height:1.5em; display:block; margin:8px 0; }
html[data-theme] .ui-modal .offer-card .offer-pricing-feedback:empty { display:block; }
html[data-theme] .ui-modal:has(.offer-card) { align-items:start; padding-top:24px; padding-bottom:24px; }
html[data-theme] .catalog-toolbar.list-toolbar { flex-wrap:wrap; }
html[data-theme] .catalog-toolbar.list-toolbar>label { flex:1 1 260px; min-width:0; }
html[data-theme] .catalog-toolbar.list-toolbar>button { flex:0 0 auto; white-space:nowrap; }
html[data-theme] .catalog-toolbar.list-toolbar>.list-filters { flex:1 1 100%; }
html[data-theme] .list-filters { display:flex; align-items:end; gap:12px; flex-wrap:wrap; width:100%; margin-top:12px; }
html[data-theme] .list-filter-control { display:grid; gap:6px; min-width:145px; flex:1 1 145px; font-size:12px; }
html[data-theme] .list-filter-control select { width:100%; min-height:40px; }
html[data-theme] .list-page-size { display:flex; align-items:center; gap:8px; margin-left:auto; font-size:12px; white-space:nowrap; }
html[data-theme] .list-page-size select { width:76px; min-height:40px; }
html[data-theme] .offer-stock-cell { line-height:1.45; }
html[data-theme] .stock-sync-note { color:var(--ui-muted,#52636c); }
html[data-theme] #feedback:not([hidden]) { position:fixed; z-index:1200; inset:16px 24px auto auto; width:max-content; max-width:min(600px,calc(100vw - 48px)); margin:0; padding:12px 18px; box-shadow:0 5px 24px #0002; }
html[data-theme] #g2a-price-form.g2a-dual-pricing { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px; }
html[data-theme] .g2a-price-column { min-width:0; display:grid; gap:12px; align-content:start; }
html[data-theme] .g2a-price-column h4 { margin:0; }
html[data-theme] .g2a-price-column label { display:grid; gap:8px; min-width:0; }
html[data-theme] .g2a-price-column input { width:100%; min-width:0; }
html[data-theme] .g2a-price-column .g2a-income { margin:0; min-height:3em; overflow-wrap:anywhere; }
html[data-theme] .g2a-pricing-note { grid-column:1/-1; margin:0; }
html[data-theme] .g2a-price-stack { display:grid; gap:6px; }
html[data-theme] .g2a-price-stack>div { display:flex; align-items:baseline; gap:8px; }
html[data-theme] .g2a-price-stack small { color:var(--ui-muted); min-width:52px; }
@media(max-width:900px) {
  html[data-theme] .inventory-choice-row { grid-template-columns:minmax(0,1fr) 64px; gap:6px 10px; }
  html[data-theme] .inventory-choice-stats { grid-column:1; grid-row:2; gap:12px; flex-wrap:wrap; font-size:11px; }
  html[data-theme] .inventory-choice-check { grid-column:2; grid-row:1 / span 2; }
}
@media(max-width:480px) {
  html[data-theme] .inventory-choice-list { max-height:300px; }
  html[data-theme] .inventory-choice-row { padding:10px; }
  html[data-theme] .inventory-choice-stats { gap:5px 12px; }
  html[data-theme] #feedback:not([hidden]) { inset:12px 12px auto; max-width:calc(100vw - 24px); width:auto; }
}

@media(max-width:600px) { html[data-theme] [data-open-bound-inventory] { margin-left:0; margin-top:8px; } }

@media(max-width:600px) { html[data-theme] #g2a-price-form.g2a-dual-pricing { gap:12px; padding:12px; } html[data-theme] .g2a-price-column input { font-size:16px; } }
/* One semantic status palette in lists and offer cards, across all themes. */
html[data-theme] .offer-status { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 1.45; color: var(--ui-muted); background: var(--ui-surface-alt); white-space: normal; }
html[data-theme] .offer-status-active { color: var(--ui-success); background: var(--ui-success-bg); }
html[data-theme] .offer-status-blocked { color: var(--ui-danger); background: var(--ui-danger-bg); }
html[data-theme] .offer-status-pending { color: var(--ui-warning); background: var(--ui-warning-bg); }
html[data-theme] .offer-status-complete { color: #2453a0; background: #eaf1ff; }
/* Hover is distinct from the filled current-account selection. */
html[data-theme] #workspace-sidebar .nav-submenu .nav-subitem:not(.active):hover { background: transparent; text-decoration: underline; text-underline-offset: 3px; }

/* Every marketplace account uses the same full-width selection target. */
html[data-theme] #workspace-sidebar .nav-submenu > div:not(.marketplace-navigation-heading) { width: 100%; }
html[data-theme] #workspace-sidebar .nav-submenu .nav-subitem { width: 100%; max-width: none; flex: none; }
/* Graphite uses a horizontal desktop navigation; account groups must not
   inherit the full-width rows used by the other themes' sidebars. */
@media (min-width: 1181px) {
  html[data-theme="graphite"] #workspace-sidebar .nav-submenu > div:not(.marketplace-navigation-heading) { width: auto; display: flex; flex-wrap: wrap; gap: 5px; }
  html[data-theme="graphite"] #workspace-sidebar .nav-submenu .nav-subitem { width: auto; flex: 0 1 auto; }
}

/* Desktop columns size to their contents instead of crushing actions and money. */
@media (min-width: 1181px) {
  html[data-theme] :is(#marketplace-offer-list, #eneba-stock-list, #k4g-offer-list, #g2a-offer-list) table.responsive-table { table-layout: auto !important; min-width: 940px; }
  html[data-theme] :is(#marketplace-offer-list, #eneba-stock-list, #k4g-offer-list, #g2a-offer-list) table.responsive-table :is(th, td):nth-child(n) { width: auto; }
  html[data-theme] :is(#marketplace-offer-list, #eneba-stock-list, #k4g-offer-list) table.responsive-table :is(th, td):first-child { min-width: 220px; width: 240px !important; }
  html[data-theme] :is(#marketplace-offer-list, #eneba-stock-list, #k4g-offer-list, #g2a-offer-list) :is(.offer-status, .inventory-binding-link) { word-break: normal; overflow-wrap: normal; }
  html[data-theme] :is(#marketplace-offer-list, #eneba-stock-list, #k4g-offer-list, #g2a-offer-list) .offer-status { white-space: nowrap; }
  html[data-theme] :is(#marketplace-offer-list, #eneba-stock-list, #k4g-offer-list, #g2a-offer-list) .offer-price-link { white-space: nowrap; }
  html[data-theme] :is(#marketplace-offer-list, #eneba-stock-list, #k4g-offer-list, #g2a-offer-list) .inventory-binding-link { min-width: 110px; }
  html[data-theme] #g2a-offer-list table.responsive-table :is(th, td):nth-child(2) { min-width: 160px; }
}

/* Two price lines need one compact desktop row, not two touch-size rows. */
@media (min-width: 1181px) {
  html[data-theme] #g2a-offer-list .g2a-price-stack { gap: 2px; }
  html[data-theme] #g2a-offer-list .g2a-price-stack > div { align-items: center; min-height: 22px; }
  html[data-theme] #g2a-offer-list .g2a-price-stack .offer-price-link { min-height: 22px; padding: 0 2px; line-height: 20px; }
}

html[data-theme] .offer-account-stock-mode { margin: 6px 0 0; font-size: 12px; line-height: 1.4; color: var(--ui-muted); }
html[data-theme] .offer-account-stock-mode[data-mode="on"] { color: var(--ui-success); }
html[data-theme] .offer-account-stock-mode[data-mode="blocked"] { color: var(--ui-danger); }

html[data-theme] .offer-inventory-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
html[data-theme] .offer-inventory-actions > .button { margin:0 !important; min-height:44px; width:auto; }
html[data-theme] .binding-current-card .offer-inventory-actions { margin-top:8px; }
html[data-theme] .inventory-unbind-button { background:#ffe9ec; color:#a52334; border-color:#efb5bd; }
html[data-theme] .inventory-unbind-button:hover:not(:disabled) { background:#ffdade; border-color:#df8d99; color:#8c1727; }

/* A long product title must leave room for the mobile picker and its actions.
   Its complete text remains in the dialog's accessible heading. */
@media (max-width: 1180px) {
  html[data-theme] .ui-modal .modal-surface > :is(h2,h3),
  html[data-theme] .ui-modal .modal-surface > .detail-heading > :is(h2,h3) {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
    overflow: hidden; overflow-wrap: anywhere;
  }
  html[data-theme="retro"] .ui-modal .modal-surface > :is(h2,h3) { padding-top: 0; padding-bottom: 0; min-height: 44px; }
}

html[data-theme] :is(#offers,#eneba,#k4g,#g2a) .section-heading .offer-account-stock-mode:not([hidden]) { display: block !important; }

/* Keep monetary values intact while retaining 44px tablet touch targets. */
html[data-theme] #g2a-offer-list .g2a-price-stack .offer-price-link { white-space: nowrap; word-break: normal; overflow-wrap: normal; flex-shrink: 0; }
@media (min-width: 641px) and (max-width: 1180px) {
  html[data-theme] #g2a-offer-list table.responsive-table :is(th, td):first-child { width: 26%; }
  html[data-theme] #g2a-offer-list table.responsive-table :is(th, td):nth-child(2) { width: 18%; }
}
