:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2b313d;
  --text: #e8ecf3;
  --muted: #949cad;
  --accent: #ff8a3d;
  --accent-2: #ffb072;
  --ok: #4ade80;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); }

/* ------------------------------------------------------------- chrome --- */
.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

header.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: none;
  z-index: 20;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: #fff; }
.brand .sub {
  font-weight: 500; font-size: 11px; color: var(--muted);
  letter-spacing: 0.01em; margin-left: 2px;
}
@media (max-width: 1100px) { .brand .sub { display: none; } }
.brand .dot {
  width: 10px; height: 10px; border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), #ff5f6d);
}

.steps { display: flex; gap: 6px; margin-left: auto; }
.steps .step {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  color: var(--muted); font-size: 13px; white-space: nowrap;
  text-decoration: none;
}
.steps .step b {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel-2); color: var(--muted);
  font-size: 11px; font-weight: 700;
}
.steps .step.active { color: var(--text); background: var(--panel-2); }
.steps .step.active b { background: var(--accent); color: #1a1004; }
.steps .step.done b { background: #33405a; color: var(--text); }

/* --------------------------------------------------------------- body --- */
.body { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: 330px; flex: none;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 18px;
}
.sidebar.right { border-right: none; border-left: 1px solid var(--line); width: 340px; }

.stage { flex: 1; position: relative; min-width: 0; }

/* ------------------------------------------------------------ controls --- */
.group { margin-bottom: 22px; }
.group > h3 {
  margin: 0 0 10px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}

label.field { display: block; margin-bottom: 13px; }
label.field > span.lab {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: var(--muted); margin-bottom: 5px;
}
label.field > span.lab b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }

input[type='range'] {
  width: 100%; accent-color: var(--accent);
  background: transparent; height: 22px;
}

input[type='text'], input[type='number'], select {
  width: 100%; padding: 9px 11px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; outline: none;
}
input[type='text']:focus, select:focus { border-color: var(--accent); }

/* Four schemes sit as an even 2x2 in the sidebar rather than 3 + 1. */
.seg { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg button {
  min-width: 0;
  padding: 8px 10px; font-size: 13px;
  background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); border-color: var(--accent); color: #1a1004; font-weight: 600; }

.check { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

button.primary {
  width: 100%; padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent), #ff6f43);
  color: #1a1004; font-weight: 700; font-size: 15px;
  border: none; border-radius: var(--radius); cursor: pointer;
}
button.primary:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }
button.ghost {
  width: 100%; padding: 11px 16px; margin-top: 8px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; font-size: 14px;
}
button.ghost:hover { color: var(--text); border-color: var(--muted); }

.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.readout {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 13px; font-size: 13px;
}
.readout .row { display: flex; justify-content: space-between; padding: 2px 0; }
.readout .row span { color: var(--muted); }
.readout .row b { font-variant-numeric: tabular-nums; font-weight: 600; }

.warn {
  background: rgba(255, 138, 61, 0.1);
  border: 1px solid rgba(255, 138, 61, 0.35);
  color: var(--accent-2);
  border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin-top: 10px;
}

/* ------------------------------------------------------- selection box --- */
#map { position: absolute; inset: 0; background: #11131a; }

.sel-layer { position: absolute; inset: 0; pointer-events: none; z-index: 500; }
.sel-layer.arming { pointer-events: auto; cursor: crosshair; }

.sel-shade {
  position: absolute; inset: 0;
  /* Four-sided mask: dark everywhere except the chosen box. */
  pointer-events: none;
}

.sel-box {
  position: absolute;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(8, 10, 14, 0.55);
  cursor: move;
  pointer-events: auto;
  touch-action: none;
}
.sel-box::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255,138,61,.35) 1px, transparent 1px) 0 33.33% / 100% 33.34%,
    linear-gradient(90deg, rgba(255,138,61,.35) 1px, transparent 1px) 33.33% 0 / 33.34% 100%;
  pointer-events: none;
}

.sel-handle {
  position: absolute; width: 14px; height: 14px;
  background: #fff; border: 2px solid var(--accent);
  border-radius: 3px; pointer-events: auto; touch-action: none;
  z-index: 2;
}
.sel-handle.nw { left: -8px; top: -8px; cursor: nwse-resize; }
.sel-handle.ne { right: -8px; top: -8px; cursor: nesw-resize; }
.sel-handle.sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.sel-handle.se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.sel-handle.n { left: 50%; top: -8px; margin-left: -7px; cursor: ns-resize; }
.sel-handle.s { left: 50%; bottom: -8px; margin-left: -7px; cursor: ns-resize; }
.sel-handle.w { left: -8px; top: 50%; margin-top: -7px; cursor: ew-resize; }
.sel-handle.e { right: -8px; top: 50%; margin-top: -7px; cursor: ew-resize; }

.sel-size {
  position: absolute; left: 50%; bottom: -32px; transform: translateX(-50%);
  background: var(--accent); color: #1a1004;
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
}

.map-tools {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 600; display: flex; gap: 8px;
  background: rgba(23, 26, 33, 0.92); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: var(--shadow);
}
.map-tools button {
  padding: 7px 12px; font-size: 13px; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--muted); border: none;
}
.map-tools button.on, .map-tools button:hover { background: var(--panel-2); color: var(--text); }

.search-wrap { position: relative; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; z-index: 30; box-shadow: var(--shadow);
}
.search-results div {
  padding: 9px 11px; font-size: 13px; cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.search-results div:last-child { border-bottom: none; }
.search-results div:hover { background: #262b36; }

/* -------------------------------------------------------------- viewer --- */
#viewer { position: absolute; inset: 0; }

.overlay-msg {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(15, 17, 21, 0.85); z-index: 10; text-align: center;
}
.overlay-msg .inner { max-width: 380px; padding: 24px; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.frame-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.frame-card {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px; cursor: pointer; text-align: center;
}
.frame-card:hover { border-color: var(--muted); }
.frame-card.on { border-color: var(--accent); background: rgba(255, 138, 61, 0.08); }
.frame-card svg { display: block; width: 100%; height: 46px; }
.frame-card span { font-size: 12px; color: var(--muted); display: block; margin-top: 4px; }
.frame-card.on span { color: var(--text); font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px;
}
.stat span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat b { font-size: 17px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- shapes --- */
.shape-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shape-card {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 8px 9px; cursor: pointer; text-align: center;
  color: var(--muted); transition: border-color .15s, color .15s, background .15s;
}
.shape-card:hover { border-color: var(--muted); color: var(--text); }
.shape-card.on {
  border-color: var(--accent); background: rgba(255,138,61,.09); color: var(--accent);
}
.shape-card svg { width: 34px; height: 34px; display: block; margin: 0 auto 5px; }
.shape-card span { font-size: 11.5px; }
.shape-card.on span { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------ credits --- */
.credit {
  font-size: 11.5px; color: #6b7382; margin: 18px 0 0;
  padding-top: 14px; border-top: 1px solid var(--line); line-height: 1.6;
}
.credit a { color: #7e8798; text-decoration: none; }
.credit a:hover { color: var(--accent-2); }

/* --------------------------------------------------------- live badge --- */
.live-badge {
  position: absolute; left: 14px; top: 14px; z-index: 600;
  display: flex; align-items: center; gap: 8px;
  background: rgba(23, 26, 33, 0.92); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px 6px 10px; font-size: 12px; color: var(--muted);
  box-shadow: var(--shadow); transition: opacity 0.4s;
}
.live-badge i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
.live-badge.ready i { background: var(--ok); animation: none; }
.live-badge.ready { color: var(--text); }
.live-badge[hidden] { display: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* --------------------------------------------------------- text items --- */
.text-item {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px; margin-bottom: 9px;
}
.text-item .head { display: flex; gap: 7px; align-items: center; margin-bottom: 7px; }
.text-item .head input { flex: 1; }
.text-item .kill {
  flex: none; width: 30px; height: 34px; border-radius: 7px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 15px;
}
.text-item .kill:hover { color: #ff6f6f; border-color: #ff6f6f; }
.text-item .seg button { min-width: 0; padding: 6px 7px; font-size: 11.5px; }
.text-item details { margin-top: 8px; }
.text-item summary {
  cursor: pointer; font-size: 12px; color: var(--muted); list-style: none; user-select: none;
}
.text-item summary::-webkit-details-marker { display: none; }
.text-item summary::before { content: '⌄  '; }
.text-item details[open] summary::before { content: '⌃  '; }
.text-item .adv { padding-top: 9px; }
.text-item .adv label.field { margin-bottom: 9px; }

/* ------------------------------------------------------------- slots --- */
.slot-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.slot-row:last-child { border-bottom: none; }
.slot-row .nm { flex: 1; font-size: 13.5px; }
.slot-row .chips { display: flex; gap: 4px; }
.slot-chip {
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; padding: 0; position: relative;
}
.slot-chip.on { border-color: var(--text); }
.slot-chip span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; mix-blend-mode: difference; color: #fff;
}
.swatches { display: flex; gap: 8px; margin-bottom: 12px; }
.swatches label { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }
.swatches input[type='color'] {
  display: block; width: 100%; height: 30px; padding: 0; cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 7px;
}

@media (max-width: 900px) {
  .body { flex-direction: column; }
  .sidebar, .sidebar.right { width: auto; border: none; border-top: 1px solid var(--line); max-height: 46vh; }
  .stage { min-height: 46vh; }
  .steps .step span { display: none; }
}

/* =========================================================== paywall === */
.lock-card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,138,61,.13), rgba(255,95,109,.06) 55%, transparent);
  border: 1px solid rgba(255,138,61,.32);
  border-radius: 14px; padding: 18px 16px 16px;
}
.lock-card::before {
  content: ''; position: absolute; inset: -40% -30% auto auto;
  width: 210px; height: 210px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,138,61,.22), transparent 68%);
  pointer-events: none;
}
.lock-card .lk-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lock-card .lk-icon {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #ff5f6d);
  display: grid; place-items: center; font-size: 16px;
}
.lock-card h4 { margin: 0; font-size: 15px; letter-spacing: -0.01em; }
.lock-card .lk-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.lock-card ul { list-style: none; margin: 0 0 14px; padding: 0; }
.lock-card li {
  font-size: 12.5px; color: #c3cad6; padding: 3px 0 3px 20px; position: relative;
}
.lock-card li::before {
  content: '✓'; position: absolute; left: 2px; color: var(--accent); font-weight: 700; font-size: 11px;
}
.lock-card .price-row {
  display: flex; align-items: baseline; gap: 7px; margin: 0 0 13px;
}
.lock-card .price-row b { font-size: 27px; letter-spacing: -0.03em; }
.lock-card .price-row span { font-size: 12.5px; color: var(--muted); }

.unlocked-card {
  background: linear-gradient(160deg, rgba(74,222,128,.14), transparent 60%);
  border: 1px solid rgba(74,222,128,.34);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
}
.unlocked-card .uc-top { display: flex; align-items: center; gap: 9px; }
.unlocked-card .uc-dot {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: var(--ok); color: #06210f; display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
}
.unlocked-card b { font-size: 14px; }
.unlocked-card p { margin: 7px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ------------------------------------------------------ pricing modal --- */
.sheet {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(6, 8, 12, 0.78); backdrop-filter: blur(14px);
  display: grid; place-items: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity 0.22s ease;
  overflow-y: auto;
}
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet-inner {
  width: min(1040px, 100%); background: var(--panel);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 40px 90px rgba(0,0,0,.6); padding: 34px 34px 28px;
  transform: translateY(14px) scale(0.985); transition: transform 0.26s cubic-bezier(.2,.9,.3,1);
  position: relative; margin: auto;
}
.sheet.open .sheet-inner { transform: none; }
.sheet-close {
  position: absolute; right: 16px; top: 14px; width: 32px; height: 32px;
  border-radius: 9px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1;
}
.sheet-close:hover { color: var(--text); border-color: var(--muted); }

.sheet h2 {
  margin: 0 0 6px; font-size: 27px; letter-spacing: -0.03em; text-align: center;
}
.sheet .lede {
  margin: 0 auto 26px; max-width: 560px; text-align: center;
  color: var(--muted); font-size: 14px; line-height: 1.6;
}

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.tier {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 15px; padding: 22px 20px; cursor: pointer;
  transition: border-color .18s, transform .18s, background .18s;
  position: relative; display: flex; flex-direction: column; min-height: 340px;
}
.tier:hover { border-color: #4a5464; transform: translateY(-2px); }
.tier.featured {
  border-color: rgba(255,138,61,.55);
  background: linear-gradient(170deg, rgba(255,138,61,.1), var(--panel-2) 58%);
}
.tier.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tier .badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), #ff5f6d); color: #1a1004;
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px; white-space: nowrap;
}
.tier h3 { margin: 0 0 3px; font-size: 16px; letter-spacing: -0.01em; }
.tier .blurb { font-size: 12.5px; color: var(--muted); min-height: 34px; line-height: 1.45; }
.tier .amount { display: flex; align-items: baseline; gap: 6px; margin: 14px 0 16px; }
.tier .amount b { font-size: 38px; letter-spacing: -0.045em; line-height: 1; }
.tier .amount span { font-size: 12.5px; color: var(--muted); }
.tier ul { list-style: none; margin: 0 0 18px; padding: 0; flex: 1; }
.tier li {
  font-size: 12.5px; color: #c3cad6; padding: 4px 0 4px 20px; position: relative; line-height: 1.45;
}
.tier li::before {
  content: '✓'; position: absolute; left: 1px; top: 4px; color: var(--accent);
  font-weight: 700; font-size: 11px;
}
.tier .pick {
  width: 100%; padding: 11px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  font-size: 13.5px; font-weight: 600;
}
.tier.featured .pick, .tier.selected .pick {
  background: linear-gradient(135deg, var(--accent), #ff6f43); color: #1a1004; border-color: transparent;
}

.sheet-foot { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sheet-foot .email-row { display: flex; gap: 8px; width: min(430px, 100%); }
.sheet-foot .email-row input { flex: 1; }
.trust {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  font-size: 11.5px; color: #6b7382;
}
.trust b { color: #8c94a3; font-weight: 600; }
.sheet .restore { font-size: 12px; color: var(--muted); text-align: center; }
.sheet .restore a { cursor: pointer; }
.sheet .err {
  color: #ff8f8f; font-size: 12.5px; text-align: center; min-height: 16px;
}
.mode-note {
  text-align: center; font-size: 11.5px; margin: 0 0 18px;
  padding: 7px 12px; border-radius: 8px;
  background: rgba(255,138,61,.1); border: 1px solid rgba(255,138,61,.3); color: var(--accent-2);
}

@media (max-width: 860px) {
  .tiers { grid-template-columns: 1fr; }
  .tier { min-height: 0; }
  .sheet-inner { padding: 26px 18px 20px; }
}

/* ------------------------------------------------------- account chip --- */
.acct {
  display: flex; align-items: center; gap: 8px; margin-left: 14px;
  padding: 5px 12px 5px 8px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted); text-decoration: none; white-space: nowrap;
}
.acct:hover { border-color: var(--muted); color: var(--text); }
.acct .pip {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff5f6d); color: #1a1004;
  font-size: 10px; font-weight: 800;
}
.acct.studio .pip { background: linear-gradient(135deg, #4ade80, #22c55e); color: #06210f; }
@media (max-width: 760px) { .acct .txt { display: none; } }

/* ------------------------------------------------------ receipt page --- */
.centre-page {
  min-height: 100%; display: grid; place-items: center; padding: 40px 20px;
}
.receipt {
  width: min(560px, 100%); background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; padding: 36px 32px;
  box-shadow: var(--shadow); text-align: center;
}
.receipt .tick {
  width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 50%;
  background: linear-gradient(135deg, #4ade80, #22c55e); color: #06210f;
  display: grid; place-items: center; font-size: 27px; font-weight: 800;
  animation: pop .45s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
.receipt h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.03em; }
.receipt p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 18px; }
.licence-key {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px;
}
.licence-key code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px; letter-spacing: .04em; color: var(--text);
}
.licence-key button {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 7px; padding: 6px 11px; font-size: 12px; cursor: pointer; flex: none;
}
.licence-key button:hover { color: var(--text); border-color: var(--muted); }

/* --------------------------------------------------------- library --- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lib-card {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 13px; padding: 16px; cursor: pointer; transition: border-color .16s, transform .16s;
}
.lib-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.lib-card h4 { margin: 0 0 4px; font-size: 14.5px; }
.lib-card .meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty {
  text-align: center; padding: 56px 20px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 14px;
}

/* ------------------------------------------------------- feature picker --- */
.pick-pop {
  position: absolute; z-index: 900; width: 190px;
  background: rgba(23, 26, 33, 0.97); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 11px; padding: 11px;
  box-shadow: var(--shadow);
}
.pick-pop[hidden] { display: none; }
.pp-title {
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-chips { display: flex; gap: 6px; margin-bottom: 8px; }
.pp-chips button {
  flex: 1; height: 30px; border-radius: 7px; cursor: pointer;
  border: 2px solid transparent; position: relative; padding: 0;
}
.pp-chips button.on { border-color: var(--text); }
.pp-chips button span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: #fff; mix-blend-mode: difference;
}
.pp-reset {
  width: 100%; padding: 7px; font-size: 11.5px; cursor: pointer;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 7px;
}
.pp-reset:hover { color: var(--text); border-color: var(--muted); }

/* --------------------------------------------------- product page chrome */
.product-chip {
  margin-left: 10px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  color: var(--accent-2);
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
@media (max-width: 760px) { .product-chip { display: none; } }

/* -------------------------------------------------------- colour palettes */
.palette-row {
  display: grid; gap: 6px; margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.palette {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 8px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted); font-size: 12px; font-weight: 500; text-align: left;
}
.palette:hover { color: var(--text); border-color: var(--muted); }
.palette.on { color: var(--text); border-color: var(--accent); background: rgba(255, 138, 61, 0.09); }
.palette .dots { display: flex; flex-shrink: 0; }
.palette .dots i {
  width: 9px; height: 14px; border: 1px solid rgba(0, 0, 0, 0.35);
}
.palette .dots i:first-child { border-radius: 3px 0 0 3px; }
.palette .dots i:last-child { border-radius: 0 3px 3px 0; }
