:root {
  --bg: #f6f3ee; --surface: #ffffff; --ink: #1d1b18; --muted: #6b655c; --line: #e4ded4;
  --accent: #1f5c46; --accent-ink: #ffffff; --bubble: #ece6dc; --warn: #8a5a00; --warn-bg: #fff4dc;
  --ok: #1f7a4d; --bad: #a33a2b; --radius: 18px; --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 6px 20px rgb(0 0 0 / .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311; --surface: #1e1c19; --ink: #f1ede6; --muted: #a49d92; --line: #34302a;
    --accent: #5fbf98; --accent-ink: #0e1a15; --bubble: #2a2722; --warn: #f3c35b; --warn-bg: #3a2f17; --ok: #6fd3a0; --bad: #f08c7a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141311; --surface: #1e1c19; --ink: #f1ede6; --muted: #a49d92; --line: #34302a;
  --accent: #5fbf98; --accent-ink: #0e1a15; --bubble: #2a2722; --warn: #f3c35b; --warn-bg: #3a2f17; --ok: #6fd3a0; --bad: #f08c7a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100dvh; }
button { font: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.link { background: none; border: 0; color: var(--accent); padding: 6px 4px; text-decoration: underline; }
.hint { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.muted { color: var(--muted); }
.warn { display: block; margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 14px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 12px 16px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.top-actions { display: flex; gap: 6px; align-items: center; }
.pill { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 14px; min-height: 36px; }
.pill span { color: var(--accent); font-weight: 700; margin-left: 4px; }

.brief { position: fixed; z-index: 4; top: 61px; right: 0; bottom: 0; width: min(380px, 100%); overflow-y: auto; padding: 16px;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow); }
.brief h2 { margin: 0 0 4px; font-size: 18px; }
.brief .item { padding: 8px 0; border-top: 1px solid var(--line); }
.brief dt { font-size: 13px; color: var(--muted); }
.brief dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.brief .item.done dt::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.thumbs figure { margin: 0; font-size: 12px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--bubble); }

main { width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: var(--radius); white-space: pre-line; overflow-wrap: anywhere; animation: rise .2s ease-out both; }
.msg.studio { background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg.studio.error { border-left: 4px solid var(--bad); }
.msg.me { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; align-self: flex-end; }
.msg.upload-msg { background: transparent; color: var(--ink); padding: 0; max-width: 100%; align-self: stretch; text-align: right; font-size: 14px; }
.event { align-self: center; margin: 2px 0; font-size: 13px; color: var(--muted); background: var(--bubble); padding: 4px 12px; border-radius: 999px; }
.typing { display: inline-flex; gap: 4px; vertical-align: middle; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.typing-label { margin-left: 10px; font-size: 14px; color: var(--muted); }
@keyframes blink { 50% { opacity: .25; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .msg, .typing i { animation: none; } }

.card-in { margin-top: 12px; white-space: normal; display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 9px 14px; min-height: 44px; }
.chip:hover { border-color: var(--accent); }
.chip.quiet { background: transparent; color: var(--muted); align-self: flex-start; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chips.small .chip { padding: 5px 10px; min-height: 34px; font-size: 14px; }

.voices { gap: 6px; }
.voice { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 14px; }
.voice.picked { border-color: var(--accent); }
.voice b { display: block; } .voice small { color: var(--muted); font-size: 13px; line-height: 1.3; display: block; }
.play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 15px; }
.styles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.style { text-align: left; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 10px; color: var(--ink); }
.style:hover { border-color: var(--accent); }
.swatch { display: flex; height: 26px; border-radius: 8px; overflow: hidden; margin-bottom: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.swatch span { flex: 1; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .06); }
.style b { display: block; } .style small { color: var(--muted); font-size: 13px; line-height: 1.35; display: block; }
.file { position: relative; display: flex; align-items: center; justify-content: center; border: 1.5px dashed var(--line); border-radius: 14px; padding: 16px; background: var(--bg); color: var(--muted); cursor: pointer; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.uploads { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; text-align: left; }
.tagcard { background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.tagcard.loading { gap: 6px; } .tagcard progress { width: 100%; }
.tagcard.failed { color: var(--bad); }
.tagcard.saved { flex-direction: row; align-items: center; padding: 8px; }
.tagcard.saved img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.tagtop { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.tagtop img, .tagtop video { width: 120px; max-height: 200px; object-fit: cover; border-radius: 10px; background: #000; }
.tagbody { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tagbody label span { display: block; font-size: 13px; color: var(--muted); }
.tagbody input { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.tick { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.tick input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.tick.need { color: var(--bad); font-weight: 600; }
.row { display: flex; gap: 8px; align-items: flex-end; }
.row.end { justify-content: flex-end; align-items: center; }

.summary dl { margin: 0; }
.summary .item { padding: 8px 0; border-top: 1px solid var(--line); }
.summary dt { font-size: 13px; color: var(--muted); } .summary dd { margin: 0; white-space: pre-line; }
.summary h3 { margin: 0; }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.price { border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.price b { font-size: 22px; display: block; } .price small { color: var(--muted); }
.price.best { border-color: var(--accent); }

.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.composer .inner { max-width: 608px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.composer .quick:empty { display: none; }
.composer textarea { flex: 1; min-width: 0; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; resize: none; max-height: 200px; }
.composer.busy textarea, .composer.busy .send { opacity: .6; }
.attach { position: relative; display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.send { display: grid; place-items: center; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 600; min-width: 46px; height: 46px; padding: 0 12px; flex: none; }
.send.small { height: 40px; padding: 0 16px; }
.primary { width: 100%; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 17px; min-height: 50px; }
.primary[disabled] { opacity: .45; cursor: not-allowed; }
textarea:focus-visible, input:focus-visible, button:focus-visible, .attach:focus-within, .file:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.progress { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.progress ol { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 10px; }
.progress li { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.progress li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.progress li.now { color: var(--ink); font-weight: 600; }
.progress li.now::before { border-color: var(--accent); border-top-color: transparent; animation: spin 1s linear infinite; }
.progress li.done::before { background: var(--ok); border-color: var(--ok); }
.progress p { margin: 0; color: var(--muted); font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.result { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card h2 { margin: 0 0 4px; font-size: 20px; } .card h3 { margin: 0 0 8px; font-size: 16px; }
video { width: 100%; border-radius: 12px; background: #000; display: block; }
.player { max-width: 360px; margin: 8px auto 0; }
.beats { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.beat { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.beat img { width: 96px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; background: var(--bubble); }
.beat.portrait img { aspect-ratio: 9 / 16; }
.beat .n { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.beat q { display: block; quotes: none; }
.beat .screen { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.beat .flag { display: inline-block; margin-top: 6px; font-size: 13px; background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 2px 8px; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.facts li { display: flex; gap: 8px; } .facts li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.facts li.miss { color: var(--warn); } .facts li.miss::before { content: "!"; color: var(--warn); }

@media (max-width: 420px) {
  .tagtop { grid-template-columns: 1fr; } .tagtop img, .tagtop video { width: 100%; max-height: 260px; }
  .prices { grid-template-columns: 1fr; }
  .pill { padding: 6px 10px; }
}
@media (min-width: 1100px) { .brief:not([hidden]) ~ main { margin-left: max(16px, calc((100% - 640px - 380px) / 2)); } }
.card-in.spent { opacity: .55; pointer-events: none; }
.card-in.spent .file { display: none; }
.qa { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }

/* Look previews in the look's own typeface (fonts served from the renderer bundle). */
@font-face { font-family: "Promo Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Promo Newsreader"; src: url("/fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Promo Cormorant"; src: url("/fonts/cormorant.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
.tf-modern b { font-family: "Promo Inter", system-ui, sans-serif; font-weight: 850; letter-spacing: -.04em; }
.tf-editorial b { font-family: "Promo Newsreader", Georgia, serif; font-weight: 620; letter-spacing: -.02em; }
.tf-classic b { font-family: "Promo Cormorant", Georgia, serif; font-weight: 600; font-size: 1.12em; }
.lookprev { display: flex; flex-direction: column; justify-content: center; gap: 6px; height: 74px; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08); overflow: hidden; }
.lookprev b { font-size: 16px; line-height: 1.08; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lookprev .rule { width: 28px; height: 3px; border-radius: 2px; }
.customise .lookprev { height: 96px; }
.customise .lookprev b { font-size: 22px; }
.style.picked { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.opt { display: flex; flex-direction: column; gap: 4px; }
.opt .hint { margin: 0; }
.swatchchip { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.swatchchip i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); display: inline-block; }
.swatchchip input[type=color] { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
button.price { background: var(--surface); color: var(--ink); text-align: left; font: inherit; } button.price:disabled { opacity: .5; }
