:root {
  --bg: #07070d;
  --bg-soft: #0d0d18;
  --surface: #15151f;
  --surface-2: #1c1c2a;
  --text: #fff;
  --muted: #b3b3c0;
  --subtle: #797988;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --orange: #ff6a1f;
  --orange-bright: #ff8a3d;
  --orange-deep: #ff4d14;
  --teal: #2dd4bf;
  --blue: #60a5fa;
  --warm-white: #f8f7f2;
  --radius: 8px;
  --radius-pill: 999px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  --font-display: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-sans: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(900px 460px at 80% -12%, rgba(45, 212, 191, 0.16), transparent 64%),
    radial-gradient(800px 420px at 16% -8%, rgba(255, 106, 31, 0.24), transparent 62%),
    linear-gradient(180deg, #08080f 0%, var(--bg) 48%, #050509 100%);
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

svg {
  display: block;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 40px;
}

.gc-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 58px;
  margin-bottom: 14px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 10px max(16px, calc((100vw - 1440px) / 2 + 16px));
  background:
    linear-gradient(180deg, rgba(8, 8, 15, 0.96), rgba(8, 8, 15, 0.82)),
    rgba(8, 8, 15, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.brand-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  width: auto;
  height: 52px;
}

.product-wordmark {
  position: absolute;
  left: 50%;
  flex: 0 0 auto;
  max-width: min(54vw, 480px);
  margin: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    #fb923c 0%,
    #ef4444 16%,
    #fb923c 32%,
    #facc15 50%,
    #fb923c 68%,
    #ef4444 84%,
    #fb923c 100%
  );
  background-repeat: repeat-x;
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  animation: butterTomatoTextFlow 2.5s linear infinite;
}

@keyframes butterTomatoTextFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .product-wordmark {
    animation: none;
  }
}

.top-language {
  flex: 0 0 auto;
  margin-left: auto;
}

.language-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
}

.language-trigger {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background-color: rgba(255, 255, 255, 0.04);
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.language-trigger:hover,
.language-trigger:focus-visible,
.language-shell.is-open .language-trigger {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
}

.language-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  pointer-events: none;
}

.language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 120;
  display: none;
  gap: 2px;
  min-width: 186px;
  padding: 7px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 14px;
  color: #15151f;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  opacity: 1;
  pointer-events: none;
  transform: none;
  transform-origin: top right;
}

.language-shell.is-open .language-menu {
  display: grid;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.language-menu button {
  display: flex;
  align-items: center;
  min-height: 34px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  color: #20202c;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 650;
  text-align: left;
  transition: background-color 140ms ease, color 140ms ease;
}

.language-menu button:hover,
.language-menu button:focus-visible {
  outline: none;
  color: #111118;
  background: #fff1e8;
}

.language-menu button[aria-checked="true"] {
  color: #8f2f0c;
  background: #ffe2d0;
}

.top-language .lang-picker {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  opacity: 0;
  pointer-events: none;
}

.custom-select {
  position: relative;
  min-width: 0;
}

.custom-select select {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  opacity: 0;
  pointer-events: none;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(5, 5, 9, 0.72);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.custom-select-trigger::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid rgba(255, 255, 255, 0.78);
  border-bottom: 2px solid rgba(255, 255, 255, 0.78);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 150ms ease, border-color 150ms ease;
}

.custom-select-trigger:hover,
.custom-select-trigger:focus-visible,
.custom-select.is-open .custom-select-trigger {
  outline: none;
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(255, 106, 31, 0.16);
}

.custom-select.is-open .custom-select-trigger::after {
  border-color: #fff;
  transform: translateY(2px) rotate(225deg);
}

.custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 130;
  display: none;
  gap: 2px;
  min-width: min(220px, 88vw);
  max-height: min(320px, 52vh);
  overflow-y: auto;
  padding: 7px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 14px;
  color: #15151f;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  opacity: 1;
  pointer-events: none;
  transform: none;
  transform-origin: top left;
}

.custom-select.is-open .custom-select-menu {
  display: grid;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.custom-select-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  color: #20202c;
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  text-align: left;
  transition: background-color 140ms ease, color 140ms ease;
}

.custom-select-menu button:hover,
.custom-select-menu button:focus-visible {
  outline: none;
  color: #111118;
  background: #fff1e8;
}

.custom-select-menu button[aria-selected="true"] {
  color: #8f2f0c;
  background: #ffe2d0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 12ch;
  margin-top: 8px;
  font-size: clamp(2rem, 4.8vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: 0;
}

.tile-kicker {
  color: var(--subtle);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.composer-layout {
  --workspace-tile-height: clamp(540px, calc(100vh - 132px), 814px);
  display: grid;
  grid-template-columns: minmax(560px, 1.08fr) minmax(380px, 0.92fr);
  gap: 18px;
  align-items: stretch;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  height: var(--workspace-tile-height);
  min-height: var(--workspace-tile-height);
}

.control-dock {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  height: var(--workspace-tile-height);
  overflow: hidden;
}

.control-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.16);
}

.control-tab {
  min-width: 0;
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.05;
  overflow: hidden;
  text-wrap: balance;
  white-space: normal;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.control-tab:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
}

.control-tab.is-active {
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
  background: linear-gradient(135deg, var(--orange-bright), var(--orange-deep));
}

.control-panels {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.control-panel {
  min-height: 100%;
}

.control-panel[hidden] {
  display: none !important;
}

.preset-lab {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.preset-lab .tile-head {
  flex: 0 0 auto;
}

.tool-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(21, 21, 31, 0.86);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.icon-button-labeled {
  display: inline-flex;
  gap: 6px;
  width: auto;
  min-width: 0;
  padding: 0 10px;
}

.icon-button-labeled span {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.icon-button:disabled {
  color: rgba(248, 247, 242, 0.28);
  cursor: not-allowed;
  opacity: 0.7;
}

.icon-button:disabled:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
  transform: none;
}

.preview-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 15px;
  overflow: visible;
}

.preview-canvas {
  position: relative;
  overflow: hidden;
  height: 100%;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ff6a1f 0%, #2dd4bf 52%, #f8f7f2 100%);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  touch-action: none;
}

.preview-info {
  position: relative;
  flex: 0 0 auto;
  order: 0;
  z-index: 12;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  color: rgba(248, 247, 242, 0.86);
  background: rgba(7, 7, 13, 0.78);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

.preview-info-icon {
  display: inline-grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.preview-info-text {
  position: absolute;
  left: 0;
  top: calc(100% + 9px);
  display: none;
  width: min(280px, calc(100vw - 48px));
  padding: 12px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(14, 14, 22, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
  transform: none;
}

.preview-info:hover .preview-info-text,
.preview-info:focus .preview-info-text,
.preview-info:focus-visible .preview-info-text,
.preview-info:active .preview-info-text,
.preview-info.is-open .preview-info-text {
  display: block;
  pointer-events: auto;
  transform: none;
}

.preview-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 18;
  background:
    linear-gradient(135deg, rgba(8, 8, 15, 0.34), rgba(8, 8, 15, 0.5)),
    rgba(248, 247, 242, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.preview-canvas.is-ai-busy::after {
  opacity: 1;
}

.preview-canvas.is-ai-busy .preview-grid,
.preview-canvas.is-ai-busy .stop-layer,
.preview-canvas.is-ai-busy .drop-hint {
  filter: grayscale(0.35) saturate(0.75);
  opacity: 0.58;
  pointer-events: none;
}

.preview-canvas.is-dragover {
  outline: 2px solid rgba(255, 138, 61, 0.85);
  outline-offset: 3px;
}

.ai-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.preview-canvas.is-ai-busy .ai-preview-overlay {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ai-working-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 106, 31, 0.28), rgba(45, 212, 191, 0.16)),
    rgba(8, 8, 15, 0.78);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px);
  font-size: 0.92rem;
  font-weight: 900;
}

.ai-bounce-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-bounce-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-bright), #fff7ed);
  animation: aiDotBounce 760ms ease-in-out infinite;
}

.ai-bounce-dots span:nth-child(2) {
  animation-delay: 120ms;
}

.ai-bounce-dots span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes aiDotBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.62;
  }

  38% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-bounce-dots span {
    animation: none;
  }
}

.preview-grid {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 10% 10%;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.drop-hint {
  position: absolute;
  left: 18px;
  bottom: 18px;
  max-width: min(280px, calc(100% - 36px));
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.86rem;
  backdrop-filter: blur(10px);
  pointer-events: none;
  transition: opacity 160ms ease;
}

.preview-canvas.has-stops .drop-hint {
  opacity: 0;
}

.stop-layer {
  position: absolute;
  inset: 0;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 160ms ease;
}

.preview-canvas.stops-hidden .stop-layer {
  opacity: 0;
  pointer-events: none;
}

.stop-control {
  position: absolute;
  width: 70px;
  height: 70px;
  transform: translate(-50%, -50%);
  opacity: 1;
  visibility: visible;
  transition: opacity 160ms ease, visibility 160ms ease;
  will-change: transform;
}

.preview-canvas.stops-hidden .stop-control {
  opacity: 0;
  visibility: hidden;
}

.stop-handle {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: var(--stop-size, 28px);
  height: var(--stop-size, 28px);
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: var(--stop-color);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.36);
  cursor: grab;
  touch-action: none;
  transform: translate(-50%, -50%);
  transition: width 140ms ease, height 140ms ease, box-shadow 140ms ease;
}

.stop-handle.is-dragging {
  cursor: grabbing;
}

.stop-handle::after {
  content: "";
  width: 8px;
  height: 8px;
  border: 1px solid rgba(0, 0, 0, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}

.stop-control.is-active .stop-handle {
  width: var(--active-stop-size, 34px);
  height: var(--active-stop-size, 34px);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.16), 0 12px 30px rgba(0, 0, 0, 0.42);
}

.stop-remove {
  position: absolute;
  right: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: #fff;
  background: rgba(7, 7, 13, 0.82);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
  font-size: 0.92rem;
  line-height: 1;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 140ms ease, transform 140ms ease, background-color 140ms ease;
}

.stop-remove::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
}

.stop-control:hover .stop-remove,
.stop-control:focus-within .stop-remove,
.stop-control.is-active .stop-remove {
  opacity: 1;
  transform: scale(1);
}

@media (hover: hover) and (pointer: fine) {
  .stop-remove:hover {
    background: rgba(239, 68, 68, 0.9);
  }
}

.stop-remove:active {
  background: rgba(239, 68, 68, 0.9);
}

.stop-remove:disabled {
  display: none;
}

.preview-footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
  padding: 0 18px 18px;
}

.footer-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-self: stretch;
  width: 100%;
  gap: 8px;
}

.footer-actions > .icon-button-labeled {
  flex: 1 1 0;
  min-width: 0;
}

.preview-footer .icon-button {
  width: 36px;
  height: 36px;
}

.preview-footer .icon-button-labeled {
  justify-content: center;
  width: 100%;
  padding: 0 9px;
  gap: 5px;
}

.preview-footer .icon-button-labeled span {
  min-width: 0;
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-footer .icon-button svg {
  width: 17px;
  height: 17px;
}

.history-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  justify-self: center;
}

.range-control {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 0.88rem;
}

.range-control span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.range-control strong {
  color: var(--text);
  font-weight: 700;
}

.shape-control {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: start;
  width: 100%;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.shape-control label {
  margin-left: auto;
  white-space: nowrap;
}

.shape-control .custom-select {
  flex: 0 1 220px;
  width: clamp(140px, 18vw, 220px);
  min-width: 140px;
}

.shape-control .custom-select-trigger {
  min-height: 36px;
}

.stop-visibility-button {
  position: relative;
  overflow: hidden;
  width: 36px;
  height: 36px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--orange-bright));
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 0 10px 28px rgba(255, 106, 31, 0.28);
}

.stop-visibility-button::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 50%;
  z-index: 2;
  height: 2px;
  border-radius: 999px;
  background: rgba(248, 247, 242, 0.86);
  opacity: 0;
  transform: translateY(-50%) rotate(-38deg) scaleX(0.7);
  transition: opacity 150ms ease, transform 150ms ease;
}

.stop-visibility-button[aria-pressed="false"] {
  color: rgba(248, 247, 242, 0.58);
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border);
  box-shadow: none;
}

.stop-visibility-button[aria-pressed="false"]::after {
  opacity: 1;
  transform: translateY(-50%) rotate(-38deg) scaleX(1);
}

.stop-visibility-glyph {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8a3d, #ff4d14);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14), 0 8px 18px rgba(0, 0, 0, 0.32);
}

.stop-visibility-glyph::after {
  content: "";
  width: 7px;
  height: 7px;
  border: 1px solid rgba(7, 7, 13, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
}

.stop-visibility-button[aria-pressed="false"] .stop-visibility-glyph {
  background: rgba(248, 247, 242, 0.22);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), 0 8px 18px rgba(0, 0, 0, 0.22);
}

.add-stop-button {
  min-height: 36px;
  padding: 8px 12px;
  white-space: nowrap;
}

.flow-tilt-control {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.flow-tilt-control span {
  display: block;
  white-space: nowrap;
}

input[type="range"] {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: var(--orange);
}

.palette-control input[type="range"] {
  accent-color: hsl(var(--palette-hue, 18), 100%, 52%);
  background: transparent;
}

.palette-control input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    #ff0000 0%,
    #ffff00 16.66%,
    #00ff00 33.33%,
    #00ffff 50%,
    #0000ff 66.66%,
    #ff00ff 83.33%,
    #ff0000 100%
  );
}

.palette-control input[type="range"]::-moz-range-track {
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    #ff0000 0%,
    #ffff00 16.66%,
    #00ff00 33.33%,
    #00ffff 50%,
    #0000ff 66.66%,
    #ff00ff 83.33%,
    #ff0000 100%
  );
}

.palette-control input[type="range"]::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -6px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--selected-color, #ff6a1f);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.68), 0 6px 14px rgba(0, 0, 0, 0.28);
  -webkit-appearance: none;
  appearance: none;
}

.palette-control input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--selected-color, #ff6a1f);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.68), 0 6px 14px rgba(0, 0, 0, 0.28);
}

.color-lab {
  overflow: hidden;
}

.color-lab .tile-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 11px 18px;
}

.color-lab .palette-control {
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}

.color-lab .palette-control input[type="range"] {
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

.current-swatch {
  width: 58px;
  height: 34px;
  min-height: 34px;
  border: 0;
  border-radius: var(--radius);
  background: #ff6a1f;
  box-shadow: none;
  cursor: grab;
  overflow: hidden;
}

.current-swatch:active {
  cursor: grabbing;
}

.color-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
  margin: 18px;
  align-items: stretch;
}

.color-field {
  position: relative;
  height: 220px;
  border: 0;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, transparent, #000),
    linear-gradient(90deg, #fff, hsl(18, 100%, 50%));
  background-clip: padding-box;
  cursor: crosshair;
  touch-action: none;
}

.field-reticle {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 8px 16px rgba(0, 0, 0, 0.24);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.harmony-stack {
  display: grid;
  grid-template-rows: auto repeat(5, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.harmony-stack > span {
  overflow: hidden;
  color: var(--subtle);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.harmony-list {
  display: grid;
  grid-row: span 5;
  gap: 6px;
}

.harmony-option {
  min-width: 0;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: var(--harmony-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 18px rgba(0, 0, 0, 0.24);
  cursor: grab;
}

.harmony-option:hover,
.harmony-option:focus-visible {
  border-color: rgba(255, 255, 255, 0.74);
  outline: none;
  transform: translateY(-1px);
}

.harmony-option:active {
  cursor: grabbing;
}

.input-grid,
.rgb-controls,
.alpha-control {
  margin-right: 18px;
  margin-left: 18px;
}

.input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.alpha-control {
  margin-top: 10px;
  margin-bottom: 16px;
}

.color-lab .input-grid label,
.color-lab .rgb-control,
.color-lab .alpha-control {
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.color-lab .alpha-control {
  grid-template-columns: 84px minmax(0, 1fr);
}

.color-lab .input-grid label span,
.color-lab .rgb-control span,
.color-lab .alpha-control span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
}

.rgb-controls {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.rgb-control {
  gap: 6px;
}

.rgb-red input[type="range"] {
  accent-color: #ef4444;
}

.rgb-green input[type="range"] {
  accent-color: #22c55e;
}

.rgb-blue input[type="range"] {
  accent-color: #3b82f6;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  color: var(--text);
  background: rgba(5, 5, 9, 0.72);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

input[type="text"],
input[type="number"] {
  min-height: 42px;
  padding: 10px 11px;
}

.color-lab input[type="text"] {
  min-height: 34px;
  padding: 7px 10px;
}

select {
  --select-arrow: rgba(255, 255, 255, 0.86);
  min-height: 44px;
  padding: 10px 38px 10px 11px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--select-arrow) 50%),
    linear-gradient(135deg, var(--select-arrow) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

textarea {
  display: block;
  min-height: 112px;
  margin: 18px;
  width: calc(100% - 36px);
  resize: vertical;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
}

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

.ai-prompt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.ai-form textarea {
  min-height: 86px;
  margin: 0;
  width: 100%;
}

.ai-safety-info {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.ai-safety-icon {
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1;
}

.ai-safety-text {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  z-index: 12;
  width: min(360px, calc(100vw - 48px));
  padding: 12px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(14, 14, 22, 0.97);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.ai-safety-info:hover .ai-safety-text,
.ai-safety-info:focus .ai-safety-text,
.ai-safety-info:focus-visible .ai-safety-text,
.ai-safety-info:active .ai-safety-text {
  opacity: 1;
  transform: translateY(0);
}

.ai-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(255, 106, 31, 0.48);
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 138, 61, 0.95), rgba(255, 77, 20, 0.9));
  font-weight: 800;
  transition: transform 150ms ease, box-shadow 180ms ease, opacity 150ms ease;
}

.ai-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(255, 106, 31, 0.26);
}

.ai-submit:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.ai-status {
  min-height: 20px;
  color: var(--subtle);
  font-size: 0.82rem;
  line-height: 1.45;
}

.ai-status.is-error {
  color: #fda4af;
}

.ai-status.is-success {
  color: #86efac;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 138, 61, 0.7);
  background: rgba(5, 5, 9, 0.9);
  box-shadow: 0 0 0 3px rgba(255, 106, 31, 0.12);
}

select:focus {
  --select-arrow: #fff;
}

.preset-menu {
  margin: 18px 18px 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.preset-list {
  display: grid;
  align-content: start;
  flex: 1 1 auto;
  gap: 8px;
  overflow: auto;
  padding: 18px;
}

.preset-option {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.preset-option:hover,
.preset-option.is-active {
  color: var(--text);
  border-color: rgba(255, 138, 61, 0.52);
  background: rgba(255, 106, 31, 0.11);
}

.preset-option:hover {
  transform: translateY(-1px);
}

.preset-swatch {
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: var(--preset-gradient);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.preset-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 800;
}

.stop-controls {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 18px 18px 0;
}

.curve-control {
  display: none;
  grid-column: 1 / -1;
  margin-top: 2px;
}

.curve-control.is-visible {
  display: grid;
}

.placed-colors-dropdown {
  margin: 16px 18px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.028);
}

.placed-colors-dropdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
  list-style: none;
}

.placed-colors-dropdown summary::-webkit-details-marker {
  display: none;
}

.placed-colors-dropdown summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.placed-colors-dropdown[open] summary::after {
  transform: rotate(225deg);
}

.placed-colors-dropdown summary strong {
  margin-left: auto;
  color: var(--subtle);
  font-size: 0.76rem;
  font-weight: 800;
}

.stop-list {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.stop-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.stop-row.is-active {
  border-color: rgba(255, 138, 61, 0.64);
  background: rgba(255, 106, 31, 0.1);
}

.stop-swatch {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 6px;
  background: var(--stop-color);
}

.stop-meta {
  min-width: 0;
}

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

.stop-meta strong {
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.stop-meta span {
  color: var(--subtle);
  font-size: 0.76rem;
}

.delete-stop,
.text-button {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.text-button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.delete-stop {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
}

.delete-stop:hover,
.text-button:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
}

.text-button:disabled,
.text-button:disabled:hover {
  color: rgba(248, 247, 242, 0.34);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.025);
  cursor: not-allowed;
}

.download-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 18px 18px 0;
}

.download-button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  font-weight: 800;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.download-button:hover {
  color: var(--text);
  border-color: rgba(255, 138, 61, 0.52);
  background: rgba(255, 106, 31, 0.12);
  transform: translateY(-1px);
}

@media (max-width: 1060px) {
  .composer-layout {
    grid-template-columns: 1fr;
  }

  .control-dock {
    position: static;
    height: auto;
  }

  .preview-panel {
    height: auto;
    min-height: 0;
  }

  .control-panels {
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .preview-wrap {
    flex: none;
  }

  .preview-canvas {
    height: clamp(320px, 48vw, 500px);
  }

  .preview-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 0;
  }

  .gc-topbar {
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-height: 46px;
    padding: 7px 10px;
    overflow: visible;
  }

  .product-wordmark {
    max-width: calc(100vw - 196px);
    margin: 0;
    font-size: clamp(0.98rem, 4.5vw, 1.25rem);
  }

  .preview-info-text {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 58px);
    left: 14px;
    right: auto;
    z-index: 180;
    width: calc(100vw - 28px);
    min-width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    max-height: min(42vh, 360px);
    overflow: auto;
    padding: 13px 14px;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(16, 16, 26, 0.98);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.5);
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.42;
    white-space: normal;
    overflow-wrap: normal;
  }

  .brand-link,
  .top-language {
    flex: none;
  }

  .brand-link {
    order: 1;
  }

  .top-language {
    order: 3;
    margin-left: auto;
  }

  .brand-logo {
    width: 74px;
    height: auto;
    max-height: 26px;
  }

  .language-shell,
  .language-trigger {
    width: 32px;
    height: 30px;
  }

  .language-menu {
    position: fixed;
    top: 54px;
    right: 10px;
    z-index: 190;
    min-width: min(190px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
  }

  .preview-footer {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(3rem, 17vw, 5.2rem);
  }

  .tile-head {
    padding: 14px;
  }

  .preview-wrap {
    padding: 14px;
  }

  .preview-canvas {
    height: clamp(160px, 44vw, 175px);
  }

  .preview-footer {
    display: grid;
    grid-template-columns: 1fr;
    padding: 0 14px 14px;
  }

  .footer-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-self: stretch;
    width: 100%;
    gap: 6px;
  }

  .footer-actions .icon-button {
    width: 34px;
    height: 34px;
    min-width: 0;
  }

  .footer-actions .icon-button-labeled {
    justify-content: center;
    width: 100%;
    padding: 0 5px;
    gap: 4px;
  }

  .footer-actions .icon-button-labeled span {
    font-size: 0.62rem;
  }

  .footer-actions .icon-button svg {
    width: 15px;
    height: 15px;
  }

  .history-actions {
    flex: 0 0 74px;
    gap: 6px;
    justify-self: stretch;
  }

  .shape-control {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
  }

  .shape-control .preview-info {
    order: 0;
    width: 34px;
    height: 34px;
  }

  .stop-visibility-button {
    width: 34px;
    height: 34px;
  }

  .shape-control label {
    margin-left: auto;
    font-size: 0.78rem;
  }

  .shape-control .custom-select {
    flex: 1 1 96px;
    width: auto;
    max-width: 140px;
    min-width: 0;
  }

  .add-stop-button {
    padding: 0 8px;
    font-size: 0.68rem;
  }

  .control-tabs {
    grid-template-columns: minmax(86px, 1.24fr) repeat(4, minmax(54px, 1fr));
    overflow-x: auto;
  }

  .control-tab {
    padding: 0 5px;
    font-size: clamp(0.62rem, 2.35vw, 0.72rem);
    line-height: 1.05;
  }

  .stop-controls {
    grid-template-columns: 1fr;
    padding: 14px 14px 0;
  }

  .color-field {
    height: 190px;
    margin: 14px;
  }

  .ai-prompt-grid {
    grid-template-columns: 1fr;
  }

  .input-grid,
  .rgb-controls,
  .alpha-control {
    margin-right: 14px;
    margin-left: 14px;
  }

  textarea {
    margin: 14px;
    width: calc(100% - 28px);
  }
}
