:root {
  color-scheme: light dark;
  --bg: #faf8f5; --surface: #ffffff; --surface-2: #f2eee8; --text: #1f2329; --muted: #5a626d; --border: #ddd6cb;
  --accent: #1d6b64; --accent-text: #ffffff; --accent-soft: #dff0ed; --link: #14564f;
  --warn: #8a5a00; --warn-bg: #fff3d6; --bad: #a3231f; --ok: #1d6b3a;
  --radius: 14px; --maxw: 980px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a; --surface: #1d2126; --surface-2: #252a31; --text: #eceff3; --muted: #a5adb8; --border: #343b44;
    --accent: #55c2b6; --accent-text: #0b1a18; --accent-soft: #1a3532; --link: #7ad3c8;
    --warn: #f1c35c; --warn-bg: #3a2f13; --bad: #ff9a92; --ok: #85d79c; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-wrap: break-word; }
img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6rem; }
h1 { font-size: clamp(1.6rem, 5.5vw, 2.5rem); letter-spacing: -.01em; }
h2 { font-size: 1.25rem; display: flex; align-items: center; gap: .5rem; }
h3 { font-size: 1rem; margin-top: 1.2rem; }
.wrap { max-width: var(--maxw); margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 10; }
.muted { color: var(--muted); } .small { font-size: .88rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top { border-bottom: 1px solid var(--border); background: var(--surface); }
.top-in { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 12px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo { width: 22px; height: 22px; border-radius: 6px; background: conic-gradient(from 45deg, #e3c49a, #5d8fa8, #c8734e, #e3c49a); }
nav a { margin-left: 14px; font-size: .95rem; }

.hero { padding-top: 28px; padding-bottom: 8px; }
.lede { font-size: 1.08rem; max-width: 46em; }
.privacy-note { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; max-width: 46em; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; margin-top: 16px; margin-bottom: 16px; }
#results > .card { margin-left: 0; margin-right: 0; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: .85rem; flex: none; }

.drop { display: grid; gap: 4px; place-items: center; text-align: center; border: 2px dashed var(--border); border-radius: 12px; padding: 28px 12px; cursor: pointer; background: var(--surface-2); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.drop-big { font-weight: 600; font-size: 1.05rem; } .drop-small { color: var(--muted); font-size: .88rem; }
.queue { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
.queue li { aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--surface-2); position: relative; }
.queue img, .queue canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.queue .qnum { display: grid; place-items: center; height: 100%; }
.queue li.nodecode { outline: 2px solid var(--bad); outline-offset: -2px; }
.warn-text { color: var(--warn); }
.msg { min-height: 1.4em; margin: 8px 0; } .msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wrap-row { align-items: flex-end; margin-bottom: 10px; } .grow { flex: 1 1 220px; display: grid; gap: 4px; }

.btn { font: inherit; font-weight: 600; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); padding: 10px 16px; min-height: 44px; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; min-height: 38px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input[type=email], input:not([type]), select { font: inherit; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-height: 44px; max-width: 100%; }
.check { display: flex; align-items: center; gap: 6px; min-height: 44px; }

.bar { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 8px; }
.seg { border: 0; padding: 0; margin: 0; display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { padding: 9px 14px; cursor: pointer; min-height: 42px; display: flex; align-items: center; }
.seg.small label { padding: 6px 10px; min-height: 36px; font-size: .9rem; }
.seg input:checked + label { background: var(--accent); color: var(--accent-text); }
.seg input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: -3px; }
.sel { display: grid; gap: 4px; font-size: .9rem; }
.scores { margin: 6px 0 12px; } .scores b { font-variant-numeric: tabular-nums; }
.up { color: var(--ok); }

.profile { max-width: 520px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.profile-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: conic-gradient(#e3c49a, #5d8fa8, #c8734e, #e3c49a); }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.grid li { position: relative; }
.tile { all: unset; box-sizing: border-box; display: block; width: 100%; aspect-ratio: 3 / 4; position: relative; overflow: hidden; background: var(--surface-2); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.tile[aria-pressed=true] { box-shadow: inset 0 0 0 4px var(--accent); }
.tile.drop-target { box-shadow: inset 0 0 0 4px #f1c35c; }
.tile.dragging { opacity: .35; }
.tile .crop { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.tile img { position: absolute; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.badge { position: absolute; left: 4px; top: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: .72rem; padding: 1px 6px; border-radius: 6px; pointer-events: none; }
/* 44x44 px touch target; only the small centred chip is visible. */
.handle { position: absolute; right: 0; bottom: 0; width: 44px; height: 44px; display: grid; place-items: center; color: #fff; font-size: .85rem; line-height: 1; touch-action: none; cursor: grab; isolation: isolate; }
.handle::before { content: ""; position: absolute; inset: 11px; border-radius: 6px; background: rgba(0,0,0,.42); z-index: -1; }
.ghost-tile { position: fixed; z-index: 50; pointer-events: none; opacity: .9; box-shadow: 0 8px 24px rgba(0,0,0,.3); border-radius: 4px; overflow: hidden; }
.tilebar { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--surface-2); display: grid; gap: 8px; }
.hint { margin-top: 8px; }

.crop-wrap { display: grid; gap: 14px; }
@media (min-width: 760px) { .crop-wrap { grid-template-columns: minmax(0, 460px) minmax(220px, 1fr); align-items: start; gap: 24px; } }
.crop-stage { position: relative; max-width: 460px; touch-action: none; user-select: none; }
.crop-stage img { width: 100%; height: auto; }
.box { position: absolute; border: 3px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.0), 0 0 0 1px rgba(0,0,0,.6); }
.box.post { cursor: move; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 0 0 9999px rgba(0,0,0,.35); }
.box.gridtile { top: 0; height: 100%; border: 2px dashed #f1c35c; box-shadow: none; pointer-events: none; }
.box-label { position: absolute; right: 6px; top: 6px; font-size: .7rem; line-height: 1.2; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; pointer-events: none; white-space: nowrap; }
.box.gridtile .box-label { top: auto; right: auto; left: 6px; bottom: 6px; color: #f1c35c; }
.key-post, .key-tile { display: inline-block; width: 14px; height: 12px; vertical-align: -1px; border: 2px solid currentColor; border-radius: 2px; }
.key-tile { border: 2px dashed #c89520; }
.crop-stage { overflow: hidden; }
.nudge { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nudge .btn { min-width: 44px; }

.why { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.why li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; background: var(--surface-2); }
.why.left li { grid-template-columns: 52px 1fr auto; }
.why img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; }
.why .meta { font-size: .8rem; color: var(--muted); }
.why .btn { white-space: nowrap; }

.cap-out { margin-top: 12px; display: grid; gap: 8px; }
.cap { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.cap .style { font-size: .75rem; color: var(--muted); display: block; }
.callout { background: var(--warn-bg); color: var(--text); padding: 10px 12px; border-radius: 10px; }
.critique { margin: 4px 0 0; padding-left: 1.2rem; }

.files { padding-left: 1.4rem; font-size: .92rem; }
.gate { border-color: var(--accent); }
.waitlist { margin-top: 10px; display: grid; gap: 6px; }
.waitlist input { flex: 1 1 200px; }
.prose { padding-top: 12px; padding-bottom: 12px; } .prose li { margin-bottom: 6px; }
.foot { padding-top: 20px; padding-bottom: 40px; border-top: 1px solid var(--border); margin-top: 24px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
