/* Amazon Seller — Listing Photos (.alp-*)
 * Visual language mirrors the Message Templates / Evri Claims modules (soft cards,
 * teal→blue gradient, 1.5px borders). Desktop layout is unchanged from that
 * language; mobile adaptations are gated at max-width:1180px and never scroll
 * horizontally (the history is a stack of cards, not a wide table).
 */

:root {
  --alp-primary: #0588b6;
  --alp-primary-d: #03658e;
  --alp-grad: linear-gradient(135deg, #03658e, #0588b6);
  --alp-ink: #0f2740;
  --alp-sub: #5b7183;
  --alp-line: #e6edf5;
  --alp-line-s: #cfdcea;
  --alp-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.alp-page { background: transparent; }
.alp-wrap { max-width: 1180px; margin: 0 auto; padding: 6px 4px 40px; }
.alp-wrap * { box-sizing: border-box; }

/* ---- header ---- */
.alp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 4px 0 16px; }
.alp-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--alp-primary); }
.alp-title { font-size: 25px; font-weight: 800; color: var(--alp-ink); margin: 4px 0; line-height: 1.15; }
.alp-sub { font-size: 13.5px; color: var(--alp-sub); margin: 0; max-width: 640px; line-height: 1.5; }
.alp-head-actions { display: flex; align-items: center; gap: 10px; }

/* ---- buttons ---- */
.alp-btn {
  appearance: none; border: 1.5px solid var(--alp-line-s); background: #fff; color: #21506f;
  font-size: 13px; font-weight: 700; padding: 9px 15px; border-radius: 11px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: .15s; white-space: nowrap;
}
.alp-btn:hover { border-color: var(--alp-primary); color: var(--alp-primary); }
.alp-btn.primary { border: none; color: #fff; background: var(--alp-grad); box-shadow: 0 8px 18px rgba(5, 136, 182, .28); }
.alp-btn.primary:hover { filter: brightness(1.05); color: #fff; }
.alp-btn.slim { padding: 6px 12px; font-size: 12.5px; }
.alp-btn:disabled { opacity: .55; cursor: default; }
.alp-link { border: none; background: none; color: var(--alp-primary); font-weight: 700; cursor: pointer; font-size: 12.5px; }
.alp-link:hover { text-decoration: underline; }

/* ---- cards / steps ---- */
.alp-card { background: #fff; border: 1.5px solid var(--alp-line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--alp-shadow); margin-bottom: 16px; }
.alp-step { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 800; color: var(--alp-ink); margin-bottom: 14px; }
.alp-step.no-mb { margin-bottom: 0; }
.alp-step-n { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; background: var(--alp-grad); color: #fff; font-size: 12.5px; font-weight: 800; }

/* ---- form rows ---- */
.alp-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.alp-field { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.alp-field.alp-grow { flex: 1 1 260px; }
.alp-field.alp-field-btn { justify-content: flex-end; }
.alp-field label { font-size: 12px; font-weight: 800; color: #45607a; letter-spacing: .01em; }
.alp-field input, .alp-field select {
  width: 100%; height: 40px; border: 1.5px solid var(--alp-line-s); border-radius: 10px; padding: 0 12px;
  font-size: 13.5px; font-family: inherit; color: var(--alp-ink); background: #fbfdff;
}
.alp-field input[type=file] { padding: 8px 12px; height: auto; }
.alp-field input:focus, .alp-field select:focus { outline: none; border-color: var(--alp-primary); box-shadow: 0 0 0 3px rgba(5, 136, 182, .14); }
.alp-hint { font-size: 11.8px; color: #90a3b6; margin: 10px 0 0; line-height: 1.5; }
.alp-hint.no-mt { margin-top: 4px; margin-bottom: 12px; }
.alp-muted { color: #7c90a4; }

.alp-note { margin-top: 14px; font-size: 13px; color: #4a637b; background: #f5f9fc; border: 1.5px solid var(--alp-line); border-radius: 11px; padding: 11px 13px; line-height: 1.5; }
.alp-note.err { color: #b23a32; background: #fdecea; border-color: #f6cfcb; }

/* ---- SKU picker ---- */
.alp-sku-list { margin-top: 15px; display: flex; flex-direction: column; gap: 8px; }
.alp-sku-lead { font-size: 12.5px; color: var(--alp-sub); margin-bottom: 2px; }
.alp-sku {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border: 1.5px solid var(--alp-line-s); background: #fff; border-radius: 12px; padding: 11px 14px; transition: .13s; font: inherit;
}
.alp-sku:hover { border-color: var(--alp-primary); background: #f7fbfe; }
.alp-sku.on { border-color: var(--alp-primary); background: #eef7fc; box-shadow: 0 0 0 3px rgba(5, 136, 182, .12); }
.alp-sku-radio { font-size: 15px; color: var(--alp-primary); line-height: 1; }
.alp-sku-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.alp-sku-code { font-size: 13.5px; font-weight: 800; color: var(--alp-ink); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.alp-sku-title { font-size: 12px; color: #6d8298; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alp-sku-tags { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.alp-acct { font-size: 11px; font-weight: 800; color: #6b52a6; background: #f3f0fb; border: 1px solid #e6dff6; padding: 2px 8px; border-radius: 999px; }
.alp-status { font-size: 11px; font-weight: 700; color: #8a97a6; background: #f1f2f4; border: 1px solid #e3e6ea; padding: 2px 8px; border-radius: 999px; text-transform: capitalize; }
.alp-status.ok { color: #2f8f52; background: #eefaf1; border-color: #d8f0df; }

.alp-chosen { font-size: 13px; color: var(--alp-ink); background: #f7fbfe; border: 1.5px solid var(--alp-line); border-radius: 11px; padding: 10px 13px; margin-bottom: 14px; }

/* ---- history ---- */
.alp-hist-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.alp-jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.alp-job { border: 1.5px solid var(--alp-line); border-radius: 13px; padding: 12px 13px; background: #fff; }
.alp-job-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.alp-job-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.alp-thumb { width: 42px; height: 42px; border-radius: 9px; background-size: cover; background-position: center; border: 1px solid var(--alp-line-s); flex-shrink: 0; display: block; }
.alp-thumb.empty { background: #eef3f8; }
.alp-job-sku { font-size: 13px; font-weight: 800; color: var(--alp-ink); font-family: ui-monospace, "SF Mono", Menlo, monospace; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.alp-slotchip { font-size: 10.5px; font-weight: 700; color: #2d6b8f; background: #eef5fb; border: 1px solid #dcecf6; padding: 2px 7px; border-radius: 999px; font-family: system-ui, sans-serif; }
.alp-job-meta { font-size: 11.5px; color: #90a3b6; margin-top: 3px; }
.alp-badge { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: #eef5fb; color: #2d6b8f; border: 1px solid #dcecf6; }
.alp-badge.ok { background: #eefaf1; color: #1f7a47; border-color: #d3edda; }
.alp-badge.warn { background: #fff6e6; color: #a86a12; border-color: #f3e2bf; }
.alp-badge.err { background: #fdecea; color: #b23a32; border-color: #f6cfcb; }
.alp-job-err { margin-top: 9px; font-size: 12px; color: #b23a32; background: #fdecea; border: 1px solid #f6cfcb; border-radius: 9px; padding: 7px 10px; line-height: 1.45; word-break: break-word; }
.alp-job-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 11px; color: #90a3b6; }
.alp-sub-id { font-family: ui-monospace, Menlo, monospace; }

.alp-empty { text-align: center; padding: 40px 20px; color: var(--alp-sub); }
.alp-empty-emoji { font-size: 38px; }
.alp-empty p { margin: 10px 0 0; font-size: 13.5px; }

/* ---- setup diagnostics ---- */
.alp-diag-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 14px; color: var(--alp-ink); }
.alp-diag-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-top: 1px solid var(--alp-line); font-size: 12.8px; }
.alp-diag-ic { font-weight: 800; flex-shrink: 0; }
.alp-diag-ic.ok { color: #1f7a47; }
.alp-diag-ic.bad { color: #b23a32; }
.alp-diag-l { font-weight: 700; color: var(--alp-ink); min-width: 190px; }
.alp-diag-d { color: var(--alp-sub); word-break: break-word; }

/* ---- toasts ---- */
.alp-toast-box { position: fixed; right: 20px; bottom: 20px; z-index: 100060; display: flex; flex-direction: column; gap: 9px; }
.alp-toast { background: #10314c; color: #fff; font-size: 13px; font-weight: 600; padding: 11px 16px; border-radius: 11px; box-shadow: 0 12px 30px rgba(9, 26, 43, .3); opacity: 0; transform: translateX(20px); transition: .28s; max-width: 360px; }
.alp-toast.show { opacity: 1; transform: none; }
.alp-toast.ok { background: #14795a; }
.alp-toast.err { background: #b23a32; }

/* ================= Mobile (gated ≤1180px, no horizontal scroll) ================= */
@media (max-width: 1180px) {
  .alp-title { font-size: 22px; }
  .alp-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .alp-field, .alp-field.alp-grow { min-width: 0; width: 100%; }
  .alp-field.alp-field-btn .alp-btn { width: 100%; justify-content: center; }
  .alp-jobs { grid-template-columns: 1fr; }
  .alp-diag-row { flex-wrap: wrap; }
  .alp-diag-l { min-width: 0; }
  .alp-sku { flex-wrap: wrap; }
  .alp-sku-tags { width: 100%; }
  .alp-head-actions { width: 100%; }
  .alp-toast-box { left: 12px; right: 12px; bottom: 12px; }
  .alp-toast { max-width: none; }
}

/* ---- dark theme ---- */
html[data-theme="dark"] .alp-title { color: #e6edf6; }
html[data-theme="dark"] .alp-sub, html[data-theme="dark"] .alp-hint, html[data-theme="dark"] .alp-job-meta, html[data-theme="dark"] .alp-job-foot { color: #9fb0c4; }
html[data-theme="dark"] .alp-card,
html[data-theme="dark"] .alp-job,
html[data-theme="dark"] .alp-sku { background: #162133; border-color: #2a3650; color: #e6edf6; }
html[data-theme="dark"] .alp-step, html[data-theme="dark"] .alp-sku-code, html[data-theme="dark"] .alp-job-sku { color: #e6edf6; }
html[data-theme="dark"] .alp-diag-head, html[data-theme="dark"] .alp-diag-l { color: #e6edf6; }
html[data-theme="dark"] .alp-diag-row { border-color: #243049; }
html[data-theme="dark"] .alp-field input,
html[data-theme="dark"] .alp-field select,
html[data-theme="dark"] .alp-chosen,
html[data-theme="dark"] .alp-note { background: #111a2b; color: #e6edf6; border-color: #243049; }
html[data-theme="dark"] .alp-sku:hover { background: #1d2941; }
html[data-theme="dark"] .alp-sku.on { background: #14263a; }
html[data-theme="dark"] .alp-btn { background: #1d2941; border-color: #2a3650; color: #cdd9e8; }
html[data-theme="dark"] .alp-btn.primary { color: #fff; }
