/* PixelCraft — web app styles
   Concept: a dark "light table". The interface stays quiet and neutral so the
   generated images are the brightest thing on screen. One warm gold accent. */

:root {
  --bg: #0f1115;
  --bg-2: #14171d;
  --surface: #191d25;
  --surface-2: #20252f;
  --line: #2a303c;
  --line-2: #363d4b;
  --text: #eceef2;
  --text-2: #b7bcc8;
  --muted: #8a91a0;
  --accent: #f2b33d;
  --accent-hi: #ffc75e;
  --accent-ink: #1c1405;
  --accent-text: #f2b33d;
  --accent-soft: rgba(242, 179, 61, .13);
  --video: #4fd1c5;
  --video-soft: rgba(79, 209, 197, .13);
  --ok: #3fcf8e;
  --err: #f2675c;
  --warn: #f2b33d;
  --side-bg: #12151b;
  --side-line: #232833;
  --side-text: #c9cdd6;
  --side-muted: #7d8494;
  --scrim: rgba(10, 12, 16, .72);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .65);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, .55);
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --line: #dde1e7;
  --line-2: #cbd1da;
  --text: #12151b;
  --text-2: #3e4553;
  --muted: #687080;
  --accent: #eaa62a;
  --accent-hi: #f5b640;
  --accent-ink: #1c1405;
  --accent-text: #93600a;
  --accent-soft: rgba(234, 166, 42, .16);
  --video: #0f9c90;
  --video-soft: rgba(15, 156, 144, .12);
  --ok: #138a55;
  --err: #c9382c;
  --scrim: rgba(244, 245, 247, .8);
  --shadow-lg: 0 24px 60px -24px rgba(17, 24, 39, .28);
  --shadow-md: 0 10px 30px -14px rgba(17, 24, 39, .25);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.hid { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 22px; height: 22px; }
::selection { background: var(--accent); color: var(--accent-ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; white-space: nowrap; letter-spacing: -.005em;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s, transform .18s var(--ease);
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.bp { background: var(--accent); color: var(--accent-ink); }
.bp:hover:not(:disabled) { background: var(--accent-hi); }
.bs { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.bs:hover:not(:disabled) { border-color: var(--line-2); background: var(--surface); }
.bg { color: var(--text); border-color: var(--line-2); }
.bg:hover { background: var(--surface-2); }
.bq { color: var(--text-2); height: 36px; padding: 0 10px; }
.bq:hover { color: var(--text); background: var(--surface-2); }
.blg { height: 52px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.bsm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.bw { width: 100%; }
.icb {
  width: 38px; height: 38px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); border: 1px solid var(--line); background: transparent; transition: .18s var(--ease);
}
.icb:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }
.lang-btn { width: auto; padding: 0 10px; gap: 6px; font-size: 13px; font-weight: 600; }

/* ---------- Toast ---------- */
#toasts {
  position: fixed; z-index: 1000; top: 16px; right: 16px; left: auto;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-2);
  padding: 11px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; max-width: 380px;
  box-shadow: var(--shadow-md); animation: tIn .28s var(--ease);
}
.toast .ic { margin-top: 1px; }
.toast.ok .ic { color: var(--ok); }
.toast.err .ic { color: var(--err); }
.toast.inf .ic { color: var(--accent-text); }
.toast.out { animation: tOut .22s ease-in forwards; }
@keyframes tIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes tOut { to { opacity: 0; transform: translateY(-6px); } }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand-mark { width: 28px; height: 28px; flex: none; }

/* ---------- Public nav ---------- */
.pnav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 64px;
  display: flex; align-items: center; gap: 12px; padding: 0 max(16px, calc((100vw - 1240px) / 2));
  transition: background .25s, border-color .25s, backdrop-filter .25s;
  border-bottom: 1px solid transparent;
}
.pnav.solid { background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.pnav-links { display: flex; gap: 4px; margin-left: 24px; }
.pnav-links button { height: 36px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; font-weight: 500; }
.pnav-links button:hover { color: var(--text); background: var(--surface-2); }
.pnav-r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pnav .brand { color: var(--text); }

/* ---------- Pages ---------- */
.pg.hid { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(92vh, 860px); display: flex; align-items: center; overflow: hidden; isolation: isolate; }
.hero-wall {
  position: absolute; inset: -40px -20px; z-index: -2;
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; transform: rotate(-6deg) scale(1.12);
  opacity: .85;
}
.wcol { display: flex; flex-direction: column; gap: 10px; animation: wallUp 90s linear infinite; }
.wcol:nth-child(even) { animation-name: wallDown; animation-duration: 110s; }
.wcol img { width: 100%; height: auto; border-radius: 12px; object-fit: cover; background: var(--surface); }
@keyframes wallUp { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes wallDown { from { transform: translateY(-50%); } to { transform: translateY(0); } }
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 34%, color-mix(in srgb, var(--bg) 40%, transparent) 70%, color-mix(in srgb, var(--bg) 25%, transparent) 100%),
    linear-gradient(0deg, var(--bg) 0%, transparent 22%, transparent 80%, color-mix(in srgb, var(--bg) 80%, transparent) 100%);
}
.hero-in { width: 100%; max-width: 1240px; margin: 0 auto; padding: 120px 16px 72px; }
.hero h1 {
  font-size: clamp(40px, 6.4vw, 84px); line-height: 1.02; letter-spacing: -.035em; font-weight: 700;
  max-width: 13ch; text-wrap: balance;
}
.hero-sub { margin-top: 22px; font-size: clamp(16px, 1.5vw, 19px); color: var(--text-2); max-width: 46ch; line-height: 1.6; }
.hero-cta { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin-top: 14px; font-size: 13.5px; color: var(--muted); max-width: 60ch; }
.hero-note .ic { display: inline-block; vertical-align: -3px; margin-right: 6px; }
.hero-note + .hero-note { margin-top: 8px; }
.hero-note a, .hero-note button { color: var(--accent-text); font-weight: 600; }
.hero-note a:hover, .hero-note button:hover { text-decoration: underline; }

/* ---------- Sections ---------- */
.sec { max-width: 1240px; margin: 0 auto; padding: 88px 16px 0; }
.sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.sec h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.12; letter-spacing: -.03em; font-weight: 700; max-width: 22ch; text-wrap: balance; }
.sec-lead { color: var(--text-2); margin-top: 10px; max-width: 58ch; font-size: 16px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
:root[data-theme="light"] .seg button.on { box-shadow: 0 1px 3px rgba(17,24,39,.12); }

/* ---------- Masonry showcase ---------- */
.masonry { column-count: 4; column-gap: 12px; }
.mtile {
  position: relative; break-inside: avoid; margin-bottom: 12px; border-radius: 12px; overflow: hidden;
  background: var(--surface); cursor: zoom-in; display: block; width: 100%; text-align: left;
}
.mtile img, .mtile video { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.mtile:hover img, .mtile:hover video { transform: scale(1.035); }
.mtile .mcap {
  position: absolute; inset: auto 0 0 0; padding: 36px 14px 12px; color: #fff; font-size: 13px; line-height: 1.45;
  background: linear-gradient(transparent, rgba(0,0,0,.78)); opacity: 0; transform: translateY(6px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mtile:hover .mcap, .mtile:focus-visible .mcap { opacity: 1; transform: none; }
.mtile .mbadge {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px);
}
.mtile .mbadge .ic { width: 12px; height: 12px; }
.mtile .muse {
  position: absolute; top: 10px; right: 10px; height: 30px; padding: 0 10px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; opacity: 0; transition: opacity .2s;
}
.mtile:hover .muse, .mtile:focus-within .muse { opacity: 1; }
@media (hover: none) { .mtile .mcap { opacity: 1; transform: none; } .mtile .muse { opacity: 1; } }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); counter-reset: st; list-style: none; }
.steps li { padding: 28px 28px 8px 0; position: relative; }
.steps li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.steps .sn { font-size: 56px; line-height: 1; font-weight: 700; letter-spacing: -.04em; color: var(--accent-text); display: block; margin-bottom: 20px; }
.steps h3 { font-size: 20px; letter-spacing: -.02em; line-height: 1.3; margin-bottom: 8px; }
.steps p { color: var(--text-2); font-size: 15px; max-width: 34ch; }
.steps code { white-space: nowrap; font-family: inherit; font-weight: 600; color: var(--text); background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 28px; display: flex; flex-direction: column; }
.plan.feat { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--surface); }
.plan h3 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.plan .tag { font-size: 12px; font-weight: 600; color: var(--accent-ink); background: var(--accent); padding: 2px 8px; border-radius: 999px; }
.plan .price { margin-top: 18px; font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.plan .usd { font-size: 14px; color: var(--muted); margin-top: 8px; min-height: 21px; }
.plan .qty { margin-top: 18px; font-size: 16px; font-weight: 600; }
.plan ul { list-style: none; margin: 16px 0 26px; display: grid; gap: 10px; color: var(--text-2); font-size: 14.5px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li .ic { color: var(--accent-text); margin-top: 3px; width: 16px; height: 16px; }
.plan .btn { margin-top: auto; }
.pay-note { margin-top: 18px; color: var(--muted); font-size: 13.5px; display: flex; gap: 8px; align-items: center; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 0; display: flex; justify-content: space-between; gap: 16px;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { transition: transform .2s var(--ease); color: var(--muted); margin-top: 4px; }
.faq details[open] summary .ic { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--text-2); max-width: 66ch; }

/* ---------- CTA band + footer ---------- */
.band {
  max-width: 1240px; margin: 96px auto 0; padding: 0 16px;
}
.band-in {
  position: relative; overflow: hidden; border-radius: 24px; padding: 56px 48px; min-height: 280px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 18px;
  background: var(--surface); border: 1px solid var(--line); isolation: isolate;
}
.band-in img.bimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.band-in::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10,12,16,.92) 0%, rgba(10,12,16,.65) 55%, rgba(10,12,16,.2) 100%); }
.band-in h2 { color: #fff; font-size: clamp(26px, 3.2vw, 40px); letter-spacing: -.03em; line-height: 1.1; max-width: 18ch; }
.band-in p { color: rgba(255,255,255,.78); max-width: 48ch; }
.foot { max-width: 1240px; margin: 72px auto 0; padding: 28px 16px 40px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; color: var(--muted); font-size: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-left: auto; }
.foot a:hover { color: var(--text); }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-side { padding: 96px 16px 48px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 30px; letter-spacing: -.03em; line-height: 1.15; }
.auth-card .lead { color: var(--text-2); margin-top: 8px; margin-bottom: 26px; }
.fg { margin-bottom: 16px; }
.fg label, .flabel { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.fi {
  width: 100%; height: 46px; padding: 0 14px; border-radius: var(--r-md);
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text); font-size: 15px; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.fi:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fi::placeholder { color: var(--muted); }
.fi.code { font-size: 20px; font-weight: 600; letter-spacing: .08em; text-align: center; height: 56px; text-transform: uppercase; }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gsi { min-height: 44px; display: flex; justify-content: center; }
.alt { margin-top: 22px; text-align: center; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.alt a, .alt button { color: var(--accent-text); font-weight: 600; }
.alt a:hover, .alt button:hover { text-decoration: underline; }
.hint {
  margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; color: var(--text-2); display: flex; gap: 12px; align-items: flex-start;
}
.hint .ic { color: var(--accent-text); margin-top: 2px; }
.hint a { color: var(--accent-text); font-weight: 600; }
.auth-art { position: relative; overflow: hidden; background: var(--bg-2); border-left: 1px solid var(--line); }
.auth-art .art-grid { position: absolute; inset: 0; padding: 76px 12px 12px; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 12px; }
.auth-art .art-grid .mtile { margin: 0; height: 100%; }
.auth-art .art-grid .mtile.tall { grid-row: span 2; }
.auth-art .art-cap { position: absolute; inset: auto 0 0 0; padding: 80px 32px 28px; background: linear-gradient(transparent, rgba(0,0,0,.82)); color: #fff; pointer-events: none; }
.auth-art .art-cap p { font-size: 13px; opacity: .7; }
.auth-art .art-cap strong { display: block; font-size: 15px; font-weight: 500; margin-top: 4px; max-width: 52ch; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side-bg); color: var(--side-text);
  border-right: 1px solid var(--side-line); display: flex; flex-direction: column; padding: 18px 14px; gap: 18px;
}
.side .brand { color: #f3f4f6; padding: 2px 6px; }
.wallet {
  border-radius: 14px; padding: 14px; background: #1a1e26; border: 1px solid var(--side-line);
}
.wallet .wl { font-size: 12.5px; color: var(--side-muted); }
.wallet .wb { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -.02em; margin-top: 2px; }
.wallet .wu { font-size: 12.5px; color: var(--side-muted); min-height: 18px; }
.meter { margin-top: 12px; }
.meter .mh { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--side-text); }
.meter .mh b { font-weight: 600; color: #fff; }
.meter .bar { height: 5px; border-radius: 99px; background: #262b35; margin-top: 6px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .6s var(--ease); }
.meter.v .bar i { background: #4fd1c5; }
.wallet .btn { margin-top: 14px; }
.snav { display: flex; flex-direction: column; gap: 2px; }
.snav .sg { font-size: 12px; color: var(--side-muted); padding: 12px 10px 6px; }
.snav a {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--side-text); transition: background .15s, color .15s;
}
.snav a:hover { background: #1c2029; color: #fff; }
.snav a.on { background: #232833; color: #fff; }
.snav a.on .ic { color: var(--accent); }
.snav a .ext { margin-left: auto; width: 14px; height: 14px; opacity: .5; }
/* Support menu (sidebar): chat with @PixcelCraft / free credits bot */
.sup summary { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px; border-radius: 9px; cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 500; color: var(--side-text); transition: background .15s, color .15s; }
.sup summary::-webkit-details-marker { display: none; }
.sup summary:hover, .sup[open] summary { background: #1c2029; color: #fff; }
.sup summary .chev { margin-left: auto; width: 14px; height: 14px; opacity: .6; transition: transform .2s var(--ease); }
.sup[open] summary .chev { transform: rotate(180deg); }
.sup summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.snav .sup a { height: auto; min-height: 48px; padding: 7px 10px 7px 20px; align-items: center; }
.sup-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sup-tx b { font-weight: 600; font-size: 13.5px; }
.sup-tx small { font-size: 11.5px; color: var(--side-muted); white-space: normal; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--side-muted); padding: 0 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.side-foot a:hover { color: #fff; }
.side-ov { display: none; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 10px;
  padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.topbar .tb-r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.burger { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--text); transition: .18s;
}
.chip:hover { border-color: var(--line-2); background: var(--surface-2); }
.chip .ic { color: var(--accent-text); }
.chip .cq { color: var(--muted); font-weight: 500; }
.umenu { position: relative; }
.ubtn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 4px; border-radius: 999px; border: 1px solid var(--line); }
.ubtn:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; text-transform: uppercase; }
.ubtn .un { font-size: 13.5px; font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.udrop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 248px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .16s, transform .16s var(--ease);
}
.umenu.open .udrop { opacity: 1; transform: none; pointer-events: auto; }
.udrop .uh { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.udrop .uh b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.udrop .uh span { font-size: 12.5px; color: var(--muted); }
.udrop button, .udrop a { width: 100%; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 9px; font-size: 14px; color: var(--text-2); text-align: left; }
.udrop button:hover, .udrop a:hover { background: var(--surface-2); color: var(--text); }
.udrop .danger:hover { color: var(--err); }

.app-body { padding: 28px 24px 56px; max-width: 1480px; width: 100%; }
.sx { display: none; }
.sx.on { display: block; animation: secIn .3s var(--ease); }
@keyframes secIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sx-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.sx-h h2 { font-size: 26px; letter-spacing: -.025em; line-height: 1.2; }
.sx-h p { color: var(--text-2); margin-top: 4px; font-size: 14.5px; max-width: 64ch; }

/* ---------- Studio ---------- */
.studio { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }
.composer, .output { min-width: 0; }
.composer { position: sticky; top: 88px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 18px; }
.pbox { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); transition: border-color .18s, box-shadow .18s; }
.pbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pbox textarea {
  display: block; width: 100%; min-height: 168px; max-height: 420px; resize: vertical; padding: 14px 14px 30px;
  background: transparent; border: 0; outline: none; color: var(--text); font-size: 15px; line-height: 1.6;
}
.pbox textarea::placeholder { color: var(--muted); }
.pbox .cc { position: absolute; right: 12px; bottom: 8px; font-size: 12px; color: var(--muted); }
.pbox .clr { position: absolute; left: 8px; bottom: 4px; height: 26px; padding: 0 8px; font-size: 12.5px; color: var(--muted); border-radius: 6px; }
.pbox .clr:hover { color: var(--text); background: var(--surface-2); }
.cblock { margin-top: 18px; }
.cblock .flabel { display: flex; justify-content: space-between; align-items: center; }
.cblock .flabel button { font-size: 12.5px; font-weight: 500; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.cblock .flabel button:hover { color: var(--text); }
.ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.idea {
  max-width: 100%; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px;
  color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: .15s;
}
.idea:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.ratios { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ratios.r3 { grid-template-columns: repeat(3, 1fr); }
.ratios.r4 { grid-template-columns: repeat(4, 1fr); }
.ratios.r2 { grid-template-columns: repeat(2, 1fr); }
.ratios.opt .ratio { min-height: 40px; padding-top: 8px; padding-bottom: 8px; justify-content: center; }
.ratio {
  height: 62px; border-radius: 10px; border: 1px solid var(--line);
  /* Fixed icon row (24px) + label row: tall icons (9:16, 3:4) can never push into / overlap the label. */
  display: grid; grid-template-rows: 24px auto; justify-items: center; align-items: center; align-content: center; row-gap: 5px;
  font-size: 12.5px; font-weight: 600; line-height: 1.2; color: var(--text-2); transition: .15s;
}
.ratio i { display: block; flex: none; box-sizing: border-box; max-height: 24px; border: 1.6px solid currentColor; border-radius: 3px; }
.ratio:hover { border-color: var(--line-2); color: var(--text); }
.ratio.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.ratio.on i { border-color: var(--accent-text); }
.vinfo { display: flex; gap: 8px; flex-wrap: wrap; }
.vinfo span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.gen { margin-top: 20px; }
.gen .btn { height: 50px; font-size: 15px; }
.gen .cost { margin-top: 10px; text-align: center; font-size: 12.5px; color: var(--muted); }
.out-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.out-h h3 { font-size: 15px; font-weight: 600; }
.out-h a, .out-h button { font-size: 13px; color: var(--muted); font-weight: 500; }
.out-h a:hover, .out-h button:hover { color: var(--text); }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.rcard .rm { position: relative; aspect-ratio: 1; background: #07080a; cursor: zoom-in; overflow: hidden; }
.rcard .rm img, .rcard .rm video { width: 100%; height: 100%; object-fit: cover; }
.rcard .rm .mbadge { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 11.5px; font-weight: 600; }
.rcard .rm .mbadge .ic { width: 11px; height: 11px; }
.rcard .rb { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.rcard .rp { font-size: 13px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.rcard .ra { display: flex; align-items: center; gap: 4px; }
.rcard .rd { font-size: 12px; color: var(--muted); margin-right: auto; }
.rcard .ra .icb { width: 32px; height: 32px; border-radius: 8px; }
.rcard.big { grid-column: 1 / -1; }
.rcard.big .rm { aspect-ratio: auto; max-height: 70vh; display: flex; justify-content: center; }
.rcard.big .rm img, .rcard.big .rm video { object-fit: contain; max-height: 70vh; width: auto; max-width: 100%; }

/* Skeleton (generating) */
.skel .rm { cursor: default; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; color: var(--text-2); font-size: 13px; text-align: center; padding: 20px;
  background: linear-gradient(110deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 55%, var(--line-2)) 50%, var(--surface-2) 70%); background-size: 220% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.skel .pr { width: min(220px, 80%); height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.skel .pr i { display: block; height: 100%; width: 8%; background: var(--accent); border-radius: 99px; transition: width .8s var(--ease); }
.skel .pt { font-weight: 600; color: var(--text); font-size: 14px; }
.skel .rp { color: var(--muted); }
.skel { align-self: start; }
.skel .rm { min-height: 190px; }
.skel .pn { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.skel:not(.big) .rm { gap: 10px; padding: 14px; }
.skel:not(.big) .pw { display: none; }
.btn.jfull:disabled { opacity: 1; background: var(--surface-2); color: var(--text-2); border-color: var(--line); cursor: not-allowed; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

.out-empty { border: 1px dashed var(--line-2); border-radius: var(--r-xl); padding: 28px; }
.out-empty h3 { font-size: 18px; letter-spacing: -.01em; }
.out-empty p { color: var(--text-2); font-size: 14.5px; margin-top: 4px; }
.mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.mini .mtile { margin: 0; aspect-ratio: 1; }
.mini .mtile .mcap { -webkit-line-clamp: 2; font-size: 12px; padding: 30px 10px 8px; }

.banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; margin-bottom: 18px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.banner .ic { color: var(--accent-text); }
.banner .bt { flex: 1; min-width: 200px; font-size: 14px; }
.banner .bt b { display: block; font-weight: 600; }
.banner .bt span { color: var(--text-2); }

/* ---------- Library / history ---------- */
.lib-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.empty { text-align: center; padding: 64px 20px; border: 1px dashed var(--line-2); border-radius: var(--r-xl); color: var(--text-2); }
.empty > .ic { width: 36px; height: 36px; margin: 0 auto 14px; color: var(--muted); stroke-width: 1.4; }
.empty h3 { font-size: 18px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 14.5px; margin-bottom: 18px; }
.list { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.lrow { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.lrow:first-child { border-top: 0; }
.lrow .lt { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: #07080a; cursor: zoom-in; }
.lrow .lt img, .lrow .lt video { width: 100%; height: 100%; object-fit: cover; }
.lrow .lp { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .lm { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; align-items: center; margin-top: 2px; }
.kind { font-weight: 600; }
.kind.image { color: var(--accent-text); }
.kind.video { color: var(--video); }
.lrow .la { display: flex; gap: 4px; }
.txrow { grid-template-columns: minmax(0, 1fr) auto; }
.txrow .amt { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.txrow .amt.pos { color: var(--ok); }
.txrow .amt.neg { color: var(--text); }
.txrow .bal { font-size: 12.5px; color: var(--muted); text-align: right; }

/* ---------- Top up / pricing (app) ---------- */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px; }
.panel h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.panel .pd { color: var(--text-2); font-size: 14px; margin-bottom: 18px; }
.paym { display: grid; gap: 8px; margin-bottom: 20px; }
.paym button {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
}
.paym button .pm-t { font-weight: 600; font-size: 14px; display: block; }
.paym button .pm-d { font-size: 12.5px; color: var(--muted); display: block; }
.paym button.on { border-color: var(--accent); background: var(--accent-soft); }
.paym button:disabled { opacity: .55; cursor: not-allowed; }
.paym .soon { white-space: nowrap; margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line-2); padding: 2px 8px; border-radius: 99px; }
.amts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.amt-b { padding: 12px 8px; border-radius: 12px; border: 1px solid var(--line); text-align: center; transition: .15s; }
.amt-b b { display: block; font-size: 15px; }
.amt-b span { display: block; font-size: 12px; color: var(--muted); min-height: 16px; }
.amt-b:hover { border-color: var(--line-2); }
.amt-b.on { border-color: var(--accent); background: var(--accent-soft); }
.qr { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.qr img { width: 100%; border-radius: 12px; background: #fff; padding: 8px; }
.kv { display: grid; gap: 2px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv div:last-child { border-bottom: 0; }
.kv dt, .kv .k { color: var(--muted); flex: none; }
.kv .v { font-weight: 600; text-align: right; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; word-break: break-all; }
.copy { height: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.copy:hover { color: var(--text); border-color: var(--line-2); }
.warn { margin-top: 14px; font-size: 13px; color: var(--text-2); display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.warn .ic { color: var(--accent-text); margin-top: 1px; }
.qr-ph { min-height: 260px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: var(--muted); text-align: center; border: 1px dashed var(--line-2); border-radius: 14px; padding: 24px; font-size: 14px; }
.qr-ph .ic { width: 40px; height: 40px; stroke-width: 1.3; }
/* Top up tabs + USDT */
.tp-tabs { display: flex; width: max-content; max-width: 100%; margin-bottom: 16px; }
.tp-tabs button { height: 38px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.tp-sym { font-size: 15px; line-height: 1; }
.cx-tk { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; color: #fff; background: #26a17b; }
.cx-tk.bep { background: #26a17b; box-shadow: inset 0 0 0 2.5px #f0b90b; }
.cx-tk.trc { box-shadow: inset 0 0 0 2.5px #ff060a; }
.cx-custom { position: relative; margin-top: 8px; }
.cx-custom .fi { padding-right: 64px; }
.cx-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 600; color: var(--muted); pointer-events: none; }
.cx-est { margin-top: 10px; font-size: 13.5px; color: var(--text-2); min-height: 20px; }
.cx-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.cx-lbl { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cx-amt { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cx-amt small { font-size: 15px; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.cx-amt .copy { align-self: center; }
.cx-vnd { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.cx-badge { flex: none; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--text); }
.cx-badge.trc { border-color: color-mix(in srgb, #ff060a 55%, var(--line)); }
.cx-badge.bep { border-color: color-mix(in srgb, #f0b90b 70%, var(--line)); }
.cx-qr { grid-template-columns: 200px minmax(0, 1fr); }
.cx-qrbox { background: #fff; border-radius: 12px; padding: 8px; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; }
.cx-qrbox img { width: 100%; padding: 0; border-radius: 0; }
.cx-qrbox #cx-qr-js img, .cx-qrbox #cx-qr-js canvas { width: 100% !important; height: auto !important; display: block; }
.cx-addr-row .v code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 600; word-break: break-all; text-align: right; }
.kv .v.soon { color: var(--err); }
.kv .v.ok { color: var(--ok); }
.cx-tx { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cx-tx .fi { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; }
.cx-status { margin-top: 14px; }
.cx-st { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 14px; }
.cx-st b { display: block; font-weight: 600; margin-bottom: 2px; }
.cx-st span { display: block; color: var(--text-2); font-size: 13.5px; }
.cx-st > .ic { flex: none; width: 22px; height: 22px; margin-top: 1px; }
.cx-st > .spin { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.cx-st.ok { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.cx-st.ok > .ic { color: var(--ok); }
.cx-st.err { border-color: color-mix(in srgb, var(--err) 50%, var(--line)); background: color-mix(in srgb, var(--err) 9%, var(--surface)); }
.cx-st.err > .ic { color: var(--err); }
.cx-new { margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.cx-new:hover { color: var(--text); }
.packs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 860px; }
/* Per-credit pricing: unit price cards, kind picker, summary, suggested-amount table */
.plan .price .per { font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0 16px; }
.kind-b { display: flex; gap: 10px; align-items: center; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); transition: .15s; min-width: 0; }
.kind-b > .ic { color: var(--accent-text); flex: none; }
.kind-b b { display: block; font-size: 15px; }
.kind-b small { display: block; font-size: 12.5px; color: var(--muted); }
.kind-b:hover { border-color: var(--line-2); }
.kind-b.on { border-color: var(--accent); background: var(--accent-soft); }
.amt-b .amt-cr { margin-top: 2px; color: var(--accent-text); font-weight: 600; }
.bk-sum { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1.5; }
.bk-sum .bk-usd { color: var(--muted); }
.bk-sum .bk-arr { color: var(--muted); margin: 0 4px; }
.bk-sum .bk-cr { color: var(--accent-text); }
.bk-sum.bad, .cx-est.bad { color: var(--err); }
.bk-short { align-items: center; flex-wrap: wrap; }
.bk-short > span { flex: 1 1 180px; }
.ptable-wrap { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 24px 28px; }
.pt-h { font-size: 17px; font-weight: 600; }
.pt-d { color: var(--muted); font-size: 14px; margin: 4px 0 14px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.ptable th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 8px 8px; border-bottom: 1px solid var(--line); }
.ptable td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable td:first-child { white-space: nowrap; }
.ptable td:first-child b { display: block; font-size: 15px; }
.ptable td:first-child span { font-size: 12.5px; color: var(--muted); }
.pt-pick { width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); font-weight: 600; transition: .15s; white-space: nowrap; }
.pt-pick small { font-weight: 500; color: var(--muted); margin-left: 5px; }
.pt-pick:hover { border-color: var(--accent); }
.pt-pick.on { border-color: var(--accent); background: var(--accent-soft); }
.gift-wrap { max-width: 520px; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 900; background: rgba(5, 6, 8, .9); display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.lb.open { opacity: 1; pointer-events: auto; }
.lb-box { max-width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 12px; }
.lb-media { display: flex; justify-content: center; min-height: 0; }
.lb-media img, .lb-media video { max-width: 100%; max-height: calc(100vh - 150px); border-radius: 12px; object-fit: contain; background: #000; }
.lb-bar { display: flex; align-items: center; gap: 12px; color: #e5e7eb; flex-wrap: wrap; }
.lb-bar p { flex: 1; min-width: 200px; font-size: 14px; color: #c7cbd3; }
.lb-bar .btn.bs { background: #1f232b; border-color: #333a46; color: #fff; }
.lb-x { position: fixed; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; display: flex; align-items: center; justify-content: center; }
.lb-x:hover { background: rgba(255,255,255,.18); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .masonry { column-count: 3; }
  .hero-wall { grid-template-columns: repeat(6, 1fr); }
  .studio { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .pnav-links { display: none; }
  .plans { grid-template-columns: 1fr; max-width: 520px; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 22px 0; border-left: 0; border-top: 1px solid var(--line); }
  .steps li:first-child { border-top: 0; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; z-index: 80; inset: 0 auto 0 0; width: 280px; max-width: 86vw; transform: translateX(-102%);
    transition: transform .25s var(--ease); box-shadow: var(--shadow-lg);
  }
  .app.nav-open .side { transform: none; }
  .side-ov { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .app.nav-open .side-ov { opacity: 1; pointer-events: auto; }
  .burger { display: inline-flex; }
  .studio { grid-template-columns: minmax(0, 1fr); }
  .composer { position: static; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .masonry { column-count: 2; column-gap: 8px; }
  .mtile { margin-bottom: 8px; border-radius: 10px; }
  .hero { min-height: 0; }
  .hero-wall { grid-template-columns: repeat(4, 1fr); gap: 8px; opacity: .55; }
  .wcol { gap: 8px; }
  .hero-scrim { background: linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 55%, color-mix(in srgb, var(--bg) 70%, transparent) 100%); }
  .hero-in { padding: 108px 16px 48px; }
  .hero-cta .btn { width: 100%; }
  .sec { padding-top: 64px; }
  .band-in { padding: 36px 22px; }
  .pnav-r .hide-sm { display: none; }
  .topbar { padding: 0 12px; gap: 6px; }
  .topbar h1 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .topbar .tb-r { gap: 6px; }
  .tb-r .hide-sm { display: none; }
  .ubtn .un { display: none; }
  .ubtn { padding: 0 4px; }
  .ubtn > .ic { display: none; }
  .app-body { padding: 20px 16px 48px; }
  .rgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rcard .rb { padding: 8px 10px 10px; }
  .rcard .rd { display: none; }
  .mini { grid-template-columns: repeat(2, 1fr); }
  .ratios { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .ratio { height: 56px; font-size: 11.5px; }
  .qr { grid-template-columns: 1fr; }
  .qr img { max-width: 240px; margin: 0 auto; }
  .packs { grid-template-columns: 1fr; }
  .amts { grid-template-columns: repeat(2, 1fr); }
  .ptable-wrap { padding: 18px 14px; }
  .ptable td, .ptable th { padding-left: 4px; padding-right: 4px; }
  .pt-pick { padding: 8px; font-size: 14px; }
  .pt-pick small { display: block; margin-left: 0; font-size: 12px; }
  .kind-b { padding: 10px; gap: 8px; }
  .tp-tabs { width: 100%; }
  .tp-tabs button { flex: 1 1 0; min-width: 0; height: auto; min-height: 40px; padding: 6px 8px; font-size: 13px; gap: 6px; white-space: normal; line-height: 1.25; text-align: left; }
  .cx-qr { grid-template-columns: 1fr; }
  .cx-qrbox { width: 200px; margin: 0 auto; }
  .cx-amt { font-size: 26px; }
  .lrow { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .lrow .lt { width: 48px; height: 48px; }
  .foot nav { margin-left: 0; }
  #toasts { left: 16px; right: 16px; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .wcol { animation: none !important; }
}

/* Google link bonus banner */
.gbanner { background: linear-gradient(100deg, var(--accent-soft), transparent 70%), var(--surface); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); padding: 16px 18px; }
.gbanner .bt b { font-size: 15px; }
.gbanner .gsi { min-height: 40px; }
@media (max-width: 720px) { .gbanner .gsi { width: 100%; justify-content: flex-start; } }
/* next-reward banner + hide-for-today button (also on the Google banner) */
.gbanner { position: relative; padding-right: 44px; }
.rb-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rb-acts .btn { white-space: nowrap; }
.rb-acts .btn .ic { color: inherit; } /* .banner .ic would paint it the button's own accent */
.rb-x .ic { color: inherit; }
.rb-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; }
.rb-x:hover { background: var(--surface-2); color: var(--text); }
.rb-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 720px) {
  .rbanner { gap: 10px; padding: 14px 40px 14px 14px; }
  .rbanner .bt { min-width: 0; flex-basis: calc(100% - 40px); font-size: 13px; }
  .rbanner .bt b { font-size: 14px; }
  .rb-acts { width: 100%; }
  .rb-acts .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Pagination (pager.js) ---------- */
.pager { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 13.5px; color: var(--text-2); }
.pager.hid { display: none; }
.pg-size { display: inline-flex; align-items: center; gap: 6px; }
.pg-size select { height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; }
.pg-info { margin-left: auto; font-variant-numeric: tabular-nums; }
.pg-nav { display: inline-flex; gap: 6px; }
.pg-nav .icb { width: 32px; height: 32px; font-size: 18px; line-height: 1; }
.pg-nav .icb:disabled { opacity: .4; cursor: default; }

/* ---------- Batch prompts (batch.js) ---------- */
.bt-mode { display: flex; width: 100%; margin-bottom: 14px; }
.bt-mode button { flex: 1 1 0; }
.composer.bt-on .bt-single { display: none !important; }
.composer:not(.bt-on) .bt-only { display: none !important; }
.bt-ta { width: 100%; min-height: 200px; resize: vertical; padding: 12px 14px; line-height: 1.5; font-size: 14px; height: auto; }
.bt-tools { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.bt-imp { cursor: pointer; }
.bt-cnt { margin-top: 10px; font-size: 13.5px; color: var(--text-2); display: grid; gap: 4px; }
.bt-cnt .bt-low, .bt-dlg .bt-low { color: var(--err); font-weight: 600; }
.bt-warn { color: var(--accent-text); font-size: 12.5px; }
.bt-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 18px; margin-bottom: 18px; }
.bt-h h3 { font-size: 15px; font-weight: 600; }
.bt-sum { font-size: 13px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.bt-bar { position: relative; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 12px 0 10px; display: flex; }
.bt-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.bt-bar b { display: block; height: 100%; background: var(--err); position: absolute; right: 0; top: 0; }
.bt-keep { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.bt-keep .ic { color: var(--accent-text); flex: none; }
.bt-pause { align-items: center; flex-wrap: wrap; }
.bt-pause > span { flex: 1 1 200px; }
.bt-acts2 { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bt-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.bt-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.bt-row.done { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.bt-row.fail { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.bt-row.cancel { opacity: .6; }
.bt-th { width: 48px; height: 48px; border-radius: 9px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; position: relative; color: var(--muted); font-size: 13px; font-weight: 600; padding: 0; }
.bt-th img, .bt-th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.bt-th .ic { position: absolute; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.bt-th .spin { width: 18px; height: 18px; }
.bt-p { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin-top: 2px; }
.bt-st { font-weight: 600; color: var(--muted); }
.bt-st.run { color: var(--accent-text); }
.bt-st.done { color: var(--ok); }
.bt-st.fail { color: var(--err); }
.bt-err { color: var(--text-2); min-width: 0; overflow-wrap: anywhere; }
.bt-pr { display: block; height: 3px; border-radius: 99px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.bt-pr i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.bt-act { display: flex; gap: 6px; align-items: center; }
.icb.dis { opacity: .35; cursor: not-allowed; }
.bt-ov { position: fixed; inset: 0; z-index: 950; background: rgba(5, 6, 8, .7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.bt-dlg { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow-lg); }
.bt-dlg h3 { font-size: 18px; font-weight: 600; }
.bt-dlg > p { margin-top: 8px; font-size: 14px; color: var(--text-2); }
.bt-prev { margin: 14px 0 0; padding: 10px 12px 10px 30px; background: var(--surface-2); border-radius: 10px; font-size: 13px; color: var(--text-2); display: grid; gap: 4px; }
.bt-prev li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-prev li.more { list-style: none; margin-left: -18px; color: var(--muted); }
.bt-dlg .bt-note { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.bt-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .pager { gap: 8px; padding: 8px 10px; flex-wrap: nowrap; }
  .pg-per, .pg-range { display: none; }
  .pg-info { font-size: 12.5px; white-space: nowrap; }
  .bt-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; }
  .bt-th { width: 40px; height: 40px; }
  .bt-acts .btn { flex: 1 1 auto; }
}

/* Tiered bonus */
.bonus-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; font-style: normal; line-height: 1.5; color: var(--accent-ink); background: var(--accent); vertical-align: 2px; }
.amt-b { position: relative; }
.amt-b > .bonus-tag { position: absolute; top: 6px; right: 6px; margin: 0; }
.bk-sum .bk-bonus, .bk-sum .bk-next { display: block; font-size: 13px; margin-top: 2px; }
.bk-sum .bk-bonus { color: var(--ok); font-weight: 600; }
.bk-sum .bk-next { color: var(--muted); }
.pt-bonus { margin-top: 12px; font-size: 13px; color: var(--text-2); }
.pt-pick .pt-b { margin-left: 4px; font-size: 12px; font-weight: 700; color: var(--ok); }

/* duration tip + free-credit ways (muse features) */
.dur-tip { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.dur-tip { padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); }
.freeways { margin-top: 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.freeways h3 { margin: 0 0 10px; font-size: 16px; }
.freeways ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.freeways li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.freeways li .ic { flex: none; margin-top: 2px; }

/* ============================================================
   Nhân vật của tôi + Ảnh → Video + Mẫu prompt (characters.js)
   ============================================================ */
/* bộ chọn nhân vật trong ô tạo ảnh / video */
.char-block .flabel { display: flex; justify-content: space-between; align-items: center; }
.char-block .flabel a { font-size: 12.5px; font-weight: 500; color: var(--accent-text); }
.char-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.chip-ch { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 62px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 12px; color: var(--text-2); background: var(--bg-2); transition: .15s; }
.chip-ch:hover { border-color: var(--line-2); color: var(--text); }
.chip-ch.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.chip-ch img, .chip-ch .ph { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; color: var(--muted); }
.chip-ch .nm { font-size: 11px; max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-ch.none, .chip-ch.add { justify-content: center; }
.chip-ch.none .ic, .chip-ch.add .ic { width: 46px; height: 46px; padding: 14px; border-radius: 10px; background: var(--surface-2); }
.chip-ch.none span, .chip-ch.add span { font-size: 11px; }

/* section Nhân vật của tôi */
#s-characters .sx-h p { color: var(--text-2); margin-top: 4px; font-size: 14.5px; max-width: 64ch; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ch-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.ch-card .ch-thumb { position: relative; aspect-ratio: 16/10; background: #07080a; }
.ch-card .ch-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ch-card .ch-thumb .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.ch-card .ch-thumb .ch-n { position: absolute; top: 8px; right: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-size: 11.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.ch-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ch-body > b { font-size: 15px; }
.ch-body > span { font-size: 13px; color: var(--text-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.ch-acts { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.ch-acts .btn { flex: 1 1 auto; }
.ch-acts .icb { width: 34px; height: 34px; flex: none; }

/* modal nhân vật */
.cm-ov { position: fixed; inset: 0; z-index: 950; background: rgba(5,6,8,.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cm-dlg { width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
.cm-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cm-h h3 { font-size: 17px; font-weight: 600; }
.cm-b { padding: 18px; overflow-y: auto; }
.cm-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.cm-mode { width: 100%; margin-bottom: 16px; }
.cm-mode button { flex: 1 1 0; display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.cm-hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 10px; line-height: 1.45; }
.cm-imgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.cm-cell { position: relative; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.cm-cell img { width: 100%; height: 100%; object-fit: cover; }
.cm-rm { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; }
.cm-noimg { grid-column: 1/-1; padding: 20px; text-align: center; font-size: 13px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 10px; }
.cm-add { cursor: pointer; }
.cm-rights { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.cm-rights input { margin-top: 3px; flex: none; }
.cm-styles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip-st { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.chip-st.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.cm-drafts { margin-top: 14px; }
.cm-draft-wait { display: flex; gap: 10px; align-items: center; padding: 24px; justify-content: center; color: var(--muted); font-size: 13.5px; }
.cm-draft-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.cm-draft { position: relative; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; }
.cm-draft img { width: 100%; height: 100%; object-fit: cover; }
.cm-draft.on { border-color: var(--accent); }
.cm-tick { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; }
.cm-b textarea.fi { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }

/* Cả bộ cảnh */
.sb-panel { grid-column: 1/-1; border-top: 1px solid var(--line); padding: 14px; background: var(--bg-2); }
.sb-ta { width: 100%; min-height: 120px; resize: vertical; padding: 10px 12px; line-height: 1.5; height: auto; }
.sb-cnt { font-size: 12.5px; color: var(--text-2); margin: 8px 0; }
.sb-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sb-sum { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin-top: 10px; }
.sb-cell { position: relative; aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; font-weight: 600; overflow: hidden; padding: 0; }
.sb-cell img { width: 100%; height: 100%; object-fit: cover; }
.sb-cell .sb-i { position: absolute; bottom: 3px; right: 5px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.sb-cell.done { cursor: zoom-in; border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.sb-cell.run { border-color: var(--accent); }
.sb-cell.fail { border-color: var(--err); color: var(--err); }
.sb-cell.cancel { opacity: .5; }
.sb-acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Ảnh → Video */
#s-img2vid .studio { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 24px; align-items: start; }
.i2v-h { font-size: 22px; letter-spacing: -.02em; }
.sx-sub { color: var(--text-2); font-size: 14px; margin: 4px 0 16px; line-height: 1.5; }
.i2v-drop { position: relative; border: 1px dashed var(--line-2); border-radius: var(--r-lg); min-height: 180px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--bg-2); }
.i2v-drop.has { border-style: solid; }
.i2v-ph { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; color: var(--muted); }
.i2v-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.i2v-drop img { max-width: 100%; max-height: 360px; display: block; }
.i2v-change { position: absolute; bottom: 10px; right: 10px; }
.i2v-libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.i2v-libcell { aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); padding: 0; }
.i2v-libcell img { width: 100%; height: 100%; object-fit: cover; }
.i2v-libcell:hover { border-color: var(--accent); }

/* Mẫu prompt */
.tpl-holder { margin-top: 10px; }
.tpl-wrap { position: relative; }
.tpl-toggle { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.tpl-toggle:hover { border-color: var(--line-2); color: var(--text); }
.tpl-pop { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px; max-height: 420px; overflow-y: auto; }
.tpl-hint { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }
.tpl-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tpl-tab { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.tpl-tab.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.tpl-items { display: grid; gap: 6px; }
.tpl-item { text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); display: block; }
.tpl-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.tpl-item b { display: block; font-size: 13.5px; }
.tpl-item span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }

@media (max-width: 980px) {
  #s-img2vid .studio { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .ch-grid { grid-template-columns: 1fr; }
  .cm-draft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-scenes { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
  .chip-ch { width: 56px; }
}

/* ---------- Video vẽ tay (handdrawn.js) ---------- */
#s-handdrawn .studio { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 24px; align-items: start; }
.hd-mode { display: flex; width: 100%; margin: 4px 0 16px; }
.hd-mode button { flex: 1 1 0; }
.hd-topic .fi, .hd-voice { width: 100%; }
.hd-range { width: 100%; accent-color: var(--accent); margin: 4px 0 0; }
.hd-ticks { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
#s-handdrawn .cblock .flabel b { font-variant-numeric: tabular-nums; color: var(--text); font-size: 13.5px; }
.hd-lang { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.hd-lang .ic { color: var(--accent-text); flex: none; }
.hd-pay { margin-top: 14px; }
.hd-price { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.hd-price span { color: var(--text-2); font-size: 12.5px; }
.hd-short { align-items: center; flex-wrap: wrap; }
.hd-short > span { flex: 1 1 180px; }
.rcard .rm.hd-rm, .hd-rm { aspect-ratio: 16/9; cursor: default; background: #000; }
.rcard .rm.hd-rm video, .hd-rm video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.hd-sample { margin-bottom: 22px; }
.hd-sample .rcard { max-width: 760px; }
.hd-rh { margin-top: 4px; }
.hd-jobs { display: grid; gap: 12px; }
.hd-job { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; min-width: 0; }
.hd-job.done { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.hd-job.fail { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.hd-job.lost { opacity: .7; }
.hd-job .bt-bar { margin: 0; }
.hd-job .hd-rm { border-radius: 10px; overflow: hidden; }
.hd-jh { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; min-width: 0; }
.hd-jh b { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; min-width: 0; }
.hd-x { width: 32px; height: 32px; flex: none; }
.hd-x:disabled { opacity: .35; cursor: not-allowed; }
.hd-meta { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 12.5px; }
.hd-pct { font-variant-numeric: tabular-nums; color: var(--text-2); }
.hd-ref { display: inline-flex; gap: 4px; align-items: center; color: var(--ok); font-weight: 600; }
.hd-msg { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
@media (max-width: 980px) {
  #s-handdrawn .studio { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- @mention nhan vat + tach prompt batch ---------- */
.men-status { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.men-status:empty { display: none; }
.men-hint { font-size: 12.5px; color: var(--muted); }
.men-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); font-size: 12.5px; font-weight: 600; color: var(--text); }
.men-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.men-warn { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--err); overflow-wrap: anywhere; }
.men-dd { position: fixed; z-index: 960; max-height: 240px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 4px; }
.men-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: left; font-size: 13.5px; }
.men-item:hover, .men-item.on { background: var(--surface-2); }
.men-item img, .men-ph { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); flex: none; }
.men-tag { font-weight: 700; }
.men-nm { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.men-none { padding: 10px 12px; font-size: 13px; color: var(--muted); }
/* select tach prompt trong o batch */
.bt-split { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.bt-split label { font-size: 13.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.bt-split-sel { height: 40px; width: auto; min-width: 0; flex: 1 1 auto; }
@media (max-width: 720px) {
  .bt-split { flex-wrap: wrap; gap: 6px; }
  .bt-split-sel { flex-basis: 100%; width: 100%; }
}
