@font-face {
  font-family: Nunito;
  src: url(/fonts/nunito.woff2) format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --bg: #FAF6F0;
  --surface: #FFFFFF;
  --surface-2: #F3EDE5;
  --line: #ECE4DA;
  --line-2: #DDD3C7;
  --ink: #26203A;
  --ink-2: #4E4766;
  --muted: #8A8299;
  --faint: #BDB6C9;
  --accent: #FF6B3D;
  --accent-2: #FF8560;
  --accent-soft: #FFE8DF;
  --violet: #7B6CF6;
  --violet-soft: #ECE8FF;
  --mint: #22B983;
  --mint-soft: #DDF6EC;
  --sun: #F2B33D;
  --sun-soft: #FFF1D3;
  --sun-ink: #9A6A0C;
  --danger: #E5484D;
  --danger-soft: #FFE3E4;
  --shadow-sm: 0 2px 10px rgba(38, 32, 58, .06);
  --shadow: 0 10px 28px rgba(38, 32, 58, .12);
  --shadow-lg: 0 24px 60px rgba(38, 32, 58, .22);
  --glow: 0 10px 26px rgba(255, 107, 61, .38);
  --r: 14px;
  --r-lg: 22px;
  --pill: 999px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: Nunito, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238A8299' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15121D;
    --surface: #1F1A2B;
    --surface-2: #29233A;
    --line: #2F2941;
    --line-2: #3E3753;
    --ink: #F4F0FA;
    --ink-2: #D2CBE3;
    --muted: #9D95B3;
    --faint: #645C7C;
    --accent: #FF7A4F;
    --accent-2: #FF8F69;
    --accent-soft: #3D2620;
    --violet-soft: #2B2653;
    --mint-soft: #16352B;
    --sun-soft: #3B2F14;
    --sun-ink: #F2C361;
    --danger-soft: #3D1F22;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .25);
    --shadow: 0 10px 28px rgba(0, 0, 0, .4);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239D95B3' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.2; }
h2 { font-size: 16px; font-weight: 800; margin: 0 0 12px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 24px; }
.boot { display: grid; place-items: center; min-height: 50vh; color: var(--muted); font-weight: 700; }
svg { display: inline-block; }

@keyframes popin { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes ripple { 0% { transform: scale(.8); opacity: .5; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes fadeout { to { opacity: 0; transform: translateY(-6px); } }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 61, .55); } 100% { box-shadow: 0 0 0 16px rgba(255, 107, 61, 0); } }
@keyframes burst { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-14deg) scale(1.1); } 60% { transform: rotate(10deg) scale(1.1); } }

/* ---------- header ---------- */
.hdr { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.3); }
.hdr-in { display: flex; align-items: center; height: 66px; gap: 22px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 900; font-size: 19px; letter-spacing: -.02em; }
.logo svg { width: 28px; height: 28px; transition: transform .45s var(--spring); }
.logo:hover svg { transform: rotate(-14deg) scale(1.12); }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 8px 14px; border-radius: var(--pill); font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; transition: color .2s, background .2s, transform .25s var(--spring); }
.nav a:hover { color: var(--ink); background: var(--surface-2); transform: translateY(-1px); }
.nav a.on { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.credits {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 12px; border-radius: var(--pill);
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.credits svg { width: 14px; height: 14px; }
.credits.zero { background: var(--sun-soft); color: var(--sun-ink); }
.credits.bump { animation: bump .5s var(--spring); }
.user-btn {
  height: 36px; padding: 0 12px; border: 0; border-radius: var(--pill); background: transparent; cursor: pointer;
  font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; transition: background .2s;
}
.user-btn:hover { background: var(--surface-2); }
.user-btn::after { content: ""; width: 10px; height: 6px; background: var(--chev) no-repeat center; }
main.wrap { padding-top: 28px; padding-bottom: 96px; }

/* ---------- controls ---------- */
.btn {
  position: relative; height: 40px; padding: 0 18px; border: 1.5px solid var(--line-2); border-radius: var(--pill);
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  transition: transform .3s var(--spring), box-shadow .25s, background .2s, border-color .2s, opacity .2s, color .2s;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--faint); }
.btn:active { transform: scale(.94); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(255, 107, 61, .3); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); box-shadow: var(--glow); }
.btn.soft { background: var(--surface-2); border-color: transparent; }
.btn.soft:hover { background: var(--line); }
.btn.text { border-color: transparent; background: transparent; color: var(--muted); }
.btn.text:hover { color: var(--ink); background: var(--surface-2); box-shadow: none; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: transparent; }
.btn.sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 15.5px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.btn.primary:disabled { background: var(--accent); }
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn:not(.primary) .spin { border-color: var(--line-2); border-top-color: var(--ink); }
.burst { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.burst i { position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: var(--accent); animation: burst .75s var(--ease) forwards; }
.burst i:nth-child(odd) { background: var(--sun); }

.in {
  height: 44px; width: 100%; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px; outline: 0; transition: border-color .2s, box-shadow .2s;
}
.in:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.in::placeholder { color: var(--faint); font-weight: 500; }
textarea.in { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; min-height: 90px; }
.in.num { width: 110px; font-variant-numeric: tabular-nums; }
.in.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.sel {
  appearance: none; height: 36px; padding: 0 30px 0 14px; border: 0; border-radius: var(--pill); display: inline-flex; align-items: center;
  background: var(--surface-2) var(--chev) no-repeat right 12px center; font-weight: 700; font-size: 13.5px; color: var(--ink);
  cursor: pointer; max-width: 100%; outline: 0; white-space: nowrap; transition: background-color .2s, transform .25s var(--spring);
}
.sel:hover { background-color: var(--line); }
.sel:active { transform: scale(.97); }
.sel:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.field { display: block; }
.field + .field { margin-top: 14px; }
.lbl { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.lbl-row { display: flex; justify-content: space-between; align-items: baseline; }
.help { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.err { color: var(--danger); font-size: 13px; font-weight: 700; margin-top: 10px; }
.err:empty { display: none; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.switch {
  appearance: none; width: 40px; height: 24px; border-radius: 12px; background: var(--line-2); position: relative;
  cursor: pointer; margin: 0; transition: background .2s; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .3s var(--spring); box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.switch:checked { background: var(--mint); }
.switch:checked::after { transform: translateX(16px); }
.pill { font-size: 12px; padding: 3px 9px; border-radius: var(--pill); background: var(--surface-2); color: var(--muted); font-weight: 800; white-space: nowrap; }
.pill.red { color: var(--danger); background: var(--danger-soft); }
.pill.violet { color: var(--violet); background: var(--violet-soft); }
.note { padding: 12px 14px; border-radius: var(--r); background: var(--sun-soft); color: var(--sun-ink); font-size: 13.5px; font-weight: 600; line-height: 1.5; }
.note a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- popover ---------- */
.pop {
  position: absolute; z-index: 60; min-width: 160px; padding: 6px; background: var(--surface);
  border-radius: 16px; box-shadow: var(--shadow-lg); animation: popin .3s var(--spring); transform-origin: top;
}
.pop button {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none;
  font-weight: 700; font-size: 14px; color: var(--ink); border-radius: 10px; cursor: pointer; transition: background .15s; white-space: nowrap;
}
.pop button:hover { background: var(--surface-2); }
.pop button.danger { color: var(--danger); }
.pop button.on { background: var(--accent-soft); color: var(--accent); }
.pop button svg { width: 14px; height: 14px; flex: none; }
.pop button .blurb { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.pop button.on .blurb { color: var(--accent); opacity: .8; }
.pop .who { padding: 8px 12px 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login form { width: 100%; max-width: 380px; background: var(--surface); border-radius: 28px; padding: 32px; box-shadow: var(--shadow); animation: popin .5s var(--spring); }
.login .logo { font-size: 24px; margin-bottom: 6px; }
.login .logo svg { width: 36px; height: 36px; }
.login .welcome { color: var(--muted); font-weight: 600; margin-bottom: 24px; }
.login .btn { margin-top: 20px; }

/* ---------- photos ---------- */
.photos { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.photos .lbl-inline { font-size: 13.5px; font-weight: 800; color: var(--muted); }
.ph { position: relative; width: 62px; height: 80px; flex: none; cursor: pointer; transition: transform .35s var(--spring); }
.ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; box-shadow: var(--shadow-sm); transition: opacity .25s, filter .25s, outline-color .25s; outline: 3px solid transparent; outline-offset: 2px; }
.ph:hover { transform: translateY(-3px) scale(1.05); }
.ph.on img { outline-color: var(--accent); }
.ph.off img { opacity: .45; filter: grayscale(.7); }
.ph .chk {
  position: absolute; right: -7px; top: -7px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); animation: popin .35s var(--spring);
}
.ph .chk svg { width: 12px; height: 12px; }
.ph .more {
  position: absolute; left: 50%; bottom: -9px; transform: translate(-50%, 4px); height: 22px; padding: 0 9px; border-radius: var(--pill); border: 0;
  background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 800; cursor: pointer; opacity: 0; transition: opacity .2s, transform .25s var(--spring);
}
.ph:hover .more, .ph:focus-within .more { opacity: 1; transform: translate(-50%, 0); }
@media (hover: none) { .ph .more { opacity: 1; transform: translate(-50%, 0); } }
.ph.add {
  border: 2px dashed var(--line-2); border-radius: 16px; background: transparent; display: grid; place-items: center;
  color: var(--muted); font-size: 26px; font-weight: 400; transition: all .25s var(--spring);
}
.ph.add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); transform: translateY(-3px) scale(1.05); }
.photos .hint { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.step { background: var(--surface); border-radius: var(--r-lg); padding: 16px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--shadow-sm); animation: popin .5s var(--spring) backwards; }
.step:nth-child(2) { animation-delay: .08s; }
.step:nth-child(3) { animation-delay: .16s; }
.step .ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; flex: none; }
.step .ic.a { background: var(--accent-soft); }
.step .ic.v { background: var(--violet-soft); }
.step .ic.m { background: var(--mint-soft); }
.step b { display: block; font-weight: 800; font-size: 14px; margin-bottom: 2px; }
.step span { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.4; }
.step.done .ic { background: var(--mint-soft); }
.step.done b::after { content: " ✓"; color: var(--mint); }

/* ---------- composer ---------- */
.seg { display: inline-flex; gap: 3px; padding: 4px; background: var(--surface-2); border-radius: var(--pill); margin-bottom: 12px; }
.seg button {
  height: 32px; padding: 0 16px; border: 0; border-radius: var(--pill); background: transparent;
  font-weight: 800; font-size: 13.5px; color: var(--muted); cursor: pointer; transition: all .3s var(--spring);
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button:hover:not(.on) { color: var(--ink); }
.composer { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: border-color .25s, box-shadow .25s; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.composer.flash { animation: flash .6s var(--ease); }
.composer textarea {
  display: block; width: 100%; min-height: 100px; max-height: 320px; padding: 18px 20px 6px; border: 0; background: transparent;
  color: var(--ink); font-weight: 600; font-size: 16px; line-height: 1.5; resize: none; outline: 0;
}
.composer textarea::placeholder { color: var(--faint); font-weight: 500; }
.cbar { display: flex; flex-direction: column; gap: 10px; padding: 8px 12px 12px 14px; border-top: 1px solid var(--line); }
.crow { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.crow.foot { gap: 8px; }
.cbar .grow { flex: 1; }
.cbar .hint { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chips .clabel { font-size: 12.5px; font-weight: 800; color: var(--muted); margin-right: 2px; }
.chip.opt {
  height: 34px; padding: 0 12px; font-size: 13px; font-weight: 700; gap: 7px; display: inline-flex; align-items: center;
  animation: none; border-color: var(--line);
}
.chip.opt svg { width: 16px; height: 16px; flex: none; }
.chip.opt:hover { border-color: var(--faint); color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.chip.opt.on { background: var(--ink); color: var(--bg); border-color: var(--ink); animation: popin .3s var(--spring); }
.chip.opt.on:hover { color: var(--bg); }
.cnote { margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); min-height: 20px; }
.cnote.err { color: var(--danger); margin-top: 10px; }

.ideas { margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ideas .lbl-inline { font-size: 13px; font-weight: 800; color: var(--muted); }
.chip {
  height: 34px; padding: 0 14px; border-radius: var(--pill); border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: transform .3s var(--spring), border-color .2s, box-shadow .2s, color .2s; animation: rise .4s var(--ease) backwards;
}
.chip:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--ink); box-shadow: var(--shadow-sm); }
.chip:active { transform: scale(.95); }
.chip.ghost { border-style: dashed; color: var(--muted); }
.chip.ghost:hover { color: var(--accent); }
.tips { margin-top: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.tips summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.tips summary::-webkit-details-marker { display: none; }
.tips summary:hover { color: var(--ink); }
.tips ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }

/* ---------- examples ---------- */
.sec { margin-top: 30px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-h h2 { margin: 0; }
.sec-h span { font-size: 13px; color: var(--muted); font-weight: 600; }
.strip { display: flex; gap: 12px; overflow-x: auto; padding: 6px 6px 12px; margin: -6px -6px 0; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.ex {
  flex: 0 0 190px; scroll-snap-align: start; background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .35s var(--spring), box-shadow .3s; animation: popin .5s var(--spring) backwards;
}
.ex:hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow); }
.ex .im { aspect-ratio: 4 / 5; background: var(--surface-2); overflow: hidden; }
.ex img, .ex video { width: 100%; height: 100%; object-fit: cover; }
.ex p { padding: 10px 12px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- results ---------- */
.results { margin-top: 30px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile {
  position: relative; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: var(--surface-2); cursor: pointer; outline: 0;
  box-shadow: var(--shadow-sm); transition: transform .35s var(--spring), box-shadow .3s; animation: popin .5s var(--spring) backwards;
}
.tile:hover { transform: translateY(-5px) scale(1.02); box-shadow: var(--shadow); }
.tile:active { transform: scale(.98); }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.tile:hover img { transform: scale(1.07); }
.tile .cap {
  position: absolute; inset: auto 0 0; padding: 30px 12px 12px; color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.35;
  background: linear-gradient(transparent, rgba(20, 14, 30, .72)); opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .3s var(--ease);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile:hover .cap { opacity: 1; transform: translateY(0); }
.tile .tag {
  position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: var(--pill); font-size: 11.5px; font-weight: 800;
  background: rgba(20, 14, 30, .55); backdrop-filter: blur(6px); color: #fff; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile .tag.r { left: auto; right: 10px; }
.tile.pending, .tile.failed { cursor: default; box-shadow: none; animation: popin .5s var(--spring); }
.tile.pending:hover, .tile.failed:hover { transform: none; box-shadow: none; }
.tile.pending { background: var(--violet-soft); }
.tile.queued { background: var(--sun-soft); }
.tile.failed { background: var(--danger-soft); }
.tile.shake { animation: shake .5s; }
.tile .state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 16px; text-align: center; }
.tile .ttl { font-weight: 800; font-size: 14.5px; color: var(--ink); }
.tile .sub { font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile.failed .ttl { color: var(--danger); }
.tile.failed .sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile.failed .btn { margin-top: 8px; }
.orb {
  position: relative; width: 46px; height: 46px; border-radius: 50%; margin-bottom: 6px;
  background: radial-gradient(circle at 30% 30%, #fff, var(--violet)); box-shadow: 0 6px 18px rgba(123, 108, 246, .4); animation: breathe 1.6s ease-in-out infinite;
}
.orb::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--violet); animation: ripple 1.6s ease-out infinite; }
.queued .orb { background: radial-gradient(circle at 30% 30%, #fff, var(--sun)); box-shadow: 0 6px 18px rgba(242, 179, 61, .4); animation-duration: 2.4s; }
.queued .orb::after { border-color: var(--sun); animation-duration: 2.4s; }
.failed .orb { background: radial-gradient(circle at 30% 30%, #fff, var(--danger)); box-shadow: 0 6px 18px rgba(229, 72, 77, .3); animation: none; }
.failed .orb::after { display: none; }
.bar { width: 72%; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .75); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; width: 4%; border-radius: 3px; background: linear-gradient(90deg, var(--violet), var(--accent)); transition: width 1s linear; }
.ready {
  position: absolute; top: 10px; right: 10px; z-index: 2; height: 26px; padding: 0 10px; border-radius: var(--pill); background: var(--mint); color: #fff;
  font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; box-shadow: 0 3px 10px rgba(34, 185, 131, .45);
  animation: popin .4s var(--spring), fadeout .5s ease 3s forwards;
}
.ready svg { width: 12px; height: 12px; }
.tile.fresh { animation: popin .6s var(--spring); }
.empty { padding: 36px 20px 44px; text-align: center; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg { animation: float 4s ease-in-out infinite; }
.empty b { color: var(--ink); font-weight: 800; }
.more-row { display: flex; justify-content: center; margin-top: 22px; }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(21, 18, 29, .96); display: flex; flex-direction: column; color: #fff; animation: fade .15s; }
.lb-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 60px 76px 12px; }
.lb-stage .main { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; width: 100%; }
.lb-stage .main > * { animation: popin .4s var(--spring); }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lb-stage .msg { color: #bbb; font-size: 14px; font-weight: 600; text-align: center; max-width: 480px; line-height: 1.5; }
.lb-stage .msg strong { color: #fff; display: block; margin-bottom: 4px; font-size: 16px; }
.lb-thumbs { display: flex; gap: 6px; flex: none; }
.lb-thumbs img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; opacity: .5; cursor: pointer; transition: opacity .2s, transform .25s var(--spring); }
.lb-thumbs img:hover { opacity: .9; transform: scale(1.08); }
.lb-thumbs img.on { opacity: 1; outline: 2px solid #fff; }
.lb-info { padding: 0 24px 24px; display: flex; gap: 24px; align-items: flex-end; justify-content: center; }
.lb-text { max-width: 640px; min-width: 0; flex: 1; }
.lb-prompt { font-size: 14.5px; font-weight: 600; line-height: 1.5; color: #f0ecf8; white-space: pre-wrap; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lb-prompt.open { display: block; max-height: 30vh; overflow: auto; }
.lb-meta { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: #9d95b3; }
.lb-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.lb .btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); color: #fff; }
.lb .btn:hover { background: rgba(255, 255, 255, .14); }
.lb .btn.primary { background: var(--accent); border-color: var(--accent); }
.lb .btn.primary:hover { background: var(--accent-2); }
.lb .btn.danger { color: #ff9a97; }
.lb .btn.on { background: var(--mint); border-color: var(--mint); }
.lb-x, .lb-prev, .lb-next {
  position: absolute; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1);
  color: #fff; font-size: 22px; cursor: pointer; display: grid; place-items: center; line-height: 1; transition: background .2s, transform .3s var(--spring);
}
.lb-x:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .22); transform: scale(1.1); }
.lb-x:active, .lb-prev:active, .lb-next:active { transform: scale(.92); }
.lb-x { top: 16px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover { transform: translateY(-50%) scale(1.1); }
.lb-next:hover { transform: translateY(-50%) scale(1.1); }
.lb-prev:disabled, .lb-next:disabled { opacity: .15; cursor: default; }

/* ---------- dialogs ---------- */
.ov { position: fixed; inset: 0; z-index: 40; background: rgba(38, 32, 58, .45); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
.dlg { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--r-lg); padding: 24px; max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); animation: popin .4s var(--spring); }
.dlg h2 { font-size: 18px; margin-bottom: 16px; }
.dlg p { margin-bottom: 12px; color: var(--muted); font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.dlg .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.share { font: 600 13.5px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; white-space: pre-wrap; word-break: break-all; margin-bottom: 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: var(--pill); font-size: 14px; font-weight: 700;
  max-width: calc(100vw - 40px); box-shadow: var(--shadow-lg); animation: toastin .45s var(--spring);
}
.toast.ok { background: var(--mint); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 16px) scale(.9); } }

/* ---------- admin ---------- */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.sub { color: var(--muted); font-size: 13.5px; font-weight: 600; margin-top: 4px; }
.back { font-size: 13.5px; font-weight: 700; color: var(--muted); display: inline-block; margin-bottom: 14px; transition: color .2s, transform .2s; }
.back:hover { color: var(--ink); transform: translateX(-2px); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow-sm); animation: popin .45s var(--spring) backwards; }
.stat:nth-child(2) { animation-delay: .05s; } .stat:nth-child(3) { animation-delay: .1s; } .stat:nth-child(4) { animation-delay: .15s; }
.stat .v { font-size: 24px; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .l { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.row {
  display: grid; grid-template-columns: 1fr 110px 110px 130px; gap: 16px; align-items: center; padding: 13px 16px;
  background: var(--surface); border-radius: 16px; font-size: 14.5px; box-shadow: var(--shadow-sm); transition: transform .3s var(--spring), box-shadow .25s;
}
a.row:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.row.head { background: transparent; box-shadow: none; font-size: 12px; font-weight: 800; color: var(--muted); padding-top: 4px; padding-bottom: 2px; }
.row .name { font-weight: 800; display: flex; gap: 8px; align-items: center; min-width: 0; }
.row .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); }
.row .dim { color: var(--muted); font-size: 13px; font-weight: 600; }
.row.creds { grid-template-columns: 1fr 1.2fr auto; }
.row .pw { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.row .pw code { font: 600 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: 4px 9px; border-radius: 8px; letter-spacing: .03em; }
.row .pw .btn { padding: 0 8px; }
.row .u { text-decoration: underline; text-underline-offset: 2px; }
.row .u:hover { color: var(--ink); }
.section { margin-top: 32px; }
.stat-big { font-size: 44px; font-weight: 900; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-big small { font-size: 15px; font-weight: 700; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.stat-big.bump { animation: bump .5s var(--spring); display: inline-block; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.log { width: 100%; border-collapse: collapse; font-size: 13.5px; font-weight: 600; }
.log td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.log td.d { color: var(--muted); white-space: nowrap; padding-right: 16px; width: 1%; }
.log td.n { text-align: right; font-variant-numeric: tabular-nums; padding-left: 16px; white-space: nowrap; width: 1%; font-weight: 800; }
.log td.a { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 16px; width: 1%; }
.pos { color: var(--mint); }
.settings { display: grid; gap: 16px; max-width: 680px; }
.settings > * { background: var(--surface); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-sm); animation: rise .4s var(--ease) backwards; }
.settings > :nth-child(2) { animation-delay: .05s; } .settings > :nth-child(3) { animation-delay: .1s; } .settings > :nth-child(4) { animation-delay: .15s; } .settings > :nth-child(5) { animation-delay: .2s; }
.model-row { display: grid; grid-template-columns: auto minmax(150px, 1fr) auto; gap: 12px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.model-row .m-name { font-weight: 800; }
.model-row .m-blurb { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.model-row .m-opts { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.model-row .m-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.model-row .m-line .inline { gap: 5px; }
.model-row .in.num { width: 76px; height: 34px; font-size: 13.5px; padding: 0 9px; }
.model-row .lbl { margin: 0; font-size: 12.5px; white-space: nowrap; }
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.keybox { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface-2); border-radius: 16px; flex-wrap: wrap; }
.keyicon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--sun-soft); color: var(--sun-ink); flex: none; }
.keyicon svg { width: 20px; height: 20px; }
.keybox.ok .keyicon { background: var(--mint-soft); color: var(--mint); }
.keytext b { display: block; font-weight: 800; font-size: 15px; letter-spacing: .04em; }
.keytext b span { letter-spacing: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.keytext .status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--sun-ink); }
.keybox.ok .status { color: var(--mint); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }
.keybox.ok .dot { animation: breathe 2.4s ease-in-out infinite; }
.keyform { margin-top: 12px; animation: rise .3s var(--ease); }

@media (max-width: 700px) {
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  main.wrap { padding-top: 18px; }
  .hdr-in { gap: 12px; height: 60px; }
  .nav { gap: 2px; }
  .nav a { padding: 7px 11px; font-size: 13.5px; }
  .hdr-right { gap: 6px; }
  .credits { height: 32px; padding: 0 11px 0 10px; font-size: 13px; }
  .user-btn { padding: 0 8px; }
  .crow.foot .hint { margin-left: auto; }
  .cbar .btn.primary { flex-basis: 100%; height: 46px; font-size: 15px; }
  .chip.opt { height: 32px; padding: 0 10px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .row { grid-template-columns: 1fr auto; }
  .row .hide-m { display: none; }
  .row.creds { grid-template-columns: 1fr; gap: 8px; }
  .row.creds.head { display: none; }
  .lb-stage { padding: 60px 12px 8px; }
  .lb-info { flex-direction: column; align-items: stretch; gap: 12px; padding: 0 16px 16px; }
  .lb-actions { justify-content: flex-start; }
  .lb-prev, .lb-next { width: 36px; height: 36px; font-size: 18px; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .model-row { grid-template-columns: auto 1fr; }
  .model-row .m-opts { grid-column: 1 / -1; align-items: flex-start; }
  .model-row .m-line { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
