/* Pattern Pro — cozy dark green, one warm contrast colour. */
:root {
  --bg: #0f1613;
  --bg-2: #121b17;
  --panel: #151f1a;
  --surface: #1b2721;
  --surface-2: #213029;
  --line: #26352d;
  --line-2: #314539;
  --text: #e9efe9;
  --text-2: #b5c2b9;
  --muted: #7f9387;
  --accent: #e9c46a;       /* honey — the one loud colour */
  --accent-ink: #1d1706;
  --accent-soft: rgba(233, 196, 106, .14);
  --sage: #8fbf9a;
  --sage-soft: rgba(143, 191, 154, .14);
  --danger: #e57a6a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px -12px rgba(0, 0, 0, .55);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: relative;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; color: var(--sage); flex: none; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { font-weight: 600; letter-spacing: -.01em; font-size: 15px; white-space: nowrap; }
.brand-by { color: var(--muted); font-size: 12px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn svg, .btn svg, .ghost-btn svg, .link-btn svg, .tool svg, .pro-chip svg, .drop svg {
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover:not(:disabled) { background: var(--surface); color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: default; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; white-space: nowrap;
  transition: transform .12s var(--ease), background .15s, border-color .15s, opacity .15s;
}
.btn svg { width: 17px; height: 17px; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: #f0cf7e; }
.btn-soft { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.btn-soft:hover:not(:disabled) { border-color: var(--sage); }
.btn-block { width: 100%; }
.btn-lg { height: 48px; font-size: 15px; }

.pro-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(233, 196, 106, .35);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500; font-size: 13px;
}
.pro-chip svg { width: 15px; height: 15px; }
.pro-chip:hover { border-color: var(--accent); }
.pro-chip.is-pro { background: var(--sage-soft); border-color: rgba(143, 191, 154, .4); color: var(--sage); }

.menu {
  position: absolute; right: 150px; top: 54px; z-index: 30;
  min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: var(--shadow);
}
.menu button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border: 0; border-radius: 8px; background: transparent;
}
.menu button:hover { background: var(--surface-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---------- workspace ---------- */
.workspace {
  height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
}
.panel {
  overflow-y: auto;
  background: var(--panel);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.panel-left { border-right: 1px solid var(--line); }
.panel-right { border-left: 1px solid var(--line); }
.block { padding: 18px 18px 20px; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; min-height: 26px; }
.block-head h2 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.count { font: 500 12px var(--mono); color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }

/* upload */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 12px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-2);
  text-align: center; cursor: pointer;
  color: var(--text-2);
  transition: border-color .15s, background .15s;
}
.drop svg { width: 22px; height: 22px; color: var(--sage); margin-bottom: 4px; }
.drop b { color: var(--text); font-weight: 500; }
.drop small { color: var(--muted); font: 11px var(--mono); letter-spacing: .03em; }
.drop:hover, .drop.is-over, .drop:focus-visible { border-color: var(--sage); background: rgba(143, 191, 154, .06); outline: none; }

.assets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.asset {
  position: relative; aspect-ratio: 1;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 7px;
  cursor: grab;
  transition: border-color .15s, transform .12s var(--ease);
}
.asset:hover { border-color: var(--sage); }
.asset:active { transform: scale(.96); cursor: grabbing; }
.asset img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.asset .tag {
  position: absolute; left: 4px; bottom: 4px;
  font: 500 9px var(--mono); letter-spacing: .04em;
  padding: 1px 4px; border-radius: 4px;
  background: rgba(15, 22, 19, .8); color: var(--sage);
}
.asset .tag.raster { color: var(--text-2); }
.asset .x {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2);
  display: grid; place-items: center; font-size: 13px; line-height: 1;
  opacity: 0; transition: opacity .15s;
}
.asset:hover .x, .asset:focus-within .x { opacity: 1; }
@media (hover: none) { .asset .x { opacity: 1; } }

/* layouts */
.layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 16px; }
.layouts button {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2); font-size: 12px;
  transition: border-color .15s, background .15s, color .15s;
}
.layouts svg { width: 28px; height: 28px; fill: currentColor; opacity: .75; }
.layouts button:hover { border-color: var(--line-2); color: var(--text); }
.layouts button.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.layouts button.is-on svg { opacity: 1; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; color: var(--sage); font-size: 13px; padding: 4px 2px;
}
.link-btn svg { width: 15px; height: 15px; }
.link-btn:hover { color: var(--text); }

/* fields */
.field { margin-bottom: 14px; }
.field.grow { flex: 1; margin: 0; }
.field-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.field-row label { color: var(--text-2); font-size: 13px; }
.field-row output { font: 500 12px var(--mono); color: var(--text); }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: transparent; margin: 0;
  --p: 50%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(to right, var(--sage) var(--p), var(--line-2) var(--p));
}
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line-2); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--sage); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px;
  border-radius: 50%; background: var(--text); border: 3px solid var(--panel);
  box-shadow: 0 0 0 1px var(--line-2);
}
input[type=range]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; background: var(--text); border: 3px solid var(--panel);
}
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }

.check { display: flex; align-items: center; gap: 9px; color: var(--text-2); font-size: 13px; cursor: pointer; margin-top: 4px; }
.check input { width: 16px; height: 16px; accent-color: var(--sage); margin: 0; }

.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); font-size: 13px; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track { width: 32px; height: 18px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.toggle .thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: transform .18s var(--ease); }
.toggle input:checked + .track { background: var(--sage); }
.toggle input:checked + .track .thumb { transform: translateX(14px); background: #0f1613; }
.toggle input:focus-visible + .track { box-shadow: 0 0 0 2px var(--accent); }
.toggle.small { font-size: 12.5px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button, .seg button {
  height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2);
  font: 500 12.5px var(--mono);
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color .15s, color .15s, background .15s;
}
.chips button:hover, .seg button:hover { color: var(--text); border-color: var(--line-2); }
.chips button.is-on, .seg button.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chips button:disabled, .seg button:disabled { opacity: .4; cursor: not-allowed; }
.seg { display: inline-flex; gap: 4px; }
.seg button { height: 28px; padding: 0 9px; font-size: 11.5px; }
.seg-lg button { height: 36px; padding: 0 14px; font: 500 13px var(--font); }
.lock {
  font: 600 9px var(--mono); font-style: normal; letter-spacing: .06em;
  padding: 2px 5px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent);
}
body.is-pro .lock { display: none; }

/* colours */
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; margin-bottom: 12px; }
.swatch {
  aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
  padding: 0;
  transition: transform .12s var(--ease), box-shadow .15s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.is-on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.color-row { display: flex; align-items: center; gap: 8px; }
.color-well { position: relative; width: 36px; height: 36px; flex: none; cursor: pointer; }
.color-well input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.color-well span { display: block; width: 100%; height: 100%; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); pointer-events: none; }
.hex {
  width: 92px; height: 36px; padding: 0 10px;
  border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2);
  font: 500 13px var(--mono); text-transform: uppercase;
}
.hex:focus { outline: none; border-color: var(--sage); }
.color-row .toggle { margin-left: auto; }

/* ---------- stage ---------- */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.stage-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; min-height: 52px;
}
.stage-title { color: var(--muted); font-size: 13px; }
.stage-title b { color: var(--text); font: 500 12.5px var(--mono); margin-left: 6px; }
.stage-tools { display: flex; align-items: center; gap: 14px; }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text-2); font-size: 12.5px;
}
.ghost-btn svg { width: 14px; height: 14px; }
.ghost-btn:hover { color: var(--text); border-color: var(--line-2); }
.canvas-wrap { position: relative; flex: 1; min-height: 0; }
#editor { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; outline: none; }
#editor.is-drop { filter: brightness(1.08); }
.stage-hint { margin: 0; padding: 10px 18px 14px; text-align: center; color: var(--muted); font-size: 12px; }
kbd {
  font: 500 11px var(--mono);
  padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2);
}

.empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  pointer-events: none;
}
.empty > * { pointer-events: auto; }
.empty-art { width: 96px; height: 96px; color: var(--muted); margin-bottom: 14px; }
.empty h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.empty p { margin: 0 0 18px; max-width: 380px; color: var(--text-2); }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- right panel ---------- */
.preview-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
  aspect-ratio: 1;
  margin-bottom: 12px;
}
#preview { width: 100%; height: 100%; display: block; }
.inspector-empty p { margin: 0; color: var(--muted); font-size: 13px; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.tool {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 4px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font-size: 11.5px;
}
.tool svg { width: 17px; height: 17px; }
.tool:hover { color: var(--text); border-color: var(--line-2); }
.tool.danger:hover { color: var(--danger); border-color: rgba(229, 122, 106, .5); }

/* ---------- modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 70; /* above the sign-in screen */
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(6, 10, 8, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .16s var(--ease);
}
.modal-card {
  width: 100%; max-width: 560px; max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  box-shadow: var(--shadow);
  animation: rise .2s var(--ease);
}
.modal-wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.modal-body { padding: 10px 20px 8px; overflow-y: auto; }
.modal-foot { padding: 14px 20px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.ex-row { display: flex; align-items: center; gap: 14px; padding: 9px 0; }
.ex-label { width: 64px; flex: none; color: var(--muted); font-size: 12.5px; }
.ex-note { margin: -2px 0 6px 78px; color: var(--muted); font-size: 12px; min-height: 0; }
.ex-note:empty { display: none; }
.custom-size { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.custom-size input {
  width: 110px; height: 36px; padding: 0 10px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2);
  font: 500 13px var(--mono);
}
.custom-size input:focus { outline: none; border-color: var(--sage); }
.ex-summary {
  margin-top: 12px; padding: 14px 16px;
  border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.ex-summary div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-summary small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.ex-summary b { font: 500 13.5px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-warn {
  margin-top: 10px; padding: 10px 14px;
  border-radius: 12px; font-size: 12.5px; color: #f2d9a0;
  background: rgba(233, 196, 106, .08); border: 1px solid rgba(233, 196, 106, .25);
}
.progress { margin-top: 14px; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--sage); transition: width .15s linear; }

.pro-lead { margin: 0 0 12px; color: var(--text-2); }
.pro-feats { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 7px; }
.pro-feats li { position: relative; padding-left: 24px; color: var(--text-2); font-size: 13.5px; }
.pro-feats li::before {
  content: ""; position: absolute; left: 2px; top: 5px; width: 12px; height: 7px;
  border-left: 2px solid var(--sage); border-bottom: 2px solid var(--sage); transform: rotate(-45deg);
}
.pro-feats b { color: var(--text); font-weight: 500; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px;
  border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface);
  text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .12s var(--ease);
}
.plan:hover { border-color: var(--sage); transform: translateY(-1px); }
.plan.best { border-color: var(--accent); background: linear-gradient(180deg, rgba(233, 196, 106, .09), transparent 70%), var(--surface); }
.plan .badge {
  position: absolute; top: -9px; right: 12px;
  font: 600 10px var(--mono); letter-spacing: .05em;
  padding: 3px 7px; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink);
}
.plan .p-name { color: var(--text-2); font-size: 13px; }
.plan .p-price { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.plan .p-price small { font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan .p-note { color: var(--muted); font-size: 12px; }
.plan .p-cta { margin-top: 10px; font-size: 13px; color: var(--accent); font-weight: 500; }
.pay-note { color: var(--muted); font-size: 12.5px; margin: 14px 0 16px; }
.pay-note b { color: var(--text-2); font-weight: 500; }
.licence { padding: 14px 0 12px; border-top: 1px solid var(--line); }
.licence label { display: block; color: var(--text-2); font-size: 13px; margin-bottom: 8px; }
.licence-row { display: flex; gap: 8px; }
.licence-row input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2);
  font: 500 13px var(--mono);
}
.licence-row input:focus { outline: none; border-color: var(--sage); }
.licence-msg { margin: 8px 0 0; font-size: 12.5px; min-height: 18px; color: var(--muted); }
.licence-msg.ok { color: var(--sage); }
.licence-msg.err { color: var(--danger); }
#proActive {
  padding: 14px 16px; margin-bottom: 14px;
  border-radius: 12px; background: var(--sage-soft); border: 1px solid rgba(143, 191, 154, .35);
  color: var(--text); font-size: 13.5px;
}
#proActive button { margin-top: 10px; }

.keys { display: grid; gap: 4px; padding-bottom: 20px; }
.keys div { display: flex; align-items: center; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.keys span { margin-left: auto; color: var(--text-2); font-size: 13px; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  padding: 10px 16px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); font-size: 13px;
  animation: rise .2s var(--ease);
  max-width: min(520px, calc(100vw - 32px));
}
.toast.err { border-color: rgba(229, 122, 106, .5); }
.toast.ok { border-color: rgba(143, 191, 154, .5); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 272px minmax(0, 1fr) 280px; }
  .brand-by { display: none; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .topbar { padding: 0 10px 0 12px; gap: 8px; }
  .brand-name { font-size: 14px; }
  .top-actions { gap: 2px; }
  .sep, #projectBtn + .pro-chip span { display: none; }
  .pro-chip { padding: 0 10px; }
  .btn-primary#exportBtn { padding: 0 14px; }
  .menu { right: 10px; }
  .workspace { height: auto; display: flex; flex-direction: column; }
  .stage { order: -1; height: min(78vw, 560px); min-height: 360px; border-bottom: 1px solid var(--line); }
  .panel { overflow: visible; border: 0; }
  .panel-right { border-top: 1px solid var(--line); }
  .stage-hint { display: none; }
  .assets { grid-template-columns: repeat(6, 1fr); }
  .plans { grid-template-columns: 1fr; }
  .modal-card { border-radius: 18px; }
  .ex-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ex-label { width: auto; }
  .ex-note { margin-left: 0; }
  .ex-summary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .assets { grid-template-columns: repeat(4, 1fr); }
  .brand-name { display: none; }
  .swatches { grid-template-columns: repeat(8, 1fr); gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- additions: library toggles, shapes, payment ---------- */
.asset .use {
  position: absolute; top: 5px; left: 5px;
  width: 12px; height: 12px; padding: 0; border-radius: 50%;
  border: 2px solid var(--panel); background: var(--sage);
  box-shadow: 0 0 0 1px var(--line-2);
}
.asset.is-out { opacity: .5; }
.asset.is-out .use { background: var(--line-2); }
.sub-head { margin: 16px 0 8px; font-size: 12px; color: var(--muted); }
.shapes { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.shape {
  aspect-ratio: 1; padding: 6px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s, transform .12s var(--ease);
}
.shape:hover { border-color: var(--sage); }
.shape:active { transform: scale(.94); }
.shape svg { width: 100%; height: 100%; }

.btn-primary.is-locked { background: var(--surface-2); color: var(--accent); border-color: rgba(233,196,106,.45); }
.pay { display: grid; gap: 14px; }
.pay-back { justify-self: start; padding: 0; }
.pay-head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); }
.pay-head span { color: var(--text-2); }
.pay-head b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.pay-methods { width: 100%; }
.pay-methods button { flex: 1; justify-content: center; }
.pay-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--text-2); font-size: 13.5px; }
.pay-steps b { color: var(--text); font-weight: 500; }
.pay-steps small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.pay-number { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.pay-number code { font: 500 16px var(--mono); color: var(--accent); letter-spacing: .03em; }
.pay-number .ghost-btn { height: 26px; }
.pay-form { display: grid; gap: 10px; }
.pay-form label { display: grid; gap: 6px; color: var(--text-2); font-size: 12.5px; }
.pay-form input {
  height: 40px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2);
}
.pay-form input:focus { outline: none; border-color: var(--sage); }
.pay-form .btn { margin-top: 4px; }
.ex-warn code, .pay code { font-family: var(--mono); }
@media (max-width: 900px) { .shapes { grid-template-columns: repeat(8, 1fr); } }

/* ---------- share ---------- */
.share-body { align-content: start; grid-auto-rows: max-content; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; padding-bottom: 22px; }
.share-preview {
  display: grid; place-items: center;
  min-height: 380px; padding: 16px;
  border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line);
}
#shareCanvas { display: block; border-radius: 6px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.6); }
.share-side { display: flex; flex-direction: column; gap: 18px; }
.share-group .ex-label { display: block; width: auto; margin-bottom: 8px; }
.share-group .field { margin: 0; }
#shRatio button { flex-direction: column; gap: 0; height: auto; padding: 7px 12px; line-height: 1.2; }
#shRatio small { font: 400 10px var(--font); color: var(--muted); }
#shRatio button.is-on small { color: inherit; opacity: .8; }
.share-note { margin: 8px 0 0; }
.share-actions { margin-top: auto; display: grid; gap: 10px; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-row .btn { height: 36px; font-size: 13px; padding: 0 10px; }
@media (max-width: 900px) {
  .share-body { grid-template-columns: 1fr; }
  #shareBtn .btn-label { display: none; }
  #shareBtn { padding: 0 11px; }
}

/* ---------- trial bar ---------- */
.trial-bar {
  height: 36px; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 12px; font-size: 13px; color: var(--text-2);
  background: linear-gradient(90deg, rgba(233,196,106,.10), rgba(143,191,154,.10));
  border-bottom: 1px solid var(--line);
}
.trial-bar b { font: 600 13px var(--mono); color: var(--accent); letter-spacing: .02em; }
.trial-bar .tb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 4px rgba(143,191,154,.16); animation: pulse 2s infinite; }
.trial-bar.is-low b { color: var(--danger); }
.trial-bar.is-low .tb-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(229,122,106,.16); }
.tb-sep { color: var(--muted); }
.tb-buy {
  margin-left: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  border: 1px solid rgba(233,196,106,.45); background: transparent; color: var(--accent); font-size: 12px; font-weight: 500;
}
.tb-buy:hover { background: var(--accent-soft); }
@keyframes pulse { 50% { opacity: .45; } }
body.has-trial .workspace { height: calc(100vh - 96px); height: calc(100dvh - 96px); }
body.is-user .lock { display: none; }

/* ---------- sign-in gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 20px 16px;
  overflow-y: auto;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(143,191,154,.10), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(233,196,106,.08), transparent 60%),
    rgba(10,15,12,.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.gate-card {
  width: 100%; max-width: 420px;
  padding: 30px 28px 20px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 22px;
  box-shadow: var(--shadow);
  animation: rise .25s var(--ease);
}
.gate-brand { text-align: center; margin-bottom: 22px; }
.gate-brand .brand-mark { display: block; width: 48px; height: 48px; margin: 0 auto 12px; }
.gate-brand h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.gate-brand p { margin: 0; color: var(--muted); font-size: 13px; }
.gate-form { display: grid; gap: 12px; }
.gate-form label, .stack-form label { display: grid; gap: 6px; color: var(--text-2); font-size: 12.5px; }
.gate-form input, .stack-form input, .stack-form textarea, .fb-form textarea {
  height: 44px; padding: 0 14px; width: 100%;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
}
.stack-form textarea, .fb-form textarea { height: auto; padding: 10px 14px; resize: vertical; font: inherit; }
.gate-form input:focus, .stack-form input:focus, .stack-form textarea:focus, .fb-form textarea:focus { outline: none; border-color: var(--sage); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 64px; }
.pw-eye { position: absolute; right: 6px; top: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--surface); color: var(--text-2); font-size: 12px; }
.form-msg { margin: 0; min-height: 18px; font-size: 12.5px; color: var(--danger); }
.form-msg.ok { color: var(--sage); }
.form-msg:empty { min-height: 0; }
.gate-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--muted); font-size: 12px; }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gate-trial { display: grid; gap: 10px; }
.trial-card {
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--surface);
}
.trial-card h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.trial-card p { margin: 0; color: var(--text-2); font-size: 12.5px; }
.trial-card .btn { margin-top: 12px; }
.trial-card.is-warn { border-color: rgba(229,122,106,.4); }
.trial-card.is-wait { border-color: rgba(233,196,106,.4); }
.gate-buy { display: block; margin: 16px auto 0; font-size: 14px; }
.gate-foot { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 11.5px; }

/* ---------- buy ---------- */
.buy-price { display: flex; align-items: baseline; gap: 10px; padding: 16px 18px; border-radius: 14px; background: linear-gradient(180deg, rgba(233,196,106,.09), transparent 80%), var(--surface); border: 1px solid rgba(233,196,106,.35); margin-bottom: 14px; }
.buy-price b { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.buy-price span { color: var(--text-2); font-size: 13px; }
.buy-price small { margin-left: auto; color: var(--muted); font-size: 12px; }
.stack-form { display: grid; gap: 11px; margin-top: 12px; padding-bottom: 20px; }
.stack-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.file-drop {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1.5px dashed var(--line-2); border-radius: 12px; background: var(--bg-2); cursor: pointer; color: var(--text-2); font-size: 13px;
}
.file-drop:hover { border-color: var(--sage); }
.file-drop img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.file-drop input { display: none; }
.done { text-align: center; padding: 10px 4px 20px; }
.done .tick { width: 56px; height: 56px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--sage-soft); color: var(--sage); font-size: 26px; }
.done h3 { margin: 0 0 8px; font-size: 18px; }
.done p { margin: 0 0 8px; color: var(--text-2); }
.contact-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.contact-row a { text-decoration: none; }

/* ---------- profile ---------- */
.prof-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 22px; font-weight: 600; }
.prof-head b { display: block; font-size: 16px; }
.prof-head span { color: var(--muted); font-size: 13px; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stats3 div { padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.stats3 small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.stats3 b { font: 600 18px var(--mono); }
.sub-title { margin: 18px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.dev-list { display: grid; gap: 6px; }
.dev { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; }
.dev small { display: block; color: var(--muted); font-size: 11.5px; }
.dev .here { margin-left: auto; color: var(--sage); font-size: 12px; }
.dev .ghost-btn { margin-left: auto; }
.notice { padding: 10px 14px; border-radius: 12px; font-size: 13px; background: var(--accent-soft); border: 1px solid rgba(233,196,106,.35); color: #f2d9a0; margin-bottom: 14px; }
.prof-foot { display: flex; justify-content: space-between; margin: 20px 0 14px; }

/* ---------- feedback ---------- */
.fb-form { display: grid; gap: 12px; padding-bottom: 20px; }
.fb-lead { margin: 0; color: var(--text-2); }
.fb-lead b { color: var(--accent); font-weight: 500; }
.stars { display: flex; gap: 4px; }
.stars button { border: 0; background: none; font-size: 28px; color: var(--line-2); padding: 0 2px; transition: color .12s, transform .12s; }
.stars button.on { color: var(--accent); }
.stars button:hover { transform: scale(1.1); }
.fb-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ex-trial { color: var(--accent); }
@media (max-width: 480px) {
  .gate-card { padding: 24px 18px 16px; }
  .stack-form .row2 { grid-template-columns: 1fr; }
  .trial-bar { font-size: 12px; gap: 6px; }
  .trial-bar > span:nth-child(2), .tb-sep { display: none; }
}
.tb-link { height: 24px; padding: 0 6px; border: 0; background: none; color: var(--text-2); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.tb-link:hover { color: var(--text); }
.gate-back { display: block; margin: 10px auto 0; font-size: 13px; color: var(--text-2); }
