:root {
  --bg: #08080a;
  --bg-soft: #0e0e12;
  --surface: #15151a;
  --surface-2: #1e1e25;
  --line: rgba(255, 255, 255, 0.04);
  --line-strong: rgba(255, 255, 255, 0.07);
  --text: #f4f4f6;
  --text-secondary: #c4c4cc;
  --muted: #9494a0;
  /* Брендовое золото: спокойнее жёлтого, контрастно на тёмной теме. */
  --accent: #c9932e;
  --accent-2: #ad741e;
  --accent-grad: linear-gradient(135deg, #e2be67, #ad741e);
  --accent-ink: #1c1305;
  --accent-soft: rgba(201, 147, 46, 0.12);
  --accent-line: rgba(226, 190, 103, 0.28);
  --accent-glow: rgba(201, 147, 46, 0.22);
  --danger: #ff5c5c;
  --radius: 20px;
  --radius-sm: 14px;
  --bottom-nav-height: 70px;
  --nav-h: var(--bottom-nav-height);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-top-inset: max(env(safe-area-inset-top, 0px), var(--content-safe-top, 0px));
  --app-bottom-inset: max(env(safe-area-inset-bottom, 0px), var(--content-safe-bottom, 0px));
  --content-safe-top: 0px;
  --content-safe-right: 0px;
  --content-safe-bottom: 0px;
  --content-safe-left: 0px;
  /* Единый хром Telegram — JS перезаписывает; fallback одинаков на всех устройствах */
  --chrome-top: 56px;
  --chrome-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-safe-area: max(var(--chrome-bottom), var(--safe-bottom));
  --page-bottom-inset: calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 24px);
  --floating-create-offset: calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 12px);
  --tg-safe-top: var(--chrome-top); /* alias */
  --viewer-side: 14px;
  --media-radius: 28px;
  --media-ar: 3 / 4;
  --media-max-h: min(62vh, 620px);
  --shadow: none;
  --glow: none;

  /* Типографика */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Unbounded", "Inter", system-ui, sans-serif;

  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 12.5px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 26px;

  --leading-tight: 1.22;
  --leading-snug: 1.38;
  --leading-normal: 1.5;
  --leading-relaxed: 1.62;

  --tracking-tight: -0.025em;
  --tracking-normal: -0.012em;
  --tracking-label: 0.045em;
  --tracking-caps: 0.07em;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: var(--tracking-normal);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
}

/* Display-заголовки — акцентный шрифт */
.brand,
.brand-name,
.hero-title,
.profile-name,
.publish-title,
.model-banner-title,
.ad-title,
.ad-code {
  font-family: var(--font-display);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  letter-spacing: inherit;
}
input, textarea, select {
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
/* appearance:none ломает нативные чекбоксы — оставляем системный вид */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: auto;
  appearance: auto;
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
  pointer-events: auto;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─────────────  ТИПОГРАФИКА (общие классы) ───────────── */
.section-title {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin: 8px 2px 14px;
  color: var(--text);
}
.shop-sub,
.subtitle {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: var(--leading-relaxed);
  margin: -8px 2px 18px;
}
.type-label,
.block-title,
.detail-label,
.account-linked-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  line-height: var(--leading-snug);
}
.block-title { margin-bottom: 10px; }
.field-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: var(--tracking-normal);
  line-height: var(--leading-snug);
}
.link-btn,
.preset-view-all {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-normal);
}
.empty-text { font-size: var(--text-base); font-weight: 500; line-height: var(--leading-relaxed); color: var(--text-secondary); }
.legal,
.publish-legal,
.account-hint {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted);
  line-height: var(--leading-relaxed);
}

body {
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(201, 147, 46, 0.08), transparent 60%),
    radial-gradient(70% 50% at 0% 100%, rgba(173, 116, 30, 0.05), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

/* ─────────────  ВЕРХНЯЯ ПАНЕЛЬ  ───────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  padding: calc(var(--chrome-top) + 8px) 16px 10px;
  background: rgba(8, 8, 10, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand {
  flex: 0 0 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  overflow: visible;
}
.brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  line-height: 1;
}
.brand-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  background: #08080a;
  position: relative;
}
.brand-logo {
  width: 100%;
  height: 100%;
  /* PNG уже круг с прозрачными углами — contain, чтобы не срезать ободок */
  object-fit: contain;
  object-position: center center;
  display: block;
}
.brand-name {
  flex: 0 0 auto;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-caption {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.topbar-back {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
}
.topbar-back:not(.hidden) + .brand { margin-right: auto; }
/* С «Назад» не сжимаем название до «L...» — только укорачиваем «Купить» */
.topbar:has(#topbarBack:not(.hidden)) .buy-pill-full { display: none; }
.topbar:has(#topbarBack:not(.hidden)) .buy-pill-short { display: inline; }
.topbar:has(#topbarBack:not(.hidden)) .brand-logo-wrap { width: 36px; height: 36px; }
.buy-pill {
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-normal);
  padding: 9px 15px;
  border-radius: 999px;
  box-shadow: var(--glow);
  transition: transform 0.12s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.buy-pill:active { transform: scale(0.95); }
.buy-pill-short { display: none; }
@media (max-width: 390px) {
  .brand-logo-wrap { width: 38px; height: 38px; }
  .brand-name { font-size: var(--text-md); letter-spacing: -0.02em; }
  .brand-caption { font-size: 7px; letter-spacing: 0.13em; }
  .buy-pill { padding: 8px 11px; }
  .buy-pill-full { display: none; }
  .buy-pill-short { display: inline; }
  .balance-chip { padding: 7px 10px; }
  .topbar-actions { gap: 6px; }
}
.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-normal);
}
.balance-token,
.token-ico {
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  object-fit: contain;
  object-position: center;
  display: inline-block;
  vertical-align: -0.2em;
  flex-shrink: 0;
  background: transparent;
}
.token-ico--inline { width:18px; height:18px; vertical-align:-4px; margin-left:3px; }
.balance-chip .token-ico {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  object-fit: contain;
}

/* ─────────────  КОНТЕЙНЕР  ───────────── */
.app {
  padding: 16px 16px calc(var(--nav-h) + var(--chrome-bottom) + 22px);
  max-width: 620px;
  margin: 0 auto;
}
.view { animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ─────────────  КАРТОЧКА ПАРТНЁРКИ  ───────────── */
.home-partner-card:focus-visible,
.chat-reset:focus-visible,
.chat-model:focus-visible,
.chat-send:focus-visible,
#chatInput:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-partner-cta {
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}
.home-partner-card {
  width: 100%; min-height: 72px; display: flex; align-items: center; gap: 12px;
  margin: 0 0 20px; padding: 13px 14px; border: 1px solid rgba(126, 139, 255, 0.28);
  border-radius: var(--radius-sm); color: var(--text);
  background: linear-gradient(112deg, rgba(112, 122, 255, 0.16), rgba(112, 122, 255, 0.04) 64%, var(--surface));
  text-align: left; transition: transform 180ms ease, border-color 180ms ease;
}
.home-partner-card:active { transform: scale(0.985); }
.home-partner-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: #e9ebff; background: rgba(112, 122, 255, 0.32); }
.home-partner-icon svg { width: 22px; height: 22px; }
.home-partner-copy { min-width: 0; display: grid; gap: 2px; }
.home-partner-copy strong { font-size: var(--text-md); font-weight: 650; }
.home-partner-copy small { color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-snug); }
.home-partner-cta { color: #dfe2ff; border-color: rgba(161, 170, 255, 0.3); }

.chat-view {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--chrome-top) - var(--nav-h) - var(--chrome-bottom) - 32px);
}
.chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 4px 0 16px; }
.chat-eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: var(--tracking-caps); }
.chat-title { margin: 0; font-family: var(--font-display); font-size: var(--text-2xl); line-height: 1.16; letter-spacing: var(--tracking-tight); }
.chat-subtitle { margin: 7px 0 0; color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-snug); }
.chat-reset {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 13px;
}
.chat-reset:active { transform: scale(0.94); }
.chat-reset svg { width: 20px; height: 20px; }
.chat-model-row { display: flex; align-items: center; gap: 8px; min-height: 42px; margin-bottom: 14px; }
.chat-model-label { color: var(--muted); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: var(--tracking-label); }
.chat-model {
  min-width: 0;
  max-width: 230px;
  flex: 1 1 auto;
  padding: 9px 32px 9px 11px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239494a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
  font-size: var(--text-sm);
  font-weight: 600;
}
.chat-model:disabled { opacity: 0.6; }
.chat-cost { margin-left: auto; color: var(--accent); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
.chat-messages { display: flex; flex: 1 1 auto; flex-direction: column; gap: 12px; min-height: 0; padding: 2px 0 16px; }
.chat-empty { display: grid; place-items: center; gap: 8px; min-height: 154px; padding: 24px 20px; text-align: center; color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-relaxed); border: 1px solid rgba(220, 216, 255, .12); border-radius: 20px; background: radial-gradient(circle at 50% 0%, rgba(103, 91, 167, .10), transparent 68%), rgba(255,255,255,.018); }
.chat-empty strong { color: var(--text); font-size: 17px; line-height: 1.2; }
.chat-empty span { max-width: 390px; }
.chat-bubble { max-width: 88%; padding: 12px 14px; border-radius: 16px; font-size: var(--text-base); line-height: var(--leading-relaxed); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble.user { align-self: flex-end; color: var(--accent-ink); border-bottom-right-radius: 5px; background: var(--accent-grad); }
.chat-bubble.assistant { align-self: flex-start; color: var(--text); border: 1px solid var(--line-strong); border-bottom-left-radius: 5px; background: var(--surface); }
.chat-bubble.pending { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.chat-pulse { display: inline-flex; gap: 4px; }
.chat-pulse i { width: 5px; height: 5px; border-radius: 99px; background: var(--accent); animation: chat-pulse 1.2s ease-in-out infinite; }
.chat-pulse i:nth-child(2) { animation-delay: 0.15s; }
.chat-pulse i:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-pulse { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-compose {
  position: sticky;
  bottom: calc(var(--nav-h) + var(--chrome-bottom) + 10px);
  z-index: 3;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: rgba(21, 21, 26, 0.96);
  box-shadow: 0 -10px 26px rgba(8, 8, 10, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
#chatInput { width: 100%; min-height: 44px; max-height: 144px; resize: none; padding: 11px 8px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 16px; line-height: 1.42; }
#chatInput::placeholder { color: var(--muted); }
.chat-send { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; color: var(--accent-ink); border-radius: 12px; background: var(--accent-grad); transition: transform 150ms ease, opacity 150ms ease; }
.chat-send:disabled { opacity: 0.4; }
.chat-send:not(:disabled):active { transform: scale(0.94); }
.chat-send svg { width: 21px; height: 21px; }
.chat-disclaimer { margin: 9px 5px 8px; color: var(--muted); font-size: var(--text-xs); line-height: var(--leading-snug); text-align: center; }
@media (prefers-reduced-motion: reduce) { .chat-pulse i { animation: none; } }

/* ─────────────  HERO  ───────────── */
.hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 176px;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  margin-bottom: 18px;
  background: #111;
  background-size: cover;
  background-position: center;
  border: none;
  box-shadow: none;
}
#homeHero { background-image: url("/shop/assets/hero-image.jpg?v=6"); }


.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 10, 0.05) 30%, rgba(8, 8, 10, 0.88));
}
.hero-text { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  margin-bottom: 8px;
}
.hero-title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}


/* ─────────────  БЫСТРЫЕ ДЕЙСТВИЯ  ───────────── */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.quick-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 13.5px;
  text-align: center;
  transition: transform 0.12s ease, border-color 0.15s;
}
.quick-card:active { transform: scale(0.97); border-color: var(--accent); }
.quick-emoji { font-size: 26px; }

/* ─────────────  ПЕРЕКЛЮЧАТЕЛЬ СОЗДАНИЯ  ───────────── */


/* ─────────────  БАННЕРЫ МОДЕЛЕЙ  ───────────── */
.model-banners { display: flex; flex-direction: column; gap: 12px; }
.model-provider-label {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  line-height: 1.2;
  text-transform: uppercase;
}
.model-provider-label:first-child { margin-top: 0; }
.model-banner {
  position: relative;
  border-radius: var(--radius);
  min-height: 126px;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  overflow: hidden;
  border: none;
  outline: none;
  text-align: left;
  width: 100%;
  background-color: #111;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  touch-action: manipulation;
}
.model-banner:active { opacity: 0.94; transform: scale(0.985); }
/* Затемнение слева под текст — без светлых краёв и без filter */
.model-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(8, 8, 10, 0.88) 0%,
    rgba(8, 8, 10, 0.55) 42%,
    rgba(8, 8, 10, 0.2) 100%
  );
  pointer-events: none;
}
.model-banner-title {
  position: relative;
  z-index: 1;
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}
.model-banner-copy {
  position: relative;
  z-index: 1;
  width: 100%;
}

.model-banner--chat::after {
  background: linear-gradient(90deg, rgba(8, 8, 10, 0.9) 0%, rgba(8, 8, 10, 0.56) 54%, rgba(8, 8, 10, 0.18) 100%);
}
.model-banner-subtitle {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--text-sm);
}
.model-catalog-status { margin: 0; padding: 20px 0; text-align: center; }

/* ─────────────  BOTTOM SHEET  ───────────── */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* Не заезжать под кнопки Telegram (Закрыть / ⋯) */
  padding-top: var(--chrome-top);
  background: rgba(0, 0, 0, 0.6);
  animation: fade 0.2s ease;
  box-sizing: border-box;
}
.sheet-body {
  background: var(--bg-soft);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--line-strong);
  padding: 6px 18px 16px;
  max-height: calc(100% - 8px);
  overflow-y: auto;
  animation: slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slide-up { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-body::before {
  content: "";
  display: block;
  width: 40px; height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 8px auto 0;
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 18px;
  position: sticky;
  top: 0;
  background: var(--bg-soft);
  z-index: 2;
}
.sheet-model { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.sheet-model-text { min-width: 0; }
.sheet-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sheet-head-actions .modal-close {
  width: 44px;
  height: 44px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  align-self: center;
}
.sheet-share-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sheet-share-btns.hidden { display: none !important; }
.sheet-round-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  box-sizing: border-box;
  background: var(--accent);
  color: #111;
  display: grid;
  place-items: center;
}
.sheet-round-btn svg { width: 18px; height: 18px; }
.sheet-gallery-byline {
  display: flex;
  min-height: 44px;
  margin: -2px 4px 8px;
}
.sheet-gallery-byline.hidden { display: none !important; }
.sheet-gallery-author {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #f7f2e4;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.sheet-gallery-author:disabled { cursor: default; }
.sheet-gallery-author > img,
.sheet-gallery-author > .sheet-gallery-author-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
  object-fit: cover;
}
.sheet-gallery-author-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.sheet-gallery-author-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-gallery-author-handle {
  overflow: hidden;
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-round-btn.sheet-gallery-action {
  width: 44px;
  height: 54px;
  min-width: 44px;
  min-height: 54px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
}
.sheet-round-btn.sheet-gallery-action .sheet-action-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-grad);
  color: var(--accent-ink);
  box-shadow: inset 0 1px rgba(255,255,240,.68), 0 5px 13px rgba(0,0,0,.28);
}
.sheet-round-btn.sheet-gallery-action .sheet-action-icon svg {
  width: 18px;
  height: 18px;
}
.sheet-round-btn.sheet-gallery-action .sheet-action-count {
  display: block;
  min-width: 3em;
  max-width: 44px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-round-btn.sheet-gallery-action:active { transform: none; }
.sheet-round-btn.sheet-gallery-action:active .sheet-action-icon { transform: scale(.9); }
.sheet-cover {
  position: relative;
  margin: 4px 0 8px;
  border-radius: 18px;
  overflow: hidden;
  background: #0a0a0c;
  width: 100%;
  height: min(42vh, 360px);
  flex-shrink: 0;
  cursor: zoom-in;
}
.sheet-cover.hidden { display: none !important; }
/* Loki: пресет = идея — чёрный фон, скруглённая медиа-карточка, форма снизу */
.gen-sheet--preset {
  justify-content: flex-end;
  align-items: stretch;
  gap: 0;
  padding: calc(var(--chrome-top) + 8px) 0 0;
  background: #000;
  box-sizing: border-box;
}
.gen-sheet--preset .sheet-body {
  width: 100%;
  max-width: none;
  padding: 0 var(--viewer-side) max(16px, var(--chrome-bottom));
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100% - 76px);
  border-radius: 24px 24px 0 0;
  border: none;
  background: #0a0a0c;
  box-shadow: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  animation: none;
  display: flex;
  flex-direction: column;
}
.gen-sheet--preset .sheet-body::before { display: none; }
.gen-sheet--preset .sheet-cover {
  width: 100%;
  max-width: none;
  aspect-ratio: var(--media-ar);
  height: auto;
  max-height: var(--media-max-h);
  margin: 0 0 14px;
  border-radius: var(--media-radius);
  cursor: pointer;
  flex-shrink: 0;
  background: #111;
  overflow: hidden;
}
.gen-sheet--preset .sheet-cover #sheetCoverImg,
.gen-sheet--preset .sheet-cover .sheet-cover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Обложка повтора — это исходный результат креатора, а не декоративный
     фон. Всегда сохраняем кадр целиком, чтобы не срезались лица и края. */
  object-fit: contain;
  object-position: center;
  display: block;
  background: #000;
}
.gen-sheet--preset .sheet-cover.sheet-cover--unavailable {
  display: grid;
  min-height: 180px;
  height: 180px !important;
  max-height: 180px !important;
  aspect-ratio: auto !important;
  place-items: center;
  background:
    radial-gradient(circle at 50% 28%, rgba(225, 184, 91, .16), transparent 46%),
    #0a0a0a;
}
.sheet-cover-status {
  position:absolute;z-index:3;inset:0;display:grid;place-items:center;padding:18px 18px 48px;text-align:center;
  color: rgba(255, 247, 222, .72);
  font-size: 13px;
  font-weight: 650;
}
.sheet-cover-retry { position:absolute;z-index:4;bottom:20px;left:50%;transform:translateX(-50%);padding:9px 14px;border:1px solid #b89a5b;border-radius:12px;background:#29251d;color:#efd18d;white-space:nowrap; }
.sheet-cover #sheetCoverImg { z-index:1; }
.sheet-cover.sheet-cover--unavailable #sheetCoverImg { display:none !important; }
.sheet-cover .sheet-cover-video { z-index:2; }
@media (max-width: 639px) {
  /* Оставляем по 8px с каждой стороны: этого достаточно, чтобы оба
     скруглённых края и первый нижний блок были видны без автопрокрутки
     листа, но ролик остаётся почти во всю ширину. */
  .gen-sheet--preset .sheet-cover.sheet-cover--portrait {
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    height: auto;
    max-height: none;
    aspect-ratio: var(--media-ar);
    margin-right: auto;
    margin-left: auto;
    align-self: center;
    border-radius: var(--media-radius);
  }
}
@media (min-width: 640px) {
  .gen-sheet--preset .sheet-cover {
    width: auto;
    max-width: 100%;
    height: min(62dvh, 620px);
    max-height: min(62dvh, 620px);
    margin-right: auto;
    margin-left: auto;
    align-self: center;
  }
}
.gen-sheet--preset .sheet-cover-caption {
  left: 16px;
  right: 16px;
  bottom: 14px;
  font-size: 16px;
  font-weight: 700;
}
.gen-sheet--preset #sheetClose {
  display: none !important;
}
/* У зрителя стрелка Telegram в системной шапке скрыта: вместо неё остаётся
   явная кнопка закрытия прямо на обложке — её не нужно искать под роликом. */
.gen-sheet--trend .sheet-cover-back {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: grid !important;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 50%;
  background: rgba(10,10,12,0.72);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.gen-sheet--trend .sheet-cover-back:active { transform: scale(0.94); }
.gen-sheet--preset .sheet-head {
  padding: 4px 4px 12px;
  background: transparent;
}
/* В публичном viewer заголовок идёт после ролика. Sticky-позиционирование
   базового листа при прокрутке уводило его под обложку и создавало ощущение,
   что вертикальный кадр выходит за границы следующего блока. */
.gen-sheet--trend .sheet-head {
  position: static;
}
/* Экран повтора — не нижний sheet с укороченной рабочей областью. Базовый
   лимит sheet-body считал высоту уже после top inset и затем вычитал ещё
   76px: на телефоне это сдвигало начало кадра примерно на 140px вниз. Для
   вертикального 9:16 из-за этого ноги/низ кадра оказывались за экраном, а
   сверху появлялся чёрный «лист». Тренд занимает всю доступную область под
   системной шапкой Telegram; файл остаётся в его нативной пропорции. */
.gen-sheet--trend .sheet-body {
  max-height: 100%;
  border-radius: 0;
  background: #000;
}
.gen-sheet--preset .sheet-body > .block,
.gen-sheet--preset .sheet-body > #promptBlock {
  padding-left: 4px;
  padding-right: 4px;
}
.sheet-cover-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}
.sheet-cover-caption.hidden { display: none !important; }
/* Крестики на обложке не нужны — есть BackButton Telegram */
.sheet-cover-back,
.sheet-cover-expand {
  display: none !important;
}
.sheet-cover img,
.sheet-cover .sheet-cover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #0a0a0c;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.sheet-model-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.2;
}
.sheet-model-badge.hidden { display: none !important; }
.sheet-model-badge strong { color: var(--text); font-weight: 600; }
.sheet-like-btn {
  border: 1px solid rgba(255,255,255,0.32);
  background: rgba(18,18,22,0.96);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.28);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.sheet-like-btn svg { width: 18px; height: 18px; }
.sheet-like-btn.liked {
  border-color: rgba(255,150,172,0.9);
  background: #9f2941;
  color: #fff;
  box-shadow: 0 7px 22px rgba(159,41,65,0.42);
}
.sheet-round-btn.sheet-gallery-action.sheet-like-btn.liked {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.sheet-round-btn.sheet-gallery-action.sheet-like-btn.liked .sheet-action-icon {
  background: #ff3b30;
  color: #fff;
  box-shadow: 0 5px 14px rgba(255, 59, 48, .35);
}
.sheet-like-btn:active { transform: scale(0.94); }
.sheet-like-btn:focus-visible {
  outline: 3px solid rgba(226,190,103,0.9);
  outline-offset: 3px;
}
.sheet-like-btn.hidden { display: none !important; }
.social-like-burst {
  position: fixed;
  z-index: 160;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.18);
  will-change: transform, opacity;
}
.social-like-burst svg {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 8px 15px rgba(0,0,0,.34));
}
.social-like-burst.is-visible { animation: social-like-burst .58s cubic-bezier(.2,.82,.2,1) forwards; }
@keyframes social-like-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.18); }
  24% { opacity: 1; transform: translate(-50%, -50%) scale(1.16); }
  56% { opacity: 1; transform: translate(-50%, -50%) scale(.96); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .social-like-burst { display: none; }
}
.sheet-avatar-pick-btn {
  width: 100%;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
}
.sheet-avatar-pick-ico {
  opacity: 0.7;
  display: inline-grid;
  place-items: center;
}
.sheet-avatar-pick-ico svg { width: 18px; height: 18px; display: block; }
.gen-sheet--preset .model-emoji { display: none; }
.gen-sheet--preset .model-hint { display: none; }
.gen-sheet--preset .model-name {
  font-size: var(--text-lg);
  font-weight: 600;
}
.sheet-foot {
  flex-shrink: 0;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding: 12px 18px calc(14px + var(--chrome-bottom));
}
.sheet-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  margin: 0 2px 10px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.sheet-price.hidden { display: none; }
.sheet-price-label { font-weight: 500; }
.sheet-price-value {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: var(--text-base);
  font-variant-numeric: tabular-nums;
}
.sheet-price-value .token-ico { width: 16px; height: 16px; }
.gen-sheet--preset .sheet-foot {
  width: 100%;
  max-width: none;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--line);
  padding: 12px var(--viewer-side) calc(14px + var(--chrome-bottom));
  background: #0a0a0c;
  box-shadow: none;
}
.model-emoji { font-size: 28px; }
.model-name { font-size: var(--text-lg); font-weight: 600; letter-spacing: var(--tracking-tight); line-height: var(--leading-tight); }
.model-hint { font-size: var(--text-sm); color: var(--muted); line-height: var(--leading-relaxed); font-weight: 400; }
.modal-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  align-self: flex-start;
  box-sizing: border-box;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
}

/* ─────────────  БЛОКИ ФОРМЫ  ───────────── */
.block { margin-bottom: 20px; }

.dropzone {
  display: block;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  background: var(--surface);
  transition: border-color 0.15s;
}
.dropzone:active { border-color: var(--accent); }
.dropzone-inner { display: flex; flex-direction: column; gap: 4px; }
.dropzone-title { font-weight: 600; font-size: var(--text-sm); color: var(--text); }
.dropzone-sub { font-size: var(--text-xs); color: var(--muted); line-height: var(--leading-relaxed); }

.ref-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ref-thumb {
  position: relative;
  width: 66px; height: 66px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ref-del {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff; font-size: 11px;
  display: grid; place-items: center;
}
.multimodal-reference { margin-top: 16px; }
.reference-dropzone { min-height: 78px; padding: 16px; }
.multimodal-reference-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.reference-file-list {
  display: grid;
  gap: 8px;
  max-height: 184px;
  margin-top: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.reference-file {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid rgba(241, 212, 134, .22);
  border-radius: 12px;
  background: rgba(215, 169, 80, .055);
}
.reference-file-icon {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: rgba(215, 169, 80, .14);
  color: #f2d486;
}
.reference-file-copy { display: grid; min-width: 0; gap: 2px; }
.reference-file-copy strong { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.reference-file-copy small { color: var(--muted); font-size: 11px; }
.reference-file-remove { display: grid; flex: 0 0 32px; width: 32px; height: 32px; margin-left: auto; place-items: center; border: 1px solid rgba(241, 212, 134, .28); border-radius: 10px; background: rgba(255, 255, 255, .035); color: #f2d486; font-size: 15px; }
.duration-slider {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(232, 198, 117, .18);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .055), rgba(208, 155, 57, .035));
  box-shadow: inset 0 1px 0 rgba(255, 246, 215, .055);
}
.duration-slider-head,
.duration-slider-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.duration-slider-head { color: var(--muted); font-size: var(--text-xs); }
.duration-slider-head strong {
  min-width: 74px;
  padding: 5px 8px;
  border: 1px solid rgba(240, 201, 103, .3);
  border-radius: 999px;
  background: rgba(17, 14, 8, .64);
  color: #f7d77d;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.duration-slider-meta { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.duration-slider-rail { display: flex; align-items: center; min-height: 44px; }
.duration-slider input[type="range"] {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
.duration-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border: 1px solid rgba(255, 240, 192, .14);
  border-radius: 999px;
  background: linear-gradient(90deg, #d7a950 0 var(--duration-progress, 0%), rgba(255, 255, 255, .11) var(--duration-progress, 0%) 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .48);
}
.duration-slider input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -9px;
  border: 3px solid #fff0bb;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: #c58b2a;
  box-shadow: 0 0 0 4px rgba(218, 170, 73, .16), 0 3px 8px rgba(0, 0, 0, .45);
}
.duration-slider input[type="range"]::-moz-range-track {
  height: 6px;
  border: 1px solid rgba(255, 240, 192, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .11);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .48);
}
.duration-slider input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: #d7a950; }
.duration-slider input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid #fff0bb;
  border-radius: 50%;
  background: #c58b2a;
  box-shadow: 0 0 0 4px rgba(218, 170, 73, .16), 0 3px 8px rgba(0, 0, 0, .45);
}
.duration-slider input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.08); }
.duration-slider input[type="range"]:active::-moz-range-thumb { transform: scale(1.08); }
.duration-slider input[type="range"]:focus-visible { outline: 2px solid rgba(241, 212, 134, .88); outline-offset: 4px; border-radius: 999px; }
.duration-slider input[type="range"]:disabled { cursor: not-allowed; opacity: .5; }
.duration-slider-hint { min-height: 15px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.motion-duration-note {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(232, 198, 117, .22);
  border-radius: 14px;
  background: rgba(215, 169, 80, .055);
}
.motion-duration-note strong { color: #f7d77d; font-size: var(--text-sm); }
.motion-duration-note span { color: var(--muted); font-size: var(--text-xs); line-height: 1.35; }

.sheet-avatar-picker { margin-top: 12px; }
.sheet-avatar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.sheet-avatar-label {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 500;
}
.sheet-avatar-link { font-size: var(--text-xs); padding: 0; }
.sheet-avatar-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.sheet-avatar-grid::-webkit-scrollbar { display: none; }
.sheet-avatar-btn {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--line);
  padding: 0;
  background: var(--surface-2);
  transition: border-color 0.15s, transform 0.12s;
}
.sheet-avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-avatar-btn.active { border-color: var(--accent); box-shadow: var(--glow); }
.sheet-avatar-btn:active { transform: scale(0.94); }
.sheet-avatar-empty { font-size: var(--text-xs); margin: 4px 0 0; line-height: var(--leading-relaxed); }

.prompt {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-relaxed);
  letter-spacing: var(--tracking-normal);
}
.prompt:focus { outline: none; border-color: var(--accent); }
.prompt-counter { text-align: right; font-size: var(--text-xs); color: var(--muted); margin-top: 5px; font-weight: 400; }

/* Длинный промпт — основной рабочий инструмент, а не короткий комментарий.
   Поле остаётся во всю ширину листа на телефоне и получает читаемую высоту;
   на широком экране сам лист ограничен, чтобы строки не становились слишком длинными. */
#genSheet .sheet-body {
  width: 100%;
  max-width: 860px;
  align-self: center;
  box-sizing: border-box;
}
#genSheet #promptBlock { min-width: 0; }
#genSheet #prompt {
  display: block;
  min-width: 0;
  min-height: clamp(180px, 28dvh, 280px);
  max-height: 54dvh;
  overflow-y: auto;
  padding: 16px 17px;
  font-size: 16px;
  line-height: 1.55;
  resize: vertical;
  -webkit-overflow-scrolling: touch;
}
#modHomeUploadPrompt { min-height: 170px; line-height: 1.55; }

.aspect-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.aspect-cell {
  padding: 11px 4px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: transform 0.1s;
}
.aspect-cell:active { transform: scale(0.94); }
.aspect-cell.active { background: var(--accent-grad); color: #1a1200; border-color: transparent; }

/* Обычное «Создать видео»: форматы — короткие touch-safe овалы. Это не
   распространяется на авторские/витринные сценарии, где сетка — часть состава
   карточки и уже имеет отдельную композицию. */
#genSheet.gen-sheet--video-create .aspect-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#genSheet.gen-sheet--video-create .aspect-cell {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 17px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.chip.active { background: var(--accent-grad); color: #1a1200; border-color: transparent; }

/* ─────────────  КНОПКИ  ───────────── */
.btn-primary {
  background: var(--accent-grad);
  color: #1a1200;
  font-weight: 600;
  font-size: var(--text-base);
  letter-spacing: var(--tracking-normal);
  padding: 15px 18px;
  border-radius: 15px;
  box-shadow: var(--glow);
  transition: transform 0.12s ease, opacity 0.15s;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; box-shadow: none; }
.btn-block { width: 100%; display: block; }

/* ─────────────  ИСТОРИЯ  ───────────── */
.filter-pills { display: flex; gap: 8px; margin-bottom: 16px; }
#modSectionTabs.filter-pills {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
  padding-bottom: 4px;
}
#modSectionTabs.filter-pills::-webkit-scrollbar { display: none; }
#modSectionTabs .filter-pill { flex-shrink: 0; white-space: nowrap; }
.filter-pill {
  padding: 10px 17px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-normal);
  color: var(--text-secondary);
}
.filter-pill.active { background: var(--accent-grad); color: #1a1200; border-color: transparent; font-weight: 600; }
.filter-pill--top-creators {
  color: #f8ddb0;
  border-color: rgba(242, 186, 84, .38);
  background: rgba(126, 76, 11, .18);
}
.filter-pill--top-creators.active {
  color: #201406;
  border-color: rgba(255, 229, 160, .78);
  background: linear-gradient(135deg, #ffe0a3, #e7ad43);
  box-shadow: inset 0 1px rgba(255,255,240,.65), 0 5px 15px rgba(148,83,5,.24);
}
.info-banner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.low-balance-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 16px 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 92, 92, 0.12);
  border: 1px solid rgba(255, 92, 92, 0.35);
  color: #ffb4b4;
  font-size: 13px;
  font-weight: 600;
}
.low-balance-banner.hidden { display: none !important; }
.video-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.video-mode-tabs.hidden { display: none !important; }
.video-mode-tab {
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.video-mode-tab.active {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}
.mod-users-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mod-user-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.mod-user-row:active { opacity: 0.88; }
.mod-user-row-name { font-weight: 600; font-size: var(--text-base); }
.mod-user-row-meta { font-size: var(--text-sm); color: var(--muted); }
.mod-user-head .btn-outline { margin-top: 10px; }
.mod-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.mod-user-row:active { opacity: 0.9; }
.mod-user-row-meta { font-size: 12px; color: var(--muted); }
.history-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.history-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0a0a0c;
  border: none;
  aspect-ratio: 3 / 4;
  box-shadow: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  /* История содержит до 50 работ. Вне viewport карточки не должны участвовать
     в paint/layout во время свайпа, как и карточки ленты «Идей». */
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: auto 250px;
}
.history-card:active { transform: scale(0.98); }
.history-share,
.trend-share,
.gc-share,
.work-share {
  position: absolute;
  z-index: 5;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,0.56);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.history-share { right: 8px; bottom: 8px; }
.history-share:active,
.trend-share:active,
.gc-share:active,
.work-share:active { transform: scale(0.92); }
.history-share svg,
.trend-share svg,
.gc-share svg,
.work-share svg { width: 18px; height: 18px; }
.history-card-media,
.history-card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0c;
}
.history-card img,
.history-card video.card-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.history-card-play {
  position: absolute; inset: 0;
  z-index: 1;
  display: grid; place-items: center;
  font-size: 22px; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.55);
  background: linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.35));
  pointer-events: none;
}
.history-card-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 32px;
  color: var(--muted);
  width: 100%;
  height: 100%;
  background: #0a0a0c;
}
.history-card-loading { font-size: 22px; opacity: 0.7; }
.history-tag {
  position: absolute; top: 8px; right: 8px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(6px);
  color: #fff;
}
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 46px 0; text-align: center; }
.empty-emoji { font-size: 44px; opacity: 0.9; }

/* ─────────────  ПРОФИЛЬ  ───────────── */
.profile-head { display: flex; align-items: center; gap: 20px; margin: 10px 0 16px; }
.profile-avatar-wrap {
  position: relative; flex-shrink: 0;
  border: none; background: none; padding: 0; cursor: pointer;
}
.profile-avatar-wrap:active .profile-avatar { transform: scale(0.96); }
.profile-avatar {
  width: 78px; height: 78px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 2px solid var(--accent);
  display: grid; place-items: center;
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-badge {
  position: absolute; right: -2px; bottom: -2px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #1a1200;
  display: grid; place-items: center;
  border: 3px solid var(--bg);
}
.avatar-badge.hidden { display: none; }
.profile-avatar-wrap:disabled { cursor: default; }
.profile-avatar-wrap:disabled:active .profile-avatar { transform: none; }
.avatar-badge svg { width: 13px; height: 13px; }
.profile-stats { display: flex; gap: 26px; flex: 1; justify-content: space-around; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-num { font-size: var(--text-xl); font-weight: 700; color: var(--accent); letter-spacing: var(--tracking-tight); }
.stat-label { font-size: var(--text-xs); color: var(--muted); font-weight: 500; }
.profile-name { font-size: var(--text-xl); font-weight: 700; letter-spacing: var(--tracking-tight); line-height: var(--leading-tight); }
.profile-name-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; background: none; padding: 0; margin-bottom: 14px;
  color: var(--text); cursor: pointer; text-align: left;
}
.profile-name-btn:active { opacity: 0.75; }
.profile-edit-ico { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.profile-actions { display: flex; gap: 12px; margin-bottom: 26px; }

.profile-edit-avatar { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8px 0 20px; }
.profile-edit-ava-btn {
  position: relative; border: none; background: none; padding: 0; cursor: pointer;
}
.profile-edit-ava-btn:active .profile-avatar { transform: scale(0.96); }
.profile-edit-hint { font-size: var(--text-xs); color: var(--muted); margin: 0; text-align: center; line-height: var(--leading-relaxed); }
#profileEditSheet { z-index: 96; }
#avatarCropModal { z-index: 120; }
.profile-back { border: none; background: none; color: var(--accent); font-size: var(--text-sm); font-weight: 600; padding: 0; margin: 4px 0 8px; cursor: pointer; }
.profile-stats-row { display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: var(--text-xs); color: var(--muted); margin: -6px 0 12px; font-weight: 400; }
.profile-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.profile-badge { font-size: var(--text-xs); font-weight: 500; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.profile-bio { font-size: var(--text-sm); line-height: var(--leading-relaxed); margin: 0 0 12px; min-height: 0; font-weight: 400; color: var(--text-secondary); }
.profile-bio:empty { display: none; }
.profile-telegram {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}
.profile-telegram.hidden { display: none !important; }
.profile-telegram-channel {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(238, 206, 126, .31);
  border-radius: 12px;
  background: rgba(244, 222, 158, .06);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .14s ease;
}
.profile-telegram-channel [data-ix] { flex: 0 0 auto; color: var(--accent); }
.profile-telegram-channel [data-ix] svg { width: 17px; height: 17px; }
.profile-telegram-channel { color: var(--accent); font-size: 13px; font-weight: 700; }
.profile-telegram-channel:active { transform: scale(.985); background: rgba(244, 222, 158, .12); }
.profile-telegram-channel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.profile-balance-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: var(--text-sm); font-weight: 600; }
.session-warn {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(236, 57, 66, 0.45);
  background: rgba(236, 57, 66, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-warn.hidden { display: none; }
.session-warn-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.btn-sm { padding: 8px 12px; font-size: var(--text-xs); font-weight: 600; border-radius: 10px; }
.profile-pinned { margin-bottom: 14px; }
.profile-pinned-label { font-size: var(--text-xs); color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.profile-pinned .work-card { max-width: 180px; }
.profile-showcase-edit {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 12px 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; touch-action: manipulation; transition: border-color .18s ease, background .18s ease, transform .14s ease;
}
.profile-showcase-edit svg { width: 18px; height: 18px; color: var(--accent); }
.profile-showcase-edit:hover { border-color: var(--accent); background: var(--surface-2); }
.profile-showcase-edit:active { transform: scale(.985); }
.profile-works-sheet { max-width: 560px; }
.profile-media-add {
  min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 12px; margin: 2px 0 10px;
  border: 1px dashed var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--text);
  cursor: pointer; touch-action: manipulation;
}
.profile-media-add:focus-within, .profile-media-add:hover { border-color: var(--accent); background: var(--surface-2); }
.profile-media-add-icon {
  width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px;
  color: #1a1200; background: var(--accent-grad);
}
.profile-media-add-icon svg { width: 22px; height: 22px; }
.profile-media-add strong, .profile-media-add small { display: block; }
.profile-media-add strong { font-size: var(--text-sm); }
.profile-media-add small { margin-top: 3px; color: var(--muted); font-size: var(--text-xs); line-height: 1.35; }
.profile-works-hint { margin: 0 0 10px; color: var(--muted); font-size: var(--text-xs); line-height: 1.4; }
.profile-works-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.profile-work-editor-item {
  display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .18s ease, opacity .18s ease, transform .18s ease;
}
.profile-work-editor-item.is-dragging { opacity: .45; transform: scale(.985); }
.profile-work-editor-item.is-drop-target { border-color: var(--accent); }
.profile-work-editor-preview { width: 60px; height: 60px; overflow: hidden; border-radius: 10px; background: #0a0a0c; }
.profile-work-editor-preview img, .profile-work-editor-preview video { width: 100%; height: 100%; display: block; object-fit: cover; }
.profile-work-editor-main { min-width: 0; }
.profile-work-editor-title { display: flex; gap: 6px; align-items: center; color: var(--text); font-size: var(--text-sm); font-weight: 600; }
.profile-work-editor-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-work-editor-meta { margin-top: 4px; color: var(--muted); font-size: var(--text-xs); }
.profile-work-editor-actions { display: flex; gap: 4px; align-items: center; }
.profile-work-editor-actions button {
  width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px;
  background: transparent; color: var(--text); font: inherit; cursor: pointer; touch-action: manipulation;
}
.profile-work-editor-actions button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.profile-work-editor-actions button:disabled { opacity: .35; cursor: default; }
.profile-work-editor-actions .profile-work-remove { color: #ef6a70; }
.profile-works-empty { padding: 22px 12px; margin-bottom: 14px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; font-size: var(--text-sm); }
@media (prefers-reduced-motion: reduce) {
  .profile-showcase-edit, .profile-work-editor-item { transition: none; }
}
.profile-select { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; color: var(--text); font-size: var(--text-base); font-weight: 400; }
.pub-toggle { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--text); margin: 8px 0; font-weight: 400; }
.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.setting-toggle-label { flex: 1; font-size: var(--text-base); font-weight: 400; color: var(--text); line-height: var(--leading-normal); }
.setting-toggle-switch {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}
.setting-toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.setting-toggle input:checked + .setting-toggle-switch { background: var(--accent); }
.setting-toggle input:checked + .setting-toggle-switch::after { transform: translateX(20px); }
.work-card-menu { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(0,0,0,0.55); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; z-index: 2; }
.work-actions-list { display: flex; flex-direction: column; gap: 8px; }
.work-action-btn { width: 100%; text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 15px; cursor: pointer; }
.crop-sheet { max-width: 340px; }
.crop-stage { display: grid; place-items: center; margin: 10px 0; border-radius: 50%; overflow: hidden; border: 2px solid var(--accent); width: 260px; height: 260px; margin-inline: auto; }
.crop-zoom { width: 100%; margin: 12px 0; accent-color: var(--accent); }
.work-card { position: relative; }
.work-pin-badge { position: absolute; top: 8px; left: 8px; font-size: 10px; padding: 3px 7px; border-radius: 999px; background: var(--accent-grad); color: #1a1200; font-weight: 700; z-index: 2; }
.ideas-status-badge { position: absolute; top: 8px; left: 8px; font-size: 10px; padding: 3px 7px; border-radius: 999px; background: rgba(0,0,0,0.65); color: #fff; z-index: 2; }
.icon-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  display: grid; place-items: center;
  transition: transform 0.12s, background 0.15s;
}
.icon-btn svg,
.icon-btn[data-ix] svg,
.partner-link-edit svg,
.sheet-round-btn svg,
.avatar-badge svg,
.profile-edit-ico svg,
.prompt-lock svg { width: 1em; height: 1em; display: block; }
.icon-btn svg { width: 20px; height: 20px; }
.avatar-badge { display: grid; place-items: center; }
.avatar-badge svg { width: 14px; height: 14px; }
.profile-edit-ico { display: inline-grid; place-items: center; }
.ws-like svg, .work-stats svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.icon-btn:active { transform: scale(0.92); background: var(--accent-soft); }

/* Работы в профиле */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.work-card {
  position: relative;
  /* Видео декодируется в отдельном compositor-слое. Свой stacking context
     гарантирует, что метрики и авторские действия остаются поверх ролика. */
  isolation: isolate;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #0a0a0c;
  border: 1px solid var(--line);
  padding: 0;
  /* Профиль автора может содержать 100 работ; карточки вне экрана не должны
     участвовать в paint/layout на каждом кадре прокрутки. */
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: auto 180px;
}
.work-card img,
.work-card .card-preview-poster,
.work-card video.card-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.work-play {
  position: absolute; inset: 0;
  z-index: 1;
  display: grid; place-items: center;
  font-size: 24px; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.55);
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.3));
  pointer-events: none;
}
.work-empty {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: #0a0a0c;
}
.work-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px);
  color: #fff; font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 8px;
}
.work-stats {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 4;
  display: flex; gap: 14px; align-items: center;
  padding: 18px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  color: #fff; font-size: 12.5px; font-weight: 600;
}
.work-stats span { display: inline-flex; align-items: center; gap: 5px; }
.work-stats svg { width: 15px; height: 15px; opacity: 0.95; }
.work-stats .ws-like svg { color: var(--accent); }
.work-share { right: 8px; bottom: 7px; width: 44px; height: 44px; }
.work-card .work-share,
.work-card .work-badge,
.work-card .work-pin-badge,
.work-card .ideas-status-badge,
.work-card .work-card-menu { z-index: 4; }
.work-share svg { width: 17px; height: 17px; }

/* ─────────────  ПРЕСЕТЫ  ───────────── */
.preset-group { margin-bottom: 26px; }
.currency-picker { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.currency-picker select { min-height: 44px; max-width: 60%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; }
#payCurrencyNote:empty { display: none; }
#payCurrencyNote { margin: 0 0 16px; font-size: 13px; }
.preset-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.preset-title { font-size: var(--text-md); font-weight: 600; letter-spacing: var(--tracking-tight); margin: 0; }
.preset-view-all {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
  margin: -6px 0;
  flex-shrink: 0;
}

.preset-empty-state {
  margin: 8px 0 20px;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.preset-scroller {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 2px;
  /* pan-y — иначе на карточке не листается главная */
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
}
.preset-scroller::-webkit-scrollbar { display: none; }
.preset-card {
  flex: 0 0 148px;
  width: 148px;
  height: 210px;
  scroll-snap-align: start;
  border-radius: 18px;
  border: none;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  text-align: left;
  position: relative;
  overflow: hidden;
  background: #0a0a0c;
  box-shadow: none;
  transition: transform 0.12s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.preset-card:active { transform: scale(0.97); }
.preset-card:focus-visible,
.preset-view-all:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.preset-card::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.72)); pointer-events: none; }
.preset-card--photo { padding: 0; border: none; }
.preset-card--photo::after { display: none; }
.preset-card-media,
.preset-card > img.preset-card-media,
.preset-card > video.card-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 0;
  background: #0a0a0c;
  pointer-events: none;
}
.preset-card > video.card-preview-video {
  z-index: 1;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.preset-card > video.card-preview-video.is-ready { opacity: 1; }
.preset-card-media--ph {
  background:
    radial-gradient(circle at 30% 30%, rgba(212, 175, 55, 0.28), transparent 55%),
    #121218;
}
.preset-card--missing-media {
  align-items: flex-start;
  justify-content: flex-end;
  padding: 14px;
  border: 1px solid rgba(230, 194, 107, .24);
  background:
    radial-gradient(circle at 70% 18%, rgba(219, 174, 77, .2), transparent 46%),
    linear-gradient(145deg, #211a0e, #0a0a0a 72%);
}
.preset-card--missing-media::after { display: none; }
.preset-card--missing-media .preset-emoji,
.preset-card--missing-media .preset-name { position: relative; z-index: 1; }
.preset-card-author,
.preset-card-like {
  position: absolute;
  z-index: 4;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(12,12,16,0.82);
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 5px 16px rgba(0,0,0,0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  touch-action: manipulation;
}
.preset-card-author {
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 56px);
  gap: 6px;
  padding: 4px 10px 4px 4px;
  overflow: hidden;
  border-radius: 999px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.preset-card-author > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.preset-card-ava {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
}
.preset-card-like {
  top: 8px;
  right: 8px;
  min-width: 44px;
  justify-content: center;
  gap: 4px;
  padding: 7px 9px;
  border-radius: 999px;
}
.preset-card-like svg { width: 17px; height: 17px; }
.preset-card-like.liked {
  border-color: rgba(255,150,172,0.9);
  background: #9f2941;
}
.preset-card-like:active,
.preset-card-author:active { transform: scale(0.95); }
.preset-card-like:focus-visible,
.preset-card-author:focus-visible { outline: 3px solid rgba(226,190,103,0.9); outline-offset: 2px; }
.preset-emoji { position: relative; z-index: 3; font-size: 24px; }
.preset-name { position: relative; z-index: 3; font-size: var(--text-sm); font-weight: 600; line-height: var(--leading-snug); letter-spacing: var(--tracking-normal); }
.preset-group-sheet {
  padding-bottom: calc(16px + var(--chrome-bottom));
  max-height: calc(100% - 8px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#presetGroupSheet.sheet {
  overscroll-behavior: contain;
}
#presetGroupSheet .sheet-body {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.preset-group-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-bottom: 12px;
}
.preset-grid-card {
  position: relative;
  border: none;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  padding: 0;
  text-align: left;
  background: #0a0a0c;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.preset-grid-card:active { transform: scale(0.98); }
.preset-grid-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.78));
  pointer-events: none;
}
.preset-grid-card .preset-card-media,
.preset-grid-card > img.preset-card-media,
.preset-grid-card > video.card-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 0;
  background: #0a0a0c;
  pointer-events: none;
}
.preset-grid-card > video.card-preview-video {
  z-index: 1;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.preset-grid-card > video.card-preview-video.is-ready { opacity: 1; }
.preset-grid-card .preset-name {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.preset-grid-card .preset-emoji {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 36px;
  z-index: 0;
}
.video-recipe-grid {
  align-items: stretch;
}
.video-recipe-column { display: contents; }
#presetGroupSheet.preset-group-sheet--recipe {
  padding-top: var(--chrome-top);
  background: #050505;
}
#presetGroupSheet.preset-group-sheet--recipe .preset-group-sheet {
  width: min(100%, 640px);
  min-height: 100%;
  margin: 0 auto;
  padding: 0 18px calc(28px + var(--chrome-bottom));
  border: 0;
  border-radius: 0;
  background: #050505;
  box-shadow: none;
}
#presetGroupSheet.preset-group-sheet--recipe .preset-group-sheet::before {
  display: none;
}
#presetGroupSheet.preset-group-sheet--recipe .sheet-head {
  position: sticky;
  top: 0;
  margin: 0 -18px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  background: rgba(5, 5, 5, .96);
  backdrop-filter: blur(12px);
  z-index: 5;
}
#presetGroupSheet.preset-group-sheet--recipe .model-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #f7f5f0;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#presetGroupSheet.preset-group-sheet--recipe .modal-close {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: #fff;
}
.recipe-manage-btn {
  min-height: 40px;
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid rgba(232, 198, 117, .42);
  border-radius: 12px;
  background: rgba(232, 198, 117, .08);
  color: #f2d487;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .01em;
}
.recipe-manage-btn:active { transform: scale(.98); }
.recipe-video-handoff-kicker {
  color: var(--gold, #e2be67);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
}
.video-recipe-card {
  min-height: 190px;
  isolation: isolate;
  outline: 0;
}
.video-recipe-card::before {
  display: none;
}
.video-recipe-card--video {
  grid-row: span 2;
  min-height: 392px;
  box-shadow: none;
}
.video-recipe-card--reference {
  aspect-ratio: auto;
  overflow: hidden;
  padding-bottom: 64px;
  background: #0a0a0c center / cover no-repeat;
  background-image: var(--recipe-ref-image, none);
}
/* Подложка заполняет плитку, но сам подготовительный кадр не обрезается. */
.video-recipe-card--reference::before {
  display: block;
  content: "";
  position: absolute;
  z-index: 0;
  inset: -16px;
  background: var(--recipe-ref-image, none) center / cover no-repeat;
  filter: blur(15px) brightness(.48) saturate(.82);
  transform: scale(1.08);
  pointer-events: none;
}
/* Кадр ролика заполняет большую карточку; у референсов показываем весь силуэт,
   чтобы на телефоне не исчезали голова или ноги. */
.video-recipe-card .preset-card-media {
  object-position: center top;
}
/* Точнее базового `.preset-grid-card > img.preset-card-media`: это правило
   действительно выигрывает каскад и сохраняет кадр целиком. */
.preset-grid-card.video-recipe-card--reference > img.preset-card-media {
  inset: 0 0 64px;
  z-index: 1;
  object-fit: contain;
  object-position: center;
  background: transparent;
}
.video-recipe-card--reference .video-recipe-card-meta {
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 64px;
  padding: 9px 12px 10px;
  background: linear-gradient(180deg, rgba(5, 5, 6, .18), rgba(5, 5, 6, .92) 45%);
}
.video-recipe-card--reference .video-recipe-card-meta strong { font-size: 15px; }
.video-recipe-card-meta {
  position: absolute;
  z-index: 4;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: grid;
  gap: 2px;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.82);
  pointer-events: none;
}
.video-recipe-card-meta small {
  color: rgba(250, 222, 151, 0.98);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.video-recipe-card-meta strong {
  color: #fff;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.12;
}
.video-recipe-card-meta em {
  overflow: hidden;
  color: rgba(255, 250, 240, 0.78);
  font-size: 10px;
  font-style: normal;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recipe-video-handoff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 2px;
  padding: 12px;
  border: 1px solid rgba(224, 184, 91, 0.3);
  border-radius: 14px;
  background: rgba(224, 184, 91, 0.07);
}
.recipe-video-handoff.hidden { display: none; }
.recipe-video-handoff > div { min-width: 0; }
.recipe-video-handoff strong {
  display: block;
  margin-top: 2px;
  color: #f8f1e1;
  font-size: 13px;
  line-height: 1.2;
}
.recipe-video-handoff p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.recipe-video-handoff .btn-outline {
  flex: 0 0 auto;
  min-height: 40px;
  font-size: 11px;
}

#videoRecipeEditorSheet {
  z-index: 92;
  padding-top: var(--chrome-top);
  background: rgba(3, 3, 4, .94);
}
#videoRecipeEditorSheet .video-recipe-editor-sheet {
  width: min(100%, 640px);
  max-height: calc(100dvh - var(--chrome-top));
  margin: 0 auto;
  padding-bottom: calc(24px + var(--chrome-bottom));
  overflow-y: auto;
  border: 1px solid rgba(232, 198, 117, .2);
  border-radius: 22px 22px 0 0;
  background: linear-gradient(155deg, #1b1811 0%, #0d0d0d 42%, #080808 100%);
  overscroll-behavior: contain;
}
#videoRecipeEditorSheet .sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -18px 16px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(232, 198, 117, .18);
  background: rgba(22, 19, 13, .96);
  backdrop-filter: blur(14px);
}
.video-recipe-editor-hint {
  margin-top: 3px;
  color: rgba(255, 245, 220, .58);
  font-size: 12px;
}
.video-recipe-editor-prompt-field { display: grid; gap: 8px; }
.video-recipe-editor-prompt-field > span,
.video-recipe-editor-ref-copy > label {
  color: rgba(255, 245, 220, .74);
  font-size: 12px;
  font-weight: 650;
}
.video-recipe-editor-prompt-field .prompt {
  min-height: 180px;
  max-height: 54dvh;
  overflow-y: auto;
  font-size: 16px;
  line-height: 1.55;
  resize: vertical;
  border-color: rgba(232, 198, 117, .22);
  background: rgba(0, 0, 0, .22);
}
.video-recipe-editor-toggle {
  margin: 12px 0;
  border-top: 1px solid rgba(232, 198, 117, .13);
  border-bottom: 1px solid rgba(232, 198, 117, .13);
}
.video-recipe-editor-variables {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
#videoRecipeEditorVariables { display: grid; gap: 8px; }
.video-recipe-editor-fragment-preview {
  grid-column: 1 / -1;
  margin: 0;
  color: #efd49c;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.video-recipe-editor-variable {
  display: grid;
  grid-template-columns: minmax(82px, .72fr) minmax(100px, 1fr) minmax(100px, 1fr) auto;
  gap: 7px;
  align-items: end;
  padding: 9px;
  border: 1px solid rgba(255, 244, 214, .11);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
}
.video-recipe-editor-variable > label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: rgba(255, 245, 220, .62);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.video-recipe-editor-variable .field-input { min-width: 0; padding: 9px; font-size: 13px; }
.video-recipe-editor-variable-remove {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 143, 143, .3);
  border-radius: 10px;
  background: rgba(255, 90, 90, .08);
  color: #ffb6b6;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.video-recipe-editor-refs {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.video-recipe-editor-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.video-recipe-editor-section-head strong { color: #fff5de; font-size: 15px; }
.video-recipe-editor-section-head p {
  margin: 4px 0 0;
  color: rgba(255, 245, 220, .56);
  font-size: 12px;
  line-height: 1.35;
}
.video-recipe-editor-count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(232, 198, 117, .25);
  border-radius: 999px;
  color: #f2d487;
  font-size: 11px;
  font-weight: 700;
}
#videoRecipeEditorRefs { display: grid; gap: 8px; }
.video-recipe-editor-ref {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 244, 214, .11);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
}
.video-recipe-editor-ref > img {
  width: 72px;
  height: 88px;
  border-radius: 9px;
  object-fit: cover;
  background: #050505;
}
.video-recipe-editor-ref-copy { min-width: 0; }
.video-recipe-editor-ref-copy > label { display: grid; gap: 6px; }
.video-recipe-editor-ref-prompt {
  min-height: 54px;
  padding: 8px 9px;
  resize: vertical;
  color: #fff8ec;
  font-size: 12px;
  line-height: 1.3;
}
.video-recipe-editor-ref-remove {
  min-height: 40px;
  padding: 7px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 198, 183, .9);
  font-size: 11px;
  font-weight: 700;
}
.video-recipe-editor-empty {
  margin: 0;
  padding: 13px;
  border: 1px dashed rgba(232, 198, 117, .24);
  border-radius: 12px;
  color: rgba(255, 245, 220, .62);
  font-size: 12px;
  line-height: 1.4;
}
.video-recipe-editor-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 10px;
}
.video-recipe-editor-actions .btn-outline {
  min-height: 44px;
  padding: 9px 6px;
  font-size: 12px;
}
.video-recipe-editor-actions .video-recipe-editor-delete {
  border-color: rgba(230, 120, 100, .38);
  color: #f0aaa0;
}
/* Мобильный рецепт повторяет эталонную masonry-композицию: независимые
   колонки без схлопывающихся auto-строк Grid. Слева ролик 9:16 и следующий
   кадр, справа — первые два портретных референса. */
@media (max-width: 639px) {
  #presetGroupSheet.preset-group-sheet--recipe .video-recipe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
  }
  #presetGroupSheet.preset-group-sheet--recipe .video-recipe-column {
    display: grid;
    min-width: 0;
    align-content: start;
    gap: 10px;
  }
  #presetGroupSheet.preset-group-sheet--recipe .video-recipe-card--video {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
    aspect-ratio: 9 / 16;
  }
  #presetGroupSheet.preset-group-sheet--recipe .video-recipe-card--reference {
    min-height: 0;
    /* Высокий формат ближе к самому коллажу 9:16: кадр не превращается
       в узкую полосу и одновременно вмещает полный рост. */
    aspect-ratio: 9 / 16;
    padding-bottom: 60px;
  }
  .preset-grid-card.video-recipe-card--reference > img.preset-card-media { inset-bottom: 60px; }
  .video-recipe-card--reference .video-recipe-card-meta { min-height: 60px; padding: 8px 10px 9px; }
}
@media (max-width: 370px) {
  .video-recipe-editor-ref { grid-template-columns: 58px minmax(0, 1fr); }
  .video-recipe-editor-ref > img { width: 58px; height: 74px; }
  .video-recipe-editor-ref-remove { grid-column: 2; justify-self: start; min-height: 32px; padding: 0; }
}
@media (max-width: 370px) {
  #presetGroupSheet.preset-group-sheet--recipe .video-recipe-card--video { min-height: 0; }
  .video-recipe-card { min-height: 171px; }
  .recipe-video-handoff { align-items: flex-start; flex-direction: column; }
  .recipe-video-handoff .btn-outline { width: 100%; }
}
.sheet-cover-video.hidden { display: none !important; }
.sheet-cover.has-video #sheetCoverImg { display: block; }
.sheet-cover .sheet-cover-video { opacity: 0; }
.sheet-cover .sheet-cover-video.is-ready { opacity: 1; }
.sheet-cover.has-video { cursor: pointer; }

/* ─────────────  МАГАЗИН  ───────────── */
.plans { display: flex; flex-direction: column; gap: 11px; margin-bottom: 22px; }
.plan {
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  transition: border-color 0.15s, transform 0.12s;
}
.plan:active { transform: scale(0.99); }
.plan.selected { border-color: var(--accent); box-shadow: var(--glow); }
.plan-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.plan-tier { font-weight: 700; font-size: 15px; }
.plan-badge { background: var(--accent-grad); color: #1a1200; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.plan-badge.hot { background: linear-gradient(135deg, #ff9a4d, #ff6a3d); }
.plan-row { display: flex; justify-content: space-between; align-items: flex-end; }
.plan-volume { font-size: 19px; font-weight: 800; }
.plan-tagline { font-size: 12px; color: var(--muted); margin-top: 2px; }
.plan-price-col { text-align: right; }
.plan-old { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.plan-price { font-size: 19px; font-weight: 800; color: var(--accent); }
.plans-empty { color: var(--muted); text-align: center; }
.plan-loki {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.plan-loki-name { font-weight: 600; font-size: var(--text-base); letter-spacing: var(--tracking-normal); }
.plan-loki-price { text-align: right; font-size: var(--text-sm); color: var(--text-secondary); }
.plan-loki-price strong { font-size: var(--text-lg); font-weight: 700; color: var(--accent); letter-spacing: var(--tracking-tight); }
.plan-details { margin-bottom: 18px; }
.plan-details-title { font-size: var(--text-base); font-weight: 600; margin: 0 0 12px; letter-spacing: var(--tracking-tight); }
.plan-highlights { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.plan-highlights li { font-size: var(--text-sm); line-height: var(--leading-relaxed); padding-left: 26px; position: relative; font-weight: 400; }
.plan-highlights li.included::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.plan-highlights li.excluded { color: var(--muted); }
.plan-highlights li.excluded::before { content: "✕"; position: absolute; left: 0; color: var(--muted); }
.plan-tagline { font-size: var(--text-xs); color: var(--muted); margin-top: 2px; line-height: var(--leading-snug); }
.checkout-panel { margin-bottom: 14px; }
.pay-methods {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
@media (min-width: 380px) {
  .pay-methods { grid-template-columns: 1fr 1fr 1fr; }
}
.pay-method {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.pay-method.hidden { display: none !important; }
.pay-method.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.pay-method-title { font-weight: 700; font-size: var(--text-sm); }
.pay-method-sub { font-size: var(--text-xs); color: var(--muted); line-height: 1.3; }
.checkout-toggle {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.checkout-toggle .chevron { transition: transform 0.2s; color: var(--muted); }
.checkout-toggle[aria-expanded="true"] .chevron { transform: rotate(90deg); }
.checkout-fields { display: flex; flex-direction: column; gap: 11px; margin-top: 11px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 14px;
  color: var(--text);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
}
.field input:focus { outline: none; border-color: var(--accent); }
.legal { text-align: center; margin-top: 12px; }
.legal-offer { margin-top: 6px; }
.legal-offer a { color: var(--accent); text-underline-offset: 3px; }

/* ─────────────  НИЖНЯЯ НАВИГАЦИЯ  ───────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: calc(var(--bottom-nav-height) + var(--bottom-safe-area));
  padding-bottom: var(--bottom-safe-area);
  background: rgba(8, 8, 10, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  flex: 1;
  transition: color 0.15s;
}
.nav-item.active { color: var(--accent); font-weight: 600; }
.nav-ico { display: grid; place-items: center; height: 24px; }
.nav-ico svg { width: 23px; height: 23px; display: block; }
.nav-center .nav-plus {
  width: 48px; height: 48px;
  margin-top: -16px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #1a1200;
  font-size: 30px;
  font-weight: 300;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s;
}
.nav-center .nav-plus svg {
  width: 26px;
  height: 26px;
  display: block;
}
.nav-center:active .nav-plus { transform: scale(0.9); }
.nav-center { color: var(--text); }

/* ─────────────  МОДАЛКИ  ───────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  animation: fade 0.2s ease;
}
.modal-sheet {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 14px; }
.result-img { width: 100%; border-radius: var(--radius-sm); margin-bottom: 12px; display: block; }
.result-note { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.success-icon {
  width: 60px; height: 60px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #1a1200;
  font-size: 30px;
  display: grid; place-items: center;
  box-shadow: var(--glow);
}

/* ─────────────  ОВЕРЛЕЙ ГЕНЕРАЦИИ  ───────────── */
.gen-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: rgba(8, 8, 10, 0.94);
  backdrop-filter: blur(8px);
  padding: calc(var(--chrome-top) + 8px) 20px calc(24px + var(--chrome-bottom));
}
.gen-overlay-back {
  position: absolute;
  top: calc(var(--chrome-top) + 8px);
  left: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.gen-overlay-back:active { transform: scale(0.94); }
.gen-overlay-hint {
  margin: 0;
  max-width: 280px;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: var(--leading-relaxed);
}
.particles { display: block; }
.gen-status { font-size: var(--text-base); font-weight: 600; color: var(--accent); letter-spacing: var(--tracking-normal); }

/* ─────────────  ГЛАВНАЯ: БАННЕРЫ (как LOKI)  ───────────── */
.home-banners {
  width: 100%;
  margin-bottom: 18px;
}
.home-banner-carousel { width: 100%; }
.home-banner-track {
  display: flex;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}
.home-banner-track::-webkit-scrollbar { display: none; }
.home-banner {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  min-height: 96px;
  border-radius: 22px;
  overflow: hidden;
  /* Карточка без светящихся краёв и декоративной рамки. */
  border: none;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  text-align: left;
  background-color: #111;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: none;
  isolation: isolate;
  transition: transform 180ms cubic-bezier(.16,1,.3,1);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.home-banner:active { transform: scale(0.985); }
.home-banner:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.home-banner--video {
  min-height: 230px;
  align-items: stretch;
  padding: 0;
  background-image: url("/shop/assets/hero-video.jpg?v=6");
  border: none;
}
.home-banner--video:active { transform: scale(0.99); }

.home-banner--video .hb-text {
  align-self: flex-start;
  max-width: min(80%, 510px);
  padding: 52px 22px 0;
}

.home-banner--video .hb-kicker { margin-bottom: 8px; }

.home-banner--video .hb-sub {
  max-width: 360px;
  color: rgba(255, 255, 255, 0.82);
}

.home-banner--video .hb-cta {
  right: auto;
  bottom: 20px;
  left: 22px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}
.home-brand-hero {
  min-height: 260px;
}
.home-brand-hero .hb-text {
  max-width: min(94%, 550px);
}
.home-brand-hero .hb-title {
  margin: 0;
  font-size: clamp(23px, 6.2vw, 34px);
  line-height: 1.08;
}
.home-brand-hero .hb-sub { margin-bottom: 0; }
.home-brand-actions {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 18px;
  left: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}
.home-brand-hero .hb-cta {
  position: static;
  min-height: 40px;
  border: 0;
  cursor: pointer;
}
.home-hero-partner {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  background: rgba(9,9,12,0.58);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.home-hero-partner:focus-visible,
.home-brand-hero .hb-cta:focus-visible,
.home-shortcuts-all:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.home-banner-motion {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #111;
  pointer-events: none;
}
.home-banner--video::after {
  display: none;
}
.home-banner--image {
  min-height: 128px;
  align-items: center;
  background-image: url("/shop/assets/hero-image.jpg?v=6");
}
.home-banner--partner {
  min-height: 260px;
  align-items: center;
  background-image: url("/shop/assets/banner-3.jpg?v=6");
}
.home-banner--chat,
.home-banner--launch {
  min-height: 216px;
  align-items: center;
}
.home-banner--chat { background-image: url("/shop/assets/banner-1.jpg?v=6"); }
.home-banner--launch { background-image: url("/shop/assets/banner-4.jpg?v=6"); }
.home-banner--chat .hb-text,
.home-banner--launch .hb-text { max-width: min(78%, 390px); }
.home-banner--partner .hb-text {
  /* CTA закреплена справа сверху — текст не должен заходить под неё. */
  max-width: min(60%, 280px);
}
.home-banner--partner .hb-sub { max-width: 330px; }
.home-banner--partner .hb-cta {
  top: 15px;
  right: 15px;
  bottom: auto;
}
.hb-levels {
  position: absolute;
  z-index: 1;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.hb-levels > span {
  display: grid;
  gap: 3px;
  min-height: 52px;
  padding: 8px 9px;
  border: 1px solid rgba(226, 190, 103, 0.32);
  border-radius: 10px;
  background: rgba(8, 8, 10, 0.72);
}
.hb-levels b {
  color: #f0ce7a;
  font-size: 17px;
  line-height: 1;
}
.hb-levels small {
  color: rgba(255, 255, 255, 0.74);
  font-size: 10px;
  line-height: 1.1;
}
.hb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8,8,10,0.9) 0%, rgba(8,8,10,0.5) 55%, rgba(8,8,10,0.2) 100%), linear-gradient(0deg, rgba(8,8,10,0.72), transparent 58%);
  pointer-events: none;
}
.home-banner--image .hb-overlay { background: linear-gradient(90deg, rgba(8,8,10,0.93) 0%, rgba(8,8,10,0.54) 64%, rgba(8,8,10,0.24) 100%); }
.hb-text { position: relative; z-index: 1; max-width: 78%; }
.hb-brand {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.62);
}
.hb-brand img {
  width: 21px;
  height: 21px;
  object-fit: contain;
}
.home-banner--image .hb-text {
  /* Правая часть карточки всегда остаётся под CTA: текст не наезжает на кнопку. */
  max-width: min(270px, calc(100% - 174px));
}
.home-banner--image .hb-title { font-size: clamp(18px, 5.3vw, 21px); line-height: 1.12; }
.home-banner--image .hb-sub { margin-top: 6px; }
.hb-kicker {
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .11em;
  line-height: 1;
}
.hb-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.72);
}
.hb-sub {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.76);
  margin-top: 7px;
  line-height: 1.35;
  font-weight: 400;
}
.hb-cta {
  position: absolute;
  z-index: 1;
  right: 14px;
  bottom: 14px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 11px;
  color: var(--accent-ink);
  background: var(--accent-grad);
  box-shadow: none;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.hb-cta span { font-size: 16px; line-height: 0; }
.home-banner-dots {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-top: 4px;
}
.home-banner-dot {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
}
.home-banner-dot::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.36);
  transition: width 180ms ease, background-color 180ms ease;
}
.home-banner-dot.active::after {
  width: 20px;
  background: var(--accent);
}
.home-banner-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 999px; }

/* Карусель заканчивается собственными точками, поэтому перед следующей карточкой
   не нужен искусственный пустой отступ. */
#view-home .home-partner-card { margin-top: 0; }

@media (max-width: 390px) {
  .home-banner--image { min-height: 144px; align-items: flex-start; }
  .home-banner--image .hb-text { max-width: calc(100% - 148px); padding-top: 2px; }
  .home-banner--image .hb-cta { right: 12px; bottom: 12px; padding: 8px 10px; gap: 6px; }
  #view-home .home-partner-card { margin-top: 0; }
}

@media (min-width: 640px) {
  .home-banner--video .hb-text { padding: 54px 26px 0; }
  .home-banner--video .hb-cta {
    bottom: 22px;
    left: 26px;
  }
}
.hb-video-mark {
  position: absolute;
  z-index: 1;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  background: rgba(12,12,15,0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hb-video-mark span {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #fff;
}
.hb-arrow {
  position: absolute;
  z-index: 1;
  right: 15px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  background: rgba(8,8,10,0.48);
  color: #fff;
  font-size: 20px;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
@media (prefers-reduced-motion: reduce) {
  .home-banner-motion { display: none; }
  .home-banner,
  .home-banner-dot::after { transition: none; }
  .home-banner-track { scroll-behavior: auto; }
}

/* ─────────────  ГЛАВНАЯ: LOKI-ЯРЛЫКИ  ───────────── */
.home-shortcuts {
  display: grid;
  /* Шесть нейросетей — одна компактная линия, без скрытого горизонтального списка. */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 0 2px 18px;
  margin: 0 0 4px;
}
.home-shortcuts-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 2px 10px;
}
.home-shortcuts-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.home-shortcuts-all {
  min-height: 36px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
@media (max-width: 360px) {
  .home-brand-hero { min-height: 282px; }
  .home-brand-hero .hb-title { font-size: 22px; }
}
.home-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.home-shortcut-tile {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 22%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(168deg, #2a2a32 0%, #1a1a22 45%, #101016 100%);
  box-shadow: none;
  border: 1px solid rgba(212, 175, 55, 0.22);
  display: grid;
  place-items: center;
  transition: transform 0.14s ease;
}
.home-shortcut:active .home-shortcut-tile {
  transform: scale(0.93);
}
.home-shortcut-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  pointer-events: none;
  image-rendering: auto;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.home-shortcut-label {
  font-size: 8.5px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.15;
  letter-spacing: var(--tracking-normal);
  max-width: 100%;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: manual;
  min-height: 2.3em;
}
@media (max-width: 360px) {
  .home-shortcut-label { font-size: 8px; }
}

/* ─────────────  ГЛАВНАЯ: ТРЕНДЫ  ───────────── */
.trends-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 10px 2px 14px;
}
.trends-head-text {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.trends-head .section-title {
  margin: 0;
}
.trends-head .shop-sub {
  margin: 0;
}
.trends-head .link-btn {
  flex-shrink: 0;
  margin-top: 2px;
  white-space: nowrap;
}
.link-btn { color: var(--accent); }
.trends-scroller {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* pan-y — иначе на карточке не листается главная */
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
}
.trends-scroller::-webkit-scrollbar { display: none; }
.trend-card {
  position: relative;
  flex: 0 0 144px;
  width: 144px;
  aspect-ratio: 3 / 4;
  height: auto;
  border-radius: 18px;
  overflow: hidden;
  border: none;
  padding: 0;
  margin: 0;
  background: #0a0a0c;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}
.trend-card > img,
.trend-card > .card-preview-poster,
.trend-card > video.card-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Та же защита формата для горизонтальной витрины «Трендов» на главной. */
.trend-card--native-vertical > img,
.trend-card--native-vertical > .card-preview-poster,
.trend-card--native-vertical > video.card-preview-video {
  object-fit: contain;
  background: #0a0a0c;
}
.trend-share { right: 8px; bottom: 8px; }
.card-preview-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
  background: #0a0a0c;
}
.trend-card video.card-preview-video,
.gallery-card video.card-preview-video,
.history-card video.card-preview-video,
.work-card video.card-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #0a0a0c;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.trend-card video.card-preview-video.is-ready,
.gallery-card video.card-preview-video.is-ready,
.history-card video.card-preview-video.is-ready,
.work-card video.card-preview-video.is-ready {
  opacity: 1;
}
/* iOS WebKit может оставить старый декодированный слой после removeAttribute
   src. Полное снятие video из дерева даёт постеру отрисоваться без полос. */
.card-preview-video.is-released { display: none !important; }
/* WebKit promotes <video> into a native layer. Clip that layer itself:
   clipping only the card can expose square frames during screen changes. */
video.card-preview-video { transform: none !important; }
.gallery-card:has(video), .history-card:has(video), .work-card:has(video) {
  content-visibility: visible;
  contain: none;
}
/* iOS clips the parent reliably but can leave square native fragments when
   `clip-path is avoided on native video; the parent keeps media in its compositor. The opaque mask keeps media
   in the card's compositing group without making another rounded video layer. */
.trend-card, .gallery-card:not(.gallery-card--feed), .history-card, .work-card,
.preset-card, .preset-grid-card {
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}
/* Do not animate native video surfaces during screen teardown on WebKit. */
video.card-preview-video { transition: none !important; }
.trend-card, .preset-card, .preset-grid-card { isolation: isolate; }
/* Превью без кнопки ▶ — сразу постер/ролик */
.trend-card .work-play,
.trend-card .history-card-play,
.gallery-card .work-play,
.history-card .history-card-play,
.work-card .work-play {
  display: none !important;
}
.trend-card .work-empty,
.gallery-card .work-empty { width: 100%; height: 100%; display: grid; place-items: center; font-size: 34px; }

/* ─────────────  ГАЛЕРЕЯ (ИДЕИ)  ───────────── */
.feed-intro { margin-bottom: 14px; padding-top: 16px; }
.feed-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border: 1px solid rgba(245, 224, 167, .16);
  border-radius: 15px;
  background: rgba(255, 248, 225, .035);
}
.feed-switch-btn {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #b9b19e;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.feed-switch-btn.active {
  color: var(--accent-ink);
  border-color: rgba(255, 243, 197, .66);
  background: var(--accent-grad);
  box-shadow: inset 0 1px rgba(255,255,240,.7), 0 6px 16px rgba(145,91,10,.24);
}
.feed-switch-btn:active { transform: scale(.98); }
.gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* «Идеи» — компактный обзор, чтобы быстро находить нужный пресет.
   Полноэкранная лента ниже намеренно переопределяет эту сетку одним материалом. */
#view-ideas:not(.feed-mode) .gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
/* «Идеи» — быстрый визуальный выбор. В отличие от ленты, здесь карточка
   остаётся главным объектом: автор — только небольшая аватарка, а счётчики
   собраны внизу в одну спокойную строку. Так лицо и композиция не скрываются
   высокой колонкой кнопок. Полные touch-safe действия остаются в открытой
   работе и в полноэкранной ленте. */
#view-ideas:not(.feed-mode) .gallery-card {
  aspect-ratio: 3 / 4;
  border-color: rgba(245, 224, 167, .18);
  background: #090908;
}
#view-ideas:not(.feed-mode) .gallery-card > img,
#view-ideas:not(.feed-mode) .gallery-card > .card-preview-poster,
#view-ideas:not(.feed-mode) .gallery-card > video.card-preview-video {
  background: #090908;
}
/* «Тренды» — та же компактная витрина, что и «Идеи». Раньше здесь оставалась
   базовая сетка 2:3, поэтому один и тот же опубликованный кадр выглядел у
   автора и зрителя по-разному. */
#view-trends .gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
#view-trends .gallery-card {
  aspect-ratio: 3 / 4;
  border-color: rgba(245, 224, 167, .18);
  background: #090908;
}
#view-trends .gallery-card > img,
#view-trends .gallery-card > .card-preview-poster,
#view-trends .gallery-card > video.card-preview-video {
  background: #090908;
}
/* Превью в «Трендах» всегда держат единую геометрию с фотографиями.
   Полный 9:16-кадр в 3:4-сетке оставлял чёрные полосы и визуально сжимал
   ролик. Полный кадр доступен после открытия работы, а в сетке используем
   аккуратный общий crop без пустых полей. */
#view-trends .gallery-card--native-vertical > img,
#view-trends .gallery-card--native-vertical > .card-preview-poster,
#view-trends .gallery-card--native-vertical > video.card-preview-video {
  object-fit: cover;
  background: #090908;
}
#view-ideas:not(.feed-mode) .gc-author,
#view-ideas:not(.feed-mode) .gc-author-btn {
  z-index: 3;
  left: 3px;
  bottom: 3px;
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  min-height: 28px;
  height: 28px;
  gap: 0;
  padding: 2px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 0;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,.82);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  touch-action: manipulation;
}
#view-ideas:not(.feed-mode) .gc-ava,
#view-ideas:not(.feed-mode) .gc-ava-img {
  width: 24px;
  height: 24px;
  font-size: 10px;
}
#view-ideas:not(.feed-mode) .gc-author-copy { display: none; }
#view-ideas:not(.feed-mode) .gc-author-btn:focus-visible,
#view-ideas:not(.feed-mode) .gc-like:focus-visible,
#view-ideas:not(.feed-mode) .gc-repeat:focus-visible,
#view-ideas:not(.feed-mode) .gc-share:focus-visible {
  outline: 2px solid rgba(255, 231, 166, .96);
  outline-offset: 1px;
}
#view-ideas:not(.feed-mode) .gc-like,
#view-ideas:not(.feed-mode) .gc-repeat,
#view-ideas:not(.feed-mode) .gc-share {
  z-index: 6;
  bottom: 1px;
  min-width: 28px;
  width: 28px;
  min-height: 31px;
  height: 31px;
  display: inline-grid;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0,0,0,.82);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  touch-action: manipulation;
}
#view-ideas:not(.feed-mode) .gc-like { right: 59px; }
#view-ideas:not(.feed-mode) .gc-share { right: 30px; }
#view-ideas:not(.feed-mode) .gc-repeat { right: 1px; }
#view-ideas:not(.feed-mode) .gc-like .gc-action-icon {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
}
#view-ideas:not(.feed-mode) .gc-like .gc-heart svg {
  width: 15px;
  height: 15px;
}
#view-ideas:not(.feed-mode) .gc-like:active { transform: none; opacity: .7; }
#view-ideas:not(.feed-mode) .gc-repeat .gc-action-icon,
#view-ideas:not(.feed-mode) .gc-share .gc-action-icon {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
}
#view-ideas:not(.feed-mode) .gc-repeat .gc-action-icon svg,
#view-ideas:not(.feed-mode) .gc-share .gc-action-icon svg { width: 14px; height: 14px; }
#view-ideas:not(.feed-mode) .gc-repeat:active,
#view-ideas:not(.feed-mode) .gc-share:active { transform: none; opacity: .7; }

/* Лента — это не каталог: на телефоне один материал занимает один жест,
   без второй навигационной шапки поверх медиа. */
html.feed-scroll { scroll-snap-type: y mandatory; }
/* В полноэкранной ленте не дублируем навигацию Telegram собственной шапкой:
   остаются системные «Назад», свернуть и меню. */
body.is-feed-view .topbar { display: none; }
/* Keep the native Telegram header over the feed backdrop without an opaque strip. */
/* У ленты нет боковых полей: фото и видео занимают всю доступную ширину
   Mini App, а не остаются внутри карточки с полями от обычного экрана. */
body.is-feed-view .app {
  max-width: none;
  padding: 0;
}
/* Лента начинается от самого верха видимой сцены. Раньше здесь оставался
   отрицательный сдвиг от старой шапки: первый кадр фактически уезжал под
   экран и на разных iPhone выглядел обрезанным. */
body.is-feed-view :is(#view-ideas.feed-mode, #profileWorkViewer) { margin-top: 0; }
:is(#view-ideas.feed-mode, #profileWorkViewer) {
  margin-top: 0;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .feed-intro,
:is(#view-ideas.feed-mode, #profileWorkViewer) .filter-pills,
:is(#view-ideas.feed-mode, #profileWorkViewer) .feed-switch { display: none; }
/* Логотип — единственная точка входа к разделам в immersive-ленте.
   Он не закрывает контент и открывает компактное меню вместо широких плашек. */
.feed-overlay-nav { display: none; }
:is(#view-ideas.feed-mode, #profileWorkViewer) .feed-overlay-nav {
  display: block;
}
/* The Ideas control has its own centered row below Telegram chrome. */
body.is-feed-view, #profileWorkViewer {
  --feed-overlay-edge: max(10px, env(safe-area-inset-right, 0px));
  --feed-ideas-menu-width: 104px;
  --feed-overlay-gap: 8px;
  /* Все нижние элементы опираются на одну базу. Иначе fixed-значение
     действия совпадает с «Идеями» на iPhone с другой высотой safe-area. */
  /* Reserve a 44px author row below the action buttons. */
  --feed-menu-bottom: 36px;
  --feed-menu-height: 44px;
  --feed-action-right: 16px;
  --feed-action-gap: 8px;
  --feed-action-step: 66px;
  --feed-repeat-bottom: calc(var(--bottom-nav-height) + var(--bottom-safe-area) + var(--feed-menu-bottom) + var(--feed-menu-height) + var(--feed-action-gap));
  --feed-share-bottom: calc(var(--feed-repeat-bottom) + var(--feed-action-step));
  --feed-like-bottom: calc(var(--feed-share-bottom) + var(--feed-action-step));
  --feed-pause-bottom: calc(var(--feed-like-bottom) + 72px);
  overflow-anchor:none;
}
.feed-brand-menu {
  position: fixed;
  z-index: 49;
  left: 50%;
  right: auto;
  top: max(0px, calc(var(--chrome-top) - 48px));
  bottom: auto;
  transform: translateX(-50%);
  box-sizing: border-box;
  inline-size: var(--feed-ideas-menu-width);
  min-width: var(--feed-ideas-menu-width);
  min-height: 44px;
  padding: 0 12px 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #ffe6a2;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1;
  text-shadow: 0 1px 5px rgba(0,0,0,.92);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .18s ease, opacity .18s ease, border-color .18s ease, background .18s ease;
}
.feed-brand-menu::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 7px 0;
  border: 1px solid rgba(255, 247, 221, .72);
  border-radius: 8px;
  background: rgba(8, 8, 7, .22);
  box-shadow: 0 1px 3px rgba(0,0,0,.38);
  transition: background .16s ease-out, border-color .16s ease-out;
}
.feed-brand-menu > * { position: relative; z-index: 1; }
.feed-brand-menu [data-ix] { width: 20px; height: 20px; color: #ffe6a2; }
.feed-brand-menu [data-ix] svg { width: 20px; height: 20px; }
.feed-brand-menu-label { white-space: nowrap; }
.feed-brand-menu:hover::before { border-color: rgba(255,255,255,.98); background: rgba(255,255,255,.14); }
.feed-brand-menu:active { transform: translateX(-50%) scale(.97); }
.feed-brand-menu:focus-visible {
  outline: 2px solid #f1c967;
  outline-offset: 3px;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* У трека и карточки одна фиксированная высота. Иначе iOS WebView при
     content-visibility мог кратко использовать его старый intrinsic-size и
     показывать в одном экране сразу две работы. */
  grid-auto-rows: var(--feed-card-height);
  align-items: stretch;
  gap: 0;
}
/* Один свайп = один ровно видимый экран. Не используем лишь min-height:
   содержимое карточки или особенности WebView могли растянуть её и оставляли
   внизу предыдущий/следующий кадр. Нижняя навигация теперь лежит поверх
   материала: исходник доходит до самого края экрана, как в ленте Instagram. */
body.is-feed-view, #profileWorkViewer {
  --feed-card-height: 100svh;
}
@supports (height: 100dvh) {
  body.is-feed-view, #profileWorkViewer {
    --feed-card-height: 100dvh;
  }
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card {
  width: 100%;
  box-sizing: border-box;
  block-size: var(--feed-card-height);
  height: var(--feed-card-height);
  min-height: var(--feed-card-height);
  max-height: var(--feed-card-height);
  aspect-ratio: auto;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  /* Исходный кадр никогда не растягиваем и не обрезаем. Нейтральное тёплое
     поле заполняет свободное место у горизонтальных/квадратных работ, поэтому
     лента остаётся цельной без жёстких чёрных полос и без дублирования кадра. */
  background:
    radial-gradient(90% 72% at 50% 46%, rgba(136, 97, 36, .20), transparent 72%),
    #060605;
  isolation: isolate;
  overflow-anchor:none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  /* В обычной сетке виртуализация экономит память. В fullscreen-ленте она
     создаёт неверный резервный размер в iOS Telegram и обрывает кадр, поэтому
     здесь размер и содержимое должны участвовать в раскладке сразу. */
  content-visibility: visible;
  contain-intrinsic-size: none;
}
/* Контент остаётся целиком в кадре, а свободное место у вертикальных,
   квадратных и горизонтальных оригиналов занимает не пустая полоса, а мягкое
   продолжение того же кадра. Для видео используем постер — второй decoder не
   запускается и лента не начинает лагать на телефоне. */
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -28px;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(6, 6, 5, .18), rgba(6, 6, 5, .18)),
    var(--feed-media-backdrop, none);
  background-position: center;
  background-size: cover;
  filter: blur(22px) saturate(.9) brightness(.85);
  transform: scale(1.08);
  opacity: .78;
}
/* Лента показывает исходный кадр целиком при любом формате. Свободное
   место заполняет размытый постер; видео и постер имеют одну геометрию. */
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--image > img,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--image > .card-preview-poster {
  object-fit: contain;
  object-position: center;
  z-index: 1;
  background: transparent;
  border-radius: 0;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--video > video.card-preview-video,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--video > .card-preview-poster {
  object-fit: contain;
  object-position: center;
  z-index: 1;
  background: transparent;
  border-radius: 0;
}
/* Даже 9:16 не равен viewport iPhone с панелями Telegram. */
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--native-vertical > img,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--native-vertical > .card-preview-poster,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--native-vertical > video.card-preview-video {
  object-fit: contain;
}
/* На телефоне 9:16 естественно заполняет высокий экран. На ПК такой же
   fullscreen-контейнер существенно шире, поэтому `cover` растягивает ролик
   по всей ширине и отрезает голову/ноги. Оставляем исходный кадр целиком по
   центру, а свободные поля мягко заполняет уже существующая подложка. */
@media (min-width: 768px) {
  :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--native-vertical > img,
  :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--native-vertical > .card-preview-poster,
  :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--native-vertical > video.card-preview-video {
    object-fit: contain;
    object-position: center;
  }
}
/* На iOS после тапа браузер может оставить :hover на карточке. У обычной
   сетки он даёт мягкое увеличение превью, но в полноэкранной ленте это
   воспринимается как прыжок/обрезание кадра. Материал в ленте всегда
   статичен: обратная связь живёт только в нажатой иконке действия. */
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed > img,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed > .card-preview-poster,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed > video.card-preview-video,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed:hover > img,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed:hover > .card-preview-poster,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed:hover > video.card-preview-video {
  transform: none !important;
  transition: none !important;
}
/* Затемнение — только лёгкая подложка для подписи автора. Оно не образует
   отдельный тёмный столбец под действиями и не меняет формат изображения. */
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-overlay {
  z-index: 2;
  background: linear-gradient(180deg, transparent 58%, rgba(0,0,0,.34) 100%);
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed {
  /* Не отдаём double tap браузерному zoom и не масштабируем сам кадр при
     нажатии: визуальная реакция живёт только в иконке лайка. */
  touch-action: manipulation;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed:active { transform: none; }
body.is-feed-view .nav-item:not(.nav-center) { gap: 4px; }
body.is-feed-view .nav-item:not(.nav-center) .nav-label {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
}

/* Symmetric wide frame with actions over the media, as in the approved
   reference. Ideas shares the native header row; navigation stays below media. */
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed {
  container-type: size;
  --feed-media-top: calc(var(--chrome-top) + 4px);
  --feed-media-bottom: calc(var(--bottom-nav-height) + var(--bottom-safe-area) + var(--feed-menu-bottom));
  --feed-media-ratio: .5625;
  background: #08080a;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed::before { opacity: .85; }
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed > img,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed > .card-preview-poster,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed > video.card-preview-video {
  inset: var(--feed-media-top) 8px var(--feed-media-bottom) 8px;
  margin: auto;
  box-sizing: border-box;
  width: calc(100cqw - 16px);
  height: min(calc((100cqw - 16px) / var(--feed-media-ratio)), calc(100cqh - var(--feed-media-top) - var(--feed-media-bottom)));
  padding: 0;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 16px;
  background: #08080a;
}
/* Approved phone reference: portrait media fills the rounded frame itself,
   instead of leaving straight-edged contain bars inside a rounded outline.
   Wider sources and desktop keep their complete frame. */
@media (max-width: 767px) {
  :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed.gallery-card--native-vertical > img,
  :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed.gallery-card--native-vertical > .card-preview-poster,
  :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed.gallery-card--native-vertical > video.card-preview-video {
    object-fit: cover;
  }
}
/* Действия в ленте построены как в соцсети: компактный круг с иконкой и
   отдельный счётчик снизу. Так длинное число не растягивает саму кнопку и
   не перекрывает «Идеи» на маленьких экранах. */
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-action {
  position: absolute;
  z-index: 5;
  right: var(--feed-action-right);
  width: 48px;
  display: grid;
  justify-items: center;
  gap: 3px;
  color: #ffe6a2;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 5px rgba(0,0,0,.9);
  -webkit-tap-highlight-color: transparent;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-like { bottom: var(--feed-like-bottom); }
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-share { bottom: var(--feed-share-bottom); }
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-repeat { bottom: var(--feed-repeat-bottom); }
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-like,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-repeat,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-share,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-toggle {
  position: static;
  min-width: 48px;
  width: 48px;
  min-height: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  /* Warm gold outlines and symbols match the approved feed reference. */
  border: 1px solid rgba(241, 201, 103, .74) !important;
  border-radius: 50%;
  background: rgba(9, 9, 7, .16) !important;
  box-shadow: 0 2px 9px rgba(0, 0, 0, .14) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: #ffe6a2;
  -webkit-tap-highlight-color: transparent;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-like .gc-action-icon path { stroke: currentColor; }
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-like.liked .gc-action-icon path { fill: currentColor; }
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-action-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: currentColor;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-like .gc-action-icon svg,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-action-icon svg {
  display: block;
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55));
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-like .gc-action-icon svg {
  width: 25px;
  height: 25px;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-action-count {
  display: block;
  min-width: 3em;
  max-width: 54px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-like:active .gc-action-icon,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-repeat:active .gc-action-icon,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-share:active .gc-action-icon,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-toggle:active .gc-action-icon { transform: scale(.88); }
/* Пауза отдельна от звука: она не включает новый аудиопоток и никогда не
   запускает соседний ролик. Расположена выше действий, чтобы не спорить с
   закреплённой кнопкой «Идеи». */
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-toggle {
  position: absolute;
  z-index: 5;
  right: var(--feed-action-right);
  bottom: var(--feed-pause-bottom);
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-toggle.is-paused {
  background: rgba(9, 9, 7, .34) !important;
}
/* Шкала у ролика остаётся тонкой визуально, но зона нажатия достаточно
   высокой для телефона: можно нажать на начало или протянуть к нужному кадру. */
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-progress {
  --feed-video-progress: 0%;
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 4px);
  left: 12px;
  width: auto;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease-out;
  touch-action: manipulation;
  cursor: pointer;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-progress::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff5dc 0 var(--feed-video-progress), rgba(255,255,255,.24) var(--feed-video-progress) 100%);
  box-shadow: 0 0 5px rgba(255,226,150,.36);
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-progress::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: 1px solid rgba(0,0,0,.45);
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: #fff5dc;
  box-shadow: 0 1px 5px rgba(0,0,0,.48);
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-progress::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.24);
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-progress::-moz-range-progress {
  height: 3px;
  border-radius: 999px;
  background: #fff5dc;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-progress::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(0,0,0,.45);
  border-radius: 50%;
  background: #fff5dc;
  box-shadow: 0 1px 5px rgba(0,0,0,.48);
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-progress:focus-visible {
  outline: 2px solid rgba(255,230,164,.96);
  outline-offset: 2px;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-progress.is-visible { opacity: .9; pointer-events: auto; }
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-row {
  position: absolute;
  z-index: 4;
  left: 14px;
  /* Автор и подписка используют всю нижнюю строку; «Идеи» теперь наверху. */
  right: 14px;
  /* Автор остаётся над нижней навигацией, хотя материал продолжается под ней. */
  bottom: calc(var(--bottom-nav-height) + var(--bottom-safe-area) + var(--feed-menu-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 0;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-btn {
  position: static;
  flex: 1 1 auto;
  max-width: none;
  min-height: 44px;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  font-size: 14px;
  text-shadow: 0 1px 5px rgba(0,0,0,.92);
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-btn {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #fff;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-btn {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-name {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-handle {
  display: block;
  overflow: hidden;
  max-width: 100%;
  color: rgba(241, 211, 139, .94);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-ava,
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-ava-img { width: 34px; height: 34px; }
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-ava { font-size: 14px; }
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-follow {
  position: static;
  flex: 0 0 auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  text-shadow: 0 1px 5px rgba(0,0,0,.92);
}
/* У кнопки компактный, почти инстаграмный контур, но внешняя зона нажатия
   остаётся 44 px: на телефоне её удобно нажать, а на кадре она не тяжелеет. */
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-follow-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(255, 247, 221, .72);
  border-radius: 999px;
  background: rgba(8, 8, 7, .22);
  color: #ffe6a2;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.08px;
  box-shadow: 0 1px 3px rgba(0,0,0,.38);
  transition: background .16s ease-out, border-color .16s ease-out, transform .16s ease-out;
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-follow:hover .gc-follow-label {
  border-color: rgba(255,255,255,.98);
  background: rgba(255,255,255,.14);
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-follow:active { transform: none; }
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-follow:active .gc-follow-label {
  transform: scale(.96);
  background: rgba(255,255,255,.22);
}
:is(#view-ideas.feed-mode, #profileWorkViewer) .gc-follow:focus-visible .gc-follow-label {
  outline: 2px solid rgba(247,214,129,.98);
  outline-offset: 3px;
}
@media (max-width: 375px) {
  body.is-feed-view, #profileWorkViewer {
    --feed-ideas-menu-width: 102px;
    --feed-overlay-gap: 6px;
  }
  :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-row { left: 10px; gap: 5px; }
  :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-btn {
    flex: 0 0 42px;
    padding-right: 4px;
  }
  :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-copy { display: none; }
  :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-follow-label { padding-inline: 8px; font-size: 11px; }
}
/* В ленте навигация — только набор иконок поверх работы, без чёрной плашки.
   Это сохраняет доступные зоны 44 px, но не отрезает нижнюю часть кадра. */
body.is-feed-view .bottom-nav {
  /* Базовый bottom-nav добавляет тонкую верхнюю границу позднее в CSS.
     В ленте это выглядело как лишняя полоса поверх контента. */
  border: 0 !important;
  background: #08080a;
  border-radius: 16px 16px 0 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
@media (prefers-reduced-motion: reduce) {
  html.feed-scroll { scroll-snap-type: y proximity; }
  :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-follow-label { transition: none; }
}
.gallery-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: none;
  background: #0a0a0c;
  aspect-ratio: 2 / 3;
  box-shadow: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: transform 0.12s;
  -webkit-appearance: none;
  appearance: none;
  /* Длинная лента с тяжёлыми фото не должна постоянно перерисовывать карточки
     за пределами видимой области. Размер всё равно резервируется aspect-ratio. */
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: auto 250px;
}
.gallery-card .gc-tag,
.gallery-card .gc-author-btn,
.gallery-card .gc-like {
  /* Blur-слои поверх каждой карточки заметно нагружают GPU именно при
     вертикальном скролле ленты. Оставляем читаемый непрозрачный фон. */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.gallery-card:active { transform: scale(0.98); }
.gallery-card > img,
.gallery-card > .card-preview-poster,
.gallery-card > video.card-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.skeleton-card {
  cursor: default;
  background: linear-gradient(100deg, rgba(255,255,255,0.03) 30%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.03) 70%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
.skeleton-card:active { transform: none; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-card { animation: none; }
}
.gc-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.15) 55%, rgba(0,0,0,0.72)); }
.gc-tag {
  position: absolute; top: 8px; left: 8px;
  z-index: 4;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px; font-weight: 700;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.gc-creator-rank {
  position: absolute;
  z-index: 5;
  top: 7px;
  left: 7px;
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(255, 225, 155, .58);
  border-radius: 999px;
  background: rgba(24, 16, 5, .76);
  color: #fff1ca;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: .01em;
  pointer-events: none;
}
.trend-card .gc-tag {
  color: #fff;
}
.gc-author {
  position: absolute; left: 8px; bottom: 8px;
  z-index: 2;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  max-width: 62%;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.gc-author-btn {
  border: none;
  background: rgba(0,0,0,0.45);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  color: #fff;
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.gc-author-btn:active { opacity: 0.85; }
.gc-author-copy { min-width: 0; }
.gc-author-name { overflow: hidden; text-overflow: ellipsis; }
.gc-author-handle { display: none; }
.gc-follow {
  position: absolute;
  left: 8px;
  bottom: 46px;
  z-index: 4;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255,244,204,.62);
  border-radius: 999px;
  color: var(--accent-ink);
  background: var(--accent-grad);
  box-shadow: 0 8px 22px rgba(0,0,0,.3);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.gc-follow:active { transform: scale(.96); }
.gc-ava {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #1a1200;
  font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.gc-ava-img {
  width: 22px; height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.detail-author-link {
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.detail-cell-wide { grid-column: 1 / -1; }
.gc-like {
  position: absolute; right: 8px; bottom: 8px;
  z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,0.5);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px; font-weight: 700;
  backdrop-filter: blur(6px);
}
.gc-like .gc-heart { color: #fff; }
.gc-repeat {
  position: absolute; right: 8px; bottom: 91px;
  z-index: 5;
  min-width: 40px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(9,10,16,.66);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.gc-repeat svg { width: 17px; height: 17px; }
.gc-repeat:active { transform: scale(.92); }
.gc-share { right: 8px; bottom: 46px; }

/* ─────────────  ДЕТАЛЬ ГЕНЕРАЦИИ  ───────────── */
/* Карточка как у пресета: один layout на всех устройствах */
#detailModal.modal,
#detailModal.modal.detail-modal--ideas {
  align-items: stretch;
  justify-content: flex-start;
  padding:
    calc(var(--chrome-top) + 8px)
    var(--viewer-side)
    max(16px, var(--chrome-bottom));
  background: #000;
}
/* Только карточка автора в «Идеях»: выводим кадр ближе к верхней навигации.
   Пользовательский fullscreen здесь не затрагивается. */
#detailModal.modal.detail-modal--ideas {
  padding-top: max(0px, calc(var(--chrome-top) - 4px));
}
#detailModal .detail-media,
#detailModal .detail-media--photo,
#detailModal .detail-media--photo img,
#detailModal .detail-media--video {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
#detailModal .detail-media--photo:active,
#detailModal .detail-media--photo:focus,
#detailModal .detail-media--photo img:active {
  opacity: 1;
  transform: none;
  filter: none;
}
.detail-sheet {
  width: 100%;
  max-width: none;
  max-height: 100%;
  overflow: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: transparent;
  border: none;
  border-radius: 0;
  position: relative;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.detail-media-wrap {
  position: relative;
  background: #111;
  border-radius: var(--media-radius);
  overflow: hidden;
  flex-shrink: 0;
  width: 100%;
  max-height: var(--media-max-h);
  /* Медиа не оформляем золотой рамкой: она отвлекает от кадра и выглядит
     как ошибка загрузки на светлых фотографиях. */
  border: 0;
  box-shadow: none;
}
/* Видео сохраняет чистый чёрный фон там, где файл содержит прозрачные/пустые
   области, но использует ту же геометрию без рамки, что и фотографии. */
.detail-media-wrap.detail-media-wrap--video {
  background: #000;
  border: 0;
  border-radius: var(--media-radius);
}
/* Закрытие — BackButton Telegram / тап по фону */
#detailModal .detail-close {
  display: grid !important; place-items:center; position:fixed;
  top:calc(var(--chrome-top,0px) + 10px);left:max(12px,env(safe-area-inset-left));
  width:44px;height:44px;z-index:12;font-size:26px;
  background:rgba(18,20,16,.85);border:1px solid #d3b77866;color:#f9e4ae;
}
.detail-media {
  width: 100%;
  background: #111;
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
}
.detail-media--photo {
  display: block;
  padding: 0;
  background: #111;
  min-height: 0;
  aspect-ratio: var(--media-ar);
  height: auto;
  max-height: var(--media-max-h);
  overflow: hidden;
  cursor: zoom-in;
}
.detail-media--photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: contain;
  object-position: center;
  background: #111;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
/* Мобильные фото могут прийти с фактическими пропорциями, отличающимися от
   заявленного формата генерации. Высота кадра тогда определяется файлом, а
   не старым aspect-ratio — рамка не оставляет чёрных боковых полос. */
@media (max-width: 639px) {
  #detailModal .detail-media-wrap { max-height: none; }
  #detailModal .detail-media--photo {
    height: auto;
    max-height: none;
    aspect-ratio: auto;
  }
  #detailModal .detail-media--photo img {
    position: relative;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: initial;
  }
  /* Высокий ролик должен сохранять свою высоту, а не втискиваться в 72vh:
     иначе object-fit: contain рисует широкие чёрные полосы по сторонам. */
  #detailModal .detail-video-wrap {
    max-height: none;
    border-radius: var(--media-radius);
  }
}
/* На ПК контейнер повторяет пропорции самого кадра. Портреты не теряются в
   огромной широкой плашке, но полностью помещаются по высоте без обрезки. */
@media (min-width: 640px) {
  #detailModal .detail-media-wrap {
    width: auto;
    height: min(68dvh, 720px);
    max-width: 100%;
    max-height: calc(100dvh - var(--chrome-top) - 32px);
    margin-right: auto;
    margin-left: auto;
    aspect-ratio: var(--detail-media-ar, var(--media-ar));
  }
  #detailModal .detail-media,
  #detailModal .detail-media--photo,
  #detailModal .detail-media--video,
  #detailModal .detail-video-wrap {
    width: 100%;
    height: 100%;
    max-height: none;
  }
  #detailModal .detail-media--photo,
  #detailModal .detail-video-wrap {
    aspect-ratio: auto;
  }
  #detailModal .detail-video-wrap {
    border-radius: var(--media-radius);
  }
}
/* Крестик на фото не нужен — есть BackButton Telegram */
.detail-photo-expand { display: none !important; }
body.photo-lightbox-open {
  overflow: hidden !important;
  touch-action: none;
}
/* Пока fullscreen — sheet/пресет не просвечивает снизу */
body.photo-lightbox-open #genSheet,
body.photo-lightbox-open #detailModal {
  visibility: hidden;
}
/* Полноэкранный просмотр: фото всегда идёт от края до края.
   Раньше stage был ограничен высотой viewport и contain сужал высокие
   вертикальные кадры, превращая их в узкую карточку с чёрными полями. */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100050;
  background: radial-gradient(80% 46% at 50% 100%, rgba(201,147,46,0.1), transparent 64%), #050506;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding:
    calc(var(--chrome-top) + 8px)
    0
    max(10px, var(--chrome-bottom));
  margin: 0;
  box-sizing: border-box;
  animation: fade 0.18s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.photo-lightbox.hidden { display: none !important; }
.photo-lightbox-stage {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  min-height: 0;
  display: block;
  overflow: hidden;
  touch-action: none;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  border-radius: 0;
  background: #000;
}
.photo-lightbox-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: initial;
  object-position: center;
  transform-origin: center center;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none; /* жесты ловит stage */
  border-radius: 0;
  opacity: 0;
  transition: opacity 0.16s ease;
}
.photo-lightbox-img.is-ready { opacity: 1; }
/* В Telegram Desktop событие load у закэшированного изображения иногда не
   приходит в WebView. Фото не должно оставаться прозрачным из-за анимации. */
.photo-lightbox[data-kind="image"] .photo-lightbox-img { opacity: 1; }
/* В ленте «Идей» кадр не ждёт декоративной fade-анимации: Telegram Desktop
   иначе может оставить первый экран чёрным до прокрутки. */
.photo-lightbox--gallery .photo-lightbox-img { opacity: 1; }
.photo-lightbox-video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
  border-radius: 0;
  outline: none;
}
/* Та же геометрия, что у фото: video никогда не диктует сцене свой
   натуральный размер и не образует отдельную скруглённую рамку. */
.photo-lightbox--gallery[data-kind="video"] .photo-lightbox-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-width: 0;
  min-height: 0;
}
.photo-lightbox[data-kind="video"] .photo-lightbox-img {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.photo-lightbox-video-toggle {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  padding: 0 0 0 4px;
  border: 1px solid rgba(255,255,255,0.36);
  border-radius: 50%;
  background: rgba(8,8,10,0.74);
  box-shadow: 0 10px 30px rgba(0,0,0,0.38);
  color: #fff;
  transform: translate(-50%, -50%);
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.photo-lightbox-video-toggle::before {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid currentColor;
  content: "";
}
.photo-lightbox-video-toggle.is-playing {
  width: 42px;
  height: 42px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
.photo-lightbox-video-toggle.is-playing::before {
  width: 14px;
  height: 18px;
  margin-left: 0;
  border: 0;
  background: linear-gradient(90deg, currentColor 0 38%, transparent 38% 62%, currentColor 62%);
}
.photo-lightbox-video-toggle:focus-visible {
  outline: 3px solid rgba(228,180,70,0.8);
  outline-offset: 3px;
}
.photo-lightbox-video-toggle:active { transform: translate(-50%, -50%) scale(0.94); }
.photo-lightbox[data-kind="video"] .photo-lightbox-stage { touch-action: pan-y; }
.photo-lightbox-meta {
  position: absolute;
  z-index: 4;
  top: calc(var(--chrome-top) + 18px);
  left: max(18px, env(safe-area-inset-left));
  max-width: calc(100% - 146px);
  min-height: 28px;
  padding: 7px 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(20,20,24,0.66);
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.photo-lightbox-repeat {
  position: absolute;
  z-index: 5;
  top: calc(var(--chrome-top) + 18px);
  right: max(76px, calc(env(safe-area-inset-right) + 66px));
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 14px;
  background: rgba(18,18,22,0.86);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  touch-action: manipulation;
}
.photo-lightbox-repeat svg { width: 18px; height: 18px; }
.photo-lightbox-repeat:active { transform: scale(0.96); }
@media (max-width: 390px) {
  .photo-lightbox-repeat { padding: 10px; }
  .photo-lightbox-repeat span { display: none; }
}
.photo-lightbox-actions {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: max(18px, calc(var(--chrome-bottom) + 10px));
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  background: rgba(18,18,22,0.88);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.photo-lightbox-actions.hidden { display: none !important; }
.photo-lightbox-bottom {
  position: absolute;
  z-index: 6;
  right: 12px;
  bottom: max(12px, calc(var(--chrome-bottom) + 8px));
  left: 12px;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  background: rgba(12,12,15,0.94);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.photo-lightbox-bottom.hidden { display: none !important; }
.photo-lightbox-bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.photo-lightbox-author {
  min-width: 0;
  max-width: calc(100% - 54px);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.photo-lightbox-author:disabled { cursor: default; }
.photo-lightbox-author img,
.photo-lightbox-author > span {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
  object-fit: cover;
}
.photo-lightbox-author strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-lightbox-share-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.photo-lightbox-owner-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.photo-lightbox-owner-actions.hidden { display: none !important; }
.photo-lightbox-owner-action {
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.photo-lightbox-owner-action svg { width: 19px; height: 19px; }
.photo-lightbox-owner-action--danger {
  border-color: rgba(255,112,135,0.32);
  background: rgba(255,92,122,0.14);
  color: #ffadbb;
}
.photo-lightbox-owner-action:active { transform: scale(0.97); }
.photo-lightbox-share {
  width: 44px;
  height: 44px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent-grad);
  color: var(--accent-ink);
  cursor: pointer;
  touch-action: manipulation;
}
.photo-lightbox-share svg,
.photo-lightbox-copy-link svg { width: 20px; height: 20px; }
.photo-lightbox-copy-link {
  width: 44px;
  height: 44px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent-grad);
  color: var(--accent-ink);
  cursor: pointer;
  touch-action: manipulation;
}
.photo-lightbox-like {
  position: absolute;
  /* Выше native video compositor в Telegram iOS: иначе кнопка видна, но
     первый tap может попасть в плеер и не поставить лайк. */
  z-index: 5;
  right: 12px;
  bottom: 12px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.42);
  border-radius: 999px;
  background: rgba(18,18,22,0.96);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 7px 22px rgba(0,0,0,0.38);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.photo-lightbox-like svg { width: 21px; height: 21px; }
.photo-lightbox-like.liked {
  border-color: rgba(255,150,172,0.9);
  background: #9f2941;
  color: #fff;
  box-shadow: 0 7px 22px rgba(159,41,65,0.42);
}
.photo-lightbox-like:focus-visible {
  outline: 3px solid rgba(226,190,103,0.9);
  outline-offset: 3px;
}
.photo-lightbox-like:active,
.photo-lightbox-copy-link:active { transform: scale(0.97); }
.photo-lightbox-primary {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.photo-lightbox-primary svg { width: 21px; height: 21px; }
.photo-lightbox-primary:active,
.photo-lightbox-share:active,
.photo-lightbox-author:not(:disabled):active { transform: scale(0.97); }
.photo-lightbox--gallery {
  --gallery-viewer-actions-h: 0px;
  gap: 0;
  overflow: hidden;
}
.photo-lightbox--gallery.photo-lightbox--owner {
  --gallery-viewer-actions-h: 184px;
}
.photo-lightbox--gallery.photo-lightbox--video {
  --gallery-viewer-actions-h: 0px;
}
.photo-lightbox--gallery.photo-lightbox--ideas {
  --gallery-viewer-actions-h: 0px;
  /* В iPhone viewer не должен оставлять лишнюю полосу между верхней
     навигацией Telegram и кадром. Плашка метаданных остаётся поверх медиа. */
  padding-top: max(0px, calc(var(--chrome-top) - 16px));
}
.photo-lightbox-bottom,
.photo-lightbox--ideas .photo-lightbox-bottom {
  display: none !important;
}
.photo-lightbox--gallery .photo-lightbox-stage {
  /* Нижняя панель закреплена вне сцены. Резервируем её высоту явно:
     так высокий портрет не может вытолкнуть действия под safe-area iPhone. */
  flex: 0 0 calc(100dvh - var(--chrome-top) - var(--chrome-bottom) - var(--gallery-viewer-actions-h));
  height: calc(100dvh - var(--chrome-top) - var(--chrome-bottom) - var(--gallery-viewer-actions-h));
  display: grid;
  min-height: 0;
  place-items: center;
  margin-bottom: 0;
}
.photo-lightbox--gallery .photo-lightbox-img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}
.photo-lightbox--gallery .photo-lightbox-bottom {
  position: absolute;
  right: 12px;
  bottom: max(10px, var(--chrome-bottom));
  left: 12px;
  margin: 0;
}
.photo-lightbox--gallery .photo-lightbox-nav,
.photo-lightbox--gallery .photo-lightbox-count,
.photo-lightbox--gallery .photo-lightbox-actions { display: none !important; }
/* На desktop медиа не растягивается на ширину всего окна Telegram: кадр
   всегда целиком помещается в центральную сцену — одинаково для фото и видео.
   В Telegram Desktop CSS-ширина иногда бывает меньше 640px из-за системного
   масштаба. По одной ширине такой экран ошибочно попадал в мобильный flex-layout:
   stage оказывался ниже viewport, и фото становилось видно лишь после zoom.
   Точный признак ПК — мышь с hover, поэтому используем его как второй путь. */
@media (min-width: 640px), (hover: hover) and (pointer: fine) {
  .photo-lightbox {
    /* В Telegram Desktop flex-раскладка сцены может рассчитываться раньше,
       чем WebView отдаст финальную высоту viewport. В результате stage
       оказывался ниже экрана, а изображение проявлялось только при zoom.
       На ПК привязываем сцену напрямую к границам fixed-overlay, без flex. */
    display: block;
    padding: 0;
    overflow: hidden;
  }
  .photo-lightbox-stage,
  .photo-lightbox--gallery .photo-lightbox-stage,
  .photo-lightbox--gallery:not(.photo-lightbox--video) .photo-lightbox-stage {
    position: absolute;
    top: calc(var(--chrome-top) + 8px);
    right: 24px;
    bottom: max(10px, calc(var(--chrome-bottom) + 8px));
    left: 24px;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    flex: none;
    align-self: auto;
    display: grid;
    place-items: center;
  }
  /* Только «Идеи»: кадр на пару миллиметров ближе к верхней панели. */
  .photo-lightbox--gallery.photo-lightbox--ideas .photo-lightbox-stage {
    top: calc(var(--chrome-top) + 4px);
  }
  .photo-lightbox .photo-lightbox-img,
  .photo-lightbox .photo-lightbox-video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
  }
  /* Grid не даёт процентной высоте replaced-элемента надёжную опорную
     величину во всех WebView: портрет мог получить ширину сцены, но свою
     натуральную высоту и уйти за её нижнюю границу. Абсолютный слой всегда
     имеет ровно размеры сцены, а object-fit уже вписывает в него кадр. */
  .photo-lightbox[data-kind="image"] .photo-lightbox-img {
    position: absolute;
    inset: 0;
    min-width: 0;
    min-height: 0;
  }
}
.photo-lightbox-action {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
}
.photo-lightbox-action:active { transform: scale(0.96); }
.photo-lightbox-action--danger { color: #ff9aaa; background: rgba(255,92,122,0.15); }
.photo-lightbox-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  background: rgba(20,20,24,0.72);
  color: #fff;
  font: 400 34px/1 sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.photo-lightbox-nav:hover { background: rgba(45,45,52,0.9); }
.photo-lightbox-nav:active { transform: scale(0.92); }
.photo-lightbox-nav:disabled { opacity: 0.22; pointer-events: none; }
.photo-lightbox-nav.hidden,
.photo-lightbox-count.hidden { display: none !important; }
.photo-lightbox-prev { left: max(10px, env(safe-area-inset-left)); }
.photo-lightbox-next { right: max(10px, env(safe-area-inset-right)); }
.photo-lightbox-count {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: max(16px, calc(var(--chrome-bottom) + 8px));
  transform: translateX(-50%);
  min-width: 54px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20,20,24,0.72);
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}
@media (max-width: 520px) {
  .photo-lightbox-nav {
    top: auto;
    bottom: max(14px, calc(var(--chrome-bottom) + 6px));
    margin-top: 0;
  }
  .photo-lightbox-prev { left: 16px; }
  .photo-lightbox-next { right: 16px; }
  .photo-lightbox-count { bottom: max(27px, calc(var(--chrome-bottom) + 19px)); }
}
@media (prefers-reduced-motion: reduce) {
  .photo-lightbox-img,
  .photo-lightbox-nav { transition: none; }
}
.photo-lightbox-hint {
  display: none !important;
}
.photo-lightbox-close {
  display: none;
  position: absolute;
  z-index: 3;
  top: calc(var(--chrome-top) + 12px);
  right: max(18px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  background: rgba(20,20,24,0.72);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.photo-lightbox-close:active { transform: scale(0.92); }
.detail-media--video {
  display: block;
  padding: 0;
  background: #000;
  max-height: none;
}
.detail-video-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  /* Нативное соотношение кадра (16:9, 4:3…) — без обрезки */
  aspect-ratio: var(--detail-video-ar, 16 / 9);
  height: auto;
  max-height: min(72vh, 720px);
  margin: 0 auto;
  border-radius: var(--media-radius);
  overflow: hidden;
  background: #000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* Вертикальное видео автора в «Идеях» должно заполнять рамку по ширине.
   Ограничение 72vh сжимало кадр, оставляя чёрные поля по бокам. */
@media (max-width: 639px) {
  #detailModal.detail-modal--ideas .detail-video-wrap {
    max-height: none;
  }
}
.detail-video-expand {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.17);
  border-radius: 14px;
  background: rgba(12,12,16,0.66);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 160ms ease, background 160ms ease;
}
.detail-video-expand svg { width: 20px; height: 20px; }
.detail-video-expand:active { transform: scale(0.92); background: rgba(38,38,44,0.9); }
.detail-video-sound {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 12px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.17);
  border-radius: 12px;
  background: rgba(12,12,16,0.72);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  touch-action: manipulation;
}
.detail-video-sound:active { transform: scale(0.96); }
.detail-video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  z-index: 1;
  pointer-events: none;
  background: #000;
}
.detail-media video.detail-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  display: block;
  object-fit: contain;
  object-position: center;
  background: #000;
  opacity: 0;
  transition: opacity 0.2s ease;
  /* без нативного UI (timeline / pause / AirPlay) */
  pointer-events: none;
}
.detail-media video.detail-video::-webkit-media-controls {
  display: none !important;
}
.detail-media video.detail-video::-webkit-media-controls-enclosure {
  display: none !important;
}
.detail-media video.detail-video.is-ready,
.detail-video-wrap.is-ready .detail-video {
  opacity: 1;
}
.detail-video-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  height: 200px; font-size: 40px; color: var(--muted);
}
.detail-video-ph span { font-size: var(--text-sm); color: var(--muted); font-weight: 400; }
.detail-body {
  padding: 16px 4px 8px;
  background: transparent;
  color: #fff;
}
.detail-body .detail-label { color: rgba(255, 255, 255, 0.55); }
.detail-body .detail-prompt { color: #fff; }
.detail-body .detail-value { color: #fff; }
.detail-label { margin-bottom: 4px; }
.detail-prompt { font-size: var(--text-base); font-weight: 400; line-height: var(--leading-relaxed); color: var(--text); }
.detail-cell .detail-value { font-size: var(--text-base); font-weight: 600; letter-spacing: var(--tracking-normal); }
.da-label { font-size: var(--text-xs); font-weight: 500; color: var(--muted); line-height: var(--leading-snug); }
.detail-badge {
  display: inline-block;
  background: rgba(52, 199, 89, 0.16);
  color: #34c759;
  border: 1px solid rgba(52,199,89,0.35);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-normal);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.detail-copy {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted); font-size: 15px;
  display: grid; place-items: center;
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-bottom: 20px; }
.detail-prompt-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.detail-prompt-col { flex: 1; min-width: 0; }
.detail-prompt-row--locked {
  align-items: stretch;
}
.detail-prompt-row--locked .detail-prompt-col {
  width: 100%;
}
.detail-prompt-row--locked .prompt-hidden-notice {
  margin: 0;
  width: 100%;
}
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.detail-action {
  flex: 1 1 60px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 60px;
}
.detail-action .da-ico {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  transition: transform 0.12s;
}
.detail-action.danger .da-ico {
  border-color: #ff5c7a;
  color: #ff5c7a;
}
.detail-action .da-ico svg {
  width: 22px;
  height: 22px;
  display: block;
}
.detail-action.primary .da-ico { background: var(--accent-grad); color: #1a1200; border-color: transparent; box-shadow: var(--glow); }
.detail-action.active .da-ico { border-color: #ff5c7a; color: #ff5c7a; }
.detail-action:active .da-ico { transform: scale(0.9); }
.detail-action:disabled { opacity: 0.5; }
.detail-action:disabled .da-ico { background: var(--surface); }

/* ─────────────  ПУБЛИКАЦИЯ  ───────────── */
.resolution-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.resolution-chips .chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 8px 6px;
  width: 100%;
}
.resolution-chips .chip-res {
  font-weight: 700;
  font-size: 15px;
}
.resolution-chips .chip-cost {
  font-size: 11px;
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.video-quality-chips {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
/* В Kling 3.0 три уровня качества: финальный 4K занимает целую строку,
   поэтому сетка не оставляет визуально случайную пустоту справа. */
.video-quality-chips .chip:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.home-upload-btn {
  margin-top: 16px;
  width: 100%;
}
#modHomeDropzone,
#manualDropzone {
  display: block;
  cursor: pointer;
  margin-bottom: 10px;
}
#modHomeUploadPrompt {
  margin: 10px 0;
  min-height: 80px;
}
.publish-title { font-size: var(--text-lg); font-weight: 700; letter-spacing: var(--tracking-tight); line-height: var(--leading-tight); }
.publish-desc { font-size: var(--text-sm); color: var(--muted); margin-top: 4px; max-width: 92%; line-height: var(--leading-relaxed); font-weight: 400; }
.sheet-head > div:first-child { padding-right: 8px; }
.pub-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  margin-bottom: 14px;
}
.pub-card-title { font-size: var(--text-base); font-weight: 600; margin-bottom: 3px; letter-spacing: var(--tracking-tight); }
.pub-status { font-size: var(--text-sm); color: var(--muted); margin-bottom: 13px; font-weight: 400; }
.pub-status.on { color: var(--accent); }
.pub-status.pending { color: #ff9a4d; }
.btn-outline {
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: var(--text-base);
  letter-spacing: var(--tracking-normal);
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  box-shadow: none;
  transition: transform 0.12s;
}
.btn-outline:active { transform: scale(0.98); }

/* ─────────────  ИНФО НА ОВЕРЛЕЕ ГЕНЕРАЦИИ  ───────────── */
.gen-info { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.gi-model { font-size: var(--text-base); font-weight: 600; letter-spacing: var(--tracking-tight); }
.gi-meta { font-size: var(--text-sm); color: var(--muted); font-weight: 400; }
.gen-tip {
  max-width: 300px;
  margin-top: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  font-weight: 400;
  text-align: center;
  transition: opacity 0.3s;
}

/* ─────────────  ЭМОДЗИ (Twemoji)  ───────────── */
img.emoji {
  height: 1em;
  width: 1em;
  margin: 0 0.03em;
  vertical-align: -0.12em;
  display: inline-block;
}
.mi-circle img.emoji, .model-emoji img.emoji, .preset-emoji img.emoji,
.quick-emoji img.emoji, .empty-emoji img.emoji, .da-ico img.emoji { vertical-align: -0.1em; }

/* Публикация всегда выше детального просмотра */
#publishSheet { z-index: 95; }

/* ─────────────  ДОСТУП ТОЛЬКО ИЗ TELEGRAM  ───────────── */
body.locked { overflow: hidden; }
body.boot-pending .topbar,
body.boot-pending .app,
body.boot-pending .bottom-nav { visibility: hidden; pointer-events: none; }
/* Публичная страница /shop доступна без Telegram: её проверяют платёжные
   провайдеры, а пользователь может прочитать условия до покупки. */
.public-shop-page { display: none; }
html.public-shop { min-width: 320px; background: #080806; }
/* Mini App может оставить body.locked после прежней сессии. У публичной
   витрины всегда обычный документный скролл — и на Safari, и на телефоне. */
html.public-shop,
html.public-shop body {
  min-width: 320px;
  min-height: 100%;
  height: auto !important;
  overflow: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: auto;
}
html.public-shop body { background: #080806; }
html.public-shop .boot-splash,
html.public-shop .topbar,
html.public-shop .app,
html.public-shop .bottom-nav,
html.public-shop #accessDenied { display: none !important; }
html.public-shop .public-shop-page { display: block; min-height: 100dvh; overflow: visible; visibility: visible; pointer-events: auto; }
.public-shop-page {
  min-height: 100dvh;
  color: #f9f4e9;
  background:
    radial-gradient(54rem 32rem at 100% -8%, rgba(187, 136, 47, .18), transparent 64%),
    radial-gradient(40rem 25rem at -10% 28%, rgba(120, 85, 28, .12), transparent 66%),
    #080806;
  font-family: var(--font-body);
}
.public-shop-shell { width: min(100% - 32px, 860px); margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 0 max(48px, env(safe-area-inset-bottom)); }
.public-shop-brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; color: #fffaf0; }
.public-shop-brand img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.public-shop-brand span { display: grid; gap: 1px; }
.public-shop-brand strong { font-size: 16px; letter-spacing: -.01em; }
.public-shop-brand small,
.public-shop-kicker { color: #d8bb7d; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.public-shop-hero { padding: clamp(31px, 7vw, 58px) 0 26px; max-width: 670px; }
.public-shop-hero h1 { max-width: 620px; margin: 8px 0 14px; color: #fffaf0; font-family: var(--font-display); font-size: clamp(33px, 7vw, 52px); line-height: 1.03; letter-spacing: -.045em; }
.public-shop-hero p:not(.public-shop-kicker) { max-width: 640px; margin: 0; color: rgba(249, 244, 233, .76); font-size: 17px; line-height: 1.6; }
.public-shop-telegram-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }
.public-shop-telegram { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border: 1px solid rgba(241, 205, 125, .7); border-radius: 14px; background: linear-gradient(135deg, #f1ce83, #c5943d); color: #171108; font-size: 15px; font-weight: 800; text-decoration: none; box-shadow: 0 12px 28px rgba(0, 0, 0, .24); }
.public-shop-telegram:hover { filter: brightness(1.06); }
.public-shop-telegram--secondary { border-color: rgba(241, 205, 125, .36); background: rgba(255, 255, 255, .055); color: #f9f4e9; box-shadow: none; }
.public-shop-telegram:focus-visible,
.public-shop-footer a:focus-visible { outline: 2px solid #f3cf81; outline-offset: 3px; border-radius: 4px; }
.public-shop-card { padding: clamp(20px, 4vw, 30px); border: 1px solid rgba(230, 192, 111, .25); border-radius: 22px; background: linear-gradient(145deg, rgba(39, 33, 23, .92), rgba(16, 14, 10, .96)); box-shadow: 0 18px 46px rgba(0, 0, 0, .18); }
.public-shop-card h2 { margin: 5px 0 17px; color: #fffaf0; font-family: var(--font-display); font-size: clamp(21px, 4vw, 28px); line-height: 1.15; letter-spacing: -.025em; }
.public-shop-card p,
.public-shop-card li { color: rgba(249, 244, 233, .78); font-size: 15px; line-height: 1.62; }
.public-shop-card p { margin: 0; }
.public-shop-card p + p { margin-top: 14px; }
.public-shop-card ol { margin: 0; padding-left: 20px; }
.public-shop-card li + li { margin-top: 10px; }
.public-shop-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.public-shop-prices { width: 100%; border-collapse: collapse; font-size: 15px; }
.public-shop-prices caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.public-shop-prices th,
.public-shop-prices td { padding: 13px 8px; border-bottom: 1px solid rgba(255, 255, 255, .11); text-align: left; white-space: nowrap; }
.public-shop-prices thead th { color: rgba(249, 244, 233, .62); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.public-shop-prices tbody th { color: #fffaf0; font-weight: 700; }
.public-shop-prices td:last-child { color: #f1cd7c; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.public-shop-note { margin-top: 16px !important; color: rgba(249, 244, 233, .63) !important; font-size: 13px !important; }
.public-shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.public-shop-requisites { margin-top: 14px; }
.public-shop-requisites dl { display: grid; gap: 12px; margin: 0; }
.public-shop-requisites dl div { display: grid; grid-template-columns: minmax(110px, .38fr) minmax(0, 1fr); gap: 14px; }
.public-shop-requisites dt { color: rgba(249, 244, 233, .59); font-size: 14px; }
.public-shop-requisites dd { min-width: 0; margin: 0; color: #fffaf0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.public-shop-requisites a,
.public-shop-footer a { color: #f1cd7c; text-underline-offset: 3px; }
.public-shop-footer { padding: 23px 0 0; color: rgba(249, 244, 233, .58); font-size: 14px; line-height: 1.55; }
.public-shop-footer span { margin: 0 7px; color: rgba(249, 244, 233, .35); }
.public-shop-footer p { margin: 10px 0 0; }
@media (max-width: 620px) {
  .public-shop-shell { width: min(100% - 24px, 860px); }
  .public-shop-grid { grid-template-columns: 1fr; }
  .public-shop-requisites dl div { grid-template-columns: 1fr; gap: 3px; }
  .public-shop-telegram-actions { display: grid; grid-template-columns: 1fr; }
  .public-shop-telegram { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .public-shop-telegram { transition: none; } }
.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(70% 50% at 50% 20%, var(--accent-soft), transparent 55%),
    #000;
}
.boot-splash.hidden { display: none; }
.boot-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
}
.boot-splash-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  animation: boot-pulse 1.4s ease-in-out infinite;
}
.boot-splash-brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: var(--tracking-tight);
}
.boot-splash-caption {
  margin-top: -10px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.boot-splash-spinner {
  width: 28px;
  height: 28px;
  margin-top: 6px;
  border: 2.5px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: boot-spin 0.75s linear infinite;
}
.boot-splash-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}
@keyframes boot-spin {
  to { transform: rotate(360deg); }
}
@keyframes boot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.96); opacity: 0.85; }
}
.access-denied {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: calc(var(--chrome-top) + 8px) 24px calc(28px + var(--chrome-bottom));
  background: #000;
}
.access-denied[data-mode="blocked"] {
  background:
    radial-gradient(80% 55% at 50% 0%, rgba(255, 92, 92, 0.12), transparent 58%),
    #000;
}
.ad-box {
  width: min(100%, 340px);
  text-align: center;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}
.ad-icon {
  width: 72px;
  height: 86px;
  margin: 0 auto 28px;
  color: var(--accent);
}
.ad-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.ad-code {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  color: var(--danger);
  margin-bottom: 10px;
}
.ad-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
  color: #fff;
  margin: 0 0 12px;
}
.ad-text {
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  line-height: 1.45;
  margin: 0 0 32px;
  font-weight: 400;
}
.ad-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.ad-debug {
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  margin: 0 0 14px;
  max-height: 36vh;
  overflow: auto;
}
.ad-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 15px 22px;
  border-radius: 14px;
  background: var(--accent);
  color: #111;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  border: none;
  cursor: pointer;
}
.ad-btn:active { filter: brightness(0.95); }
.ad-btn-link { background: var(--accent); color: #111; }
.ad-btn-secondary {
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 18px;
}

/* ─────────────  TOAST  ───────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--chrome-bottom) + 18px);
  transform: translateX(-50%);
  z-index: 999;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 13px 18px;
  border-radius: 13px;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: var(--leading-snug);
  max-width: 88%;
  text-align: center;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ─────────────  ПРОФИЛЬ: РАЗДЕЛЫ  ───────────── */
.profile-section-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.profile-section-tabs::-webkit-scrollbar { display: none; }

.account-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
}
.account-row:last-of-type { border-bottom: none; }
.billing-card { margin-top: 14px; }
.account-support-card { margin-top: 14px; }
.account-support-card .account-linked-title {
  margin-bottom: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: var(--text-xs);
  color: var(--muted);
}
.account-support-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}
.billing-list { display: flex; flex-direction: column; gap: 0; }
.billing-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.billing-item:first-child { padding-top: 4px; }
.billing-item:last-child { border-bottom: none; padding-bottom: 0; }
.billing-item-main { min-width: 0; flex: 1; }
.billing-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.billing-item-date {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.billing-item-right {
  text-align: right;
  flex-shrink: 0;
}
.billing-item-tokens {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.3;
}
.billing-item-tokens.is-debit { color: #f07178; }
.billing-item-money {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.account-id-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}
.account-id-row code {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  word-break: break-all;
}
.account-linked { margin: 14px 0; }
.account-linked-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.account-linked-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.account-linked-badge { color: var(--accent); font-weight: 600; font-size: 13px; }
.account-email-field { margin: 14px 0; }
.account-email-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.account-email-row input { flex: 1; min-width: 0; }
.account-hint { font-size: 12px; margin: 6px 0 0; }
.account-avatars-block { margin-top: 16px; }
.gen-avatars-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 10px 0 12px;
}
.gen-avatar-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 0;
  background: var(--surface-2);
}
.gen-avatar-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gen-avatar-del {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 16px;
  line-height: 22px;
  text-align: center;
}
.gen-avatar-add { margin-top: 4px; cursor: pointer; }

/* ─────────────  ПАРТНЁРКА  ───────────── */
.partner-page {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  letter-spacing: var(--tracking-normal);
  font-weight: 400;
}
.partner-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 16px 16px;
  margin-bottom: 16px;
}
.partner-card-title {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}
.partner-moderation-notice {
  display: flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 12px;
  padding: 7px 10px;
  border: 1px solid rgba(212, 175, 55, .32);
  border-radius: 10px;
  background: rgba(212, 175, 55, .08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}
.partner-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 16px;
  align-items: stretch;
}
.partner-level {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 92px;
  padding: 12px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.partner-level-name {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
  line-height: 1.2;
}
.partner-level-desc {
  font-size: 11px;
  opacity: 0.55;
  line-height: 1.25;
  min-height: 2.5em;
}
.partner-level-pct {
  margin-top: auto;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}
.partner-payout-summary {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}
.partner-terms {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.partner-terms summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--accent);
  cursor: pointer;
  font-weight: 650;
}
.partner-terms p { margin: 0; }
.partner-data-status {
  margin: -8px 0 12px;
  color: var(--muted);
  font-size: var(--text-sm);
}
.partner-data-status.is-error { color: var(--danger); }
.partner-stat-levels {
  margin-top: 10px;
  font-size: 13px;
  opacity: 0.75;
  line-height: 1.45;
}
.partner-card-sub {
  font-size: var(--text-sm);
  margin: 0 0 14px;
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  font-weight: 400;
}
.partner-link-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 12px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.partner-link-tab {
  flex: 1;
  min-height: 36px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}
.partner-link-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.partner-link-hint {
  margin: 8px 0 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  font-weight: 500;
}
.partner-link-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 4px 4px 14px;
  margin-bottom: 0;
  height: 46px;
  box-sizing: border-box;
}
.partner-link-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 10px 0;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  outline: none;
}
.partner-link-edit {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.partner-link-edit svg { width: 18px; height: 18px; }
.partner-link-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: 4px;
}
.partner-round-btn {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  border: none;
  background: var(--accent-grad);
  color: #1a1200;
  display: grid;
  place-items: center;
  box-shadow: var(--glow);
  flex-shrink: 0;
}
.partner-round-btn svg { width: 20px; height: 20px; }
.partner-period { margin-bottom: 16px; }
.partner-stats { margin: 4px 0 18px; }
.partner-stat-big {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--text);
}
.partner-stat-label {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text-secondary);
  line-height: var(--leading-snug);
}
.partner-balances {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.partner-balance-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.partner-balance-label {
  display: block;
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.partner-balance-value {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: var(--tracking-normal);
}
.partner-stars-note {
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}
.partner-withdraw {
  font-size: var(--text-sm);
  margin: 0 0 20px;
  line-height: var(--leading-relaxed);
  color: var(--muted);
  font-weight: 400;
}
.partner-block { margin-bottom: 18px; }
.partner-block-title {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: var(--tracking-tight);
}
.partner-block-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.partner-tx-pills { margin-bottom: 10px; }
.partner-list { display: flex; flex-direction: column; gap: 0; }
.partner-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.partner-list-item:last-child { border-bottom: none; padding-bottom: 0; }
.partner-list-item:first-child { padding-top: 0; }
.partner-empty {
  font-size: 14px;
  line-height: 1.55;
  color: #a8a8b3;
  font-weight: 500;
  margin: 0;
}

/* ─────────────  МОДЕРАЦИЯ  ───────────── */
.mod-analytics-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mod-analytics-group { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.mod-analytics-group summary { cursor: pointer; font-weight: 700; padding: 4px 0 10px; }
.mod-analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mod-analytics-metric { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--bg); border-radius: 10px; overflow-wrap: anywhere; }
.mod-analytics-metric span { color: var(--muted); font-size: 12px; }
.mod-analytics-switch { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.mod-analytics-switch .btn-outline.active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
#modAnalyticsContent .mod-user-row { width: 100%; margin-top: 8px; overflow-wrap: anywhere; text-align: left; }
.mod-pending-list { display: flex; flex-direction: column; gap: 12px; }
.mod-pending-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.mod-pending-card img,
.mod-pending-card video {
  width: 100%;
  /* Модератор должен видеть весь кадр, а не обрезанные головы/ноги. */
  aspect-ratio: 3 / 4;
  object-fit: contain;
  display: block;
  background: #090908;
}
.mod-pending-meta { padding: 12px 14px; }
.mod-pending-actions { display: flex; gap: 8px; margin-top: 10px; }
.mod-pending-actions .btn-primary { flex: 1; }
.mod-pending-actions .btn-outline { flex: 1; }
#modIdeasList { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px; }
#modIdeasList .mod-published-card { min-width:0; }
#modIdeasList .mod-published-card > :not(.mod-publication-open) { display:none; }
.mod-publication-open { display:block;width:100%;border:0;padding:0;background:#111;cursor:pointer; }
.mod-publication-open img { width:100%;aspect-ratio:3 / 4;object-fit:cover; }
.mod-publication-dialog .mod-publication-open { display:none; }
.mod-publication-dialog > .ui-close { display:grid;margin:0 0 12px auto; }
.mod-publication-dialog .mod-published-card { border:0; }
.mod-publication-dialog .mod-published-actions { flex-wrap:wrap; }
.mod-channel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.mod-channel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mod-channel-head strong { display: block; overflow-wrap: anywhere; }
.mod-channel-id,
.mod-channel-meta,
.mod-channel-active { color: var(--muted); font-size: 12px; line-height: 1.45; }
.mod-channel-id { display: block; margin-top: 2px; }
.mod-channel-active,
.mod-channel-meta { margin: 8px 0 0; overflow-wrap: anywhere; }
.mod-channel-link { display: block; margin-top: 12px; color: var(--accent); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.mod-channel-status { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.mod-channel-status--pending { color: #f5d982; background: rgba(184, 132, 32, .16); }
.mod-channel-status--approved { color: #70d5a2; background: rgba(44, 173, 112, .15); }
.mod-channel-status--rejected { color: #ff9994; background: rgba(214, 77, 68, .14); }
.mod-channel-actions { flex-wrap: wrap; }
.mod-channel-actions .mod-channel-remove { flex: 1 1 100%; }
.mod-published-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mod-published-head .shop-sub { max-width: 560px; margin-bottom: 0; }
.mod-published-card { position: relative; }
.mod-published-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mod-published-kind { flex: 0 0 auto; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; font-weight: 700; }
.mod-published-prompt { margin-top: 7px; font-size: 12px; line-height: 1.45; }
.mod-published-actions .btn-primary,
.mod-published-actions .btn-outline { min-height: 44px; }
.mod-published-actions { flex-wrap: wrap; }
.mod-idea-folders-list { display: grid; gap: 8px; margin: 16px 0; }
.mod-idea-folder-option { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.mod-idea-folder-option input { width: 20px; height: 20px; accent-color: var(--accent); }
.mod-published-actions .mod-feature-action { flex: 1 1 100%; }
.mod-feature-action.is-featured {
  border-color: rgba(225, 181, 81, .7);
  background: rgba(184, 132, 32, .16);
  color: #f5d982;
}
.mod-idea-editor-sheet { max-width: 560px; }
.mod-idea-editor-author { margin: 2px 0 14px; color: var(--muted); font-size: 13px; font-weight: 600; }
.mod-idea-editor-prompt-field { display: grid; gap: 7px; }
.mod-idea-editor-prompt-field textarea { min-height: 170px; resize: vertical; }
.mod-idea-editor-delete { margin-top: 8px; border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); color: var(--danger); }
@media (max-width: 420px) {
  .mod-published-head { display: block; }
  .mod-published-head .mod-library-counter { display: inline-flex; margin-top: 8px; }
}
.mod-home-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.mod-library-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 2px 0 14px;
}
.mod-library-eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}
.mod-library-intro .section-title { margin-bottom: 5px; }
.mod-library-intro .shop-sub { margin-bottom: 0; max-width: 510px; }
.mod-library-counter {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(212,175,55,.34);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(212,175,55,.08);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.mod-library-upload { padding: 16px; }
.mod-library-step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.mod-library-step > span {
  flex: 0 0 auto;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #18150d;
  font-size: 12px;
  font-weight: 800;
}
.mod-library-step strong,
.mod-library-step small { display: block; }
.mod-library-step strong { color: var(--text); font-size: 14px; }
.mod-library-step small { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.mod-library-dropzone {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 15px;
  border-color: rgba(212,175,55,.42);
  background: linear-gradient(135deg, rgba(212,175,55,.1), rgba(255,255,255,.025));
}
.mod-library-dropzone:hover { border-color: var(--accent); }
.mod-library-drop-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(212,175,55,.35);
  border-radius: 14px;
  color: var(--accent);
  background: rgba(0,0,0,.18);
}
.mod-library-drop-copy { min-width: 0; }
.mod-library-drop-copy strong,
.mod-library-drop-copy small { display: block; }
.mod-library-drop-copy strong { color: var(--text); font-size: 14px; }
.mod-library-drop-copy small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.mod-library-queue {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 12px 0;
}
.mod-library-queue-item {
  display: flex;
  width: 100%;
  min-height: 68px;
  align-items: center;
  gap: 7px;
  padding: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.mod-library-queue-item.active { border-color: var(--accent); background: rgba(212,175,55,.08); }
.mod-library-queue-item.is-preparing .mod-library-queue-thumb::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.18) 46%, transparent 67%);
  background-size: 220% 100%;
  animation: mod-library-preview-loading 1.1s linear infinite;
}
@keyframes mod-library-preview-loading { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) {
  .mod-library-queue-item.is-preparing .mod-library-queue-thumb::after { animation: none; }
}
.mod-library-queue-item:focus-within,
.mod-library-dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.mod-library-queue-select {
  display: flex;
  min-width: 0;
  min-height: 54px;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mod-library-queue-select:active { transform: scale(.99); }
.mod-library-queue-thumb {
  position: relative;
  flex: 0 0 auto;
  display: block;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 10px;
  background: #09090b;
}
.mod-library-queue-thumb img,
.mod-library-queue-thumb video { display: block; width: 100%; height: 100%; object-fit: cover; }
.mod-library-file-mark {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: linear-gradient(145deg, rgba(212,175,55,.34), rgba(88,65,217,.35));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
}
.mod-library-video-mark {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
}
.mod-library-queue-copy { min-width: 0; flex: 1; }
.mod-library-queue-copy strong,
.mod-library-queue-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-library-queue-copy strong { color: var(--text); font-size: 13px; font-weight: 650; }
.mod-library-queue-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.mod-library-queue-ready { color: var(--accent); font-size: 11px; font-weight: 700; }
.mod-library-queue-remove {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: var(--muted);
  font: inherit;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.mod-library-queue-remove:active { color: #fff; background: rgba(255,255,255,.08); }
.mod-library-queue-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mod-library-editor {
  margin: 14px 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,.12);
}
.mod-library-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mod-library-fields .field { margin: 0; }
.mod-library-fields .field:only-child { grid-column: 1 / -1; }
.mod-home-preset-field { grid-column: 1 / -1; }
.mod-home-preset-picker { display: flex; gap: 8px; align-items: stretch; }
.mod-home-preset-picker select { min-width: 0; flex: 1; }
.mod-home-new-folder-btn { flex: 0 0 auto; min-height: 48px; padding: 0 12px; white-space: nowrap; }
.mod-home-new-folder { display: grid; gap: 8px; margin-top: 8px; }
.mod-home-new-folder-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; }
.mod-home-new-folder-actions button { min-height: 44px; }
.mod-home-reference-field {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(232, 198, 117, .24);
  border-radius: 14px;
  background: rgba(232, 198, 117, .045);
}
.mod-home-reference-field .mod-library-step { margin-bottom: 0; }
.mod-home-reference-field .btn-outline { min-height: 44px; justify-content: center; }
@media (max-width: 390px) {
  .mod-home-preset-picker { display: grid; grid-template-columns: 1fr; }
  .mod-home-new-folder-btn { width: 100%; }
}
.mod-library-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
@media (max-width: 430px) {
  .mod-library-intro { display: block; }
  .mod-library-counter { display: inline-block; margin-top: 10px; }
  .mod-library-fields { grid-template-columns: 1fr; }
}
.mod-check,
.mod-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  margin: 10px 0;
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.mod-check input,
.mod-check-row input {
  pointer-events: auto;
}
.mod-home-trends {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 10px;
  scrollbar-width: none;
}
.mod-home-trends::-webkit-scrollbar { display: none; }
.mod-trend-pick {
  flex: 0 0 88px;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--surface-2);
}
.mod-trend-pick.selected { border-color: var(--accent); }
.mod-trend-pick img { width: 88px; height: 88px; object-fit: cover; display: block; }
.mod-trend-pick .mod-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
}
.mod-trend-order {
  position: absolute;
  z-index: 2;
  right: 4px;
  bottom: 4px;
  display: inline-flex;
  overflow: hidden;
  border: 1px solid rgba(245, 208, 114, .72);
  border-radius: 999px;
  background: rgba(9, 8, 6, .52);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .24);
}
.mod-trend-move {
  width: 26px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-right: 1px solid rgba(245, 208, 114, .35);
  padding: 0;
  background: transparent;
  color: #fff5d8;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.mod-trend-move:last-child { border-right: 0; }
.mod-trend-move:not(:disabled):hover { background: rgba(235, 185, 75, .24); }
.mod-trend-move:active { transform: none; background: rgba(235, 185, 75, .34); }
.mod-trend-move:disabled { cursor: default; opacity: .32; }
.mod-home-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mod-preset-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--muted);
}
.mod-preset-chip.active {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}
.mod-tab-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1200;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}
.mod-preset-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mod-preset-count { font-size: 14px; flex: 1; min-width: 140px; }
.mod-preset-hint { font-size: 13px; margin: 0; }
.mod-preset-selected {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 8px;
}
.mod-preset-selected-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
}
.mod-preset-selected-cover {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
}
.mod-preset-selected-info { flex: 1; min-width: 0; }
.mod-preset-selected-title { font-size: 14px; font-weight: 600; }
.mod-preset-selected-group { font-size: 12px; color: var(--muted); }
.mod-preset-order-btns { display: flex; gap: 4px; }
.mod-preset-order-btns button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.mod-preset-catalog { display: flex; flex-direction: column; gap: 16px; margin-bottom: 14px; }
.mod-preset-category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.mod-preset-category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}
.mod-preset-category-order { display: grid; grid-template-rows: 1fr 1fr; gap: 4px; }
.mod-preset-category-order .mod-preset-order {
  width: 30px;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}
.mod-preset-category-order .mod-preset-order:disabled { opacity: .35; cursor: default; }
.mod-preset-category-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  text-align: left;
  padding: 0;
  cursor: pointer;
}
.mod-preset-category-card:active { transform: scale(0.98); }
.mod-preset-category-cover {
  aspect-ratio: 3/4;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: var(--surface2);
}
.mod-preset-category-cover--photo { font-size: 0; }
.mod-preset-category-body { padding: 10px 12px 12px; }
.mod-preset-category-title { font-size: 14px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.mod-preset-category-meta { font-size: 11px; color: var(--muted); line-height: 1.35; }
.mod-preset-category-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mod-preset-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}
.mod-preset-badge--accent { color: var(--accent); background: rgba(124,92,255,0.12); }
.mod-preset-category-detail { margin-bottom: 14px; }
.mod-preset-back {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  padding: 0 0 12px;
  cursor: pointer;
}
.mod-preset-category-head {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--surface);
}
.mod-preset-category-head-top { display: flex; gap: 12px; align-items: flex-start; }
.mod-preset-category-head-cover {
  width: 72px;
  aspect-ratio: 3/4;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: var(--surface2);
}
.mod-preset-category-head-info { flex: 1; min-width: 0; }
.mod-preset-category-head-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.mod-preset-category-head-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mod-preset-group-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--muted);
}
.mod-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.mod-preset-card {
  position: relative;
  border: 2px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
  padding: 0;
  background: var(--surface-2);
  min-height: 108px;
}
.mod-preset-card.selected { border-color: var(--accent); box-shadow: var(--glow); }
.mod-preset-card-cover {
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 28px;
}
.mod-preset-card-body { padding: 8px 10px 10px; }
.mod-preset-card-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.mod-preset-card-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1200;
  font-size: 12px;
  font-weight: 700;
  display: none;
  place-items: center;
}
.mod-preset-card.selected .mod-preset-card-check { display: grid; }
.mod-preset-card-main {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
}
.mod-preset-help {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.mod-preset-help strong { color: var(--text); display: block; margin-bottom: 6px; }
.mod-preset-help p { margin: 0 0 6px; }
.mod-preset-help p:last-child { margin-bottom: 0; }
.mod-preset-group-meta { font-size: 12px; color: var(--muted); margin: -4px 0 8px; }
.mod-preset-examples-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mod-preset-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
}
.mod-preset-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.mod-preset-group-head .mod-preset-group-title { flex: 1; margin: 0; }
.mod-preset-group-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mod-preset-card-actions {
  display: flex;
  gap: 4px;
  padding: 0 8px 8px;
}
.mod-preset-card-actions button {
  flex: 1;
  min-width: 0;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
}
.mod-preset-card-actions .mod-preset-order { flex: 0 0 31px; font-size: 15px; }
.mod-preset-card.disabled { opacity: 0.55; }
.mod-preset-card.disabled .mod-preset-card-title::after {
  content: " · выкл";
  color: var(--muted);
  font-weight: 400;
}
.mod-preset-sheet .mod-preset-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.mod-preset-sheet .field-label { font-size: 13px; color: var(--muted); }
.mod-preset-sheet .field-input,
.mod-preset-sheet select,
.mod-preset-sheet textarea {
  min-height: 48px;
  font-size: 16px;
  line-height: 1.4;
}
.mod-preset-prompt {
  min-height: 200px !important;
  max-height: 54dvh;
  resize: vertical;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mod-preset-form-intro {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  line-height: 1.45;
}
.mod-preset-form-intro strong { display: block; margin-bottom: 4px; }
.mod-preset-form-intro p { margin: 0; font-size: 13px; color: var(--muted); }
.mod-preset-cover-upload,
.mod-preset-upload-step { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.mod-preset-cover-preview {
  width: 100%;
  min-height: 112px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}
.mod-preset-cover-preview:disabled { opacity: .7; cursor: wait; }
.mod-preset-cover-placeholder { font-size: 14px; color: var(--muted); }
.mod-preset-cover-placeholder[data-ix] { display: inline-flex; align-items: center; gap: 8px; }
.mod-preset-cover-placeholder[data-ix] svg { width: 20px; height: 20px; }
.mod-preset-advanced {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px 10px;
}
.mod-preset-advanced summary { padding: 10px 0; color: var(--muted); font-size: 13px; cursor: pointer; }
.mod-preset-settings { display: grid; grid-template-columns: 1fr; gap: 8px; padding-top: 4px; }
.mod-preset-format-field,
.mod-preset-prompt-field { display: flex; flex-direction: column; gap: 6px; }
/* Плашка скрытого промпта тренда (как у референса) */
.prompt-hidden-notice {
  background: #1c1c22;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.prompt-hidden-notice.hidden { display: none !important; }
.prompt-hidden-notice .prompt-lock {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--accent);
}
.prompt-hidden-notice .prompt-lock svg {
  display: block;
  width: 18px;
  height: 18px;
}
.prompt-hidden-notice .prompt-hidden-text {
  flex: 1;
  color: #b8b8c2;
  font-weight: 400;
  letter-spacing: 0.01em;
}
#promptBlock.prompt-block--hidden {
  margin-top: 4px;
}
#promptBlock.prompt-block--hidden .block-title,
#promptBlock.prompt-block--hidden #prompt,
#promptBlock.prompt-block--hidden #promptCounterWrap {
  display: none !important;
}
.prompt-variables {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(232, 198, 117, .23);
  border-radius: 14px;
  background: rgba(232, 198, 117, .07);
}
.prompt-variables-title { margin: 0; color: #fff2cf; font-size: 14px; font-weight: 700; }
.prompt-variables-copy { margin: 4px 0 10px; color: rgba(255, 245, 220, .64); font-size: 12px; line-height: 1.35; }
.prompt-variables-fields { display: grid; gap: 8px; }
.prompt-variable-field { display: grid; grid-template-columns: minmax(96px, .5fr) minmax(0, 1fr); gap: 10px; align-items: center; color: rgba(255, 245, 220, .78); font-size: 13px; font-weight: 650; }
.prompt-variable-field .field-input { min-width: 0; background: rgba(0, 0, 0, .22); }
@media (max-width: 480px) {
  .video-recipe-editor-variable { grid-template-columns: 1fr 1fr; }
  .video-recipe-editor-variable-remove { grid-column: span 2; }
}
.mod-user-search {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.mod-user-search .field-input { flex: 1; }
.mod-user-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mod-user-head { display: flex; flex-direction: column; gap: 4px; }
.mod-user-name { font-size: 17px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mod-user-meta { font-size: 13px; color: var(--muted); }
.mod-user-head-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.mod-user-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.18);
  color: var(--accent);
}
.mod-user-badge--danger {
  background: rgba(255, 69, 58, 0.18);
  color: #ff453a;
}
.mod-user-row--blocked .mod-user-row-name { color: #ff453a; }
.mod-user-row-name em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 500; }
.mod-user-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.mod-user-stat {
  background: var(--surface);
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
}
.mod-user-stat strong { display: block; font-size: 15px; margin-top: 4px; }
.mod-user-form { display: flex; flex-direction: column; gap: 8px; }
.mod-user-form-row { display: flex; gap: 8px; align-items: center; }
.mod-user-form-row .field-input { flex: 1; }
.mod-wd-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.mod-wd-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.mod-wd-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.mod-wd-amount { font-size: 18px; font-weight: 700; color: var(--accent); }
.mod-wd-user { font-size: 14px; font-weight: 600; }
.mod-wd-meta { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.mod-wd-actions { display: flex; gap: 8px; margin-top: 10px; }
.mod-wd-actions button { flex: 1; }
.mod-pending-meta .mod-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ─────────────────────────────────────────────────────────────────────────
   LUMIX STUDIO · 2026 PRODUCT SYSTEM
   A quiet, image-led creative operating system. This layer intentionally
   normalizes legacy screens behind one set of surface, type, spacing and
   motion tokens.
   ───────────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg: #090a10;
  --bg-soft: #10111a;
  --surface: #141622;
  --surface-2: #1a1d2b;
  --surface-3: #222638;
  --line: rgba(222, 224, 255, .075);
  --line-strong: rgba(222, 224, 255, .14);
  --text: #f5f5fa;
  --text-secondary: #d0d1dc;
  --muted: #9396aa;
  --accent: #b4adff;
  --accent-2: #8d81ee;
  --accent-grad: linear-gradient(135deg, #e2e0ff 0%, #b2aaff 50%, #9183f5 100%);
  --accent-ink: #151426;
  --accent-soft: rgba(180, 173, 255, .13);
  --accent-line: rgba(191, 186, 255, .3);
  --accent-glow: rgba(157, 143, 255, .22);
  --radius: 22px;
  --radius-sm: 16px;
  --nav-h: 76px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .32);
  --glow: 0 10px 30px rgba(126, 111, 245, .22);
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --text-2xs: 10px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 17px;
  --text-lg: 20px;
  --text-xl: 26px;
  --text-2xl: 32px;
  --leading-tight: 1.08;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.62;
  --tracking-tight: -.045em;
  --tracking-normal: -.018em;
  --tracking-label: .055em;
  --tracking-caps: .12em;
}

html { background: var(--bg); scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(80vw 48vw at 100% -12%, rgba(98, 83, 210, .16), transparent 62%),
    radial-gradient(68vw 42vw at -18% 48%, rgba(76, 100, 178, .10), transparent 65%),
    var(--bg);
  font-size: var(--text-base);
  letter-spacing: var(--tracking-normal);
}

.skip-link {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  z-index: 200;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  color: var(--accent-ink);
  background: var(--accent-grad);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}
.skip-link:focus-visible {
  width: auto;
  height: auto;
  padding: 10px 14px;
  overflow: visible;
  clip: auto;
  outline: 2px solid #fff;
  outline-offset: 2px;
}
#appMain:focus { outline:none; }
#appMain:focus-visible { outline:2px solid var(--accent);outline-offset:-2px; }
:where(button, a, input, textarea, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button { touch-action: manipulation; }
button:disabled { cursor: not-allowed; }

.brand, .brand-name, .hero-title, .profile-name, .publish-title,
.model-banner-title, .ad-title, .ad-code { font-family: var(--font-display); }
.section-title, .page-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}
.section-title {
  margin: 8px 0 7px;
  font-size: 20px;
  line-height: 1.12;
}
.shop-sub, .subtitle { color: var(--muted); font-size: 13px; line-height: 1.52; }
.page-intro { margin: 7px 0 20px; max-width: 560px; }
.page-intro .shop-sub { margin: 9px 0 0; max-width: 470px; }
.page-kicker, .chat-eyebrow, .hero-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.2;
}
.page-title { margin: 0; font-size: clamp(28px, 7.7vw, 43px); line-height: .99; }

.topbar {
  min-height: 74px;
  padding: calc(var(--chrome-top) + 10px) max(16px, env(safe-area-inset-left)) 12px;
  gap: 9px;
  background: rgba(9, 10, 16, .75);
  border-bottom: 1px solid rgba(230, 232, 255, .07);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}
.brand { gap: 9px; }
.brand-logo-wrap {
  width: 39px;
  height: 39px;
  padding: 2px;
  border: 1px solid rgba(225, 222, 255, .22);
  background: linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.025));
  box-shadow: 0 8px 25px rgba(0, 0, 0, .24);
}
.brand-logo { border-radius: 11px; }
.brand-name { color: var(--text); font-size: 17px; font-weight: 750; letter-spacing: -.055em; }
.brand-caption { margin-top: 3px; color: #9e9db2; font-size: 8px; letter-spacing: .15em; }
.topbar-actions { gap: 7px; }
.topbar-back, .modal-close, .icon-btn {
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.045);
  color: var(--text-secondary);
}
.topbar-back { width: 40px; height: 40px; border-radius: 14px; }
.buy-pill {
  min-height: 38px;
  padding: 9px 13px;
  color: var(--accent-ink);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 750;
  box-shadow: 0 7px 20px rgba(109, 93, 231, .18);
}
.balance-chip {
  min-height: 38px;
  gap: 5px;
  padding: 8px 10px;
  border-color: var(--line-strong);
  background: rgba(255,255,255,.045);
  font-size: 12px;
  font-weight: 700;
}

/* Language lives in the header as a compact, touch-safe control.  It follows
   the same translucent chrome as balance so it reads as a setting, not CTA. */
.language-button {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.language-button:active { transform: scale(.96); }
.language-button-icon { display: inline-grid; place-items: center; }
.language-sheet { max-width: 380px; }
.language-current { margin: -2px 0 14px; color: var(--muted); font-size: 13px; }
.language-options { display: grid; gap: 8px; }
.language-option {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.language-option[aria-checked="true"] {
  border-color: rgba(224, 187, 104, .7);
  background: linear-gradient(135deg, rgba(213, 170, 80, .14), rgba(255,255,255,.04));
  color: #fbf2d7;
}
.language-option:active { transform: scale(.985); }
.language-option-check { opacity: 0; color: #e0bb68; }
.language-option[aria-checked="true"] .language-option-check { opacity: 1; }
.language-button:focus-visible,
.language-option:focus-visible {
  outline: 2px solid #e0bb68;
  outline-offset: 2px;
}

@media (max-width: 390px) {
  .language-button { min-width: 38px; min-height: 38px; padding: 7px; }
  .language-button-icon { display: none; }
}

.app {
  max-width: 760px;
  padding: 17px max(16px, env(safe-area-inset-left)) calc(var(--nav-h) + var(--chrome-bottom) + 28px);
}
.view { animation: lumix-view-in .34s cubic-bezier(.16, 1, .3, 1); }
@keyframes lumix-view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Home · editorial campaign rather than an app carousel */
.home-banners { margin-bottom: 26px; }
.home-banner-track { gap: 14px; scroll-padding: 1px; }
.home-banner {
  min-height: 278px;
  padding: 20px;
  border: 1px solid rgba(226, 228, 255, .14);
  border-radius: 26px;
  background-color: #12131d;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .23);
  transition: transform .25s cubic-bezier(.16,1,.3,1), border-color .25s ease, box-shadow .25s ease;
}
.home-banner:hover { border-color: rgba(212, 208, 255, .35); box-shadow: 0 20px 55px rgba(0, 0, 0, .33); }
.home-banner:active { transform: scale(.987); }
.home-banner--video, .home-brand-hero {
  min-height: 352px;
  padding: 0;
  background-image: url("/shop/assets/lumix-studio-v3.png?v=1");
  background-position: center 57%;
}
.home-banner-motion { display: none; }
.home-banner--video .hb-text, .home-brand-hero .hb-text {
  max-width: min(82%, 540px);
  padding: 72px 24px 0;
}
.home-brand-hero .hb-title, .hb-title {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 7.2vw, 42px);
  font-weight: 750;
  letter-spacing: -.06em;
  line-height: .98;
  text-shadow: 0 5px 30px rgba(0,0,0,.55);
}
.hb-sub, .home-banner--video .hb-sub {
  max-width: 338px;
  margin: 12px 0 0;
  color: rgba(242,243,255,.79);
  font-size: 13px;
  line-height: 1.42;
}
.hb-kicker { margin-bottom: 11px; color: #d2ceff; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.hb-brand {
  top: 17px;
  left: 19px;
  gap: 8px;
  color: rgba(255,255,255,.9);
  font-size: 11px;
  font-weight: 700;
}
.hb-brand img { width: 22px; height: 22px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.32)); }
.home-brand-actions {
  right: 20px;
  bottom: 20px;
  left: 20px;
  gap: 9px;
}
.home-brand-hero .hb-cta, .hb-cta {
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 13px;
  color: var(--accent-ink);
  background: var(--accent-grad);
  box-shadow: 0 10px 28px rgba(44, 34, 121, .26);
  font-size: 12px;
  font-weight: 750;
  transition: transform .18s ease, filter .18s ease;
}
.home-brand-actions .hb-cta:last-child { color: #f7f7ff; border-color: rgba(255,255,255,.17); background: rgba(12,13,22,.58); backdrop-filter: blur(12px); }
.hb-cta:active { transform: scale(.96); filter: brightness(.96); }
.hb-overlay {
  background: linear-gradient(90deg, rgba(7,8,14,.89) 0%, rgba(7,8,14,.48) 48%, rgba(7,8,14,.09) 100%), linear-gradient(0deg, rgba(7,8,14,.54), transparent 62%);
}
.home-banner--chat {
  min-height: 300px;
  align-items: flex-end;
  background-image: url("/shop/assets/lumix-prompt-v2.png?v=1");
  background-position: 72% center;
}
.home-banner--image {
  min-height: 300px;
  align-items: flex-end;
  background-image: url("/shop/assets/lumix-image-v2.png?v=1");
  background-position: 70% center;
}
.home-banner--partner {
  min-height: 300px;
  align-items: flex-start;
  background-image: url("/shop/assets/lumix-studio-v3.png?v=1");
  background-position: 65% center;
}
.home-banner--chat .hb-text, .home-banner--image .hb-text, .home-banner--partner .hb-text { max-width: min(76%, 365px); }
.home-banner--partner .hb-text { padding-top: 52px; }
.home-banner--chat .hb-title, .home-banner--image .hb-title, .home-banner--partner .hb-title { font-size: clamp(24px, 6.6vw, 34px); }
.home-banner--chat .hb-cta, .home-banner--image .hb-cta { right: 18px; bottom: 18px; }
.home-banner--partner .hb-cta { top: 17px; right: 17px; bottom: auto; }
.home-banner--image .hb-overlay { background: linear-gradient(90deg, rgba(8,9,16,.9) 0%, rgba(8,9,16,.58) 50%, rgba(8,9,16,.12) 100%), linear-gradient(0deg, rgba(8,9,16,.52), transparent 60%); }
.hb-levels { bottom: 18px; left: 18px; right: 18px; gap: 7px; }
.hb-levels > span {
  min-height: 58px;
  padding: 9px;
  border-color: rgba(209,205,255,.22);
  border-radius: 12px;
  background: rgba(9,10,16,.56);
  backdrop-filter: blur(12px);
}
.hb-levels b { color: #f0efff; font-size: 17px; }
.hb-levels small { color: #aeb0c2; font-size: 9px; }
.home-banner-dots { min-height: 34px; gap: 4px; margin-top: 7px; }
.home-banner-dot::after { width: 6px; height: 6px; background: rgba(215,215,240,.32); }
.home-banner-dot.active::after { width: 23px; background: var(--accent); }

.home-shortcuts-head { margin: 0 0 13px; }
.home-shortcuts-head h2 { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: var(--tracking-tight); }
.home-shortcuts-all { min-height: 40px; color: var(--accent); font-size: 12px; font-weight: 700; }
.home-shortcuts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 0 27px;
  margin: 0;
}
.home-shortcut { gap: 8px; text-align: left; align-items: stretch; }
.home-shortcut-tile {
  aspect-ratio: 1.22;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: linear-gradient(140deg, rgba(185,177,255,.17), rgba(20,22,34,.92) 58%);
  box-shadow: inset 0 1px rgba(255,255,255,.09), 0 8px 20px rgba(0,0,0,.15);
}
.home-shortcut-tile::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 18%, rgba(203,198,255,.24), transparent 43%); pointer-events: none; }
.home-shortcut-icon { width: 70%; height: 70%; margin: auto; object-fit: contain; }
.home-shortcut-label { min-height: 0; color: #d9dae5; font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; }
.trends-head { margin: 0 0 13px; }
.trends-head .section-title { margin: 0 0 5px; }
.trends-head .link-btn { color: var(--accent); font-size: 12px; font-weight: 700; }
.trends-scroller { gap: 12px; padding-bottom: 4px; }

/* Galleries and works · content is the hero, the interface becomes quiet */
.gallery-grid, .history-grid, .work-grid { gap: 12px; }
.gallery-card, .history-card, .work-card {
  border: 1px solid rgba(230,232,255,.105);
  border-radius: 18px;
  background: #101119;
  box-shadow: 0 10px 26px rgba(0,0,0,.17);
  transition: transform .24s cubic-bezier(.16,1,.3,1), border-color .24s ease, box-shadow .24s ease;
}
.gallery-card:hover, .history-card:hover, .work-card:hover { border-color: rgba(205,201,255,.27); box-shadow: 0 16px 35px rgba(0,0,0,.27); }
.gallery-card:active, .history-card:active, .work-card:active { transform: scale(.975); }
/* Открытие работы не должно сначала зрительно менять её формат. Особенно на
   iPhone этот общий press-scale выглядит как скачок/кроп слева и справа. */
#view-ideas .gallery-card,
#view-trends .gallery-card { touch-action: manipulation; }
#view-ideas .gallery-card:active,
#view-trends .gallery-card:active { transform: none; }
.gallery-card { aspect-ratio: .78; }
.history-card, .work-card { aspect-ratio: .78; }
.gallery-card > img, .gallery-card > .card-preview-poster, .gallery-card > video.card-preview-video,
.history-card img, .history-card video.card-preview-video,
.work-card img, .work-card .card-preview-poster, .work-card video.card-preview-video { transition: transform .45s cubic-bezier(.16,1,.3,1); }
.gallery-card:hover > img, .gallery-card:hover > .card-preview-poster, .history-card:hover img, .work-card:hover img { transform: scale(1.035); }
.gc-overlay { background: linear-gradient(180deg, rgba(6,7,12,.04) 38%, rgba(6,7,12,.84) 100%); }
.gc-tag, .history-tag, .work-badge {
  top: 9px;
  left: 9px;
  right: auto;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(8,9,14,.52);
  border-radius: 999px;
  backdrop-filter: blur(9px);
  color: #eff0fb;
  font-size: 10px;
  font-weight: 650;
}
.gc-author, .gc-author-btn { bottom: 10px; left: 10px; font-size: 11px; }
.gc-like, .gc-repeat, .history-share, .trend-share, .gc-share, .work-share {
  width: 38px; height: 38px;
  border-color: rgba(255,255,255,.18);
  background: rgba(9,10,16,.66);
}
.gc-share { right: 8px; bottom: 47px; }
.history-share, .work-share { right: 8px; bottom: 8px; }
.history-card-play, .work-play, .gallery-card .work-play { background: linear-gradient(180deg, transparent, rgba(0,0,0,.34)); }
.filter-pills { gap: 8px; margin: 0 0 18px; overflow-x: auto; padding: 0 0 2px; scrollbar-width: none; }
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pill {
  flex: 0 0 auto;
  min-height: 39px;
  padding: 9px 13px;
  border-color: var(--line-strong);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  color: #bbbccc;
  font-size: 12px;
  font-weight: 600;
}
.filter-pill.active { color: var(--accent-ink); border-color: rgba(255,255,255,.42); background: var(--accent-grad); box-shadow: 0 7px 20px rgba(106,91,236,.2); }
.empty-state { min-height: 260px; padding: 38px 20px; border: 1px dashed var(--line-strong); border-radius: 20px; background: rgba(255,255,255,.018); }
.empty-emoji { font-size: 32px; filter: grayscale(1); opacity: .55; }
.info-banner {
  margin: -4px 0 18px;
  padding: 14px 15px;
  border: 1px solid rgba(185,177,255,.17);
  border-radius: 16px;
  background: linear-gradient(112deg, rgba(134,119,245,.13), rgba(255,255,255,.025));
  color: #c7c8d5;
  font-size: 12px;
  line-height: 1.55;
}

/* Create is a composed workspace entry, not a collection of generic tiles. */
.hero {
  min-height: 238px;
  padding: 24px;
  margin-bottom: 18px;
  border: 1px solid rgba(226,228,255,.14);
  border-radius: 24px;
  background-image: url("/shop/assets/lumix-studio-v3.png?v=1") !important;
  background-position: center 53%;
  box-shadow: 0 16px 40px rgba(0,0,0,.21);
}
.hero-overlay { background: linear-gradient(90deg, rgba(8,9,15,.83), rgba(8,9,15,.2) 77%), linear-gradient(0deg, rgba(8,9,15,.58), transparent 70%); }
.hero-text { max-width: 360px; }
.hero-eyebrow { margin-bottom: 9px; }
.hero-title { color: #fff; font-size: clamp(27px, 7.6vw, 40px); font-weight: 750; letter-spacing: -.06em; line-height: .99; text-transform: none; }


.model-banners { gap: 12px; }
.model-banner {
  min-height: 152px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
}
.model-banner::after { background: linear-gradient(90deg, rgba(9,10,16,.88), rgba(9,10,16,.42) 67%, rgba(9,10,16,.12)); }
.model-banner-title { font-size: 23px; font-weight: 750; letter-spacing: -.05em; }
.model-banner-subtitle { margin-top: 7px; color: rgba(243,244,255,.72); font-size: 12px; }
.model-provider-label { margin: 8px 1px 1px; color: #999aae; font-size: 10px; letter-spacing: .12em; }

/* Conversations, forms, sheets and feedback share the same highly legible surface. */
.chat-head { margin: 4px 0 20px; }
.chat-title { color: var(--text); font-size: clamp(27px, 7.2vw, 40px); font-weight: 750; letter-spacing: -.06em; line-height: 1.02; }
.chat-subtitle { max-width: 390px; margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.chat-reset { width: 44px; height: 44px; border-radius: 14px; border-color: var(--line-strong); background: rgba(255,255,255,.045); }
.chat-model-row { min-height: 46px; margin-bottom: 17px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.chat-model { border-color: var(--line-strong); border-radius: 12px; background-color: rgba(255,255,255,.045); }
.chat-cost { color: var(--accent); font-weight: 700; }
.chat-empty { min-height: 250px; border-radius: 20px; border-color: var(--line-strong); background: rgba(255,255,255,.018); }
.chat-bubble { padding: 13px 15px; border-radius: 17px; font-size: 14px; line-height: 1.55; }
.chat-bubble.user { color: var(--accent-ink); background: var(--accent-grad); }
.chat-bubble.assistant { border-color: var(--line-strong); background: rgba(255,255,255,.045); }
.chat-compose {
  border-color: rgba(216,213,255,.2);
  border-radius: 18px;
  background: rgba(21,23,34,.91);
  box-shadow: 0 12px 30px rgba(0,0,0,.33);
}
.chat-send { border-radius: 13px; color: var(--accent-ink); box-shadow: 0 6px 16px rgba(115,99,244,.24); }
.sheet, .modal { background: rgba(4,5,10,.72); backdrop-filter: blur(7px); }
.sheet-body, .modal-sheet {
  border-color: rgba(226,228,255,.13);
  background: #12141f;
  box-shadow: 0 -20px 60px rgba(0,0,0,.35);
}
.sheet-body { border-radius: 27px 27px 0 0; padding-right: 18px; padding-left: 18px; }
.sheet-head { background: #12141f; }
.sheet-body::before { width: 38px; height: 4px; background: rgba(235,236,255,.26); }
.sheet-foot { border-color: var(--line); background: #12141f; }
.modal-sheet { border-radius: 22px; }
.dropzone, .prompt, .field input, .field-input, .profile-select, .chat-model {
  border-color: var(--line-strong);
  background-color: rgba(255,255,255,.035);
}
.dropzone { padding: 22px; border-radius: 16px; }
.prompt { min-height: 124px; padding: 15px; border-radius: 16px; font-size: 15px; }
.prompt:focus, .field input:focus, .field-input:focus, .profile-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(180,173,255,.12); }
.chips, .aspect-grid { gap: 8px; }
.chip, .aspect-cell { min-height: 42px; border-color: var(--line-strong); background: rgba(255,255,255,.035); }
.chip.active, .aspect-cell.active { color: var(--accent-ink); background: var(--accent-grad); }
.btn-primary {
  min-height: 48px;
  padding: 13px 17px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 14px;
  color: var(--accent-ink);
  box-shadow: 0 10px 26px rgba(108,92,236,.23);
  font-size: 14px;
  font-weight: 750;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.btn-primary:hover { box-shadow: 0 13px 32px rgba(108,92,236,.33); filter: brightness(1.03); }
.btn-primary:active { transform: scale(.982); }
.btn-outline { min-height: 44px; border-color: var(--line-strong); border-radius: 13px; background: rgba(255,255,255,.035); }

/* Purchase flow: plan choice is clear, confident and not price-first noise. */
.plans { gap: 10px; margin-bottom: 24px; }
.plan {
  position: relative;
  padding: 17px;
  overflow: hidden;
  border-color: var(--line-strong);
  border-radius: 19px;
  background: linear-gradient(135deg, rgba(255,255,255,.065), rgba(255,255,255,.026));
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
}
.plan::before { content: ""; position: absolute; inset: 0; opacity: 0; background: radial-gradient(85% 120% at 100% 0%, rgba(186,180,255,.2), transparent 58%); transition: opacity .22s ease; pointer-events: none; }
.plan > * { position: relative; z-index: 1; }
.plan.selected { border-color: rgba(215,211,255,.7); box-shadow: 0 0 0 3px rgba(172,163,255,.12), 0 15px 35px rgba(75,61,179,.2); }
.plan.selected::before { opacity: 1; }
.plan-tier { font-size: 15px; letter-spacing: -.02em; }
.plan-badge { color: var(--accent-ink); background: var(--accent-grad); }
.plan-volume { font-size: 24px; letter-spacing: -.05em; }
.plan-price, .plan-loki-price strong { color: #dedbff; font-size: 21px; letter-spacing: -.04em; }
.plan-tagline, .plan-old { color: var(--muted); }
.plan-details { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.025); }
.plan-details-title { font-size: 15px; }
.plan-highlights { gap: 10px; }
.plan-highlights li { padding-left: 25px; font-size: 13px; }
.plan-highlights li.included::before { color: var(--accent); }
.checkout-panel { padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.025); }
.pay-methods { gap: 8px; }
.pay-method { min-height: 72px; padding: 12px; border-color: var(--line-strong); border-radius: 14px; background: rgba(255,255,255,.035); }
.pay-method.active { border-color: var(--accent); background: rgba(178,169,255,.11); box-shadow: 0 0 0 2px rgba(178,169,255,.1); }
.pay-method-title { font-size: 12px; }
.pay-method-sub { margin-top: 3px; font-size: 10px; }
.checkout-toggle { min-height: 48px; border-color: var(--line-strong); border-radius: 14px; background: rgba(255,255,255,.035); }
.legal { color: var(--muted); font-size: 11px; }

/* Profile: a studio identity, not a settings stack. */
/* The former purple decorative glow here looked like a stuck selection state
   during navigation in Telegram. Profile states use the gold controls only. */
.profile-section-tabs { margin: 1px 0 22px; }
.profile-head { gap: 16px; margin: 9px 0 17px; }
.profile-avatar {
  width: 84px; height: 84px;
  border: 1px solid rgba(230,232,255,.32);
  box-shadow: 0 0 0 5px rgba(183,174,255,.1), 0 13px 30px rgba(0,0,0,.28);
}
.profile-stats { gap: 12px; }
.profile-stat strong { font-size: 20px; letter-spacing: -.05em; }
.profile-stat small { color: var(--muted); font-size: 10px; }
.profile-name { font-size: 28px; font-weight: 750; letter-spacing: -.06em; }
.profile-badge { padding: 5px 9px; border-color: var(--line-strong); background: rgba(255,255,255,.045); color: #d7d6e6; font-size: 11px; }
.profile-bio { margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.profile-balance-row, .account-card, .partner-card, .partner-block-card {
  border-color: var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.024));
  box-shadow: 0 11px 28px rgba(0,0,0,.13);
}
.profile-balance-row { padding: 12px; }
.profile-balance-label { color: var(--muted); font-size: 12px; }
.profile-balance-row strong { margin-right: auto; font-variant-numeric: tabular-nums; }
.profile-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 23px; }
.profile-actions #profileFollowBtn { grid-column: 1 / -1; }
.profile-actions .profile-quick-action {
  width: 100%;
  min-height: 64px;
  height: auto;
  padding: 7px 4px;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;
}
.profile-quick-action > span:first-child { display: grid; place-items: center; min-height: 20px; }
.profile-showcase-edit { border-color: var(--line-strong); border-radius: 13px; background: rgba(255,255,255,.035); }
.profile-pinned-label { color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }

/* A persistent but deliberately quiet navigation rail. */
.bottom-nav {
  left: 50%;
  width: min(760px, 100%);
  height: calc(var(--bottom-nav-height) + var(--bottom-safe-area));
  transform: translateX(-50%);
  border: 1px solid rgba(226,228,255,.1);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: rgba(15,16,25,.82);
  box-shadow: 0 -14px 38px rgba(0,0,0,.25);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
}
.nav-item { min-height: 52px; gap: 4px; color: #85889a; font-size: 10px; font-weight: 600; transition: color .18s ease, transform .18s ease; }
.nav-item.active { color: #dfdcff; }
.nav-item.active .nav-ico { color: var(--accent); }
.nav-ico svg { width: 21px; height: 21px; }
.nav-center .nav-plus {
  width: 51px; height: 51px;
  margin-top: -22px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 17px;
  box-shadow: 0 12px 28px rgba(99,82,229,.36);
}
.nav-center .nav-plus svg { width: 24px; height: 24px; }
.nav-center:active .nav-plus { transform: scale(.93); }

@media (min-width: 640px) {
  .app { padding-right: 28px; padding-left: 28px; }
  .topbar { padding-right: 28px; padding-left: 28px; }
  .home-banner--video, .home-brand-hero { min-height: 390px; }
  .home-banner--video .hb-text, .home-brand-hero .hb-text { padding: 82px 32px 0; }
  .home-brand-actions { right: 32px; bottom: 26px; left: 32px; }
  .home-shortcuts { grid-template-columns: repeat(6, 1fr); }
  .home-shortcut-tile { aspect-ratio: 1; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .history-grid, .work-grid { grid-template-columns: repeat(3, 1fr); }
  .pay-methods { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 390px) {
  .topbar { gap: 6px; }
  .brand-logo-wrap { width: 35px; height: 35px; }
  .brand-name { font-size: 16px; }
  .balance-chip { padding: 8px; }
  .buy-pill { min-width: 38px; padding: 9px 11px; }
  .home-banner--video, .home-brand-hero { min-height: 335px; }
  .home-brand-hero .hb-text { padding: 66px 20px 0; }
  .home-brand-actions { right: 16px; bottom: 16px; left: 16px; }
  .home-brand-hero .hb-cta { padding: 10px 11px; font-size: 11px; }
  .home-banner--chat, .home-banner--image, .home-banner--partner { min-height: 280px; }
  .page-title { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ─────────────  FINAL SYSTEM PASS: LUMIX OPTICS  ─────────────
   Semantic tokens keep the production interface coherent: lavender is the
   action colour; gold remains reserved for the mark and the Lumix currency. */
:root {
  --color-background: #090a12;
  --color-background-soft: #10121d;
  --color-surface: #161825;
  --color-surface-elevated: #1d2030;
  --color-text-primary: #f5f5fb;
  --color-text-secondary: #cacbd8;
  --color-text-muted: #9b9dac;
  --color-accent: #d7a950;
  --color-accent-pressed: #ad741e;
  --color-success: #61c89a;
  --color-warning: #efbd66;
  --color-error: #ff7886;
  --color-border: rgba(232, 233, 255, 0.09);
  --color-divider: rgba(232, 233, 255, 0.06);
  --color-overlay: rgba(5, 6, 13, 0.72);
  --brand-gold: #d7a950;
  --brand-gold-grad: linear-gradient(135deg, #f1d486, #c28a2d);
  --bg: var(--color-background);
  --bg-soft: var(--color-background-soft);
  --surface: var(--color-surface);
  --surface-2: var(--color-surface-elevated);
  --text: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --muted: var(--color-text-muted);
  --line: var(--color-divider);
  --line-strong: var(--color-border);
  --accent: var(--color-accent);
  --accent-2: var(--color-accent-pressed);
  --accent-grad: var(--brand-gold-grad);
  --accent-ink: #211605;
  --accent-soft: rgba(215, 169, 80, 0.14);
  --accent-line: rgba(241, 212, 134, 0.34);
  --accent-glow: rgba(194, 138, 45, 0.24);
  --danger: var(--color-error);
  --shadow-1: 0 8px 24px rgba(0, 0, 0, 0.16);
  --shadow-2: 0 16px 40px rgba(0, 0, 0, 0.24);
  --glow: 0 10px 28px rgba(194, 138, 45, 0.22);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --radius-control: 14px;
  --duration-fast: 150ms;
  --duration-base: 220ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

html { min-height: 100%; background: var(--color-background); }
body { min-height: 100dvh; overflow-x: hidden; text-size-adjust: 100%; }
.brand-name { background: var(--brand-gold-grad); -webkit-background-clip: text; background-clip: text; }

button, a, input, select, textarea { touch-action: manipulation; }
:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
.section-title--spaced { margin-top: var(--space-6); }

/* Four distinct but related compositions: studio, prompt, image and network. */
.home-banner-carousel { position: relative; }
.home-banner--video, .home-brand-hero {
  background-image: url("/shop/assets/lumix-studio-v3.png?v=1");
  background-position: 72% 50%;
}
.home-banner--chat {
  background-image: url("/shop/assets/lumix-prompt-v2.png?v=1");
  background-position: 73% 50%;
}
.home-banner--image {
  background-image: url("/shop/assets/lumix-image-v2.png?v=1");
  background-position: 72% 50%;
}
.home-banner--partner {
  background-image: url("/shop/assets/lumix-partners-v1.jpg?v=1");
  background-position: 70% 50%;
}
.home-banner--partner .hb-overlay {
  background: linear-gradient(90deg, rgba(7, 8, 17, 0.94) 0%, rgba(7, 8, 17, 0.72) 43%, rgba(7, 8, 17, 0.16) 100%), linear-gradient(0deg, rgba(7, 8, 17, 0.48), transparent 65%);
}
.home-banner--partner .hb-text { max-width: min(62%, 330px); }
.home-banner--partner .hb-sub { max-width: 290px; }
.home-banner-dots { min-height: 44px; padding-right: 0; }
.home-banner-dot { width: 28px; min-height: 44px; }

/* Home entry uses three task types; individual models live in the catalogue. */
.home-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.home-shortcut { min-height: 142px; gap: 7px; }
.home-shortcut-tile { border-color: var(--color-border); border-radius: 18px; }
.home-shortcut-description {
  display: block;
  min-height: 1.3em;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
}

/* Catalog hierarchy makes the task type and the underlying models explicit. */
.catalog-intro { margin: 0 2px 14px; }
.catalog-title {
  margin: 0;
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: 720;
  letter-spacing: var(--tracking-tight);
}
.catalog-copy {
  max-width: 480px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}
.model-banner {
  min-height: 156px;
  border-color: var(--color-border);
  transition: transform var(--duration-fast) var(--ease-out), border-color var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}
.model-banner:hover { border-color: var(--accent-line); box-shadow: var(--shadow-2); }
.model-banner:active { transform: scale(0.985); }
.model-banner:disabled { opacity: 0.46; box-shadow: none; }
.model-provider-label { color: var(--color-text-secondary); }
.model-banner-subtitle { max-width: 250px; color: rgba(243, 244, 255, 0.76); }
.model-catalog-status { width: 100%; min-height: 56px; }

/* Pricing stays tied to server data and exposes the unit value transparently. */
.plan-unit-price {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}
.plans-empty {
  display: grid;
  width: 100%;
  min-height: 56px;
  place-items: center;
  color: var(--text-secondary);
  text-align: center;
}
.balance-chip { font-variant-numeric: tabular-nums; }

/* States must give the user a clear next action, never a raw technical error. */
.empty-state, .chat-empty { border-color: var(--color-border); background: rgba(255, 255, 255, 0.024); }
.toast { background: #202335; border-color: var(--accent-line); box-shadow: var(--shadow-2); }
.btn-primary, .buy-pill, .nav-center .nav-plus { background: var(--accent-grad); }
.btn-primary:disabled { opacity: 0.45; box-shadow: none; }

@media (min-width: 640px) {
  .home-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 390px) {
  .home-banner-dots { padding-right: 0; }
  .home-banner--partner .hb-text { max-width: calc(100% - 132px); }
  .home-shortcut-label { font-size: 10px; }
  .home-shortcut-description { font-size: 9px; }
}

/* ─────────────  FINAL MOBILE FLOW GUARDRAILS  ─────────────
   One bottom inset is shared by every scrollable screen. Individual views
   should never guess the tab-bar or Telegram safe-area height. */
:root {
  --bottom-content-inset: var(--page-bottom-inset);
  --focused-flow-inset: calc(var(--bottom-safe-area) + var(--space-6));
}
.app { padding-bottom: var(--bottom-content-inset); }
.topbar-flow-title {
  min-width: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 720;
  letter-spacing: var(--tracking-tight);
}
body.is-focused-flow .bottom-nav { display: none; }
body.is-focused-flow .app { padding-bottom: var(--focused-flow-inset); }
body.is-focused-flow .topbar {
  justify-content: flex-start;
  min-height: 62px;
}
body.is-focused-flow .topbar-back { flex: 0 0 auto; }
body.is-chat-composing .bottom-nav { display: none; }
body.is-chat-composing .app { padding-bottom: max(var(--space-4), var(--chrome-bottom)); }
body.is-chat-composing .chat-compose { bottom: max(8px, var(--chrome-bottom)); }

/* Chat needs one uninterrupted lower action area: no technical empty-state
   slab and no composer trapped between the tab bar and the software keyboard. */
.chat-empty {
  min-height: 154px;
  border-color: rgba(220, 216, 255, .12);
  background: radial-gradient(circle at 50% 0%, rgba(103, 91, 167, .10), transparent 68%), rgba(255,255,255,.018);
}

/* Chat stays dense on a phone: the model row is the detail, not a hero. */
.chat-head { margin: 2px 0 12px; }
.chat-title { font-size: clamp(23px, 6.2vw, 29px); line-height: 1.08; }
.chat-subtitle { margin-top: 6px; font-size: 12px; line-height: 1.35; }
.chat-model-row { min-height: 42px; margin-bottom: 12px; }
#chatInput {
  touch-action: auto;
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

/* Every hero has a copy zone and a separate action zone. No CTA is allowed
   to sit on top of a sentence, including at 320px or enlarged text sizes. */
.home-banner--chat,
.home-banner--image,
.home-banner--partner,
.home-brand-hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 318px;
  padding: 0;
}
.home-brand-hero { min-height: 350px; }
.home-banner--chat .hb-text,
.home-banner--image .hb-text,
.home-banner--partner .hb-text,
.home-brand-hero .hb-text {
  width: auto;
  max-width: min(100% - 36px, 410px);
  padding: 54px 18px 10px;
}
.home-brand-hero .hb-text { padding-top: 60px; }
.home-banner--chat .hb-title,
.home-banner--image .hb-title,
.home-banner--partner .hb-title,
.home-brand-hero .hb-title {
  font-size: clamp(25px, 6.7vw, 35px);
  line-height: 1.04;
}
.home-banner--chat .hb-sub,
.home-banner--image .hb-sub,
.home-banner--partner .hb-sub,
.home-brand-hero .hb-sub {
  max-width: 34rem;
  margin-bottom: 0;
  font-size: clamp(12px, 3.35vw, 14px);
  line-height: 1.45;
}
.home-banner--chat .hb-cta,
.home-banner--image .hb-cta,
.home-banner--partner .hb-cta,
.home-brand-actions {
  position: relative;
  inset: auto;
  z-index: 2;
  align-self: flex-start;
  margin: auto 18px 18px;
}
.home-brand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.home-brand-hero .hb-cta,
.home-banner--chat .hb-cta,
.home-banner--image .hb-cta,
.home-banner--partner .hb-cta {
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 13px;
}
.home-banner--partner { min-height: 366px; }
.home-banner--partner .hb-text { padding-bottom: 12px; }
.home-banner--partner .hb-cta { margin-top: 0; margin-bottom: 12px; }
.home-banner--partner .hb-levels {
  position: relative;
  inset: auto;
  z-index: 2;
  margin: 0 18px 18px;
}
.home-banner--partner .hb-levels > span { min-height: 60px; }
.home-banner-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  margin-top: 7px;
}
.home-banner-controls .home-banner-dots {
  min-height: 48px;
  margin: 0;
  padding-right: 0;
}
.home-banner-dots { min-height: 48px; padding-right: 0; }
.home-banner-dot { min-height: 44px; }

/* Three generated artworks share a square, full-bleed visual language. */
.home-shortcut { min-height: 158px; }
.home-shortcut-tile { aspect-ratio: 1; overflow: hidden; }
.home-shortcut-icon { width: 100%; height: 100%; margin: 0; object-fit: cover; }

/* Checkout is a distinct purchase flow with unambiguous selection and a
   persistent, non-overlapping review of the product before payment. */
#view-shop { padding-bottom: var(--space-5); }
.plan { padding-right: 56px; }
.plan-select-indicator,
.pay-method-check {
  position: absolute;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid rgba(224, 222, 255, 0.48);
  border-radius: 50%;
  color: var(--accent-ink);
}
.plan-select-indicator { top: 18px; right: 17px; }
.plan.selected .plan-select-indicator,
.pay-method.active .pay-method-check {
  border-color: var(--accent);
  background: var(--accent-grad);
}
.plan.selected .plan-select-indicator::after,
.pay-method.active .pay-method-check::after { content: "✓"; font-size: 14px; font-weight: 850; }
.pay-method { position: relative; padding-right: 42px; text-align: left; }
.pay-method-check { top: 13px; right: 12px; }
.field-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.field-error { display: block; margin-top: 5px; color: #ffadb5; font-size: 12px; line-height: 1.35; }
.promo-field-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: end;
  margin-top: 10px;
}
.promo-field-wrap .field { min-width: 0; }
.promo-apply { min-height: 44px; padding: 10px 13px; white-space: nowrap; }
.promo-status { grid-column: 1 / -1; margin: 1px 1px 0; font-size: 12px; line-height: 1.4; }
.promo-status.is-success { color: #bceecf; }
.promo-status.is-error { color: #ffadb5; }
.promo-status.is-loading { color: var(--text-secondary); }
.sticky-purchase-bar {
  position: sticky;
  bottom: max(8px, var(--chrome-bottom));
  z-index: 12;
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 13px;
  border: 1px solid rgba(205, 201, 255, 0.25);
  border-radius: 18px;
  background: rgba(20, 22, 34, 0.95);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.purchase-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.purchase-summary-label { min-width: 0; color: var(--text-secondary); font-size: 12px; font-weight: 620; line-height: 1.35; }
.purchase-summary-price { flex: 0 0 auto; color: #ecebff; font-size: 16px; font-variant-numeric: tabular-nums; }
.sticky-purchase-bar .btn-primary { min-height: 50px; }
/* Reserve the navigation height in both the sticky offset and the document's
   tail: the payment action and legal text must stay reachable on small phones. */
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop {
  padding-bottom:calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 24px);
  scroll-padding-bottom:calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 24px);
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .sticky-purchase-bar {
  bottom:calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 12px);
}
@media(max-width:350px) {
  html[data-lab="true"] #view-shop #payBtn { font-size:12px; }
}
@media(max-height:700px) {
  html[data-lab="true"] #view-shop .lab-payment-thanks { display:none; }
}
.purchase-status { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.42; }
.purchase-status.is-error { color: #ffadb5; }
.purchase-status.is-pending { color: #d5d2ff; }
.purchase-status-retry { min-height: 42px; color: var(--text-secondary); border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(255,255,255,.045); font-size: 12px; font-weight: 700; }

@media (max-width: 359px) {
  .home-banner--chat,
  .home-banner--image { min-height: 336px; }
  .home-banner--partner { min-height: 388px; }
  .home-banner--chat .hb-text,
  .home-banner--image .hb-text,
  .home-banner--partner .hb-text,
  .home-brand-hero .hb-text { padding-right: 16px; padding-left: 16px; }
  .home-banner--chat .hb-cta,
  .home-banner--image .hb-cta,
  .home-banner--partner .hb-cta,
  .home-brand-actions { margin-right: 16px; margin-left: 16px; }
  .home-banner--partner .hb-levels { margin-right: 16px; margin-left: 16px; }
  .promo-field-wrap { grid-template-columns: 1fr; }
  .promo-apply { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .view, .home-banner, .home-banner-dot::after, .btn-primary, .plan, .pay-method { animation: none !important; transition: none !important; }
  .home-banner-track { scroll-behavior: auto; }
}

/* ─────────────  HOME BANNER COMPACT / GOLD PASS  ─────────────
   Above-the-fold on a compact Telegram viewport: branding and actions remain
   readable, while the next action stays visible without a pause control. */
.home-banner-carousel,
.home-banner-track { max-width: 100%; min-width: 0; }
.home-banner-track { gap: 10px; }
.home-banner {
  flex-basis: 100%;
  max-width: 100%;
  min-height: 264px;
  border-color: rgba(241, 212, 134, 0.22);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
  background-position: 72% 50%;
}
.home-banner:hover { border-color: rgba(241, 212, 134, 0.5); }
.home-banner--video,
.home-brand-hero {
  min-height: 280px;
  background-image: url("/shop/assets/lumix-studio-v3.png?v=1");
  background-position: 72% 50%;
}
.home-banner--chat,
.home-banner--image { min-height: 264px; }
.home-banner--partner { min-height: 300px; }
.home-banner--video .hb-text,
.home-brand-hero .hb-text {
  max-width: min(78%, 430px);
  padding: 57px 18px 8px;
}
.home-banner--chat .hb-text,
.home-banner--image .hb-text,
.home-banner--partner .hb-text {
  max-width: min(78%, 360px);
  padding: 54px 18px 8px;
}
.home-brand-hero .hb-title,
.home-banner--chat .hb-title,
.home-banner--image .hb-title,
.home-banner--partner .hb-title {
  font-size: clamp(23px, 6.25vw, 33px);
  line-height: 1.02;
}
.home-banner .hb-kicker { color: var(--brand-gold); }
.home-banner .hb-sub { font-size: 12px; line-height: 1.4; }
.hb-brand {
  top: 13px;
  left: 14px;
  padding: 5px 8px 5px 5px;
  border: 1px solid rgba(241, 212, 134, 0.34);
  border-radius: 999px;
  background: rgba(8, 8, 10, 0.52);
  color: #f8e8bd;
  font-size: 10px;
  letter-spacing: .02em;
  text-shadow: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hb-brand img { width: 20px; height: 20px; }
.home-brand-actions,
.home-banner--chat .hb-cta,
.home-banner--image .hb-cta,
.home-banner--partner .hb-cta { margin: auto 14px 14px; }
.home-brand-actions { gap: 8px; }
.home-brand-hero .hb-cta,
.home-banner .hb-cta {
  min-height: 44px;
  padding: 10px 13px;
  border-color: rgba(255, 236, 180, 0.64);
  border-radius: 12px;
  background: var(--brand-gold-grad);
  color: #211605;
  box-shadow: 0 8px 20px rgba(120, 77, 12, 0.3);
  font-weight: 780;
}
.home-brand-hero .hb-cta--secondary {
  border-color: rgba(241, 212, 134, 0.58);
  background: rgba(10, 10, 14, 0.74);
  color: #f5d98f;
  box-shadow: none;
}
.home-banner .hb-cta:active { transform: scale(0.97); }
.home-banner-controls { min-height: 44px; margin-top: 4px; }
.home-banner-controls .home-banner-dots { min-height: 44px; }
.home-banner-dot { min-height: 44px; }
.home-banner-dot.active::after { background: var(--brand-gold); }
.home-shortcuts-all,
.trends-head .link-btn { color: var(--brand-gold); }

/* More compact catalogue cards make an extensive model list easy to scan. */
.model-banners { gap: 9px; }
.model-provider-label { margin-top: 10px; color: #e8c879; }
.model-banner {
  min-height: 108px;
  padding: 15px;
  border-color: rgba(241, 212, 134, 0.18);
  background-position: 72% 50%;
}
.model-banner-title { font-size: clamp(18px, 5.2vw, 22px); }
.model-banner-subtitle { margin-top: 4px; font-size: 11px; }
.model-banner-emoji { display: inline-block; margin-right: 7px; font-family: var(--font-ui); font-size: .9em; }

/* Primary actions use the same confident gold treatment throughout the app. */
.btn-primary,
.buy-pill,
.nav-center .nav-plus { background: var(--brand-gold-grad); }
.btn-primary { border-color: rgba(255, 236, 180, 0.64); box-shadow: 0 10px 26px rgba(142, 90, 12, 0.3); }
.btn-primary:hover { box-shadow: 0 13px 32px rgba(142, 90, 12, 0.38); }

@media (min-width: 640px) {
  .home-banner--video,
  .home-brand-hero { min-height: 306px; }
  .home-banner--chat,
  .home-banner--image { min-height: 278px; }
  .home-banner--partner { min-height: 316px; }
  .home-banner--video .hb-text,
  .home-brand-hero .hb-text { padding: 64px 24px 10px; }
}

@media (max-width: 359px) {
  .home-banner--video,
  .home-brand-hero { min-height: 270px; }
  .home-banner--chat,
  .home-banner--image { min-height: 258px; }
  .home-banner--partner { min-height: 292px; }
  .home-brand-hero .hb-text,
  .home-banner--chat .hb-text,
  .home-banner--image .hb-text,
  .home-banner--partner .hb-text { padding-right: 15px; padding-left: 15px; }
  .home-brand-actions,
  .home-banner--chat .hb-cta,
  .home-banner--image .hb-cta,
  .home-banner--partner .hb-cta { margin-right: 14px; margin-left: 14px; }
}

/* ─────────────  FINAL HOME FIT / UNIFIED ACTIONS  ─────────────
   A carousel slide must fit a compact Telegram viewport without clipping its
   copy or its next action. The three secondary artworks deliberately share the
   primary banner's cinematic light language. */
.home-banner--chat { background-image: url("/shop/assets/lumix-assistant-v3.png?v=1"); }
.home-banner--image { background-image: url("/shop/assets/lumix-image-v3.png?v=1"); }
.home-banner--partner { background-image: url("/shop/assets/lumix-partners-v3.png?v=1"); }
.home-banner--chat .hb-overlay,
.home-banner--image .hb-overlay,
.home-banner--partner .hb-overlay {
  background: linear-gradient(90deg, rgba(5, 7, 12, .94) 0%, rgba(5, 7, 12, .66) 49%, rgba(5, 7, 12, .14) 100%), linear-gradient(0deg, rgba(5, 7, 12, .48), transparent 62%);
}
.home-banner {
  min-height: clamp(224px, 42vh, 248px);
  min-height: clamp(224px, 42svh, 248px);
  background-position: 72% 50%;
}
.home-banner--video,
.home-brand-hero {
  min-height: clamp(246px, 46vh, 270px);
  min-height: clamp(246px, 46svh, 270px);
}
.home-banner--chat,
.home-banner--image {
  min-height: clamp(224px, 40vh, 238px);
  min-height: clamp(224px, 40svh, 238px);
}
.home-banner--partner {
  min-height: clamp(248px, 44vh, 264px);
  min-height: clamp(248px, 44svh, 264px);
}
.home-banner--video .hb-text,
.home-brand-hero .hb-text { padding-top: 48px; }
.home-banner--chat .hb-text,
.home-banner--image .hb-text,
.home-banner--partner .hb-text { padding-top: 46px; }
.home-banner .hb-title { font-size: clamp(22px, 6vw, 31px); }
.home-banner .hb-sub { font-size: 11px; line-height: 1.32; }
.home-banner--partner .hb-text { padding-bottom: 6px; }
.home-banner--partner .hb-sub { max-width: 260px; }
.home-banner--partner .hb-cta { min-height: 38px; margin-top: 0; margin-bottom: 8px; }
.home-banner--partner .hb-levels { margin: 0 14px 12px; gap: 6px; }
.home-banner--partner .hb-levels > span { min-height: 44px; }
.home-banner--partner .hb-levels b { font-size: 16px; }
.home-banner--partner .hb-levels small { font-size: 9px; }
.home-banner-controls,
.home-banner-controls .home-banner-dots,
.home-banner-dot { min-height: 36px; }
.home-banner-controls { margin-top: 2px; }

/* The same clear primary/secondary action language is used on Home, Create
   and result actions. The compact labels keep both start paths visible at 320px. */
.lumix-action {
  min-height: 44px;
  border-radius: 13px;
  font-weight: 780;
  letter-spacing: -.012em;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.lumix-action--primary {
  border: 1px solid rgba(255, 236, 180, .68) !important;
  background: var(--brand-gold-grad) !important;
  color: #211605 !important;
  box-shadow: 0 10px 24px rgba(142, 90, 12, .32) !important;
}
.lumix-action--secondary {
  border: 1px solid rgba(241, 212, 134, .58) !important;
  background: rgba(10, 10, 14, .74) !important;
  color: #f5d98f !important;
  box-shadow: none !important;
}
.lumix-action:not(:disabled):active { transform: scale(.975); }
.lumix-action:not(:disabled):hover { filter: brightness(1.04); }
.home-brand-actions { flex-wrap: nowrap; gap: 7px; }
.home-brand-actions .hb-cta {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 8px;
  font-size: clamp(9px, 2.7vw, 12px);
  white-space: nowrap;
}
.detail-action.primary .da-ico {
  border-color: rgba(255, 236, 180, .68);
  background: var(--brand-gold-grad);
  box-shadow: 0 9px 20px rgba(142, 90, 12, .28);
}

/* Audio is available in every video flow: audio-driven models consume it as
   input, while ordinary renderers receive it as the final video soundtrack. */
.audio-reference { margin-top: 14px; }
.audio-reference-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 3px 7px;
  border: 1px solid rgba(241, 212, 134, .38);
  border-radius: 999px;
  color: #f2d486;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.audio-dropzone { min-height: 78px; padding: 16px; }
.audio-ref-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  padding: 10px 11px;
  border: 1px solid rgba(241, 212, 134, .24);
  border-radius: 13px;
  background: rgba(215, 169, 80, .08);
}
.audio-ref-icon { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: rgba(215, 169, 80, .16); }
.audio-ref-copy { display: grid; min-width: 0; gap: 2px; }
.audio-ref-copy strong { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.audio-ref-copy small { color: var(--muted); font-size: 11px; }
.audio-ref-remove { display: grid; flex: 0 0 32px; width: 32px; height: 32px; margin-left: auto; place-items: center; border: 1px solid rgba(241, 212, 134, .28); border-radius: 10px; background: rgba(255, 255, 255, .035); color: #f2d486; font-size: 15px; }

@media (max-width: 359px) {
  .home-banner--video,
  .home-brand-hero { min-height: 246px; }
  .home-banner--chat,
  .home-banner--image { min-height: 220px; }
  .home-banner--partner { min-height: 244px; }
  .home-banner--partner .hb-title { font-size: 22px; }
  .home-banner--partner .hb-sub { font-size: 10px; }
  .home-banner--partner .hb-levels > span { min-height: 40px; }
}

/* Mobile screenshot pass: keep the visual hierarchy intentional instead of
   showing two competing brand labels or three differently-cropped tools. */
.home-banner--chat .hb-brand,
.home-banner--image .hb-brand,
.home-banner--partner .hb-brand { display: none; }
.home-banner--chat,
.home-banner--image {
  min-height: clamp(206px, 35vh, 222px);
  min-height: clamp(206px, 35svh, 222px);
}
.home-banner--chat .hb-text,
.home-banner--image .hb-text,
.home-banner--partner .hb-text { padding-top: 24px; }
.home-banner-controls,
.home-banner-controls .home-banner-dots { min-height: 44px; }

/* Home and Create share the same three tactile tool cards. The artwork lives
   in a fixed, contained window, so every option keeps equal visual weight. */
.home-shortcuts { gap: 12px; }
.home-shortcut { min-height: 160px; gap: 6px; }
.home-shortcut-tile {
  overflow: hidden;
  border: 1px solid rgba(241, 212, 134, .28);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 16%, rgba(237, 191, 83, .15), transparent 46%),
    linear-gradient(145deg, #17151a, #090a10 70%);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 9px 22px rgba(0,0,0,.22);
}
.home-shortcut-icon {
  width: 72%;
  height: 72%;
  margin: 14%;
  object-fit: contain;
}
.home-shortcut-label {
  min-height: 1.25em;
  color: #f2f0f6;
  font-size: 12px;
  font-weight: 740;
  line-height: 1.25;
}
.home-shortcut-description {
  min-height: 1.3em;
  color: #aaa9b6;
  font-size: 10px;
  line-height: 1.3;
}


@media (max-width: 359px) {
  .home-shortcuts { gap: 9px; }
  .home-shortcut { min-height: 150px; }
  .home-shortcut-label { font-size: 11px; }
}

/* Gold tactile action buttons: all three are rendered as one intentional
   family, with generated artwork carrying the shared obsidian backdrop. */
.home-banner--chat .hb-text,
.home-banner--image .hb-text,
.home-banner--partner .hb-text { padding-top: 36px; }
.home-shortcut-tile {
  border-color: rgba(247, 210, 124, .56);
  background: #0b0b0d;
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 204, .24),
    inset 0 -2px 0 rgba(0, 0, 0, .64),
    0 2px 0 rgba(210, 158, 41, .24),
    0 12px 22px rgba(0, 0, 0, .34);
}
.home-shortcut-tile::before {
  display: block;
  content: "";
  position: absolute;
  z-index: 1;
  inset: 1px;
  border: 1px solid rgba(255, 244, 210, .12);
  border-radius: inherit;
  box-shadow: inset 0 1px 10px rgba(255, 220, 136, .12), inset 0 -10px 20px rgba(0, 0, 0, .2);
  pointer-events: none;
}
.home-shortcut-icon {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}
.home-shortcut:active .home-shortcut-tile {
  transform: translateY(1px) scale(.975);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .58), 0 4px 11px rgba(0, 0, 0, .3);
}

/* ─────────────  HOME BANNERS: ONE BRAND, FOUR CLEAR TASKS  ─────────────
   The first slide introduces the product only. The following slides each
   lead to one task, so a mobile visitor never has to decode competing names. */
.home-banner--video-promo {
  min-height: clamp(222px, 40svh, 238px);
  align-items: stretch;
  background-image: url("/shop/assets/lumix-video-v4.png?v=1");
  background-position: 72% 50%;
}
.home-banner--video-promo .hb-overlay {
  background: linear-gradient(90deg, rgba(5, 7, 12, .94) 0%, rgba(5, 7, 12, .66) 49%, rgba(5, 7, 12, .14) 100%), linear-gradient(0deg, rgba(5, 7, 12, .48), transparent 62%);
}
.home-brand-hero {
  min-height: clamp(218px, 38svh, 236px);
}
.home-brand-hero .hb-text {
  max-width: min(82%, 420px);
  padding-top: 63px;
}
.home-banner--image .hb-text,
.home-banner--video-promo .hb-text,
.home-banner--partner .hb-text {
  max-width: min(80%, 360px);
  padding-top: 62px;
}
.home-banner--image .hb-text { max-width: min(80%, 360px); }
.home-banner--video-promo .hb-title,
.home-banner--image .hb-title,
.home-banner--partner .hb-title,
.home-brand-hero .hb-title {
  font-size: clamp(22px, 6vw, 31px);
  line-height: 1.04;
}
.home-banner--video-promo .hb-sub,
.home-banner--image .hb-sub,
.home-banner--partner .hb-sub,
.home-brand-hero .hb-sub {
  max-width: 270px;
  font-size: 11px;
  line-height: 1.36;
}
.home-banner--video-promo .hb-cta,
.home-banner--image .hb-cta,
.home-banner--partner .hb-cta {
  min-height: 40px;
  margin: auto 14px 13px;
  padding: 8px 12px;
  border-radius: 11px;
  font-size: 11px;
  box-shadow: 0 6px 15px rgba(120, 77, 12, .24);
}
.home-banner--partner { min-height: clamp(254px, 44svh, 272px); }
.home-banner--partner .hb-text { padding-top: 59px; }
.home-banner--partner .hb-cta { margin-top: 0; margin-bottom: 8px; }
.home-banner--partner .hb-levels { margin-bottom: 11px; }

/* Gold tool cards remain tactile, but the visual now leaves more breathing
   room and no longer dominates the first mobile viewport. */
.home-shortcuts { gap: 10px; }
.home-shortcut { min-height: 146px; }
.home-shortcut-tile { aspect-ratio: 1.10; }
.home-shortcut-tile {
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% -8%, rgba(110, 106, 138, .22), transparent 60%),
    linear-gradient(145deg, #292a34, #171820 74%);
  border-color: rgba(225, 190, 92, .42);
  box-shadow: inset 0 1px 0 rgba(255, 244, 211, .12), 0 7px 17px rgba(0, 0, 0, .28);
}
.home-shortcut-tile::before {
  display: none;
}
.home-shortcut-tile::after {
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, transparent 46%, rgba(3, 4, 8, .10) 100%);
}
.home-shortcut-icon {
  position: relative;
  z-index: 1;
  width: 76%;
  height: 76%;
  margin: 12%;
  border-radius: 20%;
  object-fit: contain;
  opacity: 1;
  transform: translateY(-4px);
  filter: saturate(.98) contrast(1.05) drop-shadow(0 8px 12px rgba(0, 0, 0, .28));
  mix-blend-mode: screen;
}

@media (max-width: 359px) {
  .home-brand-hero { min-height: 224px; }
  .home-banner--image,
  .home-banner--video-promo { min-height: 224px; }
  .home-banner--partner { min-height: 264px; }
  .home-shortcut { min-height: 138px; }
}

/* ─────────────  LUMIX VOICE  ─────────────
   Audio is a fourth peer action, not a decorative banner. Four compact,
   equal controls keep the first decision visible without a horizontal rail. */
.home-shortcuts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.home-shortcut { min-height: 118px; }


.audio-studio {
  overflow: hidden;
  margin-top: 2px;
  padding: 18px;
  border: 1px solid rgba(225, 190, 92, .34);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 82% -14%, rgba(192, 135, 35, .22), transparent 52%),
    linear-gradient(145deg, rgba(31, 29, 27, .94), rgba(10, 11, 16, .96));
  box-shadow: inset 0 1px 0 rgba(255, 245, 217, .08), 0 15px 30px rgba(0, 0, 0, .26);
}
.audio-studio-head { max-width: 420px; }
.audio-studio-eyebrow {
  margin: 0 0 6px;
  color: var(--brand-gold);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .13em;
  line-height: 1.2;
}
.audio-studio h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(23px, 6.4vw, 32px);
  font-weight: 760;
  letter-spacing: -.055em;
  line-height: 1.04;
}
.audio-studio-head > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.audio-form { display: grid; gap: 16px; margin-top: 19px; }
.audio-field > label,
.audio-voices > legend {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  color: #f2efe7;
  font-size: 12px;
  font-weight: 700;
}
.audio-field textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 136px;
  resize: vertical;
  padding: 14px;
  border: 1px solid rgba(230, 213, 166, .24);
  border-radius: 15px;
  outline: none;
  color: var(--text);
  background: rgba(5, 6, 9, .64);
  font: inherit;
  font-size: 16px;
  line-height: 1.46;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.audio-field textarea::placeholder { color: rgba(202, 202, 214, .58); }
.audio-field textarea:focus {
  border-color: rgba(225, 190, 92, .82);
  background: rgba(7, 8, 12, .84);
  box-shadow: 0 0 0 3px rgba(198, 146, 66, .16);
}
.audio-field-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
#audioPrice { color: #dec182; }
.audio-voices { min-width: 0; margin: 0; padding: 0; border: 0; }
.audio-voice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.audio-voice {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid rgba(232, 227, 207, .14);
  border-radius: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, .035);
  text-align: left;
  touch-action: manipulation;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.audio-voice:active { transform: scale(.98); }
.audio-voice:focus-visible,
.audio-generate:focus-visible,
.audio-download:focus-visible {
  outline: 2px solid #f0ce78;
  outline-offset: 3px;
}
.audio-voice.active {
  border-color: rgba(236, 198, 104, .8);
  background: linear-gradient(135deg, rgba(202, 151, 55, .24), rgba(65, 44, 15, .34));
  box-shadow: inset 0 1px rgba(255, 243, 201, .17), 0 5px 15px rgba(0, 0, 0, .19);
}
.audio-voice-mark {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(246, 215, 136, .45);
  border-radius: 50%;
  color: #f6d98e;
  background: radial-gradient(circle at 35% 25%, rgba(255, 235, 178, .24), rgba(86, 52, 8, .34));
  font-size: 12px;
  font-weight: 800;
}
.audio-voice-name {
  overflow: hidden;
  min-width: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-provider-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.42;
}
.audio-status {
  margin: -2px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(230, 199, 116, .25);
  border-radius: 12px;
  color: #ead6a2;
  background: rgba(125, 83, 18, .13);
  font-size: 12px;
  line-height: 1.42;
}
.audio-status.is-error {
  border-color: rgba(236, 128, 117, .35);
  color: #ffd2ca;
  background: rgba(132, 43, 34, .22);
}
.audio-result {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(230, 199, 116, .25);
  border-radius: 15px;
  background: rgba(5, 6, 9, .55);
}
.audio-result p { margin: 0; color: #ddd9ce; font-size: 12px; line-height: 1.4; }
.audio-result audio { width: 100%; min-height: 44px; }
.audio-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  box-sizing: border-box;
  color: var(--text);
  text-decoration: none;
}
.audio-generate { min-height: 52px; }
@media (min-width: 640px) {
  .home-shortcuts { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .audio-voice-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 359px) {
  .home-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-shortcut { min-height: 138px; }
}

/* ─────────────  ART DIRECTION: OBSIDIAN / CHAMPAGNE  ─────────────
   The visual language is intentionally built around a dark editorial canvas:
   artwork gets the stage, while gold acts as a precise edge-light rather than
   a blanket fill. This makes every start action feel like entering a studio. */
:root {
  --bg: #0a0c17;
  --bg-soft: #101322;
  --surface: #121622;
  --surface-2: #1a1f2d;
  --control-dark: rgba(14, 17, 29, .86);
  --control-dark-border: rgba(190, 199, 236, .18);
  --text: #fbfaf6;
  --text-secondary: #d4d0c3;
  --muted: #a2a7bb;
  --line: rgba(190, 199, 236, .09);
  --line-strong: rgba(190, 199, 236, .18);
  --accent: #c69242;
  --accent-2: #8e5a18;
  --brand-gold: #c69242;
  --accent-grad: linear-gradient(135deg, #e0bc73 0%, #b88031 47%, #855316 100%);
  --brand-gold-grad: var(--accent-grad);
  --accent-ink: #171004;
  --accent-soft: rgba(198, 146, 66, .12);
  --accent-line: rgba(215, 171, 91, .32);
}

html { background: var(--bg); }
body {
  background:
    radial-gradient(100% 44% at 100% -10%, rgba(180, 128, 40, .15), transparent 58%),
    radial-gradient(76% 38% at -12% 38%, rgba(111, 84, 37, .1), transparent 63%),
    linear-gradient(180deg, #0b0b09 0%, var(--bg) 28rem);
}

.topbar {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.brand-logo-wrap {
  border-color: rgba(246, 218, 143, .42);
  background: linear-gradient(145deg, rgba(255, 238, 184, .18), rgba(46, 35, 15, .12));
  box-shadow: inset 0 1px rgba(255, 247, 220, .32), 0 8px 24px rgba(0, 0, 0, .3);
}
.brand-name {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
}
.brand-caption { color: #aaa189; }
.balance-chip,
.topbar-back {
  border-color: var(--control-dark-border);
  background: var(--control-dark);
}
.buy-pill {
  border-color: rgba(255, 241, 192, .76);
  background: var(--accent-grad);
  box-shadow: inset 0 1px rgba(255, 255, 238, .7), 0 9px 23px rgba(154, 98, 16, .28);
}

/* Home is a campaign: every slide uses the same illuminated frame, but the
   real visual asset remains the focal point. */
.home-banners { margin-bottom: 25px; }
.home-banner-track { gap: 12px; }
.home-banner {
  min-height: clamp(238px, 40svh, 272px);
  border: 1px solid rgba(245, 220, 148, .29);
  border-radius: 24px;
  background-color: #0c0c0a;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .32), inset 0 1px rgba(255, 244, 212, .07);
  transition: transform .22s cubic-bezier(.16, 1, .3, 1), border-color .22s ease, box-shadow .22s ease;
}
.home-banner::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 7px;
  border: 1px solid rgba(255, 236, 177, .19);
  border-radius: calc(24px - 7px);
  box-shadow: inset 0 1px rgba(255, 251, 232, .11);
  pointer-events: none;
}
.home-banner:hover {
  border-color: rgba(255, 225, 139, .6);
  box-shadow: 0 22px 46px rgba(0, 0, 0, .38), 0 0 0 1px rgba(235, 190, 79, .08);
}
.home-banner:active { transform: scale(.982); }
.home-banner .hb-text { z-index: 2; }
.home-banner .hb-kicker {
  color: #f0cd80;
  font-size: 9px;
  letter-spacing: .16em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .54);
}
.home-banner .hb-title {
  color: #fffdf6;
  font-weight: 760;
  letter-spacing: -.058em;
  text-shadow: 0 5px 28px rgba(0, 0, 0, .72);
}
.home-banner .hb-sub {
  color: rgba(248, 241, 221, .77);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .55);
}
.home-brand-hero {
  min-height: clamp(274px, 42svh, 314px);
  background-image: url("/shop/assets/lumix-studio-v3.png?v=1");
  background-position: 68% center;
}
.home-brand-hero .hb-overlay {
  z-index: 0;
  background:
    radial-gradient(circle at 76% 22%, rgba(253, 214, 113, .21), transparent 26%),
    linear-gradient(90deg, rgba(5, 5, 4, .94) 0%, rgba(5, 5, 4, .72) 47%, rgba(5, 5, 4, .13) 100%),
    linear-gradient(0deg, rgba(5, 5, 4, .72), transparent 60%);
}
.home-brand-hero::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 231, 158, .48);
  border-radius: 50%;
  box-shadow: inset 0 0 0 6px rgba(10, 10, 8, .36), 0 0 24px rgba(225, 183, 84, .15);
  pointer-events: none;
}
.home-brand-hero .hb-text {
  max-width: min(84%, 420px);
  padding: 51px 21px 22px;
}
.home-brand-hero .hb-title { font-size: clamp(29px, 8vw, 42px); line-height: .96; }
.home-brand-hero .hb-sub { max-width: 274px; margin-top: 10px; }
.home-banner .hb-cta {
  position: static;
  min-height: 44px;
  margin: 0;
  padding: 10px 11px;
  border-radius: 13px;
  font-size: 11px;
  font-weight: 790;
  line-height: 1.1;
  white-space: nowrap;
}
.lumix-action--primary,
.home-banner .lumix-action--primary {
  border: 1px solid rgba(255, 244, 202, .82) !important;
  background: var(--accent-grad) !important;
  box-shadow: inset 0 1px rgba(255, 255, 241, .76), 0 10px 22px rgba(145, 91, 10, .3) !important;
}
.lumix-action--secondary,
.home-banner .lumix-action--secondary {
  border: 1px solid rgba(246, 220, 145, .56) !important;
  background: rgba(11, 11, 9, .67) !important;
  color: #f3d88e !important;
  box-shadow: inset 0 1px rgba(255, 248, 220, .08) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.home-banner--image,
.home-banner--video-promo { min-height: clamp(232px, 39svh, 260px); }
.home-banner--partner { min-height: clamp(264px, 43svh, 292px); }
.home-banner--image .hb-overlay,
.home-banner--video-promo .hb-overlay,
.home-banner--partner .hb-overlay {
  z-index: 0;
  background: linear-gradient(90deg, rgba(5, 5, 4, .94), rgba(5, 5, 4, .64) 51%, rgba(5, 5, 4, .11)), linear-gradient(0deg, rgba(5, 5, 4, .5), transparent 62%);
}
.home-banner--image .hb-text,
.home-banner--video-promo .hb-text,
.home-banner--partner .hb-text { padding-top: 45px; }
.home-banner--image .hb-cta,
.home-banner--video-promo .hb-cta,
.home-banner--partner .hb-cta {
  position: relative;
  z-index: 3;
  align-self: flex-start;
  margin: auto 14px 14px;
}
.home-banner--partner .hb-levels { z-index: 3; }
.hb-levels > span {
  border-color: rgba(244, 214, 130, .3);
  background: rgba(10, 10, 8, .64);
  box-shadow: inset 0 1px rgba(255, 244, 210, .07);
}
.hb-levels b { color: #f2cf7b; }
.home-banner-dot::after { background: rgba(245, 224, 167, .27); }
.home-banner-dot.active::after { background: var(--accent); box-shadow: 0 0 12px rgba(226, 187, 97, .42); }

.home-shortcuts-head { margin-bottom: 12px; }
.home-shortcuts-head h2,
.trends-head .section-title,
#view-home > .section-title {
  color: #fcf8eb;
  font-weight: 730;
}
.home-shortcuts-all,
.trends-head .link-btn { color: #edca78; }
.home-shortcuts { gap: 10px; padding-bottom: 26px; }
.home-shortcut { min-height: 150px; gap: 7px; }
.home-shortcut-tile {
  border-color: rgba(243, 213, 132, .38);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(232, 188, 87, .17), transparent 44%),
    linear-gradient(145deg, #201e19, #0c0c0a 75%);
  box-shadow: inset 0 1px rgba(255, 246, 213, .14), inset 0 -24px 35px rgba(0, 0, 0, .28), 0 10px 22px rgba(0, 0, 0, .26);
}
.home-shortcut-tile::after {
  background: radial-gradient(circle at 50% 50%, transparent 44%, rgba(0, 0, 0, .21) 100%);
}
.home-shortcut-icon {
  filter: saturate(.92) contrast(1.06) drop-shadow(0 10px 13px rgba(0, 0, 0, .38));
}
.home-shortcut-label { color: #f8f4e7; }
.home-shortcut-description {
  color: #a9a18f;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.home-shortcut:active .home-shortcut-tile { border-color: rgba(255, 225, 146, .78); }

/* Community work stays colourful; the container merely gives it a gallery edge. */
.trend-card,
.gallery-card,
.history-card,
.work-card {
  border: 1px solid rgba(245, 224, 167, .15);
  background: #0d0d0b;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}
.trend-card { border-radius: 18px; }
.gallery-card:hover,
.history-card:hover,
.work-card:hover { border-color: rgba(245, 211, 120, .48); }
.gc-tag,
.history-tag,
.work-badge {
  border-color: rgba(245, 224, 167, .28);
  background: rgba(8, 8, 7, .72);
  color: #f8edce;
}

.hero {
  border-color: rgba(245, 220, 148, .29);
  background-position: 68% center !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .3), inset 0 1px rgba(255, 244, 212, .08);
}
.hero-overlay {
  background: linear-gradient(90deg, rgba(5, 5, 4, .9), rgba(5, 5, 4, .35) 72%, rgba(5, 5, 4, .08)), linear-gradient(0deg, rgba(5, 5, 4, .58), transparent 70%);
}
.model-banner {
  border-color: rgba(245, 220, 148, .24);
  background-color: #10100e;
  background-position: center 48%;
  box-shadow: inset 0 1px rgba(255, 244, 212, .07), 0 12px 27px rgba(0, 0, 0, .24);
}
.model-banner::after { background: linear-gradient(90deg, rgba(7, 7, 6, .9), rgba(7, 7, 6, .48) 65%, rgba(7, 7, 6, .13)); }
.model-provider-label { color: #cfad64; }

.btn-primary,
.filter-pill.active,
.nav-center .nav-plus {
  border-color: rgba(255, 243, 197, .76);
  background: var(--accent-grad);
  box-shadow: inset 0 1px rgba(255, 255, 240, .7), 0 10px 24px rgba(145, 91, 10, .28);
}
.filter-pill { border-color: rgba(245, 224, 167, .18); background: rgba(255, 248, 225, .028); color: #c2bbaa; }
.bottom-nav {
  border-color: var(--control-dark-border);
  background: var(--control-dark);
  box-shadow: 0 -14px 36px rgba(0, 0, 0, .28);
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
}
.nav-item { color: #8f8a7d; }
.nav-item.active { color: #fbf2d7; }
.nav-item.active .nav-ico { color: #e0bb68; }
.nav-center .nav-plus {
  border-radius: 16px;
  box-shadow: inset 0 1px rgba(255, 255, 240, .72), 0 12px 27px rgba(145, 91, 10, .34);
}

@media (max-width: 359px) {
  .home-brand-hero { min-height: 270px; }
  .home-brand-hero .hb-text { padding: 43px 17px 20px; }
  .home-brand-hero .hb-title { font-size: 27px; }
  .home-banner--image,
  .home-banner--video-promo { min-height: 226px; }
  .home-banner--partner { min-height: 258px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-banner,
.home-shortcut-tile { transition: none; }
}

/* ─────────────  HOME BANNERS · OBSIDIAN GALLERY  ─────────────
   One precise outer gold line gives every slide a common gallery treatment.
   There is deliberately no inset rim: the earlier double frame looked like a
   crop on a narrow Telegram viewport. */
.home-banner {
  min-height: clamp(260px, 40svh, 300px);
  border: 1px solid rgba(232, 198, 117, .64);
  border-radius: 24px;
  background-color: #080807;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 72% center;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .36), inset 0 1px rgba(255, 246, 220, .07);
}
.home-banner::before { display: none; }
.home-banner:hover {
  border-color: rgba(249, 219, 143, .9);
  box-shadow: 0 22px 48px rgba(0, 0, 0, .42), 0 0 0 1px rgba(185, 135, 45, .12);
}
.home-brand-hero {
  min-height: clamp(286px, 40svh, 300px);
  background-image: url("/shop/assets/home/lumix-banner-network.jpeg?v=1");
}
.home-brand-hero .hb-overlay {
  background:
    linear-gradient(90deg, rgba(5, 5, 4, .93) 0%, rgba(5, 5, 4, .72) 43%, rgba(5, 5, 4, .18) 100%),
    linear-gradient(0deg, rgba(5, 5, 4, .52), transparent 62%);
}
.home-brand-hero::after { display: none; }
.home-banner--image,
.home-banner--video-promo,
.home-banner--voice,
.home-banner--chat-promo { min-height: clamp(254px, 37svh, 276px); }
.home-banner--partner { min-height: clamp(272px, 39svh, 292px); }
.home-brand-hero,
.home-banner--image,
.home-banner--video-promo,
.home-banner--voice,
.home-banner--chat-promo,
.home-banner--partner {
  /* Portrait references are shown as the artwork itself on the right; cover
     would crop their subject beyond recognition on the short mobile card. */
  background-repeat: no-repeat;
  background-size: auto 118%;
  background-position: right center;
}
.home-banner--image { background-image: url("/shop/assets/home/lumix-banner-image.jpeg?v=1"); }
.home-banner--video-promo { background-image: url("/shop/assets/home/lumix-banner-video.jpeg?v=1"); }
.home-banner--voice { background-image: url("/shop/assets/home/lumix-banner-voice.jpeg?v=1"); }
.home-banner--chat-promo { background-image: url("/shop/assets/home/lumix-action-assistant-v2.png?v=3"); }
.home-banner--partner { background-image: url("/shop/assets/home/lumix-banner-partner.jpeg?v=1"); }
.home-banner--image .hb-text,
.home-banner--video-promo .hb-text,
.home-banner--voice .hb-text,
.home-banner--chat-promo .hb-text,
.home-banner--partner .hb-text { padding-top: 42px; }

/* The names are the first thing the eye should read.  The shorter measure
   protects each title from the portrait artwork on every phone width. */
.home-banner .hb-text { max-width: min(84%, 410px); padding: 42px 22px 24px; }
.home-banner .hb-kicker { font-size: 10px; font-weight: 750; letter-spacing: .15em; }
.home-banner .hb-title {
  margin-top: 7px;
  font-size: clamp(29px, 8.3vw, 42px);
  line-height: .99;
  letter-spacing: -.052em;
}
.home-banner .hb-sub {
  max-width: 258px;
  margin-top: 11px;
  color: rgba(255, 250, 238, .84);
  font-size: 13px;
  line-height: 1.42;
}
.home-brand-hero .hb-text { padding-top: 34px; }
.home-brand-hero .hb-kicker { margin-top: 0; }
.home-brand-hero .hb-title { font-size: clamp(33px, 9.2vw, 46px); }
.home-banner--partner .hb-levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-banner--partner .hb-levels > span { min-width: 0; padding-right: 8px; padding-left: 8px; }
.home-banner--partner .hb-levels small { white-space: nowrap; }

/* Service terms are an explicit, calm first-open decision; Telegram's own
   Mini App terms remain a separate system dialog managed by Telegram. */
.legal-consent-modal {
  z-index: 1200;
  align-items: flex-end;
  padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, .74);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.legal-consent-sheet {
  width: min(100%, 520px);
  max-height: min(760px, calc(100svh - 28px));
  overflow: auto;
  padding: 24px 20px 18px;
  border: 1px solid rgba(243, 207, 120, .45);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(32, 27, 17, .98), rgba(12, 12, 11, .99));
  box-shadow: 0 24px 72px rgba(0, 0, 0, .62), inset 0 1px rgba(255, 241, 200, .09);
}
.legal-consent-mark {
  display: block;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border: 1px solid rgba(247, 211, 126, .68);
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(211, 158, 58, .2);
}
.legal-consent-kicker { color: #e9c573; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.legal-consent-sheet h2 { margin: 7px 0 8px; color: #fff9e9; font-size: 23px; line-height: 1.1; }
.legal-consent-lead { margin: 0 0 14px; color: rgba(255, 249, 233, .75); font-size: 14px; line-height: 1.45; }
.legal-consent-details {
  margin: 0 0 14px;
  border: 1px solid rgba(255, 242, 207, .12);
  border-radius: 13px;
  background: rgba(0, 0, 0, .19);
}
.legal-consent-details summary { min-height: 44px; padding: 13px 14px; color: #f4d289; cursor: pointer; font-size: 13px; font-weight: 700; }
.legal-document { padding: 0 14px 14px; color: rgba(255, 249, 233, .7); font-size: 12px; line-height: 1.48; }
.legal-document h3 { margin: 13px 0 6px; color: #fff8e6; font-size: 13px; }
.legal-document p { margin: 0 0 9px; }
.legal-document a { color: #f3cd76; text-decoration: underline; }
.legal-operator-details { display: grid; gap: 8px; margin: 0 0 10px; }
.legal-operator-details > div { display: grid; grid-template-columns: minmax(68px, .42fr) minmax(0, 1fr); gap: 8px; }
.legal-operator-details dt { color: rgba(255, 249, 233, .58); }
.legal-operator-details dd { min-width: 0; margin: 0; color: rgba(255, 249, 233, .86); overflow-wrap: anywhere; }
.legal-consent-status { margin: 0 0 10px; color: #ffb6b6; font-size: 12px; line-height: 1.35; }
.legal-consent-accept { min-height: 48px; }
.legal-consent-cancel {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 6px;
  border: 0;
  color: rgba(255, 249, 233, .64);
  background: transparent;
  font: inherit;
  font-size: 13px;
}
.legal-consent-cancel:focus-visible, .legal-consent-details summary:focus-visible { outline: 2px solid #f1ca71; outline-offset: 2px; }

/* A wider canvas can reveal more of the supplied vertical artwork without
   taking the text column away. Phones keep the full composition at the edge. */
@media (min-width: 640px) {
  .home-brand-hero,
  .home-banner--image,
  .home-banner--video-promo,
  .home-banner--voice,
  .home-banner--chat-promo,
  .home-banner--partner { background-size: 54% auto; }
}

@media (max-width: 359px) {
  .home-brand-hero { min-height: 286px; }
  .home-banner--image,
  .home-banner--video-promo,
  .home-banner--voice,
  .home-banner--chat-promo { min-height: 252px; }
  .home-banner--partner { min-height: 276px; }
}

/* The supplied gold control reference belongs to the three front actions,
   not to banner CTAs. The inset sits inside the rim, so no black outer edge
   is left visible around the artwork. */
.home-shortcut-tile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(224, 187, 112, .88) !important;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(235, 203, 131, .72) 0%, rgba(190, 142, 54, .90) 10%, rgba(95, 58, 10, .96) 45%, rgba(214, 171, 87, .80) 100%) border-box !important;
  box-shadow:
    inset 0 1px rgba(240, 215, 159, .58),
    inset 0 -1px rgba(62, 36, 4, .76),
    0 2px 0 rgba(72, 42, 5, .88),
    0 11px 22px rgba(0, 0, 0, .32) !important;
}
.home-shortcut-tile::before {
  display: block;
  content: "";
  position: absolute;
  z-index: 0;
  inset: 4px;
  height: auto;
  border: 1px solid rgba(203, 157, 75, .64);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(39, 35, 27, .98), rgba(7, 7, 6, .98) 62%, rgba(31, 25, 14, .98));
  box-shadow:
    inset 0 1px rgba(234, 209, 153, .10),
    inset 0 0 0 1px rgba(0, 0, 0, .54),
    0 0 0 1px rgba(88, 51, 5, .62);
  pointer-events: none;
}
.home-shortcut-tile::after { z-index: 0; }


.home-shortcut:active .home-shortcut-tile {
  transform: translateY(1px) scale(.975);
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, .55),
    inset 0 -1px rgba(255, 238, 183, .15),
    0 5px 12px rgba(0, 0, 0, .28) !important;
}
.home-hero-logo {
  display: inline-flex;
  width: 44px;
  height: 44px;
  margin: 0 0 12px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .32);
}
.home-hero-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
}
.home-brand-hero .hb-text { padding-top: 38px; }

/* Model choice is a decision grid, not a tall feed: provider labels still
   span the catalogue, while the touch-safe model cards use two columns. */
.model-banners {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}
.model-provider-label {
  grid-column: 1 / -1;
  margin: 8px 1px 0;
}
.model-banner {
  min-height: 88px;
  padding: 12px;
  align-items: center;
  border-radius: 16px;
}
.model-banner-copy { min-width: 0; }
.model-banner-title {
  font-size: 16px;
  line-height: 1.08;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .74);
}
.model-banner-emoji { margin-right: 4px; }
.model-banner-subtitle {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
@media (min-width: 640px) {
  .model-banners { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 359px) {
  .model-banners { gap: 7px; }
  .model-banner { min-height: 82px; padding: 10px; }
  .model-banner-title { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-banner:hover { box-shadow: 0 18px 42px rgba(0, 0, 0, .34), inset 0 1px rgba(255, 255, 255, .035); }
}

/* ─────────────  LUMIX VOICE · LISTENING CONTROLS  ─────────────
   The warm studio surface now sets the application foundation as well:
   graphite first, then champagne only for meaningful actions and edges. */
:root {
  --color-background: #090a0b;
  --color-background-soft: #11110f;
  --color-surface: #171611;
  --color-surface-elevated: #211e16;
  --color-text-primary: #fbfaf5;
  --color-text-secondary: #d8d2c4;
  --color-text-muted: #aaa291;
  --color-border: rgba(244, 227, 181, .12);
  --color-divider: rgba(244, 227, 181, .075);
  --color-overlay: rgba(5, 5, 4, .74);
  --bg: var(--color-background);
  --bg-soft: var(--color-background-soft);
  --surface: var(--color-surface);
  --surface-2: var(--color-surface-elevated);
  --text: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --muted: var(--color-text-muted);
  --line: var(--color-divider);
  --line-strong: var(--color-border);
  --control-dark: rgba(11, 11, 9, .84);
  --control-dark-border: rgba(240, 218, 156, .17);
}
html { background: var(--color-background); }
body {
  background:
    radial-gradient(88% 43% at 100% -10%, rgba(183, 130, 40, .13), transparent 59%),
    radial-gradient(60% 35% at -12% 52%, rgba(124, 88, 31, .08), transparent 65%),
    linear-gradient(180deg, #0b0b09 0%, var(--color-background) 31rem);
}
.bottom-nav {
  border-color: var(--control-dark-border);
  background: var(--control-dark);
}
.topbar {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.audio-voice {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 58px;
  padding: 5px;
  border: 1px solid rgba(232, 227, 207, .14);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, .035);
  text-align: left;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.audio-voice:focus-within {
  border-color: rgba(236, 198, 104, .8);
  box-shadow: inset 0 1px rgba(255, 243, 201, .15), 0 5px 15px rgba(0, 0, 0, .19);
}
.audio-voice.active {
  border-color: rgba(236, 198, 104, .8);
  background: linear-gradient(135deg, rgba(202, 151, 55, .24), rgba(65, 44, 15, .34));
  box-shadow: inset 0 1px rgba(255, 243, 201, .17), 0 5px 15px rgba(0, 0, 0, .19);
}
.audio-voice-select {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  flex: 1 1 auto;
  gap: 9px;
  padding: 0 3px;
  color: inherit;
  text-align: left;
}
.audio-voice-select:active { transform: scale(.98); }
.audio-voice-preview {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(246, 215, 136, .35);
  border-radius: 50%;
  color: #f4d78f;
  background: linear-gradient(145deg, rgba(241, 207, 124, .18), rgba(90, 56, 10, .38));
  box-shadow: inset 0 1px rgba(255, 246, 213, .12);
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.audio-voice-preview svg { width: 18px; height: 18px; fill: currentColor; }
.audio-voice-preview.is-loading svg {
  fill: none;
  animation: lumix-audio-preview-spin .72s linear infinite;
}
.audio-voice-preview.is-playing {
  color: #1d1305;
  border-color: rgba(255, 238, 181, .84);
  background: var(--accent-grad);
}
.audio-voice-preview:active:not(:disabled) { transform: scale(.93); }
.audio-voice-preview:disabled { opacity: .58; }
.audio-voice-select:focus-visible,
.audio-voice-preview:focus-visible {
  outline: 2px solid #f0ce78;
  outline-offset: 2px;
}
@keyframes lumix-audio-preview-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .audio-voice,
  .audio-voice-select,
  .audio-voice-preview { transition: none; }
  .audio-voice-preview.is-loading svg { animation: none; }
}

/* ─────────────  OBSIDIAN SURFACES · NO COOL LEGACY TINTS  ─────────────
   Sheets used to inherit a blue-grey layer from the earlier studio skin.
   All app windows now use the same warm graphite foundation as the canvas;
   gold remains an edge/action colour rather than a second background. */
:root {
  /* The voice studio supplied the reference: warm bronze graphite, with a
     quiet top-light and a deeper lower edge. Every app window shares it. */
  --lumix-window: #252019;
  --lumix-window-elevated: #2b251c;
  --lumix-window-gradient:
    radial-gradient(ellipse at 84% -18%, rgba(192, 135, 35, .18), transparent 54%),
    linear-gradient(145deg, #2a241b 0%, #17140f 78%);
  --lumix-sheet: var(--lumix-window);
  --lumix-field: #15130f;
  --lumix-overlay: rgba(5, 5, 4, .88);
  --lumix-overlay-opaque: #050504;
  --lumix-sheet-border: rgba(244, 227, 181, .14);
  --color-background: #090806;
  --color-background-soft: #100e0b;
  --color-surface: var(--lumix-window);
  --color-surface-elevated: var(--lumix-window-elevated);
  --bg: var(--color-background);
  --bg-soft: var(--color-background-soft);
  --surface: var(--color-surface);
  --surface-2: var(--color-surface-elevated);
}
.audio-studio {
  background: var(--lumix-window-gradient);
}
body {
  background:
    radial-gradient(90% 46% at 104% -12%, rgba(181, 126, 39, .11), transparent 58%),
    radial-gradient(68% 38% at -14% 50%, rgba(102, 71, 23, .07), transparent 64%),
    radial-gradient(76% 44% at 50% 22%, rgba(70, 26, 45, .11), transparent 67%),
    linear-gradient(180deg, #0d0b08 0%, var(--color-background) 31rem);
}
.sheet,
.modal {
  background: var(--lumix-overlay);
  backdrop-filter: blur(12px) saturate(.82);
  -webkit-backdrop-filter: blur(12px) saturate(.82);
}
.sheet-body,
.modal-sheet {
  border-color: var(--lumix-sheet-border);
  background: var(--lumix-window-gradient);
}
.sheet-head,
.sheet-foot {
  border-color: var(--lumix-sheet-border);
  background: var(--lumix-window-elevated);
}
.sheet-body::before {
  background: rgba(244, 227, 181, .28);
}
.dropzone,
.prompt,
.field input,
.field-input,
.profile-select,
.chat-model,
.chat-thread-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.chat-thread-row select { flex: 1; min-width: 0; }
.chat-thread-row button { flex-shrink: 0; }
.chat-attachment { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.chat-attachment img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.chat-message-photo { display: block; max-width: min(100%, 300px); max-height: 260px; object-fit: contain; border-radius: 12px; margin-bottom: 8px; }
.chat-compose,
.toast {
  border-color: var(--lumix-sheet-border);
  background: var(--lumix-field);
}
.info-banner {
  border-color: rgba(230, 193, 104, .2);
  background: linear-gradient(112deg, rgba(135, 91, 28, .18), rgba(255, 248, 225, .025));
  color: var(--text-secondary);
}

/* The profile editor is a focused workspace, not a translucent peek at the
   profile below. It reaches the safe top edge and blocks scroll chaining, so
   the page behind cannot shimmer or move while fields are being edited. */
#profileEditSheet {
  padding-top: var(--chrome-top);
  background: var(--lumix-overlay-opaque);
  animation: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#profileEditSheet .sheet-body {
  min-height: calc(100dvh - var(--chrome-top));
  max-height: calc(100dvh - var(--chrome-top));
  overscroll-behavior: contain;
  background: var(--lumix-window-gradient);
  animation: lumix-profile-editor-in .22s cubic-bezier(.22, 1, .36, 1);
}
#profileEditSheet .sheet-head {
  background: var(--lumix-window-elevated);
}

/* Compact profile controls are windows too.  Keeping the same material as the
   voice studio makes the small controls from the profile reference feel like
   deliberate parts of one interface instead of flat dark buttons. */
.profile-balance-row,
.profile-actions .profile-quick-action,
.profile-showcase-edit {
  border-color: var(--lumix-sheet-border);
  background:
    linear-gradient(145deg, rgba(255, 246, 220, .045), transparent 46%),
    var(--lumix-window-gradient);
  box-shadow: inset 0 1px 0 rgba(255, 244, 209, .055), 0 8px 20px rgba(0, 0, 0, .18);
}
.profile-actions .profile-quick-action:hover,
.profile-actions .profile-quick-action:focus-visible,
.profile-showcase-edit:hover,
.profile-showcase-edit:focus-visible {
  border-color: rgba(227, 190, 99, .52);
  background:
    linear-gradient(145deg, rgba(210, 162, 69, .12), transparent 50%),
    var(--lumix-window-gradient);
}
.profile-actions .profile-quick-action:active,
.profile-showcase-edit:active {
  transform: scale(.985);
}
.profile-actions .profile-quick-action > span:first-child,
.profile-showcase-edit > span:first-child {
  color: #d7b56c;
}
@keyframes lumix-profile-editor-in {
  from { transform: translateY(18px); }
  to { transform: none; }
}
@media (min-width: 640px) {
  #profileEditSheet {
    align-items: center;
    justify-content: center;
    padding: 32px;
  }
  #profileEditSheet .sheet-body {
    width: min(100%, 620px);
    min-height: 0;
    max-height: calc(100dvh - 64px);
    padding: 6px 24px 24px;
    border: 1px solid var(--lumix-sheet-border);
    border-radius: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #profileEditSheet .sheet-body { animation: none; }
}

/* ─────────────  STUDIO MODE ART · FINAL PASS  ─────────────
   The selected mode must be legible before a model is chosen.  The artwork
   is deliberately placed at the far edge, leaving a quiet, high-contrast
   copy column instead of adding another framed panel inside the hero. */


/* Model choice stays a compact grid, but the assigned artwork belongs to the
   active medium and is visibly present at the right of every tile. */
.model-banner {
  background-repeat: no-repeat;
  background-size: auto 128%;
  background-position: right center;
}
.model-banner::after {
  background:
    linear-gradient(90deg, rgba(7, 7, 6, .93) 0%, rgba(7, 7, 6, .76) 48%, rgba(7, 7, 6, .32) 76%, rgba(7, 7, 6, .08) 100%);
}
@media (min-width: 640px) {

  .model-banner { background-size: auto 144%; }
}

/* ─────────────  HOME BANNERS · SEAMLESS ARTWORK  ─────────────
   Supplied vertical artwork is intentionally retained, but it now enters
   through a feathered mask.  The black canvas reaches into the image instead
   of meeting it at a visible straight seam, while a one-pixel inner rail keeps
   the gold border clear of the scroll viewport on every snapped position. */
.home-banner-track {
  padding: 1px;
  scroll-padding-inline: 1px;
}
.home-banner.home-brand-hero { --home-banner-art: url("/shop/assets/home/lumix-banner-network.jpeg?v=1"); }
.home-banner.home-banner--image { --home-banner-art: url("/shop/assets/home/lumix-banner-image.jpeg?v=1"); }
.home-banner.home-banner--video-promo { --home-banner-art: url("/shop/assets/home/lumix-banner-video.jpeg?v=1"); }
.home-banner.home-banner--voice { --home-banner-art: url("/shop/assets/home/lumix-banner-voice.jpeg?v=1"); }
.home-banner.home-banner--chat-promo { --home-banner-art: url("/shop/assets/home/lumix-action-assistant-v2.png?v=3"); }
.home-banner.home-banner--partner { --home-banner-art: url("/shop/assets/home/lumix-banner-partner.jpeg?v=1"); }
.home-banner.home-brand-hero,
.home-banner.home-banner--image,
.home-banner.home-banner--video-promo,
.home-banner.home-banner--voice,
.home-banner.home-banner--chat-promo,
.home-banner.home-banner--partner {
  background-image: none !important;
}
.home-banner.home-brand-hero::after,
.home-banner.home-banner--image::after,
.home-banner.home-banner--video-promo::after,
.home-banner.home-banner--voice::after,
.home-banner.home-banner--chat-promo::after,
.home-banner.home-banner--partner::after {
  display: block;
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image: var(--home-banner-art);
  background-repeat: no-repeat;
  /* The art deliberately extends under the fade. At its former contained
     size the bitmap began after the transparent part of the mask, leaving a
     visible vertical cut exactly where the artwork started. */
  background-size: auto 190%;
  background-position: right center;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .12) 29%, #000 62%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .12) 29%, #000 62%, #000 100%);
  pointer-events: none;
}
.home-banner .hb-overlay {
  z-index: 1;
  background:
    linear-gradient(90deg, #080807 0%, rgba(8, 8, 7, .98) 30%, rgba(8, 8, 7, .86) 46%, rgba(8, 8, 7, .48) 64%, rgba(8, 8, 7, .12) 86%, transparent 100%),
    linear-gradient(0deg, rgba(5, 5, 4, .5), transparent 65%);
}
.home-banner .hb-text,
.home-banner .hb-levels { z-index: 2; }
@media (min-width: 640px) {
  .home-banner.home-brand-hero::after,
  .home-banner.home-banner--image::after,
  .home-banner.home-banner--video-promo::after,
  .home-banner.home-banner--voice::after,
  .home-banner.home-banner--chat-promo::after,
  .home-banner.home-banner--partner::after { background-size: 64% auto; }
}

/* The helper copy is part of the scenario section, not a caption tucked into
   the title.  Its own rhythm separates the heading from the first group. */


/* ─────────────  CREATE · SINGLE-ART CATALOGUE  ─────────────
   Each surface owns one artwork layer only. This avoids a repeated bitmap
   appearing beside itself when an earlier inline/background rule also wins. */


.model-banners {
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  width: min(100%, 548px);
  margin-inline: auto;
}
.model-provider-label { grid-column: 1; }
.model-banner {
  min-height: 84px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid rgba(232, 198, 117, .48);
  border-radius: 15px;
  background:
    linear-gradient(90deg, rgba(15, 13, 10, .76), rgba(15, 13, 10, .57)),
    url("/shop/assets/home/model-catalogue-texture.jpeg?v=1") center 48% / cover no-repeat !important;
  box-shadow: inset 0 1px 0 rgba(255, 244, 211, .12), 0 8px 18px rgba(0, 0, 0, .18);
}
.model-banner::before {
  display: none;
}
.model-banner::after {
  z-index: 0;
  background: linear-gradient(90deg, rgba(10, 9, 7, .21), rgba(10, 9, 7, .05));
}
.model-banner-copy { position: relative; z-index: 1; padding-right: 0; }
.model-banner-title {
  font-family: var(--font-ui);
  font-size: clamp(16px, 4.45vw, 18px);
  font-weight: 600;
  letter-spacing: -.025em;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .62);
}
.model-banner-emoji { color: #e9c97b; }
.model-banner-subtitle { color: rgba(239, 224, 187, .68); }
@media (min-width: 640px) {
  .model-banners { width: min(100%, 620px); }

}

/* The checkout keeps the same bronze graphite window as profile and studio;
   selection never falls back to the old violet surface. */
#view-shop .plan,
#view-shop .plan-details,
#view-shop .checkout-panel,
#view-shop .pay-method,
#view-shop .checkout-toggle,
#view-shop .sticky-purchase-bar {
  border-color: rgba(232, 198, 117, .2);
  background:
    linear-gradient(145deg, rgba(255, 241, 204, .045), transparent 48%),
    var(--lumix-window-gradient);
}
#view-shop .plan::before {
  background: radial-gradient(85% 120% at 100% 0%, rgba(212, 166, 75, .2), transparent 58%);
}
#view-shop .plan.selected {
  border-color: rgba(232, 198, 117, .68);
  box-shadow: 0 0 0 3px rgba(196, 145, 49, .12), 0 15px 35px rgba(91, 57, 12, .22);
}
#view-shop .plan-price,
#view-shop .plan-loki-price strong,
#view-shop .purchase-summary-price { color: #f0cd7e; }
#view-shop .pay-method.active {
  border-color: rgba(232, 198, 117, .62);
  background:
    linear-gradient(145deg, rgba(218, 174, 81, .13), transparent 52%),
    var(--lumix-window-gradient);
  box-shadow: 0 0 0 2px rgba(196, 145, 49, .11);
}
#view-shop .plan-select-indicator,
#view-shop .pay-method-check { border-color: rgba(232, 198, 117, .48); }
#view-shop .purchase-status.is-pending { color: #e5c982; }

/* CHECKOUT · UNIFIED PAYMENT TILES */
#view-shop .pay-methods {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}
#view-shop .pay-method {
  display: grid;
  grid-template-rows: 32px auto 1fr;
  align-content: start;
  gap: 7px;
  min-height: 112px;
  padding: 12px 9px 10px;
  border-radius: 16px;
}
#view-shop .pay-method-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(232, 198, 117, .32);
  border-radius: 10px;
  background: rgba(232, 198, 117, .055);
  color: #e8c675;
}
#view-shop .pay-method-icon svg { display: block; }
#view-shop .payment-icon-animation {
  display: block;
  width: 30px;
  height: 30px;
  pointer-events: none;
}
#view-shop .pay-method-title {
  overflow: hidden;
  color: #f2e7c9;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#view-shop .pay-method-sub {
  align-self: end;
  margin: 0;
  color: rgba(222, 207, 169, .66);
  font-size: 9px;
  line-height: 1.28;
}
#view-shop .pay-method-check {
  top: 10px;
  right: 9px;
  width: 18px;
  height: 18px;
}
#view-shop .pay-method.active .pay-method-icon {
  border-color: rgba(248, 219, 145, .66);
  background: rgba(226, 180, 79, .12);
  color: #ffe0a0;
}
#view-shop .pay-method.active .pay-method-check::after { font-size: 11px; }
.account-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.account-buy-token {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.account-buy-brand { display:contents; }
.account-buy-token-lab,
.account-help-icon,
.account-help-hint,
.account-help-arrow,
.account-help-support-title { display:none; }
html[data-lab="true"] .account-buy-btn {
  min-height:58px; gap:11px; padding:10px 18px; border-radius:18px;
  box-shadow:inset 0 1px 0 #fff5cc80,0 6px 22px #b58a291a;
}
html[data-lab="true"] .account-buy-brand {
  display:grid; place-items:center; flex:0 0 36px; width:36px; height:36px;
  border-radius:50%; background:linear-gradient(145deg,#302719,#141310);
  box-shadow:inset 0 0 0 1px #fff0a140,0 1px 3px #59401430;
}
html[data-lab="true"] .account-buy-token { display:none; }
html[data-lab="true"] .account-buy-token-lab { display:block; width:30px; height:30px; object-fit:contain; }
html[data-lab="true"] .account-support-card {
  display:grid; gap:10px; padding:12px; border-radius:22px;
  background:linear-gradient(145deg,#18191b,#121315); border-color:#d5b46d1f;
}
html[data-lab="true"] .account-support-card .account-support-heading { display:none; }
html[data-lab="true"] .account-help-entry {
  display:flex; align-items:center; justify-content:flex-start; gap:12px;
  min-height:76px; margin:0; padding:14px; border-radius:16px;
  border:1px solid #d9bc7d24; background:linear-gradient(125deg,#26231d99,#1a1b1e);
  color:#f3eee3; text-align:left; text-decoration:none;
  transition:background .18s ease,border-color .18s ease,box-shadow .18s ease;
}
html[data-lab="true"] .account-help-entry:hover {
  background:#29261f; border-color:#e3c37c66; box-shadow:0 3px 14px #00000018;
}
html[data-lab="true"] .account-help-entry:focus-visible { outline:2px solid #e3c37c; outline-offset:3px; }
html[data-lab="true"] .account-help-icon {
  display:grid; place-items:center; flex:0 0 40px; height:40px; border-radius:13px;
  border:1px solid #e8c77920; background:linear-gradient(140deg,#e6c67716,#b18a3a08); color:#e7c885;
}
html[data-lab="true"] .account-help-copy { display:flex; flex-direction:column; gap:5px; min-width:0; }
html[data-lab="true"] .account-help-title { font-size:14px; font-weight:600; line-height:1.35; }
html[data-lab="true"] .account-help-hint,
html[data-lab="true"] .account-help-support-label { display:block; font-size:12px; line-height:1.4; font-weight:400; color:#bcb7ad; }
html[data-lab="true"] .account-help-support-title { display:block; }
html[data-lab="true"] .account-help-arrow { display:block; flex:none; margin-left:auto; font-size:25px; line-height:1; color:#bda36e; }
@media (prefers-reduced-motion:reduce) {
  html[data-lab="true"] .account-help-entry { transition:none; }
}

/* ─────────────  VIDEO SHOWCASE REFERENCES  ───────────── */
.showcase-references {
  display: grid;
  gap: 8px;
  margin: 7px 0 2px;
  padding: 11px 12px;
  border: 1px solid rgba(232, 198, 117, .3);
  border-radius: 18px;
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(199, 145, 47, .15), transparent 60%),
    rgba(255, 255, 255, .025);
}
.showcase-references-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.showcase-references-kicker {
  margin: 0 0 2px;
  color: rgba(232, 198, 117, .72);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
}
.showcase-references h3 { margin: 0; color: var(--text); font-size: 16px; letter-spacing: -.025em; }
.showcase-references-count {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: #edd18a;
  border: 1px solid rgba(232, 198, 117, .3);
  border-radius: 999px;
  background: rgba(232, 198, 117, .07);
  font-size: 11px;
  font-weight: 700;
}
.showcase-references-copy { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.38; }
.showcase-references-grid {
  display: grid;
  grid-auto-columns: minmax(86px, 1fr);
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  min-height: 0;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}
.showcase-references-grid::-webkit-scrollbar { display: none; }
.showcase-reference-card { display: grid; gap: 6px; min-width: 86px; scroll-snap-align: start; }
.showcase-reference-thumb {
  min-width: 86px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid rgba(232, 198, 117, .24);
  border-radius: 12px;
  background: #15120d;
}
.showcase-reference-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.showcase-reference-thumb:active { transform: scale(.975); }
.showcase-reference-prompt { min-height: 32px; padding: 5px 8px; color: #ecd291; border: 1px solid rgba(232, 198, 117, .28); border-radius: 8px; background: rgba(232, 198, 117, .06); font-size: 11px; font-weight: 700; }
.showcase-reference-flow { display: grid; gap: 8px; }
.showcase-reference-step { min-width: 0; }
.showcase-references-use { min-height: 44px; padding-inline: 9px; border-color: rgba(232, 198, 117, .48); color: #efd38f; font-size: 12px; }
.showcase-references-use:disabled { opacity: .62; }
.showcase-reference-state { margin: -2px 1px 0; color: var(--muted); font-size: 11px; line-height: 1.42; }
.showcase-reference-state.is-ready { color: rgba(235, 213, 152, .94); }
.showcase-generate { min-height: 48px; }
/* Пошаговый CTA живёт в закреплённом подвале листа. Он не исчезает при
   переходе между шагами — пользователь не должен прокручивать экран назад. */
#genSheet.gen-sheet--guided .showcase-reference-flow { display: none; }
/* У витринного сценария — одна задача за раз. Референс и промпт хранятся
   в состоянии генерации, но после подтверждения не остаются вторым полем
   на экране: следующая кнопка появляется на том же месте. Сводка находится
   в шапке модели, до любого действия. */
#genSheet.gen-sheet--guided .showcase-references {
  display: block;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#genSheet.gen-sheet--guided .showcase-references-head,
#genSheet.gen-sheet--guided .showcase-references-copy,
#genSheet.gen-sheet--guided .showcase-references-grid,
#genSheet.gen-sheet--guided .showcase-reference-state { display: none; }
#genSheet.gen-sheet--guided .showcase-references-use,
#genSheet.gen-sheet--guided .showcase-generate {
  width: 100%;
  min-height: 48px;
  font-size: 14px;
}
#genSheet.gen-sheet--guided #sheetRefBlock,
#genSheet.gen-sheet--guided #promptBlock { display: none; }
/* Numeric controls are the only safe part of a protected recipe that may be
   shown to the visitor. Keep them visible without exposing the hidden prompt. */
#genSheet.gen-sheet--guided #promptBlock:has(#promptVariablesBlock:not(.hidden)) {
  display:block;
}
#genSheet.gen-sheet--guided #promptBlock:has(#promptVariablesBlock:not(.hidden)) > :is(.block-title,#promptHiddenNotice,#promptReferenceEditor,#promptReferenceTags,#promptCounterWrap) {
  display:none;
}
/* The second guided action temporarily reveals the real prompt textarea.
   Keep this narrow override after the hiding rule so it wins on mobile too. */
#genSheet.gen-sheet--guided.gen-sheet--prompt-entry #promptBlock { display: block; }
#genSheet.gen-sheet--guided .sheet-model-badge {
  max-width: min(100%, 360px);
  margin-top: 5px;
  padding: 5px 8px;
  overflow-wrap: anywhere;
}

/* The moderator sees the same packet of source frames that will be visible
   to visitors. Small thumbnails make an accidental duplicate obvious before
   publishing a video example. */
.mod-preset-reference-field,
.mod-preset-hidden-reference-field { display: grid; gap: 9px; margin-top: 14px; }
.mod-home-reference-field + .mod-preset-hidden-reference-field { margin-top: 12px; }
.mod-preset-hidden-reference-field .btn-outline { min-height: 44px; justify-content: center; }
.mod-preset-reference-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; min-height: 48px; }
.mod-preset-reference-empty { align-self: center; color: var(--muted); font-size: 12px; }
.mod-preset-reference-thumb {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 76px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid rgba(232, 198, 117, .28);
  border-radius: 9px;
  background: var(--surface);
}
.mod-preset-reference-thumb img { display: block; grid-row: 1; width: 54px; height: 68px; border-radius: 6px; object-fit: cover; }
.mod-preset-reference-thumb button {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #fff4d9;
  border: 1px solid rgba(255, 244, 217, .48);
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  font-size: 12px;
}
.mod-reference-prompt { display: grid; gap: 4px; min-width: 0; padding-right: 22px; color: var(--text); font-size: 11px; font-weight: 650; line-height: 1.25; }
.mod-reference-prompt textarea { width: 100%; min-height: 48px; resize: vertical; color: var(--text); border: 1px solid rgba(232, 198, 117, .25); border-radius: 7px; background: rgba(0, 0, 0, .18); padding: 7px 8px; font: inherit; font-weight: 400; line-height: 1.35; }
.mod-reference-prompt textarea:focus { outline: 2px solid rgba(232, 198, 117, .42); outline-offset: 1px; }
.mod-preset-hidden-reference-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px dashed rgba(232, 198, 117, .28);
  border-radius: 10px;
  background: rgba(232, 198, 117, .045);
}
.mod-preset-hidden-reference-label { color: #ead7a4; font-size: 12px; line-height: 1.35; }
.mod-preset-hidden-reference-state .btn-sm { flex: 0 0 auto; min-height: 32px; }
.mod-preset-duration-field { display: grid; gap: 6px; margin-top: 14px; }
@media (max-width: 359px) {
  .showcase-references { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .showcase-reference-thumb:active { transform: none; }
}

/* ─────────────  SOCIAL BOTTOM NAVIGATION  ─────────────
   Пять равных зон как у привычной ленты: дом, лента, создать, история,
   свой профиль. Подписи спрятаны визуально, но остаются доступны VoiceOver. */
.bottom-nav {
  width: min(760px, 100%);
  height: calc(var(--bottom-nav-height) + var(--bottom-safe-area));
  padding: 0 max(10px, env(safe-area-inset-right, 0px)) var(--bottom-safe-area) max(10px, env(safe-area-inset-left, 0px));
  border: 0;
  border-top: 1px solid rgba(244, 222, 158, .09);
  border-radius: 0;
  background: rgba(10, 10, 8, .38);
  box-shadow: 0 -10px 26px rgba(0, 0, 0, .2);
  backdrop-filter: blur(12px) saturate(1.04);
  -webkit-backdrop-filter: blur(12px) saturate(1.04);
}
.nav-item {
  position: relative;
  min-width: 44px;
  min-height: 56px;
  padding: 6px 8px;
  justify-content: center;
  gap: 0;
  color: rgba(241, 232, 208, .62);
  touch-action: manipulation;
}
.nav-item:active { transform: scale(.92); }
.nav-item.active { color: #fff8e6; }
.nav-item.active .nav-ico { color: #f0cb75; }
.nav-ico { width: 28px; height: 28px; }
.nav-ico svg { width: 24px; height: 24px; }
.nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.nav-center .nav-plus {
  width: 48px;
  height: 48px;
  margin-top: 0;
  border-radius: 15px;
  box-shadow: inset 0 1px rgba(255, 255, 240, .75), 0 7px 18px rgba(145, 91, 10, .32);
}
.nav-center .nav-plus svg { width: 25px; height: 25px; }
.nav-center .nav-lumix-mark {
  display: grid;
  place-items: center;
  padding: 4px;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}
.nav-center .nav-lumix-mark img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.nav-profile-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(240, 226, 184, .42);
  border-radius: 50%;
  background: rgba(255, 248, 224, .08);
  color: #f5ddb0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.nav-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-item.active .nav-profile-avatar {
  border-color: rgba(242, 201, 103, .95);
  box-shadow: 0 0 0 2px rgba(242, 201, 103, .13);
}
.nav-profile-avatar > span { display: grid; place-items: center; }
.nav-profile-avatar > span svg { width: 18px; height: 18px; }
.nav-item:focus-visible,
.nav-center:focus-visible .nav-plus {
  outline: 2px solid #f1c967;
  outline-offset: 3px;
}

/* ─────────────  HOME BANNERS · 16:9 MEDIA MASTER  ─────────────
   Campaign artwork is delivered horizontally.  Keep that promise all the
   way through the carousel: no portrait-only masks, no stretched video and
   no duplicate copy over a graphic which already contains its own headline. */
.home-banner.home-brand-hero,
.home-banner.home-banner--image,
.home-banner.home-banner--video-promo,
.home-banner.home-banner--voice,
.home-banner.home-banner--chat-promo {
  aspect-ratio: 16 / 9;
  min-height: 0 !important;
}

.home-banner.home-brand-hero::after,
.home-banner.home-banner--image::after,
.home-banner.home-banner--video-promo::after,
.home-banner.home-banner--voice::after,
.home-banner.home-banner--chat-promo::after {
  background-position: center;
  background-size: cover;
  -webkit-mask-image: none;
  mask-image: none;
}

.home-brand-hero::after { display: none !important; }
.home-banner-main-video {
  display: none;
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #080807;
  pointer-events: none;
}
.home-banner-main-motion {
  display: none;
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #080807;
  pointer-events: none;
}

/* The first card is a text-free campaign film, shared by every locale. */
html[lang] .home-brand-hero .home-banner-main-video { display: block; }

/* Four matching campaign scenes keep the entry cards consistent with the
   primary 16:9 hero. The artwork deliberately has no embedded wording, so
   every interface language continues to use its own live, translated copy. */
.home-banner.home-banner--image {
  --home-banner-art: url("/shop/assets/home/lumix-banner-image-wide.webp?v=20260825-3");
}
.home-banner.home-banner--video-promo {
  --home-banner-art: url("/shop/assets/home/lumix-banner-video-wide.webp?v=20260825-3");
}
.home-banner.home-banner--voice {
  --home-banner-art: url("/shop/assets/home/lumix-banner-voice-wide.webp?v=20260825-3");
}
.home-banner.home-banner--chat-promo {
  --home-banner-art: url("/shop/assets/home/lumix-banner-chat-wide.webp?v=20260825-3");
}


/* Partner uses the same 16:9 canvas as every carousel slide. Its compact
   level row is layered inside the card, so it cannot stretch the whole track
   and leave a blank area below the other banners. */
.home-banner.home-banner--partner {
  --home-banner-art: url("/shop/assets/home/lumix-banner-partner-wide.webp?v=20260825-1");
  aspect-ratio: 16 / 9;
  min-height: 0 !important;
}
.home-banner.home-banner--partner::after {
  background-position: center;
  background-size: cover;
  /* Lift the handshake slightly without changing the 16:9 card geometry. */
  transform: translateY(-3%) scale(1.025);
  -webkit-mask-image: none;
  mask-image: none;
}
.home-banner.home-banner--image::after,
.home-banner.home-banner--video-promo::after,
.home-banner.home-banner--voice::after,
.home-banner.home-banner--chat-promo::after,
.home-banner.home-banner--partner::after {
  filter: brightness(1.2) saturate(1.06);
}
.home-banner.home-banner--image .hb-overlay,
.home-banner.home-banner--video-promo .hb-overlay,
.home-banner.home-banner--voice .hb-overlay,
.home-banner.home-banner--chat-promo .hb-overlay {
  background:
    linear-gradient(90deg, rgba(4, 4, 3, .70) 0%, rgba(4, 4, 3, .54) 34%, rgba(4, 4, 3, .28) 54%, rgba(4, 4, 3, .08) 76%, transparent 100%),
    linear-gradient(0deg, rgba(4, 4, 3, .26), transparent 65%);
}
.home-banner.home-banner--partner .hb-overlay {
  background:
    linear-gradient(90deg, rgba(4, 4, 3, .64) 0%, rgba(4, 4, 3, .46) 42%, rgba(4, 4, 3, .14) 68%, rgba(4, 4, 3, .02) 100%),
    linear-gradient(0deg, rgba(4, 4, 3, .26), transparent 64%);
}
.home-banner.home-banner--partner .hb-text {
  max-width: min(76%, 330px);
  padding: 27px 20px 0;
}
.home-banner.home-banner--partner .hb-kicker { font-size: 8px; }
.home-banner.home-banner--partner .hb-title {
  margin-top: 6px;
  font-size: clamp(24px, 7.1vw, 34px);
  line-height: .96;
}
.home-banner.home-banner--partner .hb-sub {
  max-width: 276px;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.25;
}
.home-banner.home-banner--partner .hb-levels {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 13px;
  left: 14px;
  margin: 0;
  gap: 6px;
}
.home-banner.home-banner--partner .hb-levels > span {
  min-height: 0;
  padding: 6px 7px;
  gap: 1px;
  border-radius: 9px;
}
.home-banner.home-banner--partner .hb-levels b { font-size: 14px; }
.home-banner.home-banner--partner .hb-levels small { font-size: 8px; }

/* ─────────────  HOME · SECTION SPACING  ─────────────
   Do not change the campaign card, dot control or action-card geometry here.
   Only tighten the two blank intervals the home screen has between sections. */
#view-home .home-banners { margin-bottom: 14px; }
#view-home .home-shortcuts { padding-bottom: 18px; }

/* ─────────────  HOME · CAMPAIGN COMPOSITION / LOCALES  ─────────────
   Each scene has its own visual focal point.  Position copy independently
   instead of inheriting the old flex-end layout: Image remains the reference
   composition, while Voice, Video and GPT gain the unused left-side space. */
.home-banner.home-banner--image .hb-text,
.home-banner.home-banner--video-promo .hb-text,
.home-banner.home-banner--voice .hb-text,
.home-banner.home-banner--chat-promo .hb-text {
  position: absolute;
  z-index: 2;
  left: 5.7%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.home-banner.home-banner--image .hb-text {
  top: 18%;
  max-width: 47%;
}
.home-banner.home-banner--video-promo .hb-text {
  top: 27%;
  max-width: 51%;
}
.home-banner.home-banner--voice .hb-text {
  /* Long EN/KZ descriptions need an actual bottom safe area, rather than
     being aligned to the decorative waveform at the bottom of the artwork. */
  top: 15%;
  max-width: 48%;
}
.home-banner.home-banner--chat-promo .hb-text {
  top: 31%;
  max-width: 48%;
}

/* Poster is the immediate fallback while the 10-second campaign clip starts. */
.home-banner.home-brand-hero {
  background-image: url("/shop/assets/home/lumix-hero-campaign-v1-poster.jpg?v=20260921-1");
}
.home-brand-hero::after { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .home-brand-hero .home-banner-main-video { display: none !important; }
}

/* ─────────────  MANAGER ASSETS · 2026-09-21  ─────────────
   The supplied campaign art already contains its own copy. Keeping the live
   duplicate text over it makes the message unreadable, so buttons retain
   their accessible labels while the visual copy is provided by the artwork. */
.brand.brand--lockup {
  min-width: 0;
  gap: 0;
}
.brand-lockup {
  display: block;
  width: clamp(120px, 32vw, 154px);
  height: auto;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
}
.home-banner.home-banner--image {
  --home-banner-art: url("/shop/assets/home/lumix-banner-image-manager-20260921.png?v=1");
}
.home-banner.home-banner--video-promo {
  --home-banner-art: url("/shop/assets/home/lumix-banner-video-manager-20260921.png?v=1");
}
.home-banner.home-banner--voice {
  --home-banner-art: url("/shop/assets/home/lumix-banner-voice-manager-20260921.png?v=1");
}
.home-banner.home-banner--chat-promo {
  --home-banner-art: url("/shop/assets/home/lumix-banner-chat-manager-20260921.png?v=1");
}
.home-banner.home-banner--partner {
  --home-banner-art: url("/shop/assets/home/lumix-banner-partner-manager-20260921.png?v=1");
}
.home-banner.home-banner--image .hb-text,
.home-banner.home-banner--video-promo .hb-text,
.home-banner.home-banner--voice .hb-text,
.home-banner.home-banner--chat-promo .hb-text,
.home-banner.home-banner--partner .hb-text,
.home-banner.home-banner--partner .hb-levels {
  display: none;
}
.home-banner.home-banner--image .hb-overlay,
.home-banner.home-banner--video-promo .hb-overlay,
.home-banner.home-banner--voice .hb-overlay,
.home-banner.home-banner--chat-promo .hb-overlay,
.home-banner.home-banner--partner .hb-overlay {
  display: none;
}
.home-banner.home-banner--image::after,
.home-banner.home-banner--video-promo::after,
.home-banner.home-banner--voice::after,
.home-banner.home-banner--chat-promo::after,
.home-banner.home-banner--partner::after {
  filter: none;
  transform: none;
}
.partner-stat-direct {
  margin: -2px 0 10px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
}


.partner-stat-direct > span:first-child {
  color: var(--text);
  font-weight: 700;
}
@media (max-width: 359px) {
  .brand-lockup { width: 96px; }
}
/* Do not sample scrolling native video surfaces into the navigation backdrop.
   On iOS those sampled frames can remain as rectangular patches after exit. */
body:not(.is-feed-view) .bottom-nav {
  background: #100e09;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.link-share-dialog { width: min(90vw, 420px); padding: 24px; border: 1px solid #786139; border-radius: 20px; background: #15130f; color: #fff; }
.link-share-dialog::backdrop { background: rgba(0,0,0,.75); }
.link-share-dialog .modal-close { position: absolute; top: 12px; right: 12px; }
.link-share-dialog h3 { margin: 0 28px 12px 0; }
.link-share-dialog p { font-size: 14px; line-height: 1.5; }
.link-share-dialog input { width: 100%; box-sizing: border-box; margin: 12px 0; padding: 12px; font-size: 16px; color: #fff; background: #26221a; border: 1px solid #786139; border-radius: 8px; user-select: text; -webkit-user-select: text; }
.link-share-dialog .btn-block { margin-top: 10px; }
.link-share-dialog [hidden] { display: none !important; }

/* Generation choices retain their original handlers and price calculations. */
[data-choice-source="true"] { display: none !important; }
.choice-panel-trigger { width:100%; padding:14px 16px; border:1px solid var(--border, #34343c); border-radius:14px; background:var(--card, #19191f); color:var(--text, #fff); text-align:left; font:inherit; cursor:pointer; }
.choice-panel-dialog { width:min(440px, calc(100vw - 32px)); max-height:75vh; overflow:auto; border:1px solid var(--accent-line, #705831); border-radius:20px; padding:18px; background:#19160f; color:#fff; }
.choice-panel-dialog::backdrop { background:rgba(0,0,0,.6); }
.choice-panel-dialog h2 { margin:0 0 14px; font-size:20px; }
.choice-panel-close { float:right; margin-bottom:12px; padding:8px; border:1px solid var(--accent-line, #705831); border-radius:8px; background:#292319; color:#f3d99e; }
.choice-panel-option { display:block; width:100%; padding:14px; margin-top:8px; border:1px solid #4b3b24; border-radius:12px; background:#242016; color:#fff; font:inherit; text-align:left; cursor:pointer; }
.choice-panel-option[aria-pressed="true"] { border-color:var(--accent, #c69242); background:var(--accent-grad, linear-gradient(135deg,#e0bc73,#855316)); color:var(--accent-ink, #171004); font-weight:700; }
.choice-panel-option:focus-visible, .choice-panel-close:focus-visible { outline:2px solid var(--accent, #c69242); outline-offset:3px; }
.choice-panel-option:disabled { opacity:.5; }

/* Private Lab: one consistent phone-sized canvas on desktop, including
   fixed overlays. Video keeps its aspect ratio and its original stream. */
html[data-lab="true"] .topbar {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-lab="true"] .home-shortcuts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
html[data-lab="true"] .nav-item { gap: 3px; padding-block: 4px; }
html[data-lab="true"] .nav-label {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  font-size: 9px;
  line-height: 1.2;
}
html[data-lab="true"] .nav-center .nav-plus { width: 38px; height: 38px; }
html[data-lab="true"] .nav-center .nav-lumix-mark img { width: 32px; height: 32px; }
html.lab-desktop body {
  width: min(100%, 480px);
  margin-inline: auto;
}
html.lab-desktop .app,
html.lab-desktop body.is-feed-view .app {
  max-width: 480px;
}
html.lab-desktop .bottom-nav {
  width: min(100%, 480px);
}
html.lab-desktop .sheet,
html.lab-desktop .photo-lightbox,
html.lab-desktop #detailModal.modal {
  left: max(0px, calc((100% - 480px) / 2));
  right: max(0px, calc((100% - 480px) / 2));
}
html.lab-desktop .feed-brand-menu {
  left: 50%;
  right: auto;
}
html.lab-desktop .sheet-cover .sheet-cover-video {
  object-fit: contain;
}
html.lab-desktop .photo-lightbox-stage,
html.lab-desktop .photo-lightbox--gallery .photo-lightbox-stage {
  left: 12px;
  right: 12px;
}
html.lab-desktop #detailModal .detail-media-wrap--video {
  width: 100%;
  height: min(48dvh, 320px);
  max-height: min(48dvh, 320px);
  aspect-ratio: auto;
}
html.lab-desktop #detailModal .detail-media--video,
html.lab-desktop #detailModal .detail-video-wrap {
  width: 100%;
  height: 100%;
  max-height: 100%;
  aspect-ratio: auto;
}
html.lab-desktop .detail-media video.detail-video--native {
  pointer-events: auto;
}
html.lab-desktop .detail-media video.detail-video--native::-webkit-media-controls,
html.lab-desktop .detail-media video.detail-video--native::-webkit-media-controls-enclosure {
  display: flex;
}


.pinterest-reference-import { display:flex; flex-direction:column; gap:8px; margin-bottom:18px; }
.pinterest-reference-import > label { font-size:13px; color:var(--text-secondary,#b9b1a1); }
.pinterest-reference-row { display:flex; gap:8px; align-items:center; }
.pinterest-reference-row > input { min-width:0; flex:1; padding:12px; border-radius:12px; border:1px solid var(--border,#39352d); background:var(--bg-secondary,#191815); color:inherit; font:inherit; font-size:14px; }
.pinterest-reference-row > button { flex-shrink:0; }
.pinterest-reference-status { font-size:12px; line-height:1.4; color:var(--text-secondary,#b9b1a1); }
.pinterest-reference-import > .pinterest-file-upload { display:flex; align-items:center; justify-content:center; min-height:44px; cursor:pointer; }


/* Private Lab generation form: one model card, then references and prompt. */
html[data-lab="true"] .lab-generation-form .sheet-head { align-items:center; margin-bottom:20px; }
html[data-lab="true"] .lab-generation-form .model-name { font-size:22px; line-height:1.25; }
html[data-lab="true"] .lab-generation-form .model-emoji { display:none; }

html[data-lab="true"] .lab-model-heading { display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-bottom:10px; }
html[data-lab="true"] .lab-model-heading .block-title { margin:0; }
html[data-lab="true"] #sheetModelPrice { font-size:12px; color:var(--text-secondary,#b9b1a1); white-space:nowrap; }
html[data-lab="true"] .lab-model-description { margin:12px 0 0; font-size:13px; line-height:1.55; color:var(--text-secondary,#b9b1a1); }
html[data-lab="true"] .lab-model-description:empty { display:none; }
html[data-lab="true"] .home-shortcuts { grid-template-columns:repeat(3,minmax(0,1fr)); }

@media (max-width: 480px) {
  html[data-lab="true"] .topbar { padding-inline:10px; gap:6px; }
  html[data-lab="true"] .brand-lockup { width:82px; }
  html[data-lab="true"] .topbar-actions { gap:5px; }
  html[data-lab="true"] .language-button { padding-inline:6px; min-width:34px; }
  html[data-lab="true"] .language-button-icon { display:none; }
  html[data-lab="true"] .buy-pill { padding-inline:8px; font-size:11px; }
  html[data-lab="true"] .balance-chip { padding-inline:7px; font-size:11px; min-width:0; }
  html[data-lab="true"] .home-shortcut { min-height:0; gap:6px; }
  html[data-lab="true"] .home-shortcut-label { font-size:10px; overflow-wrap:normal; }
  html[data-lab="true"] .home-shortcut-description { display:none; }
  html[data-lab="true"] .home-shortcuts { gap:12px 8px; }
  html[data-lab="true"] .bottom-nav { padding-inline:4px; }
  html[data-lab="true"] .nav-item { flex:1; min-width:0; padding-inline:0; }
  html[data-lab="true"] .nav-label { font-size:8px; }
  html[data-lab="true"] .lab-model-heading .block-title { font-size:11px; }
}

/* Team review, 13 October: Lumix gold choices and a dedicated Pinterest row. */
html[data-lab="true"] .choice-panel-trigger {
  border-color:rgba(225,188,115,.46);
  background:linear-gradient(135deg,#32291a,#201a12);
  color:#f3d99e;
  box-shadow:inset 0 1px 0 rgba(255,229,170,.08);
}
html[data-lab="true"] .choice-panel-trigger:hover { border-color:#e0bc73; background:#3a2d1b; }
html[data-lab="true"] .choice-panel-trigger:focus-visible { outline:2px solid #e0bc73; outline-offset:3px; }
html[data-lab="true"] .home-shortcuts { grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px 8px; }
html[data-lab="true"] .home-shortcut { min-height:0; }
html[data-lab="true"] .home-shortcut-tile { aspect-ratio:1; }
html[data-lab="true"] .home-shortcut-icon { object-fit:contain; }
html[data-lab="true"] .home-shortcut:not(.home-shortcut--wide) .home-shortcut-label {
  width:100%; min-width:0; min-height:2.4em; font-size:10px; line-height:1.2;
  letter-spacing:normal; white-space:normal; overflow-wrap:anywhere;
}
html[data-lab="true"] .home-shortcut-description { display:none; }
html[data-lab="true"] .home-shortcut--wide {
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:48px minmax(0,1fr);
  grid-template-rows:auto auto;
  align-items:center;
  column-gap:12px;
  row-gap:4px;
  min-height:76px;
  padding:12px 14px;
  border:1px solid rgba(255,138,152,.48);
  border-radius:18px;
  background:linear-gradient(120deg,#8c1c2e,#4a1421);
  text-align:left;
}
html[data-lab="true"] .home-shortcut--wide .home-shortcut-tile {
  grid-row:1 / 3; width:48px; height:48px; aspect-ratio:1; border:0; box-shadow:none; background:transparent;
}
html[data-lab="true"] .home-shortcut--wide .home-shortcut-tile::before,
html[data-lab="true"] .home-shortcut--wide .home-shortcut-tile::after { display:none; }
html[data-lab="true"] .home-shortcut--wide .home-shortcut-label { align-self:end; text-align:left; color:#fff5f5; font-size:15px; }
html[data-lab="true"] .home-shortcut--wide .home-shortcut-description { display:block; align-self:start; text-align:left; font-size:12px; line-height:1.4; text-transform:none; letter-spacing:normal; color:#ffd7dd; }
html[data-lab="true"] .brand-lockup { width:clamp(110px,28vw,140px); max-height:48px; }
@media (max-width:360px) {
  html[data-lab="true"] .brand-lockup { width:100px; }
  html[data-lab="true"] .buy-pill-full { display:none; }
  html[data-lab="true"] .buy-pill-short { display:inline; }
}

html[data-lab="true"] .home-shortcut--wide:hover { border-color:#ffadb8; background:linear-gradient(120deg,#a92438,#591a29); }
html[data-lab="true"] .home-shortcut--wide:focus-visible { outline:2px solid #ffadb8; outline-offset:3px; }
.profile-support-entry { display:none; }
html[data-lab="true"] .profile-support-entry {
  display:flex; align-items:center; gap:12px; width:100%; margin:12px 0 16px; padding:14px;
  border:1px solid rgba(225,188,115,.35); border-radius:16px; background:linear-gradient(135deg,#292216,#171510);
  color:#f3d99e; text-align:left; cursor:pointer;
}
html[data-lab="true"] .profile-support-entry:hover { border-color:#e0bc73; }
html[data-lab="true"] .profile-support-entry:focus-visible { outline:2px solid #e0bc73; outline-offset:3px; }
.profile-support-icon { display:grid; place-items:center; flex:0 0 40px; height:40px; border-radius:12px; background:rgba(225,188,115,.1); }
.profile-support-copy { display:flex; flex-direction:column; gap:4px; min-width:0; }
.profile-support-copy strong { font-size:14px; }
.profile-support-copy > span { font-size:12px; font-weight:400; color:#c4bba9; }
.profile-support-arrow { margin-left:auto; font-size:24px; }
html[data-lab="true"] .home-shortcut--wardrobe { border-color:rgba(225,188,115,.4); background:linear-gradient(135deg,#302719,#181510); }
html[data-lab="true"] .home-shortcut--wardrobe .home-shortcut-description { color:#c4bba9; }
html[data-lab="true"] .home-shortcut--wardrobe:hover { background:#302719; border-color:#e0bc73; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .wardrobe-form #sheetRefModeRef,
:is(html[data-lab="true"],html[data-studio-v2="true"]) .wardrobe-form #sheetAvatarPicker,
:is(html[data-lab="true"],html[data-studio-v2="true"]) .wardrobe-form #promptBlock { display:none; }
.wardrobe-inputs .block-title { margin-top:18px; }
.wardrobe-inputs .block-title:first-child { margin-top:0; }
.wardrobe-copy { color:#bcb3a2; font-size:12px; line-height:1.5; margin:8px 0 12px; }
.wardrobe-inputs .dropzone-inner { padding:16px; }
.wardrobe-inputs select { width:100%; }

/* Keep prompt editing inside the visible area above the mobile keyboard. */
html.prompt-editing #genSheet {
  top: var(--prompt-viewport-top, 0px);
  bottom: auto;
  height: var(--prompt-viewport-height, 100dvh);
}
html.prompt-editing #genSheet .sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overscroll-behavior: contain;
  scroll-padding-block: 12px;
}
html.prompt-editing #genSheet .sheet-foot { flex: 0 0 auto; }
html.prompt-editing #genSheet #prompt,
html.prompt-editing #genSheet #additionalPrompt {
  min-height: min(180px, max(96px, calc(var(--prompt-viewport-height) - var(--chrome-top) - 120px)));
  max-height: max(96px, calc(var(--prompt-viewport-height) - var(--chrome-top) - 120px));
  scroll-margin-block: 12px;
}

.repeat-photo-help-trigger { min-height: 48px; color: var(--accent); border-color: var(--lumix-sheet-border); }
.repeat-photo-help {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100dvh - 40px);
  box-sizing: border-box;
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--lumix-sheet-border);
  border-radius: 24px;
  color: var(--text);
  background: var(--lumix-window-gradient);
}
.repeat-photo-help::backdrop { background: rgba(0,0,0,.78); }
.repeat-photo-help-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.repeat-photo-help h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.repeat-photo-help p, .repeat-photo-help li { font-size: 15px; line-height: 1.5; }
.repeat-photo-help-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.repeat-photo-help-grid section { border: 1px solid var(--lumix-sheet-border); border-radius: 16px; padding: 14px; background: var(--lumix-field); }
.repeat-photo-help h3 { margin: 0 0 10px; font-size: 16px; color: var(--accent); }
.repeat-photo-help ul { margin: 0; padding-left: 18px; }
.repeat-photo-help li + li { margin-top: 8px; }
@media (max-width: 420px) { .repeat-photo-help-grid { grid-template-columns: 1fr; } }

html.prompt-editing #genSheet .sheet-body > * { flex-shrink: 0; }

.admin-generation-history { width: min(760px,calc(100% - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; box-sizing: border-box; padding: 20px; border: 1px solid var(--lumix-sheet-border); border-radius: 24px; color: var(--text); background: var(--lumix-window-gradient); }
.admin-generation-history::backdrop { background: rgba(0,0,0,.8); }
.admin-history-head { display: flex; gap: 12px; align-items: start; justify-content: space-between; }
.admin-history-head h2 { margin: 0; font-size: 22px; }
.admin-history-item { margin: 14px 0; padding: 16px; border: 1px solid var(--lumix-sheet-border); border-radius: 16px; background: var(--lumix-field); }
.admin-history-item h3 { margin: 0; color: var(--accent); }
.admin-history-item p { overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.45; }
.admin-history-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.admin-history-media img, .admin-history-media video { display: block; max-width: 100%; max-height: 60dvh; margin: 12px auto 0; object-fit: contain; border-radius: 12px; }

/* Lab: compact home actions and a dedicated category panel behind “+”. */
html[data-lab="true"] #view-home .home-shortcuts-head { display:none; }
html[data-lab="true"] #view-home .home-shortcuts {
  grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px 7px; padding:0 0 12px; margin:0;
}
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) { gap:4px; }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-label {
  font-size:10px; padding:0; min-height:2.6em; line-height:1.3; overflow-wrap:anywhere; white-space:normal;
}
html[data-lab="true"] .home-shortcut--wardrobe:not(.home-shortcut--wide) { background:none; border:0; }
html[data-lab="true"] #view-home .home-shortcut--wide { min-height:68px; padding:10px 12px; }
html[data-lab="true"] .nav-center .nav-lumix-mark img { display:block; }
html[data-lab="true"] .nav-center .nav-lumix-mark::after { content:none; }
.create-category-dialog {
  width:min(430px,calc(100vw - 24px)); max-height:calc(100dvh - 48px); box-sizing:border-box;
  padding:20px; border:1px solid #66502a; border-radius:24px; background:linear-gradient(155deg,#272116,#11100e);
  color:#fff3da; overflow:auto; overscroll-behavior:contain;
}
.create-category-dialog::backdrop { background:rgba(0,0,0,.72); }
.create-category-head { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; }
.create-category-head p { margin:0 0 5px; font-size:10px; letter-spacing:.13em; color:#d1ab62; }
.create-category-head h2 { margin:0; font-size:23px; }
.create-category-close { flex:0 0 40px; height:40px; border:1px solid #655030; border-radius:50%; background:#302718; color:#f5dbab; font-size:18px; cursor:pointer; }
html[data-lab="true"] .create-category-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px 12px; padding:0; }
html[data-lab="true"] .create-category-grid .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile { width:64px; height:64px; }
html[data-lab="true"] .create-category-grid .home-shortcut:not(.home-shortcut--wide) .home-shortcut-label { font-size:12px; min-height:1.4em; }
.create-category-dialog button:focus-visible { outline:2px solid #efd18a; outline-offset:4px; }
@media (max-width:360px) {
  html[data-lab="true"] #view-home .home-shortcuts { gap:9px 5px; }
  html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-label { font-size:9px; }
}

html[data-lab="true"] .nav-center .nav-lumix-mark { background:linear-gradient(135deg,#e0bc73,#b88031) !important; border:1px solid #e0bc73 !important; border-radius:50%; }

/* Ordinary creation uses the same dark surfaces as trend/repeat creation. */
#genSheet {
  --lumix-window-gradient:#111214;
  --lumix-window-elevated:#111214;
  --lumix-field:#191a1d;
}
#genSheet .sheet-body,
#genSheet .sheet-head,
#genSheet .sheet-foot { background:#111214; color:#f4f1eb; }

#genSheet .field-input,
#genSheet textarea,
#genSheet .dropzone { background:#191a1d; border-color:#3c3932; color:#f4f1eb; }
#genSheet .choice-panel-trigger { background:#191a1d; border-color:#655538; color:#f4e2b9; }
#audioStudio { background:#111214; color:#f4f1eb; }
#audioStudio textarea { background:#191a1d; color:#f4f1eb; border-color:#3c3932; }

html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile { width:48px; height:48px; }

/* Lab reference tags retain a native, accessible plain-text textarea. */
.prompt-reference-editor { position: relative; }
.prompt-reference-editor > .prompt { display: block; }
.prompt-reference-mirror { display: none; }
.reference-tag-editor-active .prompt-reference-mirror {
  display: block; position: absolute; top: 0; left: 0; box-sizing: border-box;
  border-style: solid; border-color: transparent; overflow: hidden;
  white-space: pre-wrap; overflow-wrap: break-word; pointer-events: none;
  color: var(--text); z-index: 1;
}
.reference-tag-editor-active .prompt-reference-mirror mark {
  background: rgba(212, 166, 74, .19); color: #f5cd78; border-radius: 3px;
}
#genSheet .reference-tag-editor-active > #prompt {
  color: transparent !important; -webkit-text-fill-color: transparent; caret-color: #f5cd78;
}
#genSheet .reference-tag-editor-active > #prompt::placeholder { color: var(--muted); -webkit-text-fill-color: var(--muted); }
.prompt-reference-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.prompt-reference-tags.hidden { display: none; }
.prompt-reference-tag { color: #f5cd78; border-color: rgba(212, 166, 74, .4); font-size: 12px; }
.ref-tag-image { padding: 0; border: 0; width: 100%; height: 100%; background: transparent; cursor: pointer; }
.ref-tag-image:focus-visible { outline: 2px solid #f5cd78; outline-offset: -3px; }

/* History photos fit below viewer controls on phones, with the same rounded
   frame as the feed. The original remains available through pinch zoom. */
@media (max-width: 639px) {
  .photo-lightbox[data-kind="image"] {
    display: block;
    padding: 0;
    overflow: hidden;
  }
  .photo-lightbox[data-kind="image"] .photo-lightbox-stage {
    position: absolute;
    inset: calc(var(--chrome-top) + 68px) 12px max(20px, calc(var(--chrome-bottom) + 16px));
    width: auto;
    height: auto;
    max-height: none;
    margin: 0;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.16);
  }
  .photo-lightbox[data-kind="image"] .photo-lightbox-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
  }
}

/* Lab home, 17 October: approved robot hero, five actions and Pinterest row. */
.lab-home-hero { display:none; }
html[data-lab="true"] #view-home { display:flex; flex-direction:column; gap:0; }
html[data-lab="true"] #view-home.hidden { display:none; }
html[data-lab="true"] body:not(.is-feed-view) { background:#030403; }
html[data-lab="true"] .lab-home-hero {
  display:block; position:relative; flex-shrink:0; aspect-ratio:2.1;
  margin:4px 0 20px; overflow:hidden; border:1px solid #b88d43; border-radius:16px;
  background:#090a07 url("/shop/assets/home/lab-robot-hero-v1.webp") center / cover no-repeat;
  box-shadow:inset 0 0 0 2px #ffffff09,0 0 14px #d3a04d15;
}
html[data-lab="true"] .lab-home-hero-copy { position:relative; padding:20px 16px; width:65%; box-sizing:border-box; }
html[data-lab="true"] .lab-home-hero-copy p { margin:0 0 10px; font-size:9px; letter-spacing:.2em; color:#d7ba79; }
html[data-lab="true"] .lab-home-hero-copy h1 { margin:0 0 8px; font-size:clamp(20px,5.5vw,30px); line-height:1.02; font-weight:850; letter-spacing:-.04em; color:#fff; }
html[data-lab="true"] .lab-home-hero-copy h1 span { color:#eec76f; }
html[data-lab="true"] .lab-home-hero-copy > div { font-size:clamp(9px,2.35vw,13px); line-height:1.35; color:#dddcd5; }
html[data-lab="true"] .lab-home-hero-copy button { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-top:12px; min-height:34px; padding:7px 13px; border:1px solid #f5d58a; border-radius:12px; background:linear-gradient(135deg,#ffe391,#bd812c); color:#211707; font-weight:750; font-size:11px; cursor:pointer; }
html[data-lab="true"] #view-home .home-shortcuts { gap:14px 12px; padding:0; margin:0 0 14px; }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) { gap:6px; }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile { width:48px; height:48px; border-radius:16px; border:1px solid #e4bd69; background:radial-gradient(ellipse at 50% 100%,#6d4f1d40,transparent 70%),#090b09; box-shadow:inset 0 0 0 2px #c69e4e29,0 0 10px #c69e4e13; }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-icon { width:34px; height:34px; object-fit:contain; filter:drop-shadow(0 0 3px #e6b74940); }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-label { font-size:11px; min-height:1.5em; color:#f6f4ed; }
html[data-lab="true"] #view-home .home-shortcut--wide { position:relative; grid-template-columns:40px minmax(0,1fr); min-height:64px; padding:10px 34px 10px 12px; border:1px solid #bd944c; border-radius:14px; background:linear-gradient(95deg,#050604 48%,#05060488),url("/shop/assets/home/lumix-banner-image-wide.webp") center right / cover; }
html[data-lab="true"] #view-home .home-shortcut--wide::after { content:"→"; position:absolute; right:13px; color:#e8c97e; }
html[data-lab="true"] #view-home .home-shortcut--wide .home-shortcut-tile { width:38px; height:38px; }
html[data-lab="true"] #view-home .home-shortcut--wide .home-shortcut-label { color:#fff; font-size:14px; }
html[data-lab="true"] #view-home .home-shortcut--wide .home-shortcut-description { color:#c7c6bd; font-size:10px; }
html[data-lab="true"] #view-home .home-banners { margin:0 0 12px; }
html[data-lab="true"] #view-home .home-banner { border:1px solid #ae8843; border-radius:14px; }
html[data-lab="true"] #view-home .trends-head { margin-top:8px; }
html[data-lab="true"] #view-home .trends-head .section-title::before { content:"🔥 "; }
html[data-lab="true"] .bottom-nav { background:#050604; border-radius:24px 24px 0 0; }
@media (max-width:360px) {
  html[data-lab="true"] .lab-home-hero-copy { padding:14px 12px; }
  html[data-lab="true"] .lab-home-hero-copy p { margin-bottom:7px; }
  html[data-lab="true"] .lab-home-hero-copy button { margin-top:8px; min-height:30px; }
}
.lab-network-copy { display:none; }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile { justify-self:center; }
html[data-lab="true"] #view-home .home-shortcut--wide .home-shortcut-tile { border-radius:10px; }
html[data-lab="true"] #view-home .home-shortcut--wide .home-shortcut-icon { width:100%; height:100%; }
html[data-lab="true"] #homeBannerMain { background:#090a07 url("/shop/assets/home/lab-network-banner-v1.webp") center / cover; aspect-ratio:2.8; }
html[data-lab="true"] #homeBannerMain > video { display:none !important; }
html[data-lab="true"] #homeBannerMain .lab-network-copy { display:block; position:relative; padding:18px 16px; width:60%; box-sizing:border-box; }
html[data-lab="true"] .lab-network-copy h2 { font-size:clamp(20px,5.7vw,30px); line-height:1; letter-spacing:-.04em; margin:0 0 8px; color:#fff; }
html[data-lab="true"] .lab-network-copy h2 span { color:#e6c16c; }
html[data-lab="true"] .lab-network-copy p { font-size:10px; margin:0 0 14px; color:#dedbd3; }
html[data-lab="true"] .lab-network-copy button { border:1px solid #dfbb68; border-radius:20px; background:#08090788; color:#f3d895; padding:6px 12px; font-size:10px; display:flex; gap:20px; cursor:pointer; }
@media (max-width:360px) { html[data-lab="true"] #homeBannerMain .lab-network-copy { padding:13px 12px; } html[data-lab="true"] .lab-network-copy p { margin-bottom:9px; font-size:9px; } }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) { align-items:center; }
html[data-lab="true"] #view-home .home-banner { aspect-ratio:2.8; }
html[data-lab="true"] #homeBannerMain { background-image:url("/shop/assets/home/lab-network-banner-v1.webp") !important; }
html[data-lab="true"] #homeBannerMain .lab-network-copy { padding:15px 16px; }
html[data-lab="true"] .lab-network-copy h2 { font-size:clamp(19px,5.5vw,28px); }
html[data-lab="true"] .lab-network-copy p { margin-bottom:10px; font-size:9px; }
html[data-lab="true"] #view-home .home-banner-track { align-items:stretch; }
html[data-lab="true"] .lab-home-hero { min-height:168px; }
html[data-lab="true"] #view-home #homeBannerMain { min-height:132px !important; }
@media (max-width:360px) { html[data-lab="true"] #homeBannerMain .lab-network-copy { padding:13px 12px; width:65%; } }
html[data-lab="true"] .brand-lockup { width:clamp(112px,38vw,160px); }
html[data-lab="true"] .nav-label { font-size:10px; }

/* Lab polish: centered glyphs, proportional format tiles and a compact form. */
html[data-lab="true"] .home-shortcut:not(.home-shortcut--wide) .home-shortcut-icon {
  position:absolute; inset:auto; left:50%; top:50%; margin:0;
  transform:translate(-50%,-50%); width:34px; height:34px;
}
html[data-lab="true"] .choice-panel-dialog { background:#141517; border-color:#4e4431; }
html[data-lab="true"] .choice-panel-dialog--aspect[open] {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
  grid-auto-rows:max-content; align-content:start; height:fit-content; min-height:0;
  box-sizing:border-box; gap:8px; padding:18px;
}
html[data-lab="true"] .choice-panel-dialog--aspect h2 { grid-column:1 / -1; margin:0 72px 10px 0; min-height:32px; }
html[data-lab="true"] .choice-panel-dialog--aspect .choice-panel-close { position:absolute; top:14px; right:14px; float:none; margin:0; min-height:36px; }
html[data-lab="true"] .choice-panel-dialog--aspect .choice-panel-option { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; margin:0; min-height:94px; padding:10px 4px; background:#1c1d20; border-color:#393a3e; border-radius:13px; text-align:center; font-size:13px; }
html[data-lab="true"] .choice-panel-dialog--aspect .choice-panel-option small { font-size:9px; color:#bdb8ad; font-weight:400; }
html[data-lab="true"] .choice-panel-dialog--aspect .choice-panel-option[aria-pressed="true"] { background:#322a19; border-color:#e7c77c; color:#ffe29b; }
.aspect-choice-frame { display:block; flex-shrink:0; border:1.5px solid currentColor; border-radius:3px; background:#d6ac4e15; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-body { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px; align-content:start; padding:14px 16px 12px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-body > * { grid-column:1 / -1; min-width:0; margin:0; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-body > #aspectBlock,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-body > #resolutionBlock,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-body > #videoQualityBlock { grid-column:auto; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-head { margin:0; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .model-name { font-size:19px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .block-title { font-size:10px; margin-bottom:6px; line-height:1.3; }

:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .lab-model-heading { margin-bottom:6px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .choice-panel-trigger { min-height:40px; padding:9px 10px; font-size:12px; border-radius:10px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .lab-model-description { margin:6px 0 0; font-size:10px; line-height:1.35; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .dropzone { padding:12px 10px; min-height:58px; border-radius:12px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .dropzone-title { font-size:12px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .dropzone-sub { font-size:9px; margin-top:4px; line-height:1.3; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-avatar-picker { margin-top:6px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-avatar-head { min-height:30px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form #prompt { min-height:78px; height:78px; max-height:36dvh; padding:10px 12px; font-size:16px; line-height:1.4; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form #additionalPrompt { min-height:72px; height:72px; padding:10px 12px; font-size:16px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .prompt-counter { font-size:9px; margin-top:3px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form #additionalPromptToggle { width:100%; min-height:32px; border:0; padding:0; text-align:left; background:transparent; color:#d3c295; font:inherit; font-size:11px; cursor:pointer; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form #additionalPromptBlock.is-collapsed textarea { display:none; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form #additionalPromptBlock > .block-title { margin:0; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-foot { padding:10px 16px max(10px,var(--bottom-safe-area)); }
@media(prefers-reduced-motion:no-preference) {
  html[data-lab="true"] .choice-panel-option,
  html[data-lab="true"] .home-shortcut-tile { transition:background .15s ease,border-color .15s ease,transform .15s ease; }
}
.video-template-open { display:none; }
html[data-lab="true"] .video-template-open { display:block; width:100%; margin:6px 0 0; min-height:36px; border:1px solid #70603c; border-radius:10px; background:#211f18; color:#edd59d; font:inherit; font-size:11px; cursor:pointer; }
html[data-lab="true"] .video-template-open.hidden { display:none; }
.video-template-dialog { position:relative; width:min(480px,calc(100vw - 24px)); max-height:calc(100dvh - var(--chrome-top) - 36px); box-sizing:border-box; padding:18px; }
.video-template-dialog { transform: translateY(22px); }
.video-template-dialog h2 { margin-right:72px; }
.video-template-dialog .choice-panel-close { position:absolute; top:14px; right:14px; float:none; }
.video-template-note { color:#bdb9af; font-size:12px; line-height:1.4; }
.video-template-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.video-template-card { display:flex; flex-direction:column; gap:7px; min-width:0; padding:0 0 8px; border:1px solid #494234; border-radius:12px; overflow:hidden; background:#1b1c1e; color:#f0dfb5; text-align:left; cursor:pointer; }
.video-template-card img { display:block; width:100%; aspect-ratio:4 / 5; object-fit:cover; background:#222; }
.video-template-card span { padding:0 8px; font-size:11px; line-height:1.4; }
.video-template-more { width:100%; min-height:40px; margin-top:12px; border:1px solid #70603c; border-radius:10px; background:#211f18; color:#edd59d; font:inherit; }
.video-template-more[hidden] { display:none; }
.lab-reference-images { display:contents; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-head { padding:6px 0; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form .sheet-head .model-hint { display:none; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form .lab-model-heading { display:none; }

:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form #genjutsuModeBlock > .block-title { display:none; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form #genjutsuModeBlock .chip { min-height:36px; padding:8px 12px; font-size:11px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form #sheetRefModeRef { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 10px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form .lab-reference-images { display:block; grid-column:1; grid-row:1; min-width:0; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form #videoReferencesBlock { grid-column:2; grid-row:1; min-width:0; margin:0; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form #sheetRefModeRef > :not(.lab-reference-images):not(#videoReferencesBlock) { grid-column:1 / -1; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form .dropzone { min-height:94px; padding:8px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form .dropzone-title { font-size:11px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form .dropzone-sub { font-size:9px; line-height:1.35; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form .multimodal-reference-note { font-size:10px; line-height:1.35; margin:0; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form #durationBlock { grid-column:auto; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form .motion-duration-note { padding:8px; gap:3px; border-radius:10px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form .motion-duration-note strong { font-size:10px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form .motion-duration-note span { font-size:9px; line-height:1.3; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-motion-form .sheet-body { gap:8px 12px; }
@media (max-height:740px) {
  :is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .lab-model-description { display:none; }
  :is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form #prompt { min-height:64px; height:64px; }
}

/* Lab creation is a full-height workspace; only its content scrolls. */
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form {
  justify-content:flex-start; background:#111214; overscroll-behavior:none;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form > .sheet-body {
  flex:1 1 0; min-height:0; max-height:none; border-radius:0; border-top:0;
  overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form > .sheet-body::before { display:none; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form > .sheet-foot { flex:0 0 auto; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form #prompt {
  min-height:clamp(120px,20dvh,200px); height:clamp(120px,20dvh,200px);
}
html[data-lab="true"].generation-background-locked { overflow:hidden; overscroll-behavior:none; }
html[data-lab="true"].generation-background-locked body {
  position:fixed; top:var(--generation-background-top,0px); left:0; right:0;
  width:100%; overflow:hidden; overscroll-behavior:none;
}
html[data-lab="true"] .nav-center .nav-lumix-mark {
  display:grid; place-items:center; padding:0; line-height:0;
  background:#080807 !important; border-color:rgba(230,194,111,.6) !important;
}
html[data-lab="true"] .nav-center .nav-lumix-mark img {
  position:static; display:block; margin:0; width:34px; height:34px; object-fit:contain;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]).prompt-editing #genSheet.lab-generation-form #prompt {
  min-height:min(120px,max(72px,calc(var(--prompt-viewport-height) - var(--chrome-top) - 180px)));
  height:min(120px,max(72px,calc(var(--prompt-viewport-height) - var(--chrome-top) - 180px)));
}

/* One Lab palette for the creation workspace and all choice dialogs. */
html[data-lab="true"] {
  --lab-workspace:#111214;
  --lab-surface:#191a1d;
  --lab-surface-hover:#222326;
  --lab-line:#3c3932;
  --lab-text:#f4f1eb;
  --lab-muted:#bdb8ad;
  --lab-selected:#30291c;
  --lab-gold:#e9c66b;
  --lab-metal:linear-gradient(135deg,#fff2ba 0%,#e6bc59 28%,#fff0ae 47%,#c59635 73%,#f5d984 100%);
  --accent:#e9c66b;
  --accent-2:#bd8e30;
  --accent-grad:var(--lab-metal);
  --accent-ink:#211704;
  --accent-line:#e9c66b55;
  --accent-glow:#e9c66b2e;
  --lab-selected-text:#ffe29b;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form > .sheet-body,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-head,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form > .sheet-foot,
html[data-lab="true"] .choice-panel-dialog {
  background:var(--lab-workspace); color:var(--lab-text);
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet .field-input,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet textarea,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet .dropzone,
:is(html[data-lab="true"],html[data-studio-v2="true"]) .choice-panel-trigger,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet .choice-panel-trigger,
html[data-lab="true"] .choice-panel-option,
html[data-lab="true"] .choice-panel-dialog--aspect .choice-panel-option,
html[data-lab="true"] .choice-panel-close {
  background:var(--lab-surface); border-color:var(--lab-line);
  color:var(--lab-text); box-shadow:none;
}
html[data-lab="true"] .choice-panel-dialog {
  border-color:var(--lab-line); font-family:inherit;
}
html[data-lab="true"] .choice-panel-dialog h2 { font-size:18px; line-height:1.3; }
html[data-lab="true"] .choice-panel-option,
html[data-lab="true"] .choice-panel-close { font-family:inherit; }
html[data-lab="true"] .choice-panel-option { border-radius:12px; line-height:1.4; }
html[data-lab="true"] .choice-panel-close { border-radius:10px; font-size:12px; min-height:36px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet .lab-model-description,
html[data-lab="true"] .choice-panel-dialog--aspect .choice-panel-option small { color:var(--lab-muted); }
html[data-lab="true"] .choice-panel-option[aria-pressed="true"],
html[data-lab="true"] .choice-panel-dialog--aspect .choice-panel-option[aria-pressed="true"] {
  background:var(--lab-selected); border-color:var(--lab-gold); color:var(--lab-selected-text);
}
html[data-lab="true"] .choice-panel-trigger:focus-visible,
html[data-lab="true"] .choice-panel-option:focus-visible,
html[data-lab="true"] .choice-panel-close:focus-visible { outline:2px solid var(--lab-gold); outline-offset:3px; }
@media (hover:hover) {
  :is(html[data-lab="true"],html[data-studio-v2="true"]) .choice-panel-trigger:hover,
  :is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet .choice-panel-trigger:hover,
  html[data-lab="true"] .choice-panel-option:not([aria-pressed="true"]):not(:disabled):hover,
  html[data-lab="true"] .choice-panel-close:hover { background:var(--lab-surface-hover); border-color:var(--lab-gold); }
}

/* Lab studio: quiet surfaces, clear tools and a browsable template library. */
html[data-lab="true"] #view-home .home-shortcuts { flex:none; height:fit-content; min-height:0; grid-auto-rows:max-content; align-content:start; }


html[data-lab="true"] .lab-template-count { display:block; margin-top:5px; color:var(--lab-muted); font-size:10px; font-weight:400; letter-spacing:0; }
html[data-lab="true"] #homePresets .preset-group-head { align-items:center; margin-bottom:12px; }
html[data-lab="true"] #homePresets .preset-title { font-size:17px; line-height:1.25; }
html[data-lab="true"] #homePresets .preset-card { border-radius:18px; border:1px solid var(--lab-line); box-shadow:none; }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) {
  height:96px; min-height:0; box-sizing:border-box; justify-content:center; flex:none;
  padding:12px 6px 8px; border:1px solid var(--lab-line); border-radius:16px;
  background:linear-gradient(160deg,#1b1b19,#111214); gap:7px;
}
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile {
  width:44px; height:44px; background:#30291c; border-radius:13px; border:0; box-shadow:none;
}
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile::before,
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile::after { display:none; }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-label { font-size:11px; min-height:1.4em; color:var(--lab-text); }
html[data-lab="true"] .create-category-dialog { background:var(--lab-workspace); border-color:var(--lab-line); color:var(--lab-text); }
html[data-lab="true"] .create-category-close { background:var(--lab-surface); border-color:var(--lab-line); color:var(--lab-text); }

@media(hover:hover) {
  html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide):hover { border-color:var(--lab-gold); background:var(--lab-surface-hover); }
}
html[data-lab="true"] .lab-home-hero { width:100%; min-width:0; box-sizing:border-box; aspect-ratio:auto; }
@media(max-width:360px) {
  html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-label { font-size:10px; white-space:nowrap; overflow-wrap:normal; }
}

/* The form title has its own row, outside the scrolling fields. */
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form > .sheet-head {
  position:relative; top:auto; flex:0 0 auto; margin:0; padding:12px 16px;
  background:var(--lab-workspace, #111214); border-bottom:1px solid var(--lab-line, #3c3932);
  z-index:2;
}
html[data-lab="true"] .lab-home-hero::before { content:""; position:absolute; inset:0; pointer-events:none; background:linear-gradient(90deg,#060706e8 0%,#06070699 46%,transparent 85%); }
html[data-lab="true"] .lab-home-hero-copy { width:100%; padding:20px 16px; }
html[data-lab="true"] .lab-home-hero-copy .lab-welcome-brand {
  display:flex; align-items:center; gap:6px; margin-bottom:18px;
  font-size:11px; font-weight:800; letter-spacing:.12em; color:#ffe3a6;
}
html[data-lab="true"] .lab-welcome-brand img { width:28px; height:28px; flex-shrink:0; }
html[data-lab="true"] .lab-welcome-brand span { font-size:8px; font-weight:500; letter-spacing:.16em; color:#bfb5a0; }
html[data-lab="true"] .lab-home-hero-copy h1 { font-size:clamp(26px,7vw,38px); line-height:1.06; margin-bottom:12px; }
html[data-lab="true"] .lab-home-hero-copy > div:not(.lab-welcome-actions) { max-width:75%; font-size:11px; line-height:1.5; }
html[data-lab="true"] .lab-home-hero-copy .lab-welcome-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
html[data-lab="true"] .lab-welcome-actions button { margin:0; min-height:40px; font-size:12px; gap:12px; }
html[data-lab="true"] .lab-welcome-actions button + button { background:#151513e8; border-color:#8e7548; color:#f5ddb0; }
@media(max-width:360px) {
  html[data-lab="true"] .lab-home-hero-copy { padding:16px 12px; }
  html[data-lab="true"] .lab-home-hero-copy .lab-welcome-brand { margin-bottom:14px; }
  html[data-lab="true"] .lab-home-hero-copy > div:not(.lab-welcome-actions) { max-width:85%; font-size:10px; }
}

:is(html[data-lab="true"],html[data-studio-v2="true"]) .studio-tools-grid { display:grid; gap:12px; padding:8px 0 20px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .studio-tool-card { display:grid; grid-template-columns:48px minmax(0,1fr) 12px; align-items:center; gap:12px; padding:16px 12px; border:1px solid #3c3932; border-radius:18px; color:#f5eee1; background:#191a1d; text-align:left; font:inherit; cursor:pointer; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .studio-tool-icon { display:grid; place-items:center; width:48px; height:48px; border-radius:13px; color:#e7c77c; background:#30291c; font-size:25px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .studio-tool-card strong { display:block; font-size:16px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .studio-tool-card small { display:block; margin-top:5px; font-size:12px; line-height:1.45; color:#bdb8ad; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .studio-tool-card em { display:block; margin-top:8px; font-size:11px; font-style:normal; color:#e7c77c; }
.studio-tools-status { padding:14px; border:1px solid #c2a36770; border-radius:14px; background:#242624; color:#e0d7c3; font-size:13px; line-height:1.5; }
.tools-page-head { display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:16px 0; }
.tools-page-head h1 { margin:0; }
.home-shortcut-status { display:block;color:#c0b49b;font-size:9px;line-height:1.3;text-align:center; }
.audio-studio.is-unavailable .audio-voices { display:none; }
.audio-studio.is-unavailable .audio-field { opacity:.6; }
html[data-lab="true"] body:not(.is-feed-view)::before { content:"";position:fixed;inset:0 0 auto;height:var(--chrome-top);z-index:50;pointer-events:none;background:#1c1e1d; }
/* Fullscreen Telegram already has a transparent native header. Let the home
   artwork continue underneath it, while keeping all controls in the safe area. */
html[data-lab="true"] body:has(#view-home:not(.hidden))::before { background:transparent; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .studio-tool-card:disabled { opacity:1; cursor:not-allowed; border-style:dashed; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .studio-tool-card:disabled .studio-tool-icon { opacity:.5; }

:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-video-tool-form .lab-reference-images,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-tool-form .sheet-avatar-picker { display:none; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-tool-form #videoReferencesBlock { width:100%; }

/* Lab: one campaign film, an independent information strip, then six actions. */
html[data-lab="true"] #view-home #homeBannerMain.lab-campaign-hero {
  flex:none; aspect-ratio:16 / 9; min-height:0 !important; padding:0;
  margin:4px 0 10px; width:100%; border-radius:16px;
  background:#090a07 !important; box-sizing:border-box;
}
html[data-lab="true"] #homeBannerMain.lab-campaign-hero > video {
  display:block !important; object-fit:contain;
}
html[data-lab="true"] #homeBannerMain.lab-campaign-hero .lab-network-copy { display:none; }
html[data-lab="true"] #view-home .home-banners { margin-bottom:12px; }
html[data-lab="true"] #view-home .home-banner-track > .home-banner {
  aspect-ratio:auto; min-height:120px !important; height:120px; padding:14px 16px;
  align-items:center; justify-content:flex-start; flex-direction:row;
  box-sizing:border-box; border-color:#605035;
  background:radial-gradient(ellipse at right,#74603933,transparent 65%),#171819 !important;
}
html[data-lab="true"] #view-home .home-banner-track .hb-text {
  display:block; position:relative; top:auto; left:auto;
  padding:0; max-width:85%; width:100%; color:#f5eee1;
}
html[data-lab="true"] #view-home .home-banner-track .hb-kicker {
  font-size:8px; line-height:1.3; margin:0 0 4px; letter-spacing:.08em;
}
html[data-lab="true"] #view-home .home-banner-track .hb-title {
  font-size:18px; line-height:1.15; margin:0; letter-spacing:-.025em;
}
html[data-lab="true"] #view-home .home-banner-track .hb-title br { display:none; }
html[data-lab="true"] #view-home .home-banner-track .hb-sub {
  font-size:10px; line-height:1.35; margin:5px 0 0; max-width:240px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
html[data-lab="true"] #view-home .home-banner-track .hb-levels { display:none; }
html[data-lab="true"] #view-home .home-banner-controls { margin-top:0; }
html[data-lab="true"] #view-home .home-banner--support {
  background:radial-gradient(ellipse at right,#74603955,transparent 65%),#171819;
}
.lab-info-arrow { margin-left:auto; color:#e7c77c; font-size:24px; }
html[data-lab="true"] #view-home .home-banner-track > .home-banner::after { display:none; }
html[data-lab="true"] #view-home .home-banner-track .hb-kicker { color:#d8bc79; }
html[data-lab="true"] #view-home .home-banner-track .hb-title { color:#f5eee1; }
html[data-lab="true"] #view-home .home-banner-track .hb-sub { color:#bdb8ad; }

/* Treasury is piloted exclusively in the private Lab. */
.treasury-button { display:none; }
html[data-lab="true"] .topbar #languageButton { display:none; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-button { display:grid; place-items:center; position:relative; width:40px; height:40px; flex-shrink:0; border:1px solid #8d7541; border-radius:14px; background:radial-gradient(circle at top,#66501f,#181818); font-size:21px; cursor:pointer; }
#treasuryReadyDot { position:absolute; right:3px; top:3px; width:7px; height:7px; border-radius:50%; background:#efcf77; box-shadow:0 0 6px #e8c16a; }
.treasury-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.treasury-title { text-align:center; margin:12px 0; }
.treasury-title > span { font-size:28px; }
.treasury-chest { color:#e9c66b; text-shadow:0 0 12px #e9c66b44; font-size:34px !important; }
.treasury-title h1 { margin:5px 0; font-size:26px; letter-spacing:-.04em; }
.treasury-title p,.treasury-card p { color:#bdb8ad; font-size:13px; line-height:1.5; }
.treasury-card { margin:12px 0; padding:20px 16px; border:1px solid #51432b; border-radius:20px; background:radial-gradient(ellipse at top,#3c301b44,transparent 60%),#151618; }
.treasury-card h2 { font-size:19px; margin:0 0 6px; }
.treasury-wheel-wrap { position:relative; width:min(310px,100%); aspect-ratio:1; margin:28px auto 20px; isolation:isolate; }
.treasury-wheel-wrap::before { content:""; position:absolute; inset:-7px; border:1px solid #c8a35e66; border-radius:50%; box-shadow:0 12px 30px #0005; pointer-events:none; }
.treasury-wheel { position:absolute; inset:0; border-radius:50%; border:5px solid #c8a35e; box-sizing:border-box; background:repeating-conic-gradient(from 0deg,#49361c 0deg 36deg,#1c1d20 36deg 72deg); box-shadow:0 0 0 5px #2c261c,inset 0 0 24px #0008; transition:transform 3.2s cubic-bezier(.12,.65,.12,1); }
.treasury-prize { position:absolute; width:38px; margin:0; text-align:center; font-size:clamp(12px,3.5vw,15px); line-height:1.2; font-weight:800; font-variant-numeric:tabular-nums; color:#f5ddb0; white-space:nowrap; }
.treasury-pointer { position:absolute; top:-10px; left:50%; transform:translateX(-50%); z-index:2; width:0; height:0; font-size:0; border-left:11px solid transparent; border-right:11px solid transparent; border-top:28px solid #f8df96; filter:drop-shadow(0 2px 2px #000); }
.treasury-wheel-mark { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); display:grid; place-items:center; width:60px; height:60px; border-radius:50%; border:2px solid #ebc46e; background:#191a1d; color:#ebc46e; font-size:29px; font-weight:800; }
.treasury-spin { width:100%; min-height:48px; margin:4px 0; border-radius:13px; }
.treasury-result { text-align:center; min-height:24px; color:#f5ddb0 !important; font-weight:700; }
.treasury-result:empty { display:none; }
.treasury-timer { text-align:center; font-variant-numeric:tabular-nums; }
.treasury-reminders { display:flex; align-items:flex-start; gap:9px; font-size:12px; line-height:1.45; margin:18px 0; color:#cbc6bd; }
.treasury-reminders input { margin:2px 0 0; accent-color:#dcb966; width:17px; height:17px; flex-shrink:0; }
@media(prefers-reduced-motion:reduce) { .treasury-wheel { transition:none; } }
html[data-lab="true"] .language-sheet { background:#191a1d; border-color:#51432b; }
html[data-lab="true"] .language-option { background:#1f2023; border-color:#3c3932; }
html[data-lab="true"] .language-option[aria-checked="true"] { background:#30291c; border-color:#dcb966; }

#treasuryButton {
  padding:0;
  align-items:center;
  justify-content:center;
}
.treasury-gift { display:inline-flex; color:#ebc46e; }
#treasuryButton .treasury-gift { display:block; }
#treasuryButton svg { display:block; }
.treasury-gift svg { width:24px; height:24px; }
.treasury-title .treasury-gift svg { width:34px; height:34px; }

/* Lab community media geometry. */
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed {
  /* Chrome overlays the frame. Reserving it inside every full-height card
     leaves two blank bands between neighbouring portrait posts. */
  --feed-media-top:0px;
  --feed-media-bottom:0px;
  --feed-frame-width:min(calc(100cqw - 16px),calc((100cqh - var(--feed-media-top) - var(--feed-media-bottom)) * var(--feed-media-ratio)));
  --feed-frame-height:calc(var(--feed-frame-width) / var(--feed-media-ratio));
  --feed-frame-top:calc(var(--feed-media-top) + (100cqh - var(--feed-media-top) - var(--feed-media-bottom) - var(--feed-frame-height)) / 2);
  --feed-pause-size:min(56px,calc(var(--feed-frame-width) - 16px),calc(var(--feed-frame-height) - 16px));
  --feed-sound-size:min(44px,calc(var(--feed-frame-width) - 16px),calc(var(--feed-frame-height) - 16px));
  --feed-action-right:max(18px,calc((100cqw - var(--feed-frame-width)) / 2 + 10px));
  /* Resolve the entire stack on the card: inherited calc() values have
     already been resolved against the body's defaults. */
  --feed-action-step:72px;
  --feed-repeat-bottom:calc(var(--bottom-nav-height) + var(--bottom-safe-area) + var(--feed-menu-bottom) + var(--feed-menu-height) + var(--feed-action-gap));
  --feed-share-bottom:calc(var(--feed-repeat-bottom) + var(--feed-action-step));
  --feed-comment-bottom:calc(var(--feed-share-bottom) + var(--feed-action-step));
  --feed-like-bottom:calc(var(--feed-comment-bottom) + var(--feed-action-step));
  --feed-pause-bottom:calc(var(--feed-like-bottom) + var(--feed-action-step));
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed > img,
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed > .card-preview-poster,
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed > video.card-preview-video {
  inset:var(--feed-media-top) 0 var(--feed-media-bottom); width:var(--feed-frame-width);
  height:var(--feed-frame-height); margin:auto; object-fit:contain;
  border-radius:22px; background:transparent; transition:none;
}
/* Portrait 9:16 fills the phone's feed stage; other formats stay contained. */
@media (max-width:767px) and (orientation:portrait) {
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed.gallery-card--native-vertical {
    --feed-frame-width:100cqw;
    --feed-frame-height:calc(100cqh - var(--feed-media-top) - var(--feed-media-bottom));
  }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed.gallery-card--native-vertical > img,
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed.gallery-card--native-vertical > video.card-preview-video {
    object-fit:cover; border-radius:0;
  }
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-comment { bottom:var(--feed-comment-bottom); }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-comment {
  position:static; width:48px; height:48px; padding:0; display:grid; place-items:center;
  border:1px solid rgba(241,201,103,.74); border-radius:50%; background:#09090740; color:#ffe6a2;
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-action { gap:2px; }
/* Short viewports cannot fit four vertical action groups below Telegram's
   header. Keep the counters below their buttons in a single bottom row. */
@media (max-height:620px) {
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed { --feed-action-right:max(18px,calc((100cqw - 264px) / 2)); }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-action { bottom:var(--feed-repeat-bottom); }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-share { right:calc(var(--feed-action-right) + 72px); }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-comment { right:calc(var(--feed-action-right) + 144px); }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-like { right:calc(var(--feed-action-right) + 216px); }
}
/* Very short landscape screens need a clear centre for the media/pause. */
@media (max-height:620px) and (min-width:480px) {
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-like { left:18px; right:auto; }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-comment { left:90px; right:auto; }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-share { right:90px; }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-repeat { right:18px; }
}
/* Playback is controlled by tapping the video. Only a paused video shows
   the central play affordance; keyboard focus keeps it discoverable. */
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-toggle {
  left:calc((100cqw - var(--feed-pause-size)) / 2);
  top:calc(var(--feed-frame-top) + (var(--feed-frame-height) - var(--feed-pause-size)) / 2);
  right:auto; bottom:auto;
  width:var(--feed-pause-size); height:var(--feed-pause-size);
  min-width:0; min-height:0; box-sizing:border-box;
  opacity:0; pointer-events:none;
}
@media (max-height:620px) and (max-width:479px) {
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-toggle {
    top:max(calc(var(--feed-frame-top) + 8px),min(calc(var(--feed-frame-top) + (var(--feed-frame-height) - var(--feed-pause-size)) / 2),calc(100cqh - var(--feed-repeat-bottom) - 62px - var(--feed-pause-size) - 12px)));
  }
}
@media (max-height:620px) and (min-width:480px) {
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-toggle {
    top:max(calc(var(--feed-frame-top) + 8px),min(calc(var(--feed-frame-top) + (var(--feed-frame-height) - var(--feed-pause-size)) / 2),calc(100cqh - var(--bottom-nav-height) - var(--bottom-safe-area) - 32px - 54px - var(--feed-pause-size) - 12px)));
  }
}
@media (max-height:360px) {
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed { --feed-sound-size:36px; }
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-toggle.is-paused { opacity:1; }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-toggle:focus-visible {
  opacity:1; pointer-events:auto;
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-sound {
  position:absolute; z-index:6;
  top:calc(var(--feed-media-top) + 8px);
  right:max(16px,var(--content-safe-right,0px));
  width:var(--feed-sound-size); height:var(--feed-sound-size);
  min-width:0; min-height:0; padding:0; box-sizing:border-box;
  display:grid; place-items:center; border:1px solid rgba(241,201,103,.74);
  border-radius:50%; background:rgba(9,9,7,.44); color:#ffe6a2;
}
@media (max-height:360px) {
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-sound { top:calc(var(--feed-media-top) + 4px); }
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-sound .gc-action-icon,
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-sound .gc-action-icon svg {
  width:min(24px,calc(var(--feed-sound-size) - 8px));
  height:min(24px,calc(var(--feed-sound-size) - 8px));
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-btn { flex:1 1 auto; }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-copy { display:grid; }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-author-row { bottom:calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 32px); }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-progress { bottom:calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 8px); }
.feed-recommendation {
  height:var(--feed-card-height); min-height:0; display:grid; align-items:center; padding:calc(var(--chrome-top) + 16px) 24px calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 24px);
  box-sizing:border-box; scroll-snap-align:start; scroll-snap-stop:always; background:radial-gradient(ellipse at top,#382e1e66,transparent 65%),#09090b;
}
.feed-recommendation-inner { width:min(100%,440px); min-height:0; max-height:100%; overflow:auto; margin:auto; text-align:center; display:grid; gap:16px; }
.feed-recommendation h2 { font-size:22px; letter-spacing:-.5px; margin:0; }
.feed-recommendation p { margin:0; font-size:13px; color:#bdb5a5; }
.feed-creator-list { display:grid; gap:10px; text-align:left; }
.feed-creator-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:2px 8px; border:1px solid #ffffff14; border-radius:16px; padding:12px; background:#181819; }
.feed-recommendation .gc-author { position:static; flex:1; max-width:none; min-width:100px; color:#f7f1e6; }
.feed-recommendation .gc-author-btn { border:0; background:transparent; display:flex; align-items:center; gap:10px; text-align:left; }
.feed-recommendation .gc-ava,.feed-recommendation .gc-ava-img { width:36px;height:36px;border-radius:50%;object-fit:cover;display:grid;place-items:center;background:#715725; }
.feed-recommendation .gc-follow { position:static; min-height:40px; padding:8px 14px; border-radius:999px; border:1px solid #d0aa5c; background:#d8b263; color:#211a0e; font-weight:700; }
.feed-creator-row>.muted { grid-column:1; grid-row:2; padding-left:46px; font-size:11px; }
html[data-lab="true"] #view-ideas .feed-creator-row .gc-author { grid-column:1; grid-row:1; min-width:0; }
html[data-lab="true"] #view-ideas .feed-creator-row .gc-author-btn { padding:0; min-width:0; width:100%; font-size:13px; }
html[data-lab="true"] #view-ideas .feed-creator-row .gc-follow { grid-column:2; grid-row:1 / 3; min-height:44px; padding:8px 10px; background:#d8b263; color:#211a0e; }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .feed-creator-row .gc-follow-label { padding:0; min-height:0; font-size:11px; color:inherit; background:transparent; border:0; box-shadow:none; text-shadow:none; transform:none; }
.feed-repeat-poster { display:block; margin:auto; width:auto; height:auto; max-width:100%; max-height:min(42svh,400px); object-fit:contain; border-radius:18px; }
.feed-recommendation strong { color:#e9c576; }
.community-dialog { color:#f5efe3; background:#111113; border:1px solid #5b4c32; border-radius:24px; box-shadow:0 18px 80px #0009; padding:22px; width:min(580px,calc(100vw - 24px)); max-height:calc(100dvh - 48px); box-sizing:border-box; overscroll-behavior:contain; }
.community-dialog::backdrop { background:#000a; }
.community-dialog header { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.community-dialog h2 { margin:0; font-size:22px; letter-spacing:-.4px; }
.community-dialog .modal-close { position:static; flex-shrink:0; min-width:40px; min-height:40px; }
.community-status { font-size:13px; color:#cfbf9f; min-height:20px; }
.community-comments form { display:grid; gap:10px; padding-top:12px; border-top:1px solid #ffffff1a; }
.community-comments textarea { resize:vertical; width:100%; box-sizing:border-box; color:#fff6e4; background:#1c1c20; border:1px solid #514635; border-radius:14px; padding:12px; font:inherit; }
.community-comments small { color:#aaa394; font-size:11px; }
.community-comment-list { max-height:42dvh; overflow:auto; overscroll-behavior:contain; }
.community-comment { border-bottom:1px solid #ffffff12; padding:14px 0; }
.community-comment strong { font-size:13px; }
.community-comment time { color:#aaa394; margin-left:10px; font-size:11px; }
.community-comment p { white-space:pre-wrap; overflow-wrap:anywhere; margin:8px 0; font-size:14px; line-height:1.5; }
.community-delete { padding:4px 0; border:0; color:#d6bd8b; background:transparent; font-size:12px; }
.community-comment-setting { display:flex; align-items:center; gap:8px; margin-bottom:14px; font-size:13px; }
html:has(.community-dialog[open]) { overflow:hidden; }
.partner-cabinet-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px; margin:20px 0; }
.partner-cabinet-head h2 { margin:2px 0; font-size:26px; letter-spacing:-.7px; }
.partner-cabinet-head .page-kicker { margin:0; }
.partner-cabinet-head>button { min-height:42px; }
.partner-cabinet-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; align-items:start; }
.partner-cabinet-main,.partner-cabinet-payout { min-width:0; }
.partner-cabinet-payout { background:linear-gradient(145deg,#32271988,transparent 65%),#151516; border:1px solid #89704477; border-radius:22px; padding:20px; }
.partner-cabinet-payout .partner-payout-amount { display:block; font-size:36px; color:#edca7f; margin:4px 0 20px; }
.partner-cabinet-payout .partner-payout-open { width:100%; margin-bottom:18px; }
.partner-cabinet-payout .partner-balances { display:grid; grid-template-columns:1fr 1fr; }
.partner-cabinet-payout .partner-stars-note { font-size:12px; line-height:1.6; }
.partner-cabinet-guide { padding:16px 18px; border:1px solid #a4834355; background:#30261855; border-radius:16px; margin-bottom:16px; }
.partner-cabinet-guide summary { font-weight:700; color:#ebc67b; cursor:pointer; }
.partner-cabinet-guide p { color:#c7bfaf; font-size:13px; line-height:1.6; }
.partner-cabinet-main .partner-stats { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:18px; border:1px solid #ffffff16; border-radius:18px; background:#151516; }
.partner-cabinet-main .partner-stat-big { font-size:25px; }
.partner-cabinet-main .partner-stat-label { font-size:12px; }
.partner-cabinet-main .partner-block { margin-top:18px; }
.partner-cabinet-main .partner-card { border-radius:20px; }
.partner-cabinet-main .partner-link-input { font-size:13px; text-overflow:ellipsis; }
.partner-analytics { width:min(1000px,calc(100vw - 24px)); }
.partner-analytics-filters { display:flex; align-items:end; gap:8px; flex-wrap:wrap; }
.partner-analytics-filters label { display:grid; gap:5px; font-size:12px; color:#bbb3a5; }
.partner-analytics-filters input,.partner-analytics-filters select { color:#f5efe3; background:#202023; border:1px solid #514635; border-radius:10px; min-height:38px; box-sizing:border-box; padding:6px 9px; max-width:100%; color-scheme:dark; }
.partner-analytics-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:20px 0; }
.partner-analytics-metrics article { display:grid; align-content:start; gap:8px; padding:14px; border:1px solid #ffffff16; border-radius:16px; }
.partner-analytics-metrics strong { font-size:23px; overflow-wrap:anywhere; color:#ebc67b; }
.partner-analytics-metrics span { color:#c6bfaf; font-size:12px; }
.partner-analytics-levels { display:flex; flex-wrap:wrap; gap:12px; }
.partner-analytics-levels>div { flex:1; display:flex; justify-content:space-between; padding:10px; border-bottom:1px solid #ffffff18; font-size:12px; }
.partner-analytics-segments { margin:20px 0; }
@media(min-width:850px) {
  html.lab-desktop:has(#view-profile:not(.hidden) #profileSectionPartner:not(.hidden)) body { width:min(100%,1040px); }
  html.lab-desktop:has(#view-profile:not(.hidden) #profileSectionPartner:not(.hidden)) .app { max-width:1040px; }
  html[data-lab="true"] .partner-cabinet-grid { grid-template-columns:minmax(0,1.65fr) minmax(260px,1fr); }
  .partner-cabinet-payout { position:sticky; top:calc(var(--chrome-top) + 12px); }
}
@media(max-width:380px) { .community-dialog { padding:16px; } .partner-analytics-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .feed-creator-row { padding:9px; } }
@media(prefers-reduced-motion:reduce) {
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed > img,
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed > .card-preview-poster,
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed > video.card-preview-video { transition:none; }
}

/* Lab checkout: hosted payment details stay with the existing providers. */
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .page-intro { max-width:none; }
.lab-topup-head { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
.lab-topup-head .page-title { font-size:clamp(24px,5vw,34px); letter-spacing:-.6px; }
.lab-topup-balance { padding:13px 17px; border:1px solid #7a613855; border-radius:18px; background:#181610; display:grid; gap:5px; }
.lab-topup-balance small { color:#aaa18f; font-size:12px; }
.lab-topup-balance strong { color:#f1cd7e; font-size:20px; }
.lab-topup-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; }
.lab-topup-packages,.lab-topup-bonus,:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .checkout-panel { border:1px solid #89704455; border-radius:22px; padding:20px; background:linear-gradient(140deg,#30261833,transparent 65%),#101011; }
.lab-topup-packages h2,.lab-topup-bonus h2,:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .checkout-panel>h2 { font-size:16px; margin:0 0 16px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .plans { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:0; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .lab-topup-bonus, :is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .lab-pay-groups, :is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .checkout-panel > h2 { display:none; }
/* Lab checkout is opened in the dedicated payment picker. The legacy
   embedded panel must never flash underneath it when returning to Shop. */
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop > .checkout-panel { display:none !important; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .plan { min-height:114px; border-radius:16px; padding:14px; background:#19191a; border:1px solid #484031; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .plan.selected { border-color:#edc77a; background:linear-gradient(140deg,#59402099,#1a1814); box-shadow:0 0 18px #d1a84c16; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .plan-loki { flex-direction:column-reverse; gap:7px; align-items:flex-start; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .plan-loki-name { font-size:12px; font-weight:550; color:#c7bda9; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .plan-loki-price strong { font-size:22px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .plan-tagline,:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .plan-unit-price { display:none; }
.lab-topup-bonus>span { display:block; font-size:30px; color:#edc77a; margin-bottom:15px; }
.lab-topup-bonus p { font-size:13px; line-height:1.6; color:#bfb4a0; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .plan-details { display:none; }
.lab-pay-groups { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; width:min(100%,480px); }
.lab-pay-groups button { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; aspect-ratio:1; padding:8px; gap:7px; color:#eee8dd; background:#1a1a1b; border:1px solid #49402e; border-radius:16px; min-width:0; min-height:0; }
.lab-pay-groups button.active { border-color:#edc77a; background:linear-gradient(140deg,#51402588,#1a1916); box-shadow:0 0 16px #cfad4512; }
.lab-pay-groups button:disabled { opacity:.4; }
.lab-pay-groups strong { font-size:clamp(9px,2.7vw,13px); line-height:1.2; white-space:nowrap; font-weight:650; }
.lab-pay-art { width:65%; max-width:76px; height:auto; flex:0 1 auto; min-height:0; filter:drop-shadow(0 3px 6px #0005); }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .lab-pay-legacy { display:none; }
.lab-conversion-note { font-size:12px; line-height:1.55; margin:14px 0; }
.lab-promo-box { border:1px solid #6b563344; background:#211c1455; padding:14px; border-radius:16px; margin-top:18px; }
#view-shop .lab-promo-box .checkout-toggle { display:flex; justify-content:space-between; align-items:center; gap:10px; box-sizing:border-box; margin:0; padding:0; width:100%; min-height:36px; border:0; background:none; box-shadow:none; text-align:left; }
#view-shop .lab-promo-box .checkout-toggle .chevron { margin-left:auto; flex:0 0 auto; }
.lab-promo-box .promo-field-wrap { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:end; margin-top:14px; }
.lab-promo-box .promo-field-wrap.hidden { display:none; }
.lab-promo-box .field { margin:0; min-width:0; }
.lab-promo-box .promo-status { grid-column:1 / -1; }
.lab-promo-box input { min-width:0; width:100%; box-sizing:border-box; }
.lab-payment-options { display:grid; gap:10px; margin:20px 0; max-height:min(58dvh,520px); overflow:auto; }
.lab-payment-option { position:relative; display:grid; grid-template-columns:minmax(0,1fr) 24px; gap:3px 10px; color:#f1e7d3; background:#1d1c1a; border:1px solid #55472f; border-radius:14px; min-height:64px; padding:12px 16px; text-align:left; font:inherit; font-size:14px; }
.lab-payment-option strong { grid-column:1; font-size:15px; }
.lab-payment-option small { grid-column:1; color:#aaa08c; font-size:11px; }
.lab-payment-option.active { border-color:#e0bb68; background:#49371988; }
.lab-payment-radio { position:absolute; right:16px; top:50%; width:18px; height:18px; border:1px solid #716447; border-radius:50%; transform:translateY(-50%); }
.lab-payment-option.active .lab-payment-radio { border-color:#e8c575; box-shadow:inset 0 0 0 4px #1d1c1a,0 0 0 1px #e8c575; background:#e8c575; }
.lab-payment-continue { width:100%; }
.lab-payment-picker p { font-size:13px; line-height:1.6; }
/* Checkout follows the reference's bottom sheet with one scrolling list
   and a persistent total. The real provider routes stay in the picker. */
.community-dialog.lab-payment-picker {
  position:fixed;inset:auto 0 0;margin:0 auto;padding:0;
  width:min(560px,100%);max-width:100%;
  max-height:calc(100dvh - max(12px,var(--chrome-top,56px)));
  border:1px solid #5b503d;border-bottom:0;border-radius:28px 28px 0 0;
  background:#191a18;overflow:hidden;box-shadow:0 -18px 70px #0008;
}
.community-dialog.lab-payment-picker[open] { display:grid;grid-template-rows:auto minmax(0,1fr) auto; }
.lab-payment-picker::before { content:"";position:absolute;z-index:5;top:9px;left:calc(50% - 18px);width:36px;height:4px;border-radius:999px;background:#ffffff30;pointer-events:none; }
.lab-payment-picker .lab-payment-header { position:relative;top:auto;display:block;margin:0;padding:27px 56px 14px 20px;border-bottom:1px solid #ffffff0b;background:#191a18; }
.lab-payment-picker .lab-payment-kicker { margin:0 0 12px;color:#aaa593;font-size:10px;letter-spacing:.16em;text-transform:uppercase; }
.lab-payment-picker .lab-payment-header h2 { font-size:clamp(22px,5.5vw,26px);line-height:1.2;letter-spacing:-.4px; }
.lab-payment-picker .lab-payment-header .modal-close { position:absolute;right:13px;top:20px;width:36px;height:36px;min-width:36px;min-height:36px;border-radius:50%;background:#ffffff0a;color:#c4c0b6; }
.lab-payment-body { min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 20px 20px; }
.lab-payment-picker .lab-payment-lead { margin:0 0 22px;color:#b8b4a8;font-size:13px; }
.lab-payment-lead strong { color:#e4dfd2; }
.lab-payment-picker .lab-payment-options { margin:0;gap:9px;max-height:none;overflow:visible; }
.lab-payment-group-title { margin:17px 0 7px;color:#a8a18c;font-size:10px;font-weight:600;letter-spacing:.13em;text-transform:uppercase; }
.lab-payment-group-title:first-child { margin-top:0; }
.lab-payment-picker .lab-payment-option { grid-template-columns:42px minmax(0,1fr) 22px;gap:4px 12px;align-items:center;min-height:76px;padding:13px 12px;border-color:#ffffff20;border-radius:18px;background:#20211f; }
.lab-payment-picker .lab-payment-option strong { grid-column:2;grid-row:1;font-size:15px;line-height:1.3; }
.lab-payment-picker .lab-payment-option small { grid-column:2;grid-row:2;line-height:1.35;color:#b0ac9f;font-size:11px; }
.lab-payment-icon { grid-column:1;grid-row:1 / 3;display:grid;place-items:center;align-self:center;width:42px;height:42px;border-radius:12px;background:#ffffff07;color:#dfc27f;font-size:23px; }
.lab-payment-icon svg { width:27px;height:27px; }
.lab-payment-badge { display:inline-block;margin:4px 0 0 6px;padding:3px 7px;border-radius:999px;background:#e7bd58;color:#241e10;font-size:9px;line-height:1.2;vertical-align:middle;white-space:nowrap; }
.lab-payment-picker .lab-payment-radio { position:static;grid-column:3;grid-row:1 / 3;width:19px;height:19px;transform:none;border:2px solid #66685d; }
.lab-payment-picker .lab-payment-option.active { border-color:#d8b158;background:#2d291c; }
.lab-payment-picker .lab-payment-option.active .lab-payment-radio { border-color:#edc45e;box-shadow:inset 0 0 0 3px #2d291c;background:#edc45e; }
.lab-payment-footer { padding:12px 20px max(16px,var(--bottom-safe-area,0px),env(safe-area-inset-bottom,0px));border-top:1px solid #ffffff10;background:#191a18; }
.lab-payment-picker .lab-payment-fee { display:flex;align-items:flex-start;gap:9px;margin:0 0 12px;color:#bdb49b;font-size:11px;line-height:1.45; }
.lab-payment-fee>span:first-child { color:#dfb84e;font-size:19px;line-height:1; }
.community-dialog.lab-payment-picker .lab-payment-continue { min-height:52px;padding:12px 16px;border:1px solid #f0cb6a;border-radius:17px;background:linear-gradient(#ffdb74,#dfb23c);color:#231d10;font-size:15px;font-weight:750;white-space:normal; }
.lab-payment-picker .lab-payment-continue:disabled { opacity:.5; }
.lab-payment-picker .lab-receipt-email { display:grid;gap:7px;margin-top:18px;color:#e6ddc5;font-size:12px; }
.lab-payment-picker .lab-receipt-email[hidden] { display:none; }
.lab-payment-picker .lab-receipt-email small { color:#aca597;font-size:11px; }
@media(max-height:620px) {
 .lab-payment-picker .lab-payment-header { padding-top:24px;padding-bottom:10px; }
 .lab-payment-picker .lab-payment-kicker { margin-bottom:7px; }
 .lab-payment-footer { padding-top:9px;padding-bottom:max(10px,var(--bottom-safe-area,0px),env(safe-area-inset-bottom,0px)); }
 .lab-payment-picker .lab-payment-fee { margin-bottom:8px;font-size:10px; }
}
.partner-website-link { border-top:1px solid #ffffff18; padding-top:16px; margin-top:16px; }
.partner-website-link label { display:block; color:#b3aa97; font-size:12px; margin-bottom:8px; }
.partner-website-link>div { display:flex; align-items:center; gap:8px; }
.partner-website-link input { min-width:0; flex:1; color:#c7bea9; background:#1b1915; border:1px solid #4e412b; border-radius:12px; padding:12px; font:inherit; font-size:12px; }
html[data-lab="true"] .lab-partner-invites { display:none; }
.partner-dashboard-charts,.partner-analytics-charts { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; margin:18px 0; }
.partner-daily-card { border:1px solid #7a613844; background:linear-gradient(140deg,#33281644,#111112); border-radius:19px; padding:18px; min-width:0; }
.partner-daily-card>header { display:flex; justify-content:space-between; align-items:start; gap:12px; margin:0; }
.partner-daily-card h3 { margin:0; font-size:14px; font-weight:650; }
.partner-daily-card header strong { color:#ecc879; font-size:17px; white-space:nowrap; }
.partner-chart-selected { color:#e9ca89; font-size:12px; min-height:20px; margin:8px 0; }
.partner-daily-bars { height:100px; display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); align-items:end; gap:5px; }
.partner-daily-bars button { height:max(4px,var(--bar-height)); width:100%; min-width:0; border:1px solid transparent; border-radius:5px 5px 0 0; background:#8f7438; padding:0; position:relative; }
.partner-daily-bars button::after { content:""; position:absolute; inset:-8px -2px; min-height:24px; }
.partner-daily-bars button.empty { background:#53462c; }
.partner-daily-bars button[aria-pressed="true"] { background:#f4cc66; }
.partner-daily-bars button:focus-visible { outline:2px solid #f7d888; outline-offset:3px; }
.partner-chart-dates { display:flex; justify-content:space-between; color:#958c79; font-size:10px; margin:7px 0; }
.partner-daily-card>.muted { font-size:11px; line-height:1.5; }
.partner-chart-summary { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px; }
.partner-chart-summary span { display:grid; gap:5px; background:#ffffff05; border-radius:10px; padding:10px; color:#a69d89; font-size:10px; }
.partner-chart-summary b { font-size:14px; color:#eee4ce; }
.partner-withdraw-form { display:grid; gap:14px; }
.partner-withdraw-form label { display:grid; gap:6px; font-size:13px; color:#bfb4a0; }
.partner-withdraw-form input,.partner-withdraw-form select { min-height:46px; box-sizing:border-box; width:100%; color:#fff5e1; background:#1f1d1a; border:1px solid #665438; border-radius:12px; padding:10px; font:inherit; }
.partner-withdraw-form small,.partner-withdraw-history { color:#aaa08a; font-size:12px; line-height:1.5; }
.partner-withdraw-summary { font-size:14px; line-height:1.6; }
.partner-withdraw-history { max-height:180px; overflow:auto; }
.treasury-wheel { background:repeating-conic-gradient(from 0deg,#49361c 0deg var(--wheel-step,36deg),#1c1d20 var(--wheel-step,36deg) calc(2 * var(--wheel-step,36deg))); }
.treasury-win { text-align:center; width:min(400px,calc(100vw - 24px)); }
.treasury-win header { text-align:left; }
.treasury-win-lead { margin:0; color:#cfc4af; font-size:15px; }
.treasury-win-art { display:block; width:calc(100% + 32px); height:190px; margin:12px -16px 0; object-fit:cover; object-position:center; border-radius:14px; opacity:.94; }
.treasury-win-amount { display:block; color:#f7d98b; font-size:38px; letter-spacing:-.04em; margin:2px 0 8px; text-shadow:0 2px 16px #b9852e55; }
.treasury-win-divider { width:72%; height:1px; margin:0 auto 10px; background:linear-gradient(90deg,transparent,#ebc46e,transparent); }
.treasury-win p { color:#c2b8a4; line-height:1.6; font-size:14px; }
.treasury-win>.btn-primary { width:100%; }
.treasury-tasks-head { display:flex; align-items:center; gap:10px; }
.treasury-tasks-head h2 { margin:0; }
.treasury-tasks-head p { margin:5px 0 0; }
.treasury-tasks-brand { width:36px; height:36px; object-fit:contain; flex:none; }
.treasury-task-list { display:grid; gap:8px; margin-top:16px; }
.treasury-task { display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:10px; min-height:62px; padding:10px; border:1px solid #d8b96b2c; border-radius:15px; background:linear-gradient(120deg,#1d1b17,#151618); }
.treasury-task-icon { display:grid; place-items:center; width:40px; height:40px; border:1px solid #e1bd6a66; border-radius:12px; color:#e8c775; background:#0e0f10; }
.treasury-task strong { display:block; font-size:13px; }
.treasury-task p { margin:4px 0 0; font-size:11px; line-height:1.35; }
.treasury-task-soon { color:#e5c374; font-size:10px; white-space:nowrap; }
.treasury-tasks-note { margin-top:14px; font-size:11px !important; }
@media(min-width:850px) {
  html.lab-desktop:has(#view-shop:not(.hidden)) body { width:min(100%,1040px); }
  html.lab-desktop:has(#view-shop:not(.hidden)) .app { max-width:1040px; }
  .lab-topup-grid { grid-template-columns:minmax(0,1.8fr) minmax(230px,1fr); }
  :is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .plans { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .partner-analytics-charts { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:420px) {
  .lab-topup-head .lab-topup-balance { width:100%; }
  .lab-topup-bonus { padding:16px; }
  .lab-topup-bonus>span { display:none; }
  .lab-pay-groups { gap:7px; }
  .lab-pay-groups button { padding:7px 4px; border-radius:13px; gap:5px; }
  .lab-promo-box .promo-field-wrap { grid-template-columns:1fr; }
  .lab-topup-packages,:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .checkout-panel { padding:16px; }
}
/* Keep labels upright while the wheel rotates, including the initial last prize. */
.treasury-prize { transform:translate(-50%,-50%) rotate(var(--prize-angle,0deg)); }
.treasury-wheel--instant { transition:none; }
.lab-payment-thanks { display:flex; align-items:center; gap:12px; margin:2px 0 0; color:#bfb19a; text-align:center; font-size:11px; line-height:1.4; }
.lab-payment-thanks::before,.lab-payment-thanks::after { content:""; flex:1; height:1px; background:linear-gradient(90deg,transparent,#c7a45b66); }
.lab-payment-thanks::after { transform:rotate(180deg); }

/* Lock the document on iOS as well as desktop while native dialogs are open. */
html.dialog-background-locked { overflow:hidden !important; overscroll-behavior:none; }
html.dialog-background-locked body { position:fixed !important; top:var(--dialog-background-top,0px) !important; left:0; right:0; width:100%; overflow:hidden !important; }
.community-dialog,.create-category-dialog {
  --dialog-safe-top:max(16px,var(--chrome-top,56px));
  --dialog-safe-bottom:max(16px,var(--chrome-bottom,0px));
  position:fixed; inset:var(--dialog-safe-top) 0 var(--dialog-safe-bottom); margin:auto;
  max-height:calc(100dvh - var(--dialog-safe-top) - var(--dialog-safe-bottom));
  overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable;
}
.community-dialog>header { position:sticky; top:-22px; z-index:4; padding:12px 0; background:#111113; border-bottom:1px solid #b9974933; }
.community-dialog>header h2 { min-width:0; font-size:clamp(17px,4.5vw,22px); }
.treasury-wheel-mark { overflow:hidden; background:#0c0c0b; }
.treasury-wheel-mark img { display:block; width:100%; height:100%; object-fit:contain; border-radius:50%; }
/* A single inner tile, shared by home and the creation menu. */
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide),
html[data-lab="true"] .create-category-grid .home-shortcut:not(.home-shortcut--wide) {
  height:auto; min-height:0; padding:0; border:0; background:none; box-shadow:none; gap:9px; align-items:center;
}
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide)::before,
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide)::after,
html[data-lab="true"] .create-category-grid .home-shortcut:not(.home-shortcut--wide)::before,
html[data-lab="true"] .create-category-grid .home-shortcut:not(.home-shortcut--wide)::after { display:none; }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile,
html[data-lab="true"] .create-category-grid .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile {
  width:clamp(54px,16vw,66px); height:auto; aspect-ratio:1; border:1px solid transparent !important; border-radius:18px;
  background:linear-gradient(145deg,#262115,#0b0c0c 75%) padding-box,var(--lab-metal) border-box !important;
  box-shadow:inset 0 1px 0 #fff0b51c,0 4px 12px #0004 !important;
}
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-icon,
html[data-lab="true"] .create-category-grid .home-shortcut:not(.home-shortcut--wide) .home-shortcut-icon { width:64%; height:64%; }
html[data-lab="true"] .create-category-grid .home-shortcut-tile::before,
html[data-lab="true"] .create-category-grid .home-shortcut-tile::after { display:none; }
html[data-lab="true"] .create-category-dialog { background:linear-gradient(145deg,#17160f,#080909 70%); border-color:#c3a46066; }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-label,
html[data-lab="true"] .create-category-grid .home-shortcut:not(.home-shortcut--wide) .home-shortcut-label { font-size:11px; min-height:1.4em; color:#f4e8c9; }
@media(max-width:380px) { .community-dialog>header { top:-16px; } }
html[data-lab="true"] .create-category-grid .home-shortcut:not(.home-shortcut--wide) .home-shortcut-label { width:auto; padding:0; white-space:nowrap; overflow-wrap:normal; font-size:clamp(9px,2.7vw,11px); letter-spacing:-.15px; }
@media(max-width:380px) { .create-category-dialog { padding:16px; } html[data-lab="true"] .create-category-grid { gap:18px 8px; } }

/* Lab metallic gold: consistent highlights without animated shine or new motion. */
html[data-lab="true"] .home-shortcut-icon { color:var(--lab-gold); }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-wheel {
  border:4px solid transparent;
  background:repeating-conic-gradient(from 0deg,#0a0b0c55 0deg .7deg,transparent .7deg var(--wheel-step,36deg)) padding-box,
    radial-gradient(ellipse at 25% 15%,#fff4c938,transparent 65%) padding-box,
    repeating-conic-gradient(from 0deg,#514026 0deg var(--wheel-step,36deg),#090a0a var(--wheel-step,36deg) calc(2 * var(--wheel-step,36deg))) padding-box,
    var(--lab-metal,linear-gradient(135deg,#a87932,#f8df96 45%,#b28a42)) border-box;
  box-shadow:0 0 0 3px #e9c66b20,0 8px 24px #0005,inset 0 0 18px #0003;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-prize { color:#f5d47f; text-shadow:0 1px 2px #000; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-wheel-mark { border-color:var(--lab-gold,#e9c66b); box-shadow:0 0 0 3px #11120f,0 2px 10px #0005; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-pointer { color:#fff0b4; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-card { border-color:var(--accent-line); background:radial-gradient(ellipse at top,#e9c66b0c,transparent 65%),#151618; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-spin,
html[data-lab="true"] .btn-primary,
html[data-lab="true"] .filter-pill.active { background:var(--lab-metal,linear-gradient(135deg,#a87932,#f8df96 45%,#b28a42)); color:var(--accent-ink); }
html[data-lab="true"] .lab-pay-groups button.active { border-color:var(--lab-gold); background:linear-gradient(140deg,#e9c66b26,#151614); }

/* Lab home: a continuous warm canvas, transparent chrome and vertical trends. */
html[data-lab="true"] body:has(#view-home:not(.hidden)) {
  background:radial-gradient(ellipse 440px 340px at 68% 80px,#c5a04c26,transparent 78%),
    radial-gradient(ellipse 360px 280px at 0 240px,#aa8c3820,transparent 80%),
    linear-gradient(180deg,#222015 0px,#15150f 340px,#080908 820px,#080908 100%);
  background-repeat:no-repeat;
}
html[data-lab="true"] .topbar { background:transparent; border-color:transparent; box-shadow:none; }
html[data-lab="true"] #view-home .trends-scroller {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px;
  overflow:visible; padding-bottom:0; touch-action:pan-y; scroll-snap-type:none;
}
html[data-lab="true"] #view-home .trend-card { width:100%; min-width:0; aspect-ratio:3 / 4; border-radius:16px; }
/* Fill the Home card edge to edge with the same crop for poster and video,
   so playback and returning Home never change the framing. */
html[data-lab="true"] #view-home .trend-card--native-vertical > img,
html[data-lab="true"] #view-home .trend-card--native-vertical > .card-preview-poster,
html[data-lab="true"] #view-home .trend-card--native-vertical > video.card-preview-video {
  width:100%; height:100%; object-fit:cover; object-position:center;
  background:#0a0a0c; transition:none;
}
html[data-lab="true"] #view-trends .gallery-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
html[data-lab="true"] #view-home .trends-scroller>.muted { grid-column:1 / -1; }
/* Classic premium reference: sculpted black glass with two fine gold edges. */
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile,
html[data-lab="true"] .create-category-grid .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile {
  position:relative; isolation:isolate;
  background:radial-gradient(ellipse at 38% 0%,#fff0bd1c,transparent 48%) padding-box,
    linear-gradient(155deg,#1f201b 0%,#0a0c0b 48%,#080908 80%,#252015 100%) padding-box,
    linear-gradient(145deg,#fff1c0 0%,#806c42 22%,#d7b87b 43%,#65532c 67%,#f7dc98 88%,#b99248 100%) border-box !important;
  box-shadow:inset 0 2px 2px #fff3c72b,inset 0 -3px 5px #0009,0 4px 9px #0006 !important;
}
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile::before,
html[data-lab="true"] .create-category-grid .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile::before {
  display:block; content:""; position:absolute; inset:3px; border:1px solid #d7ba7b55; border-radius:14px; pointer-events:none;
  background:none; box-shadow:inset 0 1px 1px #fff2c01f; z-index:0;
}
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-icon,
html[data-lab="true"] .create-category-grid .home-shortcut:not(.home-shortcut--wide) .home-shortcut-icon { position:relative; z-index:1; }

.trends-all-below { display:none; }

/* Lab home curation: the warm wash reaches the trend section and ends before its cards. */
html[data-lab="true"] body:has(#view-home:not(.hidden)) {
  background:
    linear-gradient(180deg,#050504a0 0,#05050488 300px,#0505046c 650px,#0505049f 1100px,#050504e4 100%),
    url("/shop/assets/home/lumix-lab-home-bg.webp?v=20261021-1") center top / 112% auto no-repeat fixed,
    #080908;
  background-attachment:fixed;
}


html[data-lab="true"] #view-home .home-shortcuts { justify-items:center; }
html[data-lab="true"] #view-home .trends-head { align-items:center; }
html[data-lab="true"] #view-home .trends-head-all { display:none; }
html[data-lab="true"] #view-home .trends-all-below { display:block; width:max-content; margin:16px auto 4px; padding:8px 18px; border:1px solid #c9a65988; border-radius:999px; background:#17150f; color:#efd18a; }
html[data-lab="true"] #view-home .trends-all-below:hover { background:#2a2417; border-color:#efd18a; }
html[data-lab="true"] #view-home .trends-head-text { text-align:center; width:100%; }
/* Keep the six Lab actions as one precisely centered 3×2 block. */
html[data-lab="true"] #view-home .home-shortcuts {
  width:min(100%,360px);
  margin-inline:auto;
  grid-template-columns:repeat(3,minmax(0,1fr));
  justify-items:center;
  align-items:start;
}
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) {
  width:100%;
  justify-items:center;
  text-align:center;
}
/* Lab topbar occupies its own row; transparent means no opaque fill, never overlap. */
html[data-lab="true"] .topbar {
  position:relative;
  top:auto;
  min-height:74px;
  padding-top:calc(var(--chrome-top) + 8px);
  padding-bottom:12px;
  z-index:40;
}
html[data-lab="true"] #view-home {
  padding-top:0;
}
html[data-lab="true"] #view-home .home-banners {
  margin-top:0;
}
.halloween-decor, .halloween-mark { display:none !important; }
/* Seasonal Halloween layer: decorative only, never changes the hit area or layout. */
html[data-lab="true"][data-season="halloween"] #view-home {
  position:relative;
  isolation:isolate;
  overflow:hidden;
}
html[data-lab="true"][data-season="halloween"] #view-home > *:not(.halloween-decor) { position:relative; z-index:1; }
html[data-lab="true"][data-season="halloween"] .halloween-decor {
  display:block;
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  overflow:hidden;
  opacity:.92;
}
html[data-lab="true"][data-season="halloween"] .halloween-decor::before,
html[data-lab="true"][data-season="halloween"] .halloween-decor::after {
  content:"";
  position:absolute;
  width:260px;
  height:260px;
  border-radius:50%;
  filter:blur(34px);
  opacity:.16;
  animation:halloween-ember 7s ease-in-out infinite alternate;
  background:#f0a51a;
}
html[data-lab="true"][data-season="halloween"] .halloween-decor::before { top:120px; left:-140px; }
html[data-lab="true"][data-season="halloween"] .halloween-decor::after { top:360px; right:-160px; opacity:.11; }
html[data-lab="true"][data-season="halloween"] .halloween-web {
  position:absolute;
  width:205px;
  height:205px;
  opacity:.2;
  background:url("/shop/assets/home/halloween-web.svg") center / contain no-repeat;
}
html[data-lab="true"][data-season="halloween"] .halloween-web--left { top:-36px; left:-64px; transform:rotate(16deg); }
html[data-lab="true"][data-season="halloween"] .halloween-web--right { top:218px; right:-80px; transform:rotate(-18deg) scale(.88); }
html[data-lab="true"][data-season="halloween"] .halloween-pumpkin {
  position:absolute;
  width:34px;
  height:29px;
  border:1px solid #e8b956aa;
  border-radius:48% 48% 44% 44%;
  background:url("/shop/assets/home/halloween-pumpkin.svg") center / contain no-repeat;
  border:0;
  border-radius:0;
  filter:drop-shadow(0 0 7px #e8a52c55);
  opacity:.62;
}
html[data-lab="true"][data-season="halloween"] .halloween-pumpkin--left { top:170px; left:18px; transform:rotate(-10deg) scale(.72); }
html[data-lab="true"][data-season="halloween"] .halloween-pumpkin--right { top:520px; right:22px; transform:rotate(9deg) scale(.58); opacity:.42; }
html[data-lab="true"][data-season="halloween"] #homeBannerMain .halloween-mark {
  display:block;
  content:"";
  width:34px;
  height:34px;
  position:absolute;
  right:14px;
  top:13px;
  z-index:3;
  pointer-events:none;
  padding:3px;
  border:1px solid #e4b95788;
  border-radius:999px;
  background:url("/shop/assets/home/halloween-pumpkin.svg") center / 30px 30px no-repeat,#120e08aa;
  color:#ffd779;
  font-size:12px;
  letter-spacing:.04em;
  text-shadow:0 0 10px #e9a92e;
  box-shadow:0 0 18px #e2a43733,inset 0 0 8px #f3c35c18;
}
html[data-lab="true"][data-season="halloween"] #homeBannerMain {
  box-shadow:0 0 0 1px #e7b74d55,0 0 32px #e4a53324;
}
@keyframes halloween-ember { to { opacity:.08; transform:scale(.94); } }
@media (prefers-reduced-motion:reduce) {
  html[data-lab="true"][data-season="halloween"] .halloween-decor::before,
  html[data-lab="true"][data-season="halloween"] .halloween-decor::after { animation:none; filter:blur(24px); }
}
html[data-lab="true"] .brand-lockup { width:clamp(155px,38vw,190px); max-width:190px; max-height:66px; }
html[data-lab="true"] .topbar-actions { margin-left:auto; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-treasury { padding-top:0; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-treasury .treasury-heading { margin-top:0; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-treasury .treasury-title { margin-top:4px; }
/* Optical centering for the six asymmetric SVG glyphs inside identical tiles. */
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide):nth-child(1) .home-shortcut-icon { transform:translate(calc(-50% - 2px),calc(-50% - 2px)); }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide):nth-child(2) .home-shortcut-icon { transform:translate(-50%,-50%); }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide):nth-child(3) .home-shortcut-icon { transform:translate(-50%,calc(-50% - 2px)); }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide):nth-child(4) .home-shortcut-icon { transform:translate(-50%,calc(-50% - 2px)); }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide):nth-child(5) .home-shortcut-icon { transform:translate(-50%,calc(-50% - 1px)); }
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide):nth-child(6) .home-shortcut-icon { transform:translate(-50%,calc(-50% - 1px)); }
/* The glyph is centered relative to its tile, never relative to the full button label. */
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile {
  position:relative;
}
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-icon {
  left:50%; top:50%; transform:translate(-50%,-50%);
}
/* SVGs must be absolutely positioned inside the tile; relative positioning uses the label flow. */
html[data-lab="true"] #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-icon {
  position:absolute !important;
  left:50% !important;
  top:50% !important;
  margin:0 !important;
  transform:translate(-50%,-50%) !important;
}
/* The create-category modal uses the same tile markup; center its glyphs in the tile too. */
html[data-lab="true"] #createCategoryGrid .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile { position:relative; }
html[data-lab="true"] #createCategoryGrid .home-shortcut:not(.home-shortcut--wide) .home-shortcut-icon {
  position:absolute !important;
  left:50% !important;
  top:50% !important;
  margin:0 !important;
  transform:translate(-50%,-50%) !important;
}

/* Treasury reference: black glass, fine gold edges, and real prize text. */
:is(html[data-lab="true"],html[data-studio-v2="true"]) dialog.treasury-win {
  padding:34px 24px 24px; width:min(430px,calc(100vw - 28px));
  border:1px solid #efd28a; border-radius:26px;
  background:radial-gradient(ellipse at 90% 0,#8b632322,transparent 48%),
    linear-gradient(130deg,#15130f,#060706 55%,#141009);
  box-shadow:0 0 0 4px #d7ad4810,0 0 28px #d7ad4820,0 28px 90px #000b;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-win::backdrop { background:#020302d9; backdrop-filter:blur(6px); }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-win > header {
  position:static; display:block; margin:0; padding:10px 0 0;
  background:transparent; border:0; text-align:center;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-win > header h2 {
  margin:0; font-size:clamp(26px,7vw,36px); letter-spacing:-.045em;
  color:#f9df9c; text-shadow:0 2px 20px #e5ad3a22;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-win .modal-close {
  position:absolute; top:12px; right:12px; width:32px; height:32px;
  border:1px solid #d8bb75; border-radius:50%; background:#0b0c0b; color:#f4dc9e;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-win .treasury-win-lead { margin:8px 0 0; font-size:16px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-win-art {
  width:calc(100% + 48px); height:auto; aspect-ratio:900 / 576; margin:4px -24px 0;
  border-radius:0; object-fit:contain;
  mask-image:linear-gradient(transparent,#000 8%,#000 85%,transparent);
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-win .treasury-win-amount { font-size:clamp(34px,10vw,48px); margin:-4px 0 12px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-win > p:not(.treasury-win-lead) { margin:16px 0 22px; font-size:13px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-win > .btn-primary { min-height:50px; border-radius:16px; border:1px solid #f4d68e; font-size:17px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-tasks {
  padding:18px 12px 14px; border-color:#b99a5144; background:#090a09;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-tasks-head {
  position:relative; min-height:150px; padding:12px 10px; overflow:hidden; border-radius:14px;
  background:linear-gradient(90deg,#090a09 28%,#090a09bb 62%,#090a0922),
    url("/shop/assets/treasury/tasks-coin.webp") right center / auto 100% no-repeat;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-tasks-head > div { max-width:76%; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-tasks-head h2 { margin:10px 0 6px; font-size:clamp(23px,6vw,31px); letter-spacing:-.04em; color:#f5dfad; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-tasks-head p { font-size:12px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-task {
  min-height:76px; padding:12px 10px; border-radius:17px;
  border-color:#d2ab4c40; background:linear-gradient(115deg,#191710,#090a09 80%);
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-task-icon { box-shadow:inset 0 1px 8px #dfb75418,0 0 8px #e9bd4c0a; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-task-soon { padding:5px 7px; border:1px solid #b69b5740; border-radius:999px; background:#e4bb5710; }
@media(max-height:680px) {
  :is(html[data-lab="true"],html[data-studio-v2="true"]) dialog.treasury-win { padding-top:26px; }
  :is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-win-art { max-height:180px; }
  :is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-win > p:not(.treasury-win-lead) { margin:10px 0 14px; }
}

/* Lab controls: quiet dark surfaces and a continuous, restrained gold edge. */
.media-upload-tile { display:none; }
.account-language-entry { display:none; }
html[data-lab="true"] #profileLanguage {
  display:flex; align-items:center; gap:12px; width:100%; min-height:72px;
  margin:14px 0 18px; padding:12px; border:1px solid #b99b5866; border-radius:16px;
  color:#f0e7d4; background:linear-gradient(130deg,#25231d,#171819); text-align:left;
}
html[data-lab="true"] #profileLanguage .account-help-icon { display:grid; }
html[data-lab="true"] #profileLanguage .account-help-copy { display:grid; gap:5px; }
html[data-lab="true"] #profileLanguage .account-help-hint,
html[data-lab="true"] #profileLanguage .account-help-arrow { display:block; }
html[data-lab="true"] #profileLanguage .account-help-hint { color:#bdb5a5; font-size:12px; }
html[data-lab="true"] #profileLanguage .account-help-arrow { margin-left:auto; color:#ceb477; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .btn-primary,
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-spin,
html[data-lab="true"] .buy-pill,
html[data-lab="true"] .filter-pill.active,
html[data-lab="true"] .chip.active,
html[data-lab="true"] .aspect-cell.active,
html[data-lab="true"] .video-mode-tab.active {
  border:1px solid #c5a45f;
  background:linear-gradient(135deg,#302b21,#1a1b1b 65%,#24221c);
  color:#f0d89d; box-shadow:inset 0 1px 0 #f1cf7f10,0 3px 12px #0002;
  transition:background .18s ease,border-color .18s ease,box-shadow .18s ease;
}
html[data-lab="true"] .btn-primary:hover,
html[data-lab="true"] .buy-pill:hover {
  background:linear-gradient(135deg,#373023,#22231f); border-color:#e2c480;
  box-shadow:inset 0 1px 0 #f1cf7f18,0 3px 14px #0003; filter:none;
}
html[data-lab="true"] .btn-primary:disabled { opacity:.45; box-shadow:none; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet textarea,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet .field-input,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet .choice-panel-trigger,
html[data-lab="true"] .choice-panel-option[aria-selected="true"],
html[data-lab="true"] .choice-panel-option.active {
  border-color:#b99b5870; box-shadow:inset 0 1px 0 #e8c77608;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet textarea:focus,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet .field-input:focus {
  border-color:#d1b477; box-shadow:0 0 0 2px #c6a45c15;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .dropzone {
  display:block; width:100%; min-height:0; padding:12px; border:1px solid #b99b584d;
  border-radius:16px; background:linear-gradient(140deg,#201f1a,#171819);
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .dropzone-inner {
  display:flex; flex-direction:column; align-items:flex-start; gap:8px; padding:0;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .media-upload-tile {
  display:flex; align-items:center; justify-content:center; gap:9px;
  width:88px; height:88px; flex:none; box-sizing:border-box;
  border:1px dashed #c4a45b99; border-radius:16px; color:#dec182;
  background:radial-gradient(ellipse at top,#cba5540c,transparent 75%),#24221b;
}
html[data-lab="true"] .media-upload-tile svg { display:block; width:24px; height:24px; }
html[data-lab="true"] .media-upload-plus { font-size:27px; font-weight:400; line-height:1; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .dropzone-title { color:#e5dac4; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .dropzone-sub { margin:0; color:#aaa394; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .dropzone:hover,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .dropzone:focus-within {
  border-color:#d2b16e; background:#25231d; outline:none; box-shadow:0 0 0 2px #c4a45b12;
}
html[data-lab="true"] #profileLanguage:focus-visible { outline:2px solid #d2b16e; outline-offset:3px; }
@media(prefers-reduced-motion:reduce) {
  html[data-lab="true"] .btn-primary,
  html[data-lab="true"] .buy-pill,
  html[data-lab="true"] .filter-pill.active,
  html[data-lab="true"] .chip.active { transition:none; }
}
@media (max-width:480px) {
  html[data-lab="true"] .brand-lockup { width:clamp(132px,38vw,164px); max-width:164px; max-height:66px; }
}
.in-app-guide { display:flex; flex-direction:column; width:min(720px,calc(100vw - 24px)); height:min(85dvh,900px); overflow:hidden; }
.in-app-guide:not([open]) { display:none; }
.in-app-guide > header { flex:none; }
.in-app-guide iframe { display:block; flex:1; min-height:0; width:100%; border:0; background:#111214; border-radius:12px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet #generateBtn.lumix-action--primary {
  background:linear-gradient(135deg,#302b21,#1a1b1b 65%,#24221c) !important;
  border:1px solid #c5a45f !important;
  color:#f0d89d !important;
  box-shadow:inset 0 1px 0 #f1cf7f10,0 3px 12px #0002 !important;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet #generateBtn:disabled {
  opacity:1; color:#bdb29a !important; border-color:#8e774d !important; cursor:not-allowed;
}
html[data-lab="true"] .choice-panel-option[aria-pressed="true"] {
  background:linear-gradient(135deg,#302b21,#1a1b1b);
  border-color:#c5a45f; color:#f0d89d;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .plan {
  padding-top:22px; padding-bottom:16px; min-height:126px;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-shop .plan-top { margin:8px 0 4px; }

/* Reference uploads: real transfer progress, then a separate processing state. */
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file-list { display:flex;flex-wrap:wrap;gap:10px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile,
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-upload-tile,
:is(html[data-lab="true"],html[data-studio-v2="true"]) .ref-thumb {
  position:relative;isolation:isolate;width:clamp(88px,23vw,118px);height:clamp(88px,23vw,118px);flex:0 0 auto;
  padding:0;overflow:hidden;border:1px solid #a88b4f80;border-radius:18px;background:#181819;box-sizing:border-box;
}
.reference-tile-media { position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-1;pointer-events:none; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .reference-file-copy { align-self:flex-end;gap:2px;padding:25px 7px 7px;background:linear-gradient(transparent,#000d);width:100%;z-index:1; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .reference-file-copy strong { font-size:10px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .reference-file-copy small { color:#f0dcae;font-size:10px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .reference-file-icon { position:absolute;inset:0;margin:auto;background:none;z-index:-1; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .prompt-reference-tag { position:absolute;left:6px;bottom:31px;padding:2px 4px;min-height:22px;font-size:9px;z-index:2; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file-remove,
:is(html[data-lab="true"],html[data-studio-v2="true"]) .ref-del,
.reference-upload-remove { position:absolute;top:5px;right:5px;z-index:4;display:grid;place-items:center;border:1px solid #ffffff28;background:#080808c9;color:white;border-radius:50%;width:28px;height:28px;min-width:28px;padding:0; }
.reference-ready { position:absolute;top:5px;left:5px;z-index:3;display:grid;place-items:center;width:25px;height:25px;border:1px solid #caab66;border-radius:50%;background:#10100dc9;color:#f2d17e;font-size:17px; }
.reference-upload-shade { position:absolute;inset:0;background:linear-gradient(#09090933,#090909b8); }
.reference-upload-spinner { position:absolute;left:calc(50% - 12px);top:calc(45% - 12px);width:24px;height:24px;border:2px solid #d6b86a44;border-top-color:#f4d58b;border-radius:50%;animation:reference-spin .9s linear infinite; }
.reference-upload-status { position:absolute;bottom:16px;left:5px;right:5px;max-height:45px;overflow:auto;text-align:center;color:#fff1c9;font-size:11px;line-height:1.25; }
.reference-upload-progress { position:absolute;bottom:7px;left:8px;right:8px;height:3px;border-radius:8px;background:#ffffff30;overflow:hidden; }
.reference-upload-fill { display:block;height:100%;background:#e9c678;transition:width .15s ease; }
.reference-upload-retry { position:absolute;bottom:7px;left:8px;right:8px;min-height:25px;border:1px solid #bf985a;border-radius:8px;background:#241c13;color:#f2d18d;font-size:10px; }
.reference-upload-retry[hidden] { display:none; }
.reference-upload-tile.has-error { border-color:#c56d65; }
.reference-upload-tile.has-error .reference-upload-spinner,
.reference-upload-tile.has-error .reference-upload-progress { display:none; }
.reference-upload-tile.has-error .reference-upload-status { bottom:35px;font-size:10px;color:#ffd3cd; }
@keyframes reference-spin { to { transform:rotate(360deg); } }
.toast { display:flex;align-items:flex-start;gap:14px; }
.toast-close { flex:0 0 28px;width:28px;height:28px;min-height:28px;padding:0;border:0;border-radius:50%;color:inherit;background:#ffffff18; }
.toast--error { border:1px solid #f18e86;background:linear-gradient(135deg,#a73e3e,#642828);color:#fff5f2;box-shadow:0 8px 30px #0008; }
.custom-order form,.custom-order label { display:grid;gap:8px; }
.custom-order form { gap:16px; }
.custom-order select,.custom-order textarea { width:100%;box-sizing:border-box;padding:12px;color:#f5e6c6;background:#1d1d1e;border:1px solid #8d7444;border-radius:12px;font:inherit; }
.custom-order small { color:#bbb2a0;font-size:12px;line-height:1.5; }
.treasury-chest svg { width:38px;height:38px;display:block;margin:auto; }
.treasury-result-icon { width:19px;height:19px;display:inline-block;vertical-align:middle; }
.treasury-win-amount .treasury-result-icon { width:34px;height:34px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-treasury { padding-top:4px;padding-bottom:calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 28px); }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .treasury-title { margin:4px 0 14px; }
@media(prefers-reduced-motion:reduce) { .reference-upload-spinner { animation:none; } .reference-upload-fill { transition:none; } }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile,
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-upload-tile,
:is(html[data-lab="true"],html[data-studio-v2="true"]) .ref-thumb { width:clamp(100px,26vw,118px);height:clamp(100px,26vw,118px); }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .reference-file-copy {
  position:absolute;right:5px;bottom:6px;align-self:auto;width:auto;max-width:52px;padding:2px 4px;
  border-radius:6px;background:#080808c9;gap:0;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .reference-file-copy strong { display:none; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .reference-file-copy small { font-size:9px;white-space:nowrap; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .prompt-reference-tag { bottom:6px;left:5px;min-height:18px;padding:2px 3px;font-size:9px;line-height:1.2; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .reference-tile-footer { position:absolute;left:5px;right:5px;bottom:6px;display:flex;align-items:center;justify-content:space-between;gap:4px;z-index:2;min-width:0; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .reference-tile-footer > .reference-file-copy { position:static;flex:0 0 auto;max-width:none; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .reference-tile-footer > .prompt-reference-tag { position:static;flex:0 1 auto;min-width:0;max-width:calc(100% - 35px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.toast > span { flex:1;min-width:0; }
.toast--error { width:min(440px,calc(100% - 32px));max-width:calc(100% - 32px);box-sizing:border-box;text-align:left;gap:12px;border-radius:16px;padding:14px 16px; }
.reference-upload-tile { scroll-margin-top:70px;scroll-margin-bottom:150px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .reference-tile-footer { flex-wrap:wrap;row-gap:3px; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .reference-file--tile .reference-tile-footer > .prompt-reference-tag { flex:0 0 auto;width:max-content;max-width:100%;overflow:visible;text-overflow:clip; }

/* Shared Studio release: warmer gold surfaces without reducing text contrast. */
:is(html[data-lab="true"],html[data-studio-v2="true"]) {
  --studio-warm-bg:radial-gradient(ellipse at 8% 2%,#92734152,transparent 58%),linear-gradient(155deg,#413625,#29251d 55%,#332b1e);
  --studio-warm-panel:linear-gradient(125deg,#5d4a2c45,#28251f 65%);
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet .sheet,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet .sheet-body,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-chat,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-tools,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #audioStudio { background:var(--studio-warm-bg);color:#f8f0df; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet .lab-model-picker,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet .dropzone,
:is(html[data-lab="true"],html[data-studio-v2="true"]) .studio-tool-card { background:var(--studio-warm-panel);border-color:#c2a36770; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .balance-pill,
:is(html[data-lab="true"],html[data-studio-v2="true"]) .balance-badge,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #balancePill { border-color:#d4b26799;box-shadow:0 0 0 1px #e2bf7233,0 0 22px #d2ac4e44,inset 0 0 14px #d7b55e12; }
html[data-studio-v2="true"] .treasury-button { display:grid;place-items:center;position:relative;width:40px;height:40px;flex-shrink:0;border:1px solid #b29353;border-radius:14px;background:#3a301c;color:#eed08b; }
html[data-studio-v2="true"] .topbar #languageButton { display:none; }
html[data-studio-v2="true"] #view-shop .page-intro { padding-top:calc(var(--chrome-top) + 20px); }
/* Lab topbar already reserves the native chrome; do not reserve it twice. */
html[data-lab="true"] #view-shop .page-intro { padding-top:8px; }
html[data-studio-v2="true"] #view-shop .lab-topup-bonus,
html[data-studio-v2="true"] #view-shop .lab-pay-groups,
html[data-studio-v2="true"] #view-shop .checkout-panel > h2,
html[data-studio-v2="true"] #view-shop .lab-pay-legacy,
html[data-studio-v2="true"] #view-shop #emailFieldWrap { display:none; }
html[data-studio-v2="true"] #view-shop .checkout-panel { border:1px solid #a68b4f66;border-radius:22px;background:var(--studio-warm-panel);padding:20px; }
.lab-receipt-email { display:grid;gap:7px;color:#efdbac;margin:14px 0; }
.lab-receipt-email[hidden] { display:none; }
.lab-receipt-email input { width:100%;padding:12px;border:1px solid #b69a5a;border-radius:12px;background:#24211b;color:#f9efd9;box-sizing:border-box;font:inherit; }
.lab-receipt-email small { font-size:12px;color:#c8c0af; }
.treasury-task { align-items:flex-start; }
.treasury-task-copy { flex:1;min-width:0; }
.treasury-task-copy p { overflow-wrap:anywhere; }
.treasury-task-reward { display:inline-flex;align-items:center;gap:5px;color:#f2d18b;font-size:14px;font-weight:750; }
.treasury-task-reward img { width:18px;height:18px; }
.treasury-task-actions { display:grid;gap:7px;flex:0 0 130px; }
.treasury-task-actions button { white-space:normal;min-height:38px;font-size:11px; }
.treasury-task--awarded { border-color:#b79b5b66; }
.treasury-task--rejected .treasury-task-copy p { color:#f0b8a1; }
.treasury-task-form form,.treasury-task-form label { display:grid;gap:8px; }
.treasury-task-form form { gap:15px; }
.treasury-task-form textarea,.treasury-task-form select,.treasury-moderation-item input { padding:12px;border:1px solid #aa8e57;border-radius:11px;background:#28241c;color:#f5ead4;font:inherit;box-sizing:border-box;width:100%; }
.treasury-moderation-item { margin:12px 0;padding:16px;border:1px solid #8c744955;border-radius:16px;background:#2f281c; }
.treasury-moderation-item button { margin:12px 6px 0 0; }
.treasury-moderation-user { display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;margin-top:8px; }
.treasury-moderation-user small { flex-basis:100%;color:var(--muted); }
.treasury-moderation-user button { margin:0; }
.treasury-proof { white-space:pre-wrap;overflow-wrap:anywhere; }
.wardrobe-library { border:1px solid #b89a5d66;border-radius:16px;padding:12px;margin:14px 0;background:#64503224; }
.wardrobe-library summary { color:#edd29b;cursor:pointer;font-weight:700; }
.wardrobe-catalog-tabs { display:flex;gap:7px;overflow-x:auto;padding:6px 0 10px;scrollbar-width:thin; }
.wardrobe-catalog-tabs .chip { flex:0 0 auto;white-space:nowrap;min-height:32px; }
.wardrobe-catalog-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;max-height:390px;overflow:auto;padding:2px; }
.wardrobe-garment { position:relative;display:grid;gap:5px;align-content:start;padding:5px;border:1px solid #8d764455;border-radius:12px;background:#211e18;color:#f1e4cd;font:inherit;cursor:pointer;min-width:0; }
.wardrobe-garment-photo { position:relative;display:block;min-width:0; }
.wardrobe-garment img { display:block;width:100%;height:auto;aspect-ratio:4/5;object-fit:contain;background:#e1d5bf;border-radius:8px; }
/* Warm the light catalog backdrops in the UI while preserving the source references. */
.wardrobe-garment img,
:is(#wardrobeClothesPreview,#wardrobeObjectsPreview) .ref-thumb img { filter:sepia(.5) brightness(.9); }
#genSheet.wardrobe-form > .sheet-body { overflow-anchor:none; }
.wardrobe-garment strong { padding:2px;font-size:10px;font-weight:600;line-height:1.3;overflow-wrap:anywhere; }
.wardrobe-garment.selected { border-color:#efd087;box-shadow:0 0 0 1px #f4cf77; }
.wardrobe-garment-check { position:absolute;inset:4px 4px auto auto;box-sizing:border-box;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:#201b12df;border:1px solid #c6a45c;color:#f3d180;pointer-events:none; }
.wardrobe-garment-check svg { display:block;width:12px;height:12px; }
#wardrobeObjectsBlock { margin-top:14px; }
#wardrobeObjectsPreview { margin-top:8px; }
#genSheet #wardrobeBlock .dropzone .media-upload-tile { gap:4px; }
#genSheet #wardrobeBlock .dropzone .media-upload-tile .wardrobe-upload-plus { width:12px;height:12px;flex:none; }
@media(max-width:480px) { .treasury-task { flex-wrap:wrap;gap:10px; } .treasury-task-actions { flex-basis:100%;grid-template-columns:repeat(2,minmax(0,1fr)); } .treasury-task-actions button:only-child { grid-column:1/-1; } }
@media(min-width:768px) { .wardrobe-catalog-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
:is(html[data-lab="true"],html[data-studio-v2="true"]) .balance-chip { border-color:#dbb96b99;box-shadow:0 0 0 1px #e2bf7233,0 0 24px #d2ac4e55,inset 0 0 14px #d7b55e12; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) { --lab-workspace:var(--studio-warm-bg);--lab-gold:#e2c27f;--lab-text:#f7efdc; }
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form > .sheet-body,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-head,
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form > .sheet-foot { background:var(--studio-warm-bg); }

/* Community controls share the same quiet charcoal and gold finish. */
html[data-lab="true"] {
  --community-control-bg:linear-gradient(145deg,#25231e,#111310);
  --community-control-line:#b89a5b;
  --community-control-ink:#efd18d;
}
html[data-lab="true"] .partner-round-btn,
html[data-lab="true"] .sheet-round-btn:not(.sheet-gallery-action),
html[data-lab="true"] .feed-creator-row .gc-follow,
html[data-lab="true"] .sheet-round-btn.sheet-gallery-action .sheet-action-icon {
  border:1px solid var(--community-control-line);
  background:var(--community-control-bg);
  color:var(--community-control-ink);
  box-shadow:inset 0 1px #f8e4ae18,0 2px 8px #0004;
}
html[data-lab="true"] .sheet-round-btn.sheet-gallery-action.sheet-like-btn.liked .sheet-action-icon {
  background:var(--community-control-bg);color:#f2c772;border-color:#e5be6a;
}
html[data-lab="true"] .partner-round-btn { width:44px;height:44px;min-width:44px;min-height:44px; }
html[data-lab="true"] :is(.partner-round-btn,.sheet-round-btn):focus-visible {
  outline:2px solid #f5d68c;outline-offset:3px;
}
html[data-lab="true"] #view-ideas:not(.feed-mode) #galleryFilters { display:flex;gap:7px;flex-wrap:wrap; }
html[data-lab="true"] #galleryFilters .filter-pill { flex:1 1 auto;min-height:38px;padding:8px 10px;font-size:12px; }
html[data-lab="true"] #galleryFilters .filter-pill.active {
  background:var(--community-control-bg);border-color:var(--community-control-line);color:var(--community-control-ink);
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-action {
  width:44px;right:calc(var(--feed-action-right) - 6px);font-size:10px;
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-action :is(.gc-like,.gc-comment,.gc-share,.gc-repeat) {
  position:relative;width:44px;height:40px;min-width:44px;min-height:40px;
  border:0 !important;background:transparent !important;box-shadow:none !important;
  color:var(--community-control-ink);
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-action button::before {
  content:"";position:absolute;inset:1px 3px;border-radius:50%;
  border:1px solid var(--community-control-line);background:#11130fcc;z-index:-1;
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-action button { isolation:isolate; }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-action .gc-action-icon,
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-action .gc-action-icon svg { width:20px;height:20px; }
/* Retain the existing short-screen row and its spacing. */
@media(max-height:620px) {
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-like { right:calc(var(--feed-action-right) + 216px); }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-comment { right:calc(var(--feed-action-right) + 144px); }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-share { right:calc(var(--feed-action-right) + 72px); }
}
@media(max-height:620px) and (max-width:479px) {
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-like { left:18px;right:auto; }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-comment { left:90px;right:auto; }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-share { right:90px; }
  html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-repeat { right:18px; }
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-action :is(.gc-like,.gc-comment,.gc-share,.gc-repeat) {
  inset:auto;margin:0;transform:none;
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-feed-action button:focus-visible {
  outline:2px solid #f5d68c;outline-offset:2px;border-radius:50%;
}

/* Shared Lab surfaces: one charcoal finish and one muted gold accent. */
html[data-lab="true"] {
  --lumix-field:#191a18;
  --lumix-sheet-border:#a68b535c;
  --lumix-window-gradient:linear-gradient(150deg,#25241e,#111310 72%);
}
html[data-lab="true"] .repeat-photo-help {
  width:min(560px,calc(100vw - 24px));padding:clamp(16px,4vw,26px);
  border:1px solid #c3a36577;border-radius:24px;
  background:radial-gradient(ellipse at 0 0,#b79a4e16,transparent 60%),#131511;
  color:#f3eddc;box-shadow:0 28px 90px #0009;
}
html[data-lab="true"] .repeat-photo-help-kicker { margin:0 0 12px;color:#c6ab70;font-size:10px;font-weight:700;letter-spacing:.16em; }
html[data-lab="true"] .repeat-photo-help-head { align-items:center; }
html[data-lab="true"] .repeat-photo-help h2 { font-size:clamp(20px,5vw,26px);letter-spacing:-.035em; }
html[data-lab="true"] .repeat-photo-help-head .modal-close { position:static;flex:0 0 36px;width:36px;height:36px;min-height:36px;background:#24251e;border:1px solid #b49a5d66;color:#e4c98b;border-radius:50%; }
html[data-lab="true"] .repeat-photo-help p { color:#c7c4b7;font-size:13px;line-height:1.65; }
html[data-lab="true"] .repeat-photo-help-grid { gap:10px;grid-template-columns:repeat(2,minmax(0,1fr)); }
html[data-lab="true"] .repeat-photo-help-grid section { padding:14px 12px;background:#1b1d18;border:1px solid #aa905544;border-radius:16px; }
html[data-lab="true"] .repeat-photo-example-icon { width:32px;height:32px;display:grid;place-items:center;border-radius:10px;border:1px solid #b2965d66;color:#ebcf91;background:#28291f;margin-bottom:12px; }
html[data-lab="true"] .repeat-photo-help h3 { font-size:13px;color:#eed59b; }
html[data-lab="true"] .repeat-photo-help li { font-size:12px;line-height:1.55;color:#cfccbf; }
html[data-lab="true"] .repeat-photo-help .muted { padding:12px 14px;border-left:2px solid #b2975c;border-radius:0 12px 12px 0;background:#25251d; }
html[data-lab="true"] :is(.repeat-photo-help .btn-primary,.subscription-gate .btn-primary) { background:var(--community-control-bg);color:var(--community-control-ink);border:1px solid var(--community-control-line); }
html[data-lab="true"] #detailActions { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px 8px;justify-content:initial; }
html[data-lab="true"] #detailActions .detail-action { width:100%;min-width:0;min-height:72px;padding:0;justify-content:flex-start;background:transparent;border:0; }
html[data-lab="true"] #detailActions .da-label { max-width:100%;text-align:center;font-size:10px;line-height:1.4;overflow-wrap:anywhere;color:#d6d0bf; }
html[data-lab="true"] #detailActions .detail-action:not(.danger) .da-ico { width:44px;height:44px;min-width:44px;min-height:44px;background:var(--community-control-bg);color:var(--community-control-ink);border:1px solid var(--community-control-line);box-shadow:inset 0 1px #f8e4ae18,0 2px 8px #0004; }
html[data-lab="true"] #detailActions .detail-action.danger .da-label { color:#e5959f; }
html[data-lab="true"] :is(.dropzone,.video-ref-upload,.audio-ref-upload) { background:#191b17;border-color:#a68b535c;border-radius:16px;color:#eee5cf; }
html[data-lab="true"] :is(.btn-outline,.chip,.filter-pill,.mode-tab,.reference-upload-tile) { border-color:#a68b5366; }
html[data-lab="true"] .bottom-nav {
  border-radius:22px 22px 0 0;border-top:1px solid #be9b4877;
  background:linear-gradient(180deg,#17150e88,#080a0899 65%);
  box-shadow:0 -1px 0 #f6d5810d,0 -12px 34px #0005;
}
html[data-lab="true"] .bottom-nav::before {
  content:"";position:absolute;top:-1px;left:25%;right:25%;height:1px;
  background:linear-gradient(90deg,transparent,#f2d38f,transparent);
  box-shadow:0 0 12px 2px #dfb85a44;pointer-events:none;
}
html[data-lab="true"] .bottom-nav .nav-center .nav-plus {
  filter:drop-shadow(0 0 9px #e6b74c66);
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card:is(:hover,:active) > :is(img,.card-preview-poster,video) {
  transform:none;transition:none;
}
html[data-lab="true"].feed-scroll { overflow-anchor:none; }
html[data-lab="true"] .bottom-nav .nav-item { color:#a8a596; }
html[data-lab="true"] .bottom-nav .nav-item.active { color:#efd28e; }
html[data-lab="true"] .bottom-nav .nav-label { position:static;width:auto;height:auto;clip:auto;overflow:visible;font-size:9px;line-height:1.2;margin-top:4px; }
html[data-lab="true"] .bottom-nav .nav-center .nav-label { color:#efd28e; }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) :is(.gallery-grid,.gallery-card,video,.card-preview-poster) { overflow-anchor:none; }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-toggle { position:absolute;transform:none;transition:opacity .15s;touch-action:manipulation; }
.subscription-gate { position:fixed;inset:0;z-index:20000;display:grid;place-items:center;padding:20px;background:#080a08f5;overflow:auto; }
.subscription-gate-card { box-sizing:border-box;width:min(100%,440px);padding:26px;border:1px solid #a68b5377;border-radius:24px;background:linear-gradient(150deg,#25241e,#111310);color:#f3eddc;display:grid;gap:14px; }
.subscription-gate-card h1 { margin:0;font-size:26px; }
.subscription-gate-card p { margin:0;color:#ccc4b2;font-size:14px;line-height:1.6; }
.subscription-gate-card a { display:flex;align-items:center;justify-content:center;white-space:normal;text-align:center;min-height:46px; }
@media(max-width:350px) {
 html[data-lab="true"] .repeat-photo-help-grid { grid-template-columns:1fr; }
 html[data-lab="true"] #detailActions { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

/* A restrained graphite workspace; gold stays on controls and fine borders. */
html[data-lab="true"] {
  --studio-warm-bg:#1b1d1c;
  --studio-warm-panel:#222422;
  --lab-workspace:var(--studio-warm-bg);
}
html[data-lab="true"] body:not(:has(#view-home:not(.hidden))):not(.is-feed-view) { background:#1b1d1a; }
html[data-lab="true"] :is(#view-create,#view-history,#view-chat,#view-tools,#audioStudio,#wardrobeStudio) { background:var(--studio-warm-bg); }
html[data-lab="true"] #genSheet.lab-generation-form .sheet-head {
  background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;box-shadow:none;border-bottom:0;
}
html[data-lab="true"] #genSheet.lab-generation-form .sheet-body { background:transparent; }
html[data-lab="true"] .chat-compose:has(#chatAttachment:not(.hidden)) { flex-wrap:wrap; }
html[data-lab="true"] .chat-compose #chatAttachment:not(.hidden) { display:flex;align-items:center;gap:8px;margin:0;flex:0 0 auto; }
html[data-lab="true"] .chat-compose #chatAttachmentImage { width:48px;height:48px;object-fit:cover;border-radius:10px; }
html[data-lab="true"] .chat-compose #chatRemovePhoto { font-size:10px;padding:4px; }
html[data-lab="true"] .chat-compose:has(#chatAttachment:not(.hidden)) #chatInput { flex:1 1 140px;min-width:100px; }

/* Supplied artwork keeps its complete frame, including seamless loop clones. */
html[data-lab="true"] #view-home .home-banner-track > .home-banner--artwork {
  min-height:0 !important;height:auto;aspect-ratio:3 / 1;padding:0;
  border:0;border-radius:14px;
  background:var(--banner-art) center / 100% 100% no-repeat #090a08 !important;
  box-shadow:inset 0 0 0 1px #d8b86d44;
}
html[data-lab="true"] .home-banner--artwork[data-banner-artwork="partner"] { --banner-art:url("/shop/assets/home/lumix-banner-partner.jpg?v=20261025-1"); }
html[data-lab="true"] .home-banner--artwork[data-banner-artwork="support"] { --banner-art:url("/shop/assets/home/lumix-banner-support.jpg?v=20261025-1"); }
html[data-lab="true"] .home-banner--artwork[data-banner-artwork="quality"] { --banner-art:url("/shop/assets/home/lumix-banner-quality.jpg?v=20261025-1"); }
html[data-lab="true"] .home-banner--artwork[data-banner-artwork="order"] { --banner-art:url("/shop/assets/home/lumix-banner-order.jpg?v=20261025-1"); }
html[data-lab="true"] #view-home .home-banner-track > .home-banner--artwork :is(.hb-text,.lab-info-arrow) { display:none; }
/* Community has one top switch and one bottom navigation. */
html[data-lab="true"] body:has(#view-ideas:not(.hidden)) .topbar { display:none; }
html[data-lab="true"] body:has(#view-ideas:not(.hidden)) .bottom-nav { display:flex; }

/* One opaque workspace prevents stacked gradients and home artwork bleed. */
html[data-lab="true"] #genSheet {
 --lumix-window-gradient:#1b1d1c;--lumix-window:#1b1d1c;--lumix-window-elevated:#222422;
 background:#1b1d1c;
}
html[data-lab="true"] #genSheet .sheet-body,
html[data-lab="true"] #genSheet.lab-generation-form > .sheet-foot { background:#1b1d1c; }
html[data-lab="true"] #genSheet .sheet-head { background:transparent; }
html[data-lab="true"] #genSheet .sheet-title-row { background:transparent; }
html[data-lab="true"] #genSheet .sheet-share-btns { background:transparent; }
html[data-lab="true"] .partner-link-actions .partner-round-btn,
html[data-lab="true"] #sheetShareBtns .sheet-action-icon,
html[data-lab="true"] #sheetShareBtns .sheet-like-btn.liked .sheet-action-icon {
 background:#191c19;border:1px solid #b89a5b;color:#efd18d;box-shadow:inset 0 1px #f8e4ae18;
}

/* Match the calm graphite profile surface across photo/video creation. */
html[data-lab="true"] {
  --studio-warm-bg:#1c1e1d !important;
  --studio-warm-panel:#242624 !important;
  --lab-workspace:#1c1e1d !important;
}
html[data-lab="true"] :is(#view-create,#view-history,#view-chat,#view-tools,#audioStudio,#wardrobeStudio),
html[data-lab="true"] #genSheet,
html[data-lab="true"] #genSheet .sheet,
html[data-lab="true"] #genSheet .sheet-body,
html[data-lab="true"] #genSheet .sheet-head,
html[data-lab="true"] #genSheet > .sheet-foot {
  background:#1c1e1d !important;
  background-image:none !important;
}
html[data-lab="true"] #genSheet .lab-model-picker,
html[data-lab="true"] #genSheet .dropzone,
html[data-lab="true"] .studio-tool-card {
  background:#242624 !important;
  background-image:none !important;
}


html[data-lab="true"] body.is-focused-flow .bottom-nav { display:flex; }
html[data-lab="true"] body.is-focused-flow .app { padding-bottom:var(--page-bottom-inset); }


html[data-lab="true"] #appMain:focus,html[data-lab="true"] #genSheet:focus { outline:none !important; }
html[data-lab="true"] #genSheet .sheet-body { scrollbar-width:none; }
html[data-lab="true"] #genSheet .sheet-body::-webkit-scrollbar { display:none; }

/* Photo/video creation: dark studio canvas with an unmistakable model choice. */
html[data-lab="true"] #genSheet.lab-generation-form,
html[data-lab="true"] #genSheet.lab-generation-form > .sheet-body,
html[data-lab="true"] #genSheet.lab-generation-form > .sheet-foot {
  background:var(--studio-warm-bg) !important;
}


html[data-lab="true"] #genSheet.lab-photo-form .sheet-body { gap:8px 12px; }
html[data-lab="true"] #genSheet.lab-photo-form #prompt { min-height:64px;height:64px; }
html[data-lab="true"] #genSheet.lab-photo-form .dropzone { min-height:78px;padding:10px; }
html[data-lab="true"] #genSheet.lab-photo-form .sheet-avatar-picker { margin-top:2px; }
html[data-lab="true"] #genSheet.lab-photo-form .lab-model-description { max-height:30px;overflow:hidden; }
html[data-lab="true"] #genSheet.lab-photo-form #additionalPromptToggle { min-height:26px; }
html[data-lab="true"] #genSheet.lab-motion-form .choice-panel-trigger { border-color:#d1ae63 !important;background:#20221f !important;color:#f0d18d !important; }
@media(max-height:700px) {
  html[data-lab="true"] #genSheet.lab-photo-form #prompt { min-height:56px;height:56px; }
  html[data-lab="true"] #genSheet.lab-photo-form .dropzone { min-height:68px; }
}
/* Restore the original restrained creation chrome; keep the compact one-screen layout. */


html[data-lab="true"] #genSheet.lab-photo-form .dropzone {
  background:var(--studio-warm-panel) !important;border-color:#625b4a !important;
}
html[data-lab="true"] #genSheet.lab-photo-form .choice-panel-trigger,
html[data-lab="true"] #genSheet.lab-photo-form .field-input {
  background:var(--studio-warm-panel) !important;border-color:#625b4a !important;color:#e6dfcc !important;
}

/* Original vertical attachment layout, compact enough for the photo workspace. */
html[data-lab="true"] #genSheet.lab-generation-form .dropzone .dropzone-inner {
 display:flex;flex-direction:column;align-items:flex-start;gap:5px;
}
html[data-lab="true"] #genSheet.lab-generation-form .dropzone .media-upload-tile {
 display:flex;align-items:center;justify-content:center;gap:8px;position:relative;
 width:60px;height:60px;min-width:60px;flex:0 0 60px;box-sizing:border-box;padding:8px;
}
html[data-lab="true"] #genSheet.lab-generation-form .dropzone .media-upload-tile svg { width:22px;height:22px;flex-shrink:0; }
html[data-lab="true"] #genSheet.lab-generation-form .dropzone .media-upload-plus { position:static;font-size:22px;line-height:1; }
html[data-lab="true"] #genSheet.lab-photo-form #dropzone { min-height:112px;padding:10px; }
html[data-lab="true"] #genSheet.lab-photo-form #dropzone .dropzone-sub { margin:0;text-align:left; }
html[data-lab="true"] #genSheet.lab-photo-form #prompt { min-height:80px;height:80px; }
/* Keep the empty photo state compact too: selecting a file must not make the
   whole form jump when the dropzone changes to the thumbnail row. */
html[data-lab="true"] #genSheet.lab-generation-form .dropzone { min-height:112px !important;padding:10px !important; }
html[data-lab="true"] #genSheet.lab-generation-form .dropzone .dropzone-inner { display:flex;flex-direction:column;align-items:flex-start;gap:5px; }
html[data-lab="true"] #genSheet.lab-generation-form .dropzone .media-upload-tile { width:60px;height:60px;min-width:60px;flex:0 0 60px; }
html[data-lab="true"] #genSheet.lab-generation-form .dropzone .dropzone-title { font-size:12px; }
html[data-lab="true"] #genSheet.lab-generation-form .dropzone .dropzone-sub { margin:0;text-align:left;font-size:9px; }
html[data-lab="true"] #genSheet.lab-photo-form #prompt { min-height:80px !important;height:80px !important; }
@media(max-height:700px) {
 html[data-lab="true"] #genSheet.lab-generation-form .dropzone { min-height:96px !important; }
 html[data-lab="true"] #genSheet.lab-generation-form .dropzone .media-upload-tile { width:54px;height:54px;min-width:54px;flex-basis:54px; }
 html[data-lab="true"] #genSheet.lab-photo-form #prompt { min-height:72px !important;height:72px !important; }
}
/* One reference layout for ready, pending and failed uploads. No :has()
   dependency and no separate photo-only fallback for a video form. */
html[data-lab="true"] #genSheet.lab-generation-form { --reference-tile-size:104px; }
html[data-lab="true"] #genSheet.lab-generation-form :is(.lab-reference-images,.multimodal-reference,.reference-inline-group).has-reference-items {
  --reference-items-row:2;
  display:grid;grid-template-columns:var(--reference-tile-size) minmax(0,1fr);gap:8px;align-items:start;min-width:0;
}
html[data-lab="true"] #genSheet.lab-generation-form .reference-inline-group.has-reference-items { --reference-items-row:1; }
html[data-lab="true"] #genSheet.lab-generation-form .has-reference-items > .block-title { grid-column:1/-1;margin:0; }
html[data-lab="true"] #genSheet.lab-generation-form .has-reference-items > .dropzone,
html[data-lab="true"] #genSheet.lab-generation-form .lab-reference-images.has-reference-items > #dropzone {
  grid-column:1;grid-row:var(--reference-items-row);display:grid;place-items:center;
  width:var(--reference-tile-size) !important;height:var(--reference-tile-size) !important;min-height:var(--reference-tile-size) !important;
  padding:8px !important;margin:0;box-sizing:border-box;
}
html[data-lab="true"] #genSheet.lab-generation-form .has-reference-items > .dropzone .dropzone-inner { align-items:center;justify-content:center;gap:4px; }
html[data-lab="true"] #genSheet.lab-generation-form .has-reference-items > .dropzone :is(.dropzone-title,.dropzone-sub) { display:none; }
html[data-lab="true"] #genSheet.lab-generation-form .has-reference-items > :is(.ref-previews,.reference-file-list,.audio-ref-preview) {
  grid-column:2;grid-row:var(--reference-items-row);display:flex;flex-wrap:wrap;gap:8px;margin:0;min-width:0;max-height:none;overflow:visible;
}
html[data-lab="true"] #genSheet.lab-generation-form .has-reference-items > :is(.ref-previews,.reference-file-list) > * {
  width:var(--reference-tile-size);height:var(--reference-tile-size);flex:0 0 var(--reference-tile-size);box-sizing:border-box;
}
html[data-lab="true"] #genSheet.lab-generation-form .has-reference-items > .video-template-open { grid-column:1/-1;grid-row:3; }
html[data-lab="true"] #genSheet.lab-motion-form #sheetRefModeRef { grid-template-columns:minmax(0,1fr); }
html[data-lab="true"] #genSheet.lab-motion-form #videoReferencesBlock { grid-column:1;grid-row:auto; }
@media(max-width:350px) {
 html[data-lab="true"] #genSheet.lab-generation-form { --reference-tile-size:88px; }
}

/* Keep the compact switch centered in Telegram's top control row. */
html[data-lab="true"] #view-ideas .feed-overlay-nav { display:none !important; }
html[data-lab="true"] #view-ideas .feed-switch {
  position:fixed;z-index:60;top:max(8px,calc(var(--chrome-top) - 44px));left:50%;transform:translateX(-50%);
  display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr));width:min(164px,calc(100vw - 32px));
  box-sizing:border-box;margin:0;padding:3px;gap:2px;border:1px solid #786442;border-radius:999px;
  background:#171916;box-shadow:0 3px 14px #0003;
}
html[data-lab="true"] #view-ideas .feed-switch-btn { position:relative;min-width:0;min-height:32px;padding:5px 9px;border:1px solid transparent;border-radius:999px;font-size:12px;white-space:nowrap; }
html[data-lab="true"] #view-ideas .feed-switch-btn::before { content:"";position:absolute;inset:-6px 0; }
html[data-lab="true"] #view-ideas .feed-switch-btn.active { background:#302c22;border-color:#b89a5b;color:#efd18d;box-shadow:none; }
html[data-lab="true"] #view-ideas:not(.feed-mode) { padding-top:calc(var(--chrome-top) + 48px); }
html[data-lab="true"] .audio-reference-badge.has-error { border-color:#bf6e65;color:#efb3a9; }
html[data-lab="true"] #view-ideas:not(.feed-mode) .feed-intro { padding-top:0; }
html[data-lab="true"] #view-ideas:not(.feed-mode) .gallery-card :is(.gc-author,.gc-like,.gc-repeat,.gc-share,.gc-follow) { display:none !important; }
/* Audio is a focused tool, not a second catalogue of four large cards. */


/* Every creation surface uses the same graphite canvas and field material. */
html[data-lab="true"] :is(#audioStudio textarea,#view-chat .chat-compose,#view-chat .chat-model,#view-chat .chat-empty,.wardrobe-library) {
  background:var(--studio-warm-panel);background-image:none;color:var(--lab-text);
}
html[data-lab="true"] #view-chat .chat-send {
  background:var(--community-control-bg);color:var(--community-control-ink);border:1px solid var(--community-control-line);
  box-shadow:inset 0 1px #f8e4ae18,0 2px 8px #0004;
}

/* Navigation stays above the full-screen generator, not behind its sheet.
   Reserve its full height, also within the keyboard's visual viewport. */
:is(html[data-lab="true"],html[data-studio-v2="true"]) body.creation-workspace-open .bottom-nav { display:flex;z-index:61; }
:is(html[data-lab="true"],html[data-studio-v2="true"]):not(.prompt-editing) body.creation-workspace-open #genSheet.lab-generation-form {
  bottom:calc(var(--bottom-nav-height) + var(--bottom-safe-area));
}
:is(html[data-lab="true"],html[data-studio-v2="true"]).prompt-editing body.creation-workspace-open #genSheet.lab-generation-form {
  height:calc(var(--prompt-viewport-height,100dvh) - var(--bottom-nav-height) - var(--bottom-safe-area));
}
:is(html[data-lab="true"],html[data-studio-v2="true"]).prompt-editing body.creation-workspace-open .bottom-nav {
  top:calc(var(--prompt-viewport-top,0px) + var(--prompt-viewport-height,100dvh) - var(--bottom-nav-height) - var(--bottom-safe-area));bottom:auto;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) body.creation-workspace-open #genSheet.lab-generation-form > .sheet-foot { padding-bottom:10px; }


html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) { padding-top:0; }
/* Sorting belongs to Ideas; the full-screen feed has only its section switch. */
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) #galleryFilters { display:none; }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gc-video-sound { top:calc(var(--chrome-top) + 8px); }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) #galleryEmpty {
  box-sizing:border-box;min-height:100dvh;margin:0;padding:calc(var(--chrome-top) + 32px) 24px calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 32px);
  justify-content:center;border:0;border-radius:0;background:transparent;
}
.creation-sparkle { display:block;width:44px;height:44px;color:#e9c16a;filter:drop-shadow(0 0 9px #c89e4333); }
#galleryEmptyEmoji { filter:none;opacity:1; }
/* Repeats use the same workspace and upload controls, with their recipe locked. */
#genSheet.lab-generation-form.gen-sheet--preset .model-hint { display:block;margin-top:3px;color:#bdb5a1;font-size:11px; }
#genSheet.lab-generation-form.gen-sheet--preset .sheet-cover { margin-bottom:8px; }

/* Home curation: framed trends above manually arranged template folders. */
html[data-lab="true"] #view-home .home-trends-panel {
  margin:20px 0 0;padding:16px 14px 14px;border:1px solid #b99a5359;border-radius:24px;
  background:linear-gradient(145deg,#bfa15f0c,transparent 55%),#171813a8;box-shadow:inset 0 1px #f3d99a0b;
}
html[data-lab="true"] #view-home .home-trends-panel .trends-head { margin:0 0 18px; }
html[data-lab="true"] #view-home .home-trends-panel .trends-head-text { position:relative;display:flex;flex-direction:row;align-items:baseline;gap:6px;width:auto;text-align:left;padding-left:14px; }
html[data-lab="true"] #homeTrendsTitle { margin:0;font-size:21px;line-height:1.3;font-weight:750; }
html[data-lab="true"] #view-home #homeTrendsTitle::before { content:none; }
html[data-lab="true"] #view-home .home-trends-panel .trends-head-text::before,
html[data-lab="true"] #view-home .home-templates-title::before { content:"";position:absolute;left:0;top:3px;bottom:2px;width:3px;border-radius:8px;background:linear-gradient(#ffe18e,#c19634);box-shadow:0 0 12px #d6ad5033; }
.home-trends-count { font-size:13px;font-weight:500;color:#bcb5a4; }
html[data-lab="true"] #view-home .home-trends-panel .trends-all-below { display:block;box-sizing:border-box;width:100%;margin:14px 0 0;padding:12px 16px;border:1px solid #a88f5144;border-radius:15px;background:#ffffff05;color:#e5cf98;text-align:center;font-size:13px; }
html[data-lab="true"] #view-home .home-templates-title { position:relative;margin:30px 0 22px;padding-left:14px;font-size:23px;font-weight:750; }
html[data-lab="true"] #view-home .home-templates-title::after { content:"";position:absolute;top:-15px;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,#b5944144,transparent); }
html[data-lab="true"] #homePresets .preset-group { margin-bottom:28px; }
html[data-lab="true"] #homePresets .preset-group-head { align-items:baseline;gap:10px;margin-bottom:14px; }
html[data-lab="true"] #homePresets .preset-title { min-width:0;margin:0;font-size:18px;line-height:1.4; }
html[data-lab="true"] #homePresets .lab-template-count { display:inline;margin:0;color:#aaa796;font-size:12px;font-weight:450;letter-spacing:0; }
html[data-lab="true"] #homePresets .preset-view-all { flex-shrink:0;font-size:12px;color:#e5c875; }

/* Model selection is the primary action above the generation fields. */
#genSheet.lab-generation-form #sheetImageModelBlock {
  padding:14px;border:1px solid #d0aa5b;border-radius:18px;
  background:linear-gradient(130deg,#4e402833,#252620 70%) !important;
  box-shadow:inset 0 1px #ffe4a825,0 3px 16px #0002;
}
#genSheet.lab-generation-form #sheetImageModelBlock .lab-model-heading { display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px; }
#genSheet.lab-generation-form #sheetImageModelBlock .block-title { color:#efd18a;font-size:11px;font-weight:750;letter-spacing:.08em; }
#genSheet.lab-generation-form #sheetModelPrice { padding:4px 8px;border-radius:999px;background:#d8b15f16;border:1px solid #bb985f44;color:#e9d299;font-size:10px; }
#genSheet.lab-generation-form #sheetImageModelChoice {
  display:flex;align-items:center;gap:10px;min-height:60px;width:100%;padding:12px;
  border:1px solid #d6b46a;border-radius:13px;background:linear-gradient(145deg,#4e412a,#303025) !important;
  color:#fff0c9;box-shadow:inset 0 1px #ffe8b129,0 2px 8px #0003;font-size:16px;text-align:left;
}
#sheetImageModelChoice .model-choice-icon { flex:0 0 30px;display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:#d7b36621;color:#f2cd79;font-size:21px; }
#sheetImageModelChoice .model-choice-name { flex:1;min-width:0;font-weight:700;line-height:1.3;overflow-wrap:anywhere; }
#sheetImageModelChoice .model-choice-action { display:flex;align-items:center;gap:5px;flex-shrink:0;color:#f0cf82;font-size:11px;font-weight:650; }
#sheetImageModelChoice .model-choice-action>span { font-size:21px;line-height:1; }
#genSheet.lab-generation-form button#sheetImageModelChoice:hover { border-color:#ffe1a0;box-shadow:0 0 0 1px #f4d08c33,inset 0 1px #ffe8b129; }
#genSheet.lab-generation-form #sheetImageModelChoice:focus-visible { outline:2px solid #ffda7b;outline-offset:3px; }
@media(max-width:350px) {
 html[data-lab="true"] #view-home .home-trends-panel { padding:14px 10px 10px; }
 #genSheet.lab-generation-form #sheetImageModelChoice { gap:8px;padding:10px;font-size:14px; }
 #sheetImageModelChoice .model-choice-action { font-size:10px; }
}

/* A repeat's source is prepared in the background; photo upload stays in flow. */
#genSheet.lab-generation-form.repeat-workspace .sheet-body { grid-auto-rows:max-content; }
#genSheet.lab-generation-form.repeat-workspace .sheet-cover {
  position:relative;display:block;box-sizing:border-box;width:100%;height:clamp(140px,26dvh,240px);
  min-height:0;max-height:240px;aspect-ratio:auto;margin:0 0 12px;grid-row:auto;overflow:hidden;
}
#genSheet.lab-generation-form.repeat-workspace .sheet-cover.hidden { display:none; }
#genSheet.lab-generation-form.repeat-workspace #sheetRefBlock { display:block;position:relative; }
#genSheet.lab-generation-form.repeat-workspace #additionalPromptBlock { display:block; }
#genSheet.lab-generation-form.repeat-workspace #additionalPromptBlock:not(.is-collapsed) textarea { display:block;min-height:80px; }
.ref-thumb .ref-image-label { position:absolute;z-index:4;bottom:6px;left:6px;margin:0;padding:3px 6px;min-height:22px;background:#15150ee8;color:#f3cd78;border:1px solid #bd9856;border-radius:7px;font-size:10px;line-height:1.2; }
.repeat-source-status { margin:0;padding:10px 12px;border:1px solid #a68b5344;border-radius:12px;color:#d6c28e;background:#302b201f;font-size:11px;line-height:1.5; }
.repeat-source-status[hidden] { display:none; }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) #galleryFilters,
#galleryFilters[hidden] { display:none !important; }

/* A template repeat is a focused photo-personalization flow. */
#genSheet.repeat-personalization :is(#videoModeTabs,#videoReferencesBlock,#referenceAudioBlock,#audioRefBlock,#multimodalReferenceNote,#sheetLikeBtn,#sheetRepeatBtn,#sheetLinkBtn,#durationBlock,#promptBlock,#additionalPromptBlock) { display:none !important; }
/* Only the author-approved controls are visible, never the hidden recipe. */
#genSheet.repeat-personalization #promptBlock:has(#promptVariablesBlock:not(.hidden)) { display:block !important; }
#genSheet.repeat-personalization #promptHiddenNotice { display:none !important; }
#genSheet.repeat-personalization #sheetShareBtns { display:flex;gap:0; }
#genSheet.repeat-personalization #sheetShareBtn { display:inline-flex;align-items:center;justify-content:center;gap:7px;width:auto;min-height:40px;padding:8px 12px;border:1px solid #b79a5b66;border-radius:999px;background:#1c1e19;color:#e8ce93; }
#genSheet.repeat-personalization #sheetShareBtn::after { content:"Поделиться";font-size:12px;font-weight:600; }
#genSheet.repeat-personalization #sheetShareBtn .sheet-action-count { display:none; }
#genSheet.repeat-personalization .sheet-head { align-items:center;padding:8px 16px 12px;gap:12px; }
#genSheet.repeat-personalization .sheet-head-actions { flex-shrink:0; }
#genSheet.repeat-personalization .model-name { font-size:21px;line-height:1.25; }
#genSheet.repeat-personalization .model-hint { font-size:12px; }
#genSheet.repeat-personalization #sheetGalleryByline { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid #a68b5340;border-radius:14px;background:#26251c44; }
#genSheet.repeat-personalization #sheetGalleryByline.hidden { display:none; }
#genSheet.repeat-personalization #sheetGalleryByline::before { content:"Автор шаблона";color:#b9b4a5;font-size:11px; }
#genSheet.repeat-personalization .sheet-gallery-author { margin:0;padding:0;background:transparent;border:0;min-width:0; }
#genSheet.repeat-personalization #repeatPhotoHelpOpen { min-height:54px;border:1px solid #b99c575c;border-radius:14px;background:#322b1c33;color:#e5c77f;text-align:left;padding:12px; }
#genSheet.repeat-personalization #sheetRefBlock>.block-title { font-size:13px;margin:4px 0 12px; }
#genSheet.repeat-personalization:not(.has-repeat-inputs) #dropzone { min-height:106px;padding:14px;border:1px solid #b2985b66;border-radius:16px;background:#222420; }
#genSheet.repeat-personalization #sheetRefBlock { margin-bottom:4px; }
#genSheet.repeat-personalization .sheet-cover { height:clamp(160px,28dvh,280px);max-height:280px; }

/* One conversation canvas and one gold outline around the whole composer. */
#view-chat .chat-head { margin:0 0 16px;align-items:center; }
#view-chat .chat-eyebrow { display:none; }
#view-chat .chat-title { font-size:26px; }
#view-chat .chat-model-row { flex-wrap:wrap;padding:12px;border:1px solid #ac92543d;border-radius:16px;background:#21231e;gap:8px 10px; }
#view-chat .chat-model { max-width:none;border:1px solid #bba36a44;border-radius:12px;background-color:#1a1c19;min-height:42px;color:#eee6d2; }
#view-chat .chat-model-label { color:#c5b991;font-size:10px; }
#view-chat .chat-cost { font-size:11px;color:#d8b667; }
#view-chat .chat-sessions { margin:0 0 14px; }
#view-chat .chat-sessions>summary { color:#c0bba9;font-size:12px;cursor:pointer;padding:6px 2px; }
#view-chat .chat-thread-row { margin:10px 0 0;gap:8px; }
#view-chat .chat-conversation { display:flex;flex-direction:column;flex:1;min-height:340px;padding:14px;border:1px solid #b397565c;border-radius:24px;background:#181b18;box-shadow:inset 0 1px #f4dca20a; }
#view-chat .chat-messages { flex:1;padding:6px 0 18px;min-height:190px; }
#view-chat .chat-empty { min-height:240px;align-content:center;justify-items:center;gap:14px;padding:22px 8px;border:0;background:transparent;box-shadow:none; }
#view-chat .chat-empty>strong { font-size:22px;color:#eee8d9; }
#view-chat .chat-empty>span:not(.chat-welcome-emblem) { max-width:300px;color:#aaa998;font-size:12px;line-height:1.65; }
.chat-welcome-emblem { display:grid;place-items:center;width:56px;height:56px;border:1px solid #b3944c77;border-radius:50%;background:#c9a65c0e;color:#e4c16c;font-size:30px;box-shadow:0 0 24px #e1b9520c; }
.chat-starters { display:flex;flex-wrap:wrap;justify-content:center;gap:7px;margin-top:4px; }
.chat-starters button { min-height:36px;padding:7px 11px;border:1px solid #ad925247;border-radius:999px;background:#ffffff03;color:#d3cbb6;font:inherit;font-size:11px;cursor:pointer; }
.chat-starters button:hover { border-color:#d2b36b;color:#f1d38e; }
#view-chat .chat-disclaimer { font-size:10px;line-height:1.5;margin:0 0 12px;color:#8d9286;text-align:center; }
#view-chat .chat-compose { position:sticky;bottom:max(8px,var(--chrome-bottom));display:flex;align-items:flex-end;gap:8px;width:100%;padding:8px;border:1px solid #b99a5b88;border-radius:22px;background:#1c201b;box-shadow:0 4px 14px #0003; }
#view-chat .chat-compose:focus-within { border-color:#e1bb66;box-shadow:0 0 0 2px #d4ac4d14; }
#view-chat #chatInput,#view-chat #chatInput:focus,#view-chat #chatInput:focus-visible { box-sizing:border-box;flex:1;min-width:0;min-height:42px;max-height:144px;resize:none;padding:10px 2px;border:0;outline:none !important;box-shadow:none;background:transparent;color:#f0eadb;font:inherit;font-size:16px;line-height:1.45; }
#view-chat #chatInput::placeholder { color:#969e8f; }
#view-chat #chatAttach { width:40px;height:42px;border:0;border-radius:50%;color:#e0c27e;background:#ffffff05; }
#view-chat #chatSend { width:42px;height:42px;border:1px solid #c3a15d;border-radius:50%;color:#211c11;background:linear-gradient(#f1ce7f,#cda550);box-shadow:none; }
#view-chat #chatSend:disabled { opacity:.4; }
#view-chat .chat-bubble.user { color:#f2e6c5;background:#333222;border:1px solid #a68c4d55; }
#view-chat .chat-bubble.assistant { color:#e6e6db;background:#222720;border:1px solid #81906c33; }


@media(max-width:360px) {
 #view-chat .chat-conversation { padding:10px; }
 #view-chat .chat-model-label { display:none; }
 #view-chat .chat-model { flex-basis:70%; }
 #view-chat .chat-cost { margin-left:auto; }
 #genSheet.repeat-personalization .model-name { font-size:18px; }
 #genSheet.repeat-personalization #sheetShareBtn { padding:8px; }
}

/* Keep one fine frame; the inset frame printed in the artwork is cropped out. */
html[data-lab="true"] #view-home #homeBannerMain.lab-campaign-hero { border:1px solid #c1a06070;border-radius:18px;box-shadow:none;margin:2px 0 10px;overflow:hidden; }
html[data-lab="true"] #view-home #homeBannerMain.lab-campaign-hero::before,
html[data-lab="true"] #view-home #homeBannerMain.lab-campaign-hero::after { display:none; }
html[data-lab="true"] #view-home .home-banners { padding:0;border:0;background:transparent;box-shadow:none;overflow:visible; }
html[data-lab="true"] #view-home .home-banner-carousel { border:0;background:transparent;box-shadow:none; }
html[data-lab="true"] #view-home .home-banner-track { padding:0;gap:10px;scroll-padding-inline:0; }
html[data-lab="true"] #view-home .home-banner-track>.home-banner--artwork {
 border:1px solid #c1a06070;border-radius:18px;aspect-ratio:3.35 / 1;padding:0;
 background-size:105% 118% !important;box-shadow:none;overflow:hidden;
}
html[data-lab="true"] #view-home .home-banner-track>.home-banner--artwork::before,
html[data-lab="true"] #view-home .home-banner-track>.home-banner--artwork::after { display:none; }
html[data-lab="true"] #view-home .home-banner-controls { margin:0;padding:2px 0 0;border:0; }
/* Override social icon geometry only for the repeat's single Share action. */
#genSheet.repeat-personalization #sheetShareBtns #sheetShareBtn { display:flex;flex-direction:row;width:auto;min-width:116px;max-width:none;white-space:nowrap;border:1px solid #b79a5b66; }
#genSheet.repeat-personalization #sheetShareBtns #sheetShareBtn .sheet-action-icon { display:grid;place-items:center;flex:0 0 18px;width:18px;height:18px;min-width:18px;min-height:18px;border:0;border-radius:0;background:transparent;box-shadow:none; }
#genSheet.repeat-personalization #sheetShareBtns #sheetShareBtn .sheet-action-icon svg { width:18px;height:18px; }
html[data-lab="true"] #view-chat .chat-empty { background:transparent; }
#genSheet.repeat-personalization .ref-image-label { display:none; }
#genSheet.repeat-personalization .ref-tag-image { cursor:default; }

/* Repeat details remain visible even when the template model is locked. */
#genSheet.repeat-personalization #sheetHint { display:none; }
#genSheet.repeat-personalization #repeatModelName { display:inline-flex;align-items:center;margin:7px 0 0;padding:5px 9px;border:1px solid #b89a5c70;border-radius:8px;background:#d4b5710c;color:#efd18c;font-size:12px;font-weight:650;line-height:1.3; }
#genSheet #repeatModelName[hidden] { display:none; }
#genSheet.repeat-personalization #additionalPromptBlock { display:block !important; }
#genSheet.repeat-personalization #additionalPromptBlock textarea { display:block;min-height:92px;background:#20231e;border:1px solid #c1a16080;border-radius:14px;color:#eee5d1; }
#genSheet.repeat-personalization #additionalPromptBlock .block-title { font-size:12px;color:#d9c18b; }
#genSheet.repeat-personalization #sheetGalleryByline { justify-content:flex-start;padding:3px 0 5px;border:0;border-radius:0;background:none;box-shadow:none; }
#genSheet.repeat-personalization #sheetGalleryByline::before { content:none; }
#genSheet.repeat-personalization .sheet-gallery-author { justify-content:flex-start;gap:9px;text-align:left; }
#genSheet.repeat-personalization .sheet-gallery-author-copy::after { content:"Автор шаблона";display:block;margin-top:3px;font-size:10px;font-weight:400;color:#aaa99b; }
.repeat-wardrobe-open { min-height:42px;border:1px solid #bb9d5c77;border-radius:13px;color:#e9cd8b;background:#a68b5310;font-size:12px; }
.repeat-wardrobe-open.hidden { display:none; }
.repeat-wardrobe-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;max-height:55dvh;overflow:auto; }
.repeat-wardrobe-grid .wardrobe-garment { min-width:0; }
.repeat-wardrobe-grid img { width:100%;height:130px;object-fit:contain;background:#f1eee8;border-radius:10px; }
.repeat-wardrobe-grid strong { font-size:10px;line-height:1.3; }
.repeat-wardrobe-status { color:#e5ca8b;min-height:20px;font-size:12px; }

/* A single continuous gold edge surrounds every hero and information slide. */
html[data-lab="true"] #view-home #homeBannerMain.lab-campaign-hero,
html[data-lab="true"] #view-home .home-banner-track>.home-banner--artwork { border:1px solid #d8b668d9 !important;border-radius:18px;box-shadow:0 0 0 1px #b18a3826;isolation:isolate; }
html[data-lab="true"] #view-home #homeBannerMain.lab-campaign-hero>video,
html[data-lab="true"] #view-home #homeBannerMain.lab-campaign-hero>img { border-radius:17px; }
html[data-lab="true"] #view-home #homeBannerMain.lab-campaign-hero::after,
html[data-lab="true"] #view-home .home-banner-track>.home-banner--artwork::after {
 display:block !important;content:"";position:absolute;z-index:10;inset:0;border:1px solid #edc978a6;border-radius:17px;background:none !important;box-shadow:none;pointer-events:none;transform:none;
}
html[data-lab="true"] #view-home #homeBannerMain.lab-campaign-hero::after,
html[data-lab="true"] #view-home .home-banner-track>.home-banner--artwork::after {
 position:absolute;top:0;right:0;bottom:0;left:0;width:auto;height:auto;inline-size:auto;block-size:auto;min-width:0;min-height:0;max-width:none;max-height:none;aspect-ratio:auto;box-sizing:border-box;opacity:1;filter:none;mask-image:none;-webkit-mask-image:none;
}
.repeat-wardrobe-upload-status { display:flex;align-items:center;gap:9px;margin:0;padding:10px 12px;border:1px solid #b89b5b55;border-radius:12px;color:#e5ce91;background:#bd9c4e0b;font-size:12px;line-height:1.5; }
.repeat-wardrobe-upload-status[hidden] { display:none; }
.repeat-wardrobe-upload-status.is-loading::before { content:"";flex:0 0 14px;width:14px;height:14px;border:2px solid #b99a4f44;border-top-color:#edca78;border-radius:50%;animation:wardrobe-upload-spin .8s linear infinite; }
@keyframes wardrobe-upload-spin { to { transform:rotate(360deg); } }
/* Payment method and receipt email are selected inside the shared checkout sheet. */
#view-shop>.checkout-panel,
#view-shop .checkout-panel>.currency-picker,
#view-shop #emailFieldWrap { display:none; }

/* Tools: compact visual demonstrations, with the live quote beside each action. */
#view-tools .tools-page-head { display:block;margin:22px 0 24px; }
#view-tools .tools-page-eyebrow { color:#bd9c58;font-size:10px;font-weight:700;letter-spacing:.2em; }
#view-tools .tools-page-head h1 { display:flex;align-items:center;gap:12px;margin:8px 0 10px;font-size:30px;font-weight:650;letter-spacing:-.8px; }
#view-tools .tools-page-head h1>span { color:#eac985;font-size:26px;font-weight:400; }
#view-tools .tools-page-head p { margin:0;color:#b4b4ad;font-size:13px;line-height:1.6; }
#view-tools .studio-tools-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:0 0 24px; }
#view-tools .studio-tool-card { --tool-accent:#cfac69;display:flex;flex-direction:column;align-items:stretch;gap:0;min-width:0;padding:0;overflow:hidden;position:relative;border:1px solid #b99a4c55;border-radius:20px;background:#222421 !important;background-image:none !important;box-shadow:0 4px 16px #00000014;color:#f3eee5;text-align:left;font:inherit;cursor:pointer;transition:border-color .2s,transform .2s; }
#view-tools .studio-tool-art { position:relative;display:flex;align-items:center;justify-content:center;min-height:118px;color:var(--tool-accent);background:radial-gradient(ellipse at 50% 70%,color-mix(in srgb,var(--tool-accent) 17%,transparent),transparent 72%),linear-gradient(150deg,#ffffff04,#00000014);overflow:hidden; }
#view-tools .studio-tool-art svg { display:block;width:150px;height:100px;max-width:100%;margin:9px 0 22px; }
#view-tools .studio-tool-kind { position:absolute;bottom:10px;left:12px;font-size:9px;font-weight:600;letter-spacing:.025em;color:var(--tool-accent); }
#view-tools .studio-tool-copy { padding:14px 12px 0;flex:1;border-top:1px solid #ffffff08; }
#view-tools .studio-tool-card strong { display:block;font-size:15px;line-height:1.3;font-weight:650;letter-spacing:-.25px; }
#view-tools .studio-tool-card small { display:block;margin-top:7px;font-size:11px;line-height:1.5;color:#bcbcb5; }
#view-tools .studio-tool-footer { display:flex;align-items:end;gap:6px;justify-content:space-between;margin:12px 12px 13px;padding-top:10px;border-top:1px solid #ffffff0b; }
#view-tools .studio-tool-card em { display:block;margin:0;font-style:normal;font-size:10px;line-height:1.5;color:#dbc594; }
#view-tools .studio-tool-arrow { flex:none;display:grid;place-items:center;width:25px;height:25px;border:1px solid #c9a95d45;border-radius:50%;color:#e9cb8b;font-size:16px; }
#view-tools .studio-tool-card--character { grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) 43%;background:linear-gradient(115deg,#343025,#242521) !important;border-color:#cbaa666f; }
#view-tools .studio-tool-card--character .studio-tool-art { grid-column:2;grid-row:1/3;min-height:155px;background:radial-gradient(ellipse at center,#c6a5621a,transparent 70%); }
#view-tools .studio-tool-card--character .studio-tool-art svg { width:184px;height:125px;margin:0 0 18px; }
#view-tools .studio-tool-card--character .studio-tool-kind { bottom:14px;left:0;right:0;text-align:center; }
#view-tools .studio-tool-card--character .studio-tool-copy { grid-column:1;grid-row:1;padding:20px 0 0 18px;border:0; }
#view-tools .studio-tool-card--character strong { font-size:20px; }
#view-tools .studio-tool-card--character .studio-tool-footer { grid-column:1;grid-row:2;margin:10px 0 16px 18px;border:0;padding-top:0; }
#view-tools .studio-tool-card--prompt { --tool-accent:#b5a0cb; }
#view-tools .studio-tool-card--cutout { --tool-accent:#a0c7b4; }
#view-tools .studio-tool-card--expand { --tool-accent:#d4b38b; }
#view-tools .studio-tool-card--enhance { --tool-accent:#9fb7cc; }
#view-tools .studio-tool-card--video { --tool-accent:#9abfc4; }
#view-tools .studio-tool-card--reference { --tool-accent:#d1a1a1; }
#view-tools .studio-tool-card:disabled { cursor:not-allowed;border-style:dashed; }
#view-tools .studio-tool-card:disabled .studio-tool-art { opacity:.4; }
#view-tools .studio-tool-card:disabled em { color:#bcbcb5; }
#view-tools .studio-tool-card:focus-visible { outline:2px solid #f2d390;outline-offset:3px; }
@media(hover:hover) {
  #view-tools .studio-tool-card:not(:disabled):hover { border-color:#e0bf7a;transform:translateY(-2px); }
}
@media(max-width:360px) {
  #view-tools .studio-tools-grid { gap:9px; }
  #view-tools .studio-tool-card strong { font-size:14px; }
  #view-tools .studio-tool-card--character strong { font-size:19px; }
  #view-tools .studio-tool-copy { padding:12px 10px 0; }
  #view-tools .studio-tool-footer { margin-inline:10px; }
}
@media(prefers-reduced-motion:reduce) {
  #view-tools .studio-tool-card { transition:none; }
  #view-tools .studio-tool-card:not(:disabled):hover { transform:none; }
}

/* Keep the promo field outside the hidden legacy checkout in every environment. */
#view-shop>.shop-promo-box { margin:0 0 16px;border-color:#c4a46380;background:#24231e; }
#view-shop>.shop-promo-box .checkout-toggle { color:#edcd88;font-weight:650; }
#view-shop>.shop-promo-box .promo-field-wrap { grid-template-columns:minmax(0,1fr) auto;align-items:start; }
#view-shop>.shop-promo-box .promo-apply { align-self:end;min-height:46px;margin:0; }
#view-shop>.shop-promo-box .promo-status { margin:0; }
/* Emphasize only the square icon tile; the label stays outside its frame. */
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile {
  border-color:#e2c375 !important;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-home .home-shortcut:not(.home-shortcut--wide) .home-shortcut-tile::before {
  border-color:#d3b05b80;
}
:is(html[data-lab="true"],html[data-studio-v2="true"]) #view-home .home-shortcut:not(.home-shortcut--wide):focus-visible .home-shortcut-tile {
  outline:2px solid #f0d394;outline-offset:3px;
}

/* Public Studio launches separately from the Treasury pilot. */
html[data-treasury="false"] .topbar #treasuryButton,
html[data-treasury="false"] #view-treasury { display:none !important; }
html[data-treasury="false"] .topbar #languageButton { display:inline-flex; }

.lab-payment-availability { margin:0 0 14px;padding:12px;border:1px solid #b5965555;border-radius:12px;background:#2c281f;color:#dfd1b2;font-size:12px;line-height:1.5; }

/* Repeat previews retain their original frame; controls follow below. */
#genSheet.lab-generation-form.repeat-workspace .sheet-cover {
  width:100%;height:auto;max-height:none;aspect-ratio:var(--media-ar,9 / 16);margin:0 0 12px;
}
#genSheet.lab-generation-form.repeat-personalization #sheetShareBtns #sheetShareBtn {
  height:30px;min-height:30px;min-width:0;width:max-content;aspect-ratio:auto;flex:none;padding:4px 9px;gap:5px;border-radius:12px;line-height:1;
}
#genSheet.repeat-personalization #sheetShareBtn::after { font-size:11px; }
#genSheet.repeat-personalization #sheetShareBtn .sheet-action-icon,
#genSheet.repeat-personalization #sheetShareBtn svg { width:15px;height:15px; }
/* Attachment is a separate row, never a competing column beside the draft. */
#view-chat #chatForm { bottom:calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 8px);display:grid;grid-template-columns:40px minmax(0,1fr) 42px;align-items:end;box-sizing:border-box;flex-wrap:nowrap; }
#view-chat #chatForm #chatAttachment:not(.hidden) { grid-column:1/-1;grid-row:1;display:flex;align-items:center;gap:10px;margin:0 0 5px;padding:5px 7px;background:#ffffff04;border-radius:12px;min-width:0; }
#view-chat #chatForm #chatAttachmentImage { width:48px;height:48px;object-fit:cover;border-radius:8px;flex:none; }
#view-chat #chatForm #chatRemovePhoto { min-height:32px;padding:5px 8px;font-size:11px; }
#view-chat #chatForm #chatAttach { grid-column:1;grid-row:2; }
#view-chat #chatForm #chatInput { grid-column:2;grid-row:2;width:100%;min-width:0; }
#view-chat #chatForm #chatSend { grid-column:3;grid-row:2; }
body.is-chat-composing #view-chat .chat-compose { bottom:max(8px,var(--chrome-bottom)); }
.plan-loading { pointer-events:none;min-height:114px;display:flex;flex-direction:column;justify-content:center;gap:12px; }
.plan-loading span { display:block;height:16px;width:65%;border-radius:5px;background:#d1b36f18; }
.plan-loading span+span { width:85%;height:10px; }

/* The complete repeat frame fits above its fixed actions on short phones. */
#genSheet.lab-generation-form.repeat-workspace .sheet-cover {
  --repeat-preview-max:max(140px,calc(100dvh - var(--chrome-top) - var(--bottom-nav-height) - var(--bottom-safe-area) - 210px));
  width:min(100%,calc(var(--repeat-preview-max) * var(--media-ratio,.5625)));
  height:auto;max-width:100%;max-height:none;aspect-ratio:var(--media-ar,9 / 16);
  justify-self:center;margin-inline:auto;
}
/* A fixed viewport stage is shared by profile images and videos. Percentage
   heights in the old flex/grid mix produced partial WebKit paint tiles. */
html.photo-viewer-locked { overflow:hidden;overscroll-behavior:none; }
html.photo-viewer-locked body { position:fixed;top:var(--photo-viewer-top,0px);left:0;right:0;width:100%;overflow:hidden; }
#photoLightbox { display:block;padding:0;overflow:hidden;animation:none; }
#photoLightbox .photo-lightbox-stage {
  position:absolute;inset:calc(var(--chrome-top) + 66px) 12px max(12px,var(--chrome-bottom));
  display:block;width:auto;height:auto;max-width:none;max-height:none;min-height:0;flex:none;
  margin:0;padding:0;border:0;border-radius:0;overflow:hidden;touch-action:none;
}
#photoLightbox .photo-lightbox-img,
#photoLightbox .photo-lightbox-video {
  position:absolute;inset:0;display:block;width:100%;height:100%;min-width:0;min-height:0;
  max-width:100%;max-height:100%;object-fit:contain;object-position:center;border:0;border-radius:0;
  transition:none;
}
#photoLightbox .photo-lightbox-img.hidden,
#photoLightbox .photo-lightbox-video.hidden { display:none !important; }

#genSheet.lab-generation-form.repeat-workspace #sheetCoverExpand {
  display:grid !important;place-items:center;position:absolute;left:10px;top:10px;z-index:5;
  width:36px;height:36px;padding:0;border:1px solid #dac08688;border-radius:50%;background:#171b17bb;color:#f1d599;font-size:23px;line-height:1;
}

/* Switching root snap modes must not animate or inherit the other page's offset. */
.view { animation:none; }
html.view-switching { scroll-snap-type:none !important;overflow-anchor:none; }

/* App padding changes when immersive feed mode starts. It must switch in the
   same frame as restoring scroll, never interpolate the previous page box. */
#appMain { transition:none; }

.home-campaign-poster { position:absolute;inset:0;z-index:1;width:100%;height:100%;object-fit:contain;pointer-events:none; }
/* WebKit must see a visible video layer to present its first frame. Keep
   the loading poster above it instead of making the player transparent. */
.home-banner-main-video--campaign { opacity:1;transition:none; }
.home-campaign-poster[hidden] { display:none; }

/* Profile publications share feed geometry and controls, without image dragging. */
#profileWorkViewer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100svh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #08080a;
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: none;
}
#profileWorkViewer::backdrop { background: #08080a; }
#profileWorkViewer .gallery-card--feed > img {
  -webkit-user-drag: none;
  user-select: none;
  touch-action: manipulation;
}

/* A new author never inherits the previous profile while its request is pending. */
#view-profile.is-profile-loading > :not(#profileLoading) { display: none !important; }
.profile-loading { min-height: 60svh; padding-top: 16px; }
.profile-loading-head { display: flex; align-items: center; gap: 18px; margin: 20px 0 30px; }
.profile-loading-avatar { width: 72px; height: 72px; flex-shrink: 0; border-radius: 50%; }
.profile-loading-stats { height: 48px; flex: 1; border-radius: 12px; }
.profile-loading .work-card { aspect-ratio: 2 / 3; }

.chat-message-text { user-select:text;-webkit-user-select:text;-webkit-touch-callout:default;cursor:text; }
.chat-message-copy {
  display:flex;align-items:center;gap:6px;margin:10px 0 0 auto;padding:6px 9px;
  min-height:32px;border:1px solid #a68c4d66;border-radius:9px;background:#14191266;
  color:#e5cd91;font:inherit;font-size:11px;white-space:normal;cursor:pointer;
  user-select:none;-webkit-user-select:none;
}
.chat-message-copy svg { width:16px;height:16px; }

.chat-message-actions { display:flex;justify-content:flex-end;flex-wrap:wrap;gap:6px;margin-top:10px;white-space:normal; }
.chat-message-actions .chat-message-copy { margin:0; }
/* Нативное выделение ответа без возможности изменить оригинал. */
textarea.chat-message-text {
  display:block;box-sizing:border-box;width:100%;min-width:0;min-height:1.55em;
  margin:0;padding:0;border:0;border-radius:0;outline:none;background:transparent;color:inherit;
  font:inherit;font-size:16px;line-height:1.55;resize:none;overflow:hidden;
  white-space:pre-wrap;overflow-wrap:anywhere;touch-action:auto;
}
textarea.chat-message-text:focus { outline:none;box-shadow:none; }
.chat-bubble:has(> textarea.chat-message-text) { width:88%; }

textarea.chat-message-text { -webkit-user-select:text;user-select:text;-webkit-touch-callout:default;caret-color:#efd18d; }
textarea.chat-message-text::selection { color:#fff;background:#8a713b; }

/* Reactions use the familiar right-hand column, with no controls over wide video. */
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed {
  --feed-action-step:clamp(48px,9cqh,72px);
  --feed-repeat-bottom:min(calc(var(--bottom-nav-height) + var(--bottom-safe-area) + 96px),max(12px,calc(100cqh - var(--chrome-top) - var(--feed-action-step) * 3 - 64px)));
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed .gc-feed-action { left:auto;right:12px; }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed .gc-feed-repeat { bottom:var(--feed-repeat-bottom); }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed .gc-feed-share { bottom:calc(var(--feed-repeat-bottom) + var(--feed-action-step)); }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed .gc-feed-comment { bottom:calc(var(--feed-repeat-bottom) + var(--feed-action-step) * 2); }
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed .gc-feed-like { bottom:calc(var(--feed-repeat-bottom) + var(--feed-action-step) * 3); }
/* Wide video keeps its complete frame beside the right-hand action rail. */
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed.gallery-card--wide-media {
  --feed-frame-width:min(calc(100cqw - 16px),calc(100cqh * var(--feed-media-ratio)));
}
html[data-lab="true"] :is(#view-ideas.feed-mode, #profileWorkViewer) .gallery-card--feed.gallery-card--wide-media > :is(img,video.card-preview-video) {
  left:8px;right:8px;
}

/* Match the shared gold close control and lift the contained fullscreen image. */
.photo-lightbox-close {
  border:1px solid #c9a65c;background:radial-gradient(circle at 35% 25%,#75603855,#17170fee);
  color:#f2d593;box-shadow:0 0 0 1px #b8944229,0 0 16px #d2ac4e44,inset 0 1px #ffe6a233;
}
#photoLightbox .photo-lightbox-stage { top:calc(var(--chrome-top) + 48px);bottom:max(30px,calc(var(--chrome-bottom) + 18px)); }

.avatar-template-fields { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
.tool-template-block { padding:14px;border:1px solid #a68c4d55;border-radius:16px;background:#25271f; }
.tool-template-block h3 { margin:0 0 8px;font-size:18px; }
.tool-template-block .field { min-width:0; }
.tool-template-block select { width:100%;font-size:14px;min-height:44px; }
@media(max-width:360px) { .avatar-template-fields { grid-template-columns:1fr; } }

body:has(#genSheet.gen-sheet--tool-template:not(.hidden)) .topbar { visibility:hidden; }
#genSheet.gen-sheet--tool-template > .sheet-head { background:var(--lab-workspace,#1c201a); }

/* A single continuous backdrop around contained fullscreen media. */
#photoLightbox,#photoLightbox .photo-lightbox-stage,#photoLightbox .photo-lightbox-img,#photoLightbox .photo-lightbox-video { background:#08080a; }
.avatar-template-fields { display:flex;flex-direction:column;gap:22px; }
.avatar-option-group { min-width:0;margin:0;padding:0;border:0; }
.avatar-option-group legend { margin-bottom:10px;font-size:15px;font-weight:650; }
.avatar-photo-choices { display:flex;gap:9px;overflow-x:auto;padding:3px 2px 10px;scroll-snap-type:x proximity; }
.avatar-photo-choice { flex:0 0 104px;display:flex;flex-direction:column;gap:7px;padding:5px;border:1px solid #8b785b55;border-radius:15px;background:#1c201b;color:#e6dfcf;font:inherit;font-size:11px;line-height:1.3;text-align:center;cursor:pointer;scroll-snap-align:start; }
.avatar-choice-photo { display:block;width:100%;aspect-ratio:1;border-radius:10px;background-image:url('/shop/assets/tools/avatar-options-v1.webp');background-size:800% 500%;background-repeat:no-repeat; }
.avatar-photo-choice[aria-pressed="true"] { border-color:#e8c777;box-shadow:0 0 0 1px #e8c77788;background:#393121; }
.avatar-photo-choice:focus-visible { outline:2px solid #efd18d;outline-offset:2px; }
.photo-prompt-view { max-width:600px;margin-inline:auto; }
.photo-prompt-upload { display:flex;align-items:center;flex-direction:column;gap:10px;padding:24px;border:1px dashed #a68c4d;border-radius:22px;background:#25271f;cursor:pointer; }
.photo-prompt-upload-plus { font-size:32px;color:#efd18d; }
#photoPromptPreview { max-width:100%;max-height:300px;border-radius:14px;object-fit:contain; }
.photo-prompt-result { margin-top:24px;padding:16px;border:1px solid #a68c4d66;border-radius:18px;background:#22261f; }
.photo-prompt-result h2 { font-size:18px; }
#photoPromptResult { box-sizing:border-box;width:100%;min-height:240px;margin:10px 0;padding:12px;border:1px solid #76644866;border-radius:12px;color:inherit;background:#1c201b;font:inherit;font-size:16px;line-height:1.5;resize:vertical;user-select:text;-webkit-user-select:text;-webkit-touch-callout:default; }

#photoPromptResult { overflow:hidden;resize:none; }

.photo-prompt-result { scroll-margin-top:calc(var(--chrome-top,56px) + 12px); }

/* Individually cropped photographs have no neighbouring atlas rows at any size. */
.avatar-choice-photo { background-size:contain;background-position:center;background-color:#91887d; }
.avatar-photo-choice { min-height:138px; }
.image-reference-sources { display:flex;flex-wrap:wrap;gap:9px;margin:12px 0; }
#genSheet .image-reference-sources > button { flex:1;min-width:128px;min-height:44px;width:auto;margin:0;padding:10px 14px;border-radius:14px;border:1px solid #bd9b525e;background:linear-gradient(135deg,#d5ab5d12,#1c211b);color:#f1d798;font:inherit;font-size:13px; }
#genSheet .image-reference-sources > button:focus-visible { outline:2px solid #e8c777;outline-offset:3px; }
.pinterest-reference-import { scroll-margin-top:calc(var(--chrome-top,56px) + 90px); }

/* Gold community filters, with a clear selected category. */
#galleryFilters { display:flex;flex-wrap:wrap;gap:10px;overflow:visible;padding:8px 2px 14px; }
#galleryFilters .filter-pill { display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 16px;border:1px solid #b7944e8c;border-radius:999px;background:linear-gradient(150deg,#34302466,#141811);color:#e6dfcf;white-space:nowrap;font-size:13px;box-shadow:inset 0 1px #f8dfa018; }
#galleryFilters .gallery-filter-icon { color:#edc77a;font-size:20px;line-height:1; }
#galleryFilters .filter-pill.active { color:#ffe5a4;border-color:#f0ce79;background:radial-gradient(ellipse at 50% 100%,#a373282e,transparent 75%),#1c211b;box-shadow:0 0 0 1px #f3cd6755,0 0 16px #dda53055,inset 0 0 13px #c5962726; }
#galleryFilters .filter-pill:focus-visible { outline:2px solid #f0ce79;outline-offset:4px; }

/* Package cards use live prices and discounts; decoration adds no promotional claims. */
#view-shop #plans { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
#view-shop .plan { min-width:0;display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:16px 13px;border:1px solid #c29a4a55;border-radius:24px;text-align:left;isolation:isolate; }
#view-shop .plan .plan-loki { display:flex;flex-direction:column-reverse;align-items:flex-start;gap:7px; }
#view-shop .plan-loki-price { text-align:left; }
#view-shop .plan-loki-price strong { font-size:clamp(24px,7vw,36px);font-weight:800;line-height:1.15;color:#f6d989; }
#view-shop .plan-loki-name { display:block;max-width:100%;font-size:12px;font-weight:650;overflow-wrap:anywhere; }
#view-shop .plan-top { order:-1;min-height:24px;margin:0; }
#view-shop .plan-badge { max-width:100%;font-size:10px;background:linear-gradient(115deg,#fae8a8,#c08d30,#f4d891);color:#241a08; }
#view-shop .plan-unit-price { margin:0;font-size:10px; }
#view-shop .plan-tagline { font-size:11px; }
#view-shop .plan-art { display:grid;place-items:center;align-self:center;justify-self:end;box-sizing:border-box;width:32px;height:32px;aspect-ratio:1;margin:0;border:1px solid #d4b16d4d;border-radius:50%;background:radial-gradient(circle at 35% 20%,#f6d68b18,transparent 68%),#b38a3910;color:#e8c986;box-shadow:inset 0 1px #ffedb31a;line-height:0; }
#view-shop .plan-choose { display:flex;justify-content:center;align-items:center;gap:14px;min-height:42px;margin-top:6px;border:1px solid #c8a45b;border-radius:999px;color:#f2d88c;font-size:13px;font-weight:700;background:linear-gradient(130deg,#c9993722,transparent); }
#view-shop .plan.selected { border-color:#f0cd70;box-shadow:0 0 0 1px #e7bc6044,0 0 21px #b77e242e,inset 0 0 28px #b88a2520; }
#view-shop .plan.selected .plan-choose { color:#241b08;background:linear-gradient(115deg,#f7e8b0,#d6ab4b,#f6dc8c);box-shadow:0 0 15px #c89f3544; }
#view-shop .plan-select-indicator { display:none; }
@media(max-width:350px) { #view-shop #plans { grid-template-columns:1fr; } }
@media(prefers-reduced-motion:no-preference) { #galleryFilters .filter-pill,#view-shop .plan { transition:border-color .2s,box-shadow .2s,background .2s; } }
.gallery-filter-icon svg { display:block;width:20px;height:20px; }
#view-shop .plan-art svg { display:block;flex:none;width:22px;height:22px;min-width:22px;max-width:none;aspect-ratio:1;filter:none; }
#view-shop #plans > .plan { min-height:0;padding:14px 12px;gap:7px;border-radius:20px; }
#view-shop #plans .plan-loki { display:grid;grid-template-columns:minmax(0,1fr) 32px;gap:7px 6px;align-items:center; }
#view-shop #plans .plan-loki-price { grid-column:1;grid-row:1;min-width:0; }
#view-shop #plans .plan-loki-name { grid-column:1/-1;grid-row:2; }
#view-shop #plans .plan-art { grid-column:2;grid-row:1; }
@media(max-width:380px) {
  #view-shop #plans .plan-loki { grid-template-columns:minmax(0,1fr) 28px;column-gap:4px; }
  #view-shop #plans .plan-art { width:28px;height:28px; }
  #view-shop #plans .plan-art svg { width:20px;height:20px;min-width:20px; }
  #view-shop #plans .plan-loki-price strong { font-size:20px; }
}
#view-shop #plans .plan-choose { margin-top:auto;min-height:40px; }
#view-shop #plans .plan-top { margin:0 0 2px; }
#view-shop .plan.selected .plan-art { border-color:#e2bd6a8c;background:radial-gradient(circle at 40% 20%,#e9c56833,transparent 75%),#bd913419;box-shadow:0 0 14px #c69a3d18,inset 0 1px #fff0bd26; }
#genSheet .image-reference-sources { grid-column:1/-1; }
#repeatWardrobeOpen::before { content:"";display:inline-block;vertical-align:middle;width:20px;height:20px;margin-right:6px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6a3 3 0 1 1 4 2.8V11l8 6a1 1 0 0 1-.6 2H3.6a1 1 0 0 1-.6-2l8-6' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }

/* Shared close component. Visual properties override legacy modal/theme rules;
   placement stays with each dialog, viewer or toast. CSS strokes do not depend
   on the platform font used to draw the multiplication character. */
button.ui-close {
  --close-size: 44px;
  box-sizing: border-box !important;
  display: inline-grid;
  grid-template: 1fr / 1fr !important;
  grid-auto-rows: 0 !important;
  place-items: center !important;
  flex: 0 0 var(--close-size) !important;
  width: var(--close-size) !important;
  height: var(--close-size) !important;
  min-width: var(--close-size) !important;
  min-height: var(--close-size) !important;
  max-width: var(--close-size) !important;
  max-height: var(--close-size) !important;
  padding: 0 !important;
  border: 1px solid #b49a5d66 !important;
  border-radius: 50% !important;
  background: #24251e !important;
  color: #e4c98b !important;
  box-shadow: none !important;
  font-size: 0 !important;
  line-height: 1 !important;
  touch-action: manipulation;
  cursor: pointer;
  isolation: isolate;
}
button.ui-close.hidden { display: none !important; }
button.ui-close::before,
button.ui-close::after {
  content: "";
  grid-area: 1 / 1;
  display: block;
  width: 16px;
  height: 1.7px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
  pointer-events: none;
}
button.ui-close::after { transform: rotate(-45deg); }
button.ui-close:focus-visible { outline: 2px solid #efd18d !important; outline-offset: 3px !important; }
@media (hover: hover) {
  button.ui-close:hover { background: #333126 !important; border-color: #e4c98b !important; }
}
button.ui-close:active { transform: scale(.94); }
.choice-panel-dialog { position: relative; }
.choice-panel-dialog h2 { min-height: 44px; padding-right: 54px; display: flex; align-items: center; }
.choice-panel-dialog .choice-panel-close { position: absolute; top: 14px; right: 14px; float: none; margin: 0; }
.ad-box { position: relative; }
#adCloseBtn { position: absolute; top: 0; right: 0; }
#genSheet #sheetImageModelChoice:not(button) { cursor: default; }

/* Showcase uses the same quiet gold controls as the rest of the workspace. */
#profileWorksSheet .profile-works-sheet { width: 100%; margin-inline: auto; background: var(--lab-workspace, #1c201a); }
#profileWorksSheet .sheet-head { align-items: flex-start; gap: 12px; background: var(--lab-workspace, #1c201a); border-radius: 18px 18px 0 0; }
.profile-works-heading { flex: 1; min-width: 0; }
.profile-works-heading .model-name { margin: 0 0 8px; }
.profile-works-heading .model-hint { margin: 0; }
#profileWorksSheet .profile-media-add { border: 1px dashed #b49a5d66; background: #24251e; border-radius: 18px; }
#profileWorksSheet .profile-media-add-icon { width: 44px; height: 44px; flex-basis: 44px; border: 1px solid #b49a5d66; border-radius: 50%; color: #e4c98b; background: #2c2b21; box-shadow: none; }
#profileWorksSheet .profile-work-editor-item { border-color: #b49a5d33; background: #24251e; border-radius: 18px; }
#profileWorksSheet .profile-work-editor-item.is-drop-target { border-color: #e4c98b; }
#profileWorksSheet .profile-work-editor-actions button { width: 44px; height: 44px; padding: 0; border: 1px solid #b49a5d66; border-radius: 50%; color: #e4c98b; background: #2c2b21; }
.profile-work-editor-actions svg { width: 20px; height: 20px; }
#profileWorksSheet .profile-work-editor-actions button:focus-visible { outline: 2px solid #efd18d; outline-offset: 2px; }
#profileWorksSheet .profile-work-editor-actions button:disabled { opacity: .3; }
#profileWorksSheet .profile-work-editor-actions button:hover:not(:disabled) { border-color: #e4c98b; background: #333126; }
@media (max-width: 359px) {
  #profileWorksSheet .profile-work-editor-item { grid-template-columns: 48px minmax(0, 1fr); }
  #profileWorksSheet .profile-work-editor-preview { width: 48px; height: 48px; grid-row: span 2; }
  #profileWorksSheet .profile-work-editor-actions { grid-column: 2; }
}

.partner-analytics-done { margin: 20px 0 0 auto; }

.profile-work-editor-title { flex-wrap: wrap; }
.profile-work-pinned { display: inline-block; padding: 2px 6px; border: 1px solid #b49a5d66; border-radius: 999px; background: #2c2b21; color: #e4c98b; font-size: 9px; font-weight: 500; }

/* Repeat fields describe what the visitor supplies; model tags stay internal. */
#genSheet.has-repeat-slots #sheetRefModeRef>.lab-reference-images,
#genSheet.has-repeat-inputs #videoModeTabs,
#genSheet.has-repeat-inputs #videoReferencesBlock,
#genSheet.has-repeat-inputs #referenceAudioBlock,
#genSheet.has-repeat-inputs #multimodalReferenceNote,
#genSheet.has-repeat-slots #sheetAvatarPicker {display:none!important;}
.repeat-inputs {grid-column:1/-1;margin:12px 0 20px;}
.repeat-inputs h3 {margin:0 0 8px;font-size:18px;}
#repeatInputsInstructions {margin:0 0 14px;color:var(--muted);font-size:13px;line-height:1.5;}
#repeatInputsList {display:grid;gap:12px;}
.repeat-input-card {display:flex;align-items:flex-start;gap:12px;padding:12px 0;border:0;border-bottom:1px solid #b49a5d33;border-radius:0;background:transparent;}
.repeat-photo-tile {position:relative;display:flex;align-items:center;justify-content:center;width:76px;height:76px;flex:0 0 76px;box-sizing:border-box;border:1px dashed #c4a45b99;border-radius:14px;overflow:hidden;cursor:pointer;color:#dec182;background:#242624;}
.repeat-photo-tile input[hidden] {display:none!important;}
.repeat-photo-tile>img {display:block;width:100%;height:100%;object-fit:cover;}
.repeat-photo-tile .media-upload-tile {display:flex!important;align-items:center;justify-content:center;gap:7px;width:auto!important;height:auto!important;min-width:0!important;border:0!important;background:none!important;padding:0!important;}
.repeat-photo-tile .media-upload-tile svg {width:24px;height:24px;}
.repeat-photo-tile .media-upload-plus {font-size:26px;line-height:1;}
.repeat-photo-tile.is-busy {opacity:.55;pointer-events:none;}
.repeat-photo-tile:focus-within {outline:2px solid #e7c779;outline-offset:3px;}
.repeat-provider-choice {display:grid;gap:7px;margin:10px 0;font-size:12px;color:var(--muted);}
.repeat-input-card>img {width:72px;height:88px;object-fit:cover;border-radius:12px;flex-shrink:0;}
.repeat-input-copy {flex:1;min-width:0;}
.repeat-input-copy strong {display:block;font-size:14px;}
.repeat-input-copy p {margin:6px 0;color:var(--muted);font-size:12px;line-height:1.45;}
.repeat-input-copy small {display:block;color:#e4c98b;font-size:11px;margin-bottom:10px;}
.repeat-input-upload {display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 14px;font-size:13px;cursor:pointer;}
.repeat-input-upload input[hidden] {display:none!important;}
.repeat-input-remove {display:block;margin-top:9px;padding:6px 0;color:var(--muted);font-size:11px;}
#repeatInputsStatus {margin:12px 0 0;color:#e4c98b;font-size:12px;}

.repeat-setup-editor {margin-top:18px;}
.repeat-setup-editor summary {cursor:pointer;margin-bottom:12px;color:#e4c98b;}
.repeat-setup-editor>label,.repeat-setup-slot>label {display:flex;align-items:center;gap:8px;margin:10px 0;font-size:12px;}
.repeat-setup-editor textarea,.repeat-setup-slot .field-input {width:100%;margin-bottom:8px;}
.repeat-setup-slot {border:1px solid #b49a5d55;border-radius:14px;margin:14px 0;padding:12px;min-width:0;}

.repeat-saved-photos {margin-top:10px;font-size:12px;}
.repeat-saved-photos summary {color:#e4c98b;cursor:pointer;margin-bottom:8px;}
.repeat-saved-photos button {padding:3px;margin:0 5px 5px 0;border:1px solid #b49a5d66;border-radius:12px;}
.repeat-saved-photos img {display:block;width:48px;height:56px;object-fit:cover;border-radius:9px;}

#genSheet.lab-generation-form.has-repeat-inputs .sheet-cover {
  width:min(100%,calc(var(--repeat-preview-max,50dvh) * var(--media-ratio,.5625)));
  height:auto;max-height:none;min-height:0;aspect-ratio:var(--media-ar,9 / 16);margin-inline:auto;
}
#genSheet.lab-generation-form.has-repeat-inputs .sheet-cover img,
#genSheet.lab-generation-form.has-repeat-inputs .sheet-cover .sheet-cover-video {object-fit:contain;}

/* A transparent navigation surface must not expose the home page behind a repeat. */
:is(html[data-lab="true"],html[data-studio-v2="true"]) body.creation-workspace-open .bottom-nav { background:#1c1e1d;backdrop-filter:none;-webkit-backdrop-filter:none; }

/* Use the source frame's real aspect ratio for repeat covers, including
   portrait 9:16 videos. */
#genSheet.lab-generation-form.repeat-workspace .sheet-cover {
  width:min(100%,calc(var(--repeat-preview-max,50dvh) * var(--media-ratio,1.7778)));
  height:auto;
  max-width:100%;
  max-height:none;
  aspect-ratio:var(--media-ar,16 / 9);
  margin-inline:auto;
}
#genSheet.lab-generation-form.repeat-workspace .sheet-cover img,
#genSheet.lab-generation-form.repeat-workspace .sheet-cover .sheet-cover-video {
  object-fit:contain;
}

#profileSectionTabs .filter-pill { display:inline-flex;align-items:center;gap:7px; }
#profileSectionTabs .profile-section-icon { display:inline-flex;flex:0 0 18px;width:18px;height:18px;align-items:center;justify-content:center;color:#dec183; }
#profileSectionTabs .profile-section-icon svg { display:block;width:18px;height:18px; }

/* Profile navigation matches the community Ideas filter buttons. */
#profileSectionTabs .filter-pill { display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 16px;border:1px solid #b7944e8c;border-radius:999px;background:linear-gradient(150deg,#34302466,#141811);color:#e6dfcf;white-space:nowrap;font-size:13px;box-shadow:inset 0 1px #f8dfa018; }
#profileSectionTabs .profile-section-icon { flex-basis:20px;width:20px;height:20px;color:#edc77a; }
#profileSectionTabs .profile-section-icon svg { width:20px;height:20px; }
#profileSectionTabs .filter-pill.active { color:#ffe5a4;border-color:#f0ce79;background:radial-gradient(ellipse at 50% 100%,#a373282e,transparent 75%),#1c211b;box-shadow:0 0 0 1px #f3cd6755,0 0 16px #dda53055,inset 0 0 13px #c5962726; }
#profileSectionTabs .filter-pill:focus-visible { outline:2px solid #f0ce79;outline-offset:4px; }

/* Treasury: a polished wheel with clear task rewards and states. */
#view-treasury { max-width:760px;margin-inline:auto; }
#view-treasury .treasury-title { padding:12px 0 10px; }
#view-treasury .treasury-card { border-radius:26px;border-color:#a88a494d;background:radial-gradient(ellipse at 50% 0,#a67f2520,transparent 65%),#191c18; }
#view-treasury .treasury-spin { min-height:52px;border-radius:16px;font-size:16px; }
#view-treasury .treasury-timer { color:#e5ce98; }
#view-treasury .treasury-tasks-head { min-height:120px; }
.treasury-task-progress { margin:16px 0 20px;padding-bottom:13px;position:relative;color:#e7d09c;font-size:12px;font-weight:650; }
.treasury-task-progress::before,.treasury-task-progress::after { content:"";position:absolute;left:0;bottom:0;height:4px;border-radius:4px; }
.treasury-task-progress::before { width:100%;background:#d8be7820; }
.treasury-task-progress::after { width:var(--task-progress,0%);background:linear-gradient(90deg,#b58c3c,#f6dda0); }
#view-treasury .treasury-task { display:grid;grid-template-columns:44px minmax(0,1fr);gap:12px;min-width:0;padding:16px;border-radius:19px;background:linear-gradient(130deg,#78603016,transparent 65%),#1e231c;border-color:#b79a5540; }
#view-treasury .treasury-task-icon { width:42px;height:42px;border-radius:14px;background:#d5b4620b; }
#view-treasury .treasury-task strong { font-size:14px;line-height:1.4;color:#f4e7c8; }
#view-treasury .treasury-task p { font-size:12px;line-height:1.5;margin:5px 0 9px; }
.treasury-task-status { display:block;margin-bottom:8px;font-size:10px;line-height:1.4;color:#b8b6a6; }
#view-treasury .treasury-task-reward { padding:5px 9px;border:1px solid #cfac5d40;border-radius:999px;background:#af8b3020;font-size:13px; }
#view-treasury .treasury-task-actions { grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%; }
#view-treasury .treasury-task-actions button { min-height:42px;font-size:12px;border-radius:12px; }
#view-treasury .treasury-task-actions button:only-child { grid-column:1/-1; }
#view-treasury .treasury-task--awarded { border-color:#a1bd6f5c;background:#27332155; }
#view-treasury .treasury-task--awarded .treasury-task-status { color:#bdd49c; }
#view-treasury .treasury-task--pending { border-color:#e7c06b70; }
@media(min-width:600px) { #view-treasury .treasury-task-list { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start; } }

.admin-generation-history { margin-top:calc(var(--chrome-top,56px) + 16px);max-height:calc(100dvh - var(--chrome-top,56px) - 32px);box-sizing:border-box;padding-top:14px; }
.admin-generation-history .admin-history-head { position:sticky;top:0;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#1b1d18;padding:8px 0 12px; }
.admin-generation-history .admin-history-head .ui-close { position:static;flex-shrink:0; }
/* Gift task rows keep the reward and a circular action beside the title. */
#view-treasury .treasury-task-list { display:grid;grid-template-columns:minmax(0,1fr);gap:8px; }
#view-treasury .treasury-task {
  grid-template-columns:36px minmax(0,1fr) max-content 44px;
  align-items:center;gap:10px;padding:10px 12px;border-radius:16px;
  background:linear-gradient(135deg,#bd965013,transparent 65%),#1d1f1b;
  -webkit-text-size-adjust:100%;text-size-adjust:100%;
}
#view-treasury .treasury-task-icon {
  width:36px;height:36px;border-radius:11px;border-color:#d9ac626e;
  background:linear-gradient(145deg,#4b3820,#191911 72%);
}
#view-treasury .treasury-task-icon svg { width:20px;height:20px; }
#view-treasury .treasury-task strong { font-size:13px;line-height:1.35;overflow-wrap:anywhere; }
#view-treasury .treasury-task p { font-size:11px;line-height:1.4;margin:3px 0 0; }
#view-treasury .treasury-task-status { font-size:10px;margin:4px 0 0; }
#view-treasury .treasury-task-row-reward {
  display:inline-flex;align-items:center;gap:4px;white-space:nowrap;
  color:#f2d18b;font-size:13px;font-weight:700;
}
#view-treasury .treasury-task-row-reward img { width:17px;height:17px; }
#view-treasury .treasury-task-arrow {
  display:grid;place-items:center;width:44px;height:44px;min-width:44px;
  min-height:44px;padding:0;border:1px solid #c99d5d99;border-radius:50%;
  background:transparent;color:#f0d297;font-size:20px;line-height:1;
}
#view-treasury .treasury-task-arrow:not(:disabled):hover { background:#ad813225;border-color:#f0d297; }
#view-treasury .treasury-task-arrow:focus-visible { outline:2px solid #e9c783;outline-offset:3px; }
#view-treasury .treasury-task-arrow:disabled { opacity:.65;cursor:default; }
#view-treasury .treasury-task--awarded .treasury-task-arrow { color:#bfd89f;border-color:#bfd89f66; }
#view-treasury .treasury-tasks-head { min-height:0;padding-bottom:4px; }
.treasury-task-form { width:min(460px,calc(100vw - 32px));box-sizing:border-box; }
.treasury-task-form form { display:grid;gap:14px; }
.treasury-task-form form>label { display:grid;gap:8px;font-size:13px; }
.treasury-task-form textarea,.treasury-task-form input,.treasury-task-form select { width:100%;min-width:0;box-sizing:border-box; }
.treasury-task-form form>button { width:100%;min-height:48px;border-radius:13px; }
@media(max-width:360px) {
 #view-treasury .treasury-task { grid-template-columns:28px minmax(0,1fr) max-content 44px;padding:9px 7px;gap:6px; }
 #view-treasury .treasury-task-icon { width:28px;height:30px; }
}

/* Repeat bylines are text rows, not pills: rounded clipping cut off the last letter. */
#genSheet.repeat-personalization .sheet-gallery-author { width:100%;border-radius:0;overflow:visible;padding-right:4px; }
#genSheet.repeat-personalization .sheet-gallery-author-copy { flex:1 1 auto;min-width:0;overflow:visible; }
#genSheet.repeat-personalization .sheet-gallery-author-copy strong { white-space:normal;overflow-wrap:anywhere;line-height:1.4; }
#genSheet.repeat-personalization .sheet-gallery-author-copy::after { white-space:normal;line-height:1.5;padding-right:2px; }

/* Lab wheel: live sectors and upright values over a static ornamental scene.
   Only the face rotates; the rim, pointer, medallion and orbits stay fixed. */
html[data-lab="true"] #view-treasury .treasury-wheel-card {
  padding:0; margin:0 -16px 12px; border:0; border-radius:0; background:none;
}
html[data-lab="true"] #view-treasury .treasury-hero {
  container-type:inline-size; position:relative; isolation:isolate;
  max-width:560px; margin-inline:auto; padding-bottom:20px;
  overflow:hidden; background:transparent url("/shop/assets/treasury/wheel-orbits.svg?v=2") center / 100% 100% no-repeat;
}
html[data-lab="true"] #view-treasury .treasury-title {
  position:relative; z-index:1; margin:0; padding:6cqw 12px 0;
  text-align:center; color:#f0dda2;
}
html[data-lab="true"] #view-treasury .treasury-chest {
  display:block; width:5.4cqw; height:5.4cqw; margin:auto;
  color:#e3ca84; filter:drop-shadow(0 0 4px #b8852826);
}
html[data-lab="true"] #view-treasury .treasury-chest svg { display:block; width:100%; height:100%; }
html[data-lab="true"] #view-treasury .treasury-title h1 {
  margin:1cqw 0 0; font-size:clamp(20px,4.8cqw,27px); line-height:1.2;
  letter-spacing:-.025em; font-weight:700; color:#f0dda2; text-shadow:0 1px 4px #e9b54f30;
}
html[data-lab="true"] #view-treasury .treasury-title p {
  margin:1.6cqw 0 0; color:#c5b998; font-size:clamp(10px,2.5cqw,14px); line-height:1.4;
}
html[data-lab="true"] #view-treasury .treasury-wheel-stage {
  position:relative; isolation:isolate; padding:6cqw 0 5cqw; overflow:visible; background:none;
}
html[data-lab="true"] #view-treasury .treasury-wheel-stage::before,
html[data-lab="true"] #view-treasury .treasury-wheel-stage::after { content:none; }
html[data-lab="true"] #view-treasury .treasury-wheel-wrap {
  position:relative; isolation:isolate; width:62%; height:auto; aspect-ratio:1; margin:0 auto;
  container-type:inline-size;
}
html[data-lab="true"] #view-treasury .treasury-wheel-wrap::before {
  content:""; position:absolute; z-index:2; inset:-5.6%; border:0; border-radius:50%;
  background:url("/shop/assets/treasury/wheel-rim.svg") center / contain no-repeat;
  box-shadow:0 9px 20px #0009; pointer-events:none;
}
html[data-lab="true"] #view-treasury .treasury-wheel-wrap::after {
  content:""; position:absolute; z-index:1; inset:0; border:0; border-radius:50%;
  background:radial-gradient(ellipse at 50% 0,#ffe3a126,transparent 35%),
    radial-gradient(circle,transparent 58%,#0008 100%);
  pointer-events:none;
}
html[data-lab="true"] #view-treasury .treasury-wheel {
  --wheel-duration:3.2s;
  position:absolute; inset:0; border:0; border-radius:50%;
  background:url("/shop/assets/treasury/wheel-texture.svg") center / cover,
    repeating-conic-gradient(from 0deg,#ddba7145 0deg .28deg,transparent .28deg var(--wheel-step,25.7142857deg)),
    radial-gradient(circle,#080704 0%,transparent 70%),
    repeating-conic-gradient(from 0deg,#35291b 0deg var(--wheel-step,25.7142857deg),#090a08 var(--wheel-step,25.7142857deg) calc(2 * var(--wheel-step,25.7142857deg)));
  box-shadow:inset 0 0 18px #000b;
  transition:transform var(--wheel-duration) cubic-bezier(.12,.65,.12,1);
}
html[data-lab="true"] #view-treasury .treasury-prize {
  width:max-content; color:#deca88; font-size:clamp(10px,4.8cqw,17px);
  font-weight:650; line-height:1.15; text-shadow:0 1px 3px #000;
}
html[data-lab="true"] #view-treasury .treasury-wheel--instant { transition:none; }
html[data-lab="true"] #view-treasury .treasury-pointer {
  position:absolute; z-index:4; top:-8.5%; left:50%; transform:translateX(-50%);
  width:15%; height:auto; aspect-ratio:50 / 64; border:0;
  background:url("/shop/assets/treasury/wheel-pointer.svg") center / contain no-repeat;
  filter:drop-shadow(0 2px 2px #000) drop-shadow(0 0 4px #e9be5f55);
}
html[data-lab="true"] #view-treasury .treasury-pointer::after { content:none; }
html[data-lab="true"] #view-treasury .treasury-wheel-mark {
  z-index:3; width:20%; height:20%; box-sizing:border-box; padding:1.5%;
  border:2px solid #c5a367;
  background:radial-gradient(circle at 33% 20%,#967439,#2c2010 47%,#0d0b07 75%);
  box-shadow:inset 0 0 0 2px #1b1409,inset 0 0 0 3px #d0aa6566,0 0 0 3px #0a0805,0 4px 10px #000b;
}
html[data-lab="true"] #view-treasury .treasury-wheel-mark img {
  width:100%; height:100%; object-fit:contain; filter:saturate(.65) brightness(1.06); mix-blend-mode:screen;
}
html[data-lab="true"] #view-treasury .treasury-result {
  position:relative; z-index:1; display:table; max-width:85%; min-height:0;
  margin:0 auto; padding:1cqw 3.2cqw; border:1px solid #9d7f416e; border-radius:999px;
  background:linear-gradient(180deg,#211a0d99,#040403eb); color:#e4d19a !important;
  box-shadow:inset 0 1px 1px #eed49517,0 2px 6px #0008;
  font-size:clamp(10px,2.6cqw,14px); font-weight:500; line-height:1.35;
}
/* Reserve the result row before the first spin so the scene does not jump. */
html[data-lab="true"] #view-treasury .treasury-result:empty { display:table; visibility:hidden; }
html[data-lab="true"] #view-treasury .treasury-result:empty::before { content:"\00a0"; }
html[data-lab="true"] #view-treasury .treasury-result-icon { width:1.25em; height:1.25em; mix-blend-mode:screen; }
html[data-lab="true"] #view-treasury .treasury-wheel-controls { padding:14px 24px 8px; }
html[data-lab="true"] #view-treasury .treasury-daily { margin:0 0 10px; text-align:center; font-size:12px; color:#bfb8a4; }
@media (prefers-reduced-motion:reduce) {
  html[data-lab="true"] #view-treasury .treasury-wheel { transition:none; }
}

/* A paid still preview is reviewed before the separate video purchase. */
.source-repeat-dialog { overflow:auto; }
.source-repeat-dialog p { line-height:1.5; }
.source-repeat-price { color:#efd398; font-size:13px; }
.source-repeat-inputs { display:grid; gap:16px; }
.source-repeat-input { display:flex; gap:12px; padding:12px 0; }
.source-repeat-input small { color:#c9c1b5; }
.source-repeat-input input { max-width:100%; min-height:44px; color:inherit; }
.source-repeat-input .repeat-photo-tile>img {width:100%;height:100%;object-fit:cover;}
.source-repeat-preview :is(img,video) { display:block; width:100%; max-height:38dvh; object-fit:contain; border-radius:14px; background:#080809; }
.source-repeat-dialog>.btn-primary { width:100%; min-height:48px; margin-top:12px; white-space:normal; }

.source-repeat-scene { margin:0 0 12px; }
.source-repeat-scene figcaption { color:#efd398; margin:8px 0; font-size:13px; }
.source-repeat-preview:has(.source-repeat-scene:nth-child(2)) img { max-height:26dvh; }

/* Repeat preparation is a full-page workspace, not a floating popup. */
dialog.source-repeat-dialog {
  position:fixed;inset:0;margin:0;width:100%;max-width:none;
  height:100dvh;max-height:100dvh;box-sizing:border-box;border:0;border-radius:0;
  padding:calc(var(--tg-content-safe-area-inset-top, 0px) + 64px) max(20px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom));
  background:var(--bg, #1c201d);overflow-y:auto;overscroll-behavior:contain;
}
dialog.source-repeat-dialog>header {position:sticky;top:-1px;background:var(--bg, #1c201d);z-index:2;}
dialog.source-repeat-dialog .repeat-input-card {max-width:680px;width:100%;box-sizing:border-box;}

/* Social metrics belong to the feed, not the repeat editor. */
#genSheet.repeat-workspace :is(#sheetLikeBtn,#sheetRepeatBtn) {display:none !important;}

/* Direct repeats keep the original player/quality sheet and optional photo references. */
#genSheet.direct-video-repeat :is(#videoModeTabs,#videoReferencesBlock,#referenceAudioBlock,#multimodalReferenceNote,#avatarPickBlock,#sheetInspectPrompt,#additionalPromptBlock,#promptBlock,#genjutsuModeBlock) {display:none !important;}


.repeat-wardrobe-picker {width:min(540px,calc(100vw - 24px));max-height:calc(100dvh - 40px);overflow:auto;box-sizing:border-box;}
.repeat-wardrobe-picker .wardrobe-catalog-tabs {display:flex;gap:8px;overflow-x:auto;padding:8px 0 12px;}
.repeat-wardrobe-picker .wardrobe-catalog-tabs button {flex-shrink:0;min-height:42px;}
.repeat-wardrobe-picker .wardrobe-catalog-tabs [aria-pressed="true"] {border-color:#e3c47f;background:#b28d3c30;color:#f1d798;}
.repeat-wardrobe-picker .reference-own-upload {width:100%;min-height:46px;margin:0 0 12px;}
.repeat-wardrobe-picker .repeat-wardrobe-grid[hidden] {display:none;}

.mod-preset-sort-toolbar {display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:12px 0;position:sticky;top:0;z-index:3;background:var(--bg,#1c201d);}
.mod-preset-sort-toolbar p {flex-basis:100%;font-size:12px;color:var(--muted);margin:0;}
.mod-preset-position {display:flex;align-items:center;gap:6px;font-size:12px;width:100%;}
.mod-preset-position input {width:64px;min-height:40px;border:1px solid #b99b5760;border-radius:9px;background:#24271f;color:var(--text);text-align:center;font:inherit;}
.profile-admin-identity {font-size:12px;color:#d8c18d;overflow-wrap:anywhere;margin:8px 0;user-select:text;}

/* Shared upload feedback: image/video previews settle into a ready state. */
.reference-ready { box-shadow:0 2px 8px #0005;animation:reference-ready-in .24s ease-out; }
.reference-upload-tile,.reference-file--tile,.ref-thumb { animation:reference-preview-in .2s ease-out; }
.reference-upload-progress:not([aria-valuenow]),.reference-upload-progress[aria-valuenow="0"] { background:linear-gradient(90deg,#ffffff20 25%,#e9c678 50%,#ffffff20 75%);background-size:200% 100%;animation:reference-progress-flow 1.4s linear infinite; }
@keyframes reference-ready-in { from { transform:scale(.6);opacity:0; } to { transform:scale(1);opacity:1; } }
@keyframes reference-preview-in { from { transform:translateY(4px);opacity:.5; } to { transform:translateY(0);opacity:1; } }
@keyframes reference-progress-flow { to { background-position:-200% 0; } }
@media(prefers-reduced-motion:reduce) {
 .reference-ready,.reference-upload-tile,.reference-file--tile,.ref-thumb,.reference-upload-spinner,.reference-upload-progress { animation:none !important; }
}


/* Compact creation chrome keeps more of the draft visible on phones. */
:is(html[data-lab="true"],html[data-studio-v2="true"]) #genSheet.lab-generation-form .sheet-head {
  background:transparent !important;
  background-image:none !important;
  border-bottom:0;
  box-shadow:none;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  padding-block:6px;
}
#genSheet.lab-generation-form .sheet-head {
  position:relative;
  top:auto;
}
#genSheet.lab-generation-form #sheetPrice { display:none; }
#genSheet.lab-generation-form > .sheet-foot { padding-top:6px; }
.repeat-wardrobe-picker:focus { outline:none; }
.repeat-wardrobe-picker button.modal-close.ui-close {
  --close-size:32px;
  outline:none !important;
  transition:none;
}
.repeat-wardrobe-picker button.modal-close.ui-close:active { transform:none; }
.repeat-wardrobe-picker button.modal-close.ui-close::before,
.repeat-wardrobe-picker button.modal-close.ui-close::after { width:13px; }
@media (hover:hover) {
  .repeat-wardrobe-picker button.modal-close.ui-close:focus-visible {
    outline:2px solid #efd18d !important;
    outline-offset:3px !important;
  }
}
#view-tools .studio-tool-card {
  border-color:#d6b56a99;
  box-shadow:0 0 18px #e6ba4d45,inset 0 0 22px #dfbf6a20;
}
#view-tools .studio-tool-art {
  background-image:radial-gradient(ellipse at center,#e3bd7040,transparent 76%);
}
html[data-lab="true"] #view-treasury .treasury-title { padding-top:2cqw; }
html[data-studio-v2="true"] #view-treasury .treasury-title { padding-top:2cqw; }
html[data-lab="true"] #view-treasury .treasury-hero { margin-top:-12px; }
html[data-studio-v2="true"] #view-treasury .treasury-hero { margin-top:-12px; }
/* Keep the page surface opaque while iOS releases native video layers. */
#view-trends { background:var(--studio-warm-bg,#1c1e1d); }


/* In Telegram fullscreen, scroll the studio content under the native controls.
   The initial top inset keeps the first row and its actions clear of them. */
html.tg-fullscreen #genSheet.lab-generation-form {
  padding-top:0;
}
html.tg-fullscreen #genSheet.lab-generation-form > .sheet-body {
  padding-top:calc(var(--chrome-top) + 14px);
  scroll-padding-top:var(--chrome-top);
}

/* Browser chrome already occupies its own viewport space. */
html[data-website="true"] { --chrome-top:env(safe-area-inset-top,0px);--chrome-bottom:env(safe-area-inset-bottom,0px);--bottom-safe-area:env(safe-area-inset-bottom,0px); }
html[data-website="true"] body { min-height:var(--browser-height,100dvh); }
html[data-website="true"]:has(#view-profile:not(.hidden)) { scrollbar-width:none; }
html[data-website="true"]:has(#view-profile:not(.hidden))::-webkit-scrollbar { display:none; }
html[data-website="true"] body.is-feed-view,
html[data-website="true"] #profileWorkViewer { --feed-card-height:var(--browser-height,100dvh); }
html[data-website="true"] #profileWorkViewer { height:var(--browser-height,100dvh);max-height:var(--browser-height,100dvh); }
html[data-website="true"] .topbar { padding-top:max(8px,env(safe-area-inset-top)); }
html[data-lab="true"] .topbar .buy-pill { min-width:36px;min-height:36px;height:36px;padding:0 10px;font-size:12px;border-radius:13px;display:inline-flex;align-items:center;justify-content:center; }
html[data-lab="true"] .topbar .buy-pill-short { font-size:20px;font-weight:500;line-height:1; }
html[data-website="true"]:has(#view-profile:not(.hidden)) body { scrollbar-width:none; }
html[data-website="true"]:has(#view-profile:not(.hidden)) body::-webkit-scrollbar { display:none; }
html[data-website="true"] #view-ideas.feed-mode .gallery-grid { grid-auto-rows:var(--browser-height,100dvh); }
html[data-website="true"].feed-scroll { scroll-behavior:auto; }

/* One top-up label on every screen, including headers with a back control. */
html[data-lab="true"] .topbar .buy-pill { height:34px;min-height:34px;padding:0 10px;font-size:12px;border-radius:12px; }
html[data-lab="true"] .topbar .buy-pill-full { display:inline !important; }
html[data-lab="true"] .topbar .buy-pill-short { display:none !important; }
html[data-lab="true"] :is(.topbar-back,#detailModal .detail-close,.photo-lightbox-close) {
  width:36px;height:36px;min-width:36px;min-height:36px;padding:0;display:grid;place-items:center;
  border:1px solid rgba(198,164,93,.48);border-radius:12px;
  background:linear-gradient(145deg,rgba(51,45,32,.94),rgba(23,25,20,.94));
  color:#e6cd95;box-shadow:inset 0 1px rgba(255,231,174,.08);font-size:20px;font-weight:400;
}
@media(max-width:480px) {
  html[data-lab="true"] .topbar:has(#topbarBack:not(.hidden)) .brand-lockup { width:clamp(80px,24vw,106px); }
  html[data-lab="true"] .topbar-actions { gap:5px; }
  html[data-lab="true"] .topbar .buy-pill { padding-inline:8px;font-size:11px; }
}
/* Scrolling belongs to the feed, rather than the browser document. */
html[data-website="true"].feed-scroll { overflow:hidden;scroll-snap-type:none; }
html[data-website="true"] body.is-feed-view { overflow:hidden; }
html[data-website="true"] #view-ideas.feed-mode {
  position:fixed;inset:0;height:var(--browser-height,100dvh);max-height:var(--browser-height,100dvh);overflow:hidden;
}
html[data-website="true"] #view-ideas.feed-mode .gallery-grid {
  height:100%;max-height:100%;overflow-y:auto;overflow-x:hidden;scroll-snap-type:y mandatory;
  overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none;
  touch-action:pan-y;grid-auto-rows:var(--browser-height,100dvh);
}
html[data-website="true"] #view-ideas.feed-mode .gallery-grid::-webkit-scrollbar {display:none;}

/* The work back button owns one SVG, not the shared CSS cross. */
#detailModal .detail-close { box-sizing:border-box;flex-shrink:0; }
#detailModal .detail-close svg { display:block;grid-area:1 / 1; }
@media(max-width:480px) {
  html[data-lab="true"] .topbar:has(#topbarBack:not(.hidden)) .brand-lockup { width:clamp(112px,31vw,138px);max-width:138px; }
  html[data-lab="true"] .topbar:has(#topbarBack:not(.hidden)) { gap:5px;padding-inline:8px; }
  html[data-lab="true"] .topbar:has(#topbarBack:not(.hidden)) .topbar-back {width:32px;min-width:32px;height:34px;min-height:34px;}
  html[data-lab="true"] .topbar:has(#topbarBack:not(.hidden)) .treasury-button {width:32px;min-width:32px;height:34px;min-height:34px;padding:5px;}
  html[data-lab="true"] .topbar:has(#topbarBack:not(.hidden)) .buy-pill {padding-inline:7px;font-size:10px;}
}
html[data-website="true"]:has(#view-home:not(.hidden)) { background:#080908; }
html[data-website="true"] body:has(#view-home:not(.hidden)) {
  min-height:100vh;min-height:100dvh;
  background-color:#5b5141;
  background-origin:border-box;
}

/* Keep a decoded, appropriately sized logo through navigation. */
@media(max-width:480px) {
  html[data-lab="true"] .topbar .brand-lockup,
  html[data-lab="true"] .topbar:has(#topbarBack:not(.hidden)) .brand-lockup {
    width:clamp(112px,31vw,138px);max-width:138px;height:auto;transition:none;
  }
}
.profile-actions .profile-quick-action { min-height:70px;gap:7px;font-size:12px;line-height:1.2; }
.profile-actions .profile-quick-action > span:first-child {width:24px;height:24px;min-height:24px;flex:none;}
.profile-actions .profile-quick-action svg {width:24px;height:24px;}
@keyframes profile-controls-reveal {from{opacity:0;}to{opacity:1;}}
#view-profile:not(.is-profile-loading) :is(.profile-actions,.profile-support-entry,.profile-balance-row) {animation:profile-controls-reveal .32s ease-out;}
@media(prefers-reduced-motion:reduce){#view-profile:not(.is-profile-loading) :is(.profile-actions,.profile-support-entry,.profile-balance-row){animation:none;}}
/* Profile viewer has two independent controls in opposite corners. */
html[data-lab="true"] #profileWorkViewer > .photo-lightbox-close {
  position:absolute;left:max(12px,env(safe-area-inset-left));right:auto;
  top:calc(var(--chrome-top,0px) + 10px);z-index:15;
}
html[data-lab="true"] #profileWorkViewer .gc-video-sound {right:max(12px,env(safe-area-inset-right));left:auto;top:calc(var(--chrome-top,0px) + 10px);}
/* Every preset cover provides its own visible exit, not only trend videos. */
#genSheet.gen-sheet--preset #sheetCover:not(.hidden) #sheetCoverBack {
  display:grid !important;position:absolute;z-index:10;top:10px;right:10px;left:auto;
}
#genSheet.gen-sheet--preset:has(#sheetCover.hidden) #sheetClose {display:grid !important;}

html[data-website="true"]:has(#genSheet:not(.hidden)),
html[data-website="true"]:has(#profileWorkViewer[open]),
html[data-website="true"]:has(#detailModal:not(.hidden)) {background:var(--browser-screen-color,#1b1d1a);}
/* Readable profile actions retain their geometry while account data refreshes. */
#view-profile .profile-actions {gap:10px;}
#view-profile .profile-actions .profile-quick-action {min-height:82px;padding:12px 5px;gap:9px;font-size:13px;line-height:1.2;}
#view-profile .profile-actions .profile-quick-action > span:first-child,
#view-profile .profile-actions .profile-quick-action svg {width:28px;height:28px;min-height:28px;}
#view-profile .profile-support-entry {min-height:76px;font-size:15px;}
#view-profile .profile-balance-row {min-height:76px;}
#view-profile #profileBadges {min-height:36px;}
@media(max-width:350px) {#view-profile .profile-actions {grid-template-columns:repeat(2,minmax(0,1fr));}}

/* Safari samples the document canvas for browser chrome. Do not place a
   full-width fixed colour/backdrop-filter layer at the viewport's top edge. */
html[data-website="true"] body:not(.is-feed-view)::before {display:none;}
html[data-website="true"]:has(#view-home:not(.hidden)) {
  background-color:#080908;
}
html[data-website="true"] body:has(#view-home:not(.hidden)) {background:transparent !important;isolation:isolate;}
html[data-website="true"]:has(#view-home:not(.hidden)):has(#genSheet:not(.hidden),#profileWorkViewer[open],#detailModal:not(.hidden),#photoLightbox:not(.hidden)) {
  background-color:var(--browser-screen-color,#1b1d1a);
}

/* Keep Safari chrome dark while the raised artwork stays fixed beneath it. */
.browser-home-art {display:none;}
html[data-website="true"]:has(#view-home:not(.hidden)) {
  background:#080908;
}
html[data-website="true"] body:has(#view-home:not(.hidden)) {
  background:#080908 !important;
}
html[data-website="true"] body:has(#view-home:not(.hidden)) > .browser-home-art {
  --home-art-lift:clamp(72px,20vw,104px);
  display:block;position:fixed;left:0;right:0;
  top:calc(-1 * env(safe-area-inset-top,0px));
  height:calc(100lvh + env(safe-area-inset-top,0px) + env(safe-area-inset-bottom,0px));
  pointer-events:none;z-index:0;
  background-color:#080908;
  background-image:linear-gradient(180deg,#05050480 0,#05050470 300px,#0505046c 650px,#080908 100%),
    url("/shop/assets/home/lumix-lab-home-bg.webp?v=20261021-1");
  background-size:100% 100%,112% auto;
  background-position:center top,center calc(-1 * var(--home-art-lift));
  background-repeat:no-repeat;
}
html[data-website="true"]:has(#view-home:not(.hidden)):has(#genSheet:not(.hidden),#profileWorkViewer[open],#detailModal:not(.hidden),#photoLightbox:not(.hidden)) {
  background:var(--browser-screen-color,#1b1d1a);
}
html[data-website="true"].feed-scroll {
  background-color:#1b1d1a;
  background-image:var(--browser-feed-backdrop,none);
  background-position:center top;
  background-size:cover;
}
html[data-website="true"] #appMain {position:relative;z-index:1;}

/* Keep the dark upper edge stable while content scrolls past Safari chrome. */
html[data-website="true"] body:has(#view-home:not(.hidden)) > .browser-home-art::before {
  content:"";position:fixed;top:0;left:0;right:0;height:max(1px,env(safe-area-inset-top,0px));
  background:#080908;pointer-events:none;
}

.website-payment-banner {display:flex;align-items:center;gap:12px;margin-top:16px;padding:16px;border:1px solid #d6b56a80;border-radius:18px;background:linear-gradient(125deg,#3d3421,#25251d);color:#f4e6c5;}
.website-payment-banner>div {flex:1;min-width:0;}
.website-payment-banner small {display:block;margin-bottom:5px;font-size:11px;line-height:1.4;color:#c7b991;}
.website-payment-banner strong {display:block;font-size:14px;line-height:1.4;}
.website-payment-banner a {flex:none;padding:10px 13px;border-radius:12px;background:#efd28f;color:#252116;text-decoration:none;font-size:12px;font-weight:700;}
.website-payment-globe {display:grid;place-items:center;flex:none;width:32px;height:32px;color:#efd28f;}
.website-payment-globe svg {width:25px;height:25px;}
@media(max-width:350px){.website-payment-banner{gap:8px;padding:12px;}.website-payment-globe{display:none;}.website-payment-banner strong{font-size:12px;}}
