:root {
  --bg: #0f1220; --panel: #1a1f35; --panel-2: #222843; --text: #f4f6ff; --muted: #a8b0d0;
  --accent: #7c5cff; --accent-2: #ff6b9d; --accent-3: #3dd6c6; --ok: #3dd68c; --warn: #ffb84d;
  --danger: #ff6b6b; --radius: 16px; --shadow: 0 12px 40px rgba(0,0,0,.35);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.45; }
.bg-blobs {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(124,92,255,.35), transparent 60%),
    radial-gradient(700px 400px at 90% 0%, rgba(255,107,157,.28), transparent 55%),
    radial-gradient(600px 400px at 50% 100%, rgba(61,214,198,.15), transparent 50%),
    var(--bg);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10;
  background: rgba(15,18,32,.75);
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-icon { border-radius: 8px; }
.brand strong { display: block; font-size: 1.15rem; letter-spacing: -.02em; }
.tagline { display: block; font-size: .78rem; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: .6rem; }
.badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .28rem .55rem; border-radius: 999px; }
.badge.free { background: rgba(255,184,77,.2); color: var(--warn); }
.badge.pro { background: rgba(61,214,140,.2); color: var(--ok); }
.layout { display: grid; grid-template-columns: 1.1fr .9fr 1fr; gap: 1rem; padding: 1.25rem 1.5rem 2rem; max-width: 1280px; margin: 0 auto; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }
.panel {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 .9rem; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.drop-panel { min-height: 320px; display: flex; flex-direction: column; outline: none; }
.drop-panel.dragover { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124,92,255,.45), var(--shadow); }
.drop-inner { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .5rem; padding: 1.5rem; }
.drop-icon { font-size: 2.5rem; }
.drop-inner h1 { margin: 0; font-size: 1.45rem; letter-spacing: -.02em; }
.drop-inner p { margin: 0; color: var(--muted); max-width: 28ch; font-size: .95rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: .6rem; max-height: 360px; overflow: auto; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: #0c0f1a; padding: 0; display: block; color: inherit; }
.thumb.active { border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .name { position: absolute; left: 0; right: 0; bottom: 0; font-size: .62rem; padding: .25rem; background: rgba(0,0,0,.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; }
.field span { font-size: .82rem; color: var(--muted); }
.field em { font-style: normal; color: var(--accent-3); font-weight: 600; }
select, input[type="number"], input[type="text"] {
  appearance: none; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12);
  color: var(--text); border-radius: 10px; padding: .55rem .7rem; font: inherit;
}
select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.25); }
.row { display: flex; gap: .6rem; }
.half { flex: 1; }
.check { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; font-size: .9rem; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.free-note { background: rgba(255,184,77,.1); border: 1px solid rgba(255,184,77,.25); border-radius: 12px; padding: .75rem .85rem; font-size: .85rem; color: #f0d9a8; margin-bottom: 1rem; }
.free-note strong { color: var(--warn); }
.free-note[hidden], .custom-size[hidden] { display: none !important; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.btn { border: none; cursor: pointer; font: inherit; font-weight: 650; border-radius: 999px; padding: .55rem 1rem; transition: transform .12s ease, opacity .12s ease; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; width: 100%; box-sizing: border-box; }
.btn.ghost { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid rgba(255,255,255,.1); }
.btn.wide { flex: 1 1 140px; }
.linkish { background: none; border: none; color: var(--accent-3); cursor: pointer; font: inherit; font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.free-note .linkish { display: inline; margin-left: .25rem; }
.privacy { margin: 0; font-size: .8rem; color: var(--muted); text-align: center; }
.preview-wrap { display: flex; flex-direction: column; align-items: center; gap: .75rem; min-height: 280px; }
#preview {
  max-width: 100%; width: 100%; height: auto; border-radius: 12px;
  background: linear-gradient(45deg,#161a2c 25%,transparent 25%), linear-gradient(-45deg,#161a2c 25%,transparent 25%), linear-gradient(45deg,transparent 75%,#161a2c 75%), linear-gradient(-45deg,transparent 75%,#161a2c 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; background-color: #0c0f1a;
  border: 1px solid rgba(255,255,255,.08);
}
.preview-meta { margin: 0; font-size: .82rem; color: var(--muted); text-align: center; }
.footer { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem 1.25rem; padding: 1rem 1.5rem 2rem; color: var(--muted); font-size: .85rem; }
.modal[hidden] { display: none !important; }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(5,7,16,.72); display: grid; place-items: center; padding: 1rem; }
.modal-card { width: min(420px,100%); background: linear-gradient(165deg,#232946,#1a1f35); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 1.4rem 1.35rem 1.25rem; box-shadow: var(--shadow); position: relative; }
.modal-close { position: absolute; top: .6rem; right: .75rem; background: none; border: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal-card h2 { margin: 0 0 .4rem; font-size: 1.35rem; }
.modal-lead { margin: 0 0 .85rem; color: var(--muted); font-size: .95rem; }
.perk-list { margin: 0 0 1rem; padding-left: 1.1rem; color: var(--text); font-size: .9rem; }
.perk-list li { margin-bottom: .25rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.hint { color: var(--danger); font-size: .85rem; margin: -.4rem 0 .6rem; }
.tiny { margin: 0; font-size: .75rem; color: var(--muted); }

/* ——— Free-tier ads (loud yellow/black sponsored bars) ——— */
.ad-region {
  position: relative;
  background: repeating-linear-gradient(
    -45deg,
    #ffe566,
    #ffe566 12px,
    #ffd000 12px,
    #ffd000 24px
  );
  color: #111;
  border: 3px solid #111;
  border-radius: 10px;
  padding: 0.65rem 0.85rem 0.65rem 2.6rem;
  margin: 0.5rem 0;
  box-shadow: 4px 4px 0 #111;
  font-size: 0.88rem;
  line-height: 1.35;
  font-weight: 650;
}
.ad-region[hidden] { display: none !important; }
.ad-label {
  position: absolute;
  left: 0.4rem;
  top: 0.4rem;
  background: #111;
  color: #ffe566;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}
.ad-inner { color: #111; }
.ad-inner strong { font-weight: 800; }
.ad-sticky-top {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  box-shadow: 0 4px 0 #111;
}
.ad-mid.layout-ad {
  grid-column: 1 / -1;
  margin: 0;
}
.ad-download { margin: 0 0 0.85rem; }
.ad-sidebar { margin: 0 0 0.85rem; font-size: 0.82rem; }
.ad-footer {
  max-width: 1280px;
  margin: 0 auto 0.5rem;
  border-radius: 10px;
}
.ad-modal {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  box-shadow: 3px 3px 0 #111;
}
a.btn.is-disabled,
a.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: auto;
}
#checkoutBuyBtn { margin-top: 0.35rem; }
.adsbygoogle { min-height: 60px; }

.ad-wrap-mid { max-width: 1280px; margin: 0.75rem auto 0; padding: 0 1.5rem; }

.cross-promo {
  flex-basis: 100%;
  text-align: center;
  margin: .35rem 0 0;
  padding: .65rem .75rem .15rem;
  border-top: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
  font-size: .8rem;
  color: var(--muted);
}
.cross-promo-intro { margin: 0 0 .35rem; }
.cross-promo-hub { margin: 0 0 .35rem; }
.cross-promo-hub a, .cross-promo-list a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.cross-promo-hub a:hover, .cross-promo-list a:hover { color: var(--text); }
.cross-promo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.cross-promo-list .cross-buy { font-weight: 600; color: var(--accent, var(--text)); }

/* Louder Unlock / Buy CTAs (conversion) */
.btn.unlock-cta {
  font-weight: 800;
  font-size: 0.98rem;
  min-height: 44px;
  padding: 0.7rem 1.15rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.12) inset;
  letter-spacing: 0.01em;
}
.top-actions .btn.unlock-cta {
  white-space: nowrap;
}
.free-note-cta {
  display: flex;
  margin-top: 0.65rem;
}
.free-note-cta .btn.unlock-cta {
  width: 100%;
}
.unlock-inline {
  margin-bottom: 0.55rem;
}
.unlock-inline[hidden] { display: none !important; }
.soft-path {
  margin: 0.65rem 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.footer-unlock-btn,
.footer-buy-btn {
  text-decoration: none;
}
.footer .btn.unlock-cta {
  min-height: 44px;
}

/* Unlock modal mobile */
.modal {
  align-items: end;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}
@media (min-width: 520px) {
  .modal { align-items: center; place-items: center; }
}
.modal-card {
  max-height: min(92vh, 720px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  width: min(420px, 100%);
  margin-bottom: 0;
}
.modal-card #checkoutBuyBtn,
.modal-card #applyKeyBtn {
  min-height: 48px;
  width: 100%;
}
.modal-card input[type="text"] {
  min-height: 44px;
  font-size: 16px; /* avoid iOS zoom */
  width: 100%;
}
.modal-close {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
}

/* Slim sticky Unlock bar (free tier only) */
.sticky-unlock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
  background: rgba(12,14,20,.94);
  border-top: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  box-shadow: 0 -8px 28px rgba(0,0,0,.35);
}
.sticky-unlock[hidden] { display: none !important; }
.sticky-unlock-copy {
  font-size: 0.82rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.sticky-unlock .btn.unlock-cta {
  flex-shrink: 0;
  min-height: 44px;
}
body.has-sticky-unlock {
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
@media (max-width: 420px) {
  .topbar { padding: 0.75rem 0.85rem; gap: 0.5rem; }
  .tagline { display: none; }
  .sticky-unlock-copy { font-size: 0.75rem; }
}
