/* ═══════════════════════════════════════════════════════════════════════
   Helix SD — focused studio
   Modern, animated, mobile-first. Vanilla CSS, no framework.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #09090b;
  --bg-2:      #0f0f13;
  --surface:   #16161c;
  --surface-2: #1d1d25;
  --line:      #26262f;
  --line-2:    #33333f;
  --text:      #f4f4f6;
  --text-dim:  #a1a1aa;
  --text-mute: #6b6b76;
  --accent:    #7c5cff;
  --accent-2:  #a78bfa;
  --accent-ink:#ffffff;
  --danger:    #f2555a;
  --ok:        #34d399;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 8px 40px rgba(0,0,0,0.5);
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --spring:    cubic-bezier(0.22, 1, 0.36, 1); /* ease-out-quint: snappy, no overshoot */
  --topbar-h:  56px;
  --runbar-h:  76px;
  --gutter:    clamp(14px, 4vw, 28px);
}

* { box-sizing: border-box; }
/* The HTML `hidden` attribute must win over any explicit `display` we set on
   an element (e.g. .login-gate/.field/.stagearea__img). Without this, author
   `display` overrides the UA `[hidden]{display:none}` rule and hidden elements
   stay visible — which kept the login gate on screen after a successful login. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124,92,255,0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(52,211,153,0.06), transparent 55%),
    var(--bg);
}

button { font: inherit; cursor: pointer; color: inherit; }
input, textarea, button { font-family: inherit; }
::selection { background: rgba(124,92,255,0.4); }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: flex; align-items: center; gap: 12px;
  padding-left: var(--gutter); padding-right: var(--gutter);
  background: rgba(9,9,11,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.topbar__back {
  display: grid; place-items: center;
  width: 38px; height: 38px; margin-left: -6px;
  border: none; background: transparent; border-radius: 12px;
  color: var(--text-dim);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--spring);
}
.topbar__back:hover { background: var(--surface-2); color: var(--text); }
.topbar__back:active { transform: scale(0.9); }
.topbar__brand {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  text-decoration: none; color: inherit; border-radius: 12px; padding: 4px 8px; margin-left: -8px;
  transition: background 0.18s var(--ease), transform 0.18s var(--spring);
}
.topbar__brand:hover { background: var(--surface-2); }
.topbar__brand:active { transform: scale(0.96); }
.topbar__logo {
  color: var(--accent-2); font-size: 20px; line-height: 1;
  filter: drop-shadow(0 0 12px rgba(124,92,255,0.6));
}
.topbar__title {
  font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar__actions { margin-left: auto; display: flex; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 550;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--spring), background 0.18s var(--ease);
}
.pill:hover { border-color: var(--accent); background: var(--surface-2); }
.pill:active { transform: scale(0.95); }
.pill__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Stage / views ───────────────────────────────────────────────────── */
.stage { position: relative; }
.view { display: none; animation: viewIn 0.32s var(--ease); }
.view--active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view__head {
  padding: clamp(20px, 5vw, 40px) var(--gutter) 8px;
  max-width: 1100px; margin: 0 auto;
}
.view__title { margin: 0; font-size: clamp(22px, 5vw, 30px); font-weight: 680; letter-spacing: -0.02em; }
.view__sub { margin: 6px 0 0; color: var(--text-dim); font-size: 14px; }

/* ── Workflow grid ───────────────────────────────────────────────────── */
.wf-search {
  margin-top: 14px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--bg-2); padding: 0 16px; color: var(--text-mute);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.wf-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,0.18); color: var(--accent-2); }
.wf-search input {
  flex: 1; border: none; background: transparent; color: var(--text);
  padding: 12px 0; font-size: 15px; outline: none;
}
.wf-search input::placeholder { color: var(--text-mute); }

.wf-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  padding: 20px var(--gutter) 60px;
  max-width: 1100px; margin: 0 auto;
}
@media (max-width: 560px) {
  .wf-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
.wf-card {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
  cursor: pointer; text-align: left;
  transition: border-color 0.2s var(--ease), transform 0.25s var(--spring), box-shadow 0.25s var(--ease);
}
.wf-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.wf-card:active { transform: translateY(-1px) scale(0.99); }
.wf-card__thumb {
  aspect-ratio: 1 / 1; background: var(--bg-2);
  background-size: cover; background-position: center;
  display: grid; place-items: center;
}
.wf-card__thumbimg { width: 100%; height: 100%; object-fit: cover; display: block; }
.wf-card__thumb--empty {
  font-size: 38px; color: rgba(255,255,255,0.92);
  position: relative; overflow: hidden;
  text-shadow: 0 0 18px rgba(255,255,255,0.45);
}
.wf-card__thumb--empty::after {
  content: ""; position: absolute; inset: -50%;
  background-image:
    radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 70% 55%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 45% 75%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 82% 25%, rgba(255,255,255,0.55), transparent);
  background-size: 120px 120px; opacity: 0.6;
  animation: twinkle 4s var(--ease) infinite;
}
.wf-card__thumb--empty span { position: relative; z-index: 1; }
.wf-card__body { padding: 12px 14px 14px; }
.wf-card__name {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wf-card__meta { margin-top: 4px; font-size: 12px; color: var(--text-mute); display: flex; gap: 8px; }
.wf-card__badge {
  position: absolute; top: 10px; right: 10px;
  padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(9,9,11,0.7); backdrop-filter: blur(8px); color: var(--accent-2);
  border: 1px solid var(--line-2);
}

/* skeleton shimmer */
.wf-skel { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.wf-skel__thumb { aspect-ratio: 1/1; }
.wf-skel__thumb, .wf-skel__line {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
.wf-skel__line { height: 12px; margin: 12px 14px; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Studio layout ───────────────────────────────────────────────────── */
.view--studio { padding-bottom: calc(var(--runbar-h) + env(safe-area-inset-bottom, 0px)); }

.studio-tabs {
  display: flex; gap: 4px; max-width: 960px; margin: 0 auto;
  padding: 14px var(--gutter) 0;
}
.stab {
  flex: 1; height: 40px; border: none; border-radius: 12px;
  background: transparent; color: var(--text-dim); font-size: 14px; font-weight: 600;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.stab:hover { color: var(--text); background: var(--surface); }
.stab--on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.studio-panel {
  display: flex; flex-direction: column; gap: 16px;
  max-width: 960px; margin: 0 auto;
  padding: 14px var(--gutter) 20px;
  animation: viewIn 0.28s var(--ease);
}

.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 18px;
}

/* ── Fields ──────────────────────────────────────────────────────────── */
.controls { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--text-dim); display: flex; align-items: center; gap: 8px;
}
.field__area, .field input[type="number"], .field input[type="text"] {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--text);
  padding: 12px 13px; font-size: 15px; resize: vertical;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field__area { line-height: 1.5; min-height: 54px; }
.field__area:focus, .field input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,255,0.18);
}
.field--collapse { border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg-2); padding: 12px 13px; }
.field--collapse[open] { padding-bottom: 13px; }
.field--collapse summary { cursor: pointer; list-style: none; margin: 0; }
.field--collapse summary::-webkit-details-marker { display: none; }
.field--collapse[open] summary { margin-bottom: 10px; }
.field--collapse .field__area { background: var(--surface); }
.field--row { flex-direction: row; gap: 14px; }
.field--inline { flex: 0 0 auto; }
.field--grow { flex: 1 1 auto; }

.field__area:disabled {
  opacity: 0.5; cursor: not-allowed; background: var(--surface);
}

/* Prompt-builder bypass toggle */
.builder-field { margin-top: -4px; }
.builder-toggle {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg-2); padding: 11px 13px;
  transition: border-color 0.18s var(--ease);
}
.builder-toggle:hover { border-color: var(--accent); }
.builder-toggle__cb {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto;
  width: 40px; height: 22px; border-radius: 999px;
  background: var(--line-2); position: relative; cursor: pointer;
  transition: background 0.18s var(--ease);
}
.builder-toggle__cb::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform 0.18s var(--ease);
}
.builder-toggle__cb:checked { background: var(--accent); }
.builder-toggle__cb:checked::after { transform: translateX(18px); }
.builder-toggle__body { display: flex; flex-direction: column; gap: 2px; }
.builder-toggle__title { font-size: 14px; font-weight: 600; color: var(--text); }

.mini-link { border: none; background: none; color: var(--accent-2); font-size: 11px; padding: 0; text-transform: none; }
.mini-link:hover { text-decoration: underline; }
.mini-btn {
  display: grid; place-items: center; width: 40px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--text-dim);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.mini-btn:hover { border-color: var(--accent); color: var(--text); }

/* ── Chips (sizes / groups) ──────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--bg-2); color: var(--text-dim);
  padding: 8px 14px; font-size: 13px; font-weight: 550;
  transition: all 0.18s var(--ease), transform 0.18s var(--spring);
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip:active { transform: scale(0.94); }
.chip--on {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: 0 4px 16px rgba(124,92,255,0.35);
}
.chips--toggle .chip { position: relative; }
.chips--toggle .chip--off { opacity: 0.5; text-decoration: line-through; }

.size-custom { display: flex; align-items: center; gap: 8px; }
.size-custom input { width: 100%; text-align: center; }
.size-x { color: var(--text-mute); font-size: 14px; }

/* ── LoRAs ───────────────────────────────────────────────────────────── */
.loras { display: flex; flex-direction: column; gap: 10px; }
.lora {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg-2); padding: 10px 12px;
  transition: border-color 0.18s var(--ease), opacity 0.18s var(--ease);
}
.lora--off { opacity: 0.5; }
.lora__toggle {
  position: relative; width: 40px; height: 24px; flex: none;
  border-radius: 999px; border: none; background: var(--line-2);
  transition: background 0.2s var(--ease);
}
.lora__toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform 0.22s var(--spring);
}
.lora__toggle[aria-pressed="true"] { background: var(--accent); }
.lora__toggle[aria-pressed="true"]::after { transform: translateX(16px); }
.lora__body { min-width: 0; }
.lora__name { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lora__range { width: 100%; margin-top: 6px; accent-color: var(--accent); }
.lora__val { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-dim); min-width: 34px; text-align: right; }

/* ── Output / stage (hero) ───────────────────────────────────────────── */
.stagearea {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(120% 120% at 50% 0%, #12101c 0%, var(--bg-2) 55%, #08080c 100%);
  border: 1px solid var(--line);
  min-height: min(62vh, 660px); display: grid; place-items: center;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.5);
}
.stagearea__placeholder { position: relative; z-index: 2; text-align: center; color: var(--text-mute); font-size: 14px; }
.stagearea__glow {
  width: 140px; height: 140px; margin: 0 auto 16px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,92,255,0.55), transparent 70%);
  animation: breathe 3.8s var(--ease) infinite;
}
@keyframes breathe { 0%,100% { transform: scale(0.82); opacity: 0.45; } 50% { transform: scale(1.12); opacity: 1; } }
.stagearea__img {
  position: relative; z-index: 2;
  width: 100%; height: 100%; max-height: min(62vh, 660px);
  object-fit: contain; display: block; animation: fadeUp 0.45s var(--ease);
}
@keyframes fadeUp { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

/* Cosmic background — subtle, alive while generating */
.cosmos { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.cosmos__stars {
  position: absolute; inset: -50%;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, rgba(200,190,255,0.6), transparent),
    radial-gradient(1px 1px at 85% 20%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 15% 70%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1.5px 1.5px at 60% 15%, rgba(180,200,255,0.55), transparent);
  background-size: 260px 260px; opacity: 0.5;
  animation: drift 60s linear infinite, twinkle 5s var(--ease) infinite;
}
.cosmos__nebula {
  position: absolute; width: 90%; height: 90%; border-radius: 50%;
  filter: blur(60px); opacity: 0.22; mix-blend-mode: screen;
}
.cosmos__nebula--a { top: -30%; left: -10%; background: radial-gradient(circle, #7c5cff, transparent 65%); animation: float1 22s var(--ease) infinite; }
.cosmos__nebula--b { bottom: -30%; right: -10%; background: radial-gradient(circle, #2a6bff, transparent 65%); animation: float2 26s var(--ease) infinite; }
@keyframes drift { to { transform: translate(-130px, -90px); } }
@keyframes twinkle { 0%,100% { opacity: 0.4; } 50% { opacity: 0.65; } }
@keyframes float1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(12%, 10%) scale(1.15); } }
@keyframes float2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-12%, -8%) scale(1.1); } }
/* While generating, wake the cosmos up */
.stagearea--busy .cosmos__stars { opacity: 0.85; animation-duration: 30s, 3s; }
.stagearea--busy .cosmos__nebula { opacity: 0.4; }

.progress {
  position: absolute; inset: auto 0 0 0; z-index: 3; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(0deg, rgba(9,9,11,0.94), transparent);
}
.progress__bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress__bar span {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s var(--ease);
}
.progress__label { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Gallery tab ─────────────────────────────────────────────────────── */
.gallery-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.gallery-item {
  aspect-ratio: 1/1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line);
  background: var(--bg-2); cursor: pointer; padding: 0;
  transition: border-color 0.18s var(--ease), transform 0.2s var(--spring);
}
.gallery-item:hover { border-color: var(--accent); transform: translateY(-3px); }
.gallery-item img, .gallery-item video { width: 100%; height: 100%; object-fit: cover; display: block; }

.field__hint { text-transform: none; letter-spacing: 0; font-weight: 450; color: var(--text-mute); font-size: 11px; }

/* ── Run bar ─────────────────────────────────────────────────────────── */
.runbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 10px;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(9,9,11,0.82);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.runbar__btn {
  flex: 1; height: 52px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-size: 16px; font-weight: 650; letter-spacing: -0.01em;
  box-shadow: 0 6px 24px rgba(124,92,255,0.4);
  transition: transform 0.18s var(--spring), box-shadow 0.2s var(--ease), opacity 0.2s var(--ease);
}
.runbar__btn:hover { box-shadow: 0 8px 32px rgba(124,92,255,0.55); }
.runbar__btn:active { transform: scale(0.97); }
.runbar__btn:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.runbar__btn--ghost {
  flex: 0 0 auto; padding: 0 22px;
  background: transparent; border: 1px solid var(--danger); color: var(--danger); box-shadow: none;
}
.runbar__btn--busy .runbar__label { opacity: 0; }
.runbar__btn--busy::after {
  content: ""; position: absolute; width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.runbar__btn { position: relative; display: grid; place-items: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty / toast ───────────────────────────────────────────────────── */
.empty { text-align: center; padding: 60px 20px; color: var(--text-mute); }

/* ── Login gate ──────────────────────────────────────────────────────── */
.login-gate {
  position: fixed; inset: 0; z-index: 9998;
  display: grid; place-items: center; padding: 24px;
  background: rgba(9,9,11,0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: viewIn 0.25s var(--ease);
}
.login-card {
  width: min(340px, 100%); display: flex; flex-direction: column; gap: 12px;
  padding: 28px 24px; border-radius: var(--radius); text-align: center;
  border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow);
}
.login-card__logo { font-size: 30px; color: var(--accent-2); filter: drop-shadow(0 0 14px rgba(124,92,255,0.6)); }
.login-card__title { margin: 0; font-size: 20px; font-weight: 680; letter-spacing: -0.01em; }
.login-card__sub { margin: 0 0 6px; color: var(--text-dim); font-size: 13px; }
.login-card input {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--text); padding: 12px 13px; font-size: 15px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,0.18); }
.login-card__btn {
  margin-top: 4px; height: 46px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  font-size: 15px; font-weight: 650; box-shadow: 0 6px 20px rgba(124,92,255,0.4);
  transition: transform 0.18s var(--spring), box-shadow 0.2s var(--ease), opacity 0.2s var(--ease);
}
.login-card__btn:hover { box-shadow: 0 8px 28px rgba(124,92,255,0.55); }
.login-card__btn:active { transform: scale(0.97); }
.login-card__btn:disabled { opacity: 0.6; }
.login-card__error { min-height: 16px; color: var(--danger); font-size: 12px; }

.toast-host { position: fixed; left: 50%; bottom: calc(var(--runbar-h) + 16px); transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 550;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  box-shadow: var(--shadow); animation: toastIn 0.28s var(--spring);
}
.toast--success { border-color: var(--ok); }
.toast--error { border-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   iOS 26 · Liquid Glass — SD refinements (restrained)
   The Create/Gallery tabs become a true segmented control on a glass track.
   No cross-page dock — the topbar brand is "home".
   ═══════════════════════════════════════════════════════════════════════════ */
.studio-tabs {
  gap: 2px;
  padding: 3px;
  margin: 14px auto 0;
  width: max-content;
  min-width: min(320px, 90vw);
  background: rgba(22, 22, 30, 0.62);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.stab {
  height: 36px;
  padding: 0 20px;
  border-radius: 999px;
}
.stab:hover { background: rgba(255,255,255,0.04); }
.stab--on {
  background: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.14);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Aurora pass (2026-07-17) — near-black canvas + fixed ambient violet aurora,
   glass panels/cards/login, oversized light hero titles. Keeps SD's cosmos
   stage and purple accent. Appended last so it wins by source order.
   See HELIX_AURORA_REDESIGN.md (reference: Freya).
   ═══════════════════════════════════════════════════════════════════════════ */
/* Canvas + aurora + tokens now come from the shared /assets/css/aurora.css
   (linked before this file). Let the aurora bleed through the shell. */
.stage { position: relative; z-index: 1; }
.topbar { background: var(--glass-strong); border-bottom-color: var(--glass-border); }

/* Oversized, lighter hero title on the workflow picker */
.view__title {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.04;
  text-wrap: balance;
}
.view__sub { text-wrap: pretty; }

/* Search + workflow cards → glass so the aurora subtly shows through */
.wf-search { background: var(--glass); border-color: var(--glass-border);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.wf-card {
  background: var(--glass); border-color: var(--glass-border);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
}

/* Control panels → translucent glass instead of opaque surface */
.panel {
  background: var(--glass);
  border-color: var(--glass-border);
  border-radius: var(--radius-2xl);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
}

/* Unselected chips → glassy pills */
.chip { background: var(--glass); border-color: var(--glass-border); }

/* Run bar → align with the glass system */
.runbar { background: var(--glass-strong); border-top-color: var(--glass-border); }

/* Login gate → transparent-ish overlay (aurora shows through) + glass card,
   light heading */
.login-gate { background: rgba(5,5,7,0.55); }
.login-card {
  background: var(--glass-strong);
  border-color: var(--glass-border);
  border-radius: var(--radius-2xl);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  backdrop-filter: blur(28px) saturate(1.4);
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
  padding: 40px 34px;
}
.login-card__title { font-weight: 300; font-size: clamp(1.7rem, 5vw, 2.1rem); letter-spacing: -0.03em; }

/* Mobile: aurora ::before is fixed (exempt), but clip horizontal overflow.
   Use `clip` (not `hidden`): on an auto-height body that IS the scroller, iOS
   Safari treats `overflow-x: hidden` as a scroll container and locks vertical
   scrolling. `clip` avoids that while still preventing sideways drift. */
@media (max-width: 768px) {
  html, body { overflow-x: clip; }
}
