:root {
  --bg: #121010;
  --panel: #1b1816;
  --panel-2: #24201d;
  --line: #342e29;
  --text: #f3ece4;
  --muted: #a59a8f;
  --accent: #ffad42;
  --accent-2: #ff8a1f;
  --glow: rgba(255, 173, 66, .25);
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--accent); }
button, input { font: inherit; color: inherit; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.topbar nav a:hover { color: var(--text); }
.topbar .nav-cta { color: #1a1206 !important; background: var(--accent); padding: 7px 14px; border-radius: 999px; font-weight: 600; }

.app { display: grid; grid-template-columns: 360px 1fr; gap: 18px; padding: 18px 22px; max-width: 1500px; margin: 0 auto; }
.panel { display: flex; flex-direction: column; gap: 12px; }
.step, .export { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.step h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--accent); color: #1a1206; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px; border: 1.5px dashed var(--line); border-radius: 10px; cursor: pointer; text-align: center; transition: .15s; }
.drop span { color: var(--muted); font-size: 13px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--glow); }
.crop-wrap { position: relative; margin-top: 12px; display: flex; justify-content: center; background: #0c0b0a; border-radius: 10px; padding: 8px; }
#crop { display: block; max-width: 100%; cursor: grab; touch-action: none; border-radius: 4px; }
#crop:active { cursor: grabbing; }
.crop-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); font-size: 11px; background: rgba(0,0,0,.6); padding: 3px 8px; border-radius: 99px; color: #ddd; pointer-events: none; white-space: nowrap; }

.slider { display: grid; grid-template-columns: 1fr auto; align-items: center; font-size: 13px; color: var(--muted); margin-top: 10px; }
.slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.slider output { color: var(--text); font-variant-numeric: tabular-nums; }
.checks { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; }
.checks input, .frame-opts input[type=checkbox] { accent-color: var(--accent); }

.seg { display: flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: 10px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 4px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; align-items: center; }
.seg button small { font-weight: 400; font-size: 11px; opacity: .8; }
.seg button.active { background: var(--accent); color: #1a1206; }
.seg-sm { margin-top: 8px; }
.seg-sm button { padding: 6px 4px; }
.custom-size { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.custom-size input { width: 70px; }
input[type=number] { background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; width: 100%; }
.kit-fit { display: block; margin-top: 10px; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--glow); text-decoration: none; }
.kit-fit:hover { text-decoration: underline; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid3 label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; position: relative; }
.grid3 small { position: absolute; right: 8px; bottom: 7px; font-size: 11px; }
.grid3 input { padding-right: 28px; }
.frame-opts { margin-top: 12px; }
.frame-opts summary { cursor: pointer; font-size: 13px; margin-bottom: 8px; }
.note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

.export { display: flex; flex-direction: column; gap: 8px; position: sticky; bottom: 0; }
.btn { display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--line); background: var(--panel-2); padding: 11px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--text); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #1a1206; border: 0; box-shadow: 0 6px 20px var(--glow); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.link { background: none; border: 0; color: var(--muted); font-weight: 400; }
.btn:disabled { opacity: .5; cursor: default; }
.meta { font-size: 12px; color: var(--muted); margin: 2px 0 0; text-align: center; }

.stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; position: sticky; top: 12px; align-self: start; }
.stage-tabs { align-self: flex-start; }
.stage-tabs button { padding: 7px 16px; }
.viewport { position: relative; height: clamp(380px, calc(100vh - 260px), 760px); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #2a241f 0%, #141211 70%); }
#three { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lit-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: #0a0908; padding: 30px; }
#lit { max-width: 100%; max-height: 100%; border-radius: 3px; box-shadow: 0 0 80px rgba(255, 190, 110, .35), 0 0 0 10px #1d1a17; }
.busy { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; background: rgba(10,9,8,.72); font-weight: 600; }
.busy[hidden], .lit-wrap[hidden] { display: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.promo { display: grid; grid-template-columns: 170px 1fr; gap: 18px; align-items: center; background: linear-gradient(120deg, #2a1f14, var(--panel)); border: 1px solid #4a3725; border-radius: var(--radius); padding: 14px; }
.promo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; }
.promo h3 { margin: 0 0 4px; }
.promo p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.kit-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-chips a { font-size: 13px; padding: 7px 12px; border-radius: 99px; border: 1px solid #5a4330; text-decoration: none; color: var(--text); }
.kit-chips a b { color: var(--accent); }
.kit-chips a.match { background: var(--accent); color: #1a1206; border-color: var(--accent); }
.kit-chips a.match b { color: #1a1206; }

.content { max-width: 860px; margin: 40px auto; padding: 0 22px; }
.content h2 { font-size: 24px; }
.how { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0; list-style: none; counter-reset: s; }
.how li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; font-size: 14px; color: var(--muted); }
.how strong { display: block; color: var(--text); margin-bottom: 4px; }
#faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
#faq summary { cursor: pointer; font-weight: 600; }
#faq p { color: var(--muted); margin: 8px 0 0; }
.footer { display: flex; justify-content: space-between; padding: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

dialog { border: 0; padding: 0; border-radius: 16px; background: var(--panel); color: var(--text); max-width: 720px; width: calc(100% - 32px); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
.upsell { display: grid; grid-template-columns: 300px 1fr; position: relative; }
.upsell img { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }
.upsell-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.upsell-body h3 { margin: 0; font-size: 24px; }
.upsell-body p { margin: 0; color: var(--muted); }
.eyebrow { color: #7fd48a !important; font-size: 13px; font-weight: 600; }
.perks { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.close { position: absolute; top: 8px; right: 10px; background: none; border: 0; font-size: 26px; color: var(--muted); cursor: pointer; z-index: 1; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; padding: 12px; }
  .stage { display: contents; }
  .stage-tabs { order: -2; }
  .viewport { order: -1; }
  .promo { order: 10; }
  .viewport { height: 360px; }
  .promo { grid-template-columns: 90px 1fr; }
  .how { grid-template-columns: 1fr 1fr; }
  .upsell { grid-template-columns: 1fr; }
  .upsell img { min-height: 0; max-height: 200px; }
  .topbar nav a:not(.nav-cta) { display: none; }
}
