:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-raised: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --muted-strong: #424245;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --primary: #0071e3;
  --primary-dark: #005bb5;
  --primary-soft: #e8f2ff;
  --danger: #b00020;
  --warning: #8a5a00;
  --shadow: none;
  --radius: 8px;
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue",
    Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #f5f5f7;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
  background: linear-gradient(#ffffff 0 52%, #f5f5f7 52% 100%);
}

.login-card {
  width: min(520px, 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  padding: 38px;
  text-align: center;
}

.login-card h1 {
  width: 100%;
  margin-bottom: 28px;
  font-size: clamp(36px, 7vw, 58px);
}

.login-card .field-block {
  text-align: left;
}

.login-card .primary-button {
  width: 100%;
}

.login-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

.global-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 44px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(251, 251, 253, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
}

.global-nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  width: min(1024px, calc(100% - 32px));
  min-height: 44px;
  margin: 0 auto;
  color: var(--muted-strong);
  font-size: 12px;
}

.global-nav-inner strong,
.global-nav-inner .nav-home {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.global-nav-inner a {
  color: inherit;
  text-decoration: none;
}

.global-nav-inner a:hover,
.nav-button:hover {
  color: var(--ink);
}

.nav-button {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  padding: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  width: 100%;
  margin: 0 auto;
  padding: 0 0 56px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.topbar {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: clamp(390px, 52vw, 620px);
  padding: clamp(74px, 10vw, 124px) 24px clamp(112px, 13vw, 170px);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66) 0%, rgba(255, 255, 255, 0.78) 60%, #f5f5f7 100%),
    radial-gradient(circle at 50% 32%, rgba(0, 113, 227, 0.18), transparent 36%),
    #f7fbff;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(29, 29, 31, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 29, 31, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 88%);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 40%;
  background: linear-gradient(180deg, transparent, #f5f5f7 88%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(1080px, 100%);
}

.hero-content-bg {
  position: absolute;
  inset: 48px max(26px, calc((100vw - 1180px) / 2)) 74px;
  z-index: 1;
  pointer-events: none;
}

.hero-ai-bg {
  opacity: 0.9;
}

.ai-core {
  position: absolute;
  left: 50%;
  top: 43%;
  width: min(360px, 34vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95) 0 22%, transparent 23%),
    conic-gradient(from 24deg, rgba(0, 113, 227, 0.12), rgba(0, 199, 190, 0.36), rgba(191, 90, 242, 0.24), rgba(52, 199, 89, 0.32), rgba(0, 113, 227, 0.12));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 90px rgba(0, 113, 227, 0.16);
  transform: translate(-50%, -50%);
  filter: saturate(1.1);
}

.ai-core::before,
.ai-core::after {
  content: "";
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(0, 113, 227, 0.16);
  border-radius: inherit;
}

.ai-core::after {
  inset: 30%;
  border-color: rgba(52, 199, 89, 0.22);
  background: rgba(255, 255, 255, 0.46);
}

.ai-core span {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0071e3;
  box-shadow: 0 0 18px rgba(0, 113, 227, 0.46);
}

.ai-core span:nth-child(1) {
  left: 25%;
  top: 31%;
}

.ai-core span:nth-child(2) {
  right: 28%;
  top: 23%;
  background: #34c759;
}

.ai-core span:nth-child(3) {
  right: 30%;
  bottom: 25%;
  background: #00c7be;
}

.ai-lattice {
  position: absolute;
  inset: 0;
}

.ai-line {
  position: absolute;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(0, 113, 227, 0.26), rgba(52, 199, 89, 0.2), transparent);
  transform-origin: left center;
}

.line-1 {
  left: 13%;
  top: 26%;
  width: 34%;
  transform: rotate(12deg);
}

.line-2 {
  left: 52%;
  top: 27%;
  width: 34%;
  transform: rotate(-13deg);
}

.line-3 {
  left: 19%;
  top: 67%;
  width: 32%;
  transform: rotate(-18deg);
}

.line-4 {
  left: 51%;
  top: 66%;
  width: 31%;
  transform: rotate(18deg);
}

.line-5 {
  left: 34%;
  top: 47%;
  width: 33%;
}

.ai-node {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: #0071e3;
  box-shadow: 0 0 26px rgba(0, 113, 227, 0.3);
}

.node-1 {
  left: 11%;
  top: 23%;
}

.node-2 {
  right: 11%;
  top: 21%;
  background: #00c7be;
}

.node-3 {
  left: 19%;
  bottom: 22%;
  background: #34c759;
}

.node-4 {
  right: 17%;
  bottom: 22%;
  background: #bf5af2;
}

.node-5 {
  left: 50%;
  top: 16%;
  background: #ff9f0a;
}

.node-6 {
  left: 50%;
  bottom: 14%;
  background: #0071e3;
}

.ai-pill {
  position: absolute;
  min-width: 132px;
  padding: 9px 14px;
  border: 1px solid rgba(210, 210, 215, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: rgba(66, 66, 69, 0.68);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(18px);
}

.pill-1 {
  left: 5%;
  top: 12%;
}

.pill-2 {
  right: 6%;
  top: 18%;
}

.pill-3 {
  left: 8%;
  bottom: 15%;
}

.ai-pixel-cloud {
  position: absolute;
  right: 8%;
  bottom: 13%;
  display: grid;
  grid-template-columns: repeat(3, 28px);
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(210, 210, 215, 0.54);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(18px);
}

.ai-pixel-cloud span {
  width: 28px;
  aspect-ratio: 1;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.28), rgba(52, 199, 89, 0.24));
}

.ai-pixel-cloud span:nth-child(2),
.ai-pixel-cloud span:nth-child(5) {
  background: linear-gradient(135deg, rgba(0, 199, 190, 0.28), rgba(191, 90, 242, 0.2));
}

.ai-pixel-cloud span:nth-child(3),
.ai-pixel-cloud span:nth-child(6) {
  background: linear-gradient(135deg, rgba(255, 159, 10, 0.25), rgba(0, 113, 227, 0.22));
}

.eyebrow,
.label-kicker,
.metric-label,
.hint {
  color: var(--muted);
}

.eyebrow,
.label-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.topbar .eyebrow {
  margin-bottom: 12px;
  color: rgba(29, 29, 31, 0.62);
  font-size: 17px;
  font-weight: 600;
}

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

h1 {
  width: min(1060px, 100%);
  margin-bottom: 0;
  font-size: clamp(48px, 6vw, 86px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0;
}

.service-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  backdrop-filter: blur(20px);
}

.service-chip.ready {
  border-color: rgba(0, 113, 227, 0.18);
  background: rgba(232, 242, 255, 0.9);
  color: var(--primary);
}

.service-chip.warn {
  border-color: rgba(138, 90, 0, 0.18);
  background: #fff6dd;
  color: var(--warning);
}

.control-surface {
  width: min(1420px, calc(100% - 48px));
  margin: -86px auto 0;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(390px, 0.9fr) minmax(480px, 1.1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.composer-panel,
.preview-panel {
  padding: 34px;
}

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

.panel-heading {
  margin-bottom: 22px;
}

.section-title-row.compact {
  align-items: center;
}

.field-block {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field-block span {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

input,
select {
  min-height: 46px;
  padding: 0 13px;
}

textarea {
  min-height: 260px;
  padding: 14px;
  line-height: 1.52;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #86868b;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
  background: #ffffff;
}

.prompt-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 22px;
}

.inline-label {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.preset-button,
.ghost-button,
.secondary-button,
.primary-button,
.icon-button {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  min-height: 38px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 600;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.preset-button {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 72px;
  padding: 12px 16px;
  border-radius: var(--radius);
  text-align: left;
}

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

.preset-button small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.preset-button:hover,
.ghost-button:hover,
.secondary-button:hover,
.icon-button:hover {
  border-color: rgba(0, 113, 227, 0.35);
  color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.ghost-button {
  padding: 0 16px;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
}

.primary-button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 113, 227, 0.22);
}

.secondary-button {
  min-height: 50px;
  padding: 0 16px;
  background: var(--surface-raised);
  border-radius: 999px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.reference-box {
  margin-top: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

.icon-button {
  min-width: 42px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.upload-dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 150px;
  margin-top: 18px;
  border: 1px dashed #a1a1a6;
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink);
  text-align: center;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.upload-dropzone strong {
  font-size: 17px;
  font-weight: 650;
}

.upload-dropzone span {
  color: var(--muted);
  font-size: 13px;
}

.upload-dropzone:hover,
.upload-dropzone.dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.uploaded-images-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.uploaded-image-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-raised);
  padding: 8px;
}

.uploaded-image-card img {
  width: 58px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  background: #f5f5f7;
}

.uploaded-image-card strong,
.uploaded-image-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-image-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.hint {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  margin-top: 24px;
}

.status-board {
  display: grid;
  grid-template-columns: 1.45fr 0.8fr 0.6fr;
  gap: 10px;
  margin-bottom: 14px;
}

.status-board > div {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 13px;
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
}

.status-board strong {
  display: block;
  min-height: 20px;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 650;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e8ed;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 280ms ease;
}

.preview-stage {
  display: grid;
  place-items: center;
  min-height: 430px;
  margin-top: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at center, #ffffff 0 0, transparent 0),
    var(--surface-raised);
}

.empty-preview {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(360px, calc(100% - 36px));
  color: var(--muted);
  text-align: center;
}

.empty-preview p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
}

.empty-preview.is-error {
  width: min(430px, calc(100% - 36px));
  padding: 18px;
  border: 1px solid rgba(176, 0, 32, 0.14);
  border-radius: var(--radius);
  background: rgba(176, 0, 32, 0.04);
  color: var(--danger);
}

.static-preview-art {
  position: relative;
  width: 118px;
  height: 92px;
  overflow: hidden;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(232, 242, 255, 0.72)),
    #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.8),
    0 18px 45px rgba(0, 113, 227, 0.16);
}

.static-preview-art::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, transparent 0 52%, rgba(52, 199, 89, 0.38) 53% 100%),
    linear-gradient(35deg, rgba(0, 113, 227, 0.22), transparent 60%),
    #ffffff;
}

.static-preview-art::after {
  content: "";
  position: absolute;
  right: 27px;
  top: 25px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #0071e3;
  box-shadow: 0 0 0 8px rgba(0, 113, 227, 0.1);
}

.static-preview-art span {
  position: absolute;
  left: 25px;
  right: 25px;
  height: 8px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.12);
  z-index: 1;
}

.static-preview-art span:nth-child(1) {
  bottom: 31px;
}

.static-preview-art span:nth-child(2) {
  bottom: 20px;
  right: 45px;
}

.static-preview-art span:nth-child(3) {
  bottom: 20px;
  left: 80px;
  right: 25px;
  background: rgba(0, 113, 227, 0.32);
}

.generation-countdown {
  display: grid;
  gap: 4px;
  min-width: 132px;
  padding: 13px 18px;
  border: 1px solid rgba(0, 113, 227, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

.generation-countdown span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.generation-countdown strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.preview-stage img {
  display: block;
  max-width: 100%;
  max-height: 640px;
  border-radius: var(--radius);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.18);
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.image-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--surface-raised);
}

.image-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: #f5f5f7;
}

.image-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-card a,
.ghost-link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.image-card a:hover,
.ghost-link:hover {
  text-decoration: underline;
}

.history-panel {
  margin-top: 24px;
  border-top: 1px solid var(--line-soft);
  padding-top: 22px;
}

.history-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.history-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.history-empty {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.history-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-raised);
  padding: 10px;
}

.history-card img {
  width: 74px;
  height: 74px;
  border-radius: 6px;
  object-fit: cover;
  background: #f5f5f7;
}

.history-card-body {
  min-width: 0;
}

.history-card-body strong,
.history-card-body small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-card-body small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.history-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.history-actions .ghost-button,
.history-actions .ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(29, 29, 31, 0.92);
  color: #ffffff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  padding: 14px 16px;
  font-weight: 600;
  backdrop-filter: blur(20px);
  transform: translateY(120%);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background: var(--danger);
}

@media (max-width: 1040px) {
  .control-surface {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .app-shell {
    padding: 0 0 40px;
  }

  .topbar {
    display: grid;
    min-height: clamp(360px, 92vw, 470px);
    padding: 64px 18px 112px;
  }

  .topbar .eyebrow {
    font-size: 14px;
  }

  .hero-content-bg {
    inset: 52px 14px 82px;
  }

  .ai-pill {
    display: none;
  }

  .ai-core {
    top: 42%;
    width: min(310px, 74vw);
    opacity: 0.68;
  }

  .ai-line {
    opacity: 0.72;
  }

  .ai-node {
    width: 11px;
    height: 11px;
    border-width: 2px;
  }

  .node-1,
  .node-2 {
    top: 12%;
  }

  .node-3,
  .node-4 {
    bottom: 12%;
  }

  .ai-pixel-cloud {
    right: 50%;
    bottom: 4%;
    grid-template-columns: repeat(3, 22px);
    gap: 7px;
    padding: 9px;
    opacity: 0.7;
    transform: translateX(50%);
  }

  .ai-pixel-cloud span {
    width: 22px;
    border-radius: 7px;
  }

  .control-surface {
    width: calc(100% - 28px);
    margin-top: -74px;
  }

  h1 {
    font-size: clamp(31px, 9vw, 44px);
  }

  .composer-panel,
  .preview-panel {
    padding: 20px;
  }

  .panel-heading,
  .section-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .prompt-tools,
  .settings-grid,
  .status-board,
  .action-row {
    grid-template-columns: 1fr;
  }

  .preview-stage {
    min-height: 300px;
  }
}

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