/* ============================================================
   CameoMaker · Warm Night (Ethereal Glass variant)
   Deep warm charcoal #0E0C09 · single amber accent #E8A33D
   Hairline strokes rgba(255,255,255,.08) · asymmetric bento
   ============================================================ */

:root {
  /* palette: one warm-gray family + one amber accent */
  --bg: #0e0c09;
  --surface: #16130c;
  --surface-2: #1c1810;
  --core: #0b0906;
  --ink: #f0eae0;
  --ink-2: #c9c0ae;
  --muted: #9a9081;
  --faint: #6b6355;
  --accent: #e8a33d;
  --accent-ink: #20170a;
  --accent-soft: rgba(232, 163, 61, 0.12);
  --accent-line: rgba(232, 163, 61, 0.32);
  --ok: #a3bd7d;
  --ok-soft: rgba(163, 189, 125, 0.1);
  --err: #e07856;
  --err-soft: rgba(224, 120, 86, 0.08);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* geometry · 4px base */
  --radius-lg: 1.25rem;
  --radius-md: 0.875rem;
  --radius-sm: 0.625rem;
  --pad-shell: 0.375rem;

  /* tinted shadow */
  --shadow-tinted: 0 24px 64px -24px rgba(0, 0, 0, 0.7), 0 10px 28px -18px rgba(232, 163, 61, 0.14);
  --shadow-pop: 0 32px 80px -32px rgba(0, 0, 0, 0.8);

  /* z planes */
  --z-nav: 40;
  --z-modal: 60;
  --z-toast: 90;

  /* motion: everything on one expo-ish curve */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --t-fast: 200ms;
  --t-mid: 400ms;
  --t-slow: 700ms;

  /* type */
  --font-body: -apple-system, "SF Pro Display", "SF Pro Text", "PingFang SC", "MiSans", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* film grain: fixed pseudo-element, data-URI SVG turbulence */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(232, 163, 61, 0.28); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

a { color: var(--accent); text-decoration: none; transition: color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease); }
a:hover { color: #f2b95e; text-decoration: none; }
code { font-family: var(--font-mono); font-size: 0.86em; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* icons: inherit 1.5px hairline stroke */
.ic { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: -0.18em; }
.ic-lg { width: 1.75em; height: 1.75em; }
.ic-xs { width: 0.85em; height: 0.85em; }
.ic-xl { width: 2.6em; height: 2.6em; stroke-width: 1.2; }

/* ------------------------------ top bar ------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: rgba(14, 12, 9, 0.86);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  border-bottom: 1px solid var(--line);
}
.topbar-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px clamp(16px, 4vw, 36px);
  max-width: 1200px; margin: 0 auto; width: 100%;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; }
.brand-mark svg { width: 30px; height: 30px; display: block; }
.brand-name { font-size: 16.5px; font-weight: 700; letter-spacing: -0.02em; }
.brand:hover .brand-name { color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.ghost-btn {
  background: transparent; color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 16px; cursor: pointer; font-size: 13px;
  font-family: inherit; min-height: 32px;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.ghost-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }
.ghost-btn:active { transform: scale(0.98); }

/* nav tabs: current page gets a short amber underline */
.tabs {
  display: flex; gap: 4px; align-items: center;
  padding: 0 clamp(16px, 4vw, 36px) 2px;
  max-width: 1200px; margin: 0 auto; width: 100%;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; color: var(--muted); padding: 8px 14px 12px;
  white-space: nowrap; font-size: 14px; letter-spacing: 0.01em;
  transition: color var(--t-fast) var(--ease);
}
.tabs a::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 0; height: 2px;
  border-radius: 2px; background: var(--accent);
  transform: translateX(-50%);
  transition: width var(--t-mid) var(--ease);
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); font-weight: 600; }
.tabs a.active::after { width: 22px; }

/* ------------------------------ layout ------------------------------ */
.view { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 36px) 96px; }

.foot {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
  color: var(--faint); font-size: 12.5px; padding: 20px clamp(16px, 4vw, 36px) 28px;
  border-top: 1px solid var(--line);
}
.foot a { color: var(--muted); border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; }
.foot a:hover { color: var(--accent); border-color: var(--accent-line); }

/* section heads: eyebrow + display heading */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.h2 { margin: 0; font-size: clamp(1.35rem, 1.05rem + 1.2vw, 1.8rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 8px;
}

/* ------------------------------ primitives ------------------------------ */
/* nested double-ring card: light shell + deep core with inset highlight */
.shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--pad-shell);
}
.core {
  background: var(--core);
  border-radius: calc(var(--radius-lg) - var(--pad-shell));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06);
  padding: 18px 20px;
}
.core-flush { padding: 0; overflow: hidden; }

/* plain card for secondary blocks */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 16px; letter-spacing: -0.01em; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(2, 1fr) minmax(0, 1.4fr); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ------------------------------ buttons ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px;
  padding: 10px 22px; font-size: 14px; font-weight: 650; cursor: pointer; font-family: inherit;
  min-height: 40px; letter-spacing: 0.01em;
  transition: transform var(--t-fast) var(--ease), filter var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; }
.btn.big { padding: 14px 28px; font-size: 15.5px; min-height: 48px; }
.btn.sm { padding: 6px 14px; font-size: 12px; min-height: 32px; gap: 6px; }
.btn.sm .ic { width: 14px; height: 14px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--line-strong); background: var(--surface); filter: none; }
.btn.danger { background: transparent; border: 1px solid rgba(224, 120, 86, 0.45); color: var(--err); }
.btn.danger:hover { border-color: var(--err); background: var(--err-soft); filter: none; }
.btn.ok { background: var(--ok); }

/* primary CTA: pill with trailing arrow nested in its own circle */
.btn-cta {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 999px; padding: 8px 8px 8px 22px;
  font-size: 14px; font-weight: 650; cursor: pointer; font-family: inherit;
  text-decoration: none; min-height: 48px;
  transition: transform var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}
.btn-cta:hover { color: var(--accent-ink); filter: brightness(1.07); transform: translateY(-1px); }
.btn-cta:active { transform: scale(0.98); }
.btn-cta:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; }
.btn-cta .orb {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(32, 23, 10, 0.16); border: 1px solid rgba(32, 23, 10, 0.14);
  transition: transform var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease);
}
.btn-cta:hover .orb { transform: translateX(4px); background: rgba(32, 23, 10, 0.24); }
.btn-cta.w-full { width: 100%; justify-content: space-between; }

/* segmented control */
.seg { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.seg-btn {
  border: 0; background: transparent; color: var(--muted); border-radius: 999px;
  padding: 6px 16px; font-size: 13px; cursor: pointer; font-family: inherit; min-height: 32px;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { color: var(--accent-ink); background: var(--accent); font-weight: 600; }

/* ------------------------------ chips & badges ------------------------------ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 3px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--surface);
  white-space: nowrap;
}
.chip-mock { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); font-weight: 600; }
.chip.green { color: var(--ok); border-color: rgba(163, 189, 125, 0.35); background: var(--ok-soft); }
.chip.red { color: var(--err); border-color: rgba(224, 120, 86, 0.4); background: var(--err-soft); }
.chip.amber { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.chip.accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.cost-badge { font-weight: 700; color: var(--accent); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* inline notices (errors / tips are cards, never alerts) */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 14px;
  font-size: 13.5px; line-height: 1.5; border: 1px solid var(--accent-line);
  background: var(--accent-soft); color: var(--ink-2);
}
.notice .ic { margin-top: 2px; color: var(--accent); }
.notice.err { border-color: rgba(224, 120, 86, 0.4); background: var(--err-soft); }
.notice.err .ic { color: var(--err); }

/* ------------------------------ hero ------------------------------ */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 20px; align-items: end;
  padding: clamp(40px, 8vw, 88px) 0 clamp(28px, 5vw, 56px);
}
.hero-eyebrow { margin-bottom: 14px; }
.hero-title {
  margin: 0 0 14px; font-size: clamp(1.9rem, 1.2rem + 3vw, 3.1rem);
  font-weight: 720; letter-spacing: -0.03em; line-height: 1.12;
  max-width: 18ch;
}
.hero-sub { margin: 0; color: var(--muted); font-size: 15px; max-width: 52ch; }
.hero-side .core { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.hero-side .eyebrow { margin: 0; }
.hero-invite { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.hero-invite a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* ------------------------------ filters ------------------------------ */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 16px; cursor: pointer; font-size: 13px;
  font-family: inherit; min-height: 34px;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.filters button:hover { color: var(--ink); border-color: var(--line-strong); }
.filters button.active { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); font-weight: 600; }

/* ------------------------------ template bento ------------------------------ */
.tpl-grid { display: grid; gap: 16px; grid-template-columns: 1fr; grid-auto-flow: dense; }

.tpl-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--pad-shell);
  cursor: pointer; display: flex;
  transition: transform var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease);
}
.tpl-card:hover { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: var(--shadow-tinted); }
.tpl-card:active { transform: translateY(-1px) scale(0.99); }
.tpl-in {
  background: var(--core); border-radius: calc(var(--radius-lg) - var(--pad-shell));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06);
  overflow: hidden; display: flex; flex-direction: column; flex: 1; width: 100%;
}
.tpl-cover {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--accent);
}
.tpl-cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0.88;
  transition: transform var(--t-slow) var(--ease), opacity var(--t-mid) var(--ease); }
.tpl-card:hover .tpl-cover img { transform: scale(1.04); opacity: 0.96; }
.tpl-cover .cat-ic {
  position: absolute; left: 14px; bottom: 12px; z-index: 2;
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: var(--accent); background: rgba(14, 12, 9, 0.72);
  border: 1px solid var(--line); backdrop-filter: blur(4px);
}
.tpl-cover .cat-ic .ic { width: 20px; height: 20px; }
.tpl-cover::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(11, 9, 6, 0.72), rgba(11, 9, 6, 0.08) 46%, transparent);
}
.tpl-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tpl-name { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.015em; }
.tpl-desc { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.tpl-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.tpl-meta .chip .ic { width: 13px; height: 13px; }

/* asymmetric spans */
@media (min-width: 768px) {
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpl-card.c-4 { grid-column: span 2; }
  .tpl-promo { grid-column: span 2; }
}
@media (min-width: 1080px) {
  .tpl-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tpl-card.c-4 { grid-column: span 4; }
  .tpl-card.c-3 { grid-column: span 3; }
  .tpl-card.c-2 { grid-column: span 2; }
  .tpl-promo { grid-column: span 3; }
  .tpl-card.c-4 .tpl-cover { aspect-ratio: 16 / 9; }
  .tpl-card.c-3 .tpl-cover { aspect-ratio: 16 / 10; }
  .tpl-card.c-2 .tpl-cover { aspect-ratio: 4 / 3; }
  .tpl-card.c-4 .tpl-name { font-size: 18px; }
}

/* promo cell fills the bento remainder */
.tpl-promo {
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  padding: 24px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 10px; color: var(--muted); font-size: 13px; min-height: 180px;
}
.tpl-promo .ic-xl { color: var(--accent); opacity: 0.85; }
.tpl-promo a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; }

/* gallery tail note */
.gallery-tail { margin-top: 28px; color: var(--faint); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ------------------------------ template detail ------------------------------ */
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.back-link:hover { color: var(--ink); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; }
.detail-media {
  border-radius: var(--radius-md); overflow: hidden; position: relative;
  aspect-ratio: 4 / 3; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-info h2 { margin: 4px 0 12px; font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); letter-spacing: -0.025em; line-height: 1.15; }
.detail-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.detail-desc { color: var(--ink-2); margin: 0 0 14px; line-height: 1.65; }
.detail-engine { color: var(--muted); font-size: 12.5px; line-height: 1.8; margin: 0 0 18px; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.detail-invite-row { border-top: 1px solid var(--line); padding-top: 14px; font-size: 13px; }
.detail-invite-row a { display: inline-flex; align-items: center; gap: 6px; }

/* ------------------------------ wizard ------------------------------ */
.wizard-head { margin-bottom: 20px; }

.steps { display: flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; flex-wrap: wrap; }
.step-node { display: flex; align-items: center; gap: 8px; }
.step-dot {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 600;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  transition: border-color var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease), color var(--t-mid) var(--ease);
}
.step-label { font-size: 13px; color: var(--muted); transition: color var(--t-mid) var(--ease); }
.step-link { width: clamp(12px, 4vw, 44px); height: 1px; background: var(--line); }
.step-node.active .step-dot { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.step-node.active .step-label { color: var(--ink); font-weight: 600; }
.step-node.done .step-dot { border-color: rgba(163, 189, 125, 0.5); color: var(--ok); }
.step-node.done .step-label { color: var(--muted); }

.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-md);
  padding: 40px 24px; text-align: center; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  transition: border-color var(--t-mid) var(--ease), color var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease);
}
.dropzone .ic-xl { color: var(--accent); opacity: 0.75; transition: transform var(--t-mid) var(--ease); }
.dropzone:hover, .dropzone.drag { border-color: var(--accent-line); color: var(--ink); background: var(--accent-soft); }
.dropzone:hover .ic-xl, .dropzone.drag .ic-xl { transform: translateY(-3px); }

.subhead { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.thumb {
  aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1.5px solid transparent;
  cursor: pointer; background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  padding: 0; min-height: 44px;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.thumb.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.qc-card { margin-top: 16px; }
.qc-thumb { width: 88px; height: 88px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--line); flex-shrink: 0; }
.qc-meta { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.qc-meta .ic { color: var(--accent); }

/* tier cards: nested double ring, selectable */
.tier-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tier-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--pad-shell); cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.tier-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.tier-card:active { transform: scale(0.99); }
.tier-card .core { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 18px 20px; }
.tier-card.selected { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.tier-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tier-name { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.tier-check { display: none; color: var(--accent); }
.tier-card.selected .tier-check { display: inline-flex; }
.price { font-size: 24px; font-weight: 700; color: var(--accent); margin: 2px 0; }
.tier-desc { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin: 0; }
.tier-waste { color: var(--faint); font-size: 12px; margin: auto 0 0; padding-top: 8px; }

.confirm-list { list-style: none; padding: 0; margin: 0; }
.confirm-list li {
  padding: 12px 0; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px; font-size: 13.5px;
}
.confirm-list li:last-child { border-bottom: 0; }
.confirm-list li > span:first-child { color: var(--muted); }
.confirm-list li b { font-weight: 600; text-align: right; }

.warnings { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.warning-item {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--ink-2); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; line-height: 1.5;
}
.warning-item .ic { color: var(--accent); margin-top: 2px; }

.wizard-nav { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.wizard-note { color: var(--muted); font-size: 12.5px; }

/* ------------------------------ tasks ------------------------------ */
.stats-bar { margin-bottom: 18px; }
.stats-core { display: grid; grid-template-columns: 1.35fr 1fr 1.25fr; padding: 0; }
.stat { padding: 18px 22px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .k { font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.stat .v { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); font-weight: 700; line-height: 1.1; }
.stat .v.cost { color: var(--accent); }

.task-list { display: flex; flex-direction: column; gap: 14px; }
.task-item { padding: var(--pad-shell); margin-bottom: 0; }
.task-item .core { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.task-thumb {
  width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--line);
}
.task-thumb.skel { border-color: transparent; }
.task-main { flex: 1; min-width: 0; }
.task-main .name { font-weight: 650; font-size: 14.5px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-main .sub { font-size: 12px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-ops { display: flex; gap: 8px; flex-shrink: 0; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.task-ops .btn { padding: 7px 16px; font-size: 12.5px; min-height: 34px; }

.error-card {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid rgba(224, 120, 86, 0.35); background: var(--err-soft);
  border-radius: var(--radius-sm); padding: 11px 14px; margin-top: 10px; font-size: 12.5px; line-height: 1.55; color: var(--ink-2);
}
.error-card .ic { color: var(--err); margin-top: 2px; }
.error-card .code { color: var(--err); font-weight: 700; font-family: var(--font-mono); font-size: 11.5px; }

/* skeleton loaders: match the card shapes */
.skel {
  position: relative; display: block; border-radius: var(--radius-sm);
  background: var(--surface-2); overflow: hidden; min-height: 14px;
}
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.06) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: skelSweep 1.6s var(--ease) infinite;
}
@keyframes skelSweep { to { transform: translateX(100%); } }
.skel-line { height: 12px; margin: 7px 0; }
.skel-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; }

/* ------------------------------ result ------------------------------ */
.qc-tip { margin-bottom: 18px; }

.spec-row { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr) minmax(0, 1.45fr); gap: 16px; align-items: stretch; }
.spec-card { padding: var(--pad-shell); }
.spec-card .core { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.spec-card video { width: 100%; background: #000; display: block; object-fit: contain; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.spec-card.spec-1080x1920 video { aspect-ratio: 9 / 16; }
.spec-card.spec-1080x1080 video { aspect-ratio: 1 / 1; }
.spec-card.spec-1920x1080 video { aspect-ratio: 16 / 9; }
.spec-card .cap { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex: 1; }
.spec-card .cap b { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.dl-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--accent-line); color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 7px 15px; font-size: 12.5px; font-weight: 600; min-height: 34px;
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.dl-btn:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--accent); }
.dl-btn:active { transform: scale(0.98); }

.share-card { margin-top: 20px; }
.share-card .core { display: flex; flex-direction: column; gap: 14px; }
.share-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.share-title { display: flex; align-items: center; gap: 12px; }
.share-tile {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); flex-shrink: 0;
}
.share-title b { font-size: 14.5px; }
.share-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
#card-area { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.share-card-canvas { max-width: min(420px, 100%); height: auto; border-radius: var(--radius-md); border: 1px solid var(--line); }

.regen-link { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.regen-link:hover { color: var(--accent); }

.result-foot { margin-top: 26px; }
.result-foot .core { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 22px; }
.result-foot .eyebrow { margin: 0 0 4px; }
.result-foot p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.result-foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }

/* ------------------------------ settings ------------------------------ */
.settings-group { margin-bottom: 18px; }
.settings-group .core { display: flex; flex-direction: column; gap: 4px; }
.group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.group-tile {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); flex-shrink: 0;
}
.group-head h3 { margin: 0; font-size: 15px; letter-spacing: -0.01em; }

.field { display: flex; flex-direction: column; gap: 7px; margin: 14px 0; }
.field label { font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.field .hint { font-size: 11.5px; color: var(--faint); }
.field input, .field select, .field textarea, .onb-field input {
  background: var(--core); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13.5px; font-family: inherit; width: 100%;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--line-strong); }
.field input:focus, .field select:focus, .field textarea:focus, .onb-field input:focus {
  outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.field textarea { min-height: 140px; font-family: var(--font-mono); font-size: 12px; line-height: 1.6; }
.field select { appearance: none; cursor: pointer; }

.key-mask { display: inline-flex; align-items: center; gap: 8px; color: var(--ok);
  font-size: 12px; background: var(--ok-soft); border: 1px solid rgba(163, 189, 125, 0.3);
  border-radius: 999px; padding: 4px 12px; width: fit-content; }
.key-mask .ic { width: 13px; height: 13px; }

.passthrough { white-space: pre-wrap; font-size: 12px; color: var(--muted); line-height: 1.6; }
.about-line { font-size: 12.5px; color: var(--muted); margin: 6px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.about-line .ic { width: 14px; height: 14px; }
.about-line .ok { color: var(--ok); }
.about-line .bad { color: var(--err); }
.settings-actions { margin-top: 18px; }

/* ------------------------------ onboarding ------------------------------ */
.overlay {
  position: fixed; inset: 0; background: rgba(8, 7, 5, 0.9);
  z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: fadeIn var(--t-mid) var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.onb-card {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); max-width: 560px; width: 100%;
  padding: var(--pad-shell); box-shadow: var(--shadow-pop);
  max-height: 92vh; overflow-y: auto;
  animation: cardRise var(--t-slow) var(--ease);
}
@keyframes cardRise { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: none; } }
.onb-inner { background: var(--core); border-radius: calc(var(--radius-lg) - var(--pad-shell));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06); padding: 26px 28px; }
.onb-dots { display: flex; gap: 6px; margin-bottom: 20px; }
.onb-dots i { flex: 1; height: 3px; border-radius: 999px; background: var(--line); transition: background-color var(--t-mid) var(--ease); }
.onb-dots i.on { background: var(--accent); }
.onb-card h2 { margin: 0 0 10px; font-size: 21px; letter-spacing: -0.02em; }
.onb-card .muted { font-size: 13.5px; line-height: 1.65; }
.onb-note { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--faint); line-height: 1.6; margin: 14px 0; }
.onb-note .ic { color: var(--accent); margin-top: 2px; }
.onb-demo-img { width: 118px; border-radius: var(--radius-md); border: 1px solid var(--line); float: right; margin-left: 16px; shape-outside: margin-box; }
.onb-field { margin: 16px 0; }
.onb-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.onb-actions .spacer { flex: 1; }
.onb-out { font-size: 12.5px; color: var(--muted); margin-top: 10px; min-height: 1em; }

.invite-big {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  text-align: center; background: var(--accent); color: var(--accent-ink); font-weight: 700;
  border-radius: 999px; padding: 15px 26px; margin: 18px 0 10px; font-size: 15px;
  transition: filter var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.invite-big:hover { filter: brightness(1.07); transform: translateY(-1px); color: var(--accent-ink); }
.invite-big:active { transform: scale(0.99); }
.invite-url { font-family: var(--font-mono); font-size: 11px; color: var(--faint); text-align: center; word-break: break-all; margin: 0 0 4px; }
.kol-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-line); border-radius: 999px; padding: 4px 14px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.onb-done { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.onb-done video { width: 100%; border-radius: var(--radius-md); border: 1px solid var(--line); }

/* ------------------------------ toast / empty / spinner ------------------------------ */
.toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 10px 20px; box-shadow: var(--shadow-tinted); font-size: 13.5px;
  animation: toastIn var(--t-mid) var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; color: var(--muted); padding: 48px 12px; }
.empty-composed {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; padding: 64px 20px; color: var(--muted);
}
.empty-ill {
  display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--accent); margin-bottom: 6px;
}
.empty-ill .ic { width: 40px; height: 40px; stroke-width: 1.2; }
.empty-composed p { margin: 0; max-width: 46ch; line-height: 1.65; font-size: 13.5px; }

.spinner {
  width: 22px; height: 22px; border: 2px solid var(--line-strong); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: -6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 404 */
.nf { min-height: 56vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.nf-code { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: clamp(4rem, 10vw, 7rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--accent); margin: 0; }
.nf p { color: var(--muted); margin: 0 0 18px; max-width: 40ch; }

/* ------------------------------ reveal on scroll ------------------------------ */
[data-reveal] { opacity: 0; transform: translateY(16px); filter: blur(4px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease), filter var(--t-slow) var(--ease); }
[data-reveal].in { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; filter: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; }
}

/* ------------------------------ responsive ------------------------------ */
@media (max-width: 1023px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .detail-grid { grid-template-columns: 1fr; }
  .spec-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-card.spec-1920x1080 { grid-column: span 2; }
  .grid.cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .view { padding: 20px 16px 72px; }
  .grid.cols-2, .grid.cols-3, .tier-cards, .spec-row { grid-template-columns: 1fr; }
  .spec-card.spec-1920x1080 { grid-column: auto; }
  .stats-core { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
  .task-item .core { flex-wrap: wrap; }
  .task-ops { width: 100%; justify-content: flex-start; }
  .step-label { display: none; }
  .step-node.active .step-label { display: inline; }
  .step-link { width: 14px; }
  .onb-inner { padding: 20px; }
  .hero { padding-top: 24px; }
  .result-foot .core { flex-direction: column; align-items: flex-start; }
  /* touch targets >= 44px */
  .btn, .btn-cta, .ghost-btn, .tabs a, .filters button, .dl-btn, .seg-btn { min-height: 44px; }
  .tabs a { padding: 10px 12px 14px; }
}
