@font-face { font-family:Inter; font-weight:400; font-display:swap; src:url(/static/fonts/Inter_400Regular.ttf); }
@font-face { font-family:Inter; font-weight:500; font-display:swap; src:url(/static/fonts/Inter_500Medium.ttf); }
@font-face { font-family:Inter; font-weight:600; font-display:swap; src:url(/static/fonts/Inter_600SemiBold.ttf); }
@font-face { font-family:'Roboto Mono'; font-weight:400; font-display:swap; src:url(/static/fonts/RobotoMono_400.woff2) format('woff2'); }
@font-face { font-family:'Roboto Mono'; font-weight:500; font-display:swap; src:url(/static/fonts/RobotoMono_500.woff2) format('woff2'); }
@font-face { font-family:'Roboto Mono'; font-weight:700; font-display:swap; src:url(/static/fonts/RobotoMono_700.woff2) format('woff2'); }
:root {
  /* The tokens in DESIGN.md. Change them there first. */
  --bg:#111315; --surface:#181B1E; --raised:#202428; --hover:#272C31; --border:#2B3035; --border-strong:#3A4046;
  --text:#E9ECEF; --muted:#9BA3AB; --faint:#838B93; --accent:#47B5F0; --accent-hover:#6CC4F3; --accent-ink:#04131C; --accent-soft:#10283A;
  --ok:#6EDB8F; --ok-soft:#14301F; --warn:#F2B544; --warn-soft:#33280F; --danger:#F2665C; --danger-soft:#3A1715;
  --radius:8px; --radius-small:6px; --shadow:0 8px 24px rgba(0,0,0,.35);
  --mono:'Roboto Mono',ui-monospace,Menlo,monospace; --sans:Inter,-apple-system,BlinkMacSystemFont,sans-serif;
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--bg); color:var(--text); font:400 15px/1.55 Inter,-apple-system,BlinkMacSystemFont,sans-serif; }
h1,h2,h3 { margin:0; line-height:1.2; }
h1 { font:700 26px/1.2 var(--mono); letter-spacing:-.02em; overflow-wrap:anywhere; }
h2 { font:700 15px/1.3 var(--mono); letter-spacing:-.01em; }
h3 { font:500 14px/1.3 var(--mono); }
p { margin:0; }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }
code,pre { font:12.5px/1.5 ui-monospace,Menlo,monospace; overflow-wrap:anywhere; }
svg.icon { width:20px; height:20px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

.app { display:flex; min-height:100vh; }
.sidebar { width:232px; flex:none; position:sticky; top:0; height:100vh; display:flex; flex-direction:column; gap:4px; padding:18px 12px; border-right:1px solid var(--border); background:var(--surface); }
.logo { font:700 18px var(--mono); letter-spacing:-.02em; padding:4px 10px 16px; color:var(--text); }
.logo b { color:var(--accent); font-weight:700; }
.nav-item { display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:var(--radius); color:var(--muted); font-weight:500; }
.nav-item:hover { background:var(--raised); color:var(--text); text-decoration:none; }
.nav-item.on { background:var(--raised); color:var(--text); }
.nav-count { margin-left:auto; font-size:12px; font-weight:600; background:var(--accent); color:var(--accent-ink); border-radius:999px; padding:0 7px; }
.sidebar-foot { margin-top:auto; display:flex; flex-direction:column; gap:6px; }
.mode-chip { display:flex; align-items:center; gap:8px; padding:9px 10px; border-radius:var(--radius); border:1px solid var(--border); color:var(--muted); font-size:13px; }
.mode-chip:hover { text-decoration:none; color:var(--text); border-color:var(--border-strong); }
.dot { width:8px; height:8px; border-radius:50%; background:var(--ok); flex:none; }
.dot.off { background:var(--faint); } .dot.bad { background:var(--danger); }
.link-button { background:none; border:0; color:var(--faint); font:inherit; font-size:13px; padding:6px 10px; cursor:pointer; text-align:left; min-height:0; width:100%; }
.link-button:hover { color:var(--text); background:none; }

.content { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar { display:none; }
main { width:100%; max-width:1680px; margin:0; padding:32px 32px 120px; display:flex; flex-direction:column; gap:24px; }
main.narrow { max-width:1480px; }
.page-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; }
.page-head p { color:var(--muted); margin-top:6px; }
.page-actions { display:flex; gap:8px; flex-wrap:wrap; }
.back { color:var(--muted); font-size:14px; display:inline-flex; align-items:center; gap:4px; }

.tabbar { display:none; }

.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:18px; }
.card > * + * { margin-top:12px; }
.card-head { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.stack { display:flex; flex-direction:column; gap:14px; }
.stack.card > * + * { margin-top:0; }
.row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.spread { justify-content:space-between; }
.section { display:flex; flex-direction:column; gap:12px; }
.section-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.stats { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.stat { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px; color:inherit; display:block; }
a.stat:hover { border-color:var(--border-strong); text-decoration:none; }
.stat-value { font:700 28px/1 var(--mono); }
.stat-label { color:var(--muted); font-size:13px; margin-top:6px; }

.hero { background:var(--surface); border:1px solid var(--border-strong); border-left:3px solid var(--accent); border-radius:var(--radius); padding:22px; display:flex; justify-content:space-between; gap:16px; align-items:center; flex-wrap:wrap; }
.hero h2 { font:700 20px/1.25 var(--mono); letter-spacing:-.01em; }
.hero p { color:var(--muted); margin-top:4px; }

.steps { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
.step { display:flex; gap:12px; align-items:center; padding:10px 0; border-top:1px solid var(--border); }
.step:first-child { border-top:0; }
.step-mark { width:24px; height:24px; border-radius:50%; border:1.5px solid var(--border-strong); display:flex; align-items:center; justify-content:center; flex:none; font-size:12px; color:var(--faint); }
.step.done .step-mark { background:var(--ok-soft); border-color:var(--ok); color:var(--ok); }
.step-body { flex:1; min-width:0; } .step-body small { display:block; color:var(--muted); }
.step.done .step-title { color:var(--muted); }
.progress { height:6px; background:var(--border); border-radius:3px; overflow:hidden; }
.progress i { display:block; height:100%; background:var(--accent); border-radius:3px; }

button,.button { font:500 13px var(--mono); color:var(--text); background:var(--raised); border:1px solid var(--border-strong); border-radius:var(--radius); min-height:40px; padding:0 14px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:6px; white-space:nowrap; transition:background .12s,border-color .12s; }
button:hover,.button:hover { background:var(--hover); text-decoration:none; }
.primary { background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
.primary:hover { background:var(--accent-hover); border-color:var(--accent-hover); }
.ghost { background:transparent; border-color:transparent; color:var(--muted); }
.ghost:hover { background:var(--raised); color:var(--text); }
.danger-text { color:var(--danger); }
button:disabled,.button.disabled { opacity:.45; cursor:not-allowed; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.htmx-request button,button.htmx-request { opacity:.6; }

label { display:flex; flex-direction:column; gap:6px; font:500 12.5px var(--mono); color:var(--muted); }
label.check { flex-direction:row; align-items:center; gap:10px; color:var(--text); font:400 14px var(--sans); }
input,select,textarea { font:400 16px var(--sans); color:var(--text); background:var(--bg); border:1px solid var(--border-strong); border-radius:var(--radius); padding:10px 12px; width:100%; max-width:100%; }
input[type=checkbox],input[type=radio] { width:18px; height:18px; flex:none; accent-color:var(--accent); padding:0; }
textarea { resize:vertical; }
.hint { color:var(--faint); font:400 13px var(--sans); }
.muted { color:var(--muted); } .faint { color:var(--faint); } .small { font-size:13px; }
.ok { color:var(--ok); } .warn { color:var(--warn); } .error { color:var(--danger); }

.pill { display:inline-flex; align-items:center; gap:4px; font:500 11.5px var(--mono); padding:2px 9px; border-radius:999px; background:var(--raised); color:var(--muted); white-space:nowrap; }
.pill.warn { background:var(--warn-soft); color:var(--warn); }
.pill.good,.pill.ok { background:var(--ok-soft); color:var(--ok); }
.pill.bad { background:var(--danger-soft); color:var(--danger); }
.pill.accent { background:var(--accent-soft); color:var(--accent); }

.alert { display:flex; gap:12px; align-items:flex-start; border-radius:var(--radius); padding:14px 16px; border:1px solid; overflow-wrap:anywhere; }
.alert.warn { background:var(--warn-soft); border-color:#5c4726; }
.alert.bad { background:var(--danger-soft); border-color:#6a2c26; }
.alert.good { background:var(--ok-soft); border-color:#25564a; }
.alert strong { display:block; }
.alert ul { margin:6px 0 0; padding-left:18px; }

.empty { text-align:center; padding:40px 20px; border:1px dashed var(--border-strong); border-radius:var(--radius); display:flex; flex-direction:column; gap:10px; align-items:center; }
.empty h3 { font-size:16px; } .empty p { color:var(--muted); max-width:420px; }

.segmented { display:inline-flex; gap:4px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:4px; overflow-x:auto; max-width:100%; }
.segmented a { padding:6px 12px; border-radius:var(--radius); color:var(--muted); font-weight:500; font-size:14px; white-space:nowrap; }
.segmented a:hover { color:var(--text); text-decoration:none; }
.segmented a.on { background:var(--raised); color:var(--text); }

.set-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:14px; }
.set-tile { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; color:inherit; display:flex; flex-direction:column; }
.set-tile:hover { border-color:var(--border-strong); text-decoration:none; }
.set-tile img { width:100%; aspect-ratio:9/13; object-fit:cover; object-position:top; display:block; background:var(--raised); }
.set-tile-body { padding:10px 12px 12px; display:flex; flex-direction:column; gap:6px; }
.clip2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:13px; }

.review { display:grid; grid-template-columns:minmax(0,360px) minmax(0,1fr); gap:28px; align-items:start; }
.carousel-wrap { display:flex; flex-direction:column; gap:10px; position:sticky; top:24px; }
.carousel { display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; scrollbar-width:none; border-radius:var(--radius); }
.carousel::-webkit-scrollbar { display:none; }
.carousel img { flex:none; width:100%; aspect-ratio:9/16; object-fit:cover; border-radius:var(--radius); scroll-snap-align:center; background:var(--raised); border:1px solid var(--border); }
.carousel-dots { display:flex; justify-content:center; gap:6px; }
.carousel-dots i { width:6px; height:6px; border-radius:50%; background:var(--border-strong); }
.carousel-dots i.on { background:var(--text); }
.action-bar { display:flex; gap:10px; }
.action-bar > * { flex:1; } .action-bar form { display:flex; } .action-bar button { width:100%; }
details { border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); }
details > summary { list-style:none; cursor:pointer; padding:12px 14px; font-weight:500; display:flex; justify-content:space-between; align-items:center; gap:10px; }
details > summary::-webkit-details-marker { display:none; }
details > summary::after { content:'+'; color:var(--faint); font-size:18px; line-height:1; }
details[open] > summary::after { content:'–'; }
details > .details-body { padding:0 14px 14px; display:flex; flex-direction:column; gap:12px; }
.checklist { margin:0; padding:0; list-style:none; counter-reset:step; display:flex; flex-direction:column; gap:10px; }
.checklist li { counter-increment:step; display:flex; gap:10px; overflow-wrap:anywhere; }
.checklist li::before { content:counter(step); width:22px; height:22px; flex:none; border-radius:50%; background:var(--raised); color:var(--muted); font-size:12px; display:flex; align-items:center; justify-content:center; }
.copy-box { background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:10px 12px; overflow-wrap:anywhere; }

.option-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:10px; }
.option { position:relative; display:block; }
.option input { position:absolute; opacity:0; width:0; height:0; }
.option span { display:block; border:1px solid var(--border-strong); border-radius:var(--radius); padding:12px; background:var(--bg); cursor:pointer; color:var(--text); font-weight:500; font-size:14px; }
.option small { display:block; color:var(--muted); font-weight:400; font-size:12.5px; margin-top:2px; }
.option input:checked + span { border-color:var(--accent); background:var(--accent-soft); }
.option input:focus-visible + span { outline:2px solid var(--accent); outline-offset:2px; }

.queue { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.queue li { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:12px 14px; display:flex; flex-direction:column; gap:10px; }
.queue li.current { border-color:var(--accent); }
.queue-text { font-weight:500; overflow-wrap:anywhere; }
.queue textarea { min-height:64px; }

.pool-list { display:flex; flex-direction:column; }
.pool { padding:12px 0; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:8px; }
.pool:first-child { border-top:0; padding-top:0; }
.bar { height:6px; border-radius:3px; background:var(--border); overflow:hidden; }
.bar i { display:block; height:100%; border-radius:3px; }
.bar i.green { background:var(--ok); } .bar i.amber { background:var(--warn); } .bar i.red { background:var(--danger); }

.list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; }
.list-item { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:12px 0; border-top:1px solid var(--border); flex-wrap:wrap; overflow-wrap:anywhere; }
.list-item:first-child { border-top:0; padding-top:0; } .list-item:last-child { padding-bottom:0; }
.mode-options { display:flex; flex-direction:column; gap:8px; }
.mode-option { display:flex; justify-content:flex-start; gap:12px; text-align:left; white-space:normal; width:100%; min-height:0; padding:14px; background:var(--bg); align-items:flex-start; font-weight:400; }
.mode-option.on { border-color:var(--accent); background:var(--accent-soft); }
.mode-option strong { display:block; font-weight:600; }
.mode-option span span { color:var(--muted); font-size:13px; }

.sheet { position:fixed; right:20px; bottom:20px; z-index:30; width:min(440px,calc(100vw - 24px)); }
.sheet:empty { display:none; }
.job,.sheet > .error { background:var(--raised); border:1px solid var(--border-strong); border-radius:var(--radius); box-shadow:var(--shadow); padding:14px 16px; }
.sheet > .error { color:var(--danger); }
.job-head { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.job-status { font-size:13px; color:var(--muted); margin-top:2px; }
.job-status[data-state=done] { color:var(--ok); } .job-status[data-state=failed] { color:var(--danger); }
.spinner { width:16px; height:16px; border:2px solid var(--border-strong); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; flex:none; }
.job[data-done] .spinner { display:none; }
@keyframes spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .spinner { animation:none; } }
.job-actions { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.job details { margin-top:10px; background:var(--bg); }
.job-cmd { display:block; color:var(--faint); }
.job-out { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; max-height:30vh; overflow:auto; }

.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; }
.login-wrap main.login { width:min(400px,100%); padding:0; display:flex; flex-direction:column; gap:18px; }

/* Studio (Advanced) */
.tabs { display:flex; gap:4px; overflow-x:auto; }
.tabs a { padding:7px 12px; border-radius:var(--radius); color:var(--muted); white-space:nowrap; font-weight:500; }
.tabs a.on { background:var(--raised); color:var(--text); }
.filters { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; }
.filters label { min-width:160px; }
.actions { display:flex; flex-wrap:wrap; gap:8px; }
.sets,.checks,.events { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.sets a { display:flex; flex-direction:column; gap:3px; color:inherit; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:12px; overflow-wrap:anywhere; }
.clip { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.checks li { display:flex; flex-direction:column; gap:2px; background:var(--surface); border-radius:var(--radius); padding:10px 12px; overflow-wrap:anywhere; }
.checks .status-pass strong { color:var(--ok); } .checks .status-fail strong { color:var(--danger); }
.events li { overflow-wrap:anywhere; } .events code { display:block; color:var(--muted); }
.slides { display:flex; flex-direction:column; gap:14px; }
.slides figure { margin:0; } .slides img,.sheet-img { width:100%; max-width:420px; display:block; border-radius:var(--radius); }
img.sheet { position:static; width:100%; max-width:640px; border-radius:var(--radius); }
.caption { background:var(--surface); padding:12px; border-radius:var(--radius); overflow-wrap:anywhere; }
.report { background:var(--surface); padding:12px; border-radius:var(--radius); white-space:pre-wrap; max-height:60vh; overflow:auto; }

@media (max-width:860px) {
  .sidebar { display:none; }
  .topbar { display:flex; align-items:center; justify-content:space-between; gap:10px; height:var(--topbar-h); padding:0 16px; border-bottom:1px solid var(--border); background:var(--surface); position:sticky; top:0; z-index:110; }
  .topbar .logo { padding:0; font-size:18px; }
  .topbar .mode-chip { padding:5px 10px; }
  main { padding:18px 16px 100px; gap:20px; }
  h1 { font-size:24px; }
  .tabbar { display:grid; grid-template-columns:repeat(6,1fr); position:fixed; left:0; right:0; bottom:0; z-index:20; background:var(--surface); border-top:1px solid var(--border); padding:6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tab-item { display:flex; flex-direction:column; align-items:center; gap:2px; padding:4px 2px; color:var(--faint); font-size:11px; font-weight:500; border-radius:var(--radius); position:relative; }
  .tab-item:hover { text-decoration:none; }
  .tab-item.on { color:var(--accent); }
  .tab-count { position:absolute; top:0; left:calc(50% + 6px); background:var(--accent); color:var(--accent-ink); border-radius:999px; font-size:10px; font-weight:600; padding:0 5px; }
  .stats { gap:8px; } .stat { padding:12px; } .stat-value { font-size:24px; } .stat-label { font-size:12px; }
  .review { grid-template-columns:minmax(0,1fr); gap:18px; }
  .carousel-wrap { position:static; }
  .carousel img { width:68%; }
  .review .action-bar { position:fixed; left:0; right:0; bottom:calc(60px + env(safe-area-inset-bottom)); z-index:15; background:var(--surface); border-top:1px solid var(--border); padding:10px 16px; }
  main:has(.review .action-bar) { padding-bottom:170px; }
  body:has(.review .action-bar) .sheet { bottom:calc(132px + env(safe-area-inset-bottom)); }
  .sheet { right:12px; bottom:calc(72px + env(safe-area-inset-bottom)); }
  .set-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .hero button,.hero .button { width:100%; }
}
.w0 { width:0%; }
.w5 { width:5%; }
.w10 { width:10%; }
.w15 { width:15%; }
.w20 { width:20%; }
.w25 { width:25%; }
.w30 { width:30%; }
.w35 { width:35%; }
.w40 { width:40%; }
.w45 { width:45%; }
.w50 { width:50%; }
.w55 { width:55%; }
.w60 { width:60%; }
.w65 { width:65%; }
.w70 { width:70%; }
.w75 { width:75%; }
.w80 { width:80%; }
.w85 { width:85%; }
.w90 { width:90%; }
.w95 { width:95%; }
.w100 { width:100%; }
.grow { flex:1; min-width:150px; }
body:has(.sheet:not(:empty)) main { padding-bottom:340px; }
.sheet > .error { cursor:pointer; }
.stars-fields { display:none; flex-direction:column; gap:10px; }
form:has(input[value=stars]:checked) .stars-fields { display:flex; }

.board { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; align-items:start; }
.column { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:12px; display:flex; flex-direction:column; gap:10px; min-width:0; scroll-margin-top:70px; }
.column-head { display:flex; justify-content:space-between; gap:8px; align-items:flex-start; }
.column-head h2 { font-size:14px; } .column-empty { padding:8px 2px; }
.column-items { display:flex; flex-direction:column; gap:8px; }
.post-tile { display:flex; gap:10px; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:8px; color:inherit; min-width:0; }
.post-tile:hover { border-color:var(--border-strong); text-decoration:none; }
.post-tile img,.post-tile-blank { width:54px; aspect-ratio:9/16; object-fit:cover; border-radius:var(--radius); flex:none; background:var(--raised); }
.post-tile-body { display:flex; flex-direction:column; gap:4px; min-width:0; align-items:flex-start; }
.post-tile .pill { white-space:normal; }
.post-making { display:flex; gap:10px; align-items:center; padding:12px; border:1px dashed var(--border-strong); border-radius:var(--radius); color:var(--muted); font-size:13px; }
.delivery { border:0; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; min-width:0; }
.delivery legend { font-weight:600; padding:0 0 8px; }
.option input:disabled + span { opacity:.5; cursor:not-allowed; }

.review { grid-template-columns:minmax(0,340px) minmax(0,1fr); }
.phone { position:sticky; top:24px; width:100%; max-width:340px; margin:0 auto; background:#000; border:8px solid #26222f; border-radius:42px; box-shadow:var(--shadow),inset 0 0 0 1px #3e3750; overflow:hidden; }
.phone-screen { position:relative; aspect-ratio:9/16; overflow:hidden; background:#000; display:flex; flex-direction:column; color:#fff; font-size:12px; }
.phone .carousel { border-radius:0; flex:1; min-height:0; gap:0; }
.phone .carousel img { width:100%; height:100%; aspect-ratio:auto; border:0; border-radius:0; background:#000; object-fit:contain; }
.phone .carousel-dots i { background:rgba(255,255,255,.4); } .phone .carousel-dots i.on { background:#fff; }
.phone svg.icon { width:24px; height:24px; }
.tiktok .feed-top { position:absolute; top:14px; left:0; right:0; display:flex; justify-content:center; gap:14px; font-size:13px; pointer-events:none; text-shadow:0 1px 2px rgba(0,0,0,.6); }
.tiktok .feed-top span { opacity:.7; }
.tiktok .feed-rail { position:absolute; right:8px; bottom:112px; display:flex; flex-direction:column; align-items:center; gap:14px; pointer-events:none; filter:drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.tiktok .feed-rail svg { fill:rgba(255,255,255,.92); stroke:none; }
.feed-avatar { width:32px; height:32px; border-radius:50%; background:linear-gradient(135deg,var(--accent),#8e4fbf); border:1.5px solid #fff; flex:none; }
.tiktok .feed-bottom { position:absolute; left:0; right:0; bottom:0; padding:44px 54px 10px 12px; background:linear-gradient(transparent,rgba(0,0,0,.72)); pointer-events:none; display:flex; flex-direction:column; gap:3px; }
.tiktok .feed-bottom p { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; line-height:1.3; }
.tiktok .feed-bottom small { opacity:.85; font-size:11px; }
.tiktok .carousel-dots { margin-top:5px; margin-right:-42px; }
.feed .feed-head { display:flex; align-items:center; gap:8px; padding:12px 10px 8px; flex:none; }
.feed .feed-head .feed-avatar { width:26px; height:26px; }
.feed .feed-head svg { margin-left:auto; fill:#fff; stroke:none; }
.feed .carousel { flex:none; aspect-ratio:4/5; }
.feed .feed-actions { display:flex; align-items:center; gap:10px; padding:10px; flex:none; }
.feed .feed-actions .carousel-dots { flex:1; }
.feed .feed-caption { padding:0 10px 10px; line-height:1.35; overflow:hidden; }
@media (max-width:1100px) { .board { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:860px) {
  .board { grid-template-columns:minmax(0,1fr); }
  .review { grid-template-columns:minmax(0,1fr); }
  .phone { position:static; max-width:280px; }
  .phone .carousel img { width:100%; }
  .stats { grid-template-columns:repeat(2,1fr); }
  .review .action-bar { position:fixed; }
}
.feed .phone-screen { aspect-ratio:9/15; }
.tiktok .carousel img { object-fit:cover; }
.step-label { font-size:12px; color:var(--accent); font-weight:600; letter-spacing:.02em; }
.guide { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:12px; }
.alert .button { flex:none; }
.grow { flex:1; min-width:0; }


.posting-times { padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.time-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.day-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; border: 0; padding: 0; margin: 0; }
.day-grid legend { padding: 0; margin-bottom: 6px; }
.day-grid label { display: inline-flex; align-items: center; gap: 6px; }

.post-tile-thumb { position: relative; flex: none; display: block; line-height: 0; }
.platform-badge { position: absolute; left: 6px; top: 6px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.platform-badge svg { width: 15px; height: 15px; }
.platform-badge.tiktok { background: #010101; }
.platform-badge.instagram { background: #c13584; }
.platform-badge.facebook { background: #1877f2; }
.platform-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 16px; padding-bottom: 2px; }
.platform-tabs a { display: inline-flex; align-items: center; gap: 7px; flex: none; min-height: 40px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); text-decoration: none; }
.platform-tabs a.on { border-color: var(--border-strong); background: var(--raised); color: inherit; font-weight: 600; }
.platform-tabs svg { width: 16px; height: 16px; }

.cal-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; margin-bottom:14px; }
.cal-nav { display:flex; gap:6px; }
.cal-title { margin:0; font-size:17px; flex:1 1 200px; }
.cal-views { flex:none; }
.cal-week { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:8px; }
.cal-weekdays { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:6px; margin-bottom:6px; color:var(--faint); font-size:12px; text-align:center; }
.cal-month { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:6px; }
.cal-day { display:flex; flex-direction:column; gap:6px; min-height:120px; min-width:0; padding:8px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); }
.cal-week .cal-day { min-height:320px; }
.cal-day.other { opacity:.5; }
.cal-day.today { border-color:var(--accent); }
.cal-day-head { display:flex; align-items:baseline; gap:6px; color:var(--muted); font-size:13px; }
.cal-day-head strong { color:var(--text); font-size:17px; }
.cal-day-num { align-self:flex-start; color:var(--muted); font-size:13px; font-weight:600; min-width:22px; }
.cal-day.today .cal-day-num, .cal-day.today .cal-day-head strong { color:var(--accent); }
.cal-more { color:var(--muted); font-size:12px; }
.cal-chip { display:flex; flex-direction:column; gap:3px; min-width:0; padding:7px 8px; color:var(--text); background:var(--raised); border:1px solid var(--border); border-left:3px solid var(--border-strong); border-radius:var(--radius); font-size:12.5px; line-height:1.3; }
.cal-chip:hover { border-color:var(--border-strong); text-decoration:none; }
.cal-chip[draggable="true"] { cursor:grab; }
.cal-chip.dragging { opacity:.45; }
.cal-chip.good { border-left-color:var(--ok); }
.cal-chip.accent { border-left-color:var(--accent); }
.cal-chip.warn { border-left-color:var(--warn); }
.cal-chip.bad { border-left-color:var(--danger); }
.cal-chip.by-hand { border-style:dashed; border-left-style:solid; }
.cal-chip-head { display:flex; align-items:center; gap:5px; font-weight:600; }
.cal-chip-head svg { width:14px; height:14px; flex:none; }
.cal-chip-text { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; color:var(--muted); overflow-wrap:anywhere; }
.cal-chip-tag { color:var(--faint); font-size:11px; }
.cal-hours { display:flex; flex-direction:column; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.cal-hour { display:grid; grid-template-columns:64px minmax(0, 1fr); gap:10px; min-height:52px; padding:8px 12px; border-top:1px solid var(--border); }
.cal-hour:first-child { border-top:0; }
.cal-hour-label { color:var(--faint); font-size:12.5px; }
.cal-hour-items { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:6px; }
.drop-target { outline:2px solid var(--accent); outline-offset:-2px; background:var(--accent-soft); }
.cal-hint { margin-top:12px; }
.cal-status:empty { display:none; }
.cal-status { margin-top:8px; color:var(--muted); }
@media (max-width: 760px) {
  .cal-week { grid-template-columns:minmax(0, 1fr); }
  .cal-week .cal-day { min-height:0; }
  .cal-month { gap:3px; }
  .cal-weekdays { gap:3px; }
  .cal-month .cal-day { min-height:72px; padding:4px; gap:3px; align-items:flex-start; }
  .cal-month .cal-chip { padding:3px; border-left-width:1px; }
  .cal-month .cal-chip time, .cal-month .cal-chip-text, .cal-month .cal-chip-tag { display:none; }
  .cal-month .cal-more { font-size:10px; }
  .cal-hint-drag { display:none; }
  .cal-hour { grid-template-columns:46px minmax(0, 1fr); padding:8px; }
  .cal-hour-items { grid-template-columns:minmax(0, 1fr); }
}

.post-tile-wrap { position:relative; }
.post-tile-wrap .post-tile-body { padding-right:26px; }
.post-tile-delete { position:absolute; top:6px; right:6px; width:30px; height:30px; padding:0; display:grid; place-items:center; border-radius:50%; background:transparent; border:0; color:var(--faint); font-size:18px; line-height:1; }
.post-tile-delete:hover { background:var(--raised); color:var(--danger); }
.danger-link { color:var(--danger); align-self:flex-start; }
.phone-screen { position:relative; }
.carousel-arrow { position:absolute; top:42%; z-index:3; width:36px; height:36px; padding:0; display:grid; place-items:center; border:0; border-radius:50%; background:rgba(0,0,0,.55); color:#fff; }
.carousel-arrow svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
.carousel-arrow.prev { left:8px; }
.carousel-arrow.next { right:8px; }
.carousel-arrow:disabled { opacity:0; pointer-events:none; }
.topbar-right { display:flex; align-items:center; gap:8px; }
.bell { position:relative; display:grid; place-items:center; width:36px; height:36px; color:var(--muted); }
.notifications { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.notification { display:flex; flex-wrap:wrap; align-items:flex-start; gap:12px; padding:14px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); }
.notification-icon { flex:none; width:34px; height:34px; display:grid; place-items:center; border-radius:50%; color:#fff; background:var(--raised); }
.notification-icon svg { width:18px; height:18px; }
.notification-icon.tiktok { background:#010101; }
.notification-icon.instagram { background:#c13584; }
.notification-icon.facebook { background:#1877f2; }
.notification-body { flex:1 1 220px; min-width:0; display:flex; flex-direction:column; gap:2px; }
.notification-body p { margin:4px 0 0; overflow-wrap:anywhere; }
.notification-actions { display:flex; align-items:center; gap:6px; }
.tiktok .carousel-arrow { top:24%; }

.agent-steps { list-style:none; display:flex; gap:6px; overflow-x:auto; margin:0 0 18px; padding:0; }
.agent-steps li { display:flex; align-items:center; gap:6px; flex:none; color:var(--faint); font-size:13px; padding-right:8px; }
.agent-steps span { width:22px; height:22px; display:grid; place-items:center; border-radius:50%; border:1px solid var(--border); font-size:12px; }
.agent-steps .on { color:var(--text); font-weight:600; }
.agent-steps .on span { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.agent-steps .done { color:var(--muted); }
.agent-steps .done span { background:var(--ok-soft); color:var(--ok); border-color:var(--ok-soft); }
.agent-msg { display:flex; gap:10px; margin-bottom:14px; }
.agent-avatar { flex:none; width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:var(--accent); color:var(--accent-ink); font-size:12px; font-weight:700; }
.agent-bubble { min-width:0; padding:10px 14px; background:var(--raised); border-radius:4px 14px 14px 14px; }
.agent-bubble p { margin:0 0 6px; }
.agent-bubble p:last-child { margin:0; }
.agent-run:empty { display:none; }
.agent-run { margin-top:14px; }
.agent-run .job { padding:14px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); }
.agent-job .job-cmd { display:none; }
.agent-job .job-out { white-space:pre-wrap; max-height:320px; overflow:auto; }
.agent-list { margin:6px 0 0; padding-left:18px; }
.agent-quote { margin:10px 0; padding-left:12px; border-left:3px solid var(--border-strong); color:var(--muted); }
.agent-quote cite { display:block; margin-top:3px; color:var(--faint); font-size:12px; font-style:normal; }
.format-card { display:flex; flex-direction:column; gap:10px; margin-bottom:12px; }
.format-card h2 { margin:0; }
.format-card p { margin:0; }
.format-strip { display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; }
.format-strip img { flex:none; width:150px; height:auto; aspect-ratio:9/16; border-radius:var(--radius); background:var(--raised); }
.tabbar.five { grid-template-columns:repeat(5,1fr); }
.tabbar.four { grid-template-columns:repeat(4,1fr); }

.shot-preview:empty { display:none; }
.shot-preview { display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; }
.shot-preview figure { flex:none; margin:0; position:relative; }
.shot-preview img { display:block; width:72px; aspect-ratio:9/16; object-fit:cover; border-radius:var(--radius); background:var(--raised); }
.shot-preview figcaption { position:absolute; left:4px; top:4px; min-width:20px; padding:0 5px; border-radius:999px; background:rgba(0,0,0,.65); color:#fff; font-size:11px; text-align:center; }
.check { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.check input { width:auto; }
.check .hint { flex-basis:100%; }

.agent-progress { display:none; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; }
#agent-run:has(.job) ~ .agent-step { display:none; }
.agent-steps a { display:flex; align-items:center; gap:6px; color:inherit; }
.agent-run .job-status { font-weight:600; }
.agent-run .job-status[data-state=failed] { color:var(--danger); font-weight:500; }
.agent-run .job-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.start-choice { display:flex; flex-direction:column; gap:12px; }
.start-options { border:0; margin:0; padding:0; }
.start-panel { display:none; }
.start-choice:has(input[name=start][value=shots]:checked) .start-panel[data-panel=shots],
.start-choice:has(input[name=start][value=link]:checked) .start-panel[data-panel=link],
.start-choice:has(input[name=start][value=idea]:checked) .start-panel[data-panel=idea] { display:flex; }
.direction-card { padding:0; }
.saved-shots { display:flex; flex-direction:column; gap:8px; padding-bottom:12px; border-bottom:1px solid var(--border); }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
@media (max-width: 760px) {
  .agent-progress { display:flex; }
  .agent-steps li:not(.on) { display:none; }
  .agent-steps { margin-bottom:12px; }
}

.setup-delete { display:flex; justify-content:flex-end; margin-top:18px; }
#agent-run:has(.job) ~ .setup-delete { display:none; }

/* Wide screens: extra width goes to structure, and reading text keeps a comfortable measure. */
.agent-bubble { max-width:72ch; }
.card p, .hint { max-width:80ch; }
@media (min-width: 1100px) {
  .setup-grid { display:grid; grid-template-columns:190px minmax(0,1fr); gap:32px; align-items:start; }
  .setup-rail { position:sticky; top:24px; }
  .setup-rail .agent-steps { flex-direction:column; gap:12px; overflow:visible; margin:0; }
  .agent-step { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; align-items:start; }
  .agent-step > .agent-msg, .agent-step > .format-card, .agent-step > .start-choice, .agent-step > .copy-form, .agent-step > form.card { grid-column:1 / -1; }
  .agent-step > .agent-msg { margin-bottom:4px; }
  .start-choice { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; align-items:start; }
  .start-options { grid-column:1 / -1; grid-template-columns:repeat(3,minmax(0,1fr)); display:grid; gap:10px; }
  .start-panel { grid-column:1; grid-row:2; }
  .direction-card { grid-column:2; grid-row:2; }
  .copy-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; align-items:start; }
  .copy-form .action-bar { grid-column:1 / -1; }
  .format-strip img { width:190px; }
  .notification { flex-wrap:nowrap; align-items:center; }
  main.narrow:has(#automation) { display:block; columns:2; column-gap:18px; }
  main.narrow:has(#automation) > * { break-inside:avoid; margin-bottom:18px; }
  main.narrow:has(#automation) > .page-head, main.narrow:has(#automation) > .alert { column-span:all; }
}
@media (min-width: 1500px) {
  .board .column-items { gap:10px; }
}

/* The agent chat: one reading column, with the work drawn wider inside it. The slides are the loudest thing here. */
main:has(.chat-page) { max-width:none; padding-bottom:0; }
.chat-page { --column:820px; display:flex; flex-direction:column; min-height:calc(100vh - 48px); }
.chat-head { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; width:100%; max-width:var(--column); margin:0 auto 20px; }
.chat-head .back { margin-bottom:6px; display:inline-block; }
.chat-head h1 { font-size:22px; }
.chat-head-side { display:flex; flex-direction:column; align-items:flex-end; gap:2px; flex:none; }
.chat-log { flex:1; display:flex; flex-direction:column; gap:14px; width:100%; max-width:var(--column); margin:0 auto; padding-bottom:12px; }
.chat-text { line-height:1.6; max-width:68ch; overflow-wrap:anywhere; }
.chat-text p { margin:0 0 10px; }
.chat-text p:last-child { margin:0; }
.chat-text ul { margin:0 0 10px; padding-left:20px; }
.chat-text code { padding:1px 5px; background:var(--raised); border-radius:5px; }
.chat-owner { align-self:flex-end; max-width:80%; padding:9px 14px; background:var(--raised); border-radius:var(--radius) 16px 4px 16px; overflow-wrap:anywhere; white-space:pre-wrap; }
.chat-owner .format-strip { margin-bottom:8px; }
.chat-owner .format-strip img { width:64px; border-radius:6px; }
.chat-step { display:grid; grid-template-columns:14px minmax(0,max-content) minmax(0,1fr); align-items:baseline; gap:8px; color:var(--muted); font-size:13px; }
.chat-step-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-log .chat-step + .chat-step { margin-top:-8px; }
.chat-step-mark { width:8px; height:8px; border-radius:50%; align-self:center; justify-self:center; background:var(--ok); }
.chat-step.running .chat-step-mark { background:var(--accent); animation:chat-pulse 1.1s ease-in-out infinite; }
.chat-step.running { color:var(--text); }
.chat-step.failed .chat-step-mark { background:var(--danger); }
.chat-step.failed .chat-step-detail { color:var(--danger); }
.chat-step-detail { color:var(--faint); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-step.failed .chat-step-detail { grid-column:2 / -1; white-space:normal; overflow-wrap:anywhere; }
@keyframes chat-pulse { 50% { opacity:.3; transform:scale(.7); } }
@media (prefers-reduced-motion:reduce) { .chat-step.running .chat-step-mark { animation:none; } }
.chat-live { width:100%; max-width:var(--column); margin:0 auto; white-space:pre-wrap; line-height:1.6; overflow-wrap:anywhere; }
.chat-live:empty { display:none; }
.chat-live { padding-bottom:12px; }
.chat-card { display:flex; flex-direction:column; gap:10px; padding:16px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); min-width:0; }
.chat-card p { margin:0; }
.chat-card .format-strip img { width:132px; }
.chat-empty { color:var(--muted); max-width:60ch; }
.chat-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.chat-actions form { display:contents; }
.chat-choices { display:flex; flex-wrap:wrap; gap:8px; }
.chat-choices button { min-height:44px; text-align:left; }
.chat-failed { color:var(--danger); }
.chat-compose { position:sticky; bottom:0; display:flex; align-items:flex-end; gap:8px; width:100%; max-width:var(--column); margin:0 auto; padding:10px 0 14px; background:var(--bg); }
.chat-compose textarea { flex:1; min-width:0; min-height:44px; max-height:40vh; resize:none; field-sizing:content; border-radius:var(--radius); }
.chat-attach { flex:none; display:grid; place-items:center; width:44px; height:44px; padding:0; font-size:20px; cursor:pointer; }
.chat-compose button { min-height:44px; flex:none; }
.chat-compose button[hidden] { display:none; }
.chat-error { width:100%; max-width:var(--column); margin:0 auto; color:var(--danger); font-size:13px; }
.chat-error:empty { display:none; }
.chat-start { display:flex; flex-direction:column; align-items:flex-end; gap:10px; margin-bottom:12px; }
.chat-start textarea { width:100%; }
@media (max-width:860px) {
  .chat-page { min-height:0; }
  .chat-compose { bottom:calc(60px + env(safe-area-inset-bottom)); }
  .chat-owner { max-width:90%; }
}

.compare-page { --column:100%; }
.compare-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr)); gap:24px; align-items:start; }
.compare-column { display:flex; flex-direction:column; gap:12px; min-width:0; }
.compare-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:0; }
.compare-facts dt { color:var(--muted); font-size:12px; }
.compare-facts dd { margin:0; font-size:18px; font-weight:600; font-variant-numeric:tabular-nums; }

/* DESIGN.md: the instrument pass. Mono for anything you scan, slides as the loud thing, motion only for what's new. */
.sidebar nav a, .agent-steps, .chat-step, .chat-head-side, .compare-facts, .faint.small, .notification-body .small, .stat-label { font-family:var(--mono); }
.stat-label { font-size:12px; }
.format-strip img, .chat-card .format-strip img, .chat-owner .format-strip img { border-radius:var(--radius-small); }
.format-strip img { width:132px; }
@media (min-width:1100px) { .format-strip img { width:132px; } }
@media (max-width:760px) { .format-strip img, .chat-card .format-strip img { width:112px; } }
.format-card { gap:12px; }
.format-card h3 { color:var(--muted); font-size:12.5px; }
input[type=file] { padding:6px; font:400 13px var(--mono); color:var(--muted); }
input[type=file]::file-selector-button { font:500 13px var(--mono); color:var(--text); background:var(--raised); border:1px solid var(--border-strong); border-radius:var(--radius-small); padding:8px 12px; margin-right:12px; cursor:pointer; }
input[type=file]::file-selector-button:hover { background:var(--hover); }
.agent-avatar { border-radius:var(--radius-small); font:700 11px var(--mono); }
.agent-bubble { background:transparent; padding:6px 0 0; border-radius:0; }
.agent-steps li { font-size:12.5px; }
.agent-steps span { border-radius:var(--radius-small); font:500 11px var(--mono); }
.agent-steps .on span { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.agent-steps .done span { background:transparent; color:var(--ok); border-color:var(--ok-soft); }
.agent-steps .later span { color:var(--faint); }
.agent-steps .later { color:var(--faint); }
.start-option:has(input:checked) { border-color:var(--accent); background:var(--accent-soft); }
.chat-owner { border-radius:var(--radius) var(--radius) var(--radius-small) var(--radius); }
.chat-card { border-radius:var(--radius); }
.chat-step { font-size:12.5px; }
.chat-log > .arrived { animation:arrive .18s ease-out; }
@keyframes arrive { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion:reduce) { .chat-log > .arrived { animation:none; } }
@media (min-width:1100px) {
  .setup-grid { grid-template-columns:170px minmax(0,1fr); max-width:1280px; }
  .agent-step { max-width:1040px; }
}
.tabbar a { font-family:var(--sans); }

/* DESIGN.md, Reach: the page's title and its main actions stay in reach while you scroll. */
:root { --topbar-h:0px; }
@media (max-width:860px) { :root { --topbar-h:56px; } }
.page-head, .chat-head { position:sticky; top:var(--topbar-h); z-index:100; background:var(--bg); padding-block:12px; margin-block:-12px; box-shadow:0 1px 0 var(--border), 0 0 0 48px var(--bg); clip-path:inset(0 -48px -1px); }
/* The bar reaches the edges of the content area, never over the sidebar. */
.sidebar { z-index:120; }
.chat-head { margin-block:0 8px; }
.page-head h1 { transition:font-size .18s ease-out; }
@media (max-width:860px) {
  .page-head h1, .chat-head h1 { font-size:20px; }
  .page-head p { font-size:13px; margin-top:2px; }
}
@media (prefers-reduced-motion:reduce) { .page-head h1 { transition:none; } }


/* A step's output opens under it, like a terminal, and stays out of the way until asked for. */
/* On phones the tab bar covers the bottom of the page, so the chat ends above it and the message box never sits on the last reply. */
@media (max-width:860px) { main:has(.chat-page) { padding-bottom:calc(72px + env(safe-area-inset-bottom)); } }

/* The engine choice and Compare, always in the navigation. */
.engine-nav { display:flex; flex-direction:column; gap:6px; margin-bottom:8px; }
.engine-nav-label { font:500 11.5px var(--mono); color:var(--faint); padding:0 2px; }
.engine-nav-row { display:flex; align-items:center; gap:8px; }
.engine-select { flex:1; min-width:0; min-height:36px; padding:6px 8px; font:500 12.5px var(--mono); background:var(--surface); }
.engine-compare { font:500 12.5px var(--mono); white-space:nowrap; }
.engine-nav.compact { margin:0; }
.engine-nav.compact .engine-select { min-height:32px; padding:4px 6px; font-size:12px; max-width:112px; }

/* Photos wait here until Send, so a direction can go with them. */
.chat-compose-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:8px; }
.chat-compose-main textarea { width:100%; }
.chat-attachments { display:flex; gap:8px; overflow-x:auto; padding:2px 0; }
.chat-attachments[hidden] { display:none; }
.chat-attachments figure { position:relative; flex:none; margin:0; }
.chat-attachments img { display:block; width:56px; aspect-ratio:9/16; object-fit:cover; border-radius:var(--radius-small); border:1px solid var(--border); }
.chat-attachment-remove { position:absolute; top:-6px; right:-6px; width:22px; min-height:22px; height:22px; padding:0; border-radius:50%; font-size:14px; line-height:1; background:var(--raised); }

/* "Posts to" on a set: one chip per account, ticked ones on. */
.posts-to { border:0; padding:0; margin:0; display:flex; flex-direction:column; gap:6px; }
.posts-to legend { font-size:13px; color:var(--muted); margin-bottom:6px; }
.chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip { display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:6px 12px; border:1px solid var(--border); border-radius:999px; background:var(--surface); font-size:13px; cursor:pointer; }
.chip:has(input:checked) { border-color:var(--accent); color:var(--text); }
.chip { flex-direction:row; font:500 13px var(--sans); color:var(--muted); }
.chip input { accent-color:var(--accent); }

/* Posting times show only the fields the chosen way of posting uses. */
.posting-times:has(input[name=mode][value=times]:checked) :is(.schedule-window, .schedule-jitter) { display:none; }
.posting-times:not(:has(input[name=mode][value=times]:checked)) .schedule-times { display:none; }
.posting-times:not(:has(input[name=mode][value=every]:checked)) .schedule-every { display:none; }

/* The app switcher sits where the name was: the app is the first choice, and the menu below belongs to it. */
.app-switch { padding:0 4px 16px; }
.app-switch select { width:100%; font:700 16px var(--mono); color:var(--text); background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-small); padding:8px 10px; }
.app-switch.compact { padding:0; }
.app-switch.compact { min-width:0; flex:0 1 auto; }
.app-switch.compact select { width:auto; max-width:28vw; font-size:14px; padding:6px 6px; text-overflow:ellipsis; }
