:root {
  --paper: #f4efdf;
  --paper-soft: #fffaf0;
  --ink: #18201d;
  --ink-soft: #4e5a55;
  --coral: #ff684d;
  --coral-dark: #d9432e;
  --acid: #f3e45a;
  --mint: #9ed6c5;
  --blue: #9acde2;
  --line: rgba(24, 32, 29, 0.22);
  --shadow: 6px 6px 0 var(--ink);
  --serif: "STKaiti", "KaiTi", "FangSong", serif;
  --sans: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 108px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: var(--sans);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(24, 32, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 32, 29, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.075'/%3E%3C/svg%3E");
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.is-hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  z-index: -1;
}

.ambient-one {
  width: 420px;
  height: 420px;
  right: -180px;
  top: 150px;
  background: rgba(255, 104, 77, 0.15);
}

.ambient-two {
  width: 360px;
  height: 360px;
  left: -190px;
  top: 720px;
  background: rgba(82, 190, 165, 0.18);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  width: min(1480px, calc(100% - 48px));
  min-height: 82px;
  margin: 18px auto 0;
  padding: 12px 14px 12px 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 8px 30px rgba(24, 32, 29, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  color: inherit;
  text-decoration: none;
}

.brand-seal {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px 13px 13px 3px;
  color: var(--paper-soft);
  background: var(--coral);
  border: 1.5px solid var(--ink);
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 800;
  transform: rotate(-3deg);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.08em;
}

.brand-copy small {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.main-nav {
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(24, 32, 29, 0.04);
}

.nav-link {
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--paper-soft);
  background: var(--ink);
}

.account-zone {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
}

.button {
  min-height: 42px;
  padding: 10px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.button-ink {
  color: var(--paper-soft);
  background: var(--ink);
}

.button-coral {
  background: var(--coral);
}

.balance-chip {
  height: 42px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--acid);
  font-size: 12px;
  cursor: default;
}

.balance-chip strong {
  font-size: 15px;
}

.balance-dot {
  width: 7px;
  height: 7px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--coral);
}

.user-menu {
  position: relative;
}

.user-trigger {
  height: 44px;
  padding: 4px 10px 4px 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  font-weight: 700;
  cursor: pointer;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--paper-soft);
  background: var(--ink);
  border-radius: 9px;
  font-family: var(--serif);
}

.user-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 220px;
  padding: 14px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--paper-soft);
  box-shadow: 4px 4px 0 var(--ink);
}

.user-popover p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-popover button {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

main {
  width: min(1420px, calc(100% - 64px));
  margin: 0 auto;
}

.studio-section {
  padding-top: 70px;
}

.hero-copy {
  min-height: 260px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.5fr);
  align-items: end;
  gap: 64px;
  padding: 0 4px 46px;
}

.eyebrow {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.eyebrow span {
  width: 25px;
  height: 2px;
  background: var(--coral);
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(54px, 7.3vw, 108px);
  line-height: 0.92;
  letter-spacing: -0.055em;
  font-weight: 900;
}

.hero-copy h1 em {
  color: var(--coral);
  font-style: normal;
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: 3px 3px 0 var(--ink);
}

.hero-sidecopy {
  padding-bottom: 8px;
}

.hero-sidecopy > p {
  margin: 0 0 25px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.75;
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #27a070;
  box-shadow: 0 0 0 5px rgba(39, 160, 112, 0.13);
  animation: pulse 2s ease-in-out infinite;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(400px, 0.88fr);
  align-items: start;
  gap: 22px;
}

.composer,
.result-panel {
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--shadow);
}

.composer {
  padding: 26px;
}

.result-panel {
  position: sticky;
  top: 118px;
  padding: 22px;
  background: var(--ink);
  color: var(--paper-soft);
  box-shadow: 6px 6px 0 var(--coral);
}

.panel-heading,
.block-title,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading > div,
.block-title > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-index {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 25px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--acid);
  font-size: 10px;
  font-weight: 900;
}

.panel-heading h2,
.block-title h2,
.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 0.02em;
}

.draft-state {
  color: var(--ink-soft);
  font-size: 10px;
}

.prompt-shell {
  margin-top: 18px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  background: #fffdf7;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.prompt-shell:focus-within {
  box-shadow: 4px 4px 0 var(--mint);
  transform: translate(-1px, -1px);
}

.prompt-shell textarea {
  width: 100%;
  min-height: 180px;
  padding: 20px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.75;
}

.prompt-shell textarea::placeholder,
.negative-box textarea::placeholder {
  color: #9a9b91;
}

.prompt-tools {
  min-height: 50px;
  padding: 8px 9px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
}

.enhance-button {
  min-height: 34px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--mint);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.enhance-button:hover .spark {
  transform: rotate(90deg) scale(1.2);
}

.enhance-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.enhance-button small {
  padding-left: 6px;
  border-left: 1px solid rgba(24, 32, 29, 0.3);
  font-size: 9px;
}

.spark {
  font-size: 16px;
  transition: transform 220ms ease;
}

.negative-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(24, 32, 29, 0.025);
}

.negative-box summary {
  padding: 12px 14px;
  list-style: none;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.negative-box summary::-webkit-details-marker {
  display: none;
}

.negative-box summary::after {
  content: "+";
  float: right;
  font-size: 16px;
}

.negative-box[open] summary::after {
  content: "−";
}

.negative-box summary span {
  margin-left: 5px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 500;
}

.negative-box textarea {
  width: calc(100% - 24px);
  min-height: 70px;
  margin: 0 12px 12px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  outline: 0;
  font-size: 12px;
}

.setting-block {
  margin-top: 26px;
}

.setting-block.compact {
  margin-top: 22px;
}

.block-title.small h3 {
  margin: 0;
  font-size: 12px;
}

.text-button {
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.model-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.model-card {
  position: relative;
  min-height: 110px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  text-align: left;
  border: 1.2px solid var(--line);
  border-radius: 13px;
  background: #f9f6ec;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.model-card::after {
  content: attr(data-short);
  position: absolute;
  right: -5px;
  bottom: -18px;
  color: rgba(24, 32, 29, 0.06);
  font-family: var(--serif);
  font-size: 58px;
  font-weight: 900;
  line-height: 1;
}

.model-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
}

.model-card.is-active {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.model-card.accent-sun.is-active { background: var(--acid); }
.model-card.accent-mint.is-active { background: var(--mint); }
.model-card.accent-blue.is-active { background: var(--blue); }
.model-card.accent-coral.is-active { background: #ff9c82; }

.model-card strong {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 17px;
}

.model-card small {
  position: relative;
  z-index: 1;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.4;
}

.model-card .model-cost {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: 9px;
  font-weight: 800;
}

.setting-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.option-row,
.ratio-row {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.option-button,
.ratio-button {
  min-height: 37px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.option-button:hover,
.ratio-button:hover,
.option-button.is-active,
.ratio-button.is-active {
  color: var(--paper-soft);
  border-color: var(--ink);
  background: var(--ink);
}

.ratio-button {
  position: relative;
  min-width: 48px;
  padding-left: 28px;
}

.ratio-button::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 1px solid currentColor;
  transform: translateY(-50%);
}

.ratio-button[data-ratio="4:3"]::before { width: 12px; height: 9px; }
.ratio-button[data-ratio="3:4"]::before { width: 9px; height: 12px; }
.ratio-button[data-ratio="16:9"]::before { width: 14px; height: 8px; }
.ratio-button[data-ratio="9:16"]::before { width: 8px; height: 14px; }

.setting-final {
  grid-template-columns: 1.5fr 0.5fr;
}

.quantity-control {
  width: 128px;
  height: 39px;
  margin-top: 9px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}

.quantity-control button {
  align-self: stretch;
  border: 0;
  background: rgba(24, 32, 29, 0.05);
  font-size: 16px;
  cursor: pointer;
}

.quantity-control strong {
  text-align: center;
  font-size: 13px;
}

.create-bar {
  margin-top: 28px;
  padding: 12px 12px 12px 16px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  border: 1.5px solid var(--ink);
  border-radius: 15px;
  background: var(--acid);
}

.cost-readout {
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  column-gap: 12px;
}

.cost-readout > span {
  align-self: center;
  font-size: 9px;
  font-weight: 800;
}

.cost-readout > strong {
  font-family: var(--serif);
  font-size: 29px;
  line-height: 1;
}

.cost-readout > strong small {
  font-family: var(--sans);
  font-size: 9px;
}

.cost-readout > small {
  grid-column: 2;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 8px;
}

.create-button {
  min-width: 190px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  color: var(--paper-soft);
  background: var(--coral);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.create-button:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.create-button:disabled {
  cursor: wait;
  filter: grayscale(0.4);
  opacity: 0.7;
}

.create-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.result-heading .step-index {
  color: var(--ink);
  border-color: var(--paper-soft);
  background: var(--coral);
}

.status-badge {
  padding: 7px 9px;
  border: 1px solid rgba(255, 250, 240, 0.28);
  border-radius: 999px;
  color: rgba(255, 250, 240, 0.7);
  font-size: 9px;
}

.status-badge.is-running {
  color: var(--ink);
  border-color: var(--acid);
  background: var(--acid);
}

.status-badge.is-success {
  color: var(--ink);
  border-color: var(--mint);
  background: var(--mint);
}

.status-badge.is-failed {
  color: var(--paper-soft);
  border-color: var(--coral);
  background: var(--coral-dark);
}

.result-stage {
  position: relative;
  min-height: 570px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 250, 240, 0.26);
  border-radius: 16px;
  background: #27322e;
}

.empty-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 24%, rgba(255, 230, 90, 0.9) 0 11%, transparent 11.5%),
    linear-gradient(135deg, #72c5b0 0 40%, #ff7557 40% 68%, #f1df77 68% 100%);
}

.empty-art::before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(24, 32, 29, 0.7);
  border-radius: 50%;
}

.empty-number {
  position: absolute;
  right: -14px;
  top: -35px;
  color: rgba(24, 32, 29, 0.16);
  font-family: var(--serif);
  font-size: 190px;
  font-weight: 900;
  line-height: 1;
}

.orbit {
  position: absolute;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.orbit-one {
  width: 230px;
  height: 230px;
  left: -80px;
  bottom: 28px;
}

.orbit-two {
  width: 110px;
  height: 110px;
  right: 40px;
  top: 190px;
  background: rgba(255, 250, 240, 0.18);
}

.empty-copy {
  position: absolute;
  left: 10%;
  bottom: 10%;
  padding: 20px;
  border: 1.5px solid var(--ink);
  background: rgba(255, 250, 240, 0.9);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(-2deg);
}

.empty-copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.2;
}

.empty-copy small {
  display: block;
  margin-top: 13px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.result-images {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  gap: 2px;
  background: var(--ink);
}

.result-images:has(.result-image:only-child) {
  grid-template-columns: 1fr;
}

.result-image {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #2a3531;
}

.result-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.result-image a {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  color: white;
  background: rgba(24, 32, 29, 0.72);
  font-size: 9px;
  text-decoration: none;
  backdrop-filter: blur(8px);
}

.task-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(24, 32, 29, 0.88);
  backdrop-filter: blur(9px);
}

.loader-mark {
  height: 76px;
  display: flex;
  align-items: end;
  gap: 7px;
}

.loader-mark span {
  width: 12px;
  border-radius: 999px 999px 2px 2px;
  background: var(--coral);
  animation: loader 1s ease-in-out infinite alternate;
}

.loader-mark span:nth-child(1) { height: 34px; }
.loader-mark span:nth-child(2) { height: 62px; animation-delay: 180ms; background: var(--acid); }
.loader-mark span:nth-child(3) { height: 46px; animation-delay: 360ms; background: var(--mint); }

.task-overlay > strong {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: 21px;
}

.progress-track {
  width: min(280px, 72%);
  height: 7px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 250, 240, 0.5);
  border-radius: 999px;
}

.progress-track i {
  width: 0;
  height: 100%;
  display: block;
  background: var(--coral);
  transition: width 600ms ease;
}

.task-overlay > small {
  margin-top: 8px;
  color: rgba(255, 250, 240, 0.62);
  font-size: 10px;
}

.result-meta {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
}

.result-meta > div {
  padding: 9px 10px;
  border: 1px solid rgba(255, 250, 240, 0.16);
  border-radius: 9px;
  background: rgba(255, 250, 240, 0.04);
}

.result-meta span,
.result-meta strong {
  display: block;
}

.result-meta span {
  margin-bottom: 4px;
  color: rgba(255, 250, 240, 0.5);
  font-size: 8px;
}

.result-meta strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-section {
  padding: 140px 0 100px;
}

.section-heading {
  align-items: end;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1.5px solid var(--ink);
}

.section-heading h2 {
  font-size: clamp(40px, 5vw, 70px);
  line-height: 1;
}

.section-heading > p {
  max-width: 330px;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.gallery-empty {
  grid-column: 1 / -1;
  min-height: 260px;
  padding: 30px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1.5px dashed var(--ink);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.5);
  text-align: center;
}

.gallery-empty span {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 800;
}

.gallery-empty p {
  color: var(--ink-soft);
  font-size: 12px;
}

.gallery-empty button {
  padding: 9px 15px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--acid);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.gallery-card {
  min-width: 0;
  overflow: hidden;
  border: 1.2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper-soft);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.gallery-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 4px 4px 0 var(--ink);
}

.gallery-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--mint), var(--coral));
}

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

.gallery-media .gallery-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(24, 32, 29, 0.8);
  color: var(--paper-soft);
  font-family: var(--serif);
}

.gallery-info {
  padding: 13px;
}

.gallery-info p {
  height: 38px;
  margin: 0 0 12px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.45;
}

.gallery-info div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 8px;
}

.principles {
  margin-bottom: 100px;
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  background: var(--paper-soft);
  box-shadow: 5px 5px 0 var(--ink);
}

.principles > p,
.principles > div {
  min-height: 110px;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--ink);
}

.principles > p {
  color: var(--paper-soft);
  background: var(--coral);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 900;
}

.principles > div:last-child {
  border-right: 0;
}

.principles strong {
  font-family: var(--serif);
  font-size: 20px;
}

.principles span {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 10px;
}

footer {
  min-height: 180px;
  padding: 35px max(32px, calc((100% - 1420px) / 2));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
  color: var(--paper-soft);
  background: var(--ink);
}

.footer-brand {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 900;
}

.footer-brand span {
  margin-left: 8px;
  color: rgba(255, 250, 240, 0.45);
  font-family: var(--sans);
  font-size: 9px;
}

footer p {
  color: rgba(255, 250, 240, 0.65);
  font-family: var(--serif);
  font-size: 14px;
}

footer button {
  justify-self: end;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--paper-soft);
  color: var(--paper-soft);
  background: transparent;
  cursor: pointer;
}

.modal {
  width: min(920px, calc(100% - 32px));
  max-height: min(820px, calc(100vh - 32px));
  padding: 0;
  overflow: auto;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  background: var(--paper-soft);
  box-shadow: 9px 9px 0 var(--ink);
}

.modal::backdrop {
  background: rgba(24, 32, 29, 0.66);
  backdrop-filter: blur(7px);
}

.modal-close {
  position: absolute;
  right: 15px;
  top: 15px;
  z-index: 2;
  width: 37px;
  height: 37px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.auth-modal {
  grid-template-columns: 0.78fr 1.22fr;
  overflow: hidden;
}

.auth-modal[open] {
  display: grid;
}

.auth-visual {
  position: relative;
  min-height: 580px;
  padding: 35px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-right: 1.5px solid var(--ink);
  background:
    radial-gradient(circle at 25% 22%, var(--acid) 0 12%, transparent 12.5%),
    linear-gradient(145deg, var(--coral) 0 48%, var(--mint) 48% 100%);
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.auth-visual::before {
  width: 260px;
  height: 260px;
  left: -90px;
  top: 150px;
}

.auth-visual::after {
  width: 170px;
  height: 170px;
  right: -50px;
  bottom: 50px;
}

.auth-visual > span {
  width: max-content;
  padding: 6px 9px;
  border: 1px solid var(--ink);
  background: var(--paper-soft);
  font-size: 9px;
  font-weight: 900;
}

.auth-visual strong {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 50px;
  line-height: 1.05;
}

.auth-visual small {
  position: relative;
  z-index: 1;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.auth-content {
  padding: 65px 55px 45px;
}

.auth-content h2,
.pricing-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 42px;
}

.auth-content > p:not(.eyebrow),
.pricing-head > p:not(.eyebrow) {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.auth-tabs {
  margin: 28px 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.auth-tabs button {
  padding: 11px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.auth-tabs button.is-active {
  border-bottom-color: var(--coral);
}

.auth-content form {
  display: grid;
  gap: 14px;
}

.auth-content label span {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 800;
}

.auth-content input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1.2px solid var(--ink);
  border-radius: 9px;
  background: #fffdf7;
  outline: 0;
}

.form-hint {
  min-height: 20px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.form-hint.is-error {
  color: var(--coral-dark);
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.pricing-modal {
  padding: 48px;
}

.pricing-head {
  padding-right: 60px;
}

.pricing-table-wrap {
  margin-top: 30px;
  overflow: auto;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
}

.pricing-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.pricing-table-wrap th,
.pricing-table-wrap td {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.pricing-table-wrap th:last-child,
.pricing-table-wrap td:last-child {
  border-right: 0;
}

.pricing-table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.pricing-table-wrap th {
  background: var(--acid);
  font-size: 10px;
}

.pricing-table-wrap tbody tr:nth-child(even) {
  background: rgba(158, 214, 197, 0.2);
}

.pricing-table-wrap td:last-child {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 900;
}

.pricing-note {
  margin-top: 12px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--mint);
  font-size: 11px;
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  width: min(360px, calc(100% - 44px));
  display: grid;
  gap: 9px;
}

.toast {
  padding: 13px 15px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper-soft);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 11px;
  line-height: 1.5;
  animation: toast-in 220ms ease both;
}

.toast.is-error {
  color: var(--paper-soft);
  background: var(--coral-dark);
}

.reveal {
  animation: reveal 650ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.reveal-delay-1 {
  animation-delay: 110ms;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.72); opacity: 0.6; }
}

@keyframes loader {
  from { transform: scaleY(0.55); }
  to { transform: scaleY(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .hero-copy {
    grid-template-columns: 1fr 300px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: relative;
    top: auto;
  }

  .result-stage {
    min-height: 680px;
  }

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

@media (max-width: 760px) {
  .topbar {
    width: calc(100% - 24px);
    min-height: 70px;
    margin-top: 10px;
    padding: 9px 10px;
  }

  .brand-copy small,
  .balance-chip span:last-child,
  .user-trigger > span:last-child {
    display: none;
  }

  .brand-seal {
    width: 39px;
    height: 39px;
  }

  .button-ink {
    padding: 8px 11px;
    font-size: 11px;
  }

  main {
    width: calc(100% - 24px);
  }

  .studio-section {
    padding-top: 48px;
  }

  .hero-copy {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 30px;
    padding-bottom: 35px;
  }

  .hero-copy h1 {
    font-size: clamp(52px, 17vw, 78px);
  }

  .hero-sidecopy {
    max-width: 460px;
  }

  .composer,
  .result-panel {
    padding: 17px;
    border-radius: 17px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .result-panel {
    box-shadow: 4px 4px 0 var(--coral);
  }

  .prompt-shell textarea {
    min-height: 150px;
    padding: 15px;
    font-size: 17px;
  }

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

  .setting-split,
  .setting-final {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .quantity-control {
    width: 100%;
  }

  .create-bar {
    align-items: center;
  }

  .create-button {
    min-width: 150px;
    min-height: 55px;
  }

  .result-stage {
    min-height: 510px;
  }

  .gallery-section {
    padding-top: 100px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

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

  .principles {
    grid-template-columns: 1fr;
  }

  .principles > p,
  .principles > div {
    min-height: 86px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .principles > div:last-child {
    border-bottom: 0;
  }

  footer {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  footer button {
    justify-self: start;
  }

  .auth-modal[open] {
    display: block;
  }

  .auth-visual {
    min-height: 180px;
    padding: 24px;
    border-right: 0;
    border-bottom: 1.5px solid var(--ink);
  }

  .auth-visual strong {
    font-size: 34px;
  }

  .auth-visual small {
    display: none;
  }

  .auth-content,
  .pricing-modal {
    padding: 35px 22px 24px;
  }

  .pricing-head {
    padding-right: 35px;
  }
}

@media (max-width: 480px) {
  .brand-copy {
    display: none;
  }

  .balance-chip {
    padding: 0 9px;
  }

  .prompt-tools {
    align-items: flex-end;
  }

  .enhance-button small {
    display: none;
  }

  .create-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .create-button {
    min-height: 52px;
  }

  .result-stage {
    min-height: 420px;
  }

  .empty-copy {
    left: 7%;
    bottom: 7%;
  }

  .empty-copy strong {
    font-size: 22px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

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