@property --hold-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --scene-glow-x {
  syntax: "<length-percentage>";
  inherits: true;
  initial-value: 50%;
}

@property --scene-glow-y {
  syntax: "<length-percentage>";
  inherits: true;
  initial-value: 90%;
}

:root {
  --ink: #171717;
  --paper: #f4f0e6;
  --card: #fffdf8;
  --paper-strong: #fffaf0;
  --muted: #777168;
  --line: #aaa398;
  --violet: #8b5cf6;
  --blue: #66a9ff;
  --mint: #66d7af;
  --coral: #ff876f;
  --nav-base: #fffdf8;
  --nav-wave: #ebe3ff;
  --active-accent: #8b5cf6;
  --dot-color: #8b5cf6;
  --scene-glow-x: 50%;
  --scene-glow-y: calc(100% - var(--nav-height) - var(--nav-bottom));
  --page-x: 14px;
  --space: 10px;
  --header-zone: calc(64px + var(--safe-top));
  --nav-height: 64px;
  --nav-bottom: 0px;
  --nav-notch-depth: 22px;
  --create-diameter: clamp(70px,18vw,74px);
  --nav-center-slot: calc(var(--create-diameter) + 28px);
  --nav-notch-radius: calc(var(--create-diameter) / 2 + 6px);
  --create-bottom: calc(var(--nav-height) - var(--create-diameter) / 2 - var(--nav-notch-depth));
  --create-glyph-size: calc(var(--create-diameter) * .46);
  --nav-selected-size: 40px;
  --nav-icon-size: 22px;
  --nav-reserve: 84px;
  --generate-rail-height: 176px;
  --text-meta: 10px;
  --text-caption: 11px;
  --text-body: 12px;
  --text-control: 12px;
  --text-card-title: 16px;
  --tap-target: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --app-height: 100vh;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  transition: --scene-glow-x .82s cubic-bezier(.16,1,.3,1), --scene-glow-y .82s cubic-bezier(.16,1,.3,1);
}

@supports (width: 1cqi) {
  :root {
    --page-x: clamp(10px,4cqi,18px);
    --space: clamp(8px,2.5cqi,14px);
    --text-card-title: clamp(15px,4cqi,18px);
  }
}

@supports (height: 1cqb) {
  :root { --generate-rail-height: clamp(164px,24cqb,184px); }
}

:root[data-theme="dark"] {
  --ink: #f4f0e8;
  --paper: #10100f;
  --card: #1b1a18;
  --paper-strong: #25221f;
  --muted: #aaa49a;
  --line: #5e5851;
  --nav-base: #191816;
  --nav-wave: #261d39;
  color-scheme: dark;
}

@supports (height: 100dvh) {
  :root { --app-height: 100dvh; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  min-width: 280px;
  margin: 0;
  overflow: hidden;
  background: radial-gradient(circle at 10% 0, rgba(244,216,77,.28), transparent 28rem), #d8d5ce;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  transition: background-color .5s ease, color .5s ease;
}
button, textarea, input { color: inherit; font: inherit; }
button { touch-action: manipulation; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.app-shell {
  position: relative;
  width: min(100%, 560px);
  height: min(var(--app-height), 932px);
  min-height: min(var(--app-height), 480px);
  overflow: hidden;
  margin: auto;
  border: 2px solid var(--ink);
  border-radius: 35px 35px 46px 46px;
  background: var(--paper);
  box-shadow: 9px 11px 0 var(--ink);
  container: app / size;
  isolation: isolate;
  transition: background-color .5s ease, border-color .5s ease, box-shadow .5s ease;
}

.app-head {
  position: absolute;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: var(--header-zone);
  align-items: center;
  padding: var(--safe-top) var(--page-x) 0;
  pointer-events: none;
}
.brand, .header-back { pointer-events: auto; }
.brand {
  display: flex;
  align-items: center;
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
  transform-origin: left center;
  transition: opacity .28s ease, filter .34s ease, transform .46s cubic-bezier(.16,1,.3,1);
}
.brand i {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-style: normal;
  font-weight: 850;
}
.header-back {
  position: absolute;
  top: calc(10px + var(--safe-top));
  bottom: auto;
  left: var(--page-x);
  display: grid;
  width: var(--tap-target);
  height: var(--tap-target);
  place-items: center;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 4px 12px rgba(0,0,0,.16);
  color: var(--paper);
  font-size: 14px;
  opacity: 0;
  filter: blur(4px);
  pointer-events: none;
  transform: scale(.72);
  transition: opacity .28s ease, filter .34s ease, transform .46s cubic-bezier(.16,1,.3,1);
}
.app-shell.tool-mode .brand { opacity: 0; filter: blur(4px); transform: scale(.72); }
.app-shell.tool-mode .header-back { opacity: 1; filter: blur(0); pointer-events: auto; transform: scale(1); }
.app-shell.content-scrolled .brand { opacity: 0; filter: blur(4px); pointer-events: none; transform: scale(.72); }
.app-shell.generation-options-open .app-head { visibility: hidden; }

.scene { position: absolute; z-index: 1; inset: 0; overflow: hidden; background: var(--paper); transition: background-color .5s ease; }
.scene::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    radial-gradient(ellipse 74% 62% at var(--scene-glow-x) var(--scene-glow-y), rgba(139,92,246,.38) 0%, rgba(139,92,246,.2) 27%, rgba(102,169,255,.1) 47%, transparent 74%),
    conic-gradient(from 196deg at var(--scene-glow-x) var(--scene-glow-y), transparent 0deg 7deg, rgba(139,92,246,.13) 15deg 29deg, transparent 38deg 49deg, rgba(102,169,255,.09) 56deg 68deg, transparent 78deg 360deg);
  content: "";
  opacity: .32;
  pointer-events: none;
  transition: opacity .55s ease, background-position .55s ease;
}
.app-shell.tool-mode .scene::after { opacity: 1; }
.app-shell.viewer-mode .scene { z-index: 40; }
#dots {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .72;
  filter: drop-shadow(0 0 4px var(--dot-glow, rgba(139,92,246,.32)));
  pointer-events: none;
}
.screen-stack { position: absolute; z-index: 2; inset: 0 0 calc(var(--nav-reserve) + var(--safe-bottom)); overflow: hidden; }
.app-shell.tool-mode .screen-stack { bottom: calc(var(--nav-height) + var(--safe-bottom)); }
.app-shell.viewer-mode .screen-stack { z-index: 40; inset: 0; }
.screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  contain: layout paint style;
  background: transparent;
}
.screen.scene-transitioning { will-change: clip-path, mask-image, -webkit-mask-image; }
.screen::-webkit-scrollbar { display: none; }
.screen.active { display: block; }

.home-screen { place-items: center; overflow-x: hidden; overflow-y: auto; }
.home-screen.active { display: grid; }
.home-center {
  display: grid;
  width: min(calc(100% - var(--page-x) - var(--page-x)),340px);
  place-items: center;
  padding: var(--header-zone) 0 var(--space);
  text-align: center;
}
.crosshair { position: relative; width: 112px; aspect-ratio: 1; margin-bottom: 0; border: 1px solid #9d968b; border-radius: 50%; background: rgba(255,253,248,.55); }
.crosshair::before, .crosshair::after { position: absolute; background: var(--ink); content: ""; }
.crosshair::before { top: 50%; right: -25px; left: -25px; height: 1px; background:#9d968b; }
.crosshair::after { top: -25px; bottom: -25px; left: 50%; width: 1px; background:#9d968b; }
.crosshair i { position: absolute; top:50%; left:50%; width:11px; height:11px; border:2px solid var(--ink); border-radius:50%; background:var(--paper); transform:translate(-50%,-50%); }
.crosshair.compact { width: 72px; margin-bottom: 8px; }
.home-center h1 { margin: 26px 0 0; font-size: 25px; line-height: 1; letter-spacing: -.045em; }
.home-copy { max-width: 260px; margin: 7px 0 0; color: var(--muted); font-size: var(--text-body); line-height: 1.45; }
.home-hint { margin-top:12px; padding: 7px 11px; border: 1px solid #aaa398; border-radius: 999px; background: rgba(255,253,248,.62); font-size: var(--text-caption); font-weight: 800; }

.ideas-screen, .works-screen, .profile-screen { padding: var(--header-zone) var(--page-x) var(--space); }
.screen-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.screen-head small { display: block; margin-bottom: 3px; color: var(--muted); font-size: var(--text-meta); font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.screen-head h1 { margin: 0; font-size: clamp(28px, 8vw, 38px); line-height: .95; letter-spacing: -.055em; }
.screen-count { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #aaa398; border-radius: 999px; background: rgba(255,253,248,.78); font-size: var(--text-meta); font-weight: 850; }
.screen-intro { max-width: 320px; margin: -4px 0 14px; color: var(--muted); font-size: var(--text-body); line-height: 1.45; }

.idea-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space); padding-bottom: var(--space); }
.idea-card {
  position: relative;
  display: flex;
  min-height: 140px;
  min-height: clamp(124px,22cqb,160px);
  overflow: hidden;
  flex-direction: column;
  justify-content: flex-end;
  padding: 13px;
  border: 1px solid rgba(23,23,23,.72);
  border-radius: 22px;
  background: rgba(255,253,248,.78);
  box-shadow: 0 10px 28px rgba(42,36,28,.08);
  text-align: left;
  cursor: pointer;
}
.idea-card:first-child { grid-column: 1 / -1; min-height: 170px; min-height: clamp(150px,27cqb,190px); }
.idea-card::before { position: absolute; width: 130px; height: 130px; border-radius: 50%; content: ""; filter: blur(3px); transform: translate(45px,-28px); }
.idea-card.cobalt::before { background: rgba(102,169,255,.58); }
.idea-card.ember::before { background: rgba(255,135,111,.55); }
.idea-card.mint::before { background: rgba(102,215,175,.55); }
.idea-card > * { position: relative; z-index: 1; }
.idea-card small { margin-bottom: auto; color: var(--muted); font-size: var(--text-meta); font-weight: 900; letter-spacing: .1em; }
.idea-card strong { font-size: var(--text-card-title); line-height: 1.05; }
.idea-card p { margin: 6px 0 0; color: var(--muted); font-size: var(--text-body); line-height: 1.35; }
.idea-card.selected { outline: 2px solid var(--violet); outline-offset: -4px; }

.empty-state { display: grid; min-height: 55%; place-items: center; align-content: center; padding: 26px 10px; text-align: center; }
.empty-state h2 { margin: 8px 0 4px; font-size: 24px; }
.empty-state p { max-width: 280px; margin: 0 0 14px; color: var(--muted); font-size: var(--text-body); line-height: 1.5; }
.text-action { min-height: var(--tap-target); padding: 0 10px; border: 0; background: transparent; color: var(--violet); font-size: var(--text-control); font-weight: 900; cursor: pointer; }
.works-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space); padding-bottom: var(--space); }
.work-card { position: relative; overflow: hidden; width: 100%; margin: 0; border: 1px solid rgba(23,23,23,.72); border-radius: 20px; background: rgba(255,253,248,.84); box-shadow: 0 10px 28px rgba(42,36,28,.08); }
.work-media { position: relative; width: 100%; overflow: hidden; border: 0; padding: 0; background: #e8e3da; cursor: pointer; }
.work-card img { display: block; width: 100%; height: auto; opacity: 0; object-fit: cover; transition: opacity .22s ease; }
.work-card.image-ready img { opacity: 1; }
.work-skeleton, .viewer-skeleton { position: absolute; inset: 0; background: linear-gradient(105deg,#e4dfd6 20%,#f5f1e9 38%,#e4dfd6 56%); background-size: 220% 100%; animation: skeleton-shimmer 1.15s linear infinite; }
.work-card.image-ready .work-skeleton { display: none; }
.work-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; border: 0; background: rgba(255,253,248,.92); color: var(--ink); font-size: var(--text-caption); font-weight: 850; text-align: center; cursor: pointer; }
.work-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 11px 11px; }
.work-meta strong, .work-meta small { display: block; }
.work-meta strong { overflow: hidden; font-size: var(--text-body); text-overflow: ellipsis; white-space: nowrap; }
.work-meta small { margin-top: 2px; color: var(--muted); font-size: var(--text-meta); }
.work-save { display: grid; width: var(--tap-target); height: var(--tap-target); flex: 0 0 var(--tap-target); place-items: center; border: 1px solid var(--ink); border-radius: 50%; background: var(--ink); color: white; cursor: pointer; }
.work-placeholder { display: grid; min-height: 145px; place-items: center; padding: 20px; color: var(--muted); font-size: var(--text-caption); text-align: center; }
.works-status { padding: 16px 8px; color: var(--muted); font-size: var(--text-body); text-align: center; }
.works-retry, .works-load-more { display: block; margin: 0 auto 12px; }
.works-sentinel { height: 1px; }

.works-viewer { position: fixed; z-index: 60; inset: 0; display: grid; width: 100%; height: var(--app-height); place-items: center; background: #0f0f0f; }
.works-viewer[hidden] { display: none; }
.works-viewer:fullscreen { width: 100vw; height: 100vh; }
.viewer-dialog { position: relative; display: grid; width: 100%; height: 100%; grid-template-rows: minmax(0,1fr) auto; overflow: hidden; background: #0f0f0f; color: white; }
.works-viewer.is-landscape.force-landscape .viewer-dialog { position: absolute; width: 100vh; height: 100vw; transform: rotate(90deg); }
.viewer-close { position: absolute; z-index: 4; top: max(10px,var(--safe-top)); right: max(10px,var(--safe-right)); display: grid; width: var(--tap-target); height: var(--tap-target); place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(15,15,15,.7); color: white; font-size: 26px; cursor: pointer; backdrop-filter: blur(8px); }
.viewer-stage { position: relative; display: grid; min-height: 0; place-items: center; overflow: hidden; touch-action: pan-y; }
.viewer-stage img { display: block; width: 100%; height: 100%; opacity: 0; object-fit: contain; transition: opacity .2s ease, transform .24s ease; user-select: none; }
.viewer-stage.image-ready img { opacity: 1; }
.viewer-stage.image-ready .viewer-skeleton { display: none; }
.viewer-arrow { position: absolute; z-index: 3; top: 50%; display: grid; width: 42px; height: 54px; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; background: rgba(15,15,15,.55); color: white; font-size: 30px; transform: translateY(-50%); cursor: pointer; backdrop-filter: blur(8px); }
.viewer-arrow:disabled { visibility: hidden; }
.viewer-prev { left: max(8px,var(--safe-left)); }
.viewer-next { right: max(8px,var(--safe-right)); }
.viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px max(14px,var(--safe-right)) calc(12px + var(--safe-bottom)) max(14px,var(--safe-left)); border-top: 1px solid rgba(255,255,255,.14); background: rgba(15,15,15,.86); }
.viewer-footer strong, .viewer-footer small { display: block; }
.viewer-footer strong { font-size: var(--text-body); }
.viewer-footer small { margin-top: 3px; color: rgba(255,255,255,.68); font-size: var(--text-meta); }
.viewer-download { min-height: var(--tap-target); padding: 0 14px; border: 1px solid white; border-radius: 13px; background: white; color: var(--ink); font-size: var(--text-control); font-weight: 900; cursor: pointer; }
.reference-viewer { position: fixed; z-index: 70; inset: 0; display: grid; width: 100%; height: var(--app-height); grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr); place-items: center; overflow: hidden; background: rgba(12,12,12,.98); color: white; cursor: zoom-out; }
.reference-viewer[hidden] { display: none; }
.reference-viewer img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; pointer-events: none; user-select: none; }
.reference-viewer-close { position: absolute; z-index: 2; top: max(10px,var(--safe-top)); right: max(10px,var(--safe-right)); display: grid; width: var(--tap-target); height: var(--tap-target); place-items: center; border: 1px solid rgba(255,255,255,.38); border-radius: 50%; background: rgba(15,15,15,.72); color: white; font-size: 27px; cursor: pointer; backdrop-filter: blur(10px); }
.reference-viewer > span { position: absolute; right: max(16px,var(--safe-right)); bottom: calc(16px + var(--safe-bottom)); left: max(16px,var(--safe-left)); overflow: hidden; color: rgba(255,255,255,.76); font-size: var(--text-caption); font-weight: 800; text-align: center; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.orientation-guard {
  position: absolute;
  z-index: 100;
  inset: 0;
  display: none;
  place-items: center;
  overflow: hidden;
  padding: calc(18px + var(--safe-top)) max(24px,var(--safe-right,0px)) calc(18px + var(--safe-bottom)) max(24px,var(--safe-left,0px));
  background: var(--paper);
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb,var(--active-accent) 18%,transparent), transparent 42%),
    var(--paper);
  text-align: center;
}
.orientation-guard::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle,var(--line) 1px,transparent 1.35px);
  background-size: 18px 18px;
  content: "";
  opacity: .24;
}
.orientation-guard-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%,420px);
  place-items: center;
  padding: 18px 24px;
  border: 1px solid var(--line);
  border: 1px solid color-mix(in srgb,var(--ink) 48%,transparent);
  border-radius: 24px;
  background: var(--card);
  background: color-mix(in srgb,var(--card) 92%,transparent);
  box-shadow: 0 16px 48px rgba(23,23,23,.14);
  backdrop-filter: blur(14px);
}
.orientation-device {
  position: relative;
  display: block;
  width: 42px;
  height: 66px;
  margin-bottom: 13px;
  border: 2px solid var(--ink);
  border-radius: 11px;
  animation: orientation-device-turn 1.2s cubic-bezier(.16,1,.3,1) both;
}
.orientation-device::before {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
  content: "";
  transform: translateX(-50%);
}
.orientation-device i {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  height: 8px;
  border-radius: 4px;
  background: var(--active-accent);
}
.orientation-guard small { color: var(--muted); font-size: var(--text-meta); font-weight: 900; letter-spacing: .14em; }
.orientation-guard h2 { margin: 5px 0 0; font-size: clamp(22px,5vw,30px); line-height: 1; letter-spacing: -.04em; }
.orientation-guard p { max-width: 330px; margin: 9px 0 0; color: var(--muted); font-size: var(--text-body); line-height: 1.45; }
:root.viewer-open .app-head { visibility: hidden; }

.profile-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 13px; margin-bottom: 10px; padding: 15px; border: 1px solid rgba(23,23,23,.72); border-radius: 22px; background: rgba(255,253,248,.82); }
.profile-avatar { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 50%; background: var(--coral); color: white; font-size: 20px; font-weight: 900; }
.profile-card strong, .profile-card small { display: block; }
.profile-card strong { font-size: 14px; }
.profile-card small { margin-top: 3px; color: var(--muted); font-size: var(--text-caption); }
.balance-card { margin-bottom: 10px; padding: 17px; border: 1px solid rgba(23,23,23,.72); border-radius: 22px; background: #ffe9e4; }
.balance-card > small { color: var(--muted); font-size: var(--text-meta); font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.balance-card div { display: flex; align-items: flex-end; gap: 7px; margin-top: 16px; }
.balance-card div strong { font-size: clamp(42px, 14vw, 60px); line-height: .8; letter-spacing: -.065em; }
.balance-card div span { font-size: var(--text-caption); font-weight: 850; text-transform: uppercase; }
.balance-card p { margin: 14px 0 12px; color: var(--muted); font-size: var(--text-body); }
.balance-card button { display: flex; width: 100%; min-height: var(--tap-target); align-items: center; justify-content: space-between; padding: 0 13px; border: 1px solid var(--ink); border-radius: 13px; background: var(--ink); color: white; font-size: var(--text-control); font-weight: 850; cursor: pointer; }
.balance-card button:disabled { opacity: .48; cursor: default; }
.promo-card { margin-bottom: 10px; padding: 15px; border: 1px solid rgba(23,23,23,.72); border-radius: 22px; background: rgba(255,253,248,.82); container: promo / inline-size; }
.promo-card > label { display: block; margin-bottom: 9px; font-size: var(--text-body); font-weight: 850; }
.promo-card > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.promo-card input, .billing-sheet input { min-width: 0; height: var(--tap-target); padding: 0 12px; border: 1px solid rgba(23,23,23,.55); border-radius: 12px; background: #fffdf8; color: var(--ink); font: var(--text-body)/1 ui-monospace, monospace; text-transform: uppercase; }
.promo-card button { min-height: var(--tap-target); padding: 0 13px; border: 1px solid var(--ink); border-radius: 12px; background: var(--ink); color: white; font-size: var(--text-control); font-weight: 850; }
.promo-card small { display: block; margin-top: 9px; color: var(--muted); font-size: var(--text-meta); line-height: 1.45; }
@container promo (width < 300px) {
  .promo-card > div { grid-template-columns: 1fr; }
}
.settings-list { overflow: hidden; border: 1px solid rgba(23,23,23,.72); border-radius: 22px; background: rgba(255,253,248,.82); }
.theme-toggle { width: 100%; border: 0; border-bottom: 1px solid #c9c2b7; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.theme-toggle:focus-visible { outline: 2px solid var(--active-accent); outline-offset: -3px; }
.theme-switch { position: relative; display: block; width: 46px; height: 27px; flex: 0 0 46px; border: 1px solid var(--line); border: 1px solid color-mix(in srgb,var(--ink) 42%,transparent); border-radius: 999px; background: rgba(119,113,104,.22); background: color-mix(in srgb,var(--muted) 22%,transparent); box-shadow: inset 0 2px 5px rgba(23,23,23,.12); transition: background-color .46s cubic-bezier(.16,1,.3,1), border-color .46s ease, box-shadow .46s ease; }
.theme-switch i { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--card); box-shadow: 0 2px 7px rgba(23,23,23,.24); transition: background-color .46s ease, transform .52s cubic-bezier(.16,1,.3,1); }
.theme-toggle[aria-checked="true"] .theme-switch { border-color: var(--active-accent); border-color: color-mix(in srgb,var(--active-accent) 74%,var(--ink)); background: var(--active-accent); box-shadow: 0 0 18px rgba(139,92,246,.34); box-shadow: 0 0 18px color-mix(in srgb,var(--active-accent) 34%,transparent); }
.theme-toggle[aria-checked="true"] .theme-switch i { transform: translateX(19px); }

.billing-sheet { position: fixed; inset: 0; z-index: 80; display: grid; align-items: end; }
.billing-sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(23,23,23,.32); backdrop-filter: blur(5px); }
.billing-sheet > section { position: relative; max-height: min(80dvh, 640px); overflow: auto; padding: 19px 18px calc(22px + var(--safe-bottom)); border: 1px solid rgba(23,23,23,.75); border-radius: 26px 26px 0 0; background: #fffdf8; box-shadow: 0 -20px 70px rgba(23,23,23,.18); }
.billing-sheet header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 16px; }
.billing-sheet header small { color: var(--muted); font-size: var(--text-meta); font-weight: 900; letter-spacing: .12em; }
.billing-sheet h2 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.04em; }
.billing-sheet header button { width: var(--tap-target); height: var(--tap-target); flex: 0 0 var(--tap-target); border: 1px solid rgba(23,23,23,.4); border-radius: 50%; background: transparent; font-size: 21px; }
.billing-packages { display: grid; gap: 8px; margin-bottom: 15px; }
.billing-package { min-height: 58px; padding: 0 14px; border: 1px solid rgba(23,23,23,.55); border-radius: 15px; background: white; display: flex; justify-content: space-between; align-items: center; color: var(--ink); }
.billing-package strong, .billing-package small { display: block; text-align: left; }
.billing-package small { margin-top: 4px; color: var(--muted); font-size: var(--text-meta); }
.billing-package > b { font-size: var(--text-body); }
.billing-sheet > section > label { display: grid; gap: 7px; color: var(--muted); font-size: var(--text-caption); }
.billing-sheet input { width: 100%; }
.billing-sheet p { margin: 13px 0 0; color: var(--muted); font-size: var(--text-meta); line-height: 1.5; }
.setting-row { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #c9c2b7; font-size: var(--text-body); font-weight: 800; }
.setting-row:last-child { border-bottom: 0; }
.setting-row span small { display: block; margin-top: 3px; color: var(--muted); font-size: var(--text-meta); font-weight: 650; }
.setting-row > strong { color: var(--muted); font-size: var(--text-caption); }
.profile-card,
.balance-card,
.promo-card,
.settings-list,
.idea-card,
.work-card,
.composer-panel,
.prompt-card,
.reference-strip,
.generation-options,
.toast,
.promo-card input,
.billing-sheet input,
.billing-sheet > section,
.billing-package {
  transition: background-color .5s cubic-bezier(.16,1,.3,1), border-color .5s ease, color .5s ease, box-shadow .5s ease;
}

.tool-screen { overflow: hidden; padding: calc(7px + var(--safe-top)) var(--page-x) 2px; background: transparent; }
.workspace { display: flex; min-height: 0; height: 100%; flex-direction: column; gap: var(--space); padding: 0; }
.canvas-stage {
  position: relative;
  display: grid;
  min-height: 220px;
  min-height: clamp(140px,35cqb,315px);
  flex: 1 1 auto;
  place-items: stretch;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}
.canvas-stage::before { display: none; }
.canvas-stage.has-photo { margin-top: auto; margin-bottom: 0; }
.canvas-stage.options-open { z-index: 10; }
.canvas-stage.has-photo:not(.showing-result),
.canvas-stage.showing-result {
  min-height: 0;
  flex: 0 1 auto;
  align-self: center;
}
.canvas-stage.has-photo:not(.showing-result) {
  width: var(--subject-stage-width, 100%);
  height: var(--subject-stage-height, auto);
  max-height: calc(100% - var(--generate-rail-height));
  flex-basis: var(--subject-stage-height, auto);
  aspect-ratio: var(--subject-aspect, 4 / 3);
}
.canvas-stage.showing-result {
  width: 100%;
  max-height: calc(100% - var(--generate-rail-height));
  aspect-ratio: var(--output-aspect, 9 / 16);
}
.canvas-stage.has-photo.options-open { min-height: clamp(0px,calc(100% - var(--generate-rail-height)),214px); }
.upload-zone { position: relative; z-index: 2; display: grid; min-width: 0; min-height: 0; place-items: center; overflow: hidden; border-radius: 20px; cursor: zoom-in; outline: 0; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.canvas-stage:not(.has-photo) .upload-zone { cursor: pointer; pointer-events: auto; }
.canvas-stage.has-photo .upload-zone:focus-visible { box-shadow: 0 0 0 3px var(--violet); }
.canvas-stage:not(.has-photo) .upload-zone:focus-visible .upload-empty { border-color: var(--active-accent); box-shadow: 0 0 0 3px color-mix(in srgb,var(--active-accent) 16%,transparent); }
.upload-empty { display: grid; width: min(100%,250px); gap: 9px; place-items: center; padding: 22px; border: 1px solid color-mix(in srgb,var(--ink) 34%,transparent); border-radius: 22px; background: color-mix(in srgb,var(--card) 82%,transparent); box-shadow: 0 12px 38px rgba(0,0,0,.08); text-align: center; backdrop-filter: blur(12px); }
.upload-empty i { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 50%; background: var(--violet); color: white; font-style: normal; font-size: 26px; }
.upload-empty strong { font-size: 13px; }
.upload-empty small { color: var(--muted); font-size: var(--text-caption); }
.upload-preview { position: absolute; inset: 0; display: none; width: 100%; height: 100%; object-fit: contain; background: rgba(23,23,23,.96); }
.canvas-stage.has-photo .upload-preview { display: block; }
.canvas-stage.has-photo .upload-empty { display: none; }
.change-photo { position: absolute; z-index: 3; top: 12px; right: 12px; display: none; min-height: var(--tap-target); padding: 0 13px; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; background: rgba(23,23,23,.74); color: white; font-size: var(--text-caption); font-weight: 850; backdrop-filter: blur(8px); }
.canvas-stage.has-photo .change-photo { display: block; }
.canvas-stage.options-open .change-photo,
.canvas-stage.options-open .generation-summary { visibility: hidden; }
.result-layer { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; overflow: hidden; border-radius: 20px; background: #171717; }
.result-layer > img { display: none; width: 100%; height: 100%; object-fit: contain; object-position: center; cursor: zoom-in; outline: 0; }
.result-layer > img:focus-visible { box-shadow: inset 0 0 0 3px var(--violet); }
.result-layer.has-result > img { display: block; }
.result-layer.has-result .result-progress { display: none; }
.result-layer.is-failed .progress-orbit { display: none; }
.result-progress { position: relative; z-index: 2; display: grid; max-width: 240px; place-items: center; padding: 20px; color: white; text-align: center; }
.result-progress strong { margin-top: 10px; font-size: 12px; }
.result-progress p { margin: 5px 0 0; color: rgba(255,255,255,.7); font-size: var(--text-caption); line-height: 1.4; }
.result-failure-actions { display: grid; width: min(100%,220px); margin-top: 14px; grid-template-columns: 1fr 1fr; gap: 8px; }
.result-failure-actions button { min-height: var(--tap-target); padding: 8px 10px; border: 1px solid rgba(255,255,255,.5); border-radius: 12px; background: transparent; color: white; font-size: var(--text-caption); font-weight: 850; cursor: pointer; }
.result-failure-actions button:last-child { background: white; color: var(--ink); }
.progress-orbit { width: 38px; height: 38px; border: 2px solid rgba(255,255,255,.25); border-top-color: var(--violet); border-radius: 50%; animation: orbit .9s linear infinite; }

.composer-panel {
  width: 100%;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(23,23,23,.36);
  border-radius: 20px;
  background: rgba(255,253,248,.88);
  box-shadow: inset 0 1px rgba(255,255,255,.82);
  backdrop-filter: blur(14px);
  -webkit-mask: radial-gradient(circle 46px at 50% calc(100% + 32px), transparent 45px, #000 46px);
  mask: radial-gradient(circle 46px at 50% calc(100% + 32px), transparent 45px, #000 46px);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.composer-panel:focus-within {
  border-color: rgba(23,23,23,.58);
  box-shadow: inset 0 1px rgba(255,255,255,.82), 0 0 0 2px rgba(139,92,246,.08);
}
.composer-panel.instruction-needed {
  border-color: var(--coral);
  box-shadow: inset 0 1px rgba(255,255,255,.82), 0 0 0 3px rgba(255,135,111,.13);
  animation: composer-nudge .42s cubic-bezier(.2,.8,.2,1);
}
.composer-panel.mention-open { overflow: visible; -webkit-mask: none; mask: none; }
.canvas-stage:not(.has-photo) ~ .composer-panel { display: none; }
.prompt-card {
  position: relative;
  width: 100%;
  min-height: 80px;
  padding: 11px 14px 23px;
}
.prompt-card textarea, .char-count { position: relative; z-index: 1; }
.prompt-card textarea { display: block; width: 100%; height: 44px; min-height: 44px; overflow-y: auto; resize: none; border: 0; outline: 0; background: transparent; scrollbar-width: none; font-size: 16px; line-height: 1.35; }
.prompt-card textarea::-webkit-scrollbar { display: none; }
.prompt-card textarea::placeholder { color: #8d867c; opacity: 1; }
.char-count { position: absolute; right: 14px; bottom: 13px; color: var(--muted); font-size: var(--text-meta); }
.reference-strip {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(23,23,23,.18);
}
.reference-list { position: relative; display: flex; min-width: 0; min-height: 90px; align-items: center; gap: 7px; overflow-x: auto; padding: 8px 11px; scrollbar-width: none; }
.reference-list::-webkit-scrollbar { display: none; }
.reference-items { display: contents; }
.reference-card, .reference-add {
  position: relative;
  width: 70px;
  height: 54px;
  flex: 0 0 70px;
  overflow: hidden;
  border: 1px solid rgba(23,23,23,.45);
  border-radius: 13px;
  background: rgba(255,255,255,.58);
}
.reference-card { padding: 0; cursor: zoom-in; }
.reference-card:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
.reference-card img { width: 100%; height: 100%; object-fit: cover; }
.reference-card small { position: absolute; right: 4px; bottom: 4px; left: 4px; overflow: hidden; color: white; font-size: 9px; font-weight: 850; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0,0,0,.7); white-space: nowrap; }
.reference-remove { position: absolute; z-index: 2; top: 0; right: 0; display: grid; width: var(--tap-target); height: var(--tap-target); place-items: center; border: 0; background: transparent; color: white; font-size: 14px; line-height: 1; cursor: pointer; }
.reference-remove::before { position: absolute; z-index: -1; width: 24px; height: 24px; border-radius: 50%; background: rgba(23,23,23,.72); content: ""; }
.reference-add {
  align-self: stretch;
  width: auto;
  height: auto;
  min-width: 70px;
  flex: 1 0 70px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.reference-add-copy { position: absolute; top: 1px; right: 42px; left: 1px; overflow: hidden; color: var(--muted); font-size: var(--text-meta); line-height: 1.2; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.reference-add-card { position: absolute; top: 26px; left: 50%; display: grid; width: 48px; height: 48px; place-content: center; border: 0; background: transparent; text-align: center; transform: translateX(-50%); }
.reference-add-card i { font-style: normal; font-size: 27px; font-weight: 450; line-height: 1; }
.reference-strip.has-references .reference-add-copy { display: none; }
.reference-strip.has-references .reference-add-card { top: 50%; transform: translate(-50%,-50%); }
.reference-count { position: sticky; z-index: 3; right: 0; top: 0; align-self: flex-start; margin-left: -43px; padding: 1px 0 3px 7px; background: linear-gradient(90deg,transparent,var(--card) 22%); color: var(--muted); font-size: var(--text-meta); line-height: 1.2; pointer-events: none; white-space: nowrap; }
.reference-add:active { transform: scale(.97); }
.reference-mention-menu { position: absolute; z-index: 24; right: 14px; bottom: calc(100% - 8px); left: 14px; display: grid; max-height: 210px; gap: 4px; overflow-y: auto; padding: 6px; border: 1px solid color-mix(in srgb,var(--ink) 34%,transparent); border-radius: 16px; background: color-mix(in srgb,var(--card) 96%,transparent); box-shadow: 0 14px 38px rgba(0,0,0,.2); backdrop-filter: blur(18px); scrollbar-width: none; }
.reference-mention-menu[hidden] { display: none; }
.reference-mention-menu::-webkit-scrollbar { display: none; }
.reference-mention-option { display: grid; min-height: 48px; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 9px; padding: 5px 9px 5px 5px; border: 0; border-radius: 11px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.reference-mention-option img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; }
.reference-mention-option span { display: grid; gap: 2px; min-width: 0; }
.reference-mention-option strong { font-size: var(--text-body); }
.reference-mention-option small { overflow: hidden; color: var(--muted); font-size: var(--text-meta); text-overflow: ellipsis; white-space: nowrap; }
.reference-mention-option.active,
.reference-mention-option:active { background: color-mix(in srgb,var(--active-accent) 16%,var(--card)); }
.generation-summary { position: absolute; z-index: 4; right: 10px; bottom: 10px; left: 10px; display: none; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
.canvas-stage.has-photo .generation-summary { display: flex; }
.generation-settings-toggle, .generation-summary-price { min-height: var(--tap-target); border: 1px solid rgba(255,255,255,.58); border-radius: 999px; background: rgba(15,15,15,.72); box-shadow: 0 5px 16px rgba(0,0,0,.18); color: white; font-size: var(--text-caption); font-weight: 900; backdrop-filter: blur(10px); }
.generation-settings-toggle { display: flex; align-items: center; gap: 7px; padding: 0 12px; cursor: pointer; pointer-events: auto; }
.generation-settings-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.generation-summary-price { display: flex; align-items: center; padding: 0 11px; }
.generation-options { position: absolute; z-index: 6; bottom: 8px; left: 8px; display: grid; width: min(252px,calc(100% - 16px)); gap: 5px; max-height: calc(100% - 16px); overflow-y: auto; padding: 7px; border: 1px solid rgba(23,23,23,.18); border-radius: 15px; background: rgba(255,253,248,.96); box-shadow: 0 12px 32px rgba(23,23,23,.2); backdrop-filter: blur(14px); scrollbar-width: thin; }
.generation-options-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.generation-options-head strong { font-size: var(--text-caption); }
.generation-options-head button { display: grid; width: var(--tap-target); height: var(--tap-target); flex: 0 0 var(--tap-target); place-items: center; border: 0; border-radius: 50%; background: rgba(23,23,23,.08); font-size: 17px; cursor: pointer; }
.option-line { display: grid; min-width: 0; gap: 3px; }
.option-line > span { color: var(--muted); font-size: var(--text-meta); font-weight: 900; text-transform: uppercase; }
.option-chips { display: grid; min-width: 0; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; }
#resolution-options { display: flex; gap: 3px; }
#resolution-options .option-chip { width: 58px; flex: 0 0 58px; }
.option-chip { display: flex; min-width: 0; min-height: var(--tap-target); align-items: center; justify-content: center; gap: 5px; padding: 0 6px; border: 1px solid #aaa398; border-radius: 10px; background: transparent; color: var(--ink); font-size: var(--text-meta); font-weight: 850; cursor: pointer; }
.option-chip.selected { border-color: var(--ink); background: var(--ink); color: white; }
.ratio-icon { display: grid; width: 16px; height: 16px; flex: 0 0 16px; place-items: center; }
.ratio-icon i { display: block; min-width: 4px; min-height: 4px; border: 1.2px solid currentColor; border-radius: 1.5px; }
.option-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.generation-quote { display: none; }
.result-actions { position: absolute; z-index: 7; top: 12px; right: 12px; display: flex; gap: 7px; }
.result-actions button { display: grid; width: var(--tap-target); height: var(--tap-target); place-items: center; border: 1px solid rgba(255,255,255,.48); border-radius: 50%; background: rgba(15,15,15,.7); box-shadow: 0 5px 16px rgba(0,0,0,.18); color: white; font-size: 17px; font-weight: 850; cursor: pointer; backdrop-filter: blur(10px); }
.result-actions button:active { transform: scale(.96); }
.result-new { position: absolute; z-index: 7; bottom: 14px; left: 50%; min-height: var(--tap-target); padding: 0 15px; border: 1px solid rgba(255,255,255,.52); border-radius: 999px; background: rgba(15,15,15,.72); box-shadow: 0 5px 16px rgba(0,0,0,.18); color: white; font-size: var(--text-caption); font-weight: 900; transform: translateX(-50%); cursor: pointer; backdrop-filter: blur(10px); white-space: nowrap; }
.result-new span { font-size: 14px; vertical-align: -1px; }

.bottom-nav {
  position: absolute;
  z-index: 15;
  right: 0;
  bottom: var(--nav-bottom);
  left: 0;
  display: block;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding: 0 var(--page-x) var(--safe-bottom);
  background: transparent;
  pointer-events: none;
}
.nav-dock {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  height: var(--nav-height);
  grid-template-columns: repeat(2,minmax(var(--tap-target),1fr)) var(--nav-center-slot) repeat(2,minmax(var(--tap-target),1fr));
  align-items: center;
  pointer-events: auto;
}
.nav-surface {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  border-radius: 999px;
  pointer-events: none;
}
.nav-surface-base,
.nav-surface-wave {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  -webkit-mask: radial-gradient(circle var(--nav-notch-radius) at 50% var(--nav-notch-depth), transparent calc(var(--nav-notch-radius) - 1px), #000 var(--nav-notch-radius));
  mask: radial-gradient(circle var(--nav-notch-radius) at 50% var(--nav-notch-depth), transparent calc(var(--nav-notch-radius) - 1px), #000 var(--nav-notch-radius));
}
.nav-surface-base {
  z-index: 0;
  background: var(--nav-base);
}
.nav-surface-wave {
  z-index: 1;
  background: var(--nav-wave);
  clip-path: circle(var(--nav-wave-radius,0px) at var(--nav-wave-x,50%) var(--nav-wave-y,50%));
}
.nav-surface::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--ink) 56%,transparent);
  content: "";
  pointer-events: none;
  -webkit-mask: radial-gradient(circle var(--nav-notch-radius) at 50% var(--nav-notch-depth), transparent calc(var(--nav-notch-radius) - 1px), #000 var(--nav-notch-radius));
  mask: radial-gradient(circle var(--nav-notch-radius) at 50% var(--nav-notch-depth), transparent calc(var(--nav-notch-radius) - 1px), #000 var(--nav-notch-radius));
}
.nav-item {
  position: relative;
  z-index: 2;
  display: grid;
  min-width: 0;
  height: 56px;
  place-items: center;
  margin: 0 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #888178;
  cursor: pointer;
  transition: color .46s cubic-bezier(.16,1,.3,1);
}
.nav-item::before,
.nav-item::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--nav-selected-size);
  height: var(--nav-selected-size);
  border-radius: 50%;
  content: "";
  pointer-events: none;
  transform: translate(-50%,-50%);
}
.nav-item::before {
  z-index: 0;
  background: var(--nav-wave);
  background: color-mix(in srgb,var(--active-accent) 14%,var(--nav-base));
  box-shadow: inset 0 0 0 1px var(--line);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--active-accent) 22%,transparent);
  opacity: 0;
  transform: translate(-50%,-50%) scale(.78);
  transition: opacity .28s ease, background-color .48s ease, box-shadow .48s ease, transform .32s cubic-bezier(.16,1,.3,1);
}
.nav-item::after {
  z-index: 2;
  width: calc(var(--nav-selected-size) + 6px);
  height: calc(var(--nav-selected-size) + 6px);
  border: 2px solid var(--active-accent);
  border: 2px solid color-mix(in srgb,var(--active-accent) 72%,var(--ink));
  opacity: 0;
  transition: opacity .16s ease;
}
.nav-item:focus { outline: 0; }
:root.keyboard-navigation .nav-item:focus-visible::after { opacity: 1; }
.nav-item svg {
  position: relative;
  z-index: 1;
  width: var(--nav-icon-size);
  height: var(--nav-icon-size);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: none;
  transition: transform .12s ease;
}
.nav-item span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav-item.active {
  color: var(--ink);
}
.nav-item.active::before {
  opacity: 1;
  transform: translate(-50%,-50%) scale(1);
}
.nav-item:active::before {
  background: var(--nav-wave);
  background: color-mix(in srgb,var(--active-accent) 22%,var(--nav-base));
  transform: translate(-50%,-50%) scale(.94);
}
.nav-item:active svg { transform: scale(.92); }
.nav-item[data-nav="home"] { grid-column: 1; }
.nav-item[data-nav="ideas"] { grid-column: 2; }
.nav-item[data-nav="works"] { grid-column: 4; }
.nav-item[data-nav="profile"] { grid-column: 5; }
.create-slot {
  position: absolute;
  z-index: 4;
  bottom: calc(var(--create-bottom) + var(--safe-bottom));
  left: 50%;
  display: grid;
  width: var(--create-diameter);
  height: var(--create-diameter);
  place-items: center;
  pointer-events: auto;
  transform: translateX(-50%);
}
.create-main {
  --hold-angle: 0deg;
  position: absolute;
  inset: 0;
  display: grid;
  width: var(--create-diameter);
  height: var(--create-diameter);
  overflow: visible;
  place-items: center;
  border: 1.5px solid transparent;
  border-radius: 50%;
  background: var(--create-base-accent,var(--active-accent));
  box-shadow: inset 0 1px rgba(255,255,255,.3), 0 7px 18px rgba(23,23,23,.18), 0 0 18px rgba(139,92,246,.26);
  box-shadow: inset 0 1px rgba(255,255,255,.3), 0 7px 18px rgba(23,23,23,.18), 0 0 18px color-mix(in srgb,var(--create-base-accent,var(--active-accent)) 26%,transparent);
  color: white;
  cursor: pointer;
  line-height: 1;
  touch-action: none;
  transition: opacity .2s ease, transform .22s ease, box-shadow .46s ease;
  user-select: none;
  will-change: transform, box-shadow;
}
.create-main:focus { outline: 0; }
:root.keyboard-navigation .create-main:focus-visible {
  outline: 2px solid var(--active-accent);
  outline: 2px solid color-mix(in srgb,var(--active-accent) 72%,var(--ink));
  outline-offset: 3px;
}
.create-main::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: 50%;
  background: var(--create-wave-accent,var(--active-accent));
  clip-path: circle(var(--create-wave-radius,0px) at var(--create-wave-x,50%) var(--create-wave-y,50%));
  content: "";
  opacity: var(--create-wave-opacity,0);
  pointer-events: none;
}
.create-main::after {
  position: absolute;
  z-index: -1;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(var(--mint) var(--hold-angle), rgba(139,92,246,.16) 0);
  content: "";
  opacity: 0;
  pointer-events: none;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
}
.create-outline {
  position: absolute;
  z-index: 3;
  inset: -1.5px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
}
.create-main.hold-ready { animation: create-ready-pulse 1.65s cubic-bezier(.45,0,.55,1) infinite alternate; }
.create-main.is-holding {
  animation: none;
  box-shadow: inset 0 1px rgba(255,255,255,.32), 0 5px 15px rgba(61,31,129,.22), 0 0 34px rgba(139,92,246,.48);
  transform: scale(.96);
}
.create-main.is-holding::after {
  opacity: 1;
  animation: hold-progress .85s linear forwards;
}
.create-main.hold-confirmed {
  background: var(--mint);
  box-shadow: inset 0 1px rgba(255,255,255,.35), 0 5px 16px rgba(42,153,117,.3), 0 0 32px rgba(102,215,175,.55);
}
.create-main.needs-input { box-shadow: 0 5px 12px rgba(0,0,0,.14); }
.button-face { position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center; white-space: nowrap; opacity: 0; filter: blur(4px); transform: translateY(8px) scale(.86); transition: opacity .28s ease, filter .34s ease, transform .48s cubic-bezier(.16,1,.3,1); pointer-events: none; }
.face-plus { opacity: 1; filter: blur(0); font-size: var(--create-glyph-size); transform: translateY(0) scale(1); }
.face-generate, .face-done { font-size: 22px; }
.face-loading { font-size: 14px; font-weight: 950; letter-spacing: 3px; }
.create-main.generating .face-plus, .create-main.complete .face-plus { opacity: 0; filter: blur(4px); transform: translateY(-7px) scale(.88); transition-delay: 0ms; }
.create-main.generating .face-loading, .create-main.complete .face-done { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
.create-main.generating { animation: generate-pulse 1.15s cubic-bezier(.45,0,.55,1) infinite alternate; }
.create-label { display: none; }
.label-state { position: absolute; top: 0; left: 50%; white-space: nowrap; opacity: 0; filter: blur(3px); transform: translate(-50%,5px); transition: opacity .3s ease, filter .34s ease, transform .46s cubic-bezier(.16,1,.3,1); }
.label-create { opacity: 1; filter: blur(0); transform: translate(-50%,0); }
.create-main.is-returning .button-face, .create-main.is-returning + .create-label .label-state { transition-delay:.76s; }
.toast { position: absolute; z-index: 30; right: var(--page-x); bottom: calc(var(--nav-reserve) + var(--safe-bottom) + var(--space)); left: var(--page-x); padding: 10px; border: 1px solid var(--ink); border-radius: 14px; background: var(--card); box-shadow: 0 8px 22px rgba(0,0,0,.12); font-size: 10px; font-weight: 850; text-align: center; pointer-events: none; animation: toast-in .24s cubic-bezier(.16,1,.3,1); }

@keyframes orbit { to { transform: rotate(1turn); } }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes composer-nudge {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-3px); }
  70% { transform: translateX(3px); }
}
@keyframes create-ready-pulse {
  from { transform: scale(1); box-shadow: inset 0 1px rgba(255,255,255,.3), 0 8px 22px rgba(61,31,129,.24), 0 0 18px rgba(139,92,246,.22); }
  to { transform: scale(1.035); box-shadow: inset 0 1px rgba(255,255,255,.34), 0 9px 24px rgba(61,31,129,.28), 0 0 34px rgba(139,92,246,.46); }
}
@keyframes hold-progress { to { --hold-angle: 360deg; } }
@keyframes generate-pulse { from { transform: scale(1); box-shadow: 0 8px 22px rgba(139,92,246,.3); } to { transform: scale(.965); box-shadow: 0 5px 13px rgba(139,92,246,.2); } }
@keyframes skeleton-shimmer { to { background-position-x: -220%; } }
@keyframes orientation-device-turn {
  from { opacity: .2; transform: rotate(90deg) scale(.88); }
  to { opacity: 1; transform: rotate(0) scale(1); }
}

@media (max-width: 720px) and (min-height: 601px) {
  .canvas-stage.has-photo.options-open {
    width: 100%;
    height: 296px;
    min-height: 296px;
    max-height: 296px;
    flex: 0 0 296px;
    aspect-ratio: auto;
  }
  .generation-options { width: min(340px,calc(100% - 16px)); padding: 6px 7px; }
}

@media (max-width: 720px) and (max-height: 600px) and (orientation: portrait) {
  .generation-options {
    position: fixed;
    top: calc(64px + var(--safe-top));
    right: var(--page-x);
    bottom: auto;
    left: var(--page-x);
    width: auto;
    max-height: calc(var(--app-height) - var(--nav-reserve) - var(--safe-bottom) - var(--space) - 64px - var(--safe-top));
    padding: 10px;
    border-radius: 18px;
  }
}

@media (max-width: 720px), (max-height: 600px) {
  body { display: block; background: var(--paper); }
  .app-shell { width: 100%; height: var(--app-height); max-height: none; border: 0; border-radius: 0; box-shadow: none; }
}

@media (orientation: landscape) and (max-height: 600px) {
  .orientation-guard { display: grid; }
  :root:not(.viewer-open) .app-head { visibility: hidden; }
  :root.viewer-open .orientation-guard { display: none; }
}

:root[data-theme="dark"] body { background: #080808; }
:root[data-theme="dark"] .scene::after { opacity: .44; mix-blend-mode: screen; }
:root[data-theme="dark"] .app-shell { border-color: #5a554e; box-shadow: 9px 11px 0 #050505; }
:root[data-theme="dark"] .profile-card,
:root[data-theme="dark"] .promo-card,
:root[data-theme="dark"] .settings-list,
:root[data-theme="dark"] .idea-card,
:root[data-theme="dark"] .work-card,
:root[data-theme="dark"] .composer-panel,
:root[data-theme="dark"] .generation-options,
:root[data-theme="dark"] .toast { border-color: rgba(244,240,232,.3); background: rgba(27,26,24,.9); }
:root[data-theme="dark"] .balance-card { border-color: rgba(255,135,111,.48); background: #321d1a; }
:root[data-theme="dark"] .promo-card input,
:root[data-theme="dark"] .billing-sheet input,
:root[data-theme="dark"] .billing-sheet > section,
:root[data-theme="dark"] .billing-package { border-color: rgba(244,240,232,.28); background: #1b1a18; }
:root[data-theme="dark"] .setting-row,
:root[data-theme="dark"] .theme-toggle { border-bottom-color: #44403b; }
:root[data-theme="dark"] .screen-count,
:root[data-theme="dark"] .home-hint { border-color: #5e5851; background: rgba(27,26,24,.74); }
:root[data-theme="dark"] .nav-item { color: #aaa49a; }
:root[data-theme="dark"] .nav-item.active { color: var(--ink); }
:root[data-theme="dark"] .balance-card button,
:root[data-theme="dark"] .promo-card button,
:root[data-theme="dark"] .work-save,
:root[data-theme="dark"] .option-chip.selected { color: #11100f; }
:root[data-theme="dark"] .prompt-card,
:root[data-theme="dark"] .reference-strip { border-color: rgba(244,240,232,.38); background: rgba(27,26,24,.9); }

@media (min-width: 721px) and (min-height: 601px) {
  body { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
  .app-shell { height: min(calc(var(--app-height) - 40px), 932px); min-height: min(calc(var(--app-height) - 40px), 480px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  #dots { filter: none; }
}

@media (prefers-contrast: more) {
  :root { --line: #625d56; --muted: #514d47; }
  .screen { background: rgba(255,253,248,.45); }
}
