:root {
  color-scheme: dark;
  --ink: #f6f0ff;
  --muted: #c4bce5;
  --line: #aa9aff52;
  --panel: #181638;
  --sky: #a4e7ff;
  --control: #201b48;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #0b0a1d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.symbols, .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse at 15% 0, #392267 0, transparent 40%),
    radial-gradient(ellipse at 100% 48%, #15356b80 0, transparent 44%), #0b0a1d;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
}
p, h1, h2 { margin: 0; }
a { color: var(--sky); }
svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.spark { fill: currentColor; stroke: none; }

.orbit-screen { width: min(100%, 520px); margin-inline: auto; padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom)); }
.orbit-start { padding: 35vh 12px 0; text-align: center; color: var(--muted); }
.glass { background: linear-gradient(150deg, #28204ded, #151432f5 63%); border: 1px solid var(--line); box-shadow: inset 0 1px #e7daff25, 0 14px 40px #04031758; }
.muted { color: var(--muted); }
.orbit-wordmark { color: #d0baff; font-size: .66rem; font-weight: 760; letter-spacing: .16em; }
.orbit-header { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 8px; text-align: center; margin: 0 1px 12px; }
.orbit-header h1 { font-size: 1.35rem; line-height: 1.16; letter-spacing: -.035em; }
.orbit-icon { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 16px; color: #f4e6ff; background-color: #211b43; }
.orbit-active .orbit-screen {
  display: grid;
  height: 100vh;
  height: 100dvh;
}

#studio {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.orbit-workbench {
  min-height: 0;
  display: grid;
  grid-template: minmax(0, 1fr) auto / minmax(0, 1fr);
  isolation: isolate;
}

.orbit-canvas {
  grid-area: 1 / 1;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  background: #10112b;
}

.orbit-empty {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  padding: 20px;
  background: linear-gradient(0deg,#11102ef0, #2d288536 58%, #242c7a66),
    url('./assets/art-ideas/70.webp') 57% center/cover no-repeat;
}

.orbit-empty p { max-width: 12em; font-size: 1.25rem; line-height: 1.15; font-weight: 670; text-shadow: 0 1px 12px #050015; }
.orbit-canvas #result { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }
.orbit-result-matte {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(25px) brightness(.42);
  transform: scale(1.12);
}

.orbit-composer {
  grid-area: 2 / 1;
  align-self: end;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  border-radius: 0 0 19px 19px;
  background: #17172b;
  z-index: 1;
}

.orbit-workbench[data-editor-open] .orbit-canvas,
.orbit-workbench[data-editor-open] .orbit-composer { grid-area: 1 / 1 / -1; }

.orbit-workbench[data-editor-open] .orbit-empty { align-content: start; }
.orbit-workbench[data-editor-open] .orbit-canvas #result { object-position: center top; }
.orbit-workbench[data-editor-open] .orbit-composer {
  max-height: calc(100% - min(120px, 21%));
  border-radius: 22px 22px 18px 18px;
  background: linear-gradient(164deg, #222137, #17172b 68%);
}

.orbit-dock { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.orbit-dock button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid #c0a9ff83;
  border-radius: 12px;
  background: #222137;
  font-size: .88rem;
}
.orbit-dock svg, .orbit-secondary svg { color: #cbb4ff; }
.orbit-dock img { width: 36px; height: 32px; object-fit: cover; border-radius: 6px; }
.orbit-action { display: grid; gap: 8px; flex: none; }
.orbit-editor { display: grid; gap: 8px; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 2px 3px 4px; }
.orbit-handle { width: 38px; height: 4px; margin: 1px auto 0; background: #cab6fa95; border-radius: 4px; }
.orbit-editor-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.orbit-editor-head h2 { font-size: 1.16rem; }
.orbit-editor-head .orbit-icon { background: transparent; border-color: transparent; }
.orbit-editor textarea, .access input:not([type=checkbox]) {
  width: 100%;
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 12px;
  background: #24233a;
}
.orbit-editor textarea { min-height: 68px; max-height: 38vh; resize: vertical; }
.orbit-workbench[data-prompt-focused] textarea { min-height: clamp(94px, 18dvh, 152px); }
.orbit-editor textarea::placeholder { color: #c4badf; }

.orbit-reference {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #24233a;
  padding: 3px;
}
.orbit-reference #replaceReference {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  gap: 9px;
  background: transparent;
  border: 0;
  padding: 2px 4px;
  text-align: left;
}
.orbit-reference img { width: 56px; height: 44px; object-fit: cover; border-radius: 7px; flex: none; }
.orbit-reference span { min-width: 0; display: block; }
.orbit-reference strong { font-size: .90rem; }
.orbit-reference small { display: block; color: var(--muted); font-size: .72rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.orbit-reference .orbit-icon { border-color: transparent; background: transparent; }

.orbit-primary, .orbit-secondary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 49px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-weight: 680;
  font-size: .92rem;
  text-decoration: none;
  text-align: center;
}
.orbit-primary { color: #17102e; background: #c4a8ff; border-color: #d6c0ff; }
#generate { font-size: 1.03rem; }
.orbit-secondary { color: #f3e5ff; background: #201d34; }
.orbit-primary svg, .orbit-secondary svg { flex: 0 0 20px; width: 20px; height: 20px; }
.orbit-notice { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.orbit-notice[data-kind="error"] { color: #ffd0dd; }
.orbit-notice[data-kind="success"] { color: #b5f5e8; }

.access { max-width: 420px; margin: max(5vh, 16px) auto 0; padding: clamp(16px, 5vw, 28px); border-radius: 24px; }
.access h1 { font-size: 2rem; letter-spacing: -.04em; margin: 0 0 4px; }
.access form { display: grid; gap: 8px; }
.access form label { font-size: .86rem; font-weight: 650; }
.access .orbit-primary { margin-top: 9px; }
.access-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 16px 0 13px; padding: 4px; border-radius: 12px; background: #12112d; }
.access-tabs button, .text-button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.access-tabs button[aria-pressed="true"] { background: #32264f; color: var(--ink); }
.access-terms { display: flex; align-items: center; min-height: 44px; gap: 9px; }
.access-terms input { width: 19px; height: 19px; accent-color: #a67efa; }

dialog { width: min(420px, calc(100% - 24px)); max-height: 90svh; padding: 16px; color: var(--ink); border-radius: 22px; }
dialog::backdrop { background: #070617bb; backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.dialog-head h2 { font-size: 1.22rem; }
dialog > .orbit-primary, dialog > .orbit-secondary, dialog > .orbit-notice:not(:first-child) { margin-top: 9px; }
.orbit-plans { display: grid; gap: 8px; margin: 13px 0; }
.orbit-plan { min-height: 54px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--control); }
.orbit-plan strong { color: #ead9ff; }
@media (min-width: 820px) {
  .orbit-active .orbit-screen { width: min(95vw, 940px); padding-top: 18px; }
  .orbit-workbench { grid-template: minmax(0, 1fr) / minmax(0, 3fr) minmax(290px, 2fr); gap: 14px; }
  .orbit-canvas, .orbit-workbench[data-editor-open] .orbit-canvas { grid-area: 1 / 1; border-radius: 20px; }
  .orbit-composer, .orbit-workbench[data-editor-open] .orbit-composer { grid-area: 1 / 2; max-height: 100%; border-radius: 19px; }
  .orbit-handle { display: none; }
}

.orbit-allowance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 4px 5px 4px 12px;
  border-radius: 14px;
  color: var(--muted);
  font-size: .86rem;
}
.orbit-allowance strong { margin-left: 6px; color: var(--ink); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.orbit-allowance button { width: auto; min-height: 48px; background: #322653; }
.orbit-editor-tools { display: flex; gap: 4px; }
.orbit-editor-tools .orbit-icon { width: 48px; height: 48px; }
.orbit-editor-tools #clearPrompt { color: #d9c5ff; background: #2a2540; border-color: var(--line); }
.orbit-undo { justify-self: start; min-height: 48px; padding: 0 8px; color: var(--sky); }
#accountNovaId { overflow-wrap: anywhere; margin-top: 6px; }
.orbit-plans { border: 0; min-width: 0; padding: 0; }
.orbit-plan { display: grid; grid-template-columns: 18px 1fr auto; cursor: pointer; }
.orbit-plan:has(:checked) { border-color: #ceb6ff; background: #322653; }
.orbit-plan input { width: 17px; height: 17px; margin: 0; accent-color: #c4a8ff; }
#topupDialog a { margin-top: 9px; }
.orbit-dots { display: inline-flex; align-items: center; gap: 4px; }
.orbit-dots i { width: 5px; height: 5px; border-radius: 50%; background: #d5bfff; animation: orbit-pulse 1.2s ease-in-out infinite; }
.orbit-dots i:nth-child(2) { animation-delay: .16s; }
.orbit-dots i:nth-child(3) { animation-delay: .32s; }
#improve.orbit-improving { opacity: 1; color: #e0c7ff; }
.orbit-improving > svg { display: none; }
.orbit-rendering {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 10px;
  overflow: hidden;
  text-align: center;
  background: radial-gradient(ellipse at center, #362e65d9, #131328f2 72%);
}
.orbit-render-scene { position: relative; display: grid; place-items: center; width: 158px; height: 148px; }
.orbit-render-scene svg { width: 125px; height: 91px; }
.orbit-frame, .orbit-hills { stroke: url(#render-gradient); stroke-width: 2; stroke-dasharray: 100; }
.orbit-frame { animation: orbit-draw 9s cubic-bezier(.6,.05,.3,1) infinite; }
.orbit-hills { animation: orbit-hills 9s cubic-bezier(.6,.05,.3,1) infinite; }
.orbit-sun { fill: url(#render-gradient); stroke: none; transform-origin: 160px 44px; animation: orbit-sun 9s ease-in-out infinite; }
.orbit-ring { position: absolute; inset: 0; margin: auto; width: 148px; height: 148px; border: 1px dashed #ceb5ff69; border-radius: 50%; animation: orbit-spin 40s linear infinite; }
.orbit-ring::after { content: ''; position: absolute; left: 15%; top: 13%; width: 6px; height: 6px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 11px var(--sky); }
.orbit-ring-inner { width: 120px; height: 120px; border: 1px solid #a4e7ff38; animation: orbit-spin 26s linear infinite reverse; }
.orbit-ring-inner::after { left: 80%; top: 84%; background: #ffd4f5; box-shadow: 0 0 11px #ffd4f5; }
@keyframes orbit-pulse { 0%,70%,100% { opacity: .35; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
@keyframes orbit-draw { 0% { stroke-dashoffset: 100; } 22%,78% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -100; } }
@keyframes orbit-hills { 0%,14% { stroke-dashoffset: 100; } 38%,78% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -100; } }
@keyframes orbit-sun { 0%,30% { transform: scale(0); } 40% { transform: scale(1.15); } 46%,74% { transform: scale(1); } 84%,100% { transform: scale(0); } }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .orbit-dots i, .orbit-frame, .orbit-hills, .orbit-sun, .orbit-ring { animation: none; }
}
