/* WBD Catalog Builder — Styles */

:root {
  --green: #9ccb3b;
  --green-dim: #7aad1e;
  --green-glow: rgba(156,203,59,.12);
  --green-glow2: rgba(156,203,59,.06);
  --black: #080a0d;
  --bg: #0d1017;
  --surface: #131720;
  --surface2: #1a2030;
  --surface3: #212840;
  --border: #252d40;
  --border2: #303d55;
  --text: #dde3f0;
  --text-dim: #7a8baa;
  --text-faint: #3a4860;
  --orange: #f47920;
  --red: #e05252;
  --radius: 6px;
  --font: 'Barlow', sans-serif;
  --font-cond: 'Barlow Condensed', sans-serif;
  --font-mono: 'DM Mono', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: var(--font); background: var(--black); color: var(--text); font-size: 13px; line-height: 1.5; }

/* ── SCROLLBARS ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── TOPBAR ── */
.topbar {
  height: 52px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 18px; gap: 16px; flex-shrink: 0; z-index: 100; position: relative;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; background: var(--green); border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-cond); font-weight: 800; font-size: 14px; color: #000; letter-spacing: -0.5px; flex-shrink: 0;
}
.brand-name { font-family: var(--font-cond); font-weight: 700; font-size: 15px; letter-spacing: .05em; text-transform: uppercase; line-height: 1.1; }
.brand-sub { font-size: 10px; color: var(--text-dim); letter-spacing: .08em; text-transform: uppercase; }
.topbar-divider { width: 1px; height: 28px; background: var(--border); flex-shrink: 0; }

/* search */
.topbar-search { position: relative; flex: 1; max-width: 340px; }
.topbar-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.topbar-search input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 12px 7px 34px; color: var(--text); font-family: var(--font); font-size: 13px; outline: none; transition: border-color .15s;
}
.topbar-search input:focus { border-color: var(--green); }
.topbar-search input::placeholder { color: var(--text-faint); }

/* status chips */
.chip {
  font-family: var(--font-mono); font-size: 10px; padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text-dim); white-space: nowrap;
  transition: all .2s;
}
.chip.green { color: var(--green); border-color: var(--green-dim); background: var(--green-glow); }
.chip.orange { color: var(--orange); border-color: rgba(244,121,32,.4); background: rgba(244,121,32,.08); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius); border: none; cursor: pointer;
  font-family: var(--font-cond); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--green); color: #000; }
.btn-primary:hover { background: #aad940; box-shadow: 0 4px 18px rgba(156,203,59,.3); }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid rgba(224,82,82,.3); }
.btn-danger:hover { background: rgba(224,82,82,.1); border-color: var(--red); }

/* ── 3-COLUMN LAYOUT ── */
.app { display: flex; height: calc(100vh - 52px); overflow: hidden; }

/* ── LEFT PANEL: Browser ── */
.browser {
  width: 560px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.panel-head {
  padding: 12px 14px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.panel-label {
  font-family: var(--font-cond); font-size: 10px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px;
}

/* tabs */
.tabs { display: flex; gap: 2px; margin-bottom: 10px; background: var(--surface2); border-radius: var(--radius); padding: 3px; }
.tab {
  flex: 1; padding: 5px 8px; border-radius: 4px; border: none; background: transparent;
  color: var(--text-dim); font-family: var(--font-cond); font-weight: 600; font-size: 12px;
  letter-spacing: .04em; text-transform: uppercase; cursor: pointer; transition: all .15s; text-align: center;
}
.tab.active { background: var(--surface3); color: var(--green); }
.tab:hover:not(.active) { color: var(--text); }

/* brand filter */
.filter-select {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 28px 6px 9px; color: var(--text); font-family: var(--font); font-size: 12px; outline: none; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%233a4860'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: border-color .15s;
}
.filter-select:focus { border-color: var(--green); }

/* ── CATEGORY TREE ── */
.cat-tree { flex: 1; overflow-y: auto; padding: 4px 0; }
.tree-node { user-select: none; }
.tree-row {
  display: flex; align-items: center; gap: 0; padding: 5px 10px 5px 0;
  cursor: pointer; transition: background .1s; border-radius: 4px; margin: 1px 4px;
  font-size: 12px; color: var(--text-dim); position: relative;
}
.tree-row:hover { background: var(--surface2); color: var(--text); }
.tree-row.active { background: var(--green-glow); color: var(--green); font-weight: 600; }
.tree-row.active::before { content: ''; position: absolute; left: 0; top: 20%; bottom: 20%; width: 2px; background: var(--green); border-radius: 1px; }
.tree-indent { flex-shrink: 0; }
.tree-toggle {
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--text-faint); transition: transform .15s; font-size: 9px;
}
.tree-toggle.open { transform: rotate(90deg); }
.tree-toggle-ph { width: 20px; flex-shrink: 0; }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.tree-count { font-family: var(--font-mono); font-size: 9px; color: var(--text-faint); margin-left: 4px; flex-shrink: 0; }
.tree-children { display: none; }
.tree-children.open { display: block; }

/* sort/count bar */
.sort-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px;
  border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--bg);
}
.sort-label { font-size: 11px; color: var(--text-dim); }
.sort-select {
  background: transparent; border: none; color: var(--text-dim); font-family: var(--font); font-size: 11px; outline: none; cursor: pointer;
}
.result-count { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }

/* product list */
.product-list { flex: 1; overflow-y: auto; padding: 6px; }

.product-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; transition: all .12s; margin-bottom: 3px;
  background: var(--surface2);
}
.product-item:hover { border-color: var(--border2); background: var(--surface3); }
.product-item.sel { border-color: var(--green-dim); background: var(--green-glow); }

.prod-thumb {
  width: 38px; height: 38px; border-radius: 4px; object-fit: contain;
  background: #fff; border: 1px solid var(--border); flex-shrink: 0; padding: 2px;
}
.prod-thumb-ph {
  width: 38px; height: 38px; border-radius: 4px; background: var(--surface3);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.prod-info { flex: 1; min-width: 0; }
.prod-brand { font-size: 9px; color: var(--green); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.prod-name { font-size: 11.5px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.prod-sku { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-faint); }
.prod-price-col { text-align: right; flex-shrink: 0; }
.prod-price { font-family: var(--font-mono); font-size: 11px; color: var(--green); }
.prod-msrp { font-size: 9px; color: var(--text-faint); text-decoration: line-through; }
.prod-check {
  width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid var(--border2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .12s; font-size: 9px;
}
.product-item.sel .prod-check { background: var(--green); border-color: var(--green); color: #000; }

/* pagination */
.list-pagination {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 6px; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--bg);
}
.pg-btn {
  padding: 3px 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface2);
  color: var(--text-dim); font-family: var(--font-mono); font-size: 10px; cursor: pointer; transition: all .1s;
}
.pg-btn:hover:not(:disabled) { border-color: var(--border2); color: var(--text); }
.pg-btn.cur { background: var(--green-glow); border-color: var(--green); color: var(--green); }
.pg-btn:disabled { opacity: .3; cursor: default; }
.pg-dots { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); padding: 0 2px; }

/* empty states */
.empty-state { padding: 40px 20px; text-align: center; color: var(--text-faint); font-size: 12px; line-height: 1.7; }
.empty-icon { font-size: 28px; margin-bottom: 10px; opacity: .3; }

/* ── CENTER PANEL: Preview ── */
.preview-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); min-width: 0; }
.preview-toolbar {
  padding: 9px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; flex-shrink: 0; background: var(--surface);
}
.preview-toolbar-left { display: flex; align-items: center; gap: 10px; }
.preview-body { flex: 1; overflow-y: auto; padding: 24px; display: flex; justify-content: center; align-items: flex-start; }

/* catalog preview rendering */
.catalog-doc {
  width: 100%; max-width: 620px; background: #fff; border-radius: 4px;
  box-shadow: 0 12px 48px rgba(0,0,0,.7); overflow: hidden; font-family: var(--font);
}
.doc-cover {
  background: #0d0f14; padding: 36px 32px 28px; color: #fff; position: relative; overflow: hidden;
}
.doc-cover::before {
  content: ''; position: absolute; top: 0; right: 0; width: 240px; height: 240px;
  background: radial-gradient(circle at 100% 0%, rgba(156,203,59,.14) 0%, transparent 65%);
}
.doc-cover::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, #9ccb3b, transparent);
}
.doc-eyebrow { font-family: var(--font-cond); font-size: 9px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--green); margin-bottom: 6px; }
.doc-title { font-family: var(--font-cond); font-size: 28px; font-weight: 800; line-height: 1.1; color: #fff; margin-bottom: 5px; }
.doc-dealer { font-size: 13px; color: rgba(255,255,255,.45); margin-bottom: 20px; }
.doc-stats { display: inline-flex; border: 1px solid rgba(255,255,255,.1); }
.doc-stat { padding: 7px 16px; border-right: 1px solid rgba(255,255,255,.1); text-align: center; }
.doc-stat:last-child { border-right: none; }
.doc-stat-n { font-family: var(--font-cond); font-size: 18px; font-weight: 800; color: var(--green); display: block; line-height: 1; }
.doc-stat-l { font-size: 8px; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; display: block; }
.doc-rep-row { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: flex-end; }
.doc-rep-name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.8); }
.doc-rep-info { font-size: 10px; color: rgba(255,255,255,.35); line-height: 1.7; margin-top: 2px; }
.doc-date { font-family: var(--font-mono); font-size: 9px; color: rgba(255,255,255,.2); }

.doc-products { padding: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: #f4f6f9; }
.doc-card { background: #fff; border: 1px solid #e4e8ee; border-radius: 3px; overflow: hidden; }
.doc-card-img { width: 100%; aspect-ratio: 1/1; object-fit: contain; background: #f9fafb; display: block; padding: 4px; }
.doc-card-img-ph { width: 100%; aspect-ratio: 1/1; background: linear-gradient(135deg, #f0f2f6, #e4e8ee); display: flex; align-items: center; justify-content: center; font-size: 24px; color: #c4cad6; }
.doc-card-body { padding: 9px 10px 10px; border-top: 2px solid var(--green); }
.doc-card-brand { font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green-dim); margin-bottom: 2px; }
.doc-card-name { font-size: 11px; font-weight: 600; color: #1a1e2a; line-height: 1.3; margin-bottom: 3px; }
.doc-card-sku { font-family: var(--font-mono); font-size: 8.5px; color: #9aa0b0; margin-bottom: 6px; }
.doc-card-desc { font-size: 9.5px; color: #555; line-height: 1.5; margin-bottom: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-card-footer { display: flex; justify-content: space-between; align-items: flex-end; padding-top: 7px; border-top: 1px solid #eef0f4; }
.doc-price-lbl { font-size: 8px; text-transform: uppercase; letter-spacing: .05em; color: #aaa; display: block; }
.doc-price-val { font-family: var(--font-cond); font-size: 15px; font-weight: 800; color: #1a1e2a; line-height: 1; }
.doc-msrp { font-size: 9px; color: #bbb; text-decoration: line-through; }
.doc-qr { width: 32px; height: 32px; background: #f0f2f6; border: 1px solid #e4e8ee; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 7px; color: #bbb; text-align: center; font-family: var(--font-mono); line-height: 1.2; }

.doc-footer {
  background: #fff; border-top: 1px solid #e4e8ee; padding: 10px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.doc-footer-left { font-size: 9px; color: #666; line-height: 1.7; }
.doc-footer-right { font-size: 9px; color: #aaa; text-align: right; }
.doc-footer-right strong { display: block; font-size: 10px; color: #555; }

/* ── PREVIEW PAGES ── */
.pvw-doc { width: 100%; max-width: 660px; display: flex; flex-direction: column; gap: 16px; }
.pvw-page {
  background: #fff; border-radius: 4px; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.5); font-family: var(--font);
}
.pvw-page-header {
  background: #0d0f14; padding: 8px 14px; display: flex; align-items: center;
  justify-content: space-between; border-left: 4px solid #9ccb3b;
}
.pvw-page-title { font-family: var(--font-cond); font-size: 11px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: .04em; }
.pvw-page-info { font-size: 9px; color: rgba(255,255,255,.4); font-family: var(--font-mono); }
.pvw-grid { padding: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: #f4f6f9; }
.pvw-card { background: #fff; border: 1px solid #e4e8ee; border-radius: 3px; overflow: hidden; }
.pvw-img { width: 100%; aspect-ratio: 1/1; object-fit: contain; background: #f9fafb; display: block; padding: 4px; }
.pvw-img-ph { width: 100%; aspect-ratio: 1/1; background: linear-gradient(135deg, #f0f2f6, #e4e8ee); display: flex; align-items: center; justify-content: center; font-size: 22px; color: #c4cad6; }
.pvw-body { padding: 6px 8px 8px; border-top: 2px solid #9ccb3b; }
.pvw-brand { font-size: 7px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }
.pvw-name { font-size: 9px; font-weight: 600; color: #1a1e2a; line-height: 1.3; margin-bottom: 2px; }
.pvw-sku { font-family: var(--font-mono); font-size: 7.5px; color: #9aa0b0; margin-bottom: 3px; }
.pvw-notes {
  font-size: 7.5px; color: #3a4860; background: #f0f4f8; border-radius: 2px;
  padding: 3px 5px; margin-bottom: 4px; white-space: pre-wrap; line-height: 1.5;
  font-family: var(--font-mono);
}
.pvw-pricing { display: flex; flex-direction: column; padding-top: 4px; border-top: 1px solid #eef0f4; }
.pvw-price-lbl { font-size: 7px; text-transform: uppercase; letter-spacing: .04em; color: #aaa; }
.pvw-price { font-family: var(--font-cond); font-size: 12px; font-weight: 800; color: #1a1e2a; line-height: 1.1; }
.pvw-msrp { font-size: 7.5px; color: #bbb; text-decoration: line-through; }
.pvw-page-footer {
  background: #e8ecf0; padding: 5px 14px; display: flex; justify-content: space-between; align-items: center;
  font-size: 8px; color: #888; font-family: var(--font-mono);
}
.pvw-cover-footer { background: #0d0f14; color: rgba(255,255,255,.2); justify-content: center; letter-spacing: .06em; font-size: 7.5px; }


  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: var(--text-faint); text-align: center; gap: 10px;
}
.preview-empty-icon { font-size: 52px; opacity: .15; }
.preview-empty h3 { font-family: var(--font-cond); font-size: 16px; font-weight: 600; color: var(--text-dim); letter-spacing: .04em; }
.preview-empty p { font-size: 12px; max-width: 240px; line-height: 1.7; }

/* ── RIGHT PANEL: Settings + Queue ── */
.settings-panel {
  width: 280px; flex-shrink: 0; background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.settings-body { flex: 1; overflow-y: auto; padding: 14px; }
.settings-section { margin-bottom: 18px; }
.settings-label {
  font-family: var(--font-cond); font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.sep { height: 1px; background: var(--border); margin: 14px 0; }

/* form controls */
.field { margin-bottom: 6px; }
.field-label { font-size: 10px; color: var(--text-dim); margin-bottom: 3px; }
.field-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 10px; color: var(--text); font-family: var(--font); font-size: 12px; outline: none;
  transition: border-color .15s; display: block;
}
.field-input:focus { border-color: var(--green); }
.field-input::placeholder { color: var(--text-faint); }
select.field-input {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%233a4860'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px;
}

/* rep card */
.rep-card {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; margin-top: 8px; display: none;
}
.rep-card.visible { display: block; }
.rep-card-name { font-weight: 600; font-size: 12px; color: var(--text); margin-bottom: 2px; }
.rep-card-detail { font-size: 11px; color: var(--text-dim); line-height: 1.7; }
.rep-card-territory { font-family: var(--font-mono); font-size: 9px; color: var(--green); margin-top: 4px; letter-spacing: .04em; }

/* queue */
.queue-item {
  display: flex; flex-direction: column; gap: 0; padding: 0; border-radius: 5px;
  background: var(--surface2); border: 1px solid var(--border); margin-bottom: 5px; font-size: 11px; overflow: hidden;
}
.queue-item-top {
  display: flex; align-items: center; gap: 7px; padding: 6px 7px;
}
.queue-item-thumb {
  width: 28px; height: 28px; flex-shrink: 0; object-fit: contain; background: #fff;
  border-radius: 3px; padding: 1px;
}
.queue-item-thumb-ph {
  width: 28px; height: 28px; flex-shrink: 0; background: var(--surface3);
  border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.queue-item-info { flex: 1; min-width: 0; }
.queue-item-name { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-item-sku { font-family: var(--font-mono); font-size: 9px; color: var(--text-faint); }
.queue-rm {
  width: 18px; height: 18px; border-radius: 3px; background: transparent; border: none;
  color: var(--text-faint); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all .1s; flex-shrink: 0;
}
.queue-rm:hover { background: rgba(224,82,82,.15); color: var(--red); }
.queue-notes-wrap {
  padding: 0 7px 6px; border-top: 1px solid var(--border);
  background: var(--surface); 
}
.queue-notes-label {
  font-size: 8.5px; color: var(--text-faint); letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 0 3px; display: flex; align-items: center; gap: 4px;
}
.queue-notes-label svg { opacity: .5; }
.queue-notes {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 3px;
  color: var(--text); font-family: var(--font); font-size: 10.5px; line-height: 1.5;
  padding: 5px 7px; resize: vertical; min-height: 38px; max-height: 120px; outline: none;
  transition: border-color .15s; box-sizing: border-box;
}
.queue-notes:focus { border-color: var(--green); }
.queue-notes::placeholder { color: var(--text-faint); font-style: italic; }
.queue-count-badge {
  font-family: var(--font-mono); font-size: 9px; background: var(--green); color: #000;
  border-radius: 10px; padding: 1px 6px; font-weight: 600;
}

/* generate footer */
.gen-footer { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; }
.btn-generate {
  width: 100%; background: var(--green); color: #000; border: none; border-radius: var(--radius);
  padding: 12px; font-family: var(--font-cond); font-size: 15px; font-weight: 800;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: .04em; text-transform: uppercase; transition: all .15s;
}
.btn-generate:hover { background: #aad940; box-shadow: 0 6px 20px rgba(156,203,59,.35); transform: translateY(-1px); }
.btn-generate:disabled { background: var(--surface3); color: var(--text-faint); cursor: not-allowed; transform: none; box-shadow: none; }

/* ── OVERLAY ── */
.overlay {
  position: fixed; inset: 0; background: rgba(8,10,13,.85); display: flex;
  align-items: center; justify-content: center; z-index: 999; backdrop-filter: blur(5px);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.overlay.show { opacity: 1; pointer-events: all; }
.overlay-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 32px 40px; text-align: center; min-width: 260px;
}
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--green);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay-text { font-size: 13px; color: var(--text-dim); }
.overlay-sub { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); margin-top: 5px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--surface); border: 1px solid var(--green-dim); border-radius: 8px;
  padding: 10px 18px; font-size: 12px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 1000; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

/* skeleton */
.skel {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 3px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
/* ── LAYOUT SWITCHER (#5) ── */
.layout-switcher { display:flex; border:1px solid var(--border); border-radius:4px; overflow:hidden; }
.layout-btn { background:var(--surface2); border:none; color:var(--text-faint); font-size:10px; font-family:var(--font-mono); padding:3px 8px; cursor:pointer; transition:all .15s; }
.layout-btn:hover { background:var(--surface3); color:var(--text); }
.layout-btn.active { background:var(--green); color:#000; font-weight:700; }

/* ── DRAG REORDER (#1) ── */
.queue-drag-handle { cursor:grab; color:var(--text-faint); font-size:14px; flex-shrink:0; padding:0 3px; line-height:1; user-select:none; }
.queue-drag-handle:active { cursor:grabbing; }
.queue-item.drag-over { border-color:var(--green); box-shadow:0 0 0 2px rgba(156,203,59,.25); }
.queue-item[draggable] { cursor:default; }

/* ── FEATURED STAR (#7) ── */
.queue-feat-btn { width:18px; height:18px; border-radius:3px; background:transparent; border:none; color:var(--text-faint); cursor:pointer; font-size:13px; line-height:1; display:flex; align-items:center; justify-content:center; transition:all .1s; }
.queue-feat-btn:hover { color:#f5c842; }
.queue-feat-btn.active { color:#f5c842; }
.queue-item.queue-featured { border-color:rgba(245,200,66,.3); background:rgba(245,200,66,.04); }
.pvw-card-featured { border-color:rgba(245,200,66,.4) !important; }
.pvw-featured-badge { display:inline-block; font-size:7px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; border-radius:2px; padding:2px 5px; color:#000; margin-bottom:3px; }

/* ── SECTION BREAKS (#3) ── */
.pvw-section-break {
  grid-column: 1 / -1; display:flex; align-items:center; gap:8px;
  font-size:9px; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  padding:6px 0 4px; border-bottom:2px solid;
}
.pvw-section-break span { white-space:nowrap; }

/* ── QUEUE SEARCH (#8) ── */
.queue-search-wrap { display:flex; align-items:center; gap:6px; padding:5px 7px; background:var(--surface); border:1px solid var(--border); border-radius:4px; margin-bottom:6px; }
.queue-search-input { flex:1; background:transparent; border:none; outline:none; font-size:11px; color:var(--text); font-family:var(--font); }
.queue-search-input::placeholder { color:var(--text-faint); }

/* ── MODAL (#9 bulk import) ── */
.modal-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.7); z-index:1000; display:none; align-items:center; justify-content:center; }
.modal-backdrop.show { display:flex; }
.modal-card { background:var(--surface2); border:1px solid var(--border); border-radius:8px; width:420px; max-width:90vw; box-shadow:0 24px 64px rgba(0,0,0,.5); }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:14px 16px 12px; border-bottom:1px solid var(--border); }
.modal-title { font-size:13px; font-weight:700; color:var(--text); }
.modal-close { background:transparent; border:none; color:var(--text-faint); font-size:16px; cursor:pointer; line-height:1; padding:2px 6px; border-radius:3px; }
.modal-close:hover { background:var(--surface3); color:var(--text); }
.modal-body { padding:14px 16px; }
.modal-footer { display:flex; gap:8px; justify-content:flex-end; padding:12px 16px; border-top:1px solid var(--border); }

/* ── SESSION SAVED INDICATOR ── */
@keyframes session-pulse { 0%,100%{opacity:0} 50%{opacity:1} }


/* ══════════════════════════════════════════════════════════════════
   TABLET RESPONSIVE  (≤ 1199px)
   ══════════════════════════════════════════════════════════════════ */

/* ── Large tablet: 900–1199px ── */
@media (max-width: 1199px) {
  /* Shrink browser panel — hide category tree, keep product list */
  .browser { width: 300px !important; }
  .browser > div:first-child { display: none !important; } /* category tree pane */
  .browser > div:last-child { flex: 1; }

  /* Shrink settings panel */
  .settings-panel { width: 240px; }

  /* Topbar — hide text labels on ghost buttons to save space */
  .topbar-right .btn-ghost span,
  .topbar-right .btn span { display: none; }
  .btn-ghost svg, .btn svg { margin: 0; }
  .topbar-right { gap: 5px; }
  .topbar-right .btn { padding: 6px 10px; min-width: 0; }
  .topbar-right .btn-primary { padding: 6px 12px; }

  /* Tighter topbar search */
  .topbar-search { max-width: 220px; }
}

/* ── Small tablet: 768–899px — hide preview, show toggle ── */
@media (max-width: 899px) {
  .browser { width: 280px !important; }
  .settings-panel { width: 220px; }

  /* Hide preview panel by default, toggled via JS */
  .preview-panel { display: none; }
  .preview-panel.tablet-visible { display: flex; }

  /* Preview toggle button */
  .preview-toggle-btn {
    display: flex !important;
  }

  /* Compact topbar */
  .brand-sub { display: none; }
  .topbar-search { display: none; }
  .topbar-divider { display: none; }
}

/* ── Show preview toggle button only on small tablet ── */
.preview-toggle-btn { display: none; }

