/* Keepsake: warm, calm, legible. Tokens first; light theme by default, dark via prefers-color-scheme.
   Contrast (AA): --ink/--bg 15.9:1, --muted/--bg 6.0:1, --on-accent/--accent 5.6:1, --accent-ink/--bg 6.1:1. */

:root {
  --bg: #fbf7f1;
  --bg-tint: #f4ece1;
  --surface: #ffffff;
  --surface-2: #faf5ee;
  --ink: #1f1a15;
  --ink-2: #3a322a;
  --muted: #6b5f53;
  --line: #e6dccf;
  --line-strong: #d3c5b4;
  --accent: #a4471f;
  --accent-hover: #8e3c19;
  --accent-ink: #9a4220;
  --accent-soft: #f6e4d8;
  --on-accent: #ffffff;
  --sage: #4f6b55;
  --sage-soft: #e3ece3;
  --danger: #a3302a;
  --danger-soft: #f8e1df;
  --ok: #2f6b45;
  --ok-soft: #dfeee3;
  --focus: #1d5fd1;
  --shadow-sm: 0 1px 2px rgba(60, 40, 20, .06), 0 1px 1px rgba(60, 40, 20, .04);
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px -10px rgba(60, 40, 20, .18);
  --shadow-lg: 0 2px 4px rgba(60, 40, 20, .06), 0 24px 48px -20px rgba(60, 40, 20, .28);
  --radius: 14px;
  --radius-lg: 22px;
  --radius-sm: 10px;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
  --narrow: 720px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16130f;
    --bg-tint: #1d1914;
    --surface: #221d18;
    --surface-2: #29231d;
    --ink: #f4ede4;
    --ink-2: #e2d7ca;
    --muted: #b5a797;
    --line: #3a322a;
    --line-strong: #4d4338;
    --accent: #e0875a;
    --accent-hover: #ea9a70;
    --accent-ink: #f0a47c;
    --accent-soft: #3a2519;
    --on-accent: #1a110b;
    --sage: #9fbca5;
    --sage-soft: #233027;
    --danger: #f19b93;
    --danger-soft: #3a1f1c;
    --ok: #93cfa8;
    --ok-soft: #1d3125;
    --focus: #8ab4ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .35), 0 24px 48px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; outline: none; }
img, video, svg { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
h1, h2 { font-family: var(--font-display); font-weight: 560; letter-spacing: -.015em; }
h1 { font-size: clamp(2.1rem, 1.2rem + 3.6vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 1.15rem + 1.6vw, 2.25rem); }
h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -.005em; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap.narrow { max-width: var(--narrow); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; color: var(--bg); }

/* ---------- header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font: 600 1.3rem/1 var(--font-display); letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.m-bg { fill: var(--accent); }
.m-line { fill: none; stroke: var(--on-accent); }
.m-dot { fill: var(--on-accent); }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a, .nav button {
  appearance: none; border: 0; background: none; cursor: pointer; font: 500 .95rem/1 var(--font-body);
  color: var(--ink-2); text-decoration: none; padding: 10px 12px; border-radius: 999px; min-height: 40px;
  display: inline-flex; align-items: center;
}
.nav a:hover, .nav button:hover { background: var(--bg-tint); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.nav .nav-cta { background: var(--accent); color: var(--on-accent); }
.nav .nav-cta:hover { background: var(--accent-hover); color: var(--on-accent); }

.site-footer { border-top: 1px solid var(--line); margin-top: 0; padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); font-size: .95rem; }
.foot-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.foot-brand { font: 600 1.15rem/1.2 var(--font-display); margin-bottom: .35em; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: start; }
.foot-links a { color: var(--ink-2); text-decoration: none; padding: 6px 0; }
.foot-links a:hover { color: var(--accent-ink); text-decoration: underline; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr; } .foot-links { justify-content: flex-end; } }

/* ---------- buttons / inputs ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font: 600 1rem/1.1 var(--font-body); text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-lg { min-height: 54px; padding: 14px 28px; font-size: 1.05rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-primary:active { transform: translateY(1px); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--surface); color: var(--ink); border-color: var(--ink-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover { color: var(--accent-hover); filter: brightness(.98); }
.btn-text { background: none; border: 0; color: var(--accent-ink); padding-inline: 6px; min-height: 40px; }
.btn-text:hover { text-decoration: underline; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn .spinner { width: 18px; height: 18px; border-width: 2px; }

.label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.hint { color: var(--muted); font-size: .95rem; margin: -2px 0 10px; }
.input, .textarea {
  width: 100%; font: 400 1.05rem/1.5 var(--font-body); color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; min-height: 52px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.textarea { min-height: 150px; resize: vertical; }
.input-code { font: 600 1.15rem/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 4vw, 32px); }
.panel-raised { box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .97rem; margin: 12px 0; }
.notice::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: .55em; background: currentColor; }
.notice-error { background: var(--danger-soft); color: var(--danger); }
.notice-info { background: var(--sage-soft); color: var(--sage); }
.notice-ok { background: var(--ok-soft); color: var(--ok); }
.notice p { margin: 0; color: var(--ink); }
.form-msg:empty { display: none; }

/* ---------- landing ---------- */
.hero { padding: clamp(32px, 6vw, 72px) 0 clamp(24px, 4vw, 48px); overflow: hidden; }
.hero-grid { display: grid; gap: clamp(28px, 5vw, 56px); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: .88rem; letter-spacing: .01em;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lead { font-size: clamp(1.08rem, 1rem + .4vw, 1.25rem); color: var(--ink-2); max-width: 34em; }
.lead-sm { font-size: 1.1rem; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 28px; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--muted); font-size: .97rem; }
.facts strong { color: var(--ink); }

.sample { margin: 0; display: grid; justify-items: center; gap: 12px; }
.phone {
  width: min(280px, 56vw); aspect-ratio: 9 / 19; border-radius: 42px; padding: 10px;
  background: linear-gradient(160deg, #2b241d, #120f0c); box-shadow: var(--shadow-lg);
}
.phone-screen { position: relative; height: 100%; border-radius: 33px; overflow: hidden; background: #2a2119; }
.sample-art { position: absolute; inset: 0; background:
  radial-gradient(120% 70% at 20% 10%, #f3c9a4 0%, transparent 55%),
  radial-gradient(90% 60% at 90% 80%, #8fae93 0%, transparent 60%),
  linear-gradient(170deg, #d98b5f 0%, #7c4a32 55%, #3b2a20 100%); }
.frame { position: absolute; border-radius: 14px; background: rgba(255, 248, 238, .16); border: 1px solid rgba(255, 248, 238, .28); }
.f1 { left: 12%; top: 14%; width: 46%; aspect-ratio: 3 / 4; transform: rotate(-6deg); }
.f2 { right: 10%; top: 30%; width: 44%; aspect-ratio: 4 / 5; transform: rotate(5deg); }
.f3 { left: 18%; bottom: 13%; width: 60%; aspect-ratio: 4 / 3; transform: rotate(-2deg); }
.sample-play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 250, 244, .92); box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.sample-play svg { width: 28px; height: 28px; fill: #7c3b1c; margin-left: 4px; }

.section { padding: clamp(40px, 7vw, 84px) 0; }
.section-tint { background: var(--bg-tint); }
.signin-section { padding-top: 8px; }
.kicker { color: var(--accent-ink); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; margin-bottom: 10px; }
.section-title { max-width: 22em; margin-bottom: 28px; }
.signin-row { display: flex; gap: 10px; flex-wrap: wrap; }
.signin-row .input { flex: 1 1 220px; }
.signin-row .btn { flex: 0 0 auto; }
@media (max-width: 420px) { .signin-row .btn { flex: 1 1 100%; } }
.welcome h2 { margin-bottom: .3em; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px 24px 22px; }
.step::before {
  counter-increment: step; content: counter(step); position: absolute; top: 22px; right: 22px;
  font: 500 2.4rem/1 var(--font-display); color: var(--line-strong);
}
.step p { color: var(--ink-2); margin: 0; }
.step-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 16px; }
.step-icon svg, .feature-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.features { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); }
.feature p { color: var(--ink-2); margin: 0; }

.privacy-grid { display: grid; gap: 28px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .privacy-grid { grid-template-columns: .9fr 1.1fr; } }
.assurances { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.assurances li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 16px 52px; position: relative; }
.assurances li::before {
  content: ""; position: absolute; left: 20px; top: 21px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--sage-soft); box-shadow: inset 0 0 0 5px var(--sage);
}
.assurances h3 { margin-bottom: .25em; }
.assurances p { margin: 0; color: var(--ink-2); }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " →"; }
.link-arrow:hover { text-decoration: underline; }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 52px 18px 20px; font-weight: 600; position: relative; border-radius: var(--radius);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 20px 18px; margin: 0; color: var(--ink-2); }

.prose-section { padding-top: clamp(32px, 5vw, 56px); }
.prose h1 { margin-bottom: .4em; }
.prose h2 { font-size: 1.45rem; margin-top: 1.8em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .45em; }

/* ---------- app pages ---------- */
.app-main { padding: clamp(20px, 4vw, 40px) 0 56px; }
.app-wrap { max-width: var(--narrow); }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.6rem); margin-bottom: .2em; }
.page-head p { color: var(--muted); margin: 0; }
.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 40px 0; }

.spinner {
  display: inline-block; width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2.5px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-section { padding: clamp(20px, 4vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 16px; }
.form-section > h2 { font: 600 1.2rem/1.25 var(--font-body); letter-spacing: -.005em; display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.form-section > .hint { margin-bottom: 16px; }
.num {
  display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink); font: 700 .9rem/1 var(--font-body);
}
.brief-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; align-items: center; margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2); cursor: pointer;
  font: 500 .9rem/1 var(--font-body); padding: 10px 14px; border-radius: 999px; min-height: 40px;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.counter { font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.examples { margin-top: 16px; border-top: 1px dashed var(--line-strong); padding-top: 14px; }
.examples p { font-size: .92rem; color: var(--muted); margin-bottom: 8px; }
.example-list { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .example-list { grid-template-columns: repeat(3, 1fr); } }
.example {
  appearance: none; text-align: left; cursor: pointer; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 12px 14px; color: var(--ink-2); font: 400 .92rem/1.4 var(--font-body);
}
.example strong { display: block; color: var(--ink); margin-bottom: 2px; }
.example:hover { border-color: var(--accent); }

.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-body {
  display: block; height: 100%; border: 1.5px solid var(--line-strong); border-radius: var(--radius); padding: 14px 16px;
  background: var(--surface); transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.choice-body strong { display: block; font-size: 1.02rem; }
.choice-body span { display: block; color: var(--muted); font-size: .9rem; line-height: 1.4; margin-top: 2px; }
.choice input:checked + .choice-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice:hover .choice-body { border-color: var(--accent); }
.lengths { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lengths .choice-body { text-align: center; padding: 12px 8px; }
@media (max-width: 380px) { .lengths { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.drop {
  position: relative; display: grid; place-items: center; gap: 6px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 28px 16px; background: var(--surface-2);
  transition: border-color .15s ease, background-color .15s ease;
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.drop-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.drop-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop strong { font-size: 1.05rem; }
.drop .muted { font-size: .9rem; }

.tiles { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-tint); border: 1px solid var(--line); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile-ph { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 4px; color: var(--muted); font-size: .72rem; font-weight: 600; text-align: center; padding: 6px; }
.tile-ph svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.tile-badge {
  position: absolute; left: 6px; bottom: 6px; padding: 3px 7px; border-radius: 999px; font: 600 .7rem/1.2 var(--font-body);
  background: rgba(20, 16, 12, .72); color: #fff;
}
.tile-remove {
  position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(20, 16, 12, .72); color: #fff; display: grid; place-items: center; font-size: 1.1rem; line-height: 1;
}
.tile-remove:hover { background: rgba(20, 16, 12, .9); }
.tile.bad { border-color: var(--danger); }
.tile.bad::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--danger) 18%, transparent); }
.tile-error { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 4px 6px; background: var(--danger); color: #fff; font: 600 .7rem/1.25 var(--font-body); }
.tile-progress { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 6px; border-radius: 999px; background: rgba(20, 16, 12, .55); overflow: hidden; }
.tile-progress i { display: block; height: 100%; width: 0; background: #fff; border-radius: inherit; transition: width .2s linear; }
.tile.done::before {
  content: "✓"; position: absolute; right: 6px; bottom: 6px; z-index: 1; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ok); color: #fff; font: 700 .8rem/1 var(--font-body);
}
.tile.failed { border-color: var(--danger); }
.tile-retry { position: absolute; inset: auto 6px 6px 6px; z-index: 2; min-height: 30px; padding: 4px 8px; font-size: .78rem; border-radius: 999px; }
.files-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: 12px; font-size: .95rem; color: var(--muted); }
.files-summary .over { color: var(--danger); font-weight: 600; }

.consents { display: grid; gap: 12px; }
.consent { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; cursor: pointer; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.consent input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.consent strong { display: block; font-weight: 600; }
.consent span span { display: block; color: var(--muted); font-size: .9rem; margin-top: 2px; }
.consent.indent { margin-left: 24px; }

.submit-bar {
  position: sticky; bottom: 0; z-index: 10; margin: 4px calc(var(--gutter) * -1) 0; padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); display: grid; gap: 10px;
}
.submit-bar .why { font-size: .9rem; color: var(--muted); margin: 0; text-align: center; }
@media (min-width: 720px) {
  .submit-bar { position: static; margin: 8px 0 0; padding: 0; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

.progress { height: 10px; border-radius: 999px; background: var(--bg-tint); overflow: hidden; border: 1px solid var(--line); }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .25s ease; }
.upload-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }

.status-card { text-align: left; }
.timeline { list-style: none; margin: 22px 0 24px; padding: 0; display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 30px 1fr; gap: 14px; position: relative; padding-bottom: 18px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); background: var(--surface); color: var(--muted); font: 700 .8rem/1 var(--font-body); position: relative; z-index: 1; }
.tl-text strong { display: block; color: var(--muted); font-weight: 600; padding-top: 3px; }
.tl-text span { display: block; font-size: .92rem; color: var(--muted); }
.tl.done .tl-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl.done::before { background: var(--ok); }
.tl.done .tl-text strong { color: var(--ink); }
.tl.now .tl-dot { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.tl.now .tl-dot .spinner { width: 16px; height: 16px; border-width: 2px; }
.tl.now .tl-text strong { color: var(--ink); }
.tl.now .tl-text span { color: var(--ink-2); }
.tl.stop .tl-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.tl.stop .tl-text strong { color: var(--danger); }

.player {
  position: relative; width: min(100%, 420px); margin: 6px auto 18px; border-radius: 24px; overflow: hidden;
  background: #0d0b09; box-shadow: var(--shadow-lg); aspect-ratio: 9 / 16;
}
.player video { width: 100%; height: 100%; object-fit: contain; background: #0d0b09; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.actions-left { justify-content: flex-start; }
.meta-line { color: var(--muted); font-size: .9rem; margin-top: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font: 600 .8rem/1.2 var(--font-body); background: var(--bg-tint); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.s-delivered { background: var(--ok-soft); color: var(--ok); }
.pill.s-queued, .pill.s-processing { background: var(--accent-soft); color: var(--accent-ink); }
.pill.s-failed { background: var(--danger-soft); color: var(--danger); }
.pill.s-cancelled, .pill.s-draft, .pill.s-uploading { background: var(--bg-tint); color: var(--muted); }

.film-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.film-card {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.film-card:hover { border-color: var(--accent); color: var(--ink); box-shadow: var(--shadow); }
.film-thumb { width: 52px; height: 68px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.film-thumb svg { width: 22px; height: 22px; fill: currentColor; }
.film-card strong { display: block; font-size: 1.02rem; }
.film-card .meta { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
@media (max-width: 420px) { .film-card { grid-template-columns: 44px 1fr; } .film-card .pill { grid-column: 2; justify-self: start; } .film-thumb { width: 44px; height: 58px; } }
.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 18px; }

.empty { text-align: center; padding: clamp(28px, 6vw, 48px) clamp(16px, 4vw, 32px); }
.empty-art { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 24px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.empty-art svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty p { color: var(--muted); max-width: 30em; margin-inline: auto; }
.empty .actions { margin-top: 18px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .spinner { animation: none; border-top-color: color-mix(in srgb, currentColor 25%, transparent); border-right-color: currentColor; }
}
h1[tabindex="-1"]:focus, h1[tabindex="-1"]:focus-visible { outline: none; }
.btn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
form.locked .form-section { opacity: .78; }
form.locked .submit-bar { opacity: 1; }

/* signed-in header on narrow phones: the mark stands in for the name so three nav items fit on one line */
@media (max-width: 460px) {
  body.signed-in .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav { gap: 2px; flex-wrap: nowrap; }
  .nav a, .nav button { padding: 8px 10px; font-size: .92rem; }
  .hero-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 340px) { .nav a, .nav button { padding: 8px 7px; font-size: .86rem; } }
.upload-slot:empty { display: none; }
.upload-slot { margin-bottom: 16px; scroll-margin-top: 80px; }
form.locked .submit-bar { display: none; }
@media (max-width: 719px) { .submit-bar { padding-top: 10px; gap: 6px; } .submit-bar .btn-lg { min-height: 50px; } }
.upload-slot:focus { outline: none; }
