/* Shorts Forge. Same frame as Launchpad (calm, plain), with a warm accent so the two apps are easy to tell apart. */
:root {
  --bg: #f4f2ef; --surface: #ffffff; --surface-2: #f7f5f2;
  --ink: #1d1a16; --ink-2: #463f37; --muted: #6f665c;
  --line: #e2ddd5; --line-strong: #c9c1b6;
  --accent: #c2410c; --accent-ink: #ffffff; --accent-soft: #fbe7dc;
  --good: #1d7446; --good-bg: #e0f1e6;
  --warn: #8d5600; --warn-bg: #f8ecd6;
  --bad: #b3261e; --bad-bg: #fbe4e1;
  --shadow: 0 1px 2px rgba(29, 26, 22, .05), 0 6px 20px rgba(29, 26, 22, .05);
  --body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12100e; --surface: #1b1815; --surface-2: #221e1a; --ink: #efe9e2; --ink-2: #cfc6bb; --muted: #9a9086;
    --line: #2f2a24; --line-strong: #453e35; --accent: #ff8a4c; --accent-ink: #1b0d05; --accent-soft: #3a2116;
    --good: #6fd39a; --good-bg: #13301f; --warn: #f2b64f; --warn-bg: #33270f; --bad: #ff8a7e; --bad-bg: #3a1a17;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12100e; --surface: #1b1815; --surface-2: #221e1a; --ink: #efe9e2; --ink-2: #cfc6bb; --muted: #9a9086;
  --line: #2f2a24; --line-strong: #453e35; --accent: #ff8a4c; --accent-ink: #1b0d05; --accent-soft: #3a2116;
  --good: #6fd39a; --good-bg: #13301f; --warn: #f2b64f; --warn-bg: #33270f; --bad: #ff8a7e; --bad-bg: #3a1a17;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--body); }
h1, h2 { margin: 0; text-wrap: balance; letter-spacing: -.005em; }
h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 700; line-height: 1.15; }
h2 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
img { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
code { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--bad); font-weight: 600; }
.d { display: block; }
.mt { margin-top: 18px; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-block; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.sync { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.out { margin: 0; }
.banner { padding: 10px 0; }
.wrap-in { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.warn-bg { background: var(--warn-bg); color: var(--warn); }

/* Layout */
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 18px; }
.intro { display: flex; flex-direction: column; gap: 4px; }
.crumb { margin-bottom: 2px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card h2 { margin-bottom: 8px; }
.card.slim { padding: 10px 14px; }
.good-card { background: var(--good-bg); color: var(--good); border-color: transparent; font-weight: 600; }
.warn-card { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.stack input { width: 100%; }

/* Buttons and tags */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--surface-2); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn[disabled] { opacity: .55; cursor: default; }
form { margin: 0; }
form.inline { display: inline-flex; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.ok { background: var(--good-bg); border-color: transparent; color: var(--good); }
.tag.work { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.tag.bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); }

/* Shorts grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { padding: 0; overflow: hidden; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; }
.tile:hover { border-color: var(--line-strong); }
.thumb { aspect-ratio: 9 / 16; background: var(--surface-2); display: flex; align-items: center; justify-content: center; max-height: 300px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { color: var(--muted); font-weight: 600; }
.tile-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Short page */
.split { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.preview { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 70px; }
@media (max-width: 760px) { .preview { position: static; } }
.phone { width: 100%; aspect-ratio: 9 / 16; border-radius: 12px; background: #000; display: block; }
.phone.empty { background: var(--surface-2); border: 1px dashed var(--line-strong); display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 20px; }
.form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.form h2 { margin: 14px 0 2px; }
.form h2:first-of-type { margin-top: 0; }
.form label { font-weight: 600; font-size: 14px; margin-top: 4px; }
.form input:not([type=file]), .form select, .form textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: var(--surface-2); }
.form textarea { resize: vertical; line-height: 1.45; }
.form #script { font-size: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
.actions { margin-top: 12px; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%;
  display: inline-block; animation: spin 0.9s linear infinite; vertical-align: middle; margin-bottom: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Voices */
.voices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.voices li { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.voices li:last-child { border-bottom: 0; }
.vrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.voices audio { width: 100%; max-width: 420px; height: 36px; }
.voices select { padding: 4px 6px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); }
form.row input[name=q] { flex: 1 1 220px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); }
.stack input { padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); }

/* Login and messages */
.login { max-width: 380px; margin: 60px auto; display: flex; flex-direction: column; gap: 12px; }
.login form { display: flex; flex-direction: column; gap: 10px; }
.login input { padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); }
.msg { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
