/* Premium layer (2026-10): tokens, glass, motion, studio, gallery, palette.
   Loaded last. Does not replace theme.css — it deepens it. */

@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('/static/fonts/manrope-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('/static/fonts/manrope-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('/static/fonts/manrope-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('/static/fonts/manrope-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
  --fs-sm: .88rem; --fs-md: 1rem; --fs-lg: 1.15rem;
  --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --t-fast: 120ms; --t-base: 200ms; --t-slow: 400ms;
  --ok: #1a7f4b; --ok-bg: rgba(26, 127, 75, .1);
  --warn: #9a6700; --warn-bg: rgba(154, 103, 0, .1);
  --danger: #b42318; --danger-bg: rgba(180, 35, 24, .08);
  --info: #4b2ee0; --info-bg: rgba(108, 71, 255, .1);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px rgba(108, 71, 255, .65);
  --glass: rgba(255, 255, 255, .72);
  --glass-border: rgba(255, 255, 255, .55);
  --elev-1: 0 1px 2px rgba(23, 21, 31, .04);
  --elev-2: 0 8px 24px rgba(23, 21, 31, .06);
  --elev-3: 0 18px 50px rgba(108, 71, 255, .14);
  color-scheme: light;
}
html[data-theme="dark"] {
  --ok: #5dcca0; --ok-bg: rgba(93, 204, 160, .12);
  --warn: #f5c16c; --warn-bg: rgba(245, 193, 108, .12);
  --danger: #ffb4ab; --danger-bg: rgba(255, 180, 171, .1);
  --info: #d7cbff; --info-bg: rgba(176, 140, 255, .16);
  --glass: rgba(18, 16, 22, .72);
  --glass-border: rgba(255, 255, 255, .08);
  --focus-ring: 0 0 0 2px #121016, 0 0 0 4px rgba(176, 140, 255, .8);
  color-scheme: dark;
}

html { scroll-behavior: smooth; }
body {
  font-feature-settings: "ss01", "cv11";
  font-variant-numeric: tabular-nums;
}
.price, .gen-price, .stat .v, .balance-pill b, td.num, th.num { font-variant-numeric: tabular-nums; }

/* depth */
.glow-bg span { opacity: .22; filter: blur(100px); }
html[data-theme="dark"] .glow-bg span { opacity: .34; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
html[data-theme="dark"] body::before { opacity: .06; }

.topbar {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  transition: box-shadow var(--t-base) var(--ease-out);
}
.topbar.scrolled { box-shadow: var(--elev-2); }
.topbar .nav a.link { border-radius: var(--r-sm); }

.skip-link {
  position: absolute; left: 12px; top: -120px; z-index: 200; background: var(--text); color: var(--bg);
  padding: 8px 14px; border-radius: 999px; font-weight: 800;
}
.skip-link:focus { top: 10px; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; box-shadow: var(--focus-ring);
}
.btn:active { transform: scale(.98); }
.btn-primary { position: relative; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading::after {
  content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  display: inline-block; margin-left: 8px; vertical-align: -2px; animation: spin .8s linear infinite;
}

.card, .box, .model-card, .scn, .why, .stat, .ex-tile {
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base);
}
.model-card, .scn, .why, .ex-tile { position: relative; }
.model-card::after, .scn::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(108, 71, 255, .16), transparent 42%);
  opacity: 0; transition: opacity var(--t-base);
}
.model-card:hover::after, .scn:hover::after { opacity: 1; }

* { scrollbar-width: thin; scrollbar-color: rgba(108, 71, 255, .35) transparent; }

.theme-cycle {
  width: 38px; height: 38px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.theme-cycle:hover { border-color: var(--accent-line); color: var(--accent-ink); }
.theme-cycle .ico { width: 18px; height: 18px; }

.balance-pill.flash-bal { animation: balpop .6s var(--ease-spring); }
@keyframes balpop { 50% { transform: scale(1.06); } }


/* mobile tab bar */
.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 96;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--border);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68em; font-weight: 800; color: var(--text-dim); padding: 6px 2px; border-radius: 12px; }
.tabbar a.on, .tabbar a:hover { color: var(--accent-ink); background: var(--accent-soft); }
.tabbar .ico { width: 20px; height: 20px; }
@media (max-width: 760px) {
  .tabbar { display: flex; }
  body.has-tabbar { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .topbar.open .nav {
    position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 120;
    display: flex; flex-direction: column; gap: 4px; padding: 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
    box-shadow: var(--elev-3); max-height: 70vh; overflow: auto;
  }
  .mp-panel .gsubmit { bottom: calc(62px + env(safe-area-inset-bottom)) !important; }
  /* mobile header: brand + balance; everything else lives in the «Меню» sheet */
  .topbar .nav, .topbar .menu-toggle, .topbar .right > :not(.balance-pill) { display: none !important; }
  .topbar .balance-pill { display: inline-flex; }
}
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; font-size: .68em; font-weight: 800; color: var(--text-dim); padding: 6px 2px; border-radius: 12px; border: 0; background: none; cursor: pointer; }
.tabbar button:hover, .tabbar button[aria-expanded="true"] { color: var(--accent-ink); background: var(--accent-soft); }
.tabbar a.tab-cta { color: #fff; background: var(--accent-grad); }
.msheet-wrap { position: fixed; inset: 0; z-index: 130; }
.msheet-wrap[hidden] { display: none; }
.msheet-back { position: absolute; inset: 0; background: rgba(8, 6, 20, .5); backdrop-filter: blur(3px); animation: msheet-fade .2s ease; }
.msheet { z-index: 1; max-height: 85vh; max-height: 85dvh; overscroll-behavior: contain; padding-left: calc(18px + env(safe-area-inset-left)); padding-right: calc(18px + env(safe-area-inset-right)); transition: transform .22s ease; touch-action: pan-y; }
.msheet-wrap.closing .msheet { transform: translateY(100%); }
.msheet-wrap.closing .msheet-back { opacity: 0; transition: opacity .2s; }
@keyframes msheet-fade { from { opacity: 0; } }
.msheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.msheet-head b { font-size: 1.1em; }
.msheet-x { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.msheet-x .ico { width: 18px; height: 18px; }
.msheet-user { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); color: var(--text); text-decoration: none; margin-bottom: 8px; }
.msheet-user span { display: flex; flex-direction: column; min-width: 0; }
.msheet-user b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msheet-user small { color: var(--text-dim); font-weight: 700; }
.msheet-links { display: flex; flex-direction: column; gap: 2px; }
.msheet-links a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; color: var(--text); font-weight: 700; text-decoration: none; }
.msheet-links a .ico { width: 20px; height: 20px; color: var(--text-dim); }
.msheet-links a.on, .msheet-links a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.msheet-links a.on .ico { color: inherit; }
.msheet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--border); margin-top: 6px; font-weight: 700; }
.msheet-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.msheet-seg a { display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border-radius: 999px; color: var(--text-dim); font-size: .85em; font-weight: 800; text-decoration: none; }
.msheet-seg a .ico { width: 16px; height: 16px; }
.msheet-seg a.on { background: var(--accent-grad); color: #fff; }
.msheet-logout { margin: 6px 0 0; border-top: 1px solid var(--border); padding-top: 6px; }
.msheet-logout button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 12px; background: none; color: var(--danger); font: inherit; font-weight: 700; cursor: pointer; }
.msheet-logout button .ico { width: 20px; height: 20px; }
.msheet-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
html.msheet-open, html.msheet-open body { overflow: hidden; }

/* toasts */
.toaster { position: fixed; right: 16px; bottom: 16px; z-index: 140; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100% - 32px)); }
.has-tabbar .toaster { bottom: calc(78px + env(safe-area-inset-bottom)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--elev-3);
  font-weight: 700; animation: toastin var(--t-slow) var(--ease-out);
}
.toast.ok { border-color: rgba(26, 127, 75, .35); }
.toast.err { border-color: rgba(180, 35, 24, .4); }
.toast button { margin-left: auto; }
@keyframes toastin { from { transform: translateY(8px); opacity: 0; } }

/* command palette */
.palette { position: fixed; inset: 0; z-index: 150; background: rgba(17, 14, 28, .45); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.palette[hidden] { display: none; }
.palette-card { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--elev-3); overflow: hidden; }
.palette-card input { width: 100%; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 16px 18px; font-size: 1.05em; background: transparent; }
.palette-list { max-height: 50vh; overflow: auto; padding: 6px; }
.palette-list button, .palette-list a {
  width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 0; border-radius: 12px;
  background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer;
}
.palette-list button.on, .palette-list button:hover, .palette-list a:hover { background: var(--accent-soft); }
.palette-list small { margin-left: auto; color: var(--text-dim); font-weight: 600; }
.palette-foot { padding: 8px 14px 12px; color: var(--text-dim); font-size: .8em; display: flex; gap: 12px; }
kbd { font-family: inherit; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; background: var(--surface-2); font-size: .85em; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 160; background: rgba(8, 6, 14, .88); display: flex; align-items: center; justify-content: center; }
.lb[hidden] { display: none; }
.lb img, .lb video { max-width: min(1100px, 92vw); max-height: 86vh; border-radius: 16px; }
.lb-x, .lb-nav { position: absolute; top: 16px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 22px; cursor: pointer; }
.lb-x { right: 16px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; } .lb-next { right: 12px; }

/* gallery */
/* «Генерации»: table only (08.10.2026) — the favorite star lives in its own column */
.works-table th.c-fav { width: 60px; }
.works-table td.cell-fav { text-align: center; padding-left: 4px; padding-right: 4px; }
.fav-star { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text-dim); cursor: pointer; }
.fav-star .ico { width: 18px; height: 18px; }
.fav-star:hover { color: var(--text); border-color: var(--text-dim); }
.fav-star.on { color: #e9a400; border-color: rgba(233, 164, 0, .55); background: rgba(255, 196, 0, .14); }
.fav-star.on .ico { fill: currentColor; }
table.works-table tr[hidden] { display: none !important; }
.works-search { flex: 1 1 200px; display: flex; }
.works-search input { width: 100%; }
.cont-box { display: flex; gap: 16px; align-items: center; margin-top: 16px; }
.cont-media { width: 112px; height: 112px; flex: none; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.cont-media img, .cont-media .thumb-vid { width: 100%; height: 100%; object-fit: cover; display: block; }
.cont-body { min-width: 0; flex: 1; }
.cont-p { margin: 6px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-label.m0 { margin: 0 0 4px; }
.cont-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cont-actions .btn { width: auto; }
@media (max-width: 560px) { .cont-box { flex-direction: column; align-items: stretch; } .cont-media { width: 100%; height: 180px; } }
.tx-line { margin: 4px 0 16px; }
.tx-day { font-weight: 800; font-size: .85em; color: var(--text-dim); margin: 16px 0 2px; text-transform: none; }
.tx-time .tx-main { flex: 1; min-width: 0; }
.tx-time .tx-amt { text-align: right; white-space: nowrap; }
.tx-time.is-pos .dot { background: var(--ok, #22c55e); }
.tx-time.is-neg .dot { background: var(--text-dim); }
.tx-time b.pos { color: var(--ok, #22c55e); }
.filters-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.ob-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 8px 0 14px; }
.ob-bar i { display: block; height: 100%; background: var(--accent-grad); border-radius: inherit; }

/* studio extras */
.prompt-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.gcount.warn { color: var(--warn); font-weight: 800; }
.gcount.full { color: var(--danger); font-weight: 800; }
.stage-rail { display: flex; gap: 6px; margin-top: 12px; }
.stage-rail span { flex: 1; height: 4px; border-radius: 99px; background: var(--surface-3); }
.stage-rail span.on { background: var(--accent-grad); }
.keep-note { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-weight: 700; font-size: .85em; }
.cmp-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.cmp-strip img { width: 100%; border-radius: 12px; }
.sk { border-radius: 16px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; min-height: 220px; width: 100%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* home */
.hero-frame { margin: 28px auto 0; max-width: 860px; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--elev-3); background: var(--surface); aspect-ratio: 16/9; position: relative; }
.hero-frame img, .hero-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-show picture { display: contents; }
.hero-show img { transition: opacity .9s ease, transform 6s ease; }
.hero-show img:not(:first-of-type), .hero-show picture:not(:first-of-type) img { position: absolute; inset: 0; }
.hero-show img:not(.on) { opacity: 0; transform: scale(1.04); }
.hero-show img.on { opacity: 1; transform: scale(1); }
.hero-frame figcaption a { color: inherit; text-decoration: none; }
.hero2 h1 .grad-text { background-size: 220% 100%; animation: grad-pan 7s ease-in-out infinite alternate; }
@keyframes grad-pan { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.vendor-filters { flex-basis: 100%; }
.vendor-filters .chip-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.vendor-filters .chip-row::-webkit-scrollbar { display: none; }
.vendor-filters .fchip { flex: none; }
.prices-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0 4px; }
.prices-tools .search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px 14px; }
.prices-tools .search .ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; opacity: .6; }
.prices-tools .search input { border: 0; background: transparent; outline: none; box-shadow: none; padding: 10px 0; flex: 1; min-width: 0; color: var(--text); font: inherit; }
details.pcard > summary { list-style: none; cursor: pointer; flex-wrap: wrap; gap: 4px 10px; }
details.pcard > summary::-webkit-details-marker { display: none; }
details.pcard > summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: 0 4px 3px auto; opacity: .55; transition: transform .2s; flex: none; }
details.pcard[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
details.pcard:not([open]) > summary { margin-bottom: 0; }
.pcard-from { font-weight: 800; white-space: nowrap; }
.pgrid { align-items: start; }
.pcard { background: var(--surface); }
.pcard-sub { flex-basis: 100%; order: 2; }
details.pcard > summary::after { order: 1; }
.price-calc-sm { margin: 0 0 12px; padding: 12px; }
.price-calc-sm .sort-row { flex-wrap: wrap; }
.price-calc-sm select, .price-calc-sm input { max-width: 100%; }
.hero-frame figcaption { position: absolute; left: 12px; bottom: 12px; background: var(--glass); backdrop-filter: blur(10px); border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: .85em; }
.marquee-names { overflow: hidden; margin: 28px 0 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-names-track { display: flex; gap: 28px; width: max-content; animation: mq 28s linear infinite; font-weight: 800; color: var(--text-dim); }
@keyframes mq { to { transform: translateX(-50%); } }
.stat-count { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; }

/* catalog picker + prices calc */
.picker, .price-calc { padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid var(--accent-line); background: linear-gradient(160deg, rgba(108,71,255,.06), rgba(255,77,157,.05)); margin-bottom: 16px; }
.picker .chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.sort-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0 0 18px; }
.sort-row label { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: auto; font-weight: 700; }
.sort-row select, .sort-row input { width: auto; min-width: 220px; }
.model-card.is-hit { outline: 2px solid var(--accent); }
.cmp-bar { position: sticky; bottom: 12px; z-index: 30; display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--elev-3); margin-top: 12px; }
.mc-cmp { float: right; position: relative; z-index: 2; margin-left: 8px; border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; font-weight: 800; font-size: .72em; line-height: 1.4; background: var(--surface); color: var(--text-dim); cursor: pointer; }
.mc-cmp.on { background: var(--accent-grad); color: #fff; border-color: transparent; }
.model-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.marquee-names { margin-top: 22px; }
.cmp-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.cmp-table td, .cmp-table th { border-bottom: 1px solid var(--border); padding: 8px; text-align: left; }

.queue-dot { position: relative; }
.queue-dot[data-n]:not([data-n="0"])::after {
  content: attr(data-n); position: absolute; top: -6px; right: -8px; min-width: 16px; height: 16px; border-radius: 99px;
  background: var(--accent-grad); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.qpop { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--elev-3); padding: 8px; z-index: 40; }
.qpop a { display: block; padding: 8px; border-radius: 10px; font-weight: 700; }
.qpop a:hover { background: var(--accent-soft); }

.error-hero { text-align: center; padding: 48px 20px; }
.error-hero h1 { font-size: clamp(3rem, 8vw, 5rem); letter-spacing: -.04em; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-card { max-width: 460px; }
.chip-center { margin: 0 auto 12px; width: max-content; }
.side-label { font-size: .72em; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); padding: 10px 14px 2px; }
.tx-time { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tx-time .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--accent); flex: none; }
.page-head.tight { padding-top: 0; }
.m0 { margin: 0; }
.mb16 { margin-bottom: 16px; }
.flex0 { flex: 0 0 auto; }
.center-block { text-align: center; }
.mt8 { margin-top: 8px; }
.mt10 { margin-top: 10px; }
.mt18 { margin-top: 18px; }
.pad30 { padding: 30px; text-align: center; }

.content-auto { content-visibility: auto; contain-intrinsic-size: 320px 420px; }

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fade .18s var(--ease-out) both; }
::view-transition-new(root) { animation: fade .22s var(--ease-out) reverse both; }
@keyframes fade { to { opacity: 0; } }

@media (max-width: 800px) {
  .hero-frame { aspect-ratio: 4/3; }
}
/* ---------- studio (2026-10-08 b) ---------- */
@media (min-width: 981px) {
  .gen.mp-play { grid-template-columns: clamp(380px, 32vw, 420px) minmax(0, 1fr); }
}
.mp .gprompt textarea.autogrow { resize: vertical; overflow-y: auto; transition: height var(--t-fast) var(--ease-out); }
.funds-note { margin: 10px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--warn-bg); color: var(--warn); font-weight: 700; font-size: .88em; }
.funds-note[hidden] { display: none; }
.gex { margin-top: 16px; width: 100%; max-width: 460px; text-align: left; display: grid; gap: 8px; }
.gex-img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--border); }
.gex-h { margin: 4px 0 0; font-weight: 800; font-size: .82em; color: var(--text-dim); }
.gex-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); }
.gex-p { flex: 1; font-size: .86em; line-height: 1.35; }
.gex-row .btn { flex: none; }
.rdd.has-tiles { display: none; }
.ar-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.ar-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .78em; cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast); }
.ar-tile small { display: none; }
.ar-tile .rdd-shape { display: flex; align-items: center; justify-content: center; height: 28px; }
.ar-tile:hover { border-color: var(--accent-line); }
.ar-tile.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
.ar-tile:active, .seg-btn:active { transform: scale(.97); }
.seg-ctl { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.seg-btn { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border: 0; border-radius: calc(var(--r-md) - 4px); background: transparent; color: var(--text-dim); font: inherit; font-size: .85em; font-weight: 700; cursor: pointer; }
.seg-btn small { font-size: .76em; font-weight: 600; opacity: .85; white-space: normal; line-height: 1.25; text-align: center; max-width: 100%; }
@media (max-width: 520px) { .seg-ctl:has(> .seg-btn:nth-child(4)) { display: grid; grid-template-columns: 1fr 1fr; } }
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--elev-2); }
.seg-btn .rdd-shape { display: none; }
.gthumbs .thumb[draggable="true"] { cursor: grab; }
.gthumbs .thumb.dragging { opacity: .45; outline: 2px dashed var(--accent); }
.thumb-first { position: absolute; left: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; z-index: 2; }
.gthumbs .thumb:first-child .thumb-first { display: none; }
.confetti { position: fixed; inset: 0; z-index: 170; pointer-events: none; }

@media (prefers-reduced-motion: reduce) { .hero2 h1 .grad-text { animation: none; } .hero-show img { transition: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .marquee-names-track { transform: none; }
}

/* ---- components ---- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(8, 6, 20, .55); backdrop-filter: blur(6px); }
.modal[hidden], .sheet[hidden] { display: none; }
.modal-card { width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--elev-3); padding: 22px; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; max-height: 85dvh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 22px 22px 0 0; box-shadow: var(--elev-3); padding: 12px 18px calc(18px + env(safe-area-inset-bottom)); animation: sheet-in .25s ease; }
.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 99px; background: var(--border); margin: 0 auto 12px; }
@keyframes sheet-in { from { transform: translateY(100%); } }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .75em; font-weight: 800; line-height: 1.6; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.tooltip, [data-tooltip] { position: relative; }
.tooltip::after, [data-tooltip]::after { content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 260px; padding: 6px 10px; border-radius: 8px; background: var(--text); color: var(--surface); font-size: .78rem; font-weight: 700; line-height: 1.35; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 60; }
.tooltip:hover::after, .tooltip:focus-visible::after, [data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; }
.input { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---- utilities (former inline styles) ---- */
.u-m0 { margin: 0 !important; } .u-flex0 { flex: 0 !important; } .u-flex-none { flex: 0 0 auto !important; } .u-self-center { align-self: center !important; }
.u-pre-wrap { white-space: pre-wrap !important; } .u-nowrap { white-space: nowrap !important; } .u-break-all { word-break: break-all !important; }
.u-mt-6 { margin-top: 6px !important; } .u-mt-8 { margin-top: 8px !important; } .u-mt-10 { margin-top: 10px !important; } .u-mt-12 { margin-top: 12px !important; } .u-mt-14 { margin-top: 14px !important; } .u-mt-18 { margin-top: 18px !important; } .u-mt-22 { margin-top: 22px !important; }
.u-mb-6 { margin-bottom: 6px !important; } .u-mb-10 { margin-bottom: 10px !important; } .u-mb-16 { margin-bottom: 16px !important; } .u-mb-18 { margin-bottom: 18px !important; }
.u-ml-10 { margin-left: 10px !important; } .u-mr-8 { margin-right: 8px !important; } .u-p-30 { padding: 30px !important; } .u-center { text-align: center !important; }
.u-w-100 { width: 100% !important; } .u-fs-12 { font-size: 1.2em !important; } .u-fs-14 { font-size: 1.4em !important; }
.u-gap-8 { gap: 8px !important; } .u-fwrap { flex-wrap: wrap !important; } .u-items-center { align-items: center !important; } .u-between { justify-content: space-between !important; align-items: center !important; gap: 10px !important; }
.u-grow { flex: 1 !important; } .u-min-220 { min-width: 220px !important; }
.u-hrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.u-hrow-10 { display: flex; gap: 10px; flex-wrap: wrap; }
.u-media-fit { width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.u-thumb-96 { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.u-stat-row { display: flex; gap: 28px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
.u-line-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.u-line-row-wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--border); }
