/* BulkList Listing Studio - design tokens + component classes.
   Class names are load-bearing: app.js builds DOM against them. */

:root {
  --bg: #0a0a0a;
  --surface: #111112;
  --surface-2: #19191c;
  --fg: #ededf0;
  --muted: #a1a1aa;
  --faint: #6b6b74;
  --border: rgba(237, 237, 240, 0.09);
  --accent: #8b77f0;
  --accent-hover: #9d8bf5;
  --accent-soft: rgba(139, 119, 240, 0.13);
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

/* Ambient accent glow, same treatment as the marketing site */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(56rem 36rem at 50% -6%, rgba(139, 119, 240, 0.12), transparent 62%),
    radial-gradient(48rem 32rem at 108% 42%, rgba(139, 119, 240, 0.07), transparent 65%);
}

::selection { background: rgba(139, 119, 240, 0.3); }

/* Subtle scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(237, 237, 240, 0.14) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(237, 237, 240, 0.14); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(12px);
}
/* Pane labels - the mock's "NEW LISTING" / "STORE INTELLIGENCE" */
.pane-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--faint);
}

/* Step strip chips */
.step-chip {
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--faint);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.step-chip.is-active {
  border-color: rgba(139, 119, 240, 0.45);
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.step-chip.is-done {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(6, 78, 59, 0.25);
  color: rgb(110, 231, 183);
}
.step-chip.is-done::before { content: "\2713 "; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}
.card-head {
  padding: 1rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.card-head h2 {
  font-size: 1rem; font-weight: 600; color: var(--fg);
  display: flex; align-items: center; gap: 0.5rem;
}
.card-head .hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.card-body { padding: 1.25rem 1.5rem; }
.step-num {
  display: inline-flex; width: 1.5rem; height: 1.5rem;
  align-items: center; justify-content: center; border-radius: 9999px;
  background: var(--accent-soft); color: var(--accent-hover);
  border: 1px solid rgba(139, 119, 240, 0.4);
  font-size: 0.75rem; font-weight: 700;
}

/* Nested panel (manual source, personalization, camera preset) */
.sub-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

/* Code/JSON blocks */
.code-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem;
  white-space: pre-wrap;
}

/* Field */
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.lbl { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.lbl-hint { color: var(--faint); font-weight: 400; }
.required-hint { color: rgb(252, 165, 165); }

/* Inputs */
.input-base {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 0.75rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-base::placeholder { color: var(--faint); }
.input-base:focus {
  outline: none;
  border-color: rgba(139, 119, 240, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 119, 240, 0.18);
}
.input-readonly { background: var(--bg); color: var(--faint); }

select.input-base {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b74' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.2rem;
}

.checkbox-accent {
  height: 1rem; width: 1rem;
  border-radius: 0.25rem;
  accent-color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* URL shell - the mock's input row: icon + bare input + accent chip */
.url-shell {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 0.45rem 0.5rem 0.45rem 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.url-shell:focus-within {
  border-color: rgba(139, 119, 240, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 119, 240, 0.18);
}
.input-bare {
  background: transparent; border: none; outline: none;
  color: var(--fg); font-size: 0.875rem; min-width: 0;
}
.input-bare::placeholder { color: var(--faint); }

/* Buttons */
.btn-accent {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: white;
  padding: 0.55rem 1.25rem; border-radius: 0.75rem;
  font-weight: 600; font-size: 0.875rem;
  transition: background 0.15s ease;
}
.btn-accent:hover { background: var(--accent-hover); }
.btn-accent:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-accent.btn-sm {
  padding: 0.35rem 0.9rem; border-radius: 0.6rem;
  font-size: 0.75rem; font-weight: 600;
}

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--fg);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem; border-radius: 0.75rem;
  font-weight: 500; font-size: 0.875rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-primary:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(237, 237, 240, 0.16); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-copy {
  background: rgba(255, 255, 255, 0.05); color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0.5rem; padding: 0.25rem 0.6rem;
  font-size: 0.75rem; font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-copy:hover { background: rgba(255, 255, 255, 0.09); color: var(--fg); }
.btn-copy.is-copied { background: rgb(5, 150, 105); border-color: rgb(5, 150, 105); color: white; }

/* Regen button */
.btn-regen {
  background: var(--accent-soft); color: var(--accent-hover);
  border: 1px solid rgba(139, 119, 240, 0.35);
  border-radius: 0.5rem; padding: 0.25rem 0.6rem;
  font-size: 0.75rem; font-weight: 500;
  transition: background 0.15s ease;
}
.btn-regen:hover { background: rgba(139, 119, 240, 0.22); }
.btn-regen:disabled { opacity: 0.5; cursor: not-allowed; }

/* Image-gen buttons: text-only (violet) vs with-reference (teal) */
.btn-imggen {
  background: var(--accent-soft); color: rgb(199, 188, 250);
  border: 1px solid rgba(139, 119, 240, 0.35);
  border-radius: 0.5rem; padding: 0.25rem 0.7rem;
  font-size: 0.75rem; font-weight: 500;
}
.btn-imggen:hover { background: rgba(139, 119, 240, 0.24); }
.btn-imggen:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-imggen-ref {
  background: rgba(13, 148, 136, 0.16); color: rgb(153, 246, 228);
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 0.5rem; padding: 0.25rem 0.7rem;
  font-size: 0.75rem; font-weight: 500;
}
.btn-imggen-ref:hover { background: rgba(13, 148, 136, 0.28); }
.btn-imggen-ref:disabled { opacity: 0.5; cursor: not-allowed; }

/* Inline regen form */
.regen-form {
  display: flex; gap: 0.3rem; align-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(139, 119, 240, 0.3);
  border-radius: 0.5rem; padding: 0.3rem;
  margin-top: 0.5rem;
}
.regen-form input {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--fg); border-radius: 0.4rem;
  padding: 0.25rem 0.5rem; font-size: 0.75rem; flex: 1; min-width: 0;
}
.regen-form input:focus { outline: none; border-color: rgba(139, 119, 240, 0.5); }

/* Results sub-cards - the mock's bordered panels */
.result-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
}
.result-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.5rem; gap: 0.5rem; flex-wrap: wrap;
}
.result-card-head-actions { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.result-card-label {
  font-size: 11px; color: var(--faint);
  text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600;
}

/* Tag chips - the mock's violet pills */
.tag-chip {
  display: inline-block;
  background: var(--accent-soft); color: var(--accent-hover);
  border-radius: 9999px; padding: 0.25rem 0.65rem;
  font-size: 11px; font-weight: 500;
}

/* Intelligence bar rows (competitor keywords) */
.intel-bar-row { display: flex; align-items: center; gap: 0.6rem; }
.intel-bar-label {
  width: 8.5rem; flex-shrink: 0;
  font-size: 0.75rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.intel-bar-track {
  flex: 1; height: 0.4rem; border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.intel-bar-fill {
  height: 100%; border-radius: 9999px;
  background: rgba(139, 119, 240, 0.65);
}
.intel-bar-count { font-size: 11px; color: var(--faint); flex-shrink: 0; width: 2.4rem; text-align: right; }

/* Angle cards (brainstorm review) */
.angle-card {
  background: var(--surface-2);
  border: 1px solid rgba(139, 119, 240, 0.3);
  border-radius: 0.85rem; padding: 0.85rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.angle-card .angle-id {
  font-family: ui-monospace, monospace; font-size: 0.7rem;
  color: var(--accent-hover); background: var(--accent-soft);
  padding: 0.1rem 0.45rem; border-radius: 0.35rem;
}
.angle-card input, .angle-card textarea {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--fg); border-radius: 0.5rem;
  padding: 0.35rem 0.55rem; font-size: 0.8rem; width: 100%;
}
.angle-card input:focus, .angle-card textarea:focus {
  outline: none; border-color: rgba(139, 119, 240, 0.5);
}
.angle-card-row {
  display: grid; grid-template-columns: 100px 1fr; gap: 0.5rem;
  align-items: center; font-size: 0.75rem;
}
.angle-card-row .row-lbl { color: var(--muted); }
.angle-remove {
  color: rgb(252, 165, 165); font-size: 1.25rem;
  line-height: 1; padding: 0 0.25rem;
}
.angle-remove:hover { color: rgb(254, 202, 202); }

/* Variations stack (batch results) */
.variation-stack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.variation-stack-card.is-error { border-left-color: rgb(248, 113, 113); }
.variation-stack-header {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.variation-stack-anchor { scroll-margin-top: 90px; }
.variation-mini-nav {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}
.variation-mini-nav a {
  background: var(--accent-soft); color: var(--accent-hover);
  border: 1px solid rgba(139, 119, 240, 0.3);
  border-radius: 9999px; padding: 0.25rem 0.8rem;
  text-decoration: none;
  transition: background 0.15s ease;
}
.variation-mini-nav a:hover { background: rgba(139, 119, 240, 0.24); }

/* Pricing tactic mini-cards - neutral panels, color-coded edge */
.tactic-card {
  border-radius: 0.75rem; padding: 0.75rem 1rem;
  display: flex; flex-direction: column; gap: 0.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left-width: 3px;
}
.tactic-card.is-full { border-left-color: rgba(52, 211, 153, 0.7); }
.tactic-card.is-mid  { border-left-color: rgba(245, 158, 11, 0.7); }
.tactic-card.is-agg  { border-left-color: rgba(244, 63, 94, 0.7); }
.tactic-card .tactic-name {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600;
}
.tactic-card .tactic-customer-pays {
  font-size: 1.4rem; font-weight: 700; color: var(--fg);
  letter-spacing: -0.02em;
}
.tactic-card .tactic-meta { font-size: 0.7rem; color: var(--faint); }
.tactic-card .tactic-margin {
  font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem;
  border-top: 1px solid var(--border); padding-top: 0.4rem;
}

/* Angle context box */
.angle-context {
  background: var(--accent-soft); border: 1px solid rgba(139, 119, 240, 0.3);
  border-radius: 0.75rem; padding: 0.75rem 1rem; margin-bottom: 1rem;
  font-size: 0.8rem; color: rgb(199, 188, 250);
}
.angle-context .angle-ctx-name {
  font-weight: 600; color: rgb(234, 230, 254);
  display: block; margin-bottom: 0.25rem;
}

/* Generated image preview */
.gen-image-wrap { margin-top: 0.5rem; }
.gen-image-wrap img {
  max-width: 100%; max-height: 320px;
  border-radius: 0.75rem; border: 1px solid var(--border);
  background: var(--bg);
}
.gen-image-meta { font-size: 0.7rem; color: var(--faint); margin-top: 0.3rem; }

/* Shop manager modal */
.shop-modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 2.5rem 1rem; overflow-y: auto;
}
.shop-modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); z-index: -1;
  backdrop-filter: blur(2px);
}
.shop-modal-content {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 1rem; padding: 1.5rem;
  max-width: 56rem; width: 100%;
}
.shop-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.shop-list-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; padding: 0.65rem 0.9rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 0.75rem;
}
.shop-list-item .name { font-size: 0.875rem; color: var(--fg); font-weight: 500; }
.shop-list-item .slug {
  font-size: 0.7rem; color: var(--faint);
  font-family: ui-monospace, monospace;
}

/* Saved listings: drawer + toggle + per-listing save button */
.btn-saved-toggle {
  background: transparent; color: rgb(252, 211, 77);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 9999px; padding: 0.35rem 0.85rem;
  font-size: 0.8rem; font-weight: 600;
  transition: background 0.15s ease;
}
.btn-saved-toggle:hover { background: rgba(245, 158, 11, 0.14); }

.btn-save {
  background: transparent; color: rgb(252, 211, 77);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 9999px; padding: 0.35rem 0.85rem;
  font-size: 0.8rem; font-weight: 500;
  transition: background 0.15s ease;
}
.btn-save:hover { background: rgba(245, 158, 11, 0.14); }
.btn-save.is-saved {
  background: rgb(217, 119, 6); color: white; border-color: rgb(217, 119, 6);
}
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

.saved-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 22rem; max-width: 90vw;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.5);
  z-index: 40; overflow-y: auto; padding: 1rem;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.saved-drawer.is-open { transform: translateX(0); }
.saved-drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 0.75rem;
}
.saved-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 35;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.saved-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }

.saved-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 0.75rem; padding: 0.75rem;
}
.saved-item:hover { border-color: rgba(245, 158, 11, 0.35); }
.saved-item.is-stale { opacity: 0.55; border-style: dashed; }
.saved-item .saved-item-shop {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent-hover); background: var(--accent-soft);
  padding: 0.05rem 0.4rem; border-radius: 0.35rem; display: inline-block;
}

/* Outputs library items */
.output-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border);
  border-radius: 0.65rem; cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.output-item:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(139, 119, 240, 0.4);
}
.output-item .out-title {
  font-size: 0.82rem; color: var(--fg); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.output-item .out-meta { font-size: 0.68rem; color: var(--faint); flex-shrink: 0; }
.output-item .out-badge {
  display: inline-block; font-size: 0.65rem;
  background: var(--accent-soft); color: var(--accent-hover);
  border: 1px solid rgba(139, 119, 240, 0.3);
  border-radius: 0.35rem; padding: 0.05rem 0.4rem;
  margin-right: 0.4rem;
}
