/* FrameSoul tokens (see #182: --bg #0a0a0a, --accent #c9a87c) */
:root { /* #199 (2026-11-02): warmer, layered palette; was --bg #0a0a0a --card #151412 --line #2a2722 --accent #c9a87c */
        --bg:#14110f; --card:#1d1916; --raised:#2b251f; --line:#3a332b; --line-strong:#5a4e40;
        --text:#f0e8da; --muted:#c4baa8; --accent:#f2a93b; --accent-hover:#ffbe5c; --coral:#e8604c;
        --bad:#e8806f; --ok:#9cc7a3; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text);
       font:16px/1.5 "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width:880px; margin:0 auto; padding:32px 16px 64px; }
h1 { font:400 2rem/1.2 "Playfair Display", Georgia, serif; margin:0 0 8px; }
h1 span { color:var(--accent); font-style:italic; }
h2 { font:400 1.15rem/1.3 "Playfair Display", Georgia, serif; margin:0 0 12px; }
.lede { color:var(--muted); margin:0 0 24px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:20px; margin-bottom:16px; }
label { display:block; font-size:.85rem; color:var(--muted); margin:14px 0 6px; }
label:first-child { margin-top:0; }
input[type=password], input[type=email], input[type=text], select { width:100%; padding:10px 12px; background:var(--bg); color:var(--text);
       border:1px solid var(--line); border-radius:6px; font:inherit; }
input[type=range] { width:100%; accent-color:var(--accent); }
/* #199: secondary buttons get a visible fill and border; amber is reserved for primary / selected */
button { font:inherit; padding:10px 18px; border-radius:6px; border:1px solid var(--line-strong);
         background:var(--raised); color:var(--text); cursor:pointer; transition:border-color .15s, box-shadow .15s, background .15s; }
button:hover:not(:disabled) { border-color:var(--accent); box-shadow:0 0 0 3px rgba(242,169,59,.18); }
button.primary { background:var(--accent); border-color:var(--accent); color:#1a140c; font-weight:600; }
button.primary:hover:not(:disabled) { background:var(--accent-hover); border-color:var(--accent-hover); }
button:disabled { cursor:not-allowed; color:#a69b88; background:var(--card); border-color:var(--line); }   /* text 3:1+, not opacity */
button.primary:disabled { background:#4a3b22; border-color:#4a3b22; color:#d9c9a8; }
.row { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin:16px 0 0; }
.hint { color:var(--muted); font-size:.85rem; margin:8px 0 0; }
.msg { color:var(--bad); min-height:1.4em; margin:12px 0 0; }
.msg:empty { min-height:0; margin:0; }
.msg.ok { color:var(--ok); }               /* #196: a success line (XMP-only done), not an error */   /* #195: no empty band under the Render button */
.bar { height:12px; background:var(--bg); border:1px solid var(--line); border-radius:6px; overflow:hidden; }
.bar i { display:block; height:100%; width:0; background:var(--coral); transition:width .3s; }
.problems { list-style:none; padding:0; margin:12px 0 0; color:var(--bad); font-size:.85rem; }
.problems:empty { display:none; }
/* three-phase progress (upload -> convert -> save) */
.steps { list-style:none; padding:0; margin:0; }
.step { padding:10px 0 14px; opacity:.45; }
.step.active, .step.finished { opacity:1; }
.step-head { display:flex; justify-content:space-between; margin-bottom:6px; }
.step-pct { color:var(--accent); font-variant-numeric:tabular-nums; }
.step-text { margin:6px 0 0; font-size:.9rem; color:var(--muted); font-variant-numeric:tabular-nums; }
.step.finished .bar i { background:var(--ok); }
.step.error .bar i { background:var(--bad); }
/* preview of one photo under the chosen look (2026-10-31) */
.preview { margin-top:18px; padding-top:4px; border-top:1px solid var(--line); }
.preview select { flex:1 1 220px; width:auto; min-width:0; }
.preview figure { margin:12px 0 0; }
.preview.busy img { opacity:.45; transition:opacity .2s; }
#signin-btn { margin-top:16px; }
#start-btn { margin-top:0; }        /* Clear (2026-11-01): it now sits in .start-row beside "Clear and start over" */

/* #194: an element with display:flex/grid ignores the hidden attribute unless this wins (DeepSeek F1) */
[hidden] { display:none !important; }
/* #194 (2026-11-01): drop zone, batch-size meter, warnings, thumbnail grid, side-by-side preview, per-file bars */
.drop { margin-top:18px; padding:18px; border:1px dashed var(--line-strong); border-radius:10px; text-align:center; transition:border-color .15s, background .15s; }
.drop p { margin:0; }
.drop .row { justify-content:center; margin-top:12px; }
.drop.over { border-color:var(--accent); background:rgba(242,169,59,.09); }
.summary { margin-top:16px; }
.summary .bar { height:8px; }
.summary-end { display:flex; gap:12px; align-items:baseline; }
button.link { padding:2px 10px; font-size:.85rem; color:var(--accent); }   /* Clear (2026-11-01) */
.warnings { list-style:none; padding:0; margin:10px 0 0; font-size:.85rem; color:var(--bad); }
.warnings:empty { display:none; }
.warnings li::before { content:"⚠ "; }
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(110px, 1fr)); gap:8px; margin-top:14px;
        max-height:360px; overflow-y:auto; padding:2px; }
.tile { display:flex; flex-direction:column; gap:2px; padding:4px; text-align:left; border-radius:6px; min-width:0; }
.tile img, .tile .ph { width:100%; aspect-ratio:3/2; object-fit:cover; border-radius:4px; background:#000; display:block; }
.tile .ph { display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:.75rem; }
.tile .nm { font-size:.75rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tile .sz { font-size:.8rem; color:var(--muted); }   /* #195: was .7rem */
.tile-wrap { position:relative; min-width:0; }
.tile-wrap .tile { width:100%; }
.tile-wrap.on .tile { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
.tile-x { position:absolute; top:6px; right:6px; width:26px; height:26px; padding:0; border-radius:50%;
          background:rgba(20,17,15,.8); font-size:1rem; line-height:1; }
.tile-x:hover { border-color:var(--bad); color:var(--bad); }
.preview .row { justify-content:flex-start; }   /* #195: Preview button left, like Render below it */
#preview-cap { text-align:center; }
#preview-bar { margin-top:12px; height:8px; }
.pair { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
.pair.single { grid-template-columns:1fr; }
.pair figure { margin:0; min-width:0; }
.pair img { display:block; width:100%; height:auto; border-radius:6px; background:#000; object-fit:cover; }
.pair figcaption { font-size:.8rem; color:var(--muted); margin-top:4px; text-align:center; }
.busy-note { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap;
             margin-top:16px; padding:10px 12px; border:1px solid var(--accent); border-radius:8px; font-size:.9rem; }
.busy-note button { padding:6px 12px; }
.filelist { list-style:none; padding:0; margin:10px 0 0; max-height:220px; overflow-y:auto; font-size:.8rem; }
.filelist li { display:grid; grid-template-columns:1fr auto 80px; gap:10px; align-items:center; padding:3px 0; color:var(--muted); }
.filelist .fn { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.filelist .bar { height:6px; }
.filelist li.active { color:var(--text); }
.filelist li.done .bar i { background:var(--ok); }
.filelist li.error .bar i { background:var(--bad); }
@media (max-width:480px) {
  main { padding-top:20px; } .card { padding:16px; }
  .grid { grid-template-columns:repeat(3, 1fr); }
  .pair { gap:6px; }
}

/* ───── #195 (2026-11-01): input-screen polish ───── */
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
input[type=range]:focus-visible { outline-offset:4px; }
.label-row { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.label-row label { margin:0 0 6px; }
#engine-blurb { margin-bottom:6px; }
#extras label { margin-top:18px; }           /* review: the helper text sat on top of "Film stock" */
/* 2026-11-01 (#196): the Output block sits under the Texture hint; it is the first child of its box, so it needs the same gap as #extras labels */
#output-box label { margin-top:18px; }
#extras .hint { margin-top:6px; }
.ends { display:flex; justify-content:space-between; margin-top:2px; font-size:.78rem; }
/* Texture: a mark at 0 (the datalist tick is not drawn by every browser) */
#texture { background:linear-gradient(var(--muted), var(--muted)) center / 2px 14px no-repeat; }
/* grid scroll cue: fade the bottom edge while there is more below, and keep the scrollbar visible */
.grid { scrollbar-width:thin; scrollbar-color:var(--muted) transparent; }
.grid.scrolls:not(.at-end) { -webkit-mask-image:linear-gradient(#000 80%, transparent);
                             mask-image:linear-gradient(#000 80%, transparent); }
#grid-more { margin-top:6px; }
/* preview placeholder in the empty right column */
.placeholder { border:1px dashed var(--line-strong); border-radius:8px; padding:28px 16px; text-align:center; margin:0 0 16px; }
.placeholder::before { content:"▣"; display:block; font-size:2rem; line-height:1.2; color:var(--accent); opacity:.8; margin-bottom:6px; }
/* #199: slider with a dark unfilled track (the browser default is bright white) and a coral thumb */
input[type=range] { -webkit-appearance:none; appearance:none; height:22px; background-color:transparent; }
input[type=range]::-webkit-slider-runnable-track { height:6px; border-radius:3px; background:var(--line); }
input[type=range]::-moz-range-track { height:6px; border-radius:3px; background:var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:18px; height:18px; margin-top:-6px; border-radius:50%; background:var(--coral); border:2px solid var(--text); }
input[type=range]::-moz-range-thumb { width:14px; height:14px; border-radius:50%; background:var(--coral); border:2px solid var(--text); }
/* compare all looks */
.compare { margin-top:16px; padding-top:12px; border-top:1px solid var(--line); }
.compare > button { margin-right:10px; }
.swatches { display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:8px; margin-top:12px; }
.swatch { display:flex; flex-direction:column; gap:4px; padding:4px; text-align:left; border-radius:6px; min-width:0; }
.swatch img, .swatch .ph { width:100%; aspect-ratio:3/2; object-fit:cover; border-radius:4px; background:#000; display:block; }
.swatch .ph { display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:.75rem; }
.swatch .nm { font-size:.78rem; line-height:1.25; }
.swatch-wrap { min-width:0; }
.swatch-wrap .swatch { width:100%; }
.swatch.on { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
/* phones: before/after wipe instead of two tiny pictures */
.flip { margin-top:10px; }
.pair.flip { display:block; position:relative; }
.pair.flip figure:last-child { position:absolute; inset:0; clip-path:inset(0 0 0 var(--split, 50%)); }
.pair.flip figure:last-child img { height:100%; }
.pair.flip figcaption { position:absolute; top:6px; margin:0; padding:2px 8px; border-radius:4px;
                        background:rgba(20,17,15,.75); color:var(--text); }
.pair.flip figure:first-child figcaption { left:6px; }
.pair.flip figure:last-child figcaption { right:6px; }
/* per-file list: + a status column; skipped rows */
.filelist { margin-top:14px; }
.filelist li { grid-template-columns:minmax(0,1fr) auto 70px minmax(0,1.2fr); }
.filelist .st { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.filelist li.error { color:var(--bad); }
.filelist li.skipped { opacity:.6; }
/* two columns on a wide screen: settings + files | sticky preview + render */
@media (min-width:1100px) {
  main { max-width:1240px; }
  #work, #signin { max-width:880px; margin-left:auto; margin-right:auto; }   /* only the setup screen needs the width */
  .setup { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); gap:28px; align-items:start; }
  .setup-right { position:sticky; top:16px; max-height:calc(100vh - 32px); overflow-y:auto; }
  .setup-right .preview { margin-top:0; padding-top:0; border-top:0; }
}
@media (max-width:640px) {
  .tile-x { width:36px; height:36px; top:4px; right:4px; font-size:1.2rem; }   /* bigger target for a finger (review #11) */
  .filelist li { grid-template-columns:minmax(0,1fr) 60px; }
  .filelist .fs, .filelist .st { display:none; }
  .filelist li.error .st { display:block; grid-column:1 / -1; white-space:normal; }
}

/* ---- #198 (2026-11-02): accounts, queue, admin page. Colours are the tokens above; nothing new. ---- */
.acct { display:flex; gap:14px; align-items:center; justify-content:flex-end; flex-wrap:wrap; margin:-4px 0 12px; font-size:.85rem; color:var(--muted); }
.acct a, .acct .link { color:var(--accent); background:none; border:0; padding:0; font:inherit; cursor:pointer; text-decoration:underline; }
.ts-box { margin:14px 0 4px; min-height:0; }
.mybatches { list-style:none; margin:16px 0 0; padding:0; font-size:.88rem; }
.mybatches li { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:6px 0; border-bottom:1px solid var(--line); color:var(--muted); }
.mybatches button { padding:4px 12px; }
.queue { margin:0 0 16px; }
.notify { display:flex; gap:8px; align-items:center; margin:10px 0 0; color:var(--text); font-size:.9rem; cursor:pointer; }
.notify input { accent-color:var(--accent); width:18px; height:18px; }
.admin-grid { width:100%; border-collapse:collapse; font-size:.88rem; }
.admin-grid th { text-align:left; color:var(--muted); font-weight:400; padding:6px 8px; border-bottom:1px solid var(--line-strong); }
.admin-grid td { padding:8px; border-bottom:1px solid var(--line); vertical-align:middle; }
.admin-grid .acts { display:flex; gap:6px; flex-wrap:wrap; }
.admin-grid .acts button { padding:4px 10px; font-size:.8rem; }
.admin-grid tr.off td:first-child { text-decoration:line-through; color:var(--muted); }
.tag { display:inline-block; padding:1px 8px; border-radius:10px; font-size:.75rem; border:1px solid var(--line-strong); color:var(--muted); }
.tag.bad { color:var(--bad); border-color:var(--bad); }
.tag.ok { color:var(--ok); border-color:var(--ok); }
.once { margin-top:14px; padding:12px; border:1px solid var(--accent); border-radius:8px; background:var(--raised); }
.once code { display:block; margin:6px 0; padding:6px 8px; background:var(--bg); border-radius:6px; font-size:.95rem; user-select:all; word-break:break-all; }
.once pre { white-space:pre-wrap; margin:8px 0; padding:8px; background:var(--bg); border-radius:6px; font:inherit; font-size:.85rem; color:var(--muted); }
.form-row { display:grid; grid-template-columns:1fr 1fr auto; gap:10px; align-items:end; }
@media (max-width:640px) { .form-row { grid-template-columns:1fr; } .admin-grid { font-size:.8rem; } }
