:root {
  --bg: #000; --s1: #1C1C1E; --s2: #2C2C2E; --s3: #3A3A3C; --line: rgba(255,255,255,.08);
  --text: #F5F5F7; --muted: #A1A1A6; --blue: #2997FF; --green: #30D158; --orange: #FF9F0A; --red: #FF453A;
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 0 24px; min-height: 60px;
  background: rgba(0,0,0,.72); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 19px; letter-spacing: -.03em; }
nav { display: flex; gap: 4px; flex: 1; }
nav a { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-size: 14px; }
nav a.active { color: var(--text); font-weight: 600; background: var(--s1); }
.top-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 980px; background: var(--s1); font-weight: 600; font-size: 13px; }
.pill::before { content: ''; width: 12px; height: 12px; background: var(--blue); clip-path: polygon(56% 0, 14% 58%, 44% 58%, 40% 100%, 82% 42%, 52% 42%); }
.banner { background: #3A2A0C; color: #FFD27A; text-align: center; font-size: 13px; padding: 8px 16px; }

main { max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; }
h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -.035em; line-height: 1.05; margin: 0 0 10px; }
h2 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 12px; }
h3 { font-size: 17px; margin: 0 0 6px; }
.lead { color: var(--muted); font-size: 17px; line-height: 1.5; margin: 0 0 24px; max-width: 680px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border: 0; border-radius: 980px;
  background: var(--text); color: #000; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--s2); color: var(--text); }
.btn.small { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.danger { background: rgba(255,69,58,.15); color: var(--red); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .choice:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.card { background: var(--s1); border-radius: var(--radius); padding: 22px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tpl { display: flex; flex-direction: column; gap: 10px; color: var(--text); min-height: 190px; transition: transform .15s ease, background .15s ease; }
.tpl:hover { background: #242426; transform: translateY(-2px); }
.tpl .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(41,151,255,.15); color: var(--blue); }
.tpl .go { margin-top: auto; color: var(--blue); font-size: 14px; font-weight: 600; }

.promise { display: flex; gap: 14px; align-items: flex-start; margin: 28px 0 0; }
.promise svg { flex: none; color: var(--green); }

/* login */
.login { max-width: 420px; margin: 8vh auto 0; }
.login .card { display: flex; flex-direction: column; gap: 14px; }

/* forms */
.layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.layout > .main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.layout > .side { flex: 1 1 300px; position: sticky; top: 80px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label, .field .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field .help { font-size: 12px; color: var(--muted); }
input[type=text], input[type=email], input[type=number], select, textarea {
  width: 100%; background: var(--s2); border: 1px solid transparent; border-radius: 12px; padding: 12px 14px; font-size: 15px; }
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #8E8E93; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--blue); }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 -4px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

.drop { border: 1.5px dashed #48484A; border-radius: 16px; background: #161618; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { position: relative; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--s2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .n { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.7); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 980px; }
.thumb button { position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; }
.thumb.loading::after { content: 'Uploading…'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; background: rgba(0,0,0,.55); }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.choice { text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; border-radius: 12px; background: var(--s2); border: 2px solid transparent; cursor: pointer; }
.choice[aria-checked=true] { border-color: var(--blue); background: rgba(41,151,255,.14); }
.choice .t { font-weight: 600; font-size: 14px; }
.choice .d { font-size: 12px; color: var(--muted); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--s2); border-radius: 10px; padding: 2px; }
.seg button { height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 500; }
.seg button[aria-pressed=true] { background: #48484A; color: var(--text); font-weight: 600; }
.cost { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.cost strong { font-size: 22px; }
.err { color: var(--red); font-size: 14px; }

/* jobs */
.jobs { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.job { display: flex; flex-direction: column; gap: 12px; }
.job .media { border-radius: 14px; overflow: hidden; background: #111; }
.job .media video, .job .media img { width: 100%; max-height: 520px; object-fit: contain; background: #111; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 980px; background: var(--s2); }
.status.done { color: var(--green); background: rgba(48,209,88,.14); }
.status.failed { color: var(--red); background: rgba(255,69,58,.14); }
.status.running, .status.queued { color: var(--orange); background: rgba(255,159,10,.14); }
.status.running::before, .status.queued::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.steps { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.space { justify-content: space-between; }
.note { font-size: 13px; color: #FFD27A; background: rgba(255,159,10,.1); padding: 8px 12px; border-radius: 10px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--s2); color: var(--text); padding: 12px 18px; border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }
.toast.ding { background: rgba(48,209,88,.18); color: var(--green); font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--s2); }
th { color: var(--muted); font-weight: 600; font-size: 12px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 640px) { main { padding: 22px 16px 60px; } .topbar { padding: 8px 16px; } .layout > .side { position: static; } }
/* phones: name and Log out on the first row, the page links on a row of their own that slides sideways (they used to run off the screen) */
@media (max-width: 640px) {
  .topbar nav { order: 3; flex: 0 0 auto; width: calc(100% + 32px); margin: 0 -16px; padding: 0 16px; box-sizing: border-box; overflow-x: auto; scrollbar-width: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { flex: none; white-space: nowrap; }
}

/* ---------- studio ---------- */
.m0 { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.wide { width: 100%; }
.big { font-size: 26px; font-weight: 700; }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
main:has(.studio) { max-width: 1440px; }
.studio { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.panel { flex: 1 1 340px; max-width: 440px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.results { flex: 999 1 460px; min-width: 0; }
.seg button { font-size: 13px; }
.caps { display: flex; flex-wrap: wrap; gap: 6px; }
.cap { font-size: 11px; color: var(--muted); background: var(--s2); padding: 3px 8px; border-radius: 980px; }
.slot-add { width: 96px; height: 96px; border-radius: 12px; border: 1.5px dashed #48484A; background: #161618; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font-size: 12px; }
.slot-add:hover { border-color: var(--blue); color: var(--text); }
.slot-add .plus { font-size: 24px; line-height: 1; }
.dim { opacity: .45; }
.frames { display: flex; flex-wrap: wrap; gap: 18px; }
.cost-val { font-weight: 600; }
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gcard { background: var(--s1); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.gcard .media { background: #0d0d0f; }
.gcard .media video, .gcard .media img { width: 100%; max-height: 460px; object-fit: contain; background: #0d0d0f; }
.placeholder { aspect-ratio: 9 / 12; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; }
.placeholder.fail { color: var(--red); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--s3); border-top-color: var(--blue); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gmeta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.clamp { margin: 0; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { border: 1.5px dashed var(--s2); border-radius: 16px; padding: 60px 20px; text-align: center; }
.more { display: inline-block; margin-top: 14px; font-size: 14px; }
@media (max-width: 760px) { .panel { position: static; max-width: none; max-height: none; } }

/* ---------- homepage ---------- */
main:has(.home) { max-width: none; padding: 0; }
.home { display: flex; flex-direction: column; overflow-x: hidden; }
.home h2 { font-size: clamp(30px, 4.4vw, 44px); letter-spacing: -0.035em; margin: 0; }
.h-hero { max-width: 1240px; margin: 0 auto; padding: 48px 24px 40px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; box-sizing: border-box; width: 100%; }
.h-toggles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.seg.mini { grid-auto-columns: auto; }
.seg.mini button { height: 30px; padding: 0 12px; font-size: 13px; }
.h-kicker { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; border-radius: 980px; background: var(--s1); font-size: 13px; font-weight: 500; }
.h-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.4s ease-in-out infinite; }
.h-hero h1 { font-size: clamp(40px, 7vw, 68px); line-height: 1.04; letter-spacing: -0.04em; margin: 0; max-width: 960px; }
.h-word { color: var(--blue); }
.h-sub { margin: 0; font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 680px; line-height: 1.45; }
.h-ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.big-btn { height: 50px; padding: 0 26px; font-size: 17px; }
.h-demo { width: 100%; max-width: 1080px; margin-top: 24px; background: #111113; border: 1px solid rgba(255,255,255,.1); border-radius: 22px; overflow: hidden; text-align: left;
  box-shadow: 0 40px 120px rgba(41,151,255,.12), 0 30px 80px rgba(0,0,0,.6); }
.h-bar { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.07); background: #161618; }
.h-bar span { width: 12px; height: 12px; border-radius: 50%; }
.h-bar em { margin-left: 14px; font-style: normal; font-size: 13px; color: var(--muted); }
.h-body { display: flex; flex-wrap: wrap; min-height: 400px; }
.h-models { flex: 1 1 220px; border-right: 1px solid rgba(255,255,255,.07); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.h-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; padding: 4px 6px 8px; }
.h-model { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; }
.h-model.on { background: var(--s2); }
.h-model span { display: flex; flex-direction: column; gap: 2px; }
.h-model b { font-size: 14px; } .h-model small { font-size: 12px; color: var(--muted); }
.h-model i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.h-main { flex: 999 1 420px; min-width: 0; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.h-prompt { background: var(--s1); border-radius: 16px; padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.h-prompt .h-label { padding: 0; }
.h-typed { font-size: 17px; line-height: 1.45; min-height: 50px; }
.h-caret { color: var(--blue); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.h-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.h-chips span { font-size: 12px; font-weight: 600; background: var(--s2); padding: 5px 10px; border-radius: 980px; }
.h-steps { display: flex; flex-direction: column; gap: 6px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; min-height: 20px; }
.h-steps .ok { color: var(--green); } .h-steps .ok span { color: var(--text); }
.h-shimmer { font-weight: 600; background: linear-gradient(90deg,#A1A1A6 0%,#fff 50%,#A1A1A6 100%); background-size: 200px 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: -200px 0; } to { background-position: 200px 0; } }
.h-progress { height: 4px; border-radius: 980px; background: var(--s2); overflow: hidden; }
.h-progress div { height: 100%; background: var(--blue); border-radius: 980px; transition: width .1s linear; }
.h-done { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; animation: pop .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.h-done video { width: 130px; height: 231px; border-radius: 14px; object-fit: cover; background: #0d0d0f; flex: none; }
.h-done-text { display: flex; flex-direction: column; gap: 10px; flex: 1 1 200px; }
.h-done-text strong { font-size: 17px; }
.h-ding { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; height: 34px; padding: 0 14px; border-radius: 980px; background: rgba(48,209,88,.14); color: var(--green); font-size: 14px; font-weight: 600; }
.h-strip { max-width: 1240px; margin: 0 auto; padding: 8px 24px 36px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.h-names { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; font-size: 17px; font-weight: 600; color: #D2D2D7; }
.h-marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; }
.h-track { display: flex; gap: 12px; width: max-content; animation: marquee 38s linear infinite; }
.h-track span { flex: none; display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: 980px; background: var(--s1); font-size: 15px; font-weight: 600; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }
.h-section { max-width: 1240px; margin: 0 auto; padding: 80px 24px 16px; display: flex; flex-direction: column; gap: 14px; box-sizing: border-box; width: 100%; }
.h-eyebrow { font-size: 14px; font-weight: 600; color: var(--blue); }
/* four steps: 4, 2 or 1 in a row, never 3 + 1. three: the wallet cards, 3 or 1 in a row */
.h-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 12px; }
.h-cards.three { grid-template-columns: repeat(3, 1fr); }
.h-cards.three article { min-height: 0; }
@media (max-width: 1080px) { .h-cards { grid-template-columns: repeat(2, 1fr); } .h-cards.three { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) { .h-cards.three { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .h-cards { grid-template-columns: 1fr; } .h-cards article { min-height: 0; } }
.h-cards article { background: var(--s1); border-radius: 22px; padding: 24px; display: flex; flex-direction: column; gap: 12px; min-height: 210px; }
.h-cards h3 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.h-cards p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.h-step { display: flex; align-items: center; justify-content: space-between; }
.h-step span { width: 34px; height: 34px; border-radius: 50%; background: var(--s2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.h-step em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--green); background: rgba(48,209,88,.14); padding: 4px 10px; border-radius: 980px; }
.h-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; margin-top: 10px; align-items: start; }
.h-pcard { background: var(--s1); border-radius: 22px; padding: 22px 24px; }
.h-pcard .h-label { padding: 0 0 6px; }
.h-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--s2); }
.h-row span { display: flex; flex-direction: column; gap: 2px; }
.h-row b { font-size: 16px; } .h-row small { font-size: 13px; color: var(--muted); }
.h-row strong { font-size: 14px; white-space: nowrap; }
.h-pcard .h-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.h-row .h-price { flex: none; align-items: flex-end; text-align: right; }
.h-row .h-price strong { font-size: 16px; }
.h-final { max-width: 1240px; margin: 0 auto; padding: 96px 24px 100px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.h-final h2 { font-size: clamp(36px, 6vw, 56px); }
.h-final p { margin: 0; font-size: 19px; }
.h-blue { color: var(--blue); }
.h-foot { border-top: 1px solid var(--line); padding: 24px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .h-models { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.07); } .h-done video { width: 110px; height: 196px; } }
@media (prefers-reduced-motion: reduce) { .h-track, .h-caret, .h-dot, .h-shimmer, .h-done { animation: none; } }
.stat .big { margin: 2px 0; }
.meter { height: 8px; border-radius: 980px; background: var(--s2); overflow: hidden; }
.meter div { height: 100%; background: var(--blue); border-radius: 980px; }
.table-wrap { overflow-x: auto; }

/* ---------- @ image tags ---------- */
.mention-wrap { position: relative; }
.mention-wrap textarea, .mention-hl { font: inherit; font-size: 15px; line-height: 1.5; padding: 12px 14px; border: 1px solid transparent; border-radius: 12px;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word; letter-spacing: normal; box-sizing: border-box; width: 100%; min-height: 120px; }
.mention-hl { position: absolute; inset: 0; background: var(--s2); color: var(--text); overflow: hidden; pointer-events: none; }
.mention-wrap textarea { position: relative; background: transparent; color: transparent; caret-color: var(--text); resize: none; overflow: hidden; display: block; }
.mention-wrap textarea::placeholder { color: #8E8E93; }
.mention-wrap textarea::selection { background: rgba(41,151,255,.35); color: transparent; }
.mention-hl mark { border-radius: 5px; padding: 0 1px; margin: 0 -1px; }
.mention-hl mark.ok { background: rgba(41,151,255,.22); color: #7CC0FF; }
.mention-hl mark.bad { background: rgba(255,69,58,.18); color: #FF8A80; }
.mention-menu { position: absolute; z-index: 20; width: 230px; max-height: 260px; overflow: auto; background: #242426; border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 2px; }
.mention-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.mention-item.active, .mention-item:hover { background: var(--s3); }
.mention-item img, .mention-item video { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.mention-item span { display: flex; flex-direction: column; gap: 1px; }
.mention-item b { font-size: 14px; } .mention-item small { font-size: 12px; color: var(--muted); }
.mention-add { width: 40px; height: 40px; border-radius: 8px; border: 1.5px dashed #5A5A5E; display: inline-flex !important; align-items: center; justify-content: center; font-size: 20px; }
.mention-empty { padding: 10px; font-size: 13px; color: var(--muted); }
.thumb .tag-badge { position: absolute; left: 4px; bottom: 4px; right: auto; top: auto; width: auto; height: 22px; padding: 0 7px; border: 0; border-radius: 980px; background: rgba(0,0,0,.72); color: #7CC0FF;
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.thumb .tag-badge:hover { background: var(--blue); color: #fff; }
.thumb .thumb-x { position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; }

/* ---------- glowing Generate button ---------- */
@property --spin { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.gen-bar { position: sticky; bottom: -22px; margin: 0 -22px -22px; padding: 14px 22px 22px; background: linear-gradient(180deg, rgba(28,28,30,0) 0, var(--s1) 18px);
  display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.gen-bar .err:empty { display: none; }
.gen-btn { position: relative; width: 100%; height: 60px; border: 0; border-radius: 18px; padding: 2px; cursor: pointer; isolation: isolate;
  background: conic-gradient(from var(--spin), #2997FF, #8E5BFF, #FF4FD8, #FFB340, #2997FF); animation: gen-spin 3s linear infinite; }
.gen-btn::before { content: ''; position: absolute; inset: -6px; z-index: -1; border-radius: 24px; filter: blur(16px); opacity: .75;
  background: inherit; animation: gen-pulse 2.4s ease-in-out infinite; }
.gen-inner { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 100%; border-radius: 16px;
  background: linear-gradient(180deg, #F5F5F7, #DCDCE2); color: #000; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.gen-icon { display: inline-flex; color: #2997FF; }
.gen-btn:hover .gen-inner { background: #FFFFFF; }
.gen-btn:hover::before { opacity: 1; }
.gen-btn:active { transform: scale(.985); }
.gen-btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.gen-btn:disabled { cursor: progress; animation-duration: 1s; }
.gen-btn:disabled .gen-inner { background: #2C2C2E; color: var(--muted); }
@keyframes gen-spin { to { --spin: 360deg; } }
@keyframes gen-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .gen-btn, .gen-btn::before { animation: none; } }
.cap.warn { color: #FFB340; background: rgba(255,159,10,.14); cursor: help; }

/* ---------- my face (beta) ---------- */
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.face-qr { width: 220px; max-width: 100%; background: #fff; padding: 8px; border-radius: 12px; }
.face-qr svg { display: block; width: 100%; height: auto; }
.pill.face-active { background: rgba(48, 209, 88, .16); color: #30d158; }
.pill.face-failed, .pill.face-expired { background: rgba(255, 69, 58, .14); color: #ff6961; }
.pill.face-verifying, .pill.face-verified, .pill.face-processing { background: rgba(41, 151, 255, .14); color: #64b5ff; }
.face-box { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid rgba(41, 151, 255, .35); border-radius: 12px; background: rgba(41, 151, 255, .06); }
.mention-me { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: rgba(41, 151, 255, .18); font-size: 18px; flex: none; }

.err:empty { display: none; }
p.help { font-size: 13px; color: var(--muted, #8e8e93); }

/* video / audio inputs and audio results */
.thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb-audio { display: grid; place-items: center; align-content: center; gap: 4px; width: 100%; height: 100%; padding: 6px; text-align: center; font-size: 26px; color: var(--muted, #9aa0a6); }
.thumb-audio small { font-size: 10px; line-height: 1.2; word-break: break-all; }
.media.audio { display: grid; place-items: center; min-height: 96px; padding: 16px; background: var(--s2); }
.media.audio audio { width: 100%; }

/* templates */
.tgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tcard { background: var(--s1); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.tcard-link { display: block; }
.tcover { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #0d0d0f; }
.panel .tcover { aspect-ratio: auto; max-height: 340px; object-fit: contain; border-radius: 12px; }
.panel .empty-cover { display: none; }
.empty-cover { display: grid; place-items: center; }
.pre { white-space: pre-line; }
.tslot { display: flex; gap: 12px; align-items: flex-start; }
.tslot > .field { flex: 1; min-width: 0; }
.example { margin: 0; flex: none; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.example img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; }
.example figcaption { font-size: 11px; color: var(--muted); }
.card.inner { background: #161618; padding: 16px; border-radius: 14px; }
.editor { max-width: 820px; margin: 0 auto; }
.tsettings { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tgrid > .empty, .tgrid > p { grid-column: 1 / -1; }
.choice .price { color: var(--text); font-weight: 600; margin-top: 2px; }
.vcard { border: 1px solid var(--line); }

/* workflow canvas */
main:has(.wf) { max-width: none; padding: 0; }
.wf { --c-image: #2997FF; --c-video: #BF5AF2; --c-audio: #30D158; --c-text: #A1A1A6; --c-any: #FF9F0A;
  display: flex; flex-direction: column; height: calc(100dvh - 60px); }
.banner:not([hidden]) ~ main .wf { height: calc(100dvh - 96px); }
.wf-top { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; }
.wf-name { width: auto !important; min-width: 180px; max-width: 360px; background: transparent !important; font-weight: 600; padding: 6px 10px !important; }
.wf-name:hover, .wf-name:focus { background: var(--s1) !important; }
.wf-grow { flex: 1; }
.wf-main { position: relative; flex: 1; min-height: 0; }
.wf-canvas { position: absolute; inset: 0; overflow: hidden; background-color: #0B0B0C; outline: none; cursor: default; touch-action: none;
  background-image: radial-gradient(circle, #2A2A2D 1.2px, transparent 1.3px); background-size: 22px 22px; }
.wf-canvas.panning { cursor: grabbing; }
.wf-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.wf-edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.wf-edge { fill: none; stroke-width: 2.5; stroke: var(--c-any); opacity: .85; }
.wf-edge.c-image { stroke: var(--c-image); } .wf-edge.c-video { stroke: var(--c-video); } .wf-edge.c-audio { stroke: var(--c-audio); } .wf-edge.c-text { stroke: var(--c-text); }
.wf-edge.sel { stroke-width: 4; opacity: 1; filter: drop-shadow(0 0 4px rgba(255,255,255,.4)); }
.wf-edge.temp { stroke: #fff; stroke-dasharray: 6 5; opacity: .8; }
.wf-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.wf-hint { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center;
  color: var(--muted); pointer-events: none; font-size: 14px; max-width: 320px; }
.wf-hint b { color: var(--text); font-size: 16px; }
.wf-tools { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: rgba(28,28,30,.92); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.wf-tool { display: flex; align-items: center; gap: 8px; min-width: 40px; height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text); cursor: pointer; font-size: 13px; }
.wf-tool:hover { background: var(--s2); }
.wf-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: 12px; font-weight: 700; flex: none; background: var(--s3); }
.t-image .wf-ico, .wf-ico.k-image { background: rgba(41,151,255,.2); color: var(--c-image); }
.t-video .wf-ico, .wf-ico.k-video { background: rgba(191,90,242,.2); color: var(--c-video); }
.t-audio .wf-ico, .wf-ico.k-audio { background: rgba(48,209,88,.2); color: var(--c-audio); }
.t-upload .wf-ico, .wf-ico.k-upload { background: rgba(255,159,10,.2); color: var(--c-any); }
.wf-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.wf-zoom { text-align: center; color: var(--muted); padding: 2px 0; }
.wf-node { position: absolute; width: 300px; background: var(--s1); border: 1px solid #333336; border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.45); user-select: none; }
.wf-node.selected { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 6px 24px rgba(0,0,0,.45); }
.wf-head { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 12px; border-bottom: 1px solid var(--line); cursor: grab; }
.wf-title { font-weight: 600; font-size: 14px; flex: 1; }
.wf-x { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 17px; }
.wf-x:hover { background: var(--s2); color: var(--text); }
.wf-run { height: 28px; padding: 0 12px; border: 0; border-radius: 980px; background: var(--text); color: #000; font-weight: 600; font-size: 12px; cursor: pointer; }
.wf-run:disabled { background: var(--s3); color: var(--muted); cursor: progress; }
.wf-body { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; }
.wf-body textarea { min-height: 70px; font-size: 13px; padding: 9px 10px; user-select: text; }
.wf-body select, .wf-body input[type=text], .wf-body input[type=number] { font-size: 13px; padding: 8px 10px; border-radius: 9px; }
.wf-in { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-height: 20px; }
.wf-in span:nth-child(2) { color: var(--text); flex: 1; }
.wf-port { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #0B0B0C; border: 2.5px solid var(--c-any); cursor: crosshair; z-index: 2; }
.wf-port.in { left: -8px; }
.wf-port.out { right: -8px; top: 15px; }
.wf-port.c-image { border-color: var(--c-image); } .wf-port.c-video { border-color: var(--c-video); } .wf-port.c-audio { border-color: var(--c-audio); } .wf-port.c-text { border-color: var(--c-text); }
.wf-port.on, .wf-port.out { background: currentColor; }
.wf-port.out.c-image, .wf-port.on.c-image { background: var(--c-image); } .wf-port.out.c-video, .wf-port.on.c-video { background: var(--c-video); }
.wf-port.out.c-audio, .wf-port.on.c-audio { background: var(--c-audio); } .wf-port.out.c-text, .wf-port.on.c-text { background: var(--c-text); } .wf-port.out.c-any { background: var(--c-any); }
.wf-port:hover, .wf-port.hot { transform: scale(1.35); box-shadow: 0 0 0 4px rgba(255,255,255,.15); }
.wf-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.wf-set { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.wf-set.wide { grid-column: 1 / -1; }
.wf-set.check { flex-direction: row; align-items: center; gap: 6px; font-size: 12px; }
.wf-set.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.wf-media { border-radius: 10px; overflow: hidden; background: #0d0d0f; }
.wf-media img, .wf-media video { width: 100%; max-height: 300px; object-fit: contain; }
.wf-media audio { width: 100%; }
.wf-wait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 140px; }
.wf-drop { height: 64px; border: 1.5px dashed #48484A; border-radius: 10px; background: #161618; color: var(--muted); cursor: pointer; font-size: 13px; }
.wf-drop:hover { border-color: var(--blue); color: var(--text); }
.wf-out-list { display: flex; gap: 6px; overflow-x: auto; }
.wf-hist { flex: none; width: 48px; height: 48px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--s2); color: var(--text); cursor: pointer; }
.wf-hist img, .wf-hist video { width: 100%; height: 100%; object-fit: cover; }
.wf-price { min-height: 16px; }
.wf-cover-empty { background: #0B0B0C radial-gradient(circle, #2A2A2D 1.2px, transparent 1.3px) 0 0 / 18px 18px; }
@media (max-width: 640px) { .wf-tool span:not(.wf-ico) { display: none; } .wf-tools { left: 8px; } }
.linkish { border: 0; background: none; color: var(--blue); cursor: pointer; padding: 2px 4px; }
.wf-body .mention-wrap textarea, .wf-body .mention-hl { font-size: 13px; padding: 9px 10px; border-radius: 10px; min-height: 80px; }
.wf-body .mention-wrap textarea { user-select: text; }
.wf-body .mention-menu { width: 220px; }
.face-name-row { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1; }
.face-at { font-size: 24px; font-weight: 700; color: var(--blue); }
.face-name { width: auto !important; flex: 1; max-width: 320px; background: transparent !important; font-size: 24px !important; font-weight: 700; letter-spacing: -.02em; padding: 4px 8px !important; border-radius: 10px; }
.face-name:hover, .face-name:focus { background: var(--s2) !important; }
.face-pen { color: var(--muted); font-size: 14px; }
.wf-canvas.dropping { box-shadow: inset 0 0 0 2px var(--blue); background-color: #0D1420; }
.wf-node.drop-target { border-color: var(--c-any); box-shadow: 0 0 0 2px var(--c-any), 0 6px 24px rgba(0,0,0,.45); }
.wf-node.drop-target .wf-drop { border-color: var(--c-any); color: var(--text); }

/* big preview */
.zoom { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; padding: 56px 24px 24px; animation: zoomIn .15s ease; }
.zoom-media { max-width: 100%; max-height: calc(100dvh - 90px); object-fit: contain; border-radius: 10px; background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.zoom-bar { position: absolute; top: 12px; right: 16px; display: flex; gap: 10px; align-items: center; }
.zoom-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 24px; cursor: pointer; }
.zoom-x:hover { background: rgba(255,255,255,.25); }
body.zoomed { overflow: hidden; }
[data-zoom] { cursor: zoom-in; }
.zoom-wrap { position: relative; }
.zoom-btn { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; cursor: zoom-in; opacity: .85; }
.zoom-btn:hover { opacity: 1; background: rgba(0,0,0,.8); }
@keyframes zoomIn { from { opacity: 0; } to { opacity: 1; } }
.wf-menu { position: absolute; z-index: 30; min-width: 190px; padding: 5px; background: rgba(36,36,38,.97); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,.55); }
.wf-menu button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 16px; height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font-size: 13px; cursor: pointer; text-align: left; }
.wf-menu button:hover:not(:disabled), .wf-menu button:focus-visible { background: var(--blue); color: #fff; outline: none; }
.wf-menu button:disabled { color: var(--muted); cursor: default; }
.wf-menu button.danger { color: var(--red); }
.wf-menu button.danger:hover { background: var(--red); color: #fff; }
.wf-menu kbd { font: inherit; font-size: 11px; color: inherit; opacity: .6; }
.wf-menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.wf-node.gen { width: 600px; }
.wf-split { display: grid; grid-template-columns: 276px 1fr; gap: 14px; align-items: start; }
.wf-ctrl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wf-result { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wf-result .wf-media img, .wf-result .wf-media video { max-height: 440px; }
.wf-empty { display: grid; place-items: center; aspect-ratio: 9 / 16; max-height: 360px; border: 1.5px dashed #333336; background: transparent; }
.wf-result .wf-wait { height: auto; aspect-ratio: 9 / 16; max-height: 360px; }
.voice-script { background: #161618; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.voice-script .pre { font-size: 16px; line-height: 1.75; }
.rec-on { background: rgba(255,69,58,.18) !important; color: var(--red) !important; }
.wf-tool[draggable="true"] { cursor: grab; } .wf-tool[draggable="true"]:active { cursor: grabbing; }
.voice-script summary { cursor: pointer; }
.voice-form .face-qr svg { max-width: 180px; }
.pill.none { color: var(--muted); font-weight: 500; } .pill.none::before { display: none; }
.wf-menu.card-menu { position: fixed; z-index: 60; }
.wf-card-name { cursor: text; }
.wf-card-rename { width: 100%; font-size: 17px !important; font-weight: 600; padding: 4px 8px !important; border-radius: 8px; }
/* 30-second undo bar */
.undo-bar { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px;
  background: #2C2C2E; color: var(--text); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; box-shadow: 0 12px 36px rgba(0,0,0,.55); font-size: 14px; animation: zoomIn .15s ease; }
.undo-btn { height: 32px; padding: 0 14px; border: 0; border-radius: 980px; background: var(--blue); color: #fff; font-weight: 600; cursor: pointer; }
.undo-count { color: var(--muted); font-size: 12px; min-width: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.undo-x { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.undo-x:hover { background: var(--s3); color: var(--text); }
.wf-body textarea.wf-text { min-height: 140px; max-height: 480px; line-height: 1.6; }

/* ✨ Enhance prompt */
.prompt-box { display: flex; flex-direction: column; gap: 6px; }
.enhance-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.enhance-bar[hidden] { display: none; }
.enhance-btn { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--s3); background: var(--s1); color: inherit; cursor: pointer; }
.enhance-btn:hover:not(:disabled) { border-color: var(--blue); }
.enhance-btn:disabled { opacity: .6; cursor: progress; }

/* student accounts: admin table, top-up forms, wallet */
a.pill { color: var(--text); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num.plus { color: var(--green); }
.stu-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stu-form input, .stu-form select { width: auto; flex: 1 1 150px; padding: 8px 12px; font-size: 14px; }
.stu-form input[type=number] { flex: 0 1 130px; }
.stu td { vertical-align: top; }
.stu-off td { opacity: .55; }
.stu-panel td { background: #161618; padding: 12px; }
.stu-panel td > * + * { margin-top: 10px; }
.invite { white-space: pre-wrap; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); user-select: all; }
.stu-settings summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.stu-settings form { margin-top: 12px; }
.stu-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
