:root {
  --page: #f5f5f7;
  --ink: #1d1d1f;
  --ink-soft: #ececf0;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --panel-raised: #f7f7f9;
  --line: rgba(29, 29, 31, 0.11);
  --line-strong: rgba(29, 29, 31, 0.19);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --dim: #86868b;
  --cyan: #0071e3;
  --cyan-deep: #0058b0;
  --coral: #b65f42;
  --coral-deep: #83432f;
  --lime: #a47e3b;
  --yellow: #b8872d;
  --danger: #d70015;
  --success: #248a5c;
  --radius: 8px;
  --topbar-height: 68px;
  --history-width: 306px;
  --spring: cubic-bezier(.18, 1.35, .34, 1);
  --smooth: cubic-bezier(.22, 1, .36, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--page);
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: #070b12;
  font-size: 14px;
  line-height: 1.5;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  background-color: #070b12;
  background-image: url("/static/assets/starship-command-cyan-desktop-v2.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

body::after {
  background: rgba(4, 7, 12, .18);
}

body.dialog-open,
body.history-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
label,
select,
input[type="color"] {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  color: inherit;
}

button {
  border: 0;
}

a {
  text-decoration: none;
}

img,
video,
audio {
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  font-weight: 680;
}

#fluid-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(39, 215, 197, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 215, 197, .05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

.eyebrow,
.section-kicker {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.3;
  text-transform: uppercase;
}

.section-kicker {
  display: block;
  margin-bottom: 5px;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 220ms var(--spring), border-color 180ms ease, background 180ms ease, color 180ms ease, opacity 180ms ease;
}

.button {
  gap: 9px;
  padding: 0 16px;
  font-weight: 680;
}

.button svg,
.icon-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.9;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-2px) scale(1.015);
}

.button:active,
.icon-button:active {
  transform: translateY(1px) scale(.97);
}

.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.button[disabled],
.icon-button[disabled] {
  cursor: not-allowed;
  opacity: .42;
  transform: none;
}

.button-primary {
  color: #04100f;
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 10px 30px rgba(39, 215, 197, .16);
}

.button-primary:hover {
  background: #5be7d8;
}

.button-secondary {
  color: var(--text);
  background: rgba(15, 29, 31, .88);
  border-color: var(--line-strong);
}

.button-secondary:hover {
  border-color: var(--cyan);
}

.button-accent {
  color: #180b08;
  background: var(--coral);
  border-color: var(--coral);
}

.button-wide {
  width: 100%;
}

.button-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.icon-button {
  width: 40px;
  padding: 0;
  color: var(--muted);
  background: rgba(12, 24, 26, .76);
  border-color: var(--line);
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--panel-raised);
}

.icon-button.danger:hover {
  color: var(--danger);
  border-color: rgba(255, 89, 100, .45);
}

.field,
.field-block {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.field > span:first-child,
.field-block-head label {
  color: #ccdad8;
  font-size: 12px;
  font-weight: 650;
}

.field b,
.field-block b,
.required-note b {
  color: var(--coral);
}

.field em {
  color: var(--dim);
  font-size: 11px;
  font-style: normal;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: rgba(6, 14, 16, .82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 84px;
  padding: 11px 12px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #546865;
}

input:hover,
textarea:hover,
select:hover,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(39, 215, 197, .48);
  background: rgba(8, 19, 21, .96);
}

select {
  appearance: none;
  cursor: pointer;
}

.input-shell,
.compact-input,
.compact-select,
.select-shell,
.price-input {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.input-shell > svg,
.compact-input > svg,
.select-shell > svg,
.compact-select > svg {
  position: absolute;
  z-index: 2;
  width: 16px;
  height: 16px;
  color: var(--dim);
  pointer-events: none;
}

.input-shell > svg,
.compact-input > svg {
  left: 12px;
}

.input-shell input,
.compact-input input {
  padding-left: 38px;
}

.select-shell > svg,
.compact-select > svg {
  right: 12px;
}

.select-shell select,
.compact-select select {
  padding-right: 36px;
}

.price-input > span {
  position: absolute;
  left: 12px;
  z-index: 2;
  color: var(--coral);
  font-weight: 760;
}

.price-input input {
  padding-left: 32px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-span-2 {
  grid-column: span 2;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: rgba(5, 12, 14, .78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.segmented button,
.segmented label span {
  min-height: 36px;
  border-radius: 4px;
}

.auth-view {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 32px clamp(24px, 5vw, 72px);
  overflow-x: hidden;
  overflow-y: auto;
}

.auth-brand {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 13px;
}

.auth-brand strong,
.workspace-logo strong {
  display: block;
  line-height: 1.1;
}

.auth-brand strong {
  font-size: 19px;
}

.auth-brand small,
.workspace-logo small {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 9px;
  font-weight: 760;
}

.brand-glyph {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 6px);
  align-items: end;
  gap: 3px;
  width: 38px;
  height: 38px;
  padding: 8px;
  border: 1px solid rgba(39, 215, 197, .5);
  border-radius: 5px;
  background: rgba(5, 15, 16, .8);
  transform: skewX(-7deg);
}

.brand-glyph span {
  display: block;
  background: var(--cyan);
  transform-origin: bottom;
  animation: equalize 1.7s var(--spring) infinite alternate;
}

.brand-glyph span:nth-child(1) { height: 45%; }
.brand-glyph span:nth-child(2) { height: 100%; animation-delay: -1.2s; background: var(--coral); }
.brand-glyph span:nth-child(3) { height: 68%; animation-delay: -.7s; background: var(--lime); }

.brand-glyph.compact {
  width: 34px;
  height: 34px;
  grid-template-columns: repeat(3, 5px);
  padding: 7px;
}

.auth-stage {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(380px, 520px);
  align-items: center;
  gap: clamp(48px, 8vw, 140px);
  width: min(1240px, 100%);
  min-height: calc(100vh - 102px);
  margin: 0 auto;
}

.auth-signal {
  position: relative;
  width: min(34vw, 430px);
  aspect-ratio: 1;
  justify-self: center;
  transform: rotate(-7deg);
}

.signal-ring,
.signal-core {
  position: absolute;
  border-radius: 8px;
}

.signal-ring {
  inset: 12%;
  border: 1px solid rgba(39, 215, 197, .33);
  box-shadow: inset 0 0 48px rgba(39, 215, 197, .05);
  animation: signalDrift 9s var(--smooth) infinite alternate;
}

.signal-ring::before,
.signal-ring::after {
  content: "";
  position: absolute;
  background: var(--cyan);
}

.signal-ring::before {
  top: -1px;
  left: 18%;
  width: 28%;
  height: 2px;
}

.signal-ring::after {
  right: -1px;
  bottom: 14%;
  width: 2px;
  height: 32%;
  background: var(--coral);
}

.ring-b {
  inset: 26%;
  border-color: rgba(255, 112, 95, .35);
  animation-delay: -4s;
  animation-direction: alternate-reverse;
}

.signal-core {
  inset: 38%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--lime);
  font-size: 28px;
  font-weight: 850;
  box-shadow: 0 0 55px rgba(185, 244, 90, .18);
}

.auth-panel {
  position: relative;
  width: 100%;
  padding: clamp(26px, 4vw, 42px);
  overflow: hidden;
  background: rgba(7, 15, 17, .84);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .36);
  backdrop-filter: blur(18px);
  animation: authEnter 720ms var(--spring) both;
}

.auth-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 28%;
  height: 3px;
  background: var(--coral);
}

.auth-heading h1 {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.2;
}

.auth-heading p:last-child {
  margin-bottom: 24px;
  color: var(--muted);
}

.auth-tabs {
  margin-bottom: 24px;
}

.auth-tabs button {
  flex: 1;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.auth-tabs button.is-active {
  color: var(--ink);
  background: var(--cyan);
  font-weight: 720;
}

.contact-methods label {
  position: relative;
  flex: 1;
  cursor: pointer;
}

.contact-methods input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.contact-methods span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
}

.contact-methods svg {
  width: 16px;
  height: 16px;
}

.contact-methods input:checked + span {
  color: var(--ink);
  background: var(--cyan);
  font-weight: 720;
}

.auth-form {
  display: grid;
  gap: 16px;
  animation: springIn 430ms var(--spring) both;
}

.auth-form .button-wide {
  margin-top: 4px;
}

.auth-panel.is-registering {
  padding-block: 24px;
}

.auth-panel.is-registering .auth-heading p:last-child,
.auth-panel.is-registering .auth-tabs {
  margin-bottom: 14px;
}

.auth-panel.is-registering .auth-form {
  gap: 10px;
}

.auth-panel.is-registering .form-message {
  margin-top: 8px;
}

.form-message {
  min-height: 21px;
  margin: 14px 0 0;
  color: var(--coral);
  font-size: 12px;
}

.app-view {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  background: rgba(5, 9, 11, .34);
  animation: appReveal 620ms var(--smooth) both;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  height: var(--topbar-height);
  padding: 0 18px;
  background: rgba(5, 10, 12, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-actions,
.workspace-logo {
  display: flex;
  align-items: center;
}

.topbar-left,
.workspace-logo {
  gap: 11px;
}

.topbar-actions {
  justify-content: flex-end;
  gap: 8px;
}

.workspace-logo strong {
  font-size: 14px;
}

.group-switcher {
  position: relative;
  display: flex;
  align-items: center;
  width: 230px;
}

.group-switcher > svg:first-child {
  position: absolute;
  left: 12px;
  z-index: 2;
  width: 16px;
  color: var(--cyan);
  pointer-events: none;
}

.group-switcher > svg:last-child {
  position: absolute;
  right: 12px;
  z-index: 2;
  width: 14px;
  color: var(--dim);
  pointer-events: none;
}

.group-switcher select {
  height: 38px;
  min-height: 38px;
  padding: 0 34px 0 38px;
  text-align: center;
}

.credit-meter {
  display: flex;
  align-items: baseline;
  gap: 5px;
  height: 40px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(12, 24, 26, .7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.credit-meter svg {
  align-self: center;
  width: 15px;
  color: var(--lime);
}

.credit-meter strong {
  color: var(--lime);
  font-size: 17px;
}

.credit-meter span {
  font-size: 11px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--history-width) minmax(0, 1fr);
  min-height: 100vh;
  padding-top: var(--topbar-height);
}

.history-panel {
  position: fixed;
  inset: var(--topbar-height) auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: var(--history-width);
  min-height: 0;
  padding: 20px 16px 14px;
  background: rgba(6, 13, 15, .91);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.history-head,
.section-heading,
.dialog-head,
.project-toolbar,
.output-head,
.render-header,
.action-bar,
.field-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.history-head {
  margin-bottom: 16px;
}

.history-head h2,
.section-heading h2,
.dialog-head h2,
.output-head h2,
.render-header h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.history-filters {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 8px;
  margin: 14px 0 10px;
}

.history-filters input,
.history-filters select {
  min-height: 38px;
  height: 38px;
  font-size: 12px;
}

.project-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.project-list-item {
  position: relative;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 82px;
  margin: 4px 0;
  padding: 12px 10px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 220ms var(--spring), background 160ms ease, border-color 160ms ease;
}

.project-list-item:hover {
  transform: translateX(4px);
  background: rgba(18, 32, 35, .62);
  border-color: var(--line);
}

.project-list-item.is-active {
  background: rgba(20, 39, 41, .9);
  border-color: rgba(39, 215, 197, .33);
}

.project-status-line {
  width: 4px;
  height: 100%;
  min-height: 52px;
  background: var(--dim);
  border-radius: 3px;
}

.project-list-item.is-ready .project-status-line { background: var(--success); }
.project-list-item.is-working .project-status-line { background: var(--cyan); }
.project-list-item.is-failed .project-status-line { background: var(--danger); }

.project-list-copy {
  min-width: 0;
}

.project-list-copy strong {
  display: block;
  overflow: hidden;
  margin-bottom: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--dim);
  font-size: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 8px;
  color: var(--muted);
  background: rgba(128, 151, 148, .1);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 10px;
}

.status-badge.ready,
.status-badge.approved { color: var(--success); border-color: rgba(113, 230, 162, .3); }
.status-badge.working,
.status-badge.pending { color: var(--cyan); border-color: rgba(39, 215, 197, .3); }
.status-badge.failed,
.status-badge.rejected { color: var(--danger); border-color: rgba(255, 89, 100, .3); }

.history-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--dim);
  text-align: center;
}

.history-empty svg {
  width: 30px;
  height: 30px;
  margin-bottom: 8px;
}

.history-foot {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  color: var(--dim);
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.workspace-main {
  grid-column: 2;
  min-width: 0;
  min-height: calc(100vh - var(--topbar-height));
  padding: clamp(22px, 3vw, 42px);
}

.workspace-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: calc(100vh - var(--topbar-height) - 84px);
  text-align: center;
  animation: springIn 640ms var(--spring) both;
}

.empty-orbit {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin-bottom: 24px;
  color: var(--cyan);
  border: 1px solid rgba(39, 215, 197, .38);
  border-radius: 8px;
  transform: rotate(6deg);
  box-shadow: inset 0 0 38px rgba(39, 215, 197, .07);
}

.empty-orbit svg {
  width: 34px;
  height: 34px;
  transform: rotate(-6deg);
}

.workspace-empty h1 {
  max-width: 620px;
  margin-bottom: 12px;
  font-size: 32px;
}

.workspace-empty > p:not(.eyebrow) {
  max-width: 540px;
  margin-bottom: 24px;
  color: var(--muted);
}

.project-workspace {
  width: min(1220px, 100%);
  margin: 0 auto;
  animation: springIn 480ms var(--spring) both;
}

.project-toolbar {
  margin-bottom: 22px;
}

.project-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.project-identity > div {
  min-width: 0;
}

.project-identity h1 {
  overflow: hidden;
  margin-bottom: 4px;
  font-size: 23px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.dot-separator {
  margin: 0 7px;
  color: var(--dim);
}

.status-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(39, 215, 197, .1), 0 0 18px rgba(39, 215, 197, .6);
}

.status-dot.ready { background: var(--success); box-shadow: 0 0 0 5px rgba(113, 230, 162, .1); }
.status-dot.failed { background: var(--danger); box-shadow: 0 0 0 5px rgba(255, 89, 100, .1); }

.workflow-steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(28px, .25fr) minmax(0, 1fr) minmax(28px, .25fr) minmax(0, 1fr);
  align-items: center;
  margin-bottom: 28px;
  padding: 14px;
  background: rgba(7, 15, 17, .72);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(14px);
}

.workflow-step {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 260ms var(--spring), color 180ms ease, background 180ms ease;
}

.workflow-step:not([disabled]):hover {
  transform: translateY(-2px);
  color: var(--text);
  background: rgba(18, 34, 36, .7);
}

.workflow-step[disabled] {
  cursor: default;
  opacity: .5;
}

.workflow-step.is-active {
  color: var(--text);
  background: rgba(23, 45, 47, .72);
}

.step-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--dim);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 760;
}

.workflow-step.is-active .step-index {
  color: var(--ink);
  background: var(--cyan);
  border-color: var(--cyan);
  transform: rotate(-4deg);
}

.workflow-step.is-complete .step-index {
  color: var(--success);
  border-color: rgba(113, 230, 162, .38);
}

.workflow-step strong,
.workflow-step small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-step strong {
  font-size: 13px;
}

.workflow-step small {
  margin-top: 2px;
  color: var(--dim);
  font-size: 10px;
}

.workflow-step > svg {
  width: 16px;
  color: var(--success);
  opacity: 0;
}

.workflow-step.is-complete > svg {
  opacity: 1;
}

.step-line {
  height: 1px;
  background: var(--line-strong);
}

.step-stage {
  position: relative;
  min-height: 560px;
}

.step-panel {
  padding: clamp(20px, 3vw, 34px);
  background: rgba(7, 15, 17, .84);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(18px);
  transform-origin: top center;
}

.step-panel.is-entering-forward {
  animation: panelForward 520ms var(--spring) both;
}

.step-panel.is-entering-back {
  animation: panelBack 520ms var(--spring) both;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading > span,
.required-note {
  color: var(--dim);
  font-size: 11px;
}

.compact-heading {
  margin-bottom: 16px;
}

.compact-heading h2 {
  font-size: 16px;
}

.field-block {
  margin-top: 18px;
}

.field-block-head span {
  color: var(--dim);
  font-size: 11px;
}

.optional-fields {
  margin-top: 20px;
  background: rgba(9, 20, 22, .54);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.optional-fields summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.optional-fields summary::-webkit-details-marker {
  display: none;
}

.optional-fields summary span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.optional-fields summary svg {
  width: 16px;
}

.optional-fields > summary > svg {
  transition: transform 240ms var(--spring);
}

.optional-fields[open] > summary > svg {
  transform: rotate(180deg);
}

.optional-grid {
  padding: 6px 14px 16px;
  animation: springIn 360ms var(--spring) both;
}

.content-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.platform-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.platform-option {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 80px;
  padding: 14px;
  overflow: hidden;
  background: rgba(9, 20, 22, .68);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 250ms var(--spring), border-color 180ms ease, background 180ms ease;
}

.platform-option:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: var(--line-strong);
}

.platform-option:has(input:checked) {
  background: rgba(19, 42, 43, .86);
  border-color: rgba(39, 215, 197, .48);
}

.platform-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.platform-option > svg,
.platform-symbol {
  grid-row: 1;
  grid-column: 1;
  width: 27px;
  color: var(--cyan);
}

.platform-symbol {
  font-size: 10px;
  font-weight: 850;
}

.platform-option > span:last-child {
  grid-column: 2;
}

.platform-option strong,
.platform-option small {
  display: block;
}

.platform-option small {
  margin-top: 3px;
  color: var(--dim);
  font-size: 10px;
}

.platform-option.xhs:has(input:checked) { border-color: rgba(255, 112, 95, .52); }
.platform-option.xhs .platform-symbol { color: var(--coral); }
.platform-option.bili:has(input:checked) { border-color: rgba(185, 244, 90, .42); }
.platform-option.bili > svg { color: var(--lime); }

.platform-check {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  color: var(--ink);
  background: var(--cyan);
  border-radius: 4px;
  opacity: 0;
  transform: scale(.45) rotate(-20deg);
  transition: opacity 180ms ease, transform 280ms var(--spring);
}

.vision-provider-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: rgba(5, 12, 14, .78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.vision-provider-option {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 11px;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 260ms var(--spring);
}

.vision-provider-option:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.vision-provider-option:has(input:checked) {
  color: var(--ink);
  background: rgba(19, 42, 43, .9);
  border-color: rgba(39, 215, 197, .42);
}

.vision-provider-option.deepseek:has(input:checked) {
  border-color: rgba(185, 244, 90, .4);
}

.vision-provider-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.provider-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--cyan);
  background: rgba(39, 215, 197, .08);
  border: 1px solid rgba(39, 215, 197, .16);
  border-radius: 5px;
}

.deepseek .provider-icon {
  color: var(--lime);
  background: rgba(185, 244, 90, .07);
  border-color: rgba(185, 244, 90, .15);
}

.provider-icon svg,
.provider-check svg {
  width: 17px;
  height: 17px;
}

.vision-provider-option strong,
.vision-provider-option small {
  display: block;
}

.vision-provider-option small {
  margin-top: 3px;
  color: var(--dim);
  font-size: 10px;
}

.provider-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--panel);
  background: var(--cyan);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.45) rotate(-18deg);
  transition: opacity 180ms ease, transform 280ms var(--spring);
}

.deepseek .provider-check {
  background: var(--lime);
}

.vision-provider-option:has(input:checked) .provider-check {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.platform-option:has(input:checked) .platform-check {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.platform-check svg {
  width: 13px;
}

.photo-dropzone {
  display: grid;
  place-items: center;
  min-height: 164px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background: rgba(8, 18, 20, .48);
  border: 1px dashed rgba(39, 215, 197, .38);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 260ms var(--spring), border-color 160ms ease, background 160ms ease;
}

.photo-dropzone:hover,
.photo-dropzone.is-dragover {
  transform: translateY(-3px);
  background: rgba(14, 31, 33, .7);
  border-color: var(--cyan);
}

.photo-dropzone strong,
.photo-dropzone small {
  display: block;
}

.photo-dropzone strong {
  margin-top: 12px;
  color: var(--text);
}

.photo-dropzone small {
  margin-top: 4px;
  color: var(--dim);
  font-size: 11px;
}

.upload-pulse {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--cyan);
  background: rgba(39, 215, 197, .08);
  border: 1px solid rgba(39, 215, 197, .3);
  border-radius: 5px;
}

.upload-pulse svg {
  width: 21px;
}

.photo-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.photo-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: grab;
  animation: springIn 340ms var(--spring) both;
}

.photo-tile:active {
  cursor: grabbing;
}

.photo-tile.is-dragging {
  opacity: .42;
  transform: scale(.96);
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-order {
  position: absolute;
  top: 7px;
  left: 7px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--ink);
  background: var(--lime);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.photo-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: white;
  background: rgba(4, 9, 11, .78);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 4px;
  cursor: pointer;
}

.photo-remove svg {
  width: 15px;
}

.action-bar {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.action-bar p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--dim);
  font-size: 11px;
}

.action-bar p svg {
  width: 16px;
  color: var(--success);
}

.process-state {
  display: grid;
  place-items: center;
  min-height: 480px;
  text-align: center;
}

.process-orbit {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 22px;
  color: var(--cyan);
  border: 1px solid rgba(39, 215, 197, .38);
  border-radius: 8px;
  animation: processTilt 2.4s var(--spring) infinite alternate;
}

.process-orbit svg {
  width: 30px;
  height: 30px;
}

.process-state h2 {
  margin-bottom: 8px;
}

.process-state > p:not(.eyebrow) {
  color: var(--muted);
}

.linear-progress,
.render-progress {
  height: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, .07);
  border-radius: 4px;
}

.linear-progress {
  width: min(430px, 80%);
  margin-top: 12px;
}

.linear-progress span,
.render-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(39, 215, 197, .55);
  transition: width 650ms var(--smooth);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.notice svg {
  flex: 0 0 auto;
  width: 17px;
  margin-top: 2px;
}

.notice.warning {
  color: #f8d69a;
  background: rgba(255, 209, 102, .08);
  border-color: rgba(255, 209, 102, .26);
}

.platform-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.platform-tabs::-webkit-scrollbar { display: none; }

.platform-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 128px;
  min-height: 42px;
  padding: 0 14px;
  color: var(--muted);
  white-space: nowrap;
  background: rgba(10, 22, 24, .72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 230ms var(--spring), border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.platform-tab:hover {
  transform: translateY(-2px);
}

.platform-tab.is-active {
  color: var(--ink);
  background: var(--cyan);
  border-color: var(--cyan);
  font-weight: 720;
}

.platform-tab svg {
  width: 16px;
}

.draft-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, .7fr);
  gap: 18px;
  align-items: start;
}

.draft-editor,
.audio-studio {
  min-width: 0;
}

.draft-editor {
  display: grid;
  gap: 16px;
  animation: panelForward 430ms var(--spring) both;
}

.editor-block,
.recording-card,
.bgm-row {
  background: rgba(10, 22, 24, .66);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.editor-block {
  padding: 16px;
}

.editor-block-head,
.repeat-item-head,
.recording-head,
.recording-status,
.bgm-row,
.data-row-head,
.payment-summary,
.billing-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-block-head {
  margin-bottom: 12px;
}

.editor-block-head h3 {
  margin: 0;
  font-size: 13px;
}

.editor-block-head span {
  color: var(--dim);
  font-size: 10px;
}

.title-list {
  display: grid;
  gap: 8px;
}

.title-choice {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.title-choice input[type="radio"] {
  appearance: none;
  display: grid;
  place-items: center;
  width: 22px;
  min-height: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
}

.title-choice input[type="radio"]::after {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--lime);
  border-radius: 50%;
  transform: scale(0);
  transition: transform 220ms var(--spring);
}

.title-choice input[type="radio"]:checked {
  border-color: var(--lime);
}

.title-choice input[type="radio"]:checked::after {
  transform: scale(1);
}

.tag-input {
  min-height: 44px;
}

.repeat-list {
  display: grid;
  gap: 8px;
}

.repeat-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1.7fr) 86px;
  align-items: center;
  gap: 8px;
}

.repeat-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 44px;
  color: var(--cyan);
  background: rgba(39, 215, 197, .08);
  border: 1px solid rgba(39, 215, 197, .2);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 760;
}

.repeat-item input,
.repeat-item select {
  min-height: 40px;
  height: 40px;
  font-size: 12px;
}

.audio-studio {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
}

.recording-card {
  padding: 16px;
}

.recording-head h3 {
  margin: 0;
  font-size: 14px;
}

.recording-head span {
  color: var(--dim);
  font-size: 10px;
}

.script-preview {
  max-height: 188px;
  margin: 14px 0;
  padding: 11px;
  overflow-y: auto;
  color: #b8c9c7;
  white-space: pre-wrap;
  background: rgba(4, 11, 13, .72);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.7;
}

.recording-visual {
  display: grid;
  place-items: center;
  min-height: 92px;
  margin-bottom: 12px;
  background: rgba(4, 12, 14, .66);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.wave-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 40px;
}

.wave-bars span {
  width: 3px;
  height: 8px;
  background: var(--cyan);
  border-radius: 2px;
  opacity: .35;
}

.recording-visual.is-recording .wave-bars span {
  opacity: 1;
  animation: wave 680ms ease-in-out infinite alternate;
}

.wave-bars span:nth-child(2n) { animation-delay: -400ms !important; }
.wave-bars span:nth-child(3n) { animation-delay: -180ms !important; background: var(--coral); }

.recording-timer {
  margin-top: 8px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.recording-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.recording-actions .button,
.recording-actions label {
  min-width: 0;
  padding: 0 10px;
  font-size: 12px;
}

.recording-file {
  display: none;
}

.recording-status {
  margin-top: 12px;
  color: var(--dim);
  font-size: 10px;
}

.recording-status.is-stale {
  color: var(--coral);
}

.recording-status audio {
  width: 100%;
  height: 34px;
}

.bgm-row {
  margin-top: 18px;
  padding: 12px 14px;
}

.bgm-row > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bgm-row > div > svg {
  width: 18px;
  color: var(--lime);
}

.bgm-row strong,
.bgm-row small {
  display: block;
}

.bgm-row small {
  color: var(--dim);
  font-size: 10px;
}

.render-header {
  align-items: flex-end;
}

.render-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.render-percent {
  color: var(--lime);
  font-size: 38px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.render-progress {
  height: 9px;
  margin: 20px 0 18px;
}

.render-stages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 26px;
}

.render-stages > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  color: var(--dim);
  background: rgba(8, 18, 20, .56);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 10px;
  transition: transform 260ms var(--spring), color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.render-stages > div svg {
  width: 15px;
  flex: 0 0 auto;
}

.render-stages > div.is-current {
  color: var(--text);
  background: rgba(39, 215, 197, .09);
  border-color: rgba(39, 215, 197, .4);
  transform: translateY(-3px);
}

.render-stages > div.is-complete {
  color: var(--success);
  border-color: rgba(113, 230, 162, .26);
}

.error-state {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: #ffd6d9;
  background: rgba(255, 89, 100, .08);
  border: 1px solid rgba(255, 89, 100, .28);
  border-radius: var(--radius);
}

.error-state > svg {
  width: 26px;
  color: var(--danger);
}

.error-state p {
  margin: 3px 0 0;
  color: #c9a3a6;
  font-size: 12px;
}

.output-section {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  animation: springIn 520ms var(--spring) both;
}

.output-gallery {
  display: grid;
  gap: 26px;
}

.asset-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
}

.asset-group-head svg {
  width: 17px;
  color: var(--cyan);
}

.asset-group-head h3 {
  margin: 0;
  font-size: 14px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.asset-card {
  min-width: 0;
  overflow: hidden;
  background: rgba(9, 20, 22, .72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: springIn 430ms var(--spring) both;
}

.asset-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #030708;
}

.asset-preview.is-portrait {
  aspect-ratio: 3 / 4;
}

.asset-preview img,
.asset-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-preview .file-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: var(--lime);
  border: 1px solid rgba(185, 244, 90, .34);
  border-radius: 6px;
}

.asset-preview .file-icon svg {
  width: 25px;
}

.asset-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
}

.asset-meta > div {
  min-width: 0;
}

.asset-meta strong,
.asset-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-meta strong {
  font-size: 11px;
}

.asset-meta small {
  margin-top: 2px;
  color: var(--dim);
  font-size: 9px;
}

.app-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: min(850px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: #091315;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .58);
}

.app-dialog::backdrop {
  background: rgba(1, 5, 6, .75);
  backdrop-filter: blur(8px);
}

.app-dialog[open] {
  animation: dialogIn 420ms var(--spring) both;
}

.dialog-shell {
  display: flex;
  flex-direction: column;
  max-height: min(850px, calc(100vh - 32px));
}

.dialog-head {
  flex: 0 0 auto;
  padding: 18px 20px;
  background: rgba(14, 27, 29, .82);
  border-bottom: 1px solid var(--line);
}

.dialog-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 8px 12px;
  overflow-x: auto;
  background: rgba(6, 13, 15, .74);
  border-bottom: 1px solid var(--line);
}

.dialog-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
}

.dialog-tabs button.is-active {
  color: var(--text);
  background: rgba(39, 215, 197, .09);
  border-color: rgba(39, 215, 197, .3);
}

.dialog-tabs svg {
  width: 16px;
}

.dialog-body {
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
}

.dialog-body > section {
  animation: springIn 350ms var(--spring) both;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.brand-editor {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.brand-editor p {
  margin: 3px 0 10px;
  color: var(--dim);
  font-size: 11px;
}

.logo-uploader {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  overflow: hidden;
  background: rgba(5, 13, 15, .82);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

.logo-uploader img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-uploader svg {
  width: 25px;
  color: var(--cyan);
}

.color-input {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
}

.color-input input {
  padding: 5px;
}

.color-input output {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(6, 14, 16, .82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.data-list {
  display: grid;
  gap: 8px;
}

.data-row {
  padding: 13px;
  background: rgba(10, 22, 24, .68);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.data-row-head strong,
.data-row-head small {
  display: block;
}

.data-row-head small {
  margin-top: 2px;
  color: var(--dim);
  font-size: 10px;
}

.data-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.data-row-actions select,
.data-row-actions input {
  width: auto;
  min-height: 34px;
  height: 34px;
  font-size: 11px;
}

.data-row-actions input[type="password"] {
  width: 150px;
}

.inline-form,
.admin-create-form {
  display: grid;
  align-items: end;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
  background: rgba(10, 22, 24, .66);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.inline-form {
  grid-template-columns: 1fr 1fr 1fr auto;
}

.invite-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 13px;
  color: var(--lime);
  background: rgba(185, 244, 90, .08);
  border: 1px solid rgba(185, 244, 90, .26);
  border-radius: var(--radius);
}

.invite-result code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marketplace-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.marketplace-body {
  display: grid;
  gap: 18px;
}

.marketplace-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 10px;
  align-items: center;
}

.marketplace-form-panel {
  padding: 16px;
  background: rgba(9, 20, 22, .72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: springIn 360ms var(--spring) both;
}

.marketplace-form-panel .field {
  align-content: start;
}

.marketplace-photo-field {
  display: grid;
  place-items: center;
  min-height: 86px;
  margin-top: 14px;
  color: var(--muted);
  background: rgba(39, 215, 197, .04);
  border: 1px dashed rgba(39, 215, 197, .28);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.marketplace-photo-field:hover {
  color: var(--ink);
  background: rgba(39, 215, 197, .08);
  border-color: rgba(39, 215, 197, .52);
}

.marketplace-photo-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.marketplace-photo-field span {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 0 14px;
}

.marketplace-photo-field svg {
  flex: 0 0 auto;
  width: 20px;
}

.marketplace-photo-field strong {
  overflow-wrap: anywhere;
}

.marketplace-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.marketplace-list > .notice,
.marketplace-list > .history-empty,
.marketplace-list > .process-state {
  grid-column: 1 / -1;
}

.marketplace-card {
  min-width: 0;
  overflow: hidden;
  background: rgba(7, 16, 18, .9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 260ms var(--spring), border-color 180ms ease;
}

.marketplace-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.marketplace-card.is-sold {
  opacity: .72;
}

.marketplace-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: rgba(255, 255, 255, .03);
}

.marketplace-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.marketplace-status {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  color: var(--panel);
  background: var(--lime);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.marketplace-status.sold {
  color: var(--muted);
  background: rgba(5, 12, 14, .9);
  border: 1px solid var(--line);
}

.marketplace-card-body {
  display: grid;
  gap: 13px;
  padding: 14px;
}

.marketplace-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.marketplace-card-head span,
.marketplace-contact small,
.marketplace-card footer > span {
  color: var(--dim);
  font-size: 10px;
}

.marketplace-card-head h3 {
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.35;
}

.marketplace-card-head > strong {
  color: var(--coral);
  font-size: 17px;
  white-space: nowrap;
}

.marketplace-price-stack {
  display: grid;
  justify-items: end;
  min-width: 94px;
  text-align: right;
}

.marketplace-price-stack small {
  color: var(--dim);
  font-size: 9px;
}

.marketplace-price-stack strong {
  color: var(--coral);
  font-size: 17px;
  white-space: nowrap;
}

.marketplace-price-stack span {
  margin-top: 3px;
  color: #866526;
  font-size: 10px;
  white-space: nowrap;
}

.marketplace-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.marketplace-facts span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 5px 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, .035);
  border-radius: 4px;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.marketplace-facts svg {
  flex: 0 0 auto;
  width: 13px;
}

.marketplace-card-body > p {
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.marketplace-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.marketplace-contact strong,
.marketplace-contact span {
  display: block;
  overflow-wrap: anywhere;
}

.marketplace-contact span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.marketplace-card footer,
.marketplace-card footer > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.marketplace-card footer {
  min-height: 34px;
}

.marketplace-card footer .icon-button {
  width: 34px;
  min-height: 34px;
}

.market-loading {
  min-height: 220px;
}

.billing-dialog {
  width: min(1060px, calc(100vw - 32px));
}

.billing-balance {
  flex: 0 0 auto;
  padding: 12px 20px;
  color: var(--muted);
  background: rgba(185, 244, 90, .06);
  border-bottom: 1px solid rgba(185, 244, 90, .14);
}

.billing-balance strong {
  color: var(--lime);
}

.billing-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, .8fr);
  gap: 18px;
}

.plan-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.plan-card {
  position: relative;
  min-height: 152px;
  padding: 16px;
  text-align: left;
  color: var(--text);
  background: rgba(10, 22, 24, .72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 260ms var(--spring), border-color 180ms ease, background 180ms ease;
}

.plan-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.plan-card.is-selected {
  background: rgba(19, 42, 43, .9);
  border-color: var(--cyan);
}

.plan-card .plan-name {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--coral);
}

.plan-price strong {
  font-size: 28px;
}

.plan-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.plan-credit {
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--lime);
  font-size: 11px;
}

.payment-panel {
  min-width: 0;
  padding: 16px;
  background: rgba(10, 22, 24, .72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.payment-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.payment-summary span {
  color: var(--dim);
  font-size: 10px;
}

.payment-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.payment-summary b {
  color: var(--coral);
}

.payment-methods {
  margin-bottom: 14px;
}

.payment-methods label {
  flex: 1;
  cursor: pointer;
}

.payment-methods input {
  position: absolute;
  opacity: 0;
}

.payment-methods span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
}

.payment-methods input:checked + span {
  color: var(--ink);
  background: var(--cyan);
  font-weight: 700;
}

.payment-methods svg {
  width: 16px;
}

.payment-proof-grid {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.qr-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  background: white;
  border: 5px solid white;
  border-radius: var(--radius);
}

.qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#qr-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: #415250;
  background: #eaf0ee;
  font-size: 9px;
}

#qr-empty svg {
  width: 28px;
}

.proof-fields {
  display: grid;
  gap: 10px;
  align-content: start;
}

.proof-fields > p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.file-field {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: pointer;
}

.file-field input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-field span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 11px;
  color: var(--muted);
  background: rgba(6, 14, 16, .82);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.file-field svg {
  width: 16px;
  color: var(--cyan);
}

.file-field b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.order-history {
  grid-column: 1 / -1;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.admin-create-form {
  margin-bottom: 14px;
}

.admin-create-form > .button {
  justify-self: end;
}

.qr-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.qr-upload {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: rgba(10, 22, 24, .68);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.qr-upload input {
  padding: 8px;
  font-size: 11px;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(13, 27, 29, .96);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 14px 45px rgba(0, 0, 0, .42);
  backdrop-filter: blur(14px);
  animation: toastIn 430ms var(--spring) both;
  pointer-events: auto;
}

.toast.is-leaving {
  animation: toastOut 260ms ease forwards;
}

.toast svg {
  width: 18px;
  color: var(--cyan);
}

.toast.error svg { color: var(--danger); }
.toast.success svg { color: var(--success); }

.toast strong,
.toast small {
  display: block;
}

.toast small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.global-loader {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: rgba(3, 8, 9, .68);
  backdrop-filter: blur(5px);
}

.global-loader span {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(39, 215, 197, .18);
  border-top-color: var(--cyan);
  border-right-color: var(--coral);
  border-radius: 50%;
  animation: spin 820ms linear infinite;
}

.global-loader p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.mobile-only {
  display: none;
}

@keyframes equalize {
  0% { transform: scaleY(.45); }
  58% { transform: scaleY(1); }
  100% { transform: scaleY(.68); }
}

@keyframes authEnter {
  0% { opacity: 0; transform: translate3d(42px, 20px, 0) rotateY(-8deg) scale(.92); }
  66% { opacity: 1; transform: translate3d(-5px, -4px, 0) rotateY(1.2deg) scale(1.015); }
  100% { opacity: 1; transform: none; }
}

@keyframes signalDrift {
  0% { transform: translate3d(-5%, 3%, 0) rotate(-7deg) scale(.92); }
  52% { transform: translate3d(7%, -4%, 0) rotate(5deg) scale(1.04); }
  100% { transform: translate3d(2%, 6%, 0) rotate(10deg) scale(.98); }
}

@keyframes springIn {
  0% { opacity: 0; transform: translate3d(0, 18px, 0) scale(.96); }
  64% { opacity: 1; transform: translate3d(0, -3px, 0) scale(1.012); }
  100% { opacity: 1; transform: none; }
}

@keyframes appReveal {
  from { opacity: 0; transform: translateY(8px) scale(.995); }
  to { opacity: 1; transform: none; }
}

@keyframes panelForward {
  0% { opacity: 0; transform: translate3d(34px, 10px, 0) scale(.975) rotateY(-2deg); }
  62% { opacity: 1; transform: translate3d(-5px, -2px, 0) scale(1.008) rotateY(.3deg); }
  100% { opacity: 1; transform: none; }
}

@keyframes panelBack {
  0% { opacity: 0; transform: translate3d(-34px, 10px, 0) scale(.975) rotateY(2deg); }
  62% { opacity: 1; transform: translate3d(5px, -2px, 0) scale(1.008) rotateY(-.3deg); }
  100% { opacity: 1; transform: none; }
}

@keyframes processTilt {
  0% { transform: rotate(-8deg) scale(.94); box-shadow: 0 0 0 rgba(39, 215, 197, 0); }
  100% { transform: rotate(8deg) scale(1.04); box-shadow: 0 0 38px rgba(39, 215, 197, .16); }
}

@keyframes wave {
  from { height: 7px; transform: translateY(5px); }
  to { height: 38px; transform: translateY(-2px); }
}

@keyframes dialogIn {
  0% { opacity: 0; transform: translateY(28px) scale(.93) rotateX(4deg); }
  68% { opacity: 1; transform: translateY(-4px) scale(1.01) rotateX(-.5deg); }
  100% { opacity: 1; transform: none; }
}

@keyframes toastIn {
  0% { opacity: 0; transform: translate3d(30px, 8px, 0) scale(.92); }
  70% { opacity: 1; transform: translate3d(-4px, -2px, 0) scale(1.015); }
  100% { transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(28px) scale(.95); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1180px) {
  :root { --history-width: 280px; }
  .topbar { grid-template-columns: 1fr auto 1fr; }
  .topbar-actions .button-accent span { display: none; }
  .topbar-actions .button-accent { width: 40px; padding: 0; }
  .draft-layout { grid-template-columns: minmax(0, 1.35fr) minmax(250px, .75fr); }
  .repeat-item { grid-template-columns: 32px minmax(0, 1fr); }
  .repeat-item > :nth-child(3), .repeat-item > :nth-child(4) { grid-column: 2; }
  .billing-body { grid-template-columns: 1fr; }
  .order-history { grid-column: auto; }
}

@media (max-width: 920px) {
  :root { --history-width: 300px; }
  .mobile-only { display: inline-flex; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar-center { display: none; }
  .workspace-logo small { display: none; }
  .credit-meter span { display: none; }
  .history-panel {
    transform: translateX(-104%);
    transition: transform 420ms var(--spring);
    box-shadow: 18px 0 55px rgba(0, 0, 0, .36);
  }
  body.history-open .history-panel { transform: none; }
  .history-scrim {
    position: fixed;
    inset: var(--topbar-height) 0 0 0;
    z-index: 19;
    display: block;
    background: rgba(2, 7, 8, .66);
    backdrop-filter: blur(3px);
  }
  .app-shell { grid-template-columns: 1fr; }
  .workspace-main { grid-column: 1; }
  .draft-layout { grid-template-columns: 1fr; }
  .audio-studio { position: static; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-stage { grid-template-columns: 1fr; }
  .auth-signal { display: none; }
  .auth-panel { width: min(520px, 100%); margin: 0 auto; }
}

@media (max-width: 720px) {
  :root { --topbar-height: 62px; }
  body { font-size: 13px; }
  .topbar { padding: 0 10px; }
  .topbar-actions { gap: 5px; }
  .topbar .icon-button,
  .topbar .button-accent { width: 36px; min-height: 36px; }
  .credit-meter { height: 36px; padding: 0 8px; }
  .credit-meter strong { font-size: 14px; }
  .workspace-logo > div { display: none; }
  .workspace-main { padding: 16px 12px 28px; }
  .project-toolbar { margin-bottom: 14px; }
  .project-identity h1 { font-size: 18px; }
  .workflow-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
    margin-bottom: 14px;
  }
  .step-line { display: none; }
  .workflow-step {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 7px;
    padding: 7px 5px;
  }
  .workflow-step > svg,
  .workflow-step small { display: none; }
  .workflow-step strong { font-size: 11px; }
  .step-index { width: 28px; height: 28px; font-size: 9px; }
  .step-panel { padding: 18px 14px; }
  .two-columns,
  .three-columns,
  .platform-selector,
  .photo-preview,
  .render-stages,
  .plan-list,
  .qr-upload-grid {
    grid-template-columns: 1fr;
  }
  .field-span-2 { grid-column: auto; }
  .platform-option { min-height: 66px; }
  .vision-provider-option { min-height: 60px; padding: 8px 9px; }
  .photo-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-bar { align-items: stretch; flex-direction: column; }
  .action-bar .button { width: 100%; }
  .action-bar p { justify-content: center; text-align: center; }
  .render-stages {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .render-stages > div { flex: 0 0 124px; }
  .render-percent { font-size: 30px; }
  .asset-grid { grid-template-columns: 1fr; }
  .asset-preview,
  .asset-preview.is-portrait { aspect-ratio: 16 / 10; }
  .output-head { align-items: flex-start; flex-direction: column; }
  .output-head .button { width: 100%; }
  .error-state { grid-template-columns: 28px minmax(0, 1fr); }
  .error-state .button { grid-column: 1 / -1; width: 100%; }
  .app-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .dialog-shell { max-height: calc(100vh - 16px); }
  .dialog-head { padding: 14px; }
  .dialog-body { padding: 14px; }
  .dialog-tabs { padding: 6px; }
  .dialog-tabs button { padding: 0 10px; }
  .dialog-tabs button span { font-size: 11px; }
  .marketplace-toolbar { grid-template-columns: 1fr; }
  .marketplace-toolbar .button { width: 100%; }
  .marketplace-list { grid-template-columns: 1fr; }
  .marketplace-contact { grid-template-columns: 1fr; }
  .marketplace-contact .button { width: 100%; }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .inline-form .button { grid-column: 1 / -1; }
  .data-row-head { align-items: flex-start; flex-direction: column; }
  .data-row-actions { width: 100%; }
  .data-row-actions input[type="password"] { flex: 1; min-width: 120px; }
  .payment-proof-grid { grid-template-columns: 108px minmax(0, 1fr); }
  .auth-view { padding: 24px 14px; }
  .auth-stage { min-height: calc(100vh - 86px); }
  .auth-panel { padding: 24px 18px; }
  .auth-heading h1 { font-size: 24px; }
}

@media (max-width: 460px) {
  .vision-provider-selector { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .credit-meter { display: none; }
  .topbar-actions .icon-button { width: 34px; }
  .workspace-main { padding-inline: 8px; }
  .step-panel { padding-inline: 12px; }
  .workflow-step { grid-template-columns: 1fr; text-align: center; }
  .step-index { display: none; }
  .repeat-item { grid-template-columns: 28px minmax(0, 1fr); }
  .recording-actions { grid-template-columns: 1fr; }
  .payment-proof-grid { grid-template-columns: 1fr; }
  .qr-frame { width: 150px; justify-self: center; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form .button { grid-column: auto; }
  .brand-editor { align-items: flex-start; }
  .logo-uploader { width: 72px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

:root {
  --page: #ffffff;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --panel: #ffffff;
  --panel-raised: #f8fbfe;
  --soft: #f2f7fb;
  --text: #12314d;
  --muted: #526b82;
  --dim: #7890a4;
  --line: #dbe7f0;
  --line-strong: #b9ccdb;
  --cyan: #146ef5;
  --blue: #146ef5;
  --accent: #008fa8;
  --lime: #00a5bd;
  --coral: #287be8;
  --danger: #c4364d;
  --radius: 8px;
}

html,
body {
  background: #ffffff !important;
  color: var(--text) !important;
}

body::before,
body::after {
  background: none !important;
}

#fluid-canvas {
  opacity: .055 !important;
  filter: saturate(.68) hue-rotate(12deg) contrast(.9) !important;
}

.ambient-grid {
  opacity: .08 !important;
  background-image:
    linear-gradient(rgba(20, 110, 245, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 110, 245, .08) 1px, transparent 1px) !important;
}

.auth-view,
.app-view {
  background: transparent !important;
}

.auth-brand strong,
.auth-brand small,
.workspace-empty h1,
.workspace-empty > p:not(.eyebrow),
.project-identity h1,
.project-identity p,
.project-identity .dot-separator,
.auth-visual,
.auth-heading h1,
.auth-heading p {
  color: var(--text) !important;
  text-shadow: none !important;
}

.auth-brand small,
.workspace-empty > p:not(.eyebrow),
.project-identity p,
.auth-heading p {
  color: var(--muted) !important;
}

.auth-signal,
.empty-orbit,
.process-orbit {
  opacity: .24;
}

.auth-panel,
.topbar,
.history-panel,
.workflow-steps,
.step-panel,
.app-dialog {
  background: #ffffff !important;
  border-color: var(--line) !important;
  box-shadow: 0 12px 34px rgba(25, 78, 118, .07), 0 0 0 1px rgba(20, 110, 245, .025) !important;
  backdrop-filter: none !important;
}

.auth-panel {
  border-radius: 12px;
}

.button-primary,
.platform-tab.is-active,
.payment-methods input:checked + span,
.contact-methods input:checked + span {
  color: #ffffff !important;
  background: var(--cyan) !important;
  border-color: var(--cyan) !important;
  box-shadow: 0 8px 20px rgba(20, 110, 245, .18) !important;
}

.button-primary:hover,
.platform-tab.is-active:hover {
  background: #0b5dd8 !important;
  border-color: #0b5dd8 !important;
}

.button-accent {
  color: #ffffff !important;
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 8px 20px rgba(0, 143, 168, .18) !important;
}

.button-accent:hover {
  background: #007a90 !important;
  border-color: #007a90 !important;
}

.button-secondary,
.icon-button {
  color: var(--text) !important;
  background: #ffffff !important;
  border-color: var(--line-strong) !important;
  box-shadow: 0 2px 8px rgba(25, 78, 118, .035) !important;
}

.button-secondary:hover,
.icon-button:hover {
  color: var(--cyan) !important;
  background: #f3f8ff !important;
  border-color: rgba(20, 110, 245, .5) !important;
  box-shadow: 0 7px 18px rgba(20, 110, 245, .1) !important;
}

.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(20, 110, 245, .2) !important;
  outline-offset: 2px;
}

.topbar {
  border-bottom-color: var(--line) !important;
  box-shadow: 0 4px 18px rgba(25, 78, 118, .05) !important;
}

.topbar-actions {
  gap: 7px;
}

.topbar-actions .button {
  white-space: nowrap;
}

.group-switcher select,
.credit-meter,
.compact-input,
.compact-select,
input,
textarea,
select,
.color-input output {
  color: var(--text) !important;
  background: #ffffff !important;
  border-color: var(--line) !important;
}

input::placeholder,
textarea::placeholder {
  color: #8ba0b3 !important;
}

input:hover,
textarea:hover,
select:hover,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(20, 110, 245, .54) !important;
  box-shadow: 0 0 0 3px rgba(20, 110, 245, .09) !important;
}

.field > span:first-child,
.field-block-head label,
.section-heading h2,
.workspace-empty h1,
.project-identity h1,
.auth-heading h1,
.dialog-head h2 {
  color: var(--text) !important;
}

.segmented,
.dialog-tabs,
.vision-provider-selector,
.optional-fields,
.platform-option,
.editor-block,
.recording-card,
.bgm-row,
.render-stages > div,
.asset-card,
.data-row,
.inline-form,
.admin-create-form,
.qr-upload,
.marketplace-form-panel,
.plan-card,
.payment-panel,
.script-preview,
.recording-visual {
  color: var(--text) !important;
  background: var(--panel-raised) !important;
  border-color: var(--line) !important;
}

.auth-tabs button.is-active,
.dialog-tabs button.is-active,
.workflow-step.is-active,
.project-list-item.is-active,
.plan-card.is-selected,
.vision-provider-option:has(input:checked),
.platform-option:has(input:checked) {
  color: var(--text) !important;
  background: #ffffff !important;
  border-color: rgba(20, 110, 245, .42) !important;
  box-shadow: 0 6px 18px rgba(20, 110, 245, .08) !important;
}

.platform-option.xhs:has(input:checked),
.platform-option.bili:has(input:checked),
.vision-provider-option.deepseek:has(input:checked) {
  border-color: rgba(20, 110, 245, .42) !important;
}

.workflow-step:not([disabled]):hover,
.project-list-item:hover,
.platform-option:hover,
.plan-card:hover,
.marketplace-card:hover {
  background: #f7fbff !important;
  border-color: rgba(20, 110, 245, .32) !important;
}

.step-index,
.provider-icon,
.upload-pulse,
.repeat-index {
  color: var(--cyan) !important;
  background: #eaf4ff !important;
  border-color: #c7e0f8 !important;
}

.provider-check,
.platform-check,
.photo-order {
  color: #ffffff !important;
  background: var(--cyan) !important;
}

.deepseek .provider-icon,
.deepseek .provider-check {
  color: var(--cyan) !important;
  background: #eaf4ff !important;
  border-color: #c7e0f8 !important;
}

.photo-dropzone,
.marketplace-photo-field {
  color: var(--muted) !important;
  background: #f8fbfe !important;
  border-color: #b9d9ef !important;
}

.photo-dropzone:hover,
.photo-dropzone.is-dragover,
.marketplace-photo-field:hover {
  color: var(--cyan) !important;
  background: #eef7ff !important;
  border-color: var(--cyan) !important;
}

.linear-progress,
.render-progress {
  background: #e7f0f6 !important;
}

.linear-progress span,
.render-progress span {
  background: var(--cyan) !important;
  box-shadow: 0 0 14px rgba(20, 110, 245, .2) !important;
}

.notice.warning {
  color: #79551f !important;
  background: #fff8e9 !important;
  border-color: #f0d79b !important;
}

.error-state {
  color: #8c2639 !important;
  background: #fff2f4 !important;
  border-color: #f0bbc5 !important;
}

.asset-preview {
  background: #10273d !important;
}

.marketplace-card {
  color: var(--text) !important;
  background: #ffffff !important;
  border-color: var(--line) !important;
  box-shadow: 0 8px 22px rgba(25, 78, 118, .06) !important;
}

.marketplace-media,
.photo-tile {
  background: #eef4f8 !important;
}

.marketplace-status {
  color: #ffffff !important;
  background: var(--accent) !important;
}

.marketplace-status.sold {
  color: var(--muted) !important;
  background: #eef3f7 !important;
  border-color: var(--line) !important;
}

.marketplace-facts span,
.status-badge {
  color: var(--muted) !important;
  background: #eef5fa !important;
}

.dialog-head {
  background: #f8fbfe !important;
  border-bottom-color: var(--line) !important;
}

.app-dialog::backdrop {
  background: rgba(15, 43, 69, .28) !important;
  backdrop-filter: blur(5px);
}

.billing-balance {
  color: var(--text) !important;
  background: #eff8fb !important;
  border-bottom-color: #c5e7ed !important;
}

.billing-balance strong,
.plan-credit,
.customer-price,
.marketplace-price-stack strong {
  color: var(--accent) !important;
}

.toast {
  color: var(--text) !important;
  background: #ffffff !important;
  border-color: var(--line) !important;
  box-shadow: 0 16px 38px rgba(25, 78, 118, .13) !important;
}

.global-loader {
  background: rgba(255, 255, 255, .86) !important;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .topbar-center {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .topbar-left {
    flex: 1 0 100%;
    min-width: 0;
  }

  .topbar-actions {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  .topbar-actions .button,
  .topbar-actions .credit-meter {
    min-height: 36px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .topbar-actions .credit-meter {
    flex: 0 0 auto;
  }

  .step-panel {
    box-shadow: 0 10px 28px rgba(25, 78, 118, .06) !important;
  }

  .workflow-steps {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .workflow-step {
    min-width: 148px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #fluid-canvas {
    display: none;
  }
}

.login-method-tabs {
  margin: -8px 0 18px;
}

.login-method-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.login-method-tabs button.is-active {
  color: var(--text);
  background: #ffffff;
  font-weight: 720;
  box-shadow: 0 2px 8px rgba(29, 29, 31, .1);
}

.login-method-tabs svg {
  width: 15px;
  height: 15px;
}

.sms-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.sms-send-button {
  min-width: 132px;
  min-height: 42px;
}

.sms-send-button[disabled] {
  cursor: not-allowed;
  opacity: .55;
}

.notice.is-ready {
  color: #17613d;
  background: rgba(36, 138, 92, .08);
  border-color: rgba(36, 138, 92, .2);
}

.audit-filter-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.audit-filter-form .button {
  min-height: 42px;
}

.audit-row {
  overflow: hidden;
}

.audit-row.is-audit-failure {
  border-left: 3px solid var(--danger);
}

.audit-row.is-audit-success {
  border-left: 3px solid var(--success);
}

.audit-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.audit-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.audit-meta svg {
  width: 13px;
  height: 13px;
}

.audit-mark {
  color: #73571f;
  font-weight: 700;
}

.audit-agent {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  overflow: hidden;
  color: var(--dim);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .sms-code-row,
  .audit-filter-form {
    grid-template-columns: 1fr;
  }

  .sms-send-button,
  .audit-filter-form .button {
    width: 100%;
  }

  .audit-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

/* Light luxury technology theme */
::selection {
  color: #ffffff;
  background: rgba(0, 113, 227, .82);
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#fluid-canvas {
  opacity: .44;
  filter: saturate(.78) contrast(.96);
}

.ambient-grid {
  opacity: .3;
  background-image:
    linear-gradient(rgba(29, 29, 31, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 29, 31, .025) 1px, transparent 1px);
  background-size: 88px 88px;
}

.eyebrow,
.section-kicker {
  color: var(--cyan);
}

.button,
.icon-button {
  transition: transform 260ms var(--spring), border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.button-primary {
  color: #ffffff;
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 8px 24px rgba(0, 113, 227, .18);
}

.button-primary:hover {
  background: #0077ed;
  box-shadow: 0 12px 30px rgba(0, 113, 227, .24);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, .82);
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(29, 29, 31, .03);
}

.button-secondary:hover {
  color: var(--cyan);
  background: #ffffff;
  border-color: rgba(0, 113, 227, .34);
}

.button-accent {
  color: #ffffff;
  background: #1d1d1f;
  border-color: #1d1d1f;
  box-shadow: 0 8px 22px rgba(29, 29, 31, .14);
}

.button-accent:hover {
  background: #3a3a3c;
}

.icon-button {
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  border-color: var(--line);
}

.icon-button:hover {
  color: var(--text);
  background: #ffffff;
  border-color: var(--line-strong);
  box-shadow: 0 7px 20px rgba(29, 29, 31, .08);
}

.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline-color: rgba(0, 113, 227, .78);
}

.field > span:first-child,
.field-block-head label {
  color: #424245;
}

input,
textarea,
select,
.color-input output {
  color: var(--text);
  background: rgba(255, 255, 255, .9);
  border-color: rgba(29, 29, 31, .14);
  box-shadow: inset 0 1px 1px rgba(29, 29, 31, .02);
}

input::placeholder,
textarea::placeholder {
  color: #a1a1a6;
}

input:hover,
textarea:hover,
select:hover,
input:focus,
textarea:focus,
select:focus {
  background: #ffffff;
  border-color: rgba(0, 113, 227, .52);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .08);
}

.segmented,
.vision-provider-selector {
  background: rgba(232, 232, 237, .78);
  border-color: rgba(29, 29, 31, .08);
}

.brand-glyph {
  background: rgba(255, 255, 255, .78);
  border-color: rgba(0, 113, 227, .26);
  box-shadow: 0 8px 24px rgba(29, 29, 31, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
}

.brand-glyph span:nth-child(2) {
  background: var(--lime);
}

.brand-glyph span:nth-child(3) {
  background: var(--coral);
}

.signal-ring {
  border-color: rgba(0, 113, 227, .22);
  box-shadow: inset 0 0 46px rgba(0, 113, 227, .035), 0 20px 70px rgba(29, 29, 31, .04);
}

.signal-ring::before {
  background: var(--cyan);
}

.signal-ring::after,
.auth-panel::before {
  background: var(--lime);
}

.ring-b {
  border-color: rgba(164, 126, 59, .28);
}

.signal-core {
  color: #ffffff;
  background: #1d1d1f;
  box-shadow: 0 20px 54px rgba(29, 29, 31, .18), 0 0 0 1px rgba(255, 255, 255, .78);
}

.auth-panel {
  background: rgba(255, 255, 255, .78);
  border-color: rgba(255, 255, 255, .94);
  box-shadow: 0 34px 90px rgba(29, 29, 31, .13), 0 0 0 1px rgba(29, 29, 31, .06);
  backdrop-filter: blur(28px) saturate(1.2);
}

.auth-heading p:last-child {
  color: var(--muted);
}

.auth-tabs button.is-active {
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(29, 29, 31, .1);
}

.form-message {
  color: var(--danger);
}

.app-view {
  background: rgba(245, 245, 247, .08);
}

.topbar {
  background: rgba(250, 250, 252, .78);
  border-bottom-color: rgba(29, 29, 31, .1);
  box-shadow: 0 1px 18px rgba(29, 29, 31, .035);
  backdrop-filter: blur(28px) saturate(1.25);
}

.group-switcher select {
  background: rgba(255, 255, 255, .7);
}

.credit-meter {
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  border-color: var(--line);
}

.credit-meter svg,
.credit-meter strong {
  color: var(--lime);
}

.history-panel {
  background: rgba(250, 250, 252, .84);
  border-right-color: rgba(29, 29, 31, .09);
  box-shadow: 8px 0 28px rgba(29, 29, 31, .025);
  backdrop-filter: blur(26px) saturate(1.2);
}

.project-list-item:hover {
  background: rgba(255, 255, 255, .86);
  border-color: var(--line);
  box-shadow: 0 7px 18px rgba(29, 29, 31, .045);
}

.project-list-item.is-active {
  background: #ffffff;
  border-color: rgba(0, 113, 227, .22);
  box-shadow: 0 8px 24px rgba(29, 29, 31, .07);
}

.status-badge {
  background: rgba(29, 29, 31, .035);
}

.empty-orbit,
.process-orbit {
  color: var(--cyan);
  background: rgba(255, 255, 255, .44);
  border-color: rgba(0, 113, 227, .24);
  box-shadow: inset 0 0 38px rgba(0, 113, 227, .035), 0 18px 46px rgba(29, 29, 31, .06);
}

.workspace-empty h1,
.project-identity h1,
.auth-heading h1 {
  font-weight: 650;
}

.auth-brand strong,
.auth-brand small,
.auth-visual,
.workspace-empty,
.project-toolbar {
  text-shadow: 0 2px 20px rgba(0, 0, 0, .42);
}

.auth-brand strong,
.workspace-empty h1,
.project-identity h1 {
  color: #ffffff;
}

.auth-brand small,
.workspace-empty > p:not(.eyebrow),
.project-identity p,
.project-identity .dot-separator {
  color: rgba(244, 247, 252, .76);
}

.workflow-steps {
  background: rgba(255, 255, 255, .68);
  border-color: rgba(29, 29, 31, .09);
  box-shadow: 0 10px 32px rgba(29, 29, 31, .045);
  backdrop-filter: blur(22px) saturate(1.15);
}

.workflow-step:not([disabled]):hover {
  color: var(--text);
  background: rgba(245, 245, 247, .9);
}

.workflow-step.is-active {
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(29, 29, 31, .07);
}

.workflow-step.is-active .step-index {
  color: #ffffff;
  background: var(--cyan);
  border-color: var(--cyan);
}

.step-panel {
  background: rgba(255, 255, 255, .84);
  border-color: rgba(255, 255, 255, .96);
  box-shadow: 0 22px 64px rgba(29, 29, 31, .08), 0 0 0 1px rgba(29, 29, 31, .055);
  backdrop-filter: blur(30px) saturate(1.18);
}

.optional-fields,
.platform-option,
.editor-block,
.recording-card,
.bgm-row,
.render-stages > div,
.asset-card,
.data-row,
.inline-form,
.admin-create-form,
.qr-upload,
.marketplace-form-panel,
.plan-card,
.payment-panel {
  background: rgba(250, 250, 252, .9);
  border-color: rgba(29, 29, 31, .1);
}

.platform-option:hover,
.plan-card:hover,
.marketplace-card:hover {
  border-color: rgba(29, 29, 31, .2);
  box-shadow: 0 12px 28px rgba(29, 29, 31, .075);
}

.platform-option:has(input:checked) {
  background: #ffffff;
  border-color: rgba(0, 113, 227, .34);
  box-shadow: 0 9px 24px rgba(29, 29, 31, .07);
}

.platform-option.xhs:has(input:checked) {
  border-color: rgba(182, 95, 66, .42);
}

.platform-option.bili:has(input:checked) {
  border-color: rgba(164, 126, 59, .42);
}

.vision-provider-option:hover,
.vision-provider-option:has(input:checked) {
  color: var(--text);
}

.vision-provider-option:has(input:checked) {
  background: #ffffff;
  border-color: rgba(0, 113, 227, .26);
  box-shadow: 0 4px 14px rgba(29, 29, 31, .07);
}

.vision-provider-option.deepseek:has(input:checked) {
  border-color: rgba(164, 126, 59, .34);
}

.provider-icon,
.upload-pulse,
.repeat-index {
  color: var(--cyan);
  background: rgba(0, 113, 227, .065);
  border-color: rgba(0, 113, 227, .16);
}

.deepseek .provider-icon {
  color: #8a682e;
  background: rgba(164, 126, 59, .08);
  border-color: rgba(164, 126, 59, .18);
}

.provider-check,
.platform-check {
  color: #ffffff;
  background: var(--cyan);
}

.deepseek .provider-check {
  color: #ffffff;
  background: var(--lime);
}

.photo-dropzone {
  color: var(--muted);
  background: rgba(247, 250, 253, .9);
  border-color: rgba(0, 113, 227, .28);
}

.photo-dropzone:hover,
.photo-dropzone.is-dragover {
  background: rgba(237, 246, 255, .92);
  border-color: var(--cyan);
  box-shadow: 0 10px 30px rgba(0, 113, 227, .08);
}

.photo-tile {
  background: #ececf0;
  box-shadow: 0 5px 18px rgba(29, 29, 31, .06);
}

.photo-order {
  color: #ffffff;
  background: var(--lime);
}

.linear-progress,
.render-progress {
  background: rgba(29, 29, 31, .075);
}

.linear-progress span,
.render-progress span {
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 113, 227, .22);
}

.notice.warning {
  color: #73571f;
  background: rgba(201, 157, 70, .1);
  border-color: rgba(164, 126, 59, .24);
}

.platform-tab {
  background: rgba(255, 255, 255, .74);
  border-color: var(--line);
}

.platform-tab.is-active {
  color: #ffffff;
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 7px 20px rgba(0, 113, 227, .18);
}

.script-preview,
.recording-visual {
  color: #515154;
  background: #f5f5f7;
  border-color: rgba(29, 29, 31, .09);
}

.wave-bars span:nth-child(3n) {
  background: var(--lime);
}

.render-stages > div.is-current {
  color: var(--text);
  background: rgba(0, 113, 227, .07);
  border-color: rgba(0, 113, 227, .3);
}

.error-state {
  color: #7d111d;
  background: rgba(215, 0, 21, .055);
  border-color: rgba(215, 0, 21, .2);
}

.error-state p {
  color: #8b555b;
}

.asset-preview {
  background: #111113;
}

.app-dialog {
  color: var(--text);
  background: rgba(255, 255, 255, .96);
  border-color: rgba(255, 255, 255, .98);
  box-shadow: 0 34px 110px rgba(29, 29, 31, .2), 0 0 0 1px rgba(29, 29, 31, .1);
  backdrop-filter: blur(30px) saturate(1.15);
}

.app-dialog::backdrop {
  background: rgba(29, 29, 31, .26);
  backdrop-filter: blur(14px) saturate(.9);
}

.dialog-head {
  background: rgba(250, 250, 252, .92);
  border-bottom-color: rgba(29, 29, 31, .09);
}

.dialog-tabs {
  background: #f5f5f7;
  border-bottom-color: rgba(29, 29, 31, .08);
}

.dialog-tabs button.is-active {
  color: var(--text);
  background: #ffffff;
  border-color: rgba(29, 29, 31, .09);
  box-shadow: 0 3px 12px rgba(29, 29, 31, .065);
}

.logo-uploader {
  background: #f5f5f7;
  border-color: rgba(29, 29, 31, .18);
}

.invite-result {
  color: #73571f;
  background: rgba(164, 126, 59, .08);
  border-color: rgba(164, 126, 59, .22);
}

.marketplace-photo-field {
  color: var(--muted);
  background: rgba(0, 113, 227, .035);
  border-color: rgba(0, 113, 227, .22);
}

.marketplace-photo-field:hover {
  color: var(--cyan);
  background: rgba(0, 113, 227, .07);
  border-color: rgba(0, 113, 227, .42);
}

.marketplace-card {
  background: #ffffff;
  border-color: rgba(29, 29, 31, .1);
  box-shadow: 0 7px 22px rgba(29, 29, 31, .055);
}

.marketplace-media {
  background: #ececf0;
}

.marketplace-status {
  color: #ffffff;
  background: var(--lime);
  box-shadow: 0 4px 12px rgba(29, 29, 31, .14);
}

.marketplace-status.sold {
  color: var(--muted);
  background: rgba(245, 245, 247, .94);
  border-color: rgba(29, 29, 31, .12);
}

.marketplace-facts span {
  background: #f5f5f7;
}

.marketplace-contact .button span {
  margin-top: 0;
  color: inherit;
  font-size: inherit;
}

.billing-balance {
  background: rgba(164, 126, 59, .075);
  border-bottom-color: rgba(164, 126, 59, .17);
}

.billing-balance strong,
.plan-credit {
  color: #866526;
}

.plan-card.is-selected {
  background: rgba(0, 113, 227, .055);
  border-color: rgba(0, 113, 227, .52);
  box-shadow: 0 11px 28px rgba(0, 113, 227, .08);
}

.payment-methods input:checked + span {
  color: #ffffff;
  background: var(--cyan);
}

.contact-methods input:checked + span {
  color: #ffffff;
  background: var(--cyan);
}

.file-field span {
  color: var(--muted);
  background: rgba(255, 255, 255, .9);
  border-color: rgba(29, 29, 31, .18);
}

.toast {
  color: var(--text);
  background: rgba(255, 255, 255, .94);
  border-color: rgba(29, 29, 31, .12);
  box-shadow: 0 18px 50px rgba(29, 29, 31, .14);
  backdrop-filter: blur(20px) saturate(1.15);
}

.global-loader {
  background: rgba(245, 245, 247, .72);
  backdrop-filter: blur(10px) saturate(.9);
}

.global-loader span {
  border-color: rgba(0, 113, 227, .16);
  border-top-color: var(--cyan);
  border-right-color: var(--lime);
}

@media (max-width: 920px) {
  .history-panel {
    box-shadow: 18px 0 55px rgba(29, 29, 31, .14);
  }

  .history-scrim {
    background: rgba(29, 29, 31, .18);
    backdrop-filter: blur(8px);
  }
}

@media (max-width: 720px) {
  body::before {
    background-image: url("/static/assets/starship-command-cyan-mobile-v2.webp");
    background-position: center top;
  }

  body::after {
    background: rgba(4, 7, 12, .26);
  }

  .topbar {
    background: rgba(250, 250, 252, .88);
  }

  .step-panel {
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 14px 42px rgba(29, 29, 31, .075), 0 0 0 1px rgba(29, 29, 31, .05);
  }
}
