
:root {
  --bg: #F6F0E7; --card: #FFFDF9; --ink: #2B2620; --muted: #7A6F63; --line: #E6DACB;
  --primary: #D8C3A5; --accent: #B0844F; --ok: #4E7D5B; --warn: #B5672E; --bad: #A6423A;
  --radius: 16px; --shadow: 0 1px 2px rgba(43,38,32,.05), 0 8px 24px rgba(43,38,32,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 'DM Sans', system-ui, sans-serif; }
h1, h2, h3 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; letter-spacing: .01em; margin: 0 0 .4em; }
h1 { font-size: 34px; } h2 { font-size: 26px; } h3 { font-size: 20px; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; }

/* layout */
header.top { position: sticky; top: 0; z-index: 10; background: rgba(246,240,231,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .inner { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.logo .beta { font: 600 10px 'DM Sans'; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); padding: 2px 6px; border-radius: 99px; }
nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
nav.tabs button { background: none; border: 0; padding: 8px 12px; border-radius: 99px; font: 500 14px 'DM Sans'; color: var(--muted); cursor: pointer; }
nav.tabs button.on { background: var(--ink); color: var(--bg); }
main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 80px; }

/* cards & forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 4px; }
label .hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=url], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: 15px 'DM Sans'; color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); border-color: var(--accent); }
.field { margin-bottom: 14px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 99px; padding: 11px 20px; font: 600 14px 'DM Sans'; cursor: pointer; background: var(--ink); color: var(--bg); text-decoration: none; }
.btn.alt { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.bad { background: var(--bad); color: #fff; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* auth */
.auth { max-width: 420px; margin: 8vh auto; }
.auth h1 { font-size: 40px; }

/* status chips */
.chip { display: inline-block; font: 600 11px 'DM Sans'; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; background: var(--line); color: var(--ink); }
.chip.queued { background: #EFE5D6; } .chip.processing { background: #E9DCC4; color: #7A5A2E; }
.chip.review { background: #E4D5BC; color: #6B4A1F; } .chip.ready { background: #DCEADF; color: var(--ok); }
.chip.needs_changes { background: #F3DCCB; color: var(--warn); } .chip.failed { background: #F1D3D0; color: var(--bad); }

/* job list */
.job { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.job:first-child { border-top: 0; }
.job .t { font-weight: 600; } .job .meta { font-size: 13px; color: var(--muted); }
.reels { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.reel video { width: 100%; aspect-ratio: 9/16; background: #111; border-radius: 12px; object-fit: cover; }
.copybox { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; font-size: 14px; max-height: 220px; overflow: auto; }
.thread .msg { padding: 8px 12px; border-radius: 12px; background: var(--bg); margin-bottom: 8px; }
.thread .msg.mine { background: #EFE3D1; }
.thread .msg .who { font-size: 12px; color: var(--muted); }

/* upload */
.drop { border: 2px dashed var(--primary); border-radius: var(--radius); padding: 28px; text-align: center; background: #FBF7F1; cursor: pointer; }
.drop.over { background: #F2E8DA; }
.files .f { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.bar { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* brand kit */
.kit { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 20px; align-items: start; }
.kit > div { min-width: 0; }
@media (max-width: 900px) { .kit { grid-template-columns: minmax(0,1fr); } .phone { position: static; margin: 0 auto; } }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { text-align: center; font-size: 12px; }
.swatch input[type=color] { width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 12px; padding: 0; background: none; cursor: pointer; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.preset { border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; background: #fff; }
.preset.on { border-color: var(--accent); outline: 2px solid var(--primary); }
.preset b { display: block; font-size: 14px; } .preset span { font-size: 12px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 14px; font: 500 13px 'DM Sans'; cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--bg); }
.logo-up { display: flex; gap: 14px; align-items: center; }
.logo-up img { width: 72px; height: 72px; object-fit: contain; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }

/* phone preview */
.phone { position: sticky; top: 84px; width: 100%; max-width: 300px; aspect-ratio: 9/16; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); border: 8px solid #1d1a16; display: flex; flex-direction: column; }
.phone .scene { flex: 1; position: relative; background: linear-gradient(160deg, #cdb8a0, #8c7660); }
.phone .hook { position: absolute; top: 16%; left: 8%; right: 8%; text-align: center; font-size: 30px; line-height: 1.05; }
.phone .cap { position: absolute; top: 62%; left: 8%; right: 14%; text-align: center; font-weight: 700; font-size: 17px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.phone .end { position: absolute; inset: auto 0 0 0; padding: 14px; text-align: center; }
.phone .end img { max-height: 36px; max-width: 120px; }
.phone .end .bn { font-size: 18px; } .phone .end .sl { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.phone .cta { display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 99px; font: 700 11px 'DM Sans'; letter-spacing: .08em; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-size: 14px; z-index: 50; box-shadow: var(--shadow); }
.brief { line-height: 1.65; } .brief h1, .brief h2 { margin-top: 1em; } .brief table { border-collapse: collapse; width: 100%; } .brief td, .brief th { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; } table.list td, table.list th { padding: 10px 8px; border-top: 1px solid var(--line); text-align: left; } table.list tr.click { cursor: pointer; } table.list tr.click:hover { background: var(--bg); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

#baRows input[type=file] { max-width: 100%; font-size: 12px; }
@media (max-width: 600px) { #baRows td, #baRows th { padding: 8px 4px; } }
