/* ============================================================
   COVER STUDIO — Generator UI + 3 cover styles
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0e0e10;
  color: #e8e8e3;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }

.seo-fallback {
  min-height: 100%;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 56px 24px;
  text-align: center;
  background: #0e0e10;
}
.seo-fallback h1 {
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 0;
  font-weight: 800;
}
.seo-fallback p {
  max-width: 620px;
  color: #a0a0a8;
  font-size: 16px;
  line-height: 1.6;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: 100vh;
  background: #0e0e10;
}

/* ------------ LEFT PANEL ------------ */
.panel {
  background: #141417;
  border-right: 1px solid #232328;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 24px;
}
.panel * { min-width: 0; }
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb { background: #2a2a30; border-radius: 4px; }

.panel-head {
  padding: 10px 16px;
  border-bottom: 1px solid #232328;
  position: sticky; top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(20,20,23,0.95);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.panel-brand { display: flex; align-items: center; }
.panel-brand-name { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.panel-brand-sub { font-size: 10px; color: #8a8a92; margin-top: 1px; line-height: 1.2; }
.panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.heart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #2a2a30;
  background: #1a1a1f;
  color: #ff7aa8;
  font-size: 17px;
  line-height: 1;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.heart-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,122,168,0.55);
  background: rgba(255,122,168,0.12);
}
.support-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(5px);
}
.support-modal {
  position: relative;
  width: min(420px, 100%);
  border: 1px solid #2b2b33;
  border-radius: 10px;
  background: #16161a;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  padding: 26px;
  color: #e8e8e3;
}
.support-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #2a2a30;
  background: #1d1d22;
  color: #e8e8e3;
  font-size: 17px;
  font-weight: 800;
}
.support-modal-heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: rgba(255,122,168,0.12);
  color: #ff7aa8;
  font-size: 22px;
}
.support-modal h2 {
  max-width: 310px;
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}
.support-modal p {
  color: #a0a0a8;
  font-size: 13px;
  line-height: 1.55;
}
.support-modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.support-modal-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid #2d2d34;
  color: #e8e8e3;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.support-modal-links .support-modal-coffee {
  border-color: rgba(124,255,178,0.54);
  background: rgba(124,255,178,0.12);
  color: #7CFFB2;
}

.sec { padding: 18px 22px; border-bottom: 1px solid #1c1c20; }
.sec-title {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: #8a8a92;
  margin-bottom: 12px;
}
.sec-title-sub {
  color: #56565d; font-weight: 500; letter-spacing: 0.04em; text-transform: none;
  margin-left: 4px;
}
.sec-body { display: flex; flex-direction: column; gap: 12px; }

.about-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid #24242a;
  border-radius: 8px;
  background: #17171b;
}
.about-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #a0a0a8;
  font-size: 12px;
  line-height: 1.45;
}
.about-copy strong {
  color: #e8e8e3;
  font-size: 13px;
}
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.about-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #2c2c33;
  border-radius: 6px;
  color: #e8e8e3;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.about-link--coffee {
  border-color: rgba(124,255,178,0.5);
  background: rgba(124,255,178,0.11);
  color: #7CFFB2;
}

.field { display: block; }
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.field-label {
  font-size: 11px; color: #a0a0a8;
  font-weight: 500;
}
.field-hide {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7a7a82;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.field-hide input {
  width: 12px;
  height: 12px;
  accent-color: #7CFFB2;
  cursor: pointer;
}
.field-control { display: block; }

.profile-row {
  display: grid;
  grid-template-columns: 1fr 32px 32px;
  gap: 6px;
  align-items: center;
}
.profile-actions {
  display: grid;
  grid-template-columns: 1fr;
}
.reset-btn {
  justify-content: center;
}
.profile-select { min-width: 0; }
.mini-btn {
  height: 32px;
  border-radius: 6px;
  background: #1d1d22;
  border: 1px solid #2a2a30;
  color: #e8e8e3;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.mini-btn:hover:not(:disabled) { background: #232329; border-color: #3a3a42; }
.mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.save-state {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #6a6a72;
}
.save-state.is-saved { color: #7CFFB2; }
.save-state.is-error { color: #FF6B35; }

.inp {
  width: 100%;
  background: #1d1d22;
  border: 1px solid #2a2a30;
  color: #e8e8e3;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}
.inp:focus { border-color: #7CFFB2; }
.inp--ta { resize: vertical; min-height: 56px; line-height: 1.45; font-family: inherit; }
.inp-range {
  width: 100%; height: 24px; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.inp-range::-webkit-slider-runnable-track { height: 4px; background: #2a2a30; border-radius: 2px; }
.inp-range::-moz-range-track { height: 4px; background: #2a2a30; border-radius: 2px; }
.inp-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%; background: #7CFFB2;
  margin-top: -5px; cursor: pointer; border: none;
}
.inp-range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: #7CFFB2;
  cursor: pointer; border: none;
}

.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.tier-count-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.tier-count-input {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Style cards */
.style-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #1d1d22;
  padding: 4px;
  border: 1px solid #2a2a30;
  border-radius: 8px;
}
.style-tab {
  min-height: 30px;
  border-radius: 5px;
  color: #a0a0a8;
  font-size: 11px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.style-tab:hover { color: #e8e8e3; }
.style-tab.is-active {
  background: #2a2a30;
  color: #e8e8e3;
  box-shadow: inset 0 0 0 1px #3a3a42;
}
.style-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.style-card {
  display: flex; flex-direction: column; align-items: stretch;
  padding: 8px;
  background: #1d1d22;
  border: 1px solid #2a2a30;
  border-radius: 8px;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.style-card:hover { border-color: #3a3a42; }
.style-card.is-active { border-color: #7CFFB2; background: #1f2a23; }
.style-thumb {
  width: 100%; aspect-ratio: 4/3;
  border-radius: 4px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}
.style-thumb--terminal {
  background: #0a0a0c;
  border: 1px solid #1a1a20;
}
.style-thumb--terminal::before {
  content: '$ _';
  position: absolute; left: 6px; top: 6px;
  font-family: 'JetBrains Mono', monospace;
  color: #7CFFB2;
  font-size: 9px;
}
.style-thumb--terminal::after {
  content: '';
  position: absolute; bottom: 6px; left: 6px; right: 6px; height: 8px;
  background: linear-gradient(90deg, #7CFFB2 30%, transparent 30%);
}
.style-thumb--editorial {
  background: #f5f5f0;
}
.style-thumb--editorial::before {
  content: '';
  position: absolute; top: 8px; left: 6px; right: 6px; height: 1px;
  background: #1a1a20;
}
.style-thumb--editorial::after {
  content: '$';
  position: absolute; right: 8px; bottom: 4px;
  font-family: Georgia, serif;
  font-size: 24px; font-weight: 700; color: #1a1a20;
  line-height: 1;
}
.style-thumb--brutalist {
  background: #FFE600;
}
.style-thumb--brutalist::before {
  content: '01';
  position: absolute; top: 4px; left: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px; font-weight: 900; color: #0a0a0c;
  line-height: 1;
}
.style-thumb--brutalist::after {
  content: '';
  position: absolute; bottom: 6px; left: 6px; right: 6px; height: 6px;
  background: #0a0a0c;
}

/* Sticker thumb */
.style-thumb--sticker {
  background: #FFE9F0;
  border: 1px solid #2A0A1A;
}
.style-thumb--sticker::before {
  content: '01';
  position: absolute; top: 6px; left: 6px;
  width: 22px; height: 22px;
  background: #FF4D8F; color: #2A0A1A;
  border: 2px solid #2A0A1A;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 9px;
  transform: rotate(-8deg);
}
.style-thumb--sticker::after {
  content: '$';
  position: absolute; bottom: 6px; right: 6px;
  width: 18px; height: 18px;
  background: #5DEFFF; color: #2A0A1A;
  border: 2px solid #2A0A1A;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 11px;
  transform: rotate(6deg);
}

/* Blueprint thumb */
.style-thumb--blueprint {
  background: #0A2A4A;
  background-image:
    linear-gradient(rgba(255,230,0,0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,230,0,0.18) 1px, transparent 1px);
  background-size: 10px 10px;
  border: 1px solid #1a3a5a;
}
.style-thumb--blueprint::before {
  content: '+';
  position: absolute; top: 2px; left: 4px;
  color: #FFE600; font-size: 12px; font-weight: 400;
}
.style-thumb--blueprint::after {
  content: '+';
  position: absolute; bottom: 2px; right: 4px;
  color: #FFE600; font-size: 12px; font-weight: 400;
}

/* Magazine thumb */
.style-thumb--magazine {
  background: #F0EAD8;
}
.style-thumb--magazine::before {
  content: 'V';
  position: absolute; top: 5px; left: 6px;
  color: #1A1410; font-family: Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
}
.style-thumb--magazine::after {
  content: '';
  position: absolute; left: 6px; right: 6px; bottom: 5px;
  height: 1px; background: #1A1410;
  box-shadow: 0 -8px 0 #C73E3A, 0 -16px 0 #1A1410;
}
.style-card-name { font-size: 12px; font-weight: 600; }
.style-card-sub { font-size: 10px; color: #8a8a92; margin-top: 1px; }
.style-preview {
  margin-top: 4px;
  padding: 10px;
  border: 1px solid #2a2a30;
  border-radius: 7px;
  background: #17171b;
}
.style-preview-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #8a8a92;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.style-preview-card {
  margin-top: 8px;
  padding: 12px;
  border-radius: 6px;
  background: var(--preview-bg);
  color: var(--preview-text);
  border: 1px solid color-mix(in srgb, var(--preview-text) 20%, transparent);
  overflow: hidden;
  position: relative;
}
.style-preview-card > * { position: relative; z-index: 1; }
.style-preview-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--preview-pattern) 18%, transparent), color-mix(in srgb, var(--preview-pattern2) 14%, transparent)),
    radial-gradient(ellipse at top right, color-mix(in srgb, var(--preview-pattern) 34%, transparent), transparent 62%),
    radial-gradient(ellipse at bottom left, color-mix(in srgb, var(--preview-pattern2) 28%, transparent), transparent 58%);
  opacity: 0.8;
  pointer-events: none;
}
.style-preview-kicker {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--preview-accent);
  color: var(--preview-bg);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.style-preview-title {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.05;
}
.style-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--preview-muted);
  font-size: 11px;
  font-weight: 700;
}
.style-preview-meta span:first-child { color: var(--preview-accent2); }
.style-preview-price-tag {
  color: var(--preview-muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}
.style-preview-bars {
  display: grid;
  grid-template-columns: 1fr 0.7fr 0.45fr;
  gap: 5px;
  margin-top: 10px;
}
.style-preview-bars span {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--preview-text) 30%, transparent);
}
.style-preview-bars span:nth-child(2) { background: var(--preview-accent); }
.style-preview-bars span:nth-child(3) { background: var(--preview-accent2); }
.style-custom-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.style-presets-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.style-custom-panel .style-preview { margin-top: 0; }
.style-custom-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}
.style-custom-title {
  color: #8a8a92;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.style-custom-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Segmented */
.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: #1d1d22;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #2a2a30;
}
.seg--4 { grid-template-columns: repeat(4, 1fr); }
.seg--views { grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); }
.seg-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 4px;
  border-radius: 5px;
  font-size: 11px; font-weight: 500;
  color: #a0a0a8;
  transition: background 0.15s, color 0.15s;
}
.seg-btn:hover { color: #e8e8e3; }
.seg-btn.is-active {
  background: #2a2a30;
  color: #e8e8e3;
  box-shadow: inset 0 0 0 1px #3a3a42;
}
.seg-btn-name { font-weight: 600; }
.seg-btn-sub { font-size: 9px; color: #6a6a72; margin-top: 2px; }
.seg-btn.is-active .seg-btn-sub { color: #8a8a92; }

/* Color row */
.color-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.color-pick {
  width: 36px; height: 32px;
  border: 1px solid #2a2a30;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
}
.color-row .inp { flex: 1; min-width: 100px; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.color-presets { display: flex; gap: 4px; width: 100%; margin-top: 4px; }
.color-preset {
  width: 28px; height: 22px;
  border-radius: 4px;
  border: 1px solid #2a2a30;
  flex: 1;
  transition: transform 0.1s;
}
.color-preset:hover { transform: scale(1.05); }

/* Toggle */
.tog {
  width: 38px; height: 22px;
  background: #2a2a30;
  border-radius: 11px;
  position: relative;
  transition: background 0.15s;
  padding: 0;
}
.tog.is-on { background: #7CFFB2; }
.tog-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #e8e8e3;
  border-radius: 50%;
  transition: left 0.18s;
}
.tog.is-on .tog-thumb { left: 18px; background: #0e0e10; }

/* Tier editor */
.tier-ed { border-bottom: 1px solid #1c1c20; }
.tier-ed-head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  text-align: left;
  transition: background 0.12s;
}
.tier-ed-head:hover { background: #181820; }
.tier-ed-head-l { display: flex; align-items: center; gap: 10px; }
.tier-ed-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #7CFFB2;
  font-weight: 600;
}
.tier-ed-name {
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em;
}
.tier-ed-head-r { display: flex; align-items: center; gap: 10px; }
.tier-ed-price {
  font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tier-ed-chev {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  background: #2a2a30;
  border-radius: 4px;
  font-size: 14px; font-weight: 600;
}
.tier-ed-body {
  padding: 4px 22px 18px;
  display: flex; flex-direction: column; gap: 12px;
}

/* Features list (in tier editor) */
.feat-list { padding-top: 4px; }
.feat-list-title {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #8a8a92;
  margin-bottom: 8px;
}
.feat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  font-size: 12px;
  cursor: default;
}
.feat-row input[type="checkbox"] { accent-color: #7CFFB2; width: 14px; height: 14px; cursor: pointer; }
.feature-label-input {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: text;
}
.feat-row .feature-remove-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  flex: 0 0 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
.feature-add-btn {
  width: 100%;
  min-height: 34px;
  margin-top: 4px;
  justify-content: center;
  font-size: 12px;
}

/* Theme panel — preset cards, color grid, font selects */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.preset-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 4px;
  background: #1d1d22;
  border: 1px solid #2a2a30;
  border-radius: 6px;
  text-align: center;
  transition: border-color 0.12s;
}
.preset-card:hover { border-color: #4a4a52; }
.preset-card--custom { border-style: dashed; }
.preset-swatch {
  width: 100%; aspect-ratio: 1.6/1;
  border-radius: 3px;
  position: relative;
  display: flex; align-items: flex-end; justify-content: center;
  gap: 3px;
  padding: 4px;
}
.preset-dot { width: 8px; height: 8px; border-radius: 50%; }
.preset-name { font-size: 10px; color: #a0a0a8; }

.theme-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.btn--compact {
  padding: 8px 10px;
  font-size: 12px;
}
.upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-btn input { display: none; }
.theme-status {
  margin-top: 7px;
  font-size: 11px;
  color: #8a8a92;
}
.theme-instructions {
  padding: 10px;
  border: 1px solid #2a2a30;
  border-radius: 6px;
  background: #17171b;
  color: #8a8a92;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.theme-instructions-title {
  margin-bottom: 6px;
  color: #e8e8e3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.theme-instructions-copy + .theme-instructions-copy { margin-top: 4px; }
.theme-instructions code {
  font-family: 'JetBrains Mono', monospace;
  color: #c7c7cf;
}
.theme-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.theme-flow div {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 5px;
  border-radius: 5px;
  background: #1d1d22;
  color: #c7c7cf;
  font-size: 10px;
  font-weight: 700;
}
.theme-flow span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7CFFB2;
  color: #0e0e10;
  font-size: 9px;
}
.theme-token-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}
.theme-token {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border: 1px solid #2a2a30;
  border-radius: 5px;
  background: #1d1d22;
}
.theme-token-swatch {
  grid-row: span 2;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
.theme-token-label {
  color: #e8e8e3;
  font-size: 10px;
  font-weight: 700;
}
.theme-token code {
  font-size: 10px;
  color: #8a8a92;
}
.theme-json-card {
  margin: 0 0 9px;
  padding: 9px;
  border-radius: 5px;
  background: #0f0f12;
  border: 1px solid #2a2a30;
  color: #c7c7cf;
  font-size: 10px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow: hidden;
}

/* Color grid */
.color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cf { display: flex; flex-direction: column; gap: 4px; }
.cf-label { font-size: 10px; color: #a0a0a8; font-weight: 500; }
.cf-row { display: flex; gap: 4px; align-items: center; }
.cf-pick {
  width: 28px; height: 28px;
  border: 1px solid #2a2a30;
  background: transparent;
  border-radius: 4px;
  cursor: pointer; padding: 1px;
  flex-shrink: 0;
}
.cf-text {
  flex: 1; min-width: 0;
  background: #1d1d22;
  border: 1px solid #2a2a30;
  color: #e8e8e3;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  padding: 6px 8px;
  border-radius: 4px;
  outline: none;
}
.cf-text:focus { border-color: #7CFFB2; }

/* Visibility grid */
.vis-grid {
  display: flex; flex-direction: column;
  gap: 2px;
}
.vis-row {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 0;
  font-size: 12px;
  cursor: pointer;
}
.vis-row .tog { flex-shrink: 0; }

/* Select element */
select.inp {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a8a92' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}
.export-bar {
  padding: 18px 22px 4px;
  display: flex; flex-direction: column; gap: 8px;
}
.btn {
  width: 100%;
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 13px; font-weight: 600;
  transition: transform 0.1s, background 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary {
  background: #7CFFB2;
  color: #0e0e10;
}
.btn--primary:hover:not(:disabled) { background: #95ffc1; }
.btn--ghost {
  background: #1d1d22;
  color: #e8e8e3;
  border: 1px solid #2a2a30;
}
.btn--ghost:hover:not(:disabled) { background: #232329; }

/* ============================================================
   STAGE
   ============================================================ */
.stage {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 50% 50%, #1a1a20 0%, #0a0a0c 100%);
  position: relative;
  overflow: hidden;
}
.stage::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(#1a1a20 1px, transparent 1px),
    linear-gradient(90deg, #1a1a20 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.4;
  pointer-events: none;
}
.stage-meta {
  padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
  color: #8a8a92;
  border-bottom: 1px solid #1c1c20;
  background: rgba(14,14,16,0.7);
  backdrop-filter: blur(6px);
  z-index: 2;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}
.stage-meta-l, .stage-meta-r { display: flex; align-items: center; gap: 8px; }
.stage-meta .sep { color: #3a3a42; }
.stage-meta-r { font-variant-numeric: tabular-nums; }

.stage-frame {
  margin: auto;
  position: relative;
  flex-shrink: 0;
  box-shadow:
    0 24px 60px rgba(0,0,0,0.5),
    0 0 0 1px #1c1c20;
  background: #fff;
  overflow: hidden;
}
.stage-canvas {
  position: relative;
  flex-shrink: 0;
}

.stage-foot {
  padding: 12px 24px;
  font-size: 11px;
  color: #6a6a72;
  text-align: center;
  border-top: 1px solid #1c1c20;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(14,14,16,0.7);
}

.mobile-panel-toggle,
.mobile-panel-close,
.mobile-panel-backdrop {
  display: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  .app {
    grid-template-columns: 340px 1fr;
  }
  .sec {
    padding: 16px 18px;
  }
  .style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  html,
  body,
  #root {
    height: 100%;
    min-height: 100%;
  }
  body {
    overflow: hidden;
  }
  .app {
    grid-template-columns: 1fr;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }
  .stage {
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
  }
  .panel {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(420px, 92vw);
    max-width: 92vw;
    height: 100dvh;
    border-right: 1px solid #232328;
    border-top: 0;
    box-shadow: 24px 0 60px rgba(0,0,0,0.45);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 28px;
  }
  .app.is-panel-open .panel {
    transform: translateX(0);
  }
  .mobile-panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0,0,0,0.52);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }
  .app.is-panel-open .mobile-panel-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-panel-toggle {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: #7CFFB2;
    color: #0e0e10;
    box-shadow: 0 12px 30px rgba(0,0,0,0.36);
    font-size: 13px;
    font-weight: 800;
  }
  .app.is-panel-open .mobile-panel-toggle {
    opacity: 0;
    pointer-events: none;
  }
  .mobile-panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #1d1d22;
    border: 1px solid #2a2a30;
    color: #e8e8e3;
    font-size: 18px;
    font-weight: 800;
  }
  .panel-head {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .stage-meta {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 12px 16px;
  }
  .stage-meta-l,
  .stage-meta-r {
    flex-wrap: wrap;
  }
  .stage-frame {
    margin: auto;
  }
  .stage-foot {
    display: none;
    padding: 10px 16px;
  }
}

@media (max-width: 600px) {
  .panel-head {
    padding: 10px 14px;
  }
  .sec {
    padding: 15px 14px;
  }
  .style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .row3,
  .color-grid,
  .theme-actions,
  .tier-count-row {
    grid-template-columns: 1fr;
  }
  .theme-flow,
  .theme-token-grid {
    grid-template-columns: 1fr 1fr;
  }
  .seg {
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  }
  .profile-row {
    grid-template-columns: 1fr 36px 36px;
  }
  .mini-btn,
  .btn,
  .seg-btn,
  .style-tab {
    min-height: 38px;
  }
  .tier-ed-head {
    padding: 14px;
    gap: 12px;
  }
  .tier-ed-head-l,
  .tier-ed-head-r {
    min-width: 0;
  }
  .tier-ed-name {
    overflow-wrap: anywhere;
  }
  .tier-ed-price {
    white-space: nowrap;
  }
  .tier-ed-body {
    padding: 4px 14px 18px;
  }
  .feat-row {
    gap: 8px;
  }
  .stage {
    min-height: 100dvh;
    height: 100dvh;
  }
  .stage-meta {
    font-size: 10px;
  }
  .stage-meta-l,
  .stage-meta-r {
    width: 100%;
    justify-content: center;
  }
}
