:root {
  color-scheme: dark;
  --bg: #05060A;
  --bg-2: #0D0D0D;
  --glass: rgba(13, 13, 13, .66);
  --glass-strong: rgba(13, 13, 13, .84);
  --glass-soft: rgba(255, 255, 255, .055);
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #F7F8FF;
  --muted: #A8AEC5;
  --muted-2: #747B94;
  --accent: #FF4D1C;
  --accent-2: #FFB86B;
  --aqua: #FFB86B;
  --violet: #FF6B35;
  --good: #57e59d;
  --warn: #FFB86B;
  --bad: #ff6b7a;
  --shadow: 0 24px 90px rgba(0, 0, 0, .48);
  --inset-glow: inset 0 1px 0 rgba(255,255,255,.13), inset 0 -1px 0 rgba(255,255,255,.04);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 8%, rgba(255,77,28,.32), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(255,184,107,.18), transparent 30%),
    radial-gradient(circle at 55% 92%, rgba(255,107,53,.17), transparent 32%),
    linear-gradient(145deg, #07080d 0%, #0a0d16 50%, #05060a 100%);
  overflow: hidden;
}
body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(34px);
  opacity: .5;
  animation: liquidFloat 18s ease-in-out infinite alternate;
}
body::before {
  width: 420px; height: 420px; left: -120px; top: 12vh;
  background: radial-gradient(circle, rgba(255,77,28,.32), transparent 62%);
}
body::after {
  width: 520px; height: 520px; right: -170px; bottom: -150px;
  background: radial-gradient(circle, rgba(255,184,107,.22), transparent 63%);
  animation-delay: -6s;
}

@keyframes liquidFloat {
  0% { transform: translate3d(0,0,0) scale(1) rotate(0deg); border-radius: 47% 53% 58% 42%; }
  50% { transform: translate3d(24px,-16px,0) scale(1.06) rotate(7deg); border-radius: 62% 38% 45% 55%; }
  100% { transform: translate3d(-12px,18px,0) scale(.98) rotate(-4deg); border-radius: 44% 56% 38% 62%; }
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(12px) scale(.975); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes softPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255,196,119,0), var(--shadow); }
  50% { box-shadow: 0 0 34px rgba(255,196,119,.10), var(--shadow); }
}
@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}
@keyframes orbBreathe {
  0%, 100% { transform: translate(-50%, -50%) scale(.72); opacity: .72; }
  48% { transform: translate(-50%, -50%) scale(1.16); opacity: 1; }
}
@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(.55); opacity: .42; }
  38% { transform: scale(1); opacity: 1; }
}
@keyframes loadingSweep {
  0% { transform: translateX(-115%) scaleX(.34); }
  48% { transform: translateX(12%) scaleX(.72); }
  100% { transform: translateX(125%) scaleX(.36); }
}
@keyframes subtleShimmer {
  0%, 100% { opacity: .72; filter: saturate(1); }
  50% { opacity: 1; filter: saturate(1.18); }
}

button, input, textarea, select { font: inherit; }
button {
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 12px 17px;
  font-weight: 750;
  letter-spacing: -.01em;
  color: var(--text);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), filter .18s ease, opacity .18s ease, border-color .18s ease;
}
button:hover:not(:disabled) { transform: translateY(-2px) scale(1.01); filter: brightness(1.06); }
button:active:not(:disabled) { transform: translateY(0) scale(.985); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary {
  background: linear-gradient(135deg, #FF4D1C 0%, #FF6B35 52%, #FFB86B 125%);
  box-shadow: 0 16px 42px rgba(255,77,28,.24), inset 0 1px 0 rgba(255,255,255,.25);
}
.secondary {
  background: linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.045));
  border: 1px solid var(--line-strong);
  box-shadow: var(--inset-glow);
}
.ghost { background: rgba(255,255,255,.035); border: 1px solid var(--line); color: var(--muted); }
.nav-link { display: block; text-align: center; text-decoration: none; border-radius: 999px; padding: 12px 16px; font-weight: 800; color: var(--text); }
.nav-button { display: block; text-align: center; }
.full { width: 100%; margin-top: 10px; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.055);
  color: var(--text);
  border-radius: 20px;
  padding: 14px 15px;
  outline: none;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input::placeholder, textarea::placeholder { color: rgba(154,167,189,.72); }
.file-picker {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.055);
  color: var(--text);
  border-radius: 18px;
  padding: 10px 12px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease;
}
.file-picker:hover { transform: translateY(-1px); border-color: rgba(255,184,107,.36); background: rgba(255,255,255,.075); }
.file-picker input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.file-picker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; color: var(--muted); }
input:focus, textarea:focus, select:focus {
  border-color: rgba(255,184,107,.52);
  background: rgba(255,255,255,.075);
  box-shadow: 0 0 0 4px rgba(255,184,107,.08), inset 0 1px 0 rgba(255,255,255,.10);
}
.mode-select-shell {
  position: relative;
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,77,28,.16), transparent 36%),
    radial-gradient(circle at 88% 20%, rgba(255,184,107,.13), transparent 38%),
    linear-gradient(145deg, rgba(255,255,255,.095), rgba(255,255,255,.038));
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 16px 36px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.10);
  overflow: hidden;
}
.mode-select-shell::after {
  content: "⌄";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-54%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: rgba(247,248,248,.92);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
  pointer-events: none;
}
.mode-select-shell:focus-within {
  border-color: rgba(255,184,107,.52);
  box-shadow: 0 0 0 4px rgba(255,184,107,.08), 0 18px 42px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.12);
}
.mode-select-shell.is-manual {
  background:
    radial-gradient(circle at 15% 0%, rgba(255,184,107,.16), transparent 38%),
    radial-gradient(circle at 86% 18%, rgba(255,107,53,.18), transparent 40%),
    linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
}
select.mode-select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  padding-right: 52px;
  border-radius: 22px;
  box-shadow: none;
  color: var(--text);
  font-weight: 750;
}
select.mode-select:focus {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
select option,
select optgroup {
  background: #11100f;
  color: #F7F8FF;
}
select option:checked { background: #23120a; color: #ffffff; }
.mode-help {
  margin: -4px 2px 2px;
  padding: 10px 12px;
  border-radius: 16px;
  color: rgba(226,232,242,.78);
  font-size: 12px;
  line-height: 1.42;
  background:
    linear-gradient(145deg, rgba(255,184,107,.075), rgba(255,77,28,.045)),
    rgba(255,255,255,.032);
  border: 1px solid rgba(255,255,255,.075);
}
.field-label { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .06em; margin-bottom: -6px; text-transform: uppercase; }
.field-help { color: rgba(208,214,224,.66); font-size: 12px; line-height: 1.35; margin-top: -6px; }
.voice-over-panel {
  display: grid;
  gap: 10px;
  padding: 13px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 9% 0%, rgba(255,184,107,.12), transparent 34%),
    radial-gradient(circle at 92% 15%, rgba(255,77,28,.11), transparent 36%),
    linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.032));
  border: 1px solid rgba(255,255,255,.105);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 14px 42px rgba(0,0,0,.16);
}
.voice-over-panel.has-voice { border-color: rgba(255,184,107,.24); }
.voice-over-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.voice-over-heading .field-help { margin: 6px 0 0; }
.voice-over-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: rgba(245,248,255,.84);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.10);
}
.voice-mode-shell { border-radius: 18px; }
.voice-mode-shell .mode-select { border-radius: 18px; }
.voice-over-panel textarea { min-height: 84px; }
.voice-reference-dropzone { min-height: 86px; }
.duration-stepper {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 9px;
  align-items: stretch;
}
.duration-arrow {
  border-radius: 17px;
  min-height: 50px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.035));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09);
}
.duration-input-shell {
  position: relative;
  display: flex;
  align-items: center;
}
.duration-input-shell input {
  padding-right: 98px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
}
.duration-input-shell span {
  position: absolute;
  right: 16px;
  color: rgba(208,214,224,.72);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  pointer-events: none;
}
.duration-slider {
  --duration-fill: 1.7%;
  width: 100%;
  height: 34px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
  cursor: pointer;
  accent-color: var(--aqua);
}
.duration-slider::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,184,107,.85) 0 var(--duration-fill), rgba(255,255,255,.10) var(--duration-fill) 100%);
  border: 1px solid rgba(255,184,107,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}
.duration-slider::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-2), var(--aqua));
  border: 2px solid rgba(255,255,255,.70);
  box-shadow: 0 8px 24px rgba(255,184,107,.25);
}
.duration-slider::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,184,107,.16);
}
.duration-slider::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,184,107,.85);
}
.duration-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-2), var(--aqua));
  border: 2px solid rgba(255,255,255,.70);
  box-shadow: 0 8px 24px rgba(255,184,107,.25);
}
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(460px, 1fr) 350px;
  gap: 18px;
  padding: 18px;
}
.sidebar, .artifacts { display: flex; flex-direction: column; gap: 14px; min-height: 0; }

.brand, .panel, .main, .empty-card, .message, .session-item, .artifact, .event {
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
}
.brand {
  display: flex; gap: 12px; align-items: center;
  padding: 17px 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.115), rgba(255,255,255,.045));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow), var(--inset-glow);
  animation: bubbleIn .38s ease both;
}
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: radial-gradient(circle at 28% 20%, #fff1, transparent 25%), linear-gradient(135deg, var(--accent), var(--accent-2), var(--aqua));
  border-radius: 17px 20px 16px 22px;
  font-size: 25px;
  box-shadow: 0 14px 34px rgba(255,77,28,.20), inset 0 1px 0 rgba(255,255,255,.28);
}
.brand-logo-stack {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}
.tuus-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: max-content;
  max-width: 100%;
  color: var(--text);
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}
.tuus-wordmark > span {
  color: var(--accent);
  font-weight: 850;
}
.tuus-wordmark > i {
  width: 8px;
  height: 8px;
  margin-left: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: tuusLogoPulse 2.5s ease-in-out infinite;
}
@keyframes tuusLogoPulse {
  0%, 100% { box-shadow: 0 0 6px var(--accent); }
  50% { box-shadow: 0 0 16px var(--accent), 0 0 30px rgba(255,77,28,.40); }
}
.brand h1 { font-size: 18px; letter-spacing: -.03em; }
.brand p { color: var(--muted); font-size: 12px; margin-top: 2px; }

.panel {
  background: linear-gradient(160deg, rgba(255,255,255,.085), rgba(255,255,255,.035));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 16px;
  box-shadow: var(--shadow), var(--inset-glow);
  animation: bubbleIn .36s ease both;
}
.panel.compact { padding: 14px; }
.liquid-card { position: relative; overflow: hidden; }
.liquid-card::before, .panel::before, .empty-card::before {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.14), transparent 34%, rgba(255,184,107,.06) 72%, transparent);
  opacity: .75;
}
.panel-title {
  position: relative;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,196,119,.92);
  margin-bottom: 11px;
}

.list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow: auto; padding-right: 2px; }
.list::-webkit-scrollbar, .messages::-webkit-scrollbar, .artifact-list::-webkit-scrollbar, .events::-webkit-scrollbar { width: 7px; }
.list::-webkit-scrollbar-thumb, .messages::-webkit-scrollbar-thumb, .artifact-list::-webkit-scrollbar-thumb, .events::-webkit-scrollbar-thumb { background: rgba(255,255,255,.13); border-radius: 999px; }
.session-item {
  text-align: left; width: 100%; padding: 13px 14px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.032));
  border: 1px solid transparent;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.session-item.active {
  border-color: rgba(255,184,107,.42);
  background: linear-gradient(135deg, rgba(255,184,107,.14), rgba(255,77,28,.075));
}
.session-item small { display:block; color: var(--muted); margin-top: 5px; line-height: 1.35; }

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,.070), rgba(255,255,255,.028));
  border: 1px solid var(--line);
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow), var(--inset-glow);
}
.topbar {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 19px 23px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
}
.topbar h2 { letter-spacing: -.04em; font-size: 22px; }
.topbar p { margin-top: 4px; }
.status-pill {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 850;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(143,155,178,.14);
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.08);
}
.status-pill.ok { background: rgba(87,229,157,.13); color: var(--good); border-color: rgba(87,229,157,.24); }

.empty { flex: 1; display: grid; place-items: center; padding: 24px; }
.empty-card {
  position: relative;
  overflow: hidden;
  width: min(760px, 100%);
  padding: 36px;
  background: linear-gradient(155deg, rgba(255,255,255,.105), rgba(255,255,255,.045));
  border: 1px solid var(--line);
  border-radius: 36px;
  box-shadow: var(--shadow), var(--inset-glow);
  animation: bubbleIn .42s ease both, softPulse 7s ease-in-out infinite;
}
.empty-card h2 { position: relative; font-size: clamp(30px, 4vw, 48px); line-height: 1.02; letter-spacing: -.065em; margin-bottom: 12px; }
.empty-card p { position: relative; color: var(--muted); line-height: 1.6; margin-bottom: 24px; max-width: 620px; }
.idea-form { position: relative; display: grid; gap: 12px; }
.creation-intent-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.generation-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.intent-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 10px;
  align-items: start;
  padding: 12px 13px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  cursor: pointer;
}
.intent-card input { width: auto; margin-top: 2px; accent-color: #FFB86B; }
.intent-card strong { color: var(--text); font-size: 13px; letter-spacing: -.01em; }
.intent-card span { grid-column: 2; color: rgba(154,167,189,.95); font-size: 12px; line-height: 1.35; }
.generation-mode-card { min-height: 78px; }
.generation-mode-card strong { font-size: 12px; }
.generation-mode-card span { font-size: 11px; }
.intent-card:has(input:checked) { border-color: rgba(255,184,107,.42); background: linear-gradient(145deg, rgba(255,184,107,.14), rgba(255,107,53,.07)); }

.personal-mode-panel {
  display: grid;
  gap: 10px;
  padding: 14px 14px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,184,107,.22);
  background: linear-gradient(160deg, rgba(255,184,107,.08), rgba(255,107,53,.04));
  margin-top: 2px;
}
.personal-mode-panel.hidden { display: none; }
.personal-mode-label { margin: 0; }
.person-source-options { display: grid; gap: 8px; }
.person-source-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  cursor: pointer;
}
.person-source-card input { width: auto; margin-top: 2px; accent-color: #FFB86B; }
.person-source-meta { grid-column: 2; display: grid; gap: 2px; }
.person-source-card strong { color: var(--text); font-size: 12px; letter-spacing: -.01em; }
.person-source-card span { color: rgba(154,167,189,.95); font-size: 11px; line-height: 1.35; }
.person-source-card:has(input:checked) { border-color: rgba(255,184,107,.45); background: linear-gradient(145deg, rgba(255,184,107,.16), rgba(255,107,53,.07)); }

.person-subpanel { padding: 4px 4px 6px 28px; display: grid; gap: 8px; }
.person-subpanel.hidden { display: none; }

.person-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 2px;
}
.person-library-status { font-size: 11px; margin: 0; padding: 8px 4px; grid-column: 1 / -1; }
.person-library-empty-cta {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255,184,107,.35);
  background: rgba(255,184,107,.06);
  text-align: center;
}
.person-library-empty-cta a { color: #FFB86B; text-decoration: none; font-weight: 600; }
.person-library-empty-cta a:hover { text-decoration: underline; }

.person-library-card {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.08);
  cursor: pointer;
  aspect-ratio: 1 / 1;
  background: rgba(0,0,0,.25);
  transition: border-color .18s ease, transform .12s ease;
}
.person-library-card input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.person-library-card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.person-library-card-title {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 4px 6px;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(0deg, rgba(0,0,0,.85), rgba(0,0,0,.0));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.person-library-card:hover { transform: translateY(-1px); }
.person-library-card:has(input:checked) {
  border-color: #FFB86B;
  box-shadow: 0 0 0 2px rgba(255,184,107,.25);
}

.person-sex-row { display: flex; gap: 8px; flex-wrap: wrap; }
.person-sex-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  font-size: 12px; color: var(--muted);
  cursor: pointer;
}
.person-sex-pill input { width: auto; accent-color: #FFB86B; }
.person-sex-pill:has(input:checked) {
  border-color: rgba(255,184,107,.45);
  background: rgba(255,184,107,.12);
  color: var(--text);
}

#personDescribeInput {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
}
#personDescribeInput:focus {
  outline: none;
  border-color: rgba(255,184,107,.45);
  background: rgba(255,184,107,.06);
}
.micro { font-size: 11px; line-height: 1.4; margin: 0; }
.personal-mode-validation {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,107,53,.10);
  border: 1px solid rgba(255,107,53,.35);
  color: rgba(255,210,180,.95);
}
.personal-mode-validation.hidden { display: none; }
.personal-mode-validation a { color: #FFB86B; text-decoration: underline; }

/* === Wizard onboarding fullscreen ====================================== */
.create-wizard {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
}
.create-wizard.hidden { display: none; }
.wizard-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(80vh at 50% -10%, rgba(255,184,107,.10), transparent 60%), rgba(8,10,18,.86);
  backdrop-filter: blur(10px);
}
.wizard-shell {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(circle at 20% 0%, rgba(255,184,107,.14), transparent 34%),
    radial-gradient(circle at 82% 8%, rgba(255,77,28,.14), transparent 32%),
    linear-gradient(160deg, rgba(22,28,42,.94), rgba(10,14,22,.92));
  box-shadow: 0 34px 120px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.06);
  animation: wizardBubbleIn .28s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes wizardBubbleIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.wizard-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.wizard-progress { display: grid; gap: 6px; }
.wizard-step-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.wizard-step-counter strong { color: var(--text); letter-spacing: .02em; }
.wizard-step-percent { color: rgba(255,184,107,.95); font-weight: 600; }
.wizard-progress-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.wizard-progress-fill {
  height: 100%;
  width: 17%;
  background: linear-gradient(90deg, #FFB86B, #FF6B35);
  border-radius: 999px;
  transition: width .35s cubic-bezier(.4,.0,.2,1);
}

.wizard-form {
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}
.wizard-step {
  padding: 22px 22px 8px;
  overflow-y: auto;
  display: grid;
  gap: 16px;
  align-content: start;
  animation: wizardFadeIn .25s ease;
}
.wizard-step.hidden { display: none; }

.wizard-path-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.wizard-path-card {
  position: relative;
  display: block;
  cursor: pointer;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(150deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  padding: 18px 18px 16px;
  transition: border-color .18s ease, transform .14s ease, box-shadow .18s ease;
}
.wizard-path-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.wizard-path-meta { display: grid; gap: 6px; }
.wizard-path-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 4px;
}
.wizard-path-card strong {
  color: var(--text);
  font-size: 14px;
  letter-spacing: -.01em;
}
.wizard-path-card span {
  color: rgba(154,167,189,.95);
  font-size: 12.5px;
  line-height: 1.45;
}
.wizard-path-stats {
  margin-top: 6px;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,184,107,.08);
  color: rgba(255,184,107,.95);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  width: max-content;
}
.wizard-path-card:hover { transform: translateY(-1px); }
.wizard-path-card:has(input:checked) {
  border-color: rgba(255,184,107,.5);
  background: linear-gradient(150deg, rgba(255,184,107,.16), rgba(255,107,53,.06));
  box-shadow: 0 0 0 2px rgba(255,184,107,.16);
}

@keyframes wizardFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wizard-step-header { display: grid; gap: 8px; }
.wizard-step-header h2 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: -.015em;
  line-height: 1.2;
}
.wizard-step-tip {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}
.wizard-step-tip strong { color: var(--text); }
.wizard-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  width: max-content;
}
.wizard-kicker-required {
  color: #FF8A65;
  background: rgba(255,138,101,.10);
}
.wizard-kicker-defaults {
  color: #B5D4FF;
  background: rgba(181,212,255,.08);
}
.wizard-kicker-optional {
  color: rgba(184,214,184,.95);
  background: rgba(184,214,184,.08);
}

.wizard-step-body { display: grid; gap: 12px; }
.wizard-step-body .field-label { margin-top: 4px; }
.wizard-step-body label.field-label:first-of-type { margin-top: 0; }

.required-mark {
  color: #FF8A65;
  font-weight: 700;
  margin-left: 4px;
}
.optional-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(184,214,184,.95);
  background: rgba(184,214,184,.08);
  border: 1px solid rgba(184,214,184,.22);
  border-radius: 999px;
  vertical-align: middle;
}

.wizard-summary {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,184,107,.22);
  background: linear-gradient(140deg, rgba(255,184,107,.08), rgba(255,107,53,.04));
  font-size: 12.5px;
  color: rgba(245,248,255,.92);
}
.wizard-summary strong { color: var(--text); }
.wizard-summary-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  align-items: baseline;
}
.wizard-summary-row > span:first-child {
  color: rgba(255,184,107,.95);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.wizard-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(255,255,255,.06);
  background: linear-gradient(0deg, rgba(0,0,0,.18), transparent);
}
.wizard-nav-spacer { flex: 1; }
.wizard-nav .ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 13px;
  cursor: pointer;
}
.wizard-nav .ghost:hover { color: var(--text); border-color: rgba(255,255,255,.32); }
.wizard-nav .primary {
  padding: 10px 22px;
  border-radius: 14px;
  font-size: 14px;
}
.wizard-nav .primary[disabled] { opacity: .45; cursor: not-allowed; }

@media (max-width: 640px) {
  .create-wizard { padding: 0; }
  .wizard-shell {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .wizard-step { padding: 18px 16px 8px; }
  .wizard-nav { padding: 12px 16px 14px; }
}

.person-pick-modal {
  position: fixed; inset: 0;
  z-index: 1200;
  display: grid; place-items: center;
}
.person-pick-modal.hidden { display: none; }
.person-pick-backdrop {
  position: absolute; inset: 0;
  background: rgba(8,10,18,.72);
  backdrop-filter: blur(8px);
}
.person-pick-sheet {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 22px 24px 18px;
  border-radius: 24px;
  display: grid; gap: 14px;
}
.person-pick-header {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  align-items: start;
}
.person-pick-header h3 {
  margin: 4px 0 0;
  font-size: 18px; letter-spacing: -.01em;
}
.person-pick-header p {
  margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4;
}
.person-pick-loading {
  display: grid; gap: 14px; place-items: center;
  padding: 32px 12px;
  text-align: center;
}
.person-pick-loading.hidden { display: none; }
.person-pick-loading p { color: var(--muted); font-size: 13px; margin: 0; max-width: 360px; }
.person-pick-spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(255,184,107,.18);
  border-top-color: #FFB86B;
  border-radius: 50%;
  animation: personPickSpin 1s linear infinite;
}
@keyframes personPickSpin { to { transform: rotate(360deg); } }

.person-pick-candidates {
  display: grid;
  gap: 8px;
}
.person-pick-candidates.hidden { display: none; }
.person-pick-sheet-result {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(255,184,107,.42);
  background: rgba(0,0,0,.25);
  box-shadow: 0 0 0 2px rgba(255,184,107,.18), 0 12px 36px rgba(255,107,53,.18);
}
.person-pick-sheet-result img {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.person-pick-sheet-caption {
  margin: 0;
  padding: 8px 12px;
  font-size: 12px;
  color: rgba(245,248,255,.92);
  background: linear-gradient(135deg, rgba(255,184,107,.16), rgba(255,107,53,.07));
  border-top: 1px solid rgba(255,184,107,.22);
}

.person-pick-error {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,77,77,.10);
  border: 1px solid rgba(255,77,77,.35);
  color: rgba(255,210,210,.95);
  font-size: 13px;
  line-height: 1.45;
}
.person-pick-error.hidden { display: none; }

.person-pick-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}
.person-pick-actions .ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
}
.person-pick-actions .ghost:hover { color: var(--text); border-color: rgba(255,255,255,.32); }
.person-pick-actions .primary[disabled] {
  opacity: .45; cursor: not-allowed;
}
.idea-hint {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border-radius: 22px;
  border: 1px solid rgba(255,184,107,.18);
  background: linear-gradient(135deg, rgba(255,184,107,.10), rgba(255,107,53,.07), rgba(255,77,28,.055));
  color: rgba(245,248,255,.94);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.idea-hint strong { font-size: 14px; letter-spacing: -.01em; }
.idea-hint span { color: rgba(154,167,189,.95); font-size: 13px; line-height: 1.45; }
.checkbox { color: var(--muted); display: flex; gap: 10px; align-items: center; }
.checkbox input { width: auto; }

.workspace-tools { margin: 16px 22px 0; }
.mini-form { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; margin-bottom: 10px; align-items: center; }
.manual-draft-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; align-items: stretch; }
.mini-form input, .mini-form select { border-radius: 18px; padding: 10px 12px; }
.mini-form button { padding: 10px 14px; }
.mini-form.drag-over { border: 1px dashed rgba(255,184,107,.62); border-radius: 24px; padding: 10px; background: rgba(255,184,107,.08); }

.workspace { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.messages { flex: 1; overflow: auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.message {
  position: relative;
  max-width: min(82%, 760px);
  border: 1px solid rgba(255,255,255,.105);
  border-radius: 28px;
  padding: 15px 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.095), rgba(255,255,255,.040));
  box-shadow: 0 14px 40px rgba(0,0,0,.22), var(--inset-glow);
  animation: bubbleIn .22s cubic-bezier(.2,.8,.2,1) both;
}
.message::after {
  content: "";
  position: absolute;
  bottom: 10px;
  width: 16px; height: 16px;
  background: inherit;
  border: inherit;
  transform: rotate(45deg);
  z-index: -1;
}
.message.user {
  margin-left: auto;
  background: linear-gradient(145deg, rgba(255,77,28,.22), rgba(255,107,53,.10));
  border-color: rgba(255,77,28,.24);
  border-bottom-right-radius: 12px;
}
.message.user::after { right: -4px; border-left: 0; border-bottom: 0; }
.message.assistant {
  margin-right: auto;
  background: linear-gradient(145deg, rgba(255,184,107,.105), rgba(255,255,255,.052));
  border-bottom-left-radius: 12px;
}
.message.assistant::after { left: -4px; border-right: 0; border-top: 0; }
.message-header { color: rgba(255,196,119,.95); font-size: 11px; font-weight: 850; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .10em; }
.message-body { white-space: pre-wrap; line-height: 1.55; color: rgba(245,248,255,.96); }
.campaign-idea-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.campaign-idea-card {
  display: grid;
  gap: 7px;
  padding: 13px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,184,107,.16), transparent 40%),
    linear-gradient(145deg, rgba(255,255,255,.095), rgba(255,255,255,.035));
  border: 1px solid rgba(255,184,107,.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 12px 28px rgba(0,0,0,.16);
}
.campaign-idea-eyebrow {
  color: rgba(255,184,107,.82);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.campaign-idea-card strong { color: rgba(255,255,255,.96); font-size: 14px; letter-spacing: -.01em; }
.campaign-idea-card p { margin: 0; color: rgba(245,248,255,.86); line-height: 1.45; }
.campaign-idea-card small { color: rgba(154,167,189,.96); line-height: 1.35; }
.campaign-idea-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 3px;
}
.campaign-idea-actions .secondary,
.campaign-idea-actions .primary { padding: 9px 12px; min-height: 34px; font-size: 12px; }
.campaign-idea-actions-all {
  justify-content: flex-end;
  padding-top: 2px;
}
.confirmation-message {
  border-color: rgba(255,196,119,.38) !important;
  box-shadow: 0 18px 54px rgba(255,196,119,.12), 0 14px 40px rgba(0,0,0,.22), var(--inset-glow);
}
.confirmation-popup {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  margin-top: 14px;
  padding: 13px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255,196,119,.22), transparent 38%),
    radial-gradient(circle at 88% 18%, rgba(255,184,107,.14), transparent 40%),
    linear-gradient(145deg, rgba(255,255,255,.115), rgba(255,255,255,.045));
  border: 1px solid rgba(255,196,119,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 16px 38px rgba(0,0,0,.18);
}
.confirmation-popup-copy { display: grid; gap: 4px; min-width: 0; }
.confirmation-popup-copy strong { color: #fff2cf; font-size: 12px; letter-spacing: .08em; }
.confirmation-popup-copy span { color: rgba(226,232,242,.76); font-size: 12px; line-height: 1.35; }
.confirmation-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.confirmation-popup-btn {
  white-space: nowrap;
  background: linear-gradient(135deg, #ffc477 0%, #FF4D1C 54%, #FFB86B 130%);
  flex: 1 1 200px;
  min-width: 0;
}
.confirmation-popup-btn-modify,
.confirmation-popup-btn-cancel {
  white-space: nowrap;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  color: var(--muted);
  letter-spacing: -.01em;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s cubic-bezier(.2,.8,.2,1);
}
.confirmation-popup-btn-modify:hover:not(:disabled) {
  background: rgba(255,255,255,.08);
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-1px);
}
.confirmation-popup-btn-cancel {
  border-color: rgba(255,107,53,.32);
  color: rgba(255,107,53,.78);
}
.confirmation-popup-btn-cancel:hover:not(:disabled) {
  border-color: rgba(255,107,53,.7);
  color: rgba(255,107,53,1);
  background: rgba(255,107,53,.07);
  transform: translateY(-1px);
}
.confirmation-popup-btn-modify:disabled,
.confirmation-popup-btn-cancel:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 480px) {
  .confirmation-popup-actions { flex-direction: column; align-items: stretch; }
  .confirmation-popup-actions > * { width: 100%; }
}
@keyframes confirmation-pulse {
  0%   { box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 16px 38px rgba(0,0,0,.18), 0 0 0 0 rgba(255,196,119,.55); }
  50%  { box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 18px 44px rgba(0,0,0,.22), 0 0 0 14px rgba(255,196,119,.0); }
  100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 16px 38px rgba(0,0,0,.18), 0 0 0 0 rgba(255,196,119,0); }
}
.confirmation-popup.is-fresh {
  animation: confirmation-pulse 2s ease-out;
  border-color: rgba(255,196,119,.55);
}
@keyframes render-cta-slide-in {
  from { transform: translateY(110%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes render-cta-glow {
  0%, 100% { box-shadow: 0 -8px 28px rgba(255,196,119,.18), 0 -2px 0 rgba(255,196,119,.32) inset; }
  50%      { box-shadow: 0 -8px 38px rgba(255,196,119,.32), 0 -2px 0 rgba(255,196,119,.6) inset; }
}
.render-cta {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  margin: 8px 0 4px;
  padding: 14px 18px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 6% -10%, rgba(255,196,119,.28), transparent 42%),
    radial-gradient(circle at 92% 0%, rgba(255,184,107,.18), transparent 44%),
    linear-gradient(135deg, rgba(255,196,119,.16), rgba(255,77,28,.10) 56%, rgba(255,184,107,.08));
  border: 1px solid rgba(255,196,119,.42);
  animation: render-cta-slide-in 280ms cubic-bezier(.18,.89,.32,1.28),
             render-cta-glow 2.6s ease-in-out infinite;
}
.render-cta[hidden] { display: none; }
.render-cta-copy { display: grid; gap: 4px; min-width: 0; }
.render-cta-copy strong {
  color: #fff2cf;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.render-cta-copy span {
  color: rgba(226,232,242,.82);
  font-size: 13px;
  line-height: 1.4;
}
.render-cta-btn {
  white-space: nowrap;
  min-height: 48px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffc477 0%, #FF4D1C 54%, #FFB86B 130%);
  transition: transform 160ms ease, filter 160ms ease;
}
.render-cta-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.render-cta-btn:disabled { opacity: .55; cursor: progress; }
.working-message {
  border-color: rgba(255,184,107,.24) !important;
  background: linear-gradient(145deg, rgba(255,184,107,.12), rgba(255,107,53,.055)) !important;
}
.chat-working-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: center;
  min-width: min(430px, 62vw);
}
/* New structure: orb + (eyebrow / live copy / progress strip). */
.chat-working-text {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.chat-working-eyebrow {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,184,107,.78);
  text-shadow: 0 0 18px rgba(255,184,107,.18);
}
.chat-working-copy {
  margin: 0 0 4px;
  font-size: 13.5px;
  line-height: 1.42;
  color: rgba(245,248,255,.94);
  letter-spacing: -.005em;
  min-height: 1.42em;
  transition: opacity .18s ease, transform .18s ease, filter .18s ease;
}
.chat-working-copy.is-fading {
  opacity: 0;
  transform: translateY(2px);
  filter: blur(2.5px);
}
.chat-working-detail {
  margin: -1px 0 2px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(202,214,232,.78);
}
.chat-working-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 1px 0 4px;
}
.chat-working-progress[hidden] { display: none; }
.chat-working-progress-track {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.075);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.16);
}
.chat-working-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255,184,107,.92), rgba(255,107,53,.82), rgba(255,196,119,.86));
  box-shadow: 0 0 18px rgba(255,184,107,.22);
  transition: width .42s cubic-bezier(.22,.8,.24,1);
}
.chat-working-progress-value {
  min-width: 38px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  color: rgba(245,248,255,.9);
}
.chat-working-progress-eta {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(245,248,255,.55);
  white-space: nowrap;
}
.chat-working-progress-eta[hidden] { display: none; }
/* Orb: a soft conic gradient ring rotating around a breathing aqua core.
   Reuses the project's existing accent stops (--aqua, --accent, --accent-2)
   so it reads as a chat-tinted variant of the onboarding orbit, not a new
   visual language. */
.chat-working-orb {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 12px rgba(255,184,107,.18));
}
.chat-working-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: conic-gradient(from 220deg,
    rgba(255,184,107,0)   0deg,
    rgba(255,184,107,.7)  92deg,
    rgba(255,77,28,.62) 200deg,
    rgba(255,196,119,.42) 290deg,
    rgba(255,184,107,0)   360deg);
  -webkit-mask: radial-gradient(circle, transparent 9.5px, #000 10.5px);
          mask: radial-gradient(circle, transparent 9.5px, #000 10.5px);
  animation: orbitSpin 4.6s linear infinite;
  opacity: .92;
}
.chat-working-orb-core {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 32% 30%, #ffffff 0%, var(--aqua) 58%, rgba(255,184,107,.6) 100%);
  box-shadow:
    0 0 14px rgba(255,184,107,.7),
    0 0 28px rgba(255,184,107,.32),
    inset 0 0 5px rgba(255,255,255,.45);
  animation: chatOrbBreathe 1.85s cubic-bezier(.55,.08,.4,1) infinite;
}
@keyframes chatOrbBreathe {
  0%, 100% { transform: scale(.78); opacity: .78; }
  48%      { transform: scale(1.12); opacity: 1; }
}
.chat-loading-line,
.onboarding-loading-line {
  position: relative;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.058);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.12);
}
.chat-loading-line span,
.onboarding-loading-line span {
  position: absolute;
  inset: 0;
  width: 72%;
  border-radius: inherit;
  transform-origin: left center;
  background: linear-gradient(90deg, transparent, rgba(255,184,107,.88), rgba(255,77,28,.82), transparent);
  animation: loadingSweep 1.65s cubic-bezier(.4,0,.2,1) infinite;
}
/* Layered second sweep — slower, thinner, offset — adds a sense of depth so
   the strip reads as a real status indicator instead of a single-bar gif. */
.chat-loading-line span:nth-child(2) {
  width: 46%;
  background: linear-gradient(90deg, transparent, rgba(255,196,119,.42), rgba(255,107,53,.36), transparent);
  filter: blur(.6px);
  opacity: .55;
  animation: loadingSweep 2.7s cubic-bezier(.4,0,.2,1) infinite;
  animation-delay: -.85s;
}

@media (prefers-reduced-motion: reduce) {
  .chat-working-orb-ring,
  .chat-working-orb-core,
  .chat-loading-line span,
  .onboarding-loading-line span { animation: none !important; }
  .chat-working-orb-core { transform: scale(1); opacity: .95; }
  .chat-loading-line span,
  .onboarding-loading-line span {
    transform: translateX(-10%) scaleX(.9);
    opacity: .55;
  }
  .chat-working-copy {
    transition: none;
  }
}
.message-form {
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
}
.message-form textarea { min-height: 56px; max-height: 180px; border-radius: 24px; }

.meta { font-size: 13px; line-height: 1.48; word-break: break-word; color: var(--muted); }
.meta strong { color: var(--text); }
.artifact-list, .events { display: flex; flex-direction: column; gap: 9px; max-height: 48vh; overflow: auto; }
.artifact {
  display: grid; grid-template-columns: 48px 1fr; gap: 11px; align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(255,255,255,.075), rgba(255,255,255,.032));
  border-radius: 22px;
  text-decoration: none;
  color: var(--text);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.artifact:hover { transform: translateY(-2px); border-color: rgba(255,184,107,.34); background: rgba(255,255,255,.075); }
.artifact img, .artifact video { width: 48px; height: 48px; object-fit: cover; border-radius: 16px; background: #05060a; }
.artifact.video-artifact { border-color: rgba(87,229,157,.32); background: rgba(87,229,157,.055); }
.final-badge { display: inline-block !important; width: fit-content; margin: 4px 0 2px; padding: 3px 8px; border-radius: 999px; color: var(--good) !important; background: rgba(87,229,157,.14); font-weight: 850; }
.asset-card { border-left-color: var(--good); }
.artifact small, .event small { color: var(--muted-2); display: block; margin-top: 4px; line-height: 1.35; }
.event {
  padding: 11px 12px;
  border-left: 0;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(160deg, rgba(255,255,255,.070), rgba(255,255,255,.030));
  border-radius: 20px;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
  animation: bubbleIn .22s ease both;
}
.event::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 14px rgba(255,196,119,.5); }
.event.error::before { background: var(--bad); }
.event.info::before { background: var(--aqua); }
.event.completed::before, .event.succeeded::before { background: var(--good); }
@keyframes milestone-spin {
  to { transform: rotate(360deg); }
}
@keyframes milestone-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,184,107,.45); }
  50%      { box-shadow: 0 0 0 8px rgba(255,184,107,0); }
}
.milestones {
  list-style: none;
  margin: 0;
  padding: 4px 2px;
  display: grid;
  gap: 6px;
}
.milestone {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 4px 10px 4px;
  position: relative;
}
.milestone:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 32px;
  bottom: -6px;
  width: 1px;
  background: linear-gradient(to bottom, rgba(255,255,255,.18), rgba(255,255,255,.04));
}
.milestone-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.04);
  color: rgba(226,232,242,.6);
  line-height: 1;
}
.milestone-icon[data-state="pending"] {
  color: rgba(208,214,224,.5);
  border-color: rgba(255,255,255,.12);
}
.milestone-icon[data-state="active"] {
  color: var(--aqua, #FFB86B);
  background: rgba(255,184,107,.14);
  border-color: rgba(255,184,107,.55);
  animation: milestone-pulse 1.6s ease-in-out infinite;
}
.milestone-icon[data-state="done"] {
  color: var(--good, #57e59d);
  background: rgba(87,229,157,.14);
  border-color: rgba(87,229,157,.55);
}
.milestone-icon[data-state="failed"] {
  color: var(--bad, #ff7676);
  background: rgba(255,118,118,.14);
  border-color: rgba(255,118,118,.55);
}
.milestone-content {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.milestone-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(226,232,242,.92);
}
.milestone[data-state="pending"] .milestone-label { color: rgba(208,214,224,.55); }
.milestone[data-state="done"]    .milestone-label { color: rgba(208,214,224,.78); }
.milestone[data-state="failed"]  .milestone-label { color: var(--bad, #ff7676); }
.milestone-detail {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(208,214,224,.65);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.milestone-detail[hidden] { display: none; }
.asset-quick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid rgba(255,184,107,.16);
  border-radius: 16px;
  background: rgba(255,184,107,.060);
  color: var(--muted);
  font-size: 12px;
}
.asset-quick-row span { font-weight: 800; color: rgba(245,248,255,.78); }
.asset-quick-row button {
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,184,107,.28);
  background: rgba(255,184,107,.11);
  color: var(--aqua);
  font-size: 12px;
  font-weight: 900;
  box-shadow: none;
}
.asset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255,255,255,.072), rgba(255,255,255,.030));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
  animation: bubbleIn .22s ease both;
}
.asset-card.invoked {
  border-color: rgba(87,229,157,.36);
  background: linear-gradient(160deg, rgba(87,229,157,.105), rgba(255,255,255,.030));
}
.asset-card strong { font-size: 13px; line-height: 1.2; letter-spacing: -.01em; }
.asset-card small { color: var(--muted-2); display: block; line-height: 1.25; }
.asset-card-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.asset-mention-chip,
.asset-invoked-pill,
.asset-aliases button,
.asset-use-button {
  border: 1px solid rgba(255,184,107,.20);
  background: rgba(255,184,107,.085);
  color: var(--aqua);
  box-shadow: none;
}
.asset-mention-chip {
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .01em;
}
.asset-invoked-pill {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--good);
  background: rgba(87,229,157,.12);
  border-color: rgba(87,229,157,.25);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}
.asset-aliases { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; color: var(--muted-2); font-size: 11px; line-height: 1.25; }
.asset-aliases button { max-width: 46%; padding: 4px 7px; border-radius: 999px; color: var(--muted); font-size: 11px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-use-button { width: 100%; padding: 7px 10px; border-radius: 13px; font-size: 12px; font-weight: 850; color: rgba(245,248,255,.88); background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.10); }
.workspace-tools #assetsList { max-height: 210px; overflow: auto; padding-right: 2px; }
.internal-debug { display: none !important; }

@media (max-width: 1180px) {
  body { overflow: auto; }
  .app-shell { grid-template-columns: 280px 1fr; }
  .artifacts { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
  body { overflow: auto; }
  .app-shell { grid-template-columns: 1fr; padding: 10px; }
  .artifacts { display: flex; }
  .message { max-width: 100%; }
  .message-form, .manual-draft-form, .mini-form { grid-template-columns: 1fr; }
  .empty-card { padding: 24px; }
}


/* Reference-inspired cockpit layout pass */
button, .chat-icon-button { transition: transform .18s cubic-bezier(.2,.8,.2,1), filter .18s ease, opacity .18s ease, border-color .18s ease, background .18s ease; }
.app-shell {
  grid-template-columns: 292px minmax(520px, 1fr) 342px;
  gap: 14px;
  padding: 14px;
}
.sidebar, .artifacts { gap: 12px; }
.brand > div:nth-child(2),
.brand-logo-stack { min-width: 0; flex: 1; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 15px;
  color: rgba(245,248,255,.82);
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: var(--inset-glow);
}
.sidebar-fold { margin-left: auto; color: rgba(245,248,255,.62); font-size: 19px; }
.sessions-panel { flex: 1; min-height: 0; }
.active-project-card { margin-top: auto; }
.list { max-height: 100%; }
.session-item {
  position: relative;
  padding: 14px 16px;
  border-radius: 17px;
}
.session-item.active {
  border-color: rgba(255,77,28,.52);
  background: linear-gradient(135deg, rgba(255,77,28,.16), rgba(255,107,53,.09));
  box-shadow: 0 0 0 1px rgba(255,77,28,.10), 0 18px 45px rgba(255,77,28,.08), inset 0 1px 0 rgba(255,255,255,.08);
}
.session-item.active::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(255,77,28,.75);
}
.main { border-radius: 18px; }
.topbar {
  padding: 20px 22px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.workspace-tools { margin: 14px 18px 0; border-radius: 18px; padding: 16px; }
.panel-title-with-icon { display: flex; align-items: center; gap: 10px; color: rgba(245,248,255,.74); }
.panel-title-with-icon span { color: var(--aqua); font-size: 14px; }
.file-picker { gap: 9px; }
.file-icon { color: var(--aqua) !important; font-weight: 900; }
.mini-form { grid-template-columns: 1fr 190px auto; gap: 10px; }
.manual-draft-form { grid-template-columns: 1fr 220px; gap: 10px; }
.messages { padding: 22px 20px; }
.message {
  border-radius: 18px;
  padding: 16px 18px;
}
.message.user {
  background: linear-gradient(135deg, rgba(255,107,53,.24), rgba(255,77,28,.30));
  border-bottom-right-radius: 7px;
}
.message.assistant {
  background: linear-gradient(145deg, rgba(255,255,255,.088), rgba(255,255,255,.036));
  border-bottom-left-radius: 7px;
  border-left: 1px solid rgba(255,77,28,.42);
}
.message-form {
  display: grid;
  grid-template-columns: 44px 1fr 44px auto;
  gap: 10px;
  align-items: end;
  margin: 0 18px 16px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  box-shadow: 0 16px 46px rgba(0,0,0,.25), var(--inset-glow);
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
}
.message-form textarea {
  min-height: 48px;
  max-height: 170px;
  border-radius: 14px;
  border-color: transparent;
  background: transparent;
  padding: 12px 6px;
  box-shadow: none;
  resize: none;
}
.message-form textarea:focus { box-shadow: none; background: transparent; border-color: transparent; }
.chat-icon-button {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(245,248,255,.78);
  box-shadow: var(--inset-glow);
  cursor: pointer;
}
.chat-icon-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.attach-button input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.magic-button { color: var(--aqua); }
.send-button { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 18px; border-radius: 14px; }
.artifact {
  position: relative;
  grid-template-columns: 44px 1fr 18px;
  padding: 10px 12px;
  border-radius: 16px;
}
.artifact::after { content: "⋮"; color: rgba(245,248,255,.45); font-weight: 900; }
.artifact img, .artifact video { width: 44px; height: 44px; border-radius: 13px; }
.event { border-radius: 14px; }
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 280px 1fr; }
}
@media (max-width: 780px) {
  .message-form { grid-template-columns: 42px 1fr 42px; }
  .send-button { grid-column: 1 / -1; justify-content: center; }
  .mini-form, .manual-draft-form { grid-template-columns: 1fr; }
}
.message-form.drag-over {
  border-color: rgba(255,184,107,.58);
  background: linear-gradient(160deg, rgba(255,184,107,.12), rgba(255,77,28,.06));
  box-shadow: 0 0 0 4px rgba(255,184,107,.07), 0 20px 60px rgba(0,0,0,.28), var(--inset-glow);
}


/* Centered empty state + second polish pass */
html, body { width: 100%; height: 100%; }
.app-shell {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.sidebar, .main, .artifacts { min-height: 0; }
.main {
  position: relative;
  height: calc(100dvh - 28px);
}
.empty {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vh, 34px) clamp(18px, 4vw, 56px);
  overflow: hidden;
}
.empty-card {
  width: min(760px, 94%);
  max-height: min(760px, calc(100dvh - 132px));
  overflow: auto;
  margin: auto;
  transform: translateY(-1vh);
  scrollbar-width: thin;
}
.empty-card::-webkit-scrollbar { width: 7px; }
.empty-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 999px; }
.idea-form button.primary { justify-self: stretch; min-height: 48px; }

.artifacts {
  height: calc(100dvh - 28px);
  overflow: hidden;
}
.artifacts > .panel {
  min-height: 148px;
  overflow: hidden;
}
.artifacts > .panel:first-child { flex: 1.12; }
.artifacts > .panel:nth-child(2) { flex: .88; }
.artifact-list, .events {
  max-height: none;
  min-height: 0;
  height: calc(100% - 28px);
}
.empty-mini {
  position: relative;
  min-height: 118px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: 18px;
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 20px;
  background:
    radial-gradient(circle at 16% 18%, rgba(255,184,107,.10), transparent 34%),
    linear-gradient(155deg, rgba(255,255,255,.052), rgba(255,255,255,.022));
  color: rgba(245,248,255,.88);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.empty-mini strong {
  font-size: 13px;
  letter-spacing: -.01em;
}
.empty-mini small {
  color: rgba(154,167,189,.86);
  line-height: 1.42;
}
.empty-mini-orb {
  width: 28px;
  height: 28px;
  border-radius: 12px 16px 11px 18px;
  background: linear-gradient(135deg, rgba(255,77,28,.85), rgba(255,184,107,.72));
  box-shadow: 0 10px 28px rgba(255,184,107,.14), inset 0 1px 0 rgba(255,255,255,.38);
}

.sessions-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sessions-panel .list {
  flex: 1;
  min-height: 0;
  padding-right: 5px;
}
.session-item {
  padding: 12px 14px;
  line-height: 1.18;
}
.session-item small { color: rgba(154,167,189,.86); }
.active-project-card .meta { color: rgba(154,167,189,.90); }

.workspace-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.workspace-tools-toggle {
  width: 100%;
  border: 0;
  padding: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.workspace-tools-toggle .panel-title { margin: 0; }
.workspace-tools-summary {
  min-width: 0;
  justify-self: end;
  color: rgba(185,194,209,.70);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-tools-chevron {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: rgba(247,248,248,.88);
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.085);
  transition: transform .18s ease, background .18s ease;
}
.workspace-tools:not(.is-collapsed) .workspace-tools-chevron { transform: rotate(180deg); }
.workspace-tools-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  animation: bubbleIn .18s ease both;
}
.workspace-tools.is-collapsed .workspace-tools-body { display: none; }
.workspace-tools.is-collapsed { padding-bottom: 12px; }
.workspace-tools .panel-title { margin-bottom: 0; }
.manual-mode-help {
  margin: -2px 2px 0;
  color: rgba(185,194,209,.72);
  font-size: 11px;
  line-height: 1.35;
}
.mini-form, .manual-draft-form { margin-bottom: 0; }
#assetsList.events {
  height: auto;
  max-height: 156px;
}

.workspace {
  padding-top: 2px;
}
.messages {
  padding: 20px 20px 14px;
  gap: 12px;
}
.message-form {
  position: relative;
  margin: 0 18px 18px;
  border-color: rgba(255,255,255,.13);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,184,107,.08), transparent 30%),
    linear-gradient(160deg, rgba(255,255,255,.085), rgba(255,255,255,.038));
}
.message-form::before {
  content: "";
  position: absolute;
  inset: -8px 20px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,184,107,.28), rgba(255,77,28,.26), transparent);
}

@media (max-height: 820px) {
  .empty-card {
    width: min(720px, 94%);
    padding: 24px;
    max-height: calc(100dvh - 116px);
  }
  .empty-card h2 { font-size: clamp(26px, 3.2vw, 38px); }
  .empty-card p { margin-bottom: 16px; line-height: 1.48; }
  .idea-form { gap: 9px; }
  .idea-form textarea { min-height: 96px; }
  .checkbox { font-size: 13px; }
}

@media (max-width: 1180px) {
  .main, .artifacts { height: auto; min-height: 640px; }
  .empty-card { max-height: none; transform: none; }
  .artifacts > .panel { flex: unset; }
}

/* Compact centered welcome card for short laptop/browser heights */
@media (max-height: 700px) {
  .topbar { padding: 14px 18px 10px; }
  .topbar h2 { font-size: 18px; }
  .topbar p { font-size: 12px; margin-top: 2px; }
  .status-pill { padding: 6px 10px; }
  .empty { padding: 10px 18px; align-items: center; }
  .empty-card {
    width: min(690px, 92%);
    max-height: calc(100dvh - 104px);
    padding: 18px 20px;
    transform: none;
  }
  .empty-card h2 {
    font-size: clamp(24px, 2.6vw, 31px);
    line-height: 1.02;
    letter-spacing: -.055em;
    margin-bottom: 8px;
  }
  .empty-card p {
    font-size: 13px;
    line-height: 1.36;
    margin-bottom: 12px;
    max-width: 100%;
  }
  .idea-form { gap: 7px; }
  .idea-form input,
  .idea-form select {
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 15px;
  }
  .idea-form textarea {
    height: 74px;
    min-height: 74px;
    padding: 10px 12px;
    border-radius: 15px;
  }
  .field-label { font-size: 10px; margin-bottom: -4px; }
  .checkbox { font-size: 12px; line-height: 1.2; }
  .idea-form button.primary { min-height: 40px; padding: 9px 14px; }
}

@media (max-width: 1340px) and (max-height: 760px) {
  .empty-card h2 { font-size: clamp(24px, 2.4vw, 32px); }
  .empty-card p { font-size: 13px; }
}

.idea-form textarea { resize: none; }


/* Professional frontend design pass: Linear precision x Runway cinematic restraint */
:root {
  --linear-black: #08090a;
  --surface-0: rgba(8, 9, 12, .72);
  --surface-1: rgba(255,255,255,.032);
  --surface-2: rgba(255,255,255,.052);
  --surface-3: rgba(255,255,255,.075);
  --hairline: rgba(255,255,255,.075);
  --hairline-2: rgba(255,255,255,.12);
  --type-primary: #F7F8FF;
  --type-secondary: #D9DDEB;
  --type-muted: #A8AEC5;
  --brand-flame: #FF6B35;
  --brand-amber: #FFB86B;
  --brand-orange: #FF4D1C;
}

body {
  font-feature-settings: "cv01", "ss03";
  background:
    radial-gradient(circle at 9% 6%, rgba(255,77,28,.22), transparent 25%),
    radial-gradient(circle at 92% 10%, rgba(255,184,107,.13), transparent 28%),
    linear-gradient(145deg, #050609 0%, #080a10 47%, #06070b 100%);
}
body::before, body::after { opacity: .32; filter: blur(52px); }

.app-shell {
  grid-template-columns: 286px minmax(560px, 1fr) 330px;
  gap: 10px;
  padding: 10px;
}
.brand, .panel, .main, .empty-card, .message, .session-item, .artifact, .event,
.message-form, .empty-mini {
  backdrop-filter: blur(26px) saturate(1.08);
  -webkit-backdrop-filter: blur(26px) saturate(1.08);
}
.brand, .panel, .main {
  background: linear-gradient(180deg, rgba(255,255,255,.048), rgba(255,255,255,.020));
  border-color: var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 18px 70px rgba(0,0,0,.30);
}
.brand { border-radius: 18px; padding: 14px; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 20px;
  background: linear-gradient(135deg, rgba(255,77,28,.95), rgba(255,107,53,.86) 58%, rgba(255,184,107,.86));
}
.brand-logo-stack { min-width: 0; flex: 1; gap: 4px; }
.brand-logo-stack .tuus-wordmark { font-size: 22px; }
.compact-brand .brand-logo-stack { gap: 3px; }
.compact-brand .tuus-wordmark { font-size: 19px; }
.auth-brand .tuus-wordmark { font-size: 22px; }
.auth-brand .tuus-wordmark + span { min-width: 0; }
.brand h1 { font-size: 15px; font-weight: 590; letter-spacing: -.035em; }
.brand p { font-size: 11px; color: var(--type-muted); }
.primary {
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-flame) 54%, var(--brand-amber));
  box-shadow: 0 10px 34px rgba(255,107,53,.18), inset 0 1px 0 rgba(255,255,255,.24);
}
.secondary, .ghost, .icon-button, .chat-icon-button {
  background: rgba(255,255,255,.035);
  border: 1px solid var(--hairline);
}
button { font-weight: 590; }
button, input, textarea, select { letter-spacing: -.01em; }
.nav-link, .full { margin-top: 8px; }

.panel { border-radius: 18px; padding: 13px; }
.panel-title {
  color: rgba(208,214,224,.82);
  font-size: 10px;
  letter-spacing: .145em;
  margin-bottom: 10px;
}
.sessions-panel { flex: 1.1; }
.active-project-card { flex: .0 0 auto; }
.session-item {
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(255,255,255,.026);
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
}
.session-item:hover { background: rgba(255,255,255,.046); border-color: rgba(255,255,255,.075); }
.session-item.active {
  border-color: rgba(255,107,53,.34);
  background: linear-gradient(135deg, rgba(255,107,53,.13), rgba(255,77,28,.075));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 36px rgba(255,107,53,.08);
}
.session-item small { font-size: 11px; color: var(--type-muted); }

.main { border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.040), rgba(255,255,255,.016)); }
.topbar {
  min-height: 66px;
  padding: 16px 19px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.038), rgba(255,255,255,.010));
}
.topbar h2 { font-size: 19px; font-weight: 510; letter-spacing: -.045em; color: var(--type-primary); }
.topbar p { color: var(--type-muted); font-size: 12px; }
.status-pill { background: rgba(87,229,157,.09); color: rgba(121,237,176,.95); border-color: rgba(87,229,157,.18); }

.empty { padding: clamp(12px, 2.5vh, 28px) clamp(18px, 4vw, 58px); }
.empty-card {
  width: min(680px, 92%);
  border-radius: 22px;
  padding: 28px;
  background:
    radial-gradient(circle at 12% -8%, rgba(255,77,28,.16), transparent 31%),
    radial-gradient(circle at 88% 0%, rgba(255,184,107,.10), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.070), rgba(255,255,255,.030));
  border: 1px solid var(--hairline-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 28px 90px rgba(0,0,0,.34);
  animation: bubbleIn .28s cubic-bezier(.2,.8,.2,1) both;
}
.empty-card::before { opacity: .38; }
.welcome-kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--type-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-weight: 590;
}
.welcome-kicker span {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--brand-amber);
  box-shadow: 0 0 18px rgba(255,184,107,.64);
}
.empty-card h2 {
  max-width: 620px;
  font-size: clamp(31px, 4.2vw, 50px);
  font-weight: 590;
  line-height: .985;
  letter-spacing: -.073em;
  text-wrap: balance;
}
.empty-card p {
  max-width: 560px;
  margin-bottom: 14px;
  color: rgba(208,214,224,.76);
  font-size: 14px;
  line-height: 1.52;
}
.welcome-flow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  color: var(--type-muted);
  font-size: 11px;
  font-weight: 510;
}
.welcome-flow span {
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.075);
  background: rgba(255,255,255,.028);
}
.welcome-flow i { width: 18px; height: 1px; background: rgba(255,255,255,.16); }
input, textarea, select {
  background: rgba(255,255,255,.032);
  border-color: rgba(255,255,255,.085);
  border-radius: 12px;
  color: var(--type-primary);
}
input::placeholder, textarea::placeholder { color: rgba(138,143,152,.84); }
input:focus, textarea:focus, select:focus {
  border-color: rgba(255,184,107,.38);
  background: rgba(255,255,255,.046);
  box-shadow: 0 0 0 4px rgba(255,184,107,.055), inset 0 1px 0 rgba(255,255,255,.08);
}
.field-label { color: rgba(208,214,224,.72); font-size: 10px; }
.checkbox { color: rgba(208,214,224,.72); }

.workspace-tools {
  margin: 10px 14px 0;
  border-radius: 16px;
  padding: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,.046), rgba(255,255,255,.020));
}
.mini-form { grid-template-columns: minmax(0, 1fr) 160px auto; gap: 8px; }
.manual-draft-form { grid-template-columns: minmax(0, 1fr) 188px; }
.file-picker { border-radius: 12px; justify-content: flex-start; }
#assetsList.events { max-height: 126px; }

.messages { padding: 16px 16px 12px; }
.message {
  max-width: min(78%, 720px);
  border-radius: 14px;
  background: rgba(255,255,255,.038);
  border-color: rgba(255,255,255,.080);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 12px 40px rgba(0,0,0,.18);
}
.message-header { font-size: 10px; color: rgba(208,214,224,.72); letter-spacing: .13em; }
.message-body { color: rgba(247,248,248,.94); font-size: 14px; }
.message.assistant { border-left-color: rgba(255,107,53,.34); }
.message.user { background: linear-gradient(135deg, rgba(255,107,53,.19), rgba(255,77,28,.18)); }
.message-form {
  margin: 0 14px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.060), rgba(255,255,255,.030));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11), 0 14px 50px rgba(0,0,0,.24);
}
.message-form textarea { font-size: 14px; }
.chat-icon-button, .send-button { border-radius: 12px; }

.artifacts { gap: 10px; }
.artifacts > .panel { border-radius: 18px; }
.empty-mini {
  min-height: 132px;
  justify-items: center;
  text-align: center;
  border-radius: 16px;
  border-color: rgba(255,255,255,.105);
  background: radial-gradient(circle at 50% 0%, rgba(255,107,53,.10), transparent 38%), rgba(255,255,255,.022);
}
.empty-mini-orb { width: 30px; height: 30px; border-radius: 10px; }
.empty-mini strong { color: var(--type-secondary); font-size: 13px; font-weight: 590; }
.empty-mini small { max-width: 220px; color: var(--type-muted); }
.artifact, .event { border-radius: 12px; }
.event { color: rgba(208,214,224,.88); }

@media (max-height: 700px) {
  .empty-card { padding: 18px 20px; width: min(640px, 92%); }
  .empty-card h2 { font-size: clamp(25px, 2.9vw, 34px); letter-spacing: -.058em; }
  .empty-card p { font-size: 12.5px; margin-bottom: 10px; }
  .welcome-kicker { margin-bottom: 8px; }
  .welcome-flow { margin-bottom: 10px; gap: 6px; }
  .welcome-flow span { padding: 5px 7px; }
}
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 280px 1fr; }
  .artifacts { height: auto; }
}
@media (max-width: 780px) {
  .app-shell { grid-template-columns: 1fr; padding: 8px; }
  .welcome-flow { flex-wrap: wrap; }
  .welcome-flow i { display: none; }
  .empty-card { width: 100%; }
}

/* Short-viewport correction after pro design pass: keep CTA visible, no internal card clipping */
@media (max-height: 700px) {
  .topbar { min-height: 54px; padding: 11px 16px 8px; }
  .topbar h2 { font-size: 17px; }
  .empty { padding: 6px 14px; }
  .empty-card {
    width: min(620px, 90%);
    max-height: calc(100dvh - 82px);
    padding: 14px 18px;
    overflow: visible;
  }
  .welcome-kicker { font-size: 9.5px; margin-bottom: 6px; }
  .empty-card h2 {
    font-size: clamp(23px, 2.35vw, 29px);
    line-height: 1;
    margin-bottom: 7px;
  }
  .empty-card p {
    font-size: 12px;
    line-height: 1.32;
    margin-bottom: 8px;
  }
  .welcome-flow { display: none; }
  .idea-form { gap: 6px; }
  .idea-form input,
  .idea-form select {
    min-height: 35px;
    padding: 7px 10px;
    border-radius: 11px;
    font-size: 13px;
  }
  .idea-form textarea {
    height: 56px;
    min-height: 56px;
    padding: 8px 10px;
    border-radius: 11px;
    font-size: 13px;
  }
  .field-label { font-size: 9px; margin-bottom: -3px; }
  .checkbox { font-size: 11.5px; gap: 7px; }
  .checkbox input { transform: scale(.9); }
  .idea-form button.primary {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 13px;
  }
}

input::placeholder, textarea::placeholder { color: rgba(176,184,198,.78); }
.muted { color: rgba(176,184,198,.78); }
button:disabled { opacity: .58; }

/* Final micro-polish from visual QA */
@media (max-height: 700px) {
  .empty-card { padding-bottom: 18px; }
  .empty-card h2 { line-height: 1.045; }
}
.empty-card p, .topbar p, .session-item small, .empty-mini small, .meta { color: rgba(185,194,209,.82); }
.active-project-card button:disabled {
  color: rgba(185,194,209,.72);
  border-color: rgba(255,255,255,.075);
  background: rgba(255,255,255,.026);
}

/* Active-workspace viewport fix: keep the composer inside the center card and let panels scroll. */
.main, .artifacts {
  height: 100%;
  min-height: 0;
}
.workspace {
  min-height: 0;
  overflow: hidden;
}
.message-form {
  flex: 0 0 auto;
}
.messages {
  min-height: 96px;
}
.artifacts > .panel {
  min-height: 0;
}

@media (max-height: 720px) {
  .sidebar, .artifacts { gap: 8px; }
  .brand { padding: 11px 12px; }
  .brand-mark { width: 34px; height: 34px; }
  .nav-link, .full { margin-top: 6px; }
  .panel { padding: 10px; }
  .session-item { padding: 9px 10px; }
  .session-item small { line-height: 1.25; }
  .topbar { min-height: 54px; padding: 11px 16px 8px; }
  .workspace-tools {
    max-height: 184px;
    overflow: auto;
    margin: 8px 12px 0;
    padding: 10px;
    gap: 7px;
  }
  .workspace-tools::-webkit-scrollbar { width: 7px; }
  .workspace-tools::-webkit-scrollbar-thumb { background: rgba(255,255,255,.13); border-radius: 999px; }
  .mini-form,
  .manual-draft-form {
    gap: 6px;
  }
  .mini-form input,
  .mini-form select,
  .file-picker,
  .manual-draft-form textarea {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 12.5px;
  }
  .mini-form button,
  .manual-draft-form button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12.5px;
  }
  #assetsList.events { max-height: 54px; }
  .messages { padding: 11px 12px 8px; gap: 9px; }
  .message { padding: 11px 12px; }
  .message-body { font-size: 13px; line-height: 1.42; }
  .message-form {
    margin: 0 12px 10px;
    padding: 8px;
    min-height: 62px;
  }
  .message-form textarea { min-height: 42px; padding: 8px 4px; }
  .chat-icon-button,
  .send-button { height: 40px; min-height: 40px; }
}

/* User-facing gallery: public generated media only, same liquid-glass cockpit language. */
.gallery-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
}
.gallery-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 22px;
  padding: 18px;
}
.gallery-hero h3 {
  position: relative;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -.055em;
  line-height: 1;
  margin-bottom: 8px;
}
.gallery-hero p {
  position: relative;
  max-width: 640px;
  color: rgba(185,194,209,.82);
  line-height: 1.48;
}
.gallery-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 2px 3px 4px;
}
.gallery-grid::-webkit-scrollbar { width: 7px; }
.gallery-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.13); border-radius: 999px; }
.gallery-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.105);
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,184,107,.08), transparent 38%),
    linear-gradient(160deg, rgba(255,255,255,.082), rgba(255,255,255,.032));
  box-shadow: 0 18px 54px rgba(0,0,0,.26), var(--inset-glow);
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  animation: bubbleIn .26s ease both;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.gallery-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,184,107,.36);
  background:
    radial-gradient(circle at 18% 0%, rgba(255,184,107,.13), transparent 40%),
    linear-gradient(160deg, rgba(255,255,255,.105), rgba(255,255,255,.040));
}
.gallery-card.video { border-color: rgba(87,229,157,.22); }
.gallery-media {
  aspect-ratio: 16 / 10;
  background: #05060a;
  overflow: hidden;
}
.gallery-media img,
.gallery-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.gallery-copy {
  padding: 12px;
}
.gallery-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(247,248,248,.96);
  font-weight: 820;
  letter-spacing: -.015em;
  margin-bottom: 5px;
}
.gallery-copy small {
  display: block;
  color: rgba(185,194,209,.78);
  line-height: 1.35;
}
.gallery-badge {
  display: inline-grid;
  place-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.gallery-badge.final {
  color: var(--good);
  background: rgba(87,229,157,.13);
  border: 1px solid rgba(87,229,157,.22);
}
@media (max-height: 720px) {
  .gallery-view { padding: 12px; gap: 10px; }
  .gallery-hero { padding: 12px; border-radius: 16px; }
  .gallery-hero h3 { font-size: clamp(21px, 2.2vw, 29px); }
  .gallery-hero p { font-size: 12.5px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 9px; }
  .gallery-copy { padding: 10px; }
}

/* Auth */
.auth-body {
  overflow: auto;
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  position: relative;
  z-index: 1;
}
.auth-card {
  width: min(460px, 100%);
  position: relative;
  overflow: hidden;
  padding: 34px;
  border-radius: 34px;
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(255,255,255,.115), rgba(255,255,255,.045));
  box-shadow: var(--shadow), var(--inset-glow);
  animation: bubbleIn .36s ease both;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 28px;
}
.auth-brand span:last-child { display: grid; gap: 2px; }
.auth-brand small { color: var(--muted); font-weight: 650; }
.auth-card h1 {
  font-size: clamp(34px, 7vw, 54px);
  letter-spacing: -.07em;
  margin: 10px 0 10px;
}
.auth-card > p { line-height: 1.65; }
.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.auth-error {
  min-height: 20px;
  color: var(--bad);
  font-weight: 750;
  font-size: 13px;
  line-height: 1.45;
}
.auth-switch {
  margin-top: 18px;
  text-align: center;
}
.auth-switch a {
  color: var(--aqua);
  font-weight: 850;
  text-decoration: none;
}
.topbar-actions,
.studio-auth-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.auth-user {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,184,107,.08);
  border: 1px solid rgba(255,184,107,.18);
  color: var(--aqua);
  font-size: 12px;
  font-weight: 850;
}
.logout-button {
  padding: 8px 12px;
  font-size: 12px;
}
@media (max-width: 820px) {
  .auth-card { padding: 26px; }
  .auth-user { max-width: 150px; }
}

/* iOS-style business onboarding modal */
.onboarding-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}
.onboarding-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 10, .66);
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
}
.onboarding-sheet {
  position: relative;
  width: min(620px, 96vw);
  max-height: min(820px, 92dvh);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 38px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,184,107,.16), transparent 34%),
    radial-gradient(circle at 82% 8%, rgba(255,77,28,.18), transparent 32%),
    linear-gradient(160deg, rgba(22,28,42,.86), rgba(10,14,22,.78));
  box-shadow: 0 34px 120px rgba(0,0,0,.62), var(--inset-glow);
  animation: bubbleIn .28s cubic-bezier(.2,.8,.2,1) both;
}
.onboarding-phone-notch {
  width: 74px;
  height: 7px;
  margin: 0 auto 17px;
  border-radius: 999px;
  background: rgba(255,255,255,.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24);
}
.onboarding-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}
.onboarding-header h3 {
  margin-top: 8px;
  font-size: clamp(27px, 5vw, 42px);
  line-height: 1.02;
  letter-spacing: -.06em;
}
.onboarding-header p {
  margin-top: 10px;
  color: rgba(154,167,189,.94);
  line-height: 1.48;
}
.onboarding-steps {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  gap: 9px;
  align-items: center;
  margin: 16px 0 20px;
  color: rgba(154,167,189,.88);
  font-size: 12px;
  font-weight: 850;
}
.onboarding-steps span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.08);
}
.onboarding-steps span.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255,77,28,.28), rgba(255,184,107,.13));
  border-color: rgba(255,77,28,.32);
}
.onboarding-steps i {
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.16), rgba(255,184,107,.28));
}
.onboarding-form {
  position: relative;
  display: grid;
  gap: 11px;
}
.onboarding-form-dimmed {
  pointer-events: none;
  user-select: none;
  opacity: .26;
  filter: blur(1px) saturate(.72);
  transition: opacity .18s ease, filter .18s ease;
}
.onboarding-loading {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(430px, calc(100% - 36px));
  max-width: calc(100vw - 48px);
  translate: -50% -50%;
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  border: 1px solid rgba(255,184,107,.22);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 6%, rgba(255,184,107,.18), transparent 40%),
    linear-gradient(160deg, rgba(20,27,42,.94), rgba(8,12,20,.90));
  box-shadow: 0 28px 90px rgba(0,0,0,.55), var(--inset-glow);
  animation: bubbleIn .24s cubic-bezier(.2,.8,.2,1) both, subtleShimmer 2.7s ease-in-out infinite;
}
.onboarding-loader-orbit {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255,184,107,.18);
  background: radial-gradient(circle, rgba(255,184,107,.10), rgba(255,255,255,.035) 52%, transparent 68%);
  box-shadow: 0 0 42px rgba(255,184,107,.14), inset 0 1px 0 rgba(255,255,255,.12);
  animation: orbitSpin 2.7s linear infinite;
}
.onboarding-loader-orbit i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.88), rgba(255,184,107,.72) 28%, rgba(255,77,28,.40) 62%, rgba(255,107,53,.18));
  box-shadow: 0 0 34px rgba(255,184,107,.35), 0 0 64px rgba(255,77,28,.18);
  animation: orbBreathe 1.55s ease-in-out infinite;
}
.onboarding-loader-orbit span {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--aqua);
  box-shadow: 0 0 18px rgba(255,184,107,.72);
}
.onboarding-loader-orbit span:nth-child(1) { top: 2px; left: 50%; transform: translateX(-50%); }
.onboarding-loader-orbit span:nth-child(2) { right: 8px; bottom: 18px; background: var(--accent); box-shadow: 0 0 18px rgba(255,77,28,.62); }
.onboarding-loader-orbit span:nth-child(3) { left: 8px; bottom: 18px; background: var(--accent-2); box-shadow: 0 0 18px rgba(255,196,119,.62); }
.onboarding-loading strong { font-size: 17px; letter-spacing: 0; }
.onboarding-loading p { margin: 0; color: rgba(154,167,189,.95); line-height: 1.45; }
.onboarding-loading small { color: var(--aqua); font-weight: 800; }
.onboarding-loading-line { width: 100%; max-width: 310px; margin: 4px 0 0; }
.onboarding-progress-meter {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.onboarding-progress-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  text-align: left;
}
.onboarding-progress-head span {
  min-width: 0;
  color: rgba(231,238,252,.94);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}
.onboarding-progress-head strong {
  min-width: 54px;
  text-align: right;
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
}
.onboarding-progress-track {
  position: relative;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255,184,107,.20);
  background: rgba(5,10,18,.72);
}
.onboarding-progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--aqua), var(--accent), var(--accent-2));
  box-shadow: 0 0 22px rgba(255,184,107,.22);
  transition: width .28s ease;
}
.onboarding-progress-meter[data-status="failed"] .onboarding-progress-track span {
  background: linear-gradient(90deg, #FF4D1C, #ffc477);
}
.onboarding-error {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,77,28,.28);
  background: rgba(255,77,28,.10);
  color: #ffd9e1;
  font-size: 13px;
  line-height: 1.35;
}
.onboarding-form textarea { resize: vertical; }
.instagram-post-intake {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(255,184,107,.16);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255,184,107,.065), rgba(255,255,255,.030));
}
.instagram-post-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.instagram-post-heading p {
  margin: 4px 0 0;
  color: rgba(154,167,189,.90);
  font-size: 12px;
  line-height: 1.35;
}
.instagram-post-heading > span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--good);
  background: rgba(87,229,157,.12);
  border: 1px solid rgba(87,229,157,.20);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.instagram-download-status {
  min-height: 20px;
  color: rgba(154,167,189,.90);
  font-size: 12px;
  line-height: 1.35;
}
.instagram-download-status.ok { color: var(--good); font-weight: 780; }
.instagram-download-status.err { color: var(--bad); font-weight: 780; }
.instagram-post-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}
.instagram-post-form textarea {
  min-height: 42px;
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
}
.instagram-post-form .instagram-download-status {
  grid-column: 1 / -1;
  margin-top: -2px;
}
.onboarding-dropzone {
  display: grid;
  gap: 7px;
  min-height: 112px;
  place-items: center;
  text-align: center;
  padding: 18px;
  border: 1px dashed rgba(255,184,107,.40);
  border-radius: 24px;
  background:
    radial-gradient(circle at 16% 10%, rgba(255,184,107,.12), transparent 38%),
    rgba(255,255,255,.045);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.onboarding-dropzone:hover {
  transform: translateY(-1px);
  border-color: rgba(255,184,107,.68);
  background: rgba(255,184,107,.075);
}
.onboarding-dropzone input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.onboarding-dropzone strong { font-size: 15px; }
.onboarding-dropzone small { max-width: 420px; color: rgba(154,167,189,.88); line-height: 1.42; }
.onboarding-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  font-size: 12px;
}
.onboarding-files span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(245,248,255,.92);
}
.onboarding-files small { color: var(--aqua); margin-left: 5px; }
.onboarding-files .asset-chip { display: inline-flex; align-items: center; gap: 6px; }
.asset-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 18px;
  block-size: 18px;
  margin-left: 4px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: rgba(245,248,255,.85);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.asset-chip-remove:hover { background: rgba(255,90,90,.18); color: #ffd9d9; border-color: rgba(255,90,90,.45); }
.asset-chip-remove:focus-visible { outline: 2px solid var(--aqua); outline-offset: 1px; }
.onboarding-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 4px;
}
@media (max-width: 620px) {
  .onboarding-modal { padding: 10px; align-items: end; }
  .onboarding-sheet { width: 100%; max-height: 94dvh; border-radius: 32px 32px 24px 24px; padding: 19px; }
  .onboarding-header h3 { font-size: 29px; }
  .onboarding-steps { grid-template-columns: 1fr; }
  .onboarding-steps i { display: none; }
  .onboarding-actions { grid-template-columns: 1fr; }
}

@media (max-height: 760px) {
  .onboarding-modal { padding: 10px; }
  .onboarding-sheet {
    max-height: calc(100dvh - 20px);
    padding: 16px 18px;
    border-radius: 30px;
  }
  .onboarding-phone-notch { margin-bottom: 9px; }
  .onboarding-header { margin-bottom: 10px; }
  .onboarding-header h3 { font-size: clamp(23px, 3.2vw, 31px); margin-top: 5px; }
  .onboarding-header p { font-size: 13px; line-height: 1.34; margin-top: 6px; }
  .onboarding-steps { margin: 9px 0 12px; }
  .onboarding-form { gap: 7px; }
  .onboarding-form input,
  .onboarding-form textarea { padding: 9px 12px; border-radius: 15px; }
  .onboarding-form textarea { min-height: 58px; }
  .onboarding-dropzone { min-height: 72px; padding: 11px; border-radius: 18px; }
  .onboarding-dropzone small { display: none; }
  .onboarding-files { max-height: 42px; overflow: auto; }
  .onboarding-actions { position: sticky; bottom: -1px; padding-top: 7px; background: linear-gradient(180deg, rgba(15,20,31,0), rgba(15,20,31,.96) 38%); }
}

@media (max-height: 760px) and (min-width: 621px) {
  .onboarding-sheet { width: min(760px, 98vw); max-height: calc(100dvh - 8px); padding: 12px 16px; }
  .onboarding-phone-notch { display: none; }
  .onboarding-header { margin-bottom: 6px; }
  .onboarding-header p { display: none; }
  .onboarding-header h3 { font-size: 25px; }
  .onboarding-steps { margin: 6px 0 8px; font-size: 11px; }
  .onboarding-steps span { padding: 5px 8px; }
  .onboarding-form { gap: 5px; }
  .onboarding-form input { min-height: 36px; padding: 7px 10px; }
  .onboarding-form textarea { min-height: 42px; height: 46px; padding: 7px 10px; }
  .onboarding-dropzone { min-height: 54px; padding: 8px; gap: 3px; }
  .onboarding-dropzone strong { font-size: 13px; }
  .onboarding-files { min-height: 20px; font-size: 11px; }
  .onboarding-files span { padding: 4px 8px; }
  .onboarding-form .checkbox { font-size: 11px; }
  .onboarding-actions { position: static; padding-top: 2px; background: transparent; }
  .onboarding-actions button { min-height: 38px; padding: 8px 12px; }
}

/* ───────── Credits pill + modal ───────── */
.credits-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,184,107,.16), rgba(255,107,53,.18));
  border: 1px solid rgba(255,184,107,.32);
  color: var(--aqua);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}
.credits-pill:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -8px rgba(255,184,107,.55); }
.credits-pill:active { transform: translateY(0); }
.credits-pill-icon { font-size: 13px; opacity: .9; }
.credits-pill-label { color: rgba(185,194,209,.75); font-weight: 600; font-size: 11px; }
.credits-pill.is-low {
  background: linear-gradient(135deg, rgba(255,134,134,.14), rgba(255,179,134,.18));
  border-color: rgba(255,134,134,.4);
  color: #ffd2d2;
}

.credits-modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
}
.credits-modal.hidden { display: none; }
.credits-backdrop {
  position: absolute; inset: 0;
  /* Opaque — same color as .welcome-paywall background. The user shouldn't
     see the app underneath the modal (consistent with the welcome paywall). */
  background: #080c16;
}
.credits-sheet {
  position: relative;
  width: min(760px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  border-radius: 22px;
  display: flex; flex-direction: column; gap: 22px;
}
.credits-modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.credits-modal-header h3 { letter-spacing: -.03em; font-size: 22px; margin-top: 4px; }
.credits-modal-header p { color: rgba(185,194,209,.85); font-size: 13px; margin-top: 6px; line-height: 1.45; }
.credits-modal-header strong { color: var(--aqua); }

.credits-packages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.credits-loading { padding: 18px; }
.credits-package {
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid rgba(255,184,107,.18);
  background: rgba(255,255,255,.03);
  transition: border-color .2s ease, transform .15s ease, background .2s ease;
}
.credits-package:hover { border-color: rgba(255,184,107,.45); background: rgba(255,184,107,.05); transform: translateY(-2px); }
.credits-package.is-popular { border-color: rgba(255,107,53,.55); background: linear-gradient(165deg, rgba(255,107,53,.08), rgba(255,184,107,.05)); }
.credits-package-title {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
}
.credits-package-credits {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 30px;
  font-weight: 850;
  color: var(--aqua);
  letter-spacing: -.03em;
  line-height: 1;
}
.credits-package-usd {
  font-size: 12px;
  color: rgba(185,194,209,.7);
  letter-spacing: .01em;
}
.credits-package-videos {
  font-size: 12.5px;
  color: rgba(185,194,209,.62);
  letter-spacing: .01em;
  margin-top: -4px;
}
.credits-package-price {
  font-size: 16px;
  font-weight: 700;
  color: #ffd9a8;
  letter-spacing: -.01em;
}
.credits-package button { margin-top: auto; min-height: 40px; }
.credits-package button[disabled] { opacity: .55; cursor: progress; }

/* ---- Welcome paywall (one-time post-signup hard blocker) ---- */
/* Solid opaque background — the paywall fully occludes the app underneath.
   No dismiss button + no transparency = user must pick trial or pay. */
.welcome-paywall {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  background: #080c16;
  padding: 24px;
  overflow-y: auto;
}

/* Hard lock: completely hide the app shell (sidebars + main) while
   booting OR while the paywall is active. The paywall sits OUTSIDE
   `.app-shell` in the DOM (see index.html bottom) so it stays visible.
   Using `display: none` (not visibility:hidden) drops the shell out of
   layout entirely — no flash of interactive sidebar, no scroll context,
   nothing to see behind a truly fullscreen paywall. */
body[data-boot-state="loading"] .app-shell,
body[data-boot-state="paywall"] .app-shell {
  display: none;
}

/* Boot loader: branded splash while the JS bootstrap + welcome-offer
   fetch resolve (~200-500ms). Visible by default (body[data-boot-state]
   is "loading" at <body> open), removed once the JS flips the state to
   "paywall" or "ready". Eliminates the perception of a black screen. */
.boot-loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px;
  /* Transparent so the body's animated orange-gradient blobs
     (liquidFloat) show through — the brand's signature moving
     background IS the loader. */
  background: transparent;
}
.boot-loader .tuus-wordmark {
  font-size: 30px;
  letter-spacing: -.02em;
  /* Two layered animations so the logo drifts AND glows in sync with
     the body gradients underneath. Float is 5.4s (slower than glow) so
     the wordmark feels physical rather than ticking. */
  animation:
    tuusLogoFloat 5.4s ease-in-out infinite,
    tuusLogoBootGlow 2.6s ease-in-out infinite;
}
/* Universal "still loading" circular spinner under the logo. Brand
   accent on top arc, transparent sides, 1s rotation — the standard
   spinner pattern but tinted to the app's orange. */
.boot-spinner {
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 2.5px solid rgba(255, 184, 107, .18);
  border-top-color: var(--accent);
  animation: bootSpinnerRotate .9s linear infinite;
}
@keyframes bootSpinnerRotate {
  to { transform: rotate(360deg); }
}
/* While booting, speed up the body gradient blobs so they feel alive
   (default 18s reads as "static" on a 1-2s loader). Only applied
   during boot — keeps the rest of the app's atmosphere subtle. */
body[data-boot-state="loading"]::before,
body[data-boot-state="loading"]::after {
  animation-duration: 6s;
  opacity: .72;
}
@keyframes tuusLogoFloat {
  0%   { transform: translate3d(0, 0, 0)        rotate(0deg)   scale(1); }
  25%  { transform: translate3d(6px, -8px, 0)   rotate(-1.2deg) scale(1.015); }
  50%  { transform: translate3d(-4px, 6px, 0)   rotate(0.8deg)  scale(.99); }
  75%  { transform: translate3d(-7px, -4px, 0)  rotate(1.4deg)  scale(1.02); }
  100% { transform: translate3d(0, 0, 0)        rotate(0deg)   scale(1); }
}
@keyframes tuusLogoBootGlow {
  0%, 100% { opacity: .82; filter: drop-shadow(0 0 6px rgba(255, 77, 28, .32)); }
  50%      { opacity: 1;   filter: drop-shadow(0 0 22px rgba(255, 77, 28, .55)); }
}
body[data-boot-state="ready"] .boot-loader,
body[data-boot-state="paywall"] .boot-loader {
  display: none;
}
.welcome-paywall.hidden { display: none; }
.welcome-paywall-shell {
  position: relative;
  width: min(960px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: 36px;
  border-radius: 24px;
  display: flex; flex-direction: column; gap: 22px;
}
.welcome-paywall-header {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  text-align: center;
}
/* Compact logo at the very top — sets the brand context without
   competing with the hero copy below. */
.welcome-paywall-logo .tuus-wordmark {
  font-size: 18px;
  letter-spacing: -.02em;
  opacity: .85;
}
/* HERO copy — the value proposition. Hot-orange glow using --accent
   with a layered text-shadow halo so it reads like a neon sign on the
   dark backdrop. Display font (Space Grotesk) at a confident size,
   tight tracking so 2 lines feel like one statement. */
.welcome-paywall-hero {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 4.6vw, 44px);
  letter-spacing: -.035em;
  line-height: 1.05;
  margin: 4px 0 0;
  color: #FF6A1F;
  text-shadow:
    0 0 16px rgba(255, 77, 28, .55),
    0 0 38px rgba(255, 77, 28, .28),
    0 0 72px rgba(255, 122, 47, .18);
  max-width: 820px;
}
/* Secondary punch line — high-contrast white, calmer typography. */
.welcome-paywall-subhero {
  font-size: clamp(14px, 1.6vw, 16px);
  font-weight: 600;
  color: #F7F8FF;
  letter-spacing: -.005em;
  margin: 0;
  max-width: 640px;
}
/* Discount disclaimer — the existing line, now centered + muted. */
.welcome-paywall-offer {
  font-size: 12.5px;
  line-height: 1.55;
  margin-top: 2px;
  max-width: 560px;
}
.welcome-paywall-header p { color: rgba(185,194,209,.85); font-size: 13.5px; line-height: 1.55; }
.welcome-paywall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.welcome-paywall-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 28px;
  border-radius: 18px;
  border: 1px solid rgba(255,184,107,.18);
  background: rgba(255,255,255,.03);
  transition: border-color .2s ease, transform .15s ease, background .2s ease;
}
.welcome-paywall-card:hover { border-color: rgba(255,184,107,.45); background: rgba(255,184,107,.05); transform: translateY(-2px); }
.welcome-paywall-card.is-trial {
  border-color: rgba(107,223,255,.4);
  background: linear-gradient(165deg, rgba(107,223,255,.08), rgba(255,255,255,.02));
}
.welcome-paywall-card.is-trial:hover { border-color: rgba(107,223,255,.7); background: linear-gradient(165deg, rgba(107,223,255,.14), rgba(255,255,255,.04)); }
.welcome-paywall-card h3 {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0;
}
.welcome-paywall-card .pack-credits {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 32px;
  font-weight: 850;
  color: var(--aqua);
  letter-spacing: -.03em;
  line-height: 1;
}
.welcome-paywall-card .pack-usd {
  font-size: 12.5px;
  color: rgba(185,194,209,.7);
  letter-spacing: .01em;
  margin-top: -6px;
}
.welcome-paywall-card .pack-videos {
  font-size: 13px;
  color: rgba(185,194,209,.62);
  letter-spacing: .01em;
  /* Supporting line — the number itself does the marketing work. */
}
.welcome-paywall-card .pack-meta {
  font-size: 12.5px;
  color: rgba(185,194,209,.78);
  line-height: 1.5;
}
.welcome-paywall-card .price {
  display: flex; flex-direction: column; gap: 2px;
}
.welcome-paywall-card .price-old {
  text-decoration: line-through;
  color: rgba(185,194,209,.5);
  font-size: 12.5px;
}
.welcome-paywall-card .price-new {
  font-size: 20px;
  font-weight: 800;
  color: #ffd9a8;
  letter-spacing: -.01em;
}
.welcome-paywall-card button { margin-top: auto; min-height: 42px; }
.welcome-paywall-card button[disabled] { opacity: .55; cursor: progress; }
.welcome-badge {
  /* In-flow at the top of the card so it cannot overlap the title regardless
     of card width. Pairs with align-self: flex-start to hug the left edge. */
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.welcome-badge.is-free {
  background: rgba(107,223,255,.18);
  color: #aef0ff;
  border: 1px solid rgba(107,223,255,.45);
}
.welcome-badge.is-discount {
  background: linear-gradient(135deg, rgba(255,107,53,.22), rgba(255,184,107,.22));
  color: #ffd9a8;
  border: 1px solid rgba(255,184,107,.5);
}
/* Top-right exit out of the hard paywall — for users who want to
   switch accounts. Doesn't bypass the paywall (it logs them out and
   sends them to /static/login.html); just acknowledges the multi-account
   reality. Positioned absolute so it doesn't push the header layout. */
.welcome-paywall-logout {
  position: absolute;
  top: 18px; right: 22px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(185, 194, 209, .85);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.welcome-paywall-logout:hover {
  background: rgba(255, 184, 107, .12);
  border-color: rgba(255, 184, 107, .35);
  color: var(--text);
}
.welcome-paywall-logout span { font-size: 14px; }

.welcome-paywall-footer {
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.welcome-paywall-footer small {
  color: rgba(185,194,209,.6);
  font-size: 11.5px;
  text-align: center;
  line-height: 1.55;
  max-width: 720px;
}
.welcome-paywall-error {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,134,134,.1);
  border: 1px solid rgba(255,134,134,.4);
  color: #ffd2d2;
  font-size: 12.5px;
}
@media (max-width: 640px) {
  .welcome-paywall-shell { padding: 24px; }
  .welcome-paywall-header h2 { font-size: 22px; }
  .welcome-paywall-grid { grid-template-columns: 1fr; }
}

.credits-transactions { display: flex; flex-direction: column; gap: 8px; }
.credits-transactions .panel-title { font-size: 11px; }
.credits-transactions-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}
.credits-tx {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  font-size: 12px;
}
.credits-tx-kind {
  font-weight: 800; font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
}
.credits-tx-kind.kind-purchase { color: #b6ffce; background: rgba(102,255,153,.12); }
.credits-tx-kind.kind-grant    { color: #ffd2b6; background: rgba(255,107,53,.14); }
.credits-tx-kind.kind-consume  { color: #ffc7b6; background: rgba(255,134,102,.14); }
.credits-tx-kind.kind-refund   { color: #ffe4ba; background: rgba(255,184,107,.14); }
.credits-tx-amount { font-weight: 800; font-variant-numeric: tabular-nums; }
.credits-tx-amount.is-negative { color: #ffaca0; }
.credits-tx-amount.is-positive { color: #a0ffba; }
.credits-tx-meta { color: rgba(185,194,209,.7); font-size: 11px; }

.credits-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 102, 102, .1);
  border: 1px solid rgba(255, 102, 102, .35);
  color: #ffc7c7;
  font-size: 12px;
}
.credits-error.hidden { display: none; }

@media (max-width: 540px) {
  .credits-pill-label { display: none; }
  .credits-sheet { padding: 20px; max-height: 92vh; }
  .credits-packages { grid-template-columns: 1fr; }
}

/* ============================================================
   MOBILE RESPONSIVE PASS — chat-first drawers + density.
   Appended last so it is authoritative over the scattered
   legacy width/height media queries above. Desktop (>900px) is
   untouched; all tokens, fonts and glass are preserved.
   ============================================================ */

/* Topbar toggle buttons are desktop-hidden by default. */
.mobile-only { display: none; }

.drawer-backdrop {
  position: fixed; inset: 0; z-index: 1080;
  background: rgba(5, 6, 10, .55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.drawer-backdrop[hidden] { display: none; }

@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  body { overflow-y: auto; }
  body.drawer-sidebar-open, body.drawer-artifacts-open { overflow: hidden; }

  /* show the topbar drawer toggles; the desktop fold affordance isn't needed */
  .topbar .mobile-only { display: inline-grid; }
  .sidebar-fold { display: none; }

  /* shell collapses to the chat; the two asides become off-canvas drawers */
  .app-shell { display: block; padding: 0; gap: 0; min-height: 100dvh; }
  .main { width: 100%; height: 100dvh; border-radius: 0; }

  .sidebar, .artifacts {
    position: fixed; top: 0; bottom: 0; z-index: 1090;
    width: min(86vw, 340px); max-width: 340px;
    margin: 0; border-radius: 0; overflow-y: auto;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(22px) saturate(1.1); backdrop-filter: blur(22px) saturate(1.1);
    box-shadow: var(--shadow); padding: 16px;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  }
  .sidebar { left: 0; border-right: 1px solid var(--line-strong); transform: translateX(-106%); }
  .artifacts {
    right: 0; border-left: 1px solid var(--line-strong);
    transform: translateX(106%);
    display: flex; flex-direction: column; gap: 14px; grid-template-columns: none;
  }
  body.drawer-sidebar-open .sidebar { transform: translateX(0); }
  body.drawer-artifacts-open .artifacts { transform: translateX(0); }

  /* compact topbar: ☰ · title · credits · ▦ ; drop verbose status */
  .topbar { padding: 12px 14px; gap: 8px; flex-wrap: wrap; }
  .topbar-title { flex: 1; min-width: 0; }
  .topbar-title h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-title #sessionStatus { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-actions { gap: 6px; }
  .auth-user, #healthPill { display: none; }
  .topbar-actions .icon-button[aria-label="Opciones"] { display: none; }
  .credits-pill-label { display: none; }
  .logout-button { padding: 8px 10px; font-size: 12px; }

  /* chat density */
  .messages { padding: 16px 14px; }
  .message { max-width: 100%; }
  .workspace-tools { margin: 12px 14px 0; padding: 14px; }
  .message-form { margin: 0 14px 14px; }
  .empty-card { padding: 22px 18px; }

  /* trim the fixed background blobs on small screens */
  body::before { width: 260px; height: 260px; left: -90px; }
  body::after { width: 300px; height: 300px; right: -120px; opacity: .35; }

  /* sidebar drawer: un-cramp (natural height, the drawer scrolls) + make the
     panels tap-to-expand accordions so sessions opens to its full list */
  .sidebar .sessions-panel, .sidebar .active-project-card { flex: none; min-height: 0; margin-top: 0; }
  .sidebar .list { max-height: none; }
  .sidebar .panel.compact > .panel-title {
    cursor: pointer; display: flex; align-items: center; justify-content: space-between;
    gap: 8px; user-select: none;
  }
  .sidebar .panel.compact > .panel-title::after {
    content: "▾"; color: var(--accent-2); font-size: 11px; transition: transform .2s ease;
  }
  .sidebar .panel.compact.panel-collapsed > .panel-title::after { transform: rotate(-90deg); }
  .sidebar .panel.compact.panel-collapsed > :not(.panel-title) { display: none; }
}

@media (max-width: 600px) {
  /* full-screen modals on phones (internal scroll, dvh-safe) */
  .create-wizard, .credits-modal, .welcome-paywall, .person-pick-modal { padding: 0; }
  .wizard-shell, .credits-sheet, .welcome-paywall-shell, .person-pick-sheet {
    width: 100%; max-width: 100%; max-height: 100dvh; border-radius: 0;
  }
  /* onboarding: stack the 2-col card grids. Grid items default to
     min-width:auto, so long card text was blowing the two columns wider
     than the phone (content spilling off the edges). One column fixes it;
     overflow-x clip is the belt-and-suspenders net. */
  .creation-intent-toggle, .generation-mode-grid, .wizard-path-choice { grid-template-columns: 1fr; }
  .wizard-shell { overflow-x: hidden; }
}
