/* TakeOne — dark cinematic studio, Veo-style: the film is the hero,
   one floating prompt composer at the bottom, pill controls, a shot strip. */
:root {
  --bg: #0b0c0f;
  --bg-2: #121318;
  --surface: #17181e;
  --surface-2: #1f2129;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #eef0f5;
  --text-2: #a3a7b3;
  --text-3: #6d7280;
  --accent: #8ab4ff;
  --accent-2: #c58af9;
  --grad: linear-gradient(120deg, #6ea8ff 0%, #a98bff 50%, #ff8ad8 100%);
  --ok: #7fd8a4;
  --err: #ff8a8a;
  --warn: #f2c66d;
  --radius: 22px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --dock-h: 200px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { touch-action: manipulation; -webkit-text-size-adjust: 100%; overscroll-behavior: none; margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(110, 140, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at 90% 110%, rgba(255, 120, 210, 0.06), transparent 60%),
    var(--bg);
}
button, select, input, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dim { color: var(--text-3); }

/* ---- top bar ---------------------------------------------------------------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 20px 12px;
  background: linear-gradient(var(--bg), rgba(11, 12, 15, 0.7));
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { display: block; width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 0 24px rgba(140, 150, 255, 0.45); }  /* assets/brand/takeone.svg: a clapperboard, take 1 */
.name { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.badge { font-size: 11px; font-weight: 600; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 9px; }
.bar-link { color: var(--text-2); text-decoration: none; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); }
.bar-link:hover { color: var(--text); border-color: var(--line-2); }

/* ---- stage ------------------------------------------------------------------- */
.app { max-width: 1180px; margin: 0 auto; padding: 8px 20px calc(var(--dock-h) + 40px); }
.stage { display: flex; flex-direction: column; gap: 14px; }
.screen-wrap { display: flex; justify-content: center; }
.screen {
  position: relative; width: min(100%, calc((100dvh - var(--dock-h) - 150px) * 16 / 9)); aspect-ratio: 16 / 9; min-height: 220px;
  border-radius: var(--radius); overflow: hidden; background: #050506;
  box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, 0.55);
}
.screen.v916 { width: auto; height: max(320px, calc(100dvh - var(--dock-h) - 150px)); }
.screen.v11 { width: auto; height: max(300px, calc(100dvh - var(--dock-h) - 150px)); }
/* on wider screens the welcome screen stays wide whatever frame is picked; the frame
   shape applies once there's a film (phones have their own welcome layout below) */
@media (min-width: 641px) {
  .screen.v916:has(#empty:not([hidden])), .screen.v11:has(#empty:not([hidden])) {
    width: min(100%, calc((100dvh - var(--dock-h) - 150px) * 16 / 9)); height: auto; aspect-ratio: 16 / 9 !important;  /* over the frame set inline */
  }
}
.screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.screen:fullscreen { border-radius: 0; max-height: none; }

.screen-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 10px;
  background: radial-gradient(70% 90% at 50% 40%, #1a1c26 0%, #08090c 100%);
}
.screen-empty h1 { margin: 0; font-size: clamp(22px, 3.4vw, 38px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; max-width: 22ch;
  background: linear-gradient(180deg, #fff, #b9bfd0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.screen-empty .sub { margin: 0; color: var(--text-2); max-width: 52ch; font-size: 14px; }
.orb { flex: none; width: 70px; height: 70px; border-radius: 50%; background: var(--grad); filter: blur(0.5px); margin-bottom: 8px;
  box-shadow: 0 0 60px rgba(150, 140, 255, 0.55), inset 0 -10px 30px rgba(0, 0, 0, 0.25); animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); box-shadow: 0 0 90px rgba(150, 140, 255, 0.75), inset 0 -10px 30px rgba(0, 0, 0, 0.25); } }

/* progress: a glass card on the screen while generating */
/* live progress card: overall bar, time left, the shots as they're made, then the steps */
.progress {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 18px 20px; width: min(400px, 88%); max-height: 92%; overflow-y: auto;
  display: none; flex-direction: column; gap: 10px;
  background: rgba(18, 19, 25, 0.82); backdrop-filter: blur(18px);
  border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.progress:has(li.active), .progress:has(li.error) { display: flex; }
.p-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.p-pct { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.p-time { font: 12px var(--mono); color: var(--text-2); text-align: right; }
.p-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.p-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); background-size: 200% 100%; animation: p-flow 2.4s linear infinite; transition: width 0.45s ease-out; }
@keyframes p-flow { to { background-position: -200% 0; } }
.p-now { margin: 0; font-size: 13px; color: var(--text); min-height: 1.4em; }
.p-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.p-strip[hidden] { display: none; }
.p-shot { position: relative; flex: none; height: 46px; aspect-ratio: 16 / 9; border-radius: 7px; background: var(--surface-2) center/cover no-repeat; border: 1px solid var(--line); transition: opacity 0.3s; }
.p-shot.v916 { aspect-ratio: 9 / 16; }
.p-shot.v11 { aspect-ratio: 1; }
.p-shot:not([data-state]) { animation: p-wait 1.6s ease-in-out infinite; }
.p-shot[data-state='painted'] { animation: p-pop 0.35s ease-out; }
.p-shot[data-state='animated']::after, .p-shot[data-state='synced']::after { content: '✓'; position: absolute; right: 3px; bottom: 2px; font-size: 11px; font-weight: 700; color: #0b0c0f; background: var(--ok); border-radius: 50%; width: 15px; height: 15px; display: grid; place-items: center; }
@keyframes p-wait { 50% { opacity: 0.45; } }
@keyframes p-pop { from { transform: scale(0.8); opacity: 0; } }
.steps { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-3); }
.steps li::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.steps li.active { color: var(--text); }
.steps li.active::before { border-color: var(--accent) transparent var(--accent) var(--accent); animation: spin 0.9s linear infinite; }
.steps li.done { color: var(--text-2); }
.steps li.done::before { border: none; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%230b0c0f' stroke-width='2'/%3E%3C/svg%3E") center/12px no-repeat; }
.steps li.error { color: var(--err); }
.steps li.error::before { border-color: var(--err); }
.steps li > span:first-child { flex: 1; }
.steps .pct { font: 12px var(--mono); color: var(--text-2); }
.steps li .btn-primary, .steps li .btn-ghost { margin-left: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

.screen-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 5, 8, 0.6); backdrop-filter: blur(6px); }
.busy-card { width: min(360px, 86%); background: rgba(18, 19, 25, 0.9); border: 1px solid var(--line-2); border-radius: 18px; padding: 20px; text-align: center; }
.busy-title { margin: 0 0 12px; font-weight: 600; }
.bar-track { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-track i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width 0.3s; }
.busy-sub { margin: 10px 0 14px; color: var(--text-2); font-size: 13px; }

/* ---- transport --- (hidden until a film exists) */
.transport:has(#play:disabled) { display: none; }
/* ---- transport --------------------------------------------------------------- */
.transport { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.btn-icon { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; }
.btn-icon svg { width: 18px; height: 18px; fill: currentColor; }
.btn-icon.play { background: #fff; color: #0b0c0f; border: none; }
.btn-icon:disabled { opacity: 0.35; cursor: default; }
.tc { font: 12px var(--mono); color: var(--text-2); min-width: 0; }
.scrub { position: relative; flex: 1; height: 24px; display: flex; align-items: center; }
.marks { position: absolute; inset: 0; pointer-events: none; }
.marks i { position: absolute; top: 8px; width: 2px; height: 8px; border-radius: 1px; background: rgba(255, 255, 255, 0.22); }
.scrub input { width: 100%; appearance: none; -webkit-appearance: none; background: transparent; height: 24px; margin: 0; position: relative; }
.scrub input::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--surface-2); }
.scrub input::-moz-range-track { height: 4px; border-radius: 4px; background: var(--surface-2); }
.scrub input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; margin-top: -5px; box-shadow: 0 0 0 4px rgba(138, 180, 255, 0.25); }
.scrub input::-moz-range-thumb { width: 14px; height: 14px; border: none; border-radius: 50%; background: #fff; }
.btn-export {
  height: 40px; padding: 0 18px; border-radius: 999px; border: none; cursor: pointer; font-weight: 600;
  background: #fff; color: #0b0c0f; display: inline-flex; align-items: center; gap: 8px; flex: none;
}
.btn-export::before { content: ''; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v11m0 0l-5-5m5 5l5-5M5 20h14' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v11m0 0l-5-5m5 5l5-5M5 20h14' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.btn-export:disabled { opacity: 0.3; cursor: default; }

/* ---- shot strip -------------------------------------------------------------- */
.board-head { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 4px 0; }
.board-head h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; }
.board-head:has(+ .board:empty) { display: none; }
.board { display: flex; gap: 12px; overflow-x: auto; padding: 2px 4px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.card {
  flex: 0 0 220px; scroll-snap-align: start; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card.now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 30px rgba(110, 150, 255, 0.18); }
.card .thumb { aspect-ratio: 16 / 9; border-radius: 10px; background: var(--surface-2) center/cover no-repeat; margin: -2px -2px 2px; }
.card .slugline { font: 10.5px var(--mono); color: var(--text-3); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .shot { display: flex; gap: 6px; align-items: center; }
.card .tag { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.card .tag.mood { color: var(--accent-2); }
.card .line { font-size: 13px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .who { font-size: 12px; color: var(--accent); }

/* ---- composer dock ----------------------------------------------------------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(11, 12, 15, 0.92) 30%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.samples { display: flex; gap: 8px; overflow-x: auto; max-width: 860px; width: 100%; scrollbar-width: none; padding: 2px; }
.samples::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-size: 13px; white-space: nowrap;
  border: 1px solid var(--line-2); background: rgba(23, 24, 30, 0.8); color: var(--text-2); backdrop-filter: blur(10px);
}
.chip:hover { color: var(--text); }
.chip[aria-pressed='true'] { color: var(--text); border-color: var(--accent); background: rgba(138, 180, 255, 0.12); }
.composer {
  width: 100%; max-width: 860px; background: rgba(28, 29, 36, 0.92); backdrop-filter: blur(20px);
  border: 1px solid var(--line-2); border-radius: 26px; padding: 14px 14px 10px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.composer:focus-within { border-color: rgba(138, 180, 255, 0.55); box-shadow: 0 0 0 4px rgba(138, 180, 255, 0.10), 0 20px 60px rgba(0, 0, 0, 0.55); }
#story {
  width: 100%; border: none; outline: none; resize: none; background: transparent; color: var(--text);
  font-size: 15px; line-height: 1.5; height: 68px; padding: 0; overflow-y: auto;
}
#story::placeholder { color: var(--text-3); }
.composer-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; position: relative; }
.spacer { flex: 1; }
.pill {
  height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: 13px; list-style: none; user-select: none;
}
.pill:hover { color: var(--text); }
.pill svg { width: 16px; height: 16px; }
.pill::-webkit-details-marker { display: none; }
.server-pill .dot, .server-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.server-status { display: flex; align-items: center; gap: 8px; margin: -2px 0 0; font-size: 12px; color: var(--text-2); }
.server-status .bar, .server-status .tip { display: none; }
.server-status.loading { flex-wrap: wrap; row-gap: 6px; }
.server-status.loading .bar { display: block; flex-basis: 100%; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.server-status.loading .bar i { display: block; height: 100%; width: var(--pct, 0%); border-radius: 3px; transition: width 0.9s ease;
  background: linear-gradient(90deg, var(--warn), #f5c26b, var(--warn)); background-size: 200% 100%; animation: sr-shimmer 1.6s linear infinite; }
.server-status.loading .tip { display: block; flex-basis: 100%; color: var(--text-3); font-size: 12px; }
@keyframes sr-shimmer { from { background-position: 200% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .server-status.loading .bar i { animation: none; } }
[data-server='ready'] .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(127, 216, 164, 0.18); }
[data-server='starting'] .dot, [data-server='checking'] .dot { background: var(--warn); animation: server-pulse 1.4s ease-in-out infinite; }
[data-server='down'] .dot { background: var(--err); }
@keyframes server-pulse { 50% { opacity: 0.35; } }
.select-pill select { appearance: none; -webkit-appearance: none; border: none; background: transparent; color: inherit; font-size: 13px; cursor: pointer; padding-right: 2px; outline: none; }
.select-pill select option, .field select option { background: var(--surface); color: var(--text); }
.settings[open] > .pill { color: var(--text); border-color: var(--accent); }
.popover {
  position: absolute; left: -6px; bottom: calc(100% + 14px); width: min(520px, calc(100vw - 32px));
  background: rgba(24, 25, 32, 0.98); backdrop-filter: blur(20px); border: 1px solid var(--line-2);
  border-radius: 20px; padding: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6); max-height: 60dvh; overflow: auto;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); }
.field select, .field input {
  height: 38px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); padding: 0 10px; font-size: 13px; width: 100%;
}
.field input[type='file'] { padding: 6px 10px; }
.checks { grid-column: 1 / -1; display: flex; gap: 16px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.ai-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.hint { margin: 0; font-size: 12px; color: var(--text-3); }

.btn-make {
  height: 40px; padding: 0 18px 0 14px; border-radius: 999px; border: none; cursor: pointer; font-weight: 600; font-size: 14px;
  color: #0b0c0f; background: #fff; display: inline-flex; align-items: center; gap: 8px; transition: transform 0.15s, box-shadow 0.2s;
}
.btn-make::before {
  content: ''; width: 18px; height: 18px; background: var(--grad); border-radius: 50%;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.4 7.6L22 12l-7.6 2.4L12 22l-2.4-7.6L2 12l7.6-2.4z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.4 7.6L22 12l-7.6 2.4L12 22l-2.4-7.6L2 12l7.6-2.4z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.btn-make:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(160, 160, 255, 0.35); }
.btn-make:disabled { cursor: default; background: var(--surface-2); color: var(--text-2); }
.btn-make:disabled::before { animation: spin 1.2s linear infinite; }

.enhance-pill i { font-style: normal; }
.enhance-pill[aria-busy='true'] { opacity: 0.75; cursor: progress; }
.btn-primary { height: 34px; padding: 0 14px; border-radius: 999px; border: none; background: #fff; color: #0b0c0f; font-weight: 600; cursor: pointer; }
.btn-ghost { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; }

/* ---- shot review (before animating) ------------------------------------------ */
.review { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: rgba(11, 12, 15, 0.97); }
.review-head { padding: 20px 20px 8px; max-width: 1100px; width: 100%; margin: 0 auto; }
.review-head h2 { margin: 0 0 4px; font-size: 20px; }
.review-head p { margin: 0; font-size: 13px; }
.review-grid { flex: 1; overflow-y: auto; padding: 12px 20px; max-width: 1100px; width: 100%; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); grid-auto-rows: max-content; gap: 14px; align-content: start; }
.review-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.review-card .pic { position: relative; background: var(--bg-2); min-height: 120px; flex: none; }  /* never squeezed: the Redo row stays below */
.review-card img { display: block; width: 100%; height: auto; max-height: 52vh; object-fit: cover; }
.review-card .pic.busy img { opacity: 0.35; }
.review-card .pic .state { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--text); }
.review-card .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.review-card .cap { margin: 0; font-size: 12px; color: var(--text-2); line-height: 1.4; }
.review-card .cap b { color: var(--text); font-weight: 600; }
.review-card .row { display: flex; gap: 8px; }
.review-card input { flex: 1; min-width: 0; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); padding: 0 10px; font-size: 16px; }
.review-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); max-width: 1100px; width: 100%; margin: 0 auto; border-top: 1px solid var(--line); }
.review-foot .btn-primary, .review-foot .btn-ghost { height: 42px; padding: 0 20px; font-size: 15px; }

/* ---- toast ------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 50;
  max-width: min(560px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 14px; font-size: 13px;
  background: rgba(30, 31, 39, 0.96); border: 1px solid var(--line-2); box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
}
.toast.err { border-color: rgba(255, 138, 138, 0.5); color: #ffd0d0; }

/* ---- phones ------------------------------------------------------------------ */
@media (max-width: 640px) {
  .app { padding: 4px 12px calc(var(--dock-h) + 30px); }
  .screen { border-radius: 16px; width: 100%; }
  .screen:has(#empty:not([hidden])) { aspect-ratio: auto; height: calc(100dvh - var(--dock-h) - 110px); }
  .screen-empty h1 { font-size: 22px; }
  .orb { width: 48px; height: 48px; }
  .screen-empty .sub { font-size: 13px; }
  .transport { gap: 8px; }
  .tc.dim, #fs { display: none; }
  .btn-export { padding: 0 14px; }
  .card { flex-basis: 180px; }
  .dock { padding: 8px 10px max(10px, env(safe-area-inset-bottom)); }
  .composer { border-radius: 22px; padding: 12px 12px 8px 14px; }
  #story { font-size: 16px; height: 72px; }
  .field-grid { grid-template-columns: 1fr; }
  .pill span { display: none; }
  .server-pill .dot { display: block; }
  .pill { padding: 0 11px; }
  .composer-row { flex-wrap: nowrap; gap: 6px; }
  .btn-make { width: 44px; height: 44px; padding: 0; justify-content: center; font-size: 0; flex: none; }
  .btn-make::before { width: 20px; height: 20px; }
  /* 16px inputs stop iOS from zooming in on focus */
  .field select, .field input, .select-pill select { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.steps li { flex-wrap: wrap; }
