/* ═══════════════════════════════════════════════════════════════
   SHAPE · Product Master — design system
   Palette taken straight from the company logo:
     amber  #FFAB2D   cream #E6E0CE   charcoal #2C2E35
   ═══════════════════════════════════════════════════════════════ */
/* Tokens lifted straight from shape-connect-web/src/index.css so the tool
   looks like part of the same product, not a bolt-on. */
:root {
  --ink:        #0F172A;   /* --text-main   */
  --ink-2:      #1A1D20;   /* --accent      */
  --ink-soft:   #334155;
  --muted:      #64748B;   /* --text-secondary */
  --muted-2:    #94A3B8;

  --amber:      #FAAE00;   /* --primary       */
  --amber-dark: #D99600;   /* --primary-hover */
  --amber-tint: #FFF3DF;

  --cream:      #F0ECE4;
  --cream-soft: #FAF8F4;

  --bg:         #F8FAFC;
  --surface:    #FFFFFF;
  --border:     #E2E8F0;   /* --glass-border */
  --border-2:   #CBD5E1;

  --ok:         #065F46;
  --ok-bg:      #D1FAE5;
  --err:        #991B1B;
  --err-bg:     #FEE2E2;
  --warn:       #B5650A;
  --warn-bg:    #FFF3DF;

  --sidebar:    268px;
  --rail:       0px;
  --r:          10px;
  --r-lg:       14px;
  --shadow:     0 1px 2px rgba(15,23,42,.05), 0 4px 14px rgba(15,23,42,.05);
  --shadow-lg:  0 12px 34px rgba(15,23,42,.16);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'SF Mono', 'Cascadia Mono', Consolas, 'Roboto Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--amber); color: var(--ink-2); }

/* ── shell ─────────────────────────────────────────────── */
.shell { min-height: 100vh; display: flex; }

/* Sidebar is PERMANENT on desktop — it sits in the layout and pushes the
   content across. It only turns into an overlay drawer below 1024px, where
   there genuinely isn't room for both. */
.scrim {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 70;
  backdrop-filter: blur(2px);
}
.scrim.on { opacity: 1; pointer-events: auto; }

.sidebar {
  position: sticky; top: 0; z-index: 80;
  flex: 0 0 var(--sidebar); width: var(--sidebar); height: 100vh;
  background: var(--surface);
  color: var(--ink);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.closebtn {
  display: none;                     /* only needed in overlay mode */
  position: absolute; top: 16px; right: 14px;
  background: var(--cream-soft); border: 1px solid var(--border); color: var(--ink-soft);
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
  place-items: center;
}
.closebtn:hover { background: var(--err-bg); color: var(--err); border-color: #F0CFCA; }
.closebtn svg { width: 15px; height: 15px; stroke-width: 2.4; }
.brand { padding: 20px 20px 18px; border-bottom: 1px solid var(--border); }
.brand img { width: 122px; display: block; border-radius: 5px; }
.brand .tag {
  margin-top: 10px; font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--amber-dark); font-weight: 800;
}
.brand .tag span { color: var(--muted-2); font-weight: 600; }

.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--muted-2); font-weight: 800; padding: 14px 10px 7px;
}
.nav button {
  width: 100%; display: flex; align-items: center; gap: 11px;
  background: none; border: 0; color: var(--ink-soft);
  padding: 10px 11px; border-radius: 9px; font-size: 13.5px; font-weight: 550;
  cursor: pointer; font-family: inherit; text-align: left;
  transition: background .13s, color .13s;
  position: relative;
}
.nav button svg { width: 17px; height: 17px; flex: 0 0 17px; stroke-width: 1.9; }
.nav button:hover { background: var(--cream-soft); color: var(--ink); }
.nav button.on { background: var(--amber-tint); color: var(--ink); font-weight: 750; }
.nav button.on::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--amber); border-radius: 0 3px 3px 0;
}
.nav button.on svg { color: var(--amber-dark); }
.nav button svg { color: var(--muted); }

.sidefoot { padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.userchip {
  display: flex; align-items: center; gap: 10px;
  background: var(--cream-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 11px;
}
.avatar {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px;
  background: var(--amber); color: var(--ink-2);
  display: grid; place-items: center; font-weight: 800; font-size: 12.5px;
}
.userchip .u1 { font-size: 12.5px; font-weight: 700; color: var(--ink); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip .u2 { font-size: 10.5px; color: var(--muted); text-transform: capitalize; }
.linklike {
  background: none; border: 0; color: var(--muted); font-size: 11px;
  cursor: pointer; padding: 8px 2px 0; font-family: inherit;
}
.linklike:hover { color: var(--amber-dark); }

/* ── back to Shape Connect ── */
.backlink {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin: 4px 0 2px; padding: 11px 11px; border-radius: 10px;
  background: var(--ink-2); color: #fff; border: 0; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 650; text-align: left;
  text-decoration: none; transition: background .13s;
}
.backlink:hover { background: #2D3748; }
.backlink svg { width: 16px; height: 16px; flex: 0 0 16px; stroke-width: 2.1; color: var(--amber); }
.backlink span { flex: 1; }
.backlink small { font-size: 10px; opacity: .55; display: block; font-weight: 500; }

/* ── content ───────────────────────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 14px 26px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 40;
}
.menubtn {
  display: none;                     /* shown only in overlay mode */
  place-items: center; width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; color: var(--ink); transition: background .13s, border-color .13s;
}
.menubtn:hover { background: var(--cream-soft); border-color: var(--border-2); }
.menubtn svg { width: 19px; height: 19px; stroke-width: 2; }
.topbrand { display: none; }   /* the sidebar already shows it */
.topdiv { display: none; }
.topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: -.35px; color: var(--ink); }
.topbar p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.topbar .spacer { flex: 1; }
.page { padding: 24px 30px 70px; max-width: 1680px; width: 100%; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow); margin-bottom: 20px;
}
.card-h { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-h h2 { font-size: 14.5px; font-weight: 700; letter-spacing: -.15px; }
.card-h p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.card-b { padding: 22px; }
.card-f {
  padding: 16px 22px; border-top: 1px solid var(--border);
  background: var(--cream-soft); border-radius: 0 0 var(--r-lg) var(--r-lg);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

/* ── forms ─────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 15px 16px; }
.sect {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px;
  margin-top: 18px; padding-top: 4px;
}
.sect:first-child { margin-top: 0; }
.sect b { font-size: 10.5px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--ink); font-weight: 800; }
.sect i { flex: 1; height: 1px; background: var(--border); }

label {
  display: block; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 700; margin-bottom: 5px;
}
label em { color: var(--amber-dark); font-style: normal; }
input, select, textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r);
  padding: 9px 11px; transition: border-color .13s, box-shadow .13s;
}
select { cursor: pointer; }
input:hover, select:hover { border-color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,171,45,.18);
}
input::placeholder { color: var(--muted-2); }
input[type=file] { padding: 8px; background: var(--cream-soft); cursor: pointer; }

.row { display: flex; gap: 13px; align-items: flex-end; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 165px; }
.row > div.tight { flex: 0 0 auto; min-width: 0; }

/* ── buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: 13.5px; font-weight: 700; letter-spacing: .1px;
  padding: 10px 18px; border-radius: var(--r); border: 1px solid transparent;
  cursor: pointer; transition: background .13s, border-color .13s, transform .06s, box-shadow .13s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; stroke-width: 2.1; }
.btn-primary { background: var(--amber); color: var(--ink); box-shadow: 0 1px 2px rgba(224,138,0,.25); }
.btn-primary:hover { background: #FFB846; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--cream-soft); border-color: var(--muted-2); }
.btn-danger { background: var(--surface); color: var(--err); border-color: #EBC7C2; }
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.textlink {
  background: none; border: 0; color: var(--amber-dark); font-weight: 700;
  font-size: 13px; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 0;
}
.textlink:hover { text-decoration: underline; }

/* ── feedback ──────────────────────────────────────────── */
.note {
  display: none; gap: 10px; padding: 12px 15px; border-radius: var(--r);
  font-size: 13.5px; margin-bottom: 16px; white-space: pre-line; line-height: 1.45;
  border: 1px solid transparent;
}
.note.show { display: flex; }
.note.ok   { background: var(--ok-bg);   color: var(--ok);   border-color: #C6E5D4; }
.note.err  { background: var(--err-bg);  color: var(--err);  border-color: #F0CFCA; }
.note.warn { background: var(--warn-bg); color: var(--warn); border-color: #F6DDB2; }

#toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 90; }
.toast {
  background: var(--ink); color: #fff; padding: 13px 17px; border-radius: var(--r);
  box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 10px; max-width: 380px;
  animation: slideIn .22s cubic-bezier(.2,.8,.3,1);
}
.toast.ok  { border-left: 3px solid #3DD68C; }
.toast.err { border-left: 3px solid #FF6B5E; }
.toast b { color: var(--amber); font-weight: 700; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ── tables ────────────────────────────────────────────── */
.tw { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--cream-soft); text-align: left; padding: 10px 14px;
  font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 800; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FDFCF9; }
.code {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; color: var(--ink);
  background: var(--cream-soft); padding: 2px 7px; border-radius: 5px;
  border: 1px solid var(--border);
}

/* ── misc bits ─────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 7px; background: var(--cream-soft);
  border: 1px solid var(--border); border-radius: 20px; padding: 4px 6px 4px 12px;
  margin: 0 6px 7px 0; font-size: 13px; font-weight: 500;
}
.pill x {
  cursor: pointer; color: var(--muted); font-weight: 700; line-height: 1;
  width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%;
}
.pill x:hover { background: var(--err-bg); color: var(--err); }

.badge {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; padding: 3px 8px; border-radius: 5px;
}
.badge.amber { background: var(--amber-tint); color: var(--warn); }
.badge.green { background: var(--ok-bg); color: var(--ok); }
.badge.grey  { background: #F0EEE9; color: var(--muted); }
.badge.red   { background: var(--err-bg); color: var(--err); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .n { font-size: 25px; font-weight: 800; letter-spacing: -.8px; line-height: 1.1; }
.stat .l { font-size: 11px; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 5px; }
.stat.accent { border-left: 3px solid var(--amber); }

.muted { color: var(--muted); font-size: 12.5px; }
.empty { text-align: center; padding: 46px 24px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; stroke-width: 1.5; color: var(--border-2); margin-bottom: 12px; }
.empty h3 { font-size: 14.5px; color: var(--ink-soft); font-weight: 700; margin-bottom: 5px; }
.empty p { font-size: 13px; max-width: 380px; margin: 0 auto; line-height: 1.55; }

.spin {
  width: 15px; height: 15px; border: 2px solid rgba(44,46,53,.2);
  border-top-color: var(--ink); border-radius: 50%; animation: sp .6s linear infinite;
}
.btn-primary .spin { border-color: rgba(44,46,53,.3); border-top-color: var(--ink); }
.btn-dark .spin { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
@keyframes sp { to { transform: rotate(360deg); } }

.center-lock { min-height: 78vh; display: grid; place-items: center; padding: 30px; }
.lockcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 44px 40px; max-width: 440px; text-align: center;
}
.lockcard img { width: 96px; margin-bottom: 22px; }
.lockcard h2 { font-size: 18px; font-weight: 700; margin-bottom: 9px; }
.lockcard p { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin-bottom: 22px; }

/* import: duplicate merge rows */
.merge {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); margin-bottom: 9px;
}
.merge.review { border-color: #F0CFCA; background: #FFFBFA; }
.merge .from { flex: 2; min-width: 210px; }
.merge .arrow { color: var(--muted-2); font-size: 17px; }
.merge .to { flex: 1; min-width: 180px; }
.merge .to input { font-weight: 700; border-color: var(--amber); background: var(--amber-tint); }
.vchip {
  display: inline-block; background: var(--cream-soft); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 9px; margin: 0 5px 5px 0; font-size: 12.5px;
}
.vchip small { color: var(--muted); font-weight: 700; margin-left: 4px; }

.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 9px; padding: 8px 14px 8px 9px;
  border: 1px solid var(--border); border-radius: 22px; background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.step b {
  width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cream); color: var(--ink-soft); font-size: 11.5px; font-weight: 800;
}
.step.on { border-color: var(--amber); color: var(--ink); background: var(--amber-tint); }
.step.on b { background: var(--amber); color: var(--ink); }
.step.done b { background: var(--ok); color: #fff; }
.step.done { color: var(--ink-soft); }

.expcard {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 11px;
  background: var(--surface); transition: border-color .13s, box-shadow .13s;
}
.expcard:hover { border-color: var(--amber); box-shadow: 0 2px 10px rgba(255,171,45,.13); }
.expicon {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px;
  background: var(--amber-tint); color: var(--warn); display: grid; place-items: center;
}
.expcard .t { flex: 1; min-width: 0; }
.expcard .t b { font-size: 14px; font-weight: 700; display: block; }
.expcard .t span { font-size: 12px; color: var(--muted); font-family: var(--mono); }

@media (max-width: 1023px) {
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    transform: translateX(-100%);
    transition: transform .24s cubic-bezier(.3,.9,.3,1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .closebtn { display: grid; }
  .menubtn  { display: inline-grid; }
  .topbrand { display: block; height: 26px; opacity: .92; }
  .topdiv   { display: block; }
}
@media (max-width: 860px) {
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .topbar h1 { font-size: 17px; }
  .topbar p { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   Searchable dropdown (combobox)
   Replaces every native <select> — type to filter, arrows to move.
   ═══════════════════════════════════════════════════════════════ */
.cbx { position: relative; }
.cbx > input { padding-right: 32px; cursor: text; }
.cbx::after {
  content: ''; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px;
  border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.cbx.open > input { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(250,174,0,.18); }
.cbx-pop {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 5px);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r);
  box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; padding: 5px;
  display: none;
}
.cbx.open .cbx-pop { display: block; }
.cbx-opt {
  padding: 8px 11px; border-radius: 7px; cursor: pointer; font-size: 13.5px;
  display: flex; align-items: baseline; gap: 8px;
}
.cbx-opt:hover, .cbx-opt.hi { background: var(--amber-tint); }
.cbx-opt small { color: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.cbx-opt mark { background: rgba(250,174,0,.35); color: inherit; border-radius: 3px; padding: 0 1px; }
.cbx-none { padding: 14px 12px; color: var(--muted); font-size: 12.5px; text-align: center; }
.cbx-add {
  margin-top: 4px; border-top: 1px solid var(--border); padding: 9px 11px;
  color: var(--amber-dark); font-weight: 700; font-size: 12.5px; cursor: pointer; border-radius: 7px;
}
.cbx-add:hover { background: var(--amber-tint); }
.cbx-clear {
  position: absolute; right: 30px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--border); color: var(--ink-soft); font-size: 12px; line-height: 1;
  display: none; place-items: center;
}
.cbx.filled .cbx-clear { display: grid; }
.cbx-clear:hover { background: var(--err-bg); color: var(--err); }

/* ═══════════════════════════════════════════════════════════════
   Two-column create layout: form + sticky live card
   ═══════════════════════════════════════════════════════════════ */
.createwrap { display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 22px; align-items: start; }
@media (max-width: 1240px) { .createwrap { grid-template-columns: 1fr; } }

.preview { position: sticky; top: 84px; }
.pv-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.pv-hero {
  aspect-ratio: 4/3; background: var(--cream-soft); position: relative;
  display: grid; place-items: center; border-bottom: 1px solid var(--border);
}
.pv-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-hero .ph { color: var(--border-2); }
.pv-hero .ph svg { width: 40px; height: 40px; stroke-width: 1.4; }
.pv-count {
  position: absolute; right: 10px; bottom: 10px; background: rgba(15,23,42,.78);
  color: #fff; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px;
}
.pv-body { padding: 16px 18px; }
.pv-code {
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--amber-dark);
  letter-spacing: .4px;
}
.pv-name {
  font-size: 15.5px; font-weight: 700; line-height: 1.35; margin: 5px 0 10px;
  color: var(--ink); word-break: break-word; min-height: 21px;
}
.pv-name.empty { color: var(--muted-2); font-weight: 500; font-style: italic; }
.pv-mrp { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; }
.pv-mrp small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 5px; }
.pv-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.pv-tag {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
  background: var(--cream-soft); border: 1px solid var(--border); color: var(--ink-soft);
}
.pv-tag.brand { background: var(--amber-tint); border-color: #F6DDB2; color: var(--warn); }
.pv-rows { border-top: 1px solid var(--border); }
.pv-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 18px; font-size: 12.5px; border-bottom: 1px solid var(--border);
}
.pv-row:last-child { border-bottom: 0; }
.pv-row span { color: var(--muted); }
.pv-row b { font-weight: 700; text-align: right; word-break: break-word; }
.pv-fill { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--cream-soft); }
.pv-bar { height: 5px; border-radius: 4px; background: var(--border); overflow: hidden; }
.pv-bar i { display: block; height: 100%; background: var(--amber); transition: width .25s; }
.pv-fill p { font-size: 11.5px; color: var(--muted); margin-top: 7px; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   Media gallery — image 1..N + video
   ═══════════════════════════════════════════════════════════════ */
.media { grid-column: 1 / -1; }
.mgrid { display: flex; flex-wrap: wrap; gap: 11px; }
.mthumb {
  width: 104px; height: 104px; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--border); position: relative; background: var(--cream-soft);
}
.mthumb img, .mthumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mthumb .no {
  position: absolute; left: 6px; top: 6px; background: rgba(15,23,42,.78); color: #fff;
  font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 20px;
}
.mthumb .main {
  position: absolute; left: 6px; bottom: 6px; background: var(--amber); color: var(--ink-2);
  font-size: 9.5px; font-weight: 800; padding: 2px 7px; border-radius: 20px; letter-spacing: .4px;
}
.mthumb .rm {
  position: absolute; right: 5px; top: 5px; width: 21px; height: 21px; border-radius: 50%;
  background: rgba(15,23,42,.8); color: #fff; border: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 13px; line-height: 1;
}
.mthumb .rm:hover { background: var(--err); }
.madd {
  width: 104px; height: 104px; border-radius: var(--r); cursor: pointer;
  border: 1.5px dashed var(--border-2); background: var(--surface);
  display: grid; place-items: center; gap: 5px; color: var(--muted);
  font-size: 11.5px; font-weight: 700; transition: border-color .13s, background .13s, color .13s;
}
.madd:hover { border-color: var(--amber); background: var(--amber-tint); color: var(--amber-dark); }
.madd svg { width: 19px; height: 19px; stroke-width: 2; }
.madd.busy { pointer-events: none; opacity: .6; }

/* name field spans wide + has a rebuild button */
.namewrap { grid-column: 1 / -1; }
.namerow { display: flex; gap: 9px; align-items: stretch; }
.namerow > .cbx, .namerow > input { flex: 1; }
/* The product name is the headline field — give it presence. */
.namerow > input {
  font-size: 15.5px; font-weight: 650; padding: 12px 14px;
  background: var(--cream-soft); border-color: var(--border-2);
}
.namerow > input:focus { background: var(--surface); }
.namehint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.namehint b { color: var(--amber-dark); font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════
   Modal — used by "Add new" on every master dropdown
   ═══════════════════════════════════════════════════════════════ */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 120; padding: 20px;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 420px; overflow: hidden;
  animation: popIn .18s cubic-bezier(.2,.9,.3,1);
}
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98) } to { opacity: 1; transform: none } }
.modal-h { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); }
.modal-h h3 { font-size: 15.5px; font-weight: 700; }
.modal-h p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.modal-b { padding: 20px 22px; }
.modal-f {
  padding: 14px 22px; background: var(--cream-soft); border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}
.modal-warn {
  margin-top: 12px; font-size: 12px; color: var(--warn); background: var(--warn-bg);
  border: 1px solid #F6DDB2; border-radius: 8px; padding: 9px 12px; line-height: 1.45;
}
.cbx-addrow {
  margin-top: 4px; border-top: 1px solid var(--border); padding: 10px 11px;
  color: var(--amber-dark); font-weight: 750; font-size: 12.5px; cursor: pointer;
  border-radius: 7px; display: flex; align-items: center; gap: 8px;
}
.cbx-addrow:hover { background: var(--amber-tint); }
.cbx-addrow svg { width: 14px; height: 14px; stroke-width: 2.4; }
textarea { width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r);
  padding: 10px 12px; line-height: 1.5; }
textarea:focus { outline: 0; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(250,174,0,.18); }
.modal.wide { max-width: 520px; }
