/* The editfast look, from the test.html mock: a near-black ground lit violet and cyan,
   glass panels, pill buttons, DM Sans with Fraunces for display type. */

:root {
  color-scheme: dark;
  --bg: #090b12;
  --panel: #171a25;
  --panel-deep: #10131d;
  --panel-deeper: #0d1018;
  --raised: #20232e;
  --raised-hover: #303344;
  --line: #343747;
  --line-soft: #2b2e3b;
  --line-mid: #373a49;
  --line-strong: #494d5c;
  --line-input: #454858;

  --text: #f7f8fc;
  --text-soft: #d5d7e3;
  --muted: #aeb4c5;
  --muted-2: #b9bfd0;
  --dim: #8d91a3;
  --faint: #7d8194;
  --placeholder: #9da4b6;

  --violet: #a682ff;
  --violet-hover: #c1a8ff;
  --violet-ink: #120b22;
  --violet-text: #cbb8ff;
  --violet-glow: #b89bff;
  --violet-tint: #282537;
  --cyan: #75e9ef;
  --cyan-text: #adf3f5;
  --cyan-tint: #14323a;
  --green-text: #9cf0b8;
  --green-tint: #1f3a2a;
  --red-text: #ffb3bd;
  --red-tint: #3a1d26;
  --red-line: #7a3b4a;
  --bubble-user: #302943;
  --bubble-bot: #242332;

  --font-body: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--violet-text); text-underline-offset: 3px; }
code { font-family: var(--font-mono); font-size: 12px; }
button, a { transition: background .2s, border-color .2s, transform .2s, color .2s, opacity .2s; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }
::selection { background: color-mix(in srgb, var(--violet) 40%, transparent); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.app-shell {
  width: 100%; min-height: 100vh; overflow: hidden;
  background:
    radial-gradient(ellipse 65% 37% at 80% 3%, #34235955, transparent 75%),
    radial-gradient(ellipse 45% 32% at 2% 43%, #12424a33, transparent 75%),
    var(--bg);
}
.page-width { width: min(100% - 40px, 1180px); margin-inline: auto; }
.glass { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 24px 80px #0005; }
.panel { border: 1px solid var(--line-mid); border-radius: 16px; background: var(--panel-deep); }

/* ---- buttons, badges, inputs ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; padding: 10px 18px;
  color: var(--text); background: transparent; white-space: nowrap;
}
.btn svg { display: block; flex: none; }
.btn-primary { background: var(--violet); color: var(--violet-ink); font-weight: 700; box-shadow: 0 8px 27px #a682ff35; }
.btn-primary:not(:disabled):not([aria-disabled=true]):hover { background: var(--violet-hover); color: var(--violet-ink); transform: translateY(-2px); }
.btn-outline { border-color: var(--line-strong); background: var(--raised); }
.btn-outline:not(:disabled):hover { background: var(--raised-hover); border-color: var(--dim); color: var(--text); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn[aria-disabled=true] { pointer-events: none; }

.badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
}
.badge-violet { background: var(--violet-tint); color: var(--violet-text); }
.badge-live { background: var(--cyan-tint); color: var(--cyan-text); animation: pulse 2s ease-in-out infinite; }
.badge-ready { background: var(--green-tint); color: var(--green-text); }
.badge-failed { background: var(--red-tint); color: var(--red-text); }
@keyframes pulse { 50% { opacity: .55; } }

.input {
  width: 100%; min-height: 44px; padding: 10px 14px; font: inherit; font-size: 15px;
  color: var(--text); caret-color: var(--cyan);
  background: var(--raised); border: 1px solid var(--line-input); border-radius: 12px;
}
.input::placeholder { color: var(--placeholder); }
.input:hover { border-color: var(--dim); }
.input:focus-visible { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px #75e9ef26; }
.input[aria-invalid=true] { border-color: var(--red-text); }
textarea.input { resize: vertical; line-height: 1.5; }
select.input { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23aeb4c5' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.link {
  border: 0; background: none; padding: 0; font: inherit; color: var(--violet-text);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.kicker { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--cyan); }

/* ---- header ---- */

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 0; position: relative; z-index: 5; }
.brand { font-size: 23px; font-weight: 700; letter-spacing: -.02em; color: var(--text); text-decoration: none; flex: none; }
.nav { display: flex; gap: 32px; }
.nav a { color: var(--muted-2); text-decoration: none; }
.nav a:hover { color: var(--text); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.recent-wrap { position: relative; }
.narrow { display: none; }

.recent-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 280px; z-index: 10;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 60px #0008; padding: 6px;
}
.recent-menu button {
  display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px;
  background: none; border: 0; border-radius: 10px; font: inherit; font-size: 14px; color: var(--text);
  text-align: left; cursor: pointer;
}
.recent-menu button:hover { background: var(--raised); }
.recent-menu button[aria-current=true] { background: var(--violet-tint); color: var(--violet-text); }
.recent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-when { color: var(--dim); font-size: 12px; flex: none; }
.recent-empty { padding: 10px 12px; font-size: 14px; color: var(--muted); }

/* ---- hero ---- */

.hero { padding: 80px 0 64px; }
.hero-copy { max-width: 56rem; }
.eyebrow {
  display: inline-flex; border-radius: 999px; border: 1px solid #62517e; background: #241e32;
  padding: 8px 16px; font-size: 12px; font-weight: 700; letter-spacing: .025em; color: #c9b4ff;
}
.hero-title {
  font-family: var(--font-display); font-weight: 700; font-size: 32px;
  line-height: 1.05; letter-spacing: -.055em; margin: 28px 0 24px; text-wrap: balance;
}
.hero-lede { max-width: 42rem; font-size: 19px; line-height: 1.65; color: var(--muted-2); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 32px; }
.trust { color: var(--muted); font-size: 14px; }

.reveal { animation: rise .65s both; }
.delay-1 { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---- workspace ---- */

.workspace { margin-top: 56px; border-radius: 28px; padding: 24px; scroll-margin-top: 32px; }
.ws-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; padding: 0 4px; }
.ws-title { display: flex; align-items: center; gap: 10px; }
.ws-title h2 { font-size: 17px; font-weight: 400; }
.live-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--cyan); box-shadow: 0 0 13px var(--cyan); }

.banner {
  margin-bottom: 20px; padding: 12px 16px; border-radius: 12px; font-size: 14px;
  border: 1px solid var(--red-line); background: var(--red-tint); color: var(--red-text); overflow-wrap: anywhere;
}

.back { margin-bottom: 20px; }

.setup { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.setup-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.drop-zone {
  min-height: 245px; border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: 1.5px dashed #66627d; background: linear-gradient(135deg, #252136, #191e2b);
  transition: .2s; cursor: pointer;
}
.drop-zone.compact { min-height: 0; padding: 20px 24px; }
.drop-zone.compact .drop-icon { display: none; }
.drop-zone.is-over {
  border-color: var(--cyan); background: #18343c; transform: scale(1.01);
  box-shadow: inset 0 0 0 2px #75e9ef55, 0 0 35px #75e9ef24;
}
.drop-icon {
  width: 56px; height: 56px; border-radius: 16px; margin-bottom: 16px;
  display: grid; place-items: center; background: #a682ff25; color: #bda4ff;
}
.drop-title { font-size: 21px; font-weight: 400; }
.drop-help { margin: 4px 0 16px; font-size: 14px; color: var(--muted); }
.drop-note { margin-top: 14px; min-height: 20px; font-size: 14px; color: var(--cyan-text); }
.drop-note:empty { display: none; }

.files { display: flex; flex-direction: column; gap: 6px; }
.files:empty { display: none; }
.file {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 32px; gap: 12px; align-items: center;
  padding: 10px 8px 10px 14px; border-radius: 12px; background: var(--panel-deep); border: 1px solid var(--line-soft);
}
.file-icon { color: var(--violet-glow); display: grid; }
.file-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.file-line { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.file-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 12px; color: var(--dim); flex: none; }
.file-bar { height: 4px; border-radius: 999px; background: var(--raised-hover); overflow: hidden; }
.file-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet), var(--cyan)); transition: width .2s; }
.file-status { font-size: 12px; color: var(--cyan-text); min-width: 58px; text-align: right; }
.file-status.bad { color: var(--red-text); }
.file-remove {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: none;
  color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.file-remove:hover { background: var(--raised-hover); color: var(--text); }

.composer { padding: 20px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 16px; font-weight: 700; }
.field-label.lg { font-size: 18px; font-weight: 400; }
.field-label.sm { font-size: 13px; font-weight: 600; color: var(--muted-2); }
.label-row { display: flex; align-items: baseline; gap: 8px; }
.optional, .count { font-size: 12px; color: var(--dim); }
.count { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hint { font-size: 13px; color: var(--muted); }
.hint:empty { display: none; }
#direction { min-height: 96px; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; background: none;
  font: inherit; font-size: 15px; color: var(--text-soft); cursor: pointer; transition: .2s;
}
.chip:hover { border-color: var(--cyan); }
.chip[aria-pressed=true] { color: #111927; background: var(--cyan); border-color: var(--cyan); font-weight: 600; }
.chip-input { width: 150px; min-height: 36px; padding: 6px 14px; border-radius: 999px; font-size: 14px; }

.disclosure { border-top: 1px solid var(--line-soft); }
.disclosure summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 44px;
  font-size: 14px; font-weight: 600; color: var(--muted-2); cursor: pointer; list-style: none;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary:hover { color: var(--text); }
.disclosure summary svg { transition: transform .15s; }
.disclosure[open] summary svg { transform: rotate(180deg); }
.advanced { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; padding: 4px 0 8px; }

.composer-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.status { flex: 1; min-width: 170px; font-size: 14px; color: var(--cyan-text); }

/* ---- studio ---- */

.studio-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.version-select { width: auto; max-width: min(320px, 100%); min-height: 36px; padding: 6px 34px 6px 12px; font-size: 13px; font-weight: 600; }
.version-select:disabled { opacity: .55; cursor: default; }
.note-count { margin-left: 0; text-align: right; }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

.progress { order: 2; padding: 16px; display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.panel-head h3, .chat h3 { font-size: 15px; font-weight: 700; }
.chat h3 { font-size: 18px; }
.elapsed { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }

.steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.stage { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 8px 6px; border-radius: 12px; transition: background .3s; }
.stage[data-state=active] { background: #1d2130; }
.stage-icon {
  width: 20px; height: 20px; margin-top: 1px; border-radius: 999px; border: 2px solid var(--line-strong);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--violet-ink);
}
.stage[data-state=active] .stage-icon { border-color: var(--raised-hover); border-top-color: var(--cyan); animation: spin .8s linear infinite; }
.stage[data-state=done] .stage-icon { background: var(--violet); border-color: var(--violet); }
.stage[data-state=done] .stage-icon::after { content: "✓"; }
.stage[data-state=failed] .stage-icon { background: var(--red-text); border-color: var(--red-text); color: var(--red-tint); }
.stage[data-state=failed] .stage-icon::after { content: "!"; }
.stage-name { font-size: 14px; font-weight: 600; color: var(--dim); }
.stage[data-state=active] .stage-name, .stage[data-state=done] .stage-name, .stage[data-state=failed] .stage-name { color: var(--text); }
.stage-detail { margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--faint); overflow-wrap: anywhere; }
.stage[data-state=active] .stage-detail { color: var(--cyan-text); }
.stage[data-state=done] .stage-detail { color: var(--muted); }
.stage[data-state=failed] .stage-detail { color: var(--red-text); }
@keyframes spin { to { transform: rotate(360deg); } }

.brief { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.brief-direction { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.brief-direction.empty { color: var(--faint); }
.brief-meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.brief-meta span { border-radius: 999px; background: var(--bubble-bot); padding: 4px 10px; font-size: 11px; color: var(--violet-text); }

.log { margin-top: 16px; }
.log pre {
  margin: 0; padding: 0 0 8px; font-family: var(--font-mono); font-size: 11px; line-height: 1.7;
  color: var(--muted); max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}

.stage-panel { order: 1; padding: 20px; background: var(--panel-deeper); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.video-frame {
  position: relative; width: 100%; max-width: 290px; aspect-ratio: 9 / 16; overflow: hidden;
  border-radius: 26px; border: 4px solid #303343; background: #141726;
}
.video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.frame-visual { position: absolute; inset: 0; }
.frame-overlay { position: absolute; inset: auto 0 0; padding: 12px; }
.overlay-card { border-radius: 12px; background: #0b0d16d9; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 12px; }
.overlay-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; }
.overlay-time { color: var(--cyan-text); font-variant-numeric: tabular-nums; }
.overlay-bar { margin-top: 8px; height: 6px; border-radius: 999px; background: var(--raised-hover); overflow: hidden; }
.overlay-bar > span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--violet), var(--cyan)); transition: width 1s linear; }
.overlay-step { margin-top: 6px; font-size: 11px; color: var(--muted); }

/* What the frame shows while a step runs. Decorative; the words come from the job. */
.fv { position: absolute; inset: 0; padding: 22px 14px 0; display: flex; flex-direction: column; }
.fv-center { align-items: center; justify-content: center; text-align: center; padding: 20px 20px 110px; gap: 10px; }
.fv-label { font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--cyan-text); }
.fv-label.violet { color: var(--violet-text); }
.fv-big { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.05; letter-spacing: -.03em; }
.fv-sub { font-size: 13px; color: var(--muted); }
.fv-live { margin-top: 14px; font-size: 13px; line-height: 1.4; color: var(--cyan-text); }
.fv-alert { width: 52px; height: 52px; border-radius: 999px; display: grid; place-items: center; background: var(--red-tint); color: var(--red-text); }
.fv-failed { font-size: 18px; font-weight: 700; line-height: 1.3; }

.tiles { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tile {
  aspect-ratio: 9 / 16; border-radius: 10px; padding: 6px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(160deg, #282047, #1a2335); color: var(--dim);
  opacity: .35; animation: tile-in .5s var(--d) both; transition: opacity .4s, box-shadow .4s, color .4s;
}
.tile-name { font-size: 9px; line-height: 1.2; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tile[data-state=current] { opacity: 1; color: var(--cyan-text); box-shadow: inset 0 0 0 2px var(--cyan); animation: tile-in .5s var(--d) both, pulse 1.4s ease-in-out infinite; }
.tile[data-state=seen] { opacity: 1; color: var(--text-soft); background: linear-gradient(160deg, #3a2a66, #12636f); }
.tile.more { align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
@keyframes tile-in { from { opacity: 0; transform: scale(.9); } }
.scanline {
  position: absolute; inset-inline: 0; top: -40%; height: 40%; pointer-events: none;
  background: linear-gradient(180deg, transparent, #75e9ef2e 80%, var(--cyan)); opacity: .5;
  animation: sweep 2.4s linear infinite;
}
@keyframes sweep { to { top: 100%; } }

.beats { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.beat {
  display: grid; grid-template-columns: 22px 1fr; gap: 4px 10px; align-items: center;
  border-radius: 12px; padding: 10px; background: #1d2130; border: 1px solid var(--line-soft);
  opacity: 0; transform: translateY(10px); animation: pop-in .45s var(--d) forwards;
}
.beat-num { grid-row: span 2; width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; background: var(--violet-tint); color: var(--violet-text); font-size: 11px; font-weight: 700; }
.shimmer {
  height: 7px; border-radius: 999px;
  background: linear-gradient(90deg, var(--raised-hover) 0%, #4a4466 50%, var(--raised-hover) 100%);
  background-size: 200% 100%; animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pop-in { to { opacity: 1; transform: none; } }

.tracks { position: relative; margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.track { display: flex; gap: 4px; height: 36px; }
.seg { border-radius: 6px; transform: scaleX(0); transform-origin: left; animation: grow .35s var(--d) forwards; }
.playhead { position: absolute; top: -6px; bottom: -6px; width: 2px; left: 0; background: #fff; box-shadow: 0 0 10px #fff; animation: play-sweep 6s linear infinite; }
@keyframes grow { to { transform: scaleX(1); } }
@keyframes play-sweep { to { left: 100%; } }

.fv-render {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #282047, #6749a0 55%, #12636f);
  clip-path: inset(100% 0 0 0); animation: fill-up 60s cubic-bezier(.2, .6, .3, 1) forwards;
}
@keyframes fill-up { to { clip-path: inset(8% 0 0 0); } }

.failed { width: 100%; max-width: 420px; margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.failed-lead { font-size: 14px; font-weight: 600; }
.error-box {
  padding: 12px 14px; border-radius: 12px; background: var(--red-tint); border: 1px solid var(--red-line); color: var(--red-text);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.55; word-break: break-word; white-space: pre-wrap;
  max-height: 200px; overflow: auto;
}
.failed .btn { align-self: flex-start; }
.failed-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.downloads { margin-top: 20px; width: 100%; max-width: 290px; display: grid; gap: 8px; }
.downloads .btn { padding: 12px 20px; }
.action-note { margin-top: 12px; min-height: 20px; text-align: center; font-size: 14px; color: var(--muted); }

.chat { order: 3; padding: 16px; display: flex; flex-direction: column; background: var(--panel); }
.chat-sub { margin-top: 4px; font-size: 14px; color: var(--muted); }
.chat-log { margin-top: 16px; flex: 1; min-height: 200px; max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.bubble { max-width: 88%; border-radius: 16px; padding: 10px 14px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.assistant { background: var(--bubble-bot); border-top-left-radius: 6px; }
.bubble.user { margin-left: auto; background: var(--bubble-user); border-top-right-radius: 6px; }
.chat-form { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.chat-box {
  display: flex; align-items: flex-end; gap: 8px; border-radius: 16px; padding: 8px;
  border: 1px solid var(--line-input); background: var(--raised);
}
.chat-box:focus-within { border-color: var(--cyan); }
.chat-box textarea {
  flex: 1; min-width: 0; resize: none; border: 0; background: transparent; padding: 4px 8px;
  font: inherit; font-size: 15px; color: var(--text);
}
.chat-box textarea::placeholder { color: var(--placeholder); }
.chat-box textarea:focus-visible { outline: none; }
.send { border-radius: 12px; padding: 10px 12px; }

/* ---- below the workspace ---- */

.how { padding: 96px 0; scroll-margin-top: 32px; }
.how-head { max-width: 36rem; margin-bottom: 40px; }
.how-head .kicker { font-weight: 400; font-size: 12px; }
.how-head h2 { margin-top: 12px; font-size: 36px; font-weight: 400; letter-spacing: -.02em; line-height: 1.15; }
.how-grid { display: grid; gap: 16px; }
.how-card { border-radius: 16px; padding: 28px; border: 1px solid var(--line); background: var(--panel); }
.how-icon { margin-bottom: 24px; display: block; }
.how-icon.cyan { color: var(--cyan); }
.how-icon.violet { color: #b69aff; }
.how-card h3 { font-size: 20px; font-weight: 400; margin-bottom: 8px; }
.how-card p { color: var(--muted); line-height: 1.65; }

.closing-wrap { padding-bottom: 80px; }
.closing {
  border-radius: 28px; border: 1px solid #604d8a; padding: 64px 56px; text-align: center;
  background: linear-gradient(125deg, #302248, #172934);
}
.closing h2 { font-size: 40px; font-weight: 400; letter-spacing: -.02em; line-height: 1.15; }
.closing p { margin: 12px 0 28px; color: #c7c9d8; }

.foot {
  border-top: 1px solid var(--line); padding: 28px 0; display: flex; flex-wrap: wrap; gap: 8px 16px;
  justify-content: space-between; align-items: center; font-size: 13px; color: var(--placeholder);
}
.foot-brand { font-weight: 700; font-size: 16px; color: var(--text); }
.foot code { overflow-wrap: anywhere; color: var(--muted-2); }

/* ---- layout breakpoints ---- */

@media (min-width: 768px) {
  .how-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .setup { grid-template-columns: 1fr 1fr; }
  .studio-grid { grid-template-columns: 230px minmax(0, 1fr) 340px; }
  .progress { order: 1; }
  .stage-panel { order: 2; }
  .chat { height: 700px; }
  .chat-log { max-height: none; }
}
@media (max-width: 767px) {
  .nav { display: none; }
  .hero { padding-top: 48px; }
  .workspace { padding: 16px; border-radius: 22px; }
  .closing { padding: 48px 24px; }
  .closing h2, .how-head h2 { font-size: 30px; }
}
@media (max-width: 640px) {
  .page-width { width: min(100% - 28px, 1180px); }
  .wide { display: none; }
  .narrow { display: inline; }
  #newProject { padding: 9px 11px; }
  .recent-menu { position: fixed; top: 72px; left: 14px; right: 14px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
