:root {
  --bg: #F6F3FC;
  --text: #18131F;
  --dim: #6F6B7E;
  --dim2: #8B87A0;
  --line: rgba(30, 20, 60, 0.1);
  --surface: rgba(30, 20, 60, 0.045);
  --surface-soft: rgba(30, 20, 60, 0.03);
  --topbar-bg: rgba(246, 243, 252, 0.75);
  --topbar-h: 56px;
  --accent: #8B5CFF;
  --accent-soft: rgba(139, 92, 255, 0.35);
  --accent-shadow: rgba(139, 92, 255, 0.35);
  --accent-tint: rgba(139, 92, 255, 0.07);
  --coral: #FF6A55;
  --success: #8FD35C;
  --modal-bg: #FFFFFF;
  --gen-bg: #0B0A10;
  --edit-bg: #1A1A1F;
  --font-head: "Unbounded", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius-card: 16px;
  --radius-pill: 999px;
  --shadow-cta: 0 12px 30px var(--accent-shadow);
  --shadow-result: 0 30px 70px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 16px 40px rgba(30, 20, 60, 0.15);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: #6B46E0;
}

a:hover {
  color: #4C2FB0;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* —— blobs —— */
.blobs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
}

.blob-a {
  width: 640px;
  height: 640px;
  left: -160px;
  top: -120px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  animation: blobA 16s ease-in-out infinite;
}

.blob-b {
  width: 560px;
  height: 560px;
  right: -140px;
  top: 120px;
  background: radial-gradient(circle, rgba(255, 106, 85, 0.35), transparent 70%);
  animation: blobB 19s ease-in-out infinite;
}

.blob-c {
  width: 480px;
  height: 480px;
  left: 30%;
  bottom: -220px;
  background: radial-gradient(circle, rgba(240, 185, 61, 0.22), transparent 70%);
  filter: blur(48px);
  animation: blobC 21s ease-in-out infinite;
}

@keyframes blobA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -40px) scale(1.15); }
}

@keyframes blobB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 50px) scale(1.1); }
}

@keyframes blobC {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 60px) scale(1.2); }
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(-0.6deg); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes kenBurns {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

@keyframes balanceFlash {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(8px); }
}

@keyframes sheetUp {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

@keyframes scrimIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* —— topbar —— */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.logo-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 16px var(--accent-shadow);
}

.logo-wordmark {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: 280px;
}

.profile-guest .login-block {
  align-items: center;
  margin-top: 16px;
  max-width: 320px;
}

.login-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--dim);
  text-align: right;
}

.profile-guest .login-hint {
  text-align: center;
}

.login-hint.is-error {
  color: var(--coral);
}

.btn-login {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-login:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-login-lg {
  font-size: 14px;
  padding: 12px 24px;
}

.login-picker-card,
.login-picker-sheet {
  --login-bg: #fbf9fe;
  position: relative;
  overflow: hidden;
  background: var(--login-bg);
  color: #18131f;
  border: none;
  box-shadow: var(--shadow-modal);
}

.login-picker-card {
  width: min(400px, calc(100vw - 32px));
  border-radius: 28px;
  padding: 0;
  text-align: center;
}

.login-picker-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.login-picker-orb {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
}

.login-picker-orb--tr {
  width: 260px;
  height: 260px;
  top: -60px;
  right: -80px;
  opacity: 0.16;
  filter: blur(4px);
}

.login-picker-orb--ml {
  width: 200px;
  height: 200px;
  top: 120px;
  left: -90px;
  opacity: 0.12;
}

.login-picker-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 28px 24px 30px;
  text-align: center;
}

.login-picker-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(30, 20, 60, 0.08);
  color: var(--dim);
  display: grid;
  place-items: center;
  font-size: 14px;
  cursor: pointer;
  z-index: 3;
}

.login-picker-brand {
  width: 60px;
  height: 60px;
  margin: 8px auto 18px;
  border-radius: 16px;
  display: block;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(24, 19, 31, 0.12);
}

.login-picker-title {
  margin: 0 0 6px;
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  color: #18131f;
  text-align: center;
}

.login-picker-sub {
  margin: 0 0 22px;
  font-size: 13.5px;
  line-height: 1.4;
  color: #6f6b7e;
  text-align: center;
}

.login-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-methods-more {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  margin-top: -10px; /* cancel flex gap while collapsed */
  transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.25s ease;
}

.login-methods-more.is-open {
  max-height: 160px;
  opacity: 1;
  pointer-events: auto;
  margin-top: 0;
}

.login-methods-more-toggle {
  appearance: none;
  border: none;
  background: transparent;
  padding: 4px;
  margin: 2px 0 0;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.login-method {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px;
  border-radius: 100px;
  border: 1px solid rgba(30, 20, 60, 0.14);
  background: #fff;
  color: #18131f;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  text-align: center;
}

.login-method:hover:not(:disabled):not(.login-method--disabled) {
  background: #fff;
  border-color: rgba(30, 20, 60, 0.22);
}

.login-method--primary {
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 600;
}

.login-method--primary:hover:not(:disabled):not(.login-method--disabled) {
  background: var(--accent);
  filter: brightness(1.03);
}

.login-method-label {
  flex: 0 1 auto;
}

.login-method-badge {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.login-method-badge svg {
  width: 12px;
  height: 12px;
  display: block;
}

.login-method-badge--on-primary {
  background: rgba(255, 255, 255, 0.25);
}

.login-method-badge--ya {
  background: #fc3f1d;
}

.login-method-badge--vk {
  background: #0077ff;
  font-size: 8px;
  letter-spacing: -0.02em;
}

.login-method-badge--tg {
  background: #2aabee;
}

.login-method-icon-mail {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #18131f;
}

.login-method--disabled,
.login-method:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.login-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  cursor: pointer;
  text-align: left;
  user-select: none;
}

.login-consent-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.login-consent-box {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
  border-radius: 5px;
  border: 1.5px solid rgba(30, 20, 60, 0.25);
  background: transparent;
  box-sizing: border-box;
  display: grid;
  place-items: center;
}

.login-consent-input:checked + .login-consent-box {
  border: none;
  background: var(--accent);
}

.login-consent-input:checked + .login-consent-box::after {
  content: "✓";
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.login-consent-text {
  font-size: 11.5px;
  line-height: 1.5;
  color: #6f6b7e;
}

.login-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}

.login-legal-links a {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-email-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.login-email-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: #6f6b7e;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 4px;
}

.login-email-back:hover {
  color: var(--text);
}

.login-email-hint {
  margin: 0;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.4;
}

.login-email-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
}

.login-email-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
}

.login-email-input:focus {
  border-color: var(--accent);
}

.login-email-input:disabled {
  opacity: 0.65;
}

.login-email-error {
  margin: 0;
  font-size: 12px;
  color: var(--coral);
  line-height: 1.35;
}

.login-email-submit {
  margin-top: 4px;
  width: 100%;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.login-email-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.login-email-resend {
  width: 100%;
  border: none;
  background: none;
  color: var(--dim);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
}

.login-email-resend:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.login-email-resend:hover:not(:disabled) {
  color: var(--text);
}

.balance-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 7px 9px 7px 15px;
  font-family: var(--font-mono);
  font-size: 13.8px;
  position: relative;
}

.balance-flash {
  position: absolute;
  right: 40px;
  top: -2px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 700;
  animation: balanceFlash 1.4s ease forwards;
  pointer-events: none;
}

.balance-plus {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.avatar-btn {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid rgba(30, 20, 60, 0.15);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  color: var(--dim);
}

.avatar-btn.active {
  border: 2px solid var(--accent);
  box-shadow: 0 6px 18px var(--accent-shadow);
}

.avatar-btn img,
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 148px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(30, 20, 60, 0.12);
  border-radius: 14px;
  box-shadow: var(--shadow-modal);
}

.avatar-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.avatar-menu-item:hover {
  background: rgba(30, 20, 60, 0.06);
}

.avatar-menu-item--danger {
  color: var(--coral);
}

.avatar-menu-item--danger:hover {
  background: rgba(220, 80, 80, 0.08);
}

/* —— main —— */
.main {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding-top: var(--topbar-h);
  overflow: hidden;
  z-index: 1;
}

.screen {
  width: 100%;
  height: 100%;
}

.hidden {
  display: none !important;
}

/* —— upload / home —— */
.screen-upload {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 40px;
  height: 100%;
  padding: 16px 40px 0;
  overflow: visible;
}

.upload-copy {
  max-width: 460px;
  flex: 0 1 auto;
  min-width: min(100%, 420px);
}

.upload-copy h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 36px;
  line-height: 1.2;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.accent-text {
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.upload-sub {
  color: var(--dim);
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 22px;
  max-width: 480px;
}

.advantage-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 22px;
  margin-bottom: 22px;
  height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  box-shadow: 0 12px 30px rgba(80, 50, 150, 0.08);
  overflow: hidden;
}

.advantage-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.advantage-body.is-fading {
  opacity: 0;
  transform: scale(0.96);
}

.advantage-badge {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  font-size: 15px;
  color: #fff;
  box-shadow: 0 6px 16px var(--accent-shadow);
}

.advantage-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15.5px;
  margin: 0 0 5px;
}

.advantage-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.55;
  min-height: 58px;
}

.advantage-dots {
  display: flex;
  gap: 5px;
  padding-left: 48px;
}

.advantage-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(30, 20, 60, 0.15);
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.35s ease, box-shadow 0.35s ease;
}

.advantage-dot.active {
  width: 20px;
  background: var(--accent);
  box-shadow: 0 2px 8px var(--accent-shadow);
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.btn-primary {
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16.5px;
  padding: 17px 32px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-cta);
}

.btn-secondary {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(30, 20, 60, 0.12);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 16px 26px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-wrap {
  width: min(546px, calc(100vw - 560px));
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.hero-stage {
  width: 100%;
  height: auto;
  padding: 18px 10px 16px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: visible;
}

.hero-glow {
  position: absolute;
  width: 70%;
  height: 78%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  filter: blur(30px);
  animation: glowPulse 3.4s ease-in-out infinite;
}

.hero-float {
  position: relative;
  width: 96%;
  z-index: 1;
  margin-top: 0;
  margin-left: 10%;
  animation: floatY 5s ease-in-out infinite;
}

.hero-collage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: clamp(14px, 3.5%, 22px);
  width: 100%;
  padding: 4px 8px 64px; /* место под смещение средней колонки */
  box-sizing: border-box;
  perspective: 1100px;
  align-items: start;
}

.hero-tile {
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: visible;
  position: relative;
  border-radius: 22px;
  background: transparent;
  box-shadow: 0 12px 28px rgba(30, 20, 60, 0.16);
  transform-style: preserve-3d;
  will-change: transform;
}

.hero-tile-flip {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.5s ease-in-out;
  border-radius: 22px;
}

.hero-tile-face {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

.hero-tile-face--front {
  transform: rotateY(0deg);
}

.hero-tile-face--back {
  transform: rotateY(180deg);
}

.hero-tile-inner,
.hero-tile-zoom {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.hero-tile-zoom {
  animation: kenBurns 13s ease-in-out infinite alternate;
}

.hero-tile-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-tile--skeleton {
  background: linear-gradient(
    110deg,
    var(--surface) 25%,
    var(--surface-soft) 37%,
    var(--surface) 63%
  );
  background-size: 200% 100%;
  animation: heroSkeleton 1.2s ease-in-out infinite;
  box-shadow: 0 12px 28px rgba(30, 20, 60, 0.08);
  overflow: hidden;
}

@keyframes heroSkeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* —— shared interior —— */
.screen-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 44px 60px;
}

/* Fixed header + scrollable body (styles / profile / params) */
.screen-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.screen-panel-head {
  flex: 0 0 auto;
  z-index: 2;
  padding: 44px 60px 14px;
  background: rgba(246, 243, 252, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(30, 20, 60, 0.04);
}

.screen-panel-head .screen-header {
  margin-bottom: 0;
}

.screen-panel-head .preset-banner {
  margin: 16px auto 0;
}

.screen-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 60px 32px;
  background: var(--bg);
}

/* Instagram-style: head overlays body, hides on scroll down */
.screen-panel--auto-hide {
  display: block;
}

.screen-panel--auto-hide .screen-panel-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 18px 60px 10px;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.screen-panel--auto-hide .screen-panel-head .screen-title {
  font-size: 20px;
  margin-bottom: 2px;
}

.screen-panel--auto-hide .screen-panel-head .screen-sub {
  font-size: 12.5px;
}

.screen-panel--auto-hide .screen-panel-head .preset-banner {
  margin: 10px auto 0;
  padding: 8px 14px;
}

.screen-panel--auto-hide .screen-panel-head.head-hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

.screen-panel--auto-hide .screen-panel-body {
  height: 100%;
  padding-top: var(--panel-head-space, var(--topbar-h));
}

.screen-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}

.screen-header.centered {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.screen-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 24px;
  margin-bottom: 4px;
}

.screen-sub {
  color: var(--dim);
  font-size: 13.5px;
}

.back-link {
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
}

.preset-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  flex: 0 0 auto;
  gap: 0;
}

.preset-banner-text {
  font-size: 13px;
  flex: 1;
  min-width: 0;
}

.preset-clear {
  cursor: pointer;
  color: #6F6B7E;
  font-size: 12px;
  white-space: nowrap;
  margin-left: 16px;
}

/* —— params screen (compact table) —— */
.screen-params.screen-scroll {
  padding: 40px 60px;
  overflow-y: auto;
}

.params-inner {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.params-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex: 0 0 auto;
}

.params-title {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.params-back {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8B87A0;
  cursor: pointer;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.params-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.params-row {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid rgba(30, 20, 60, 0.08);
}

.params-row--model {
  align-items: flex-start;
  padding: 18px 0;
}

.params-row--format {
  position: relative;
}

.params-label {
  width: 130px;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8B87A0;
  letter-spacing: 0.06em;
  margin: 0;
}

.params-row--model .params-label {
  margin-top: 2px;
}

.params-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.params-values--photos {
  gap: 6px;
}

.params-values-col {
  min-width: 0;
  flex: 1;
}

.params-values-col .params-values {
  margin-bottom: 6px;
}

.params-model-desc {
  margin: 0;
  font-size: 12px;
  color: #8B87A0;
}

.params-pill {
  border: 1px solid rgba(30, 20, 60, 0.08);
  background: rgba(30, 20, 60, 0.05);
  color: #6F6B7E;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.params-pill.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.params-pill-cost {
  opacity: 0.7;
}

.params-pill-chev {
  opacity: 0.7;
  font-size: 11px;
}

.params-pill--quality {
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
}

.params-pill--sm {
  padding: 6px 10px;
  font-size: 12px;
}

.params-photo-slot {
  width: 46px;
  height: 46px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(30, 20, 60, 0.05);
  border: 1px dashed rgba(30, 20, 60, 0.18);
  flex: 0 0 auto;
}

.params-photo-slot.filled {
  border-style: solid;
  border-color: rgba(30, 20, 60, 0.08);
}

.params-photo-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.params-photo-plus {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #B8B4C6;
  pointer-events: none;
}

.params-photo-slot input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.params-photo-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 15, 30, 0.6);
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  cursor: pointer;
  z-index: 5;
}

.params-photo-slot.filled:hover .params-photo-del {
  display: flex;
}

.params-photo-more {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: rgba(30, 20, 60, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: #8B87A0;
  cursor: pointer;
  font-family: var(--font-mono);
  flex: 0 0 auto;
}

.format-menu {
  position: absolute;
  top: 48px;
  left: 130px;
  z-index: 20;
  background: #fff;
  border: 1px solid rgba(30, 20, 60, 0.1);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(30, 20, 60, 0.1);
  width: 300px;
}

.format-group {
  margin-bottom: 12px;
}

.format-group:last-child {
  margin-bottom: 0;
}

.format-group-label {
  font-size: 11px;
  color: #8B87A0;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.format-group-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.params-prompt-wrap {
  flex: 0 0 auto;
  padding-top: 6px;
}

.params-param-wrap {
  flex: 0 0 auto;
  padding-top: 6px;
}

.params-param-label {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text);
}

.param-answer-input {
  width: 100%;
  border: 1px solid rgba(30, 20, 60, 0.08);
  border-radius: 12px;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text);
  background: rgba(30, 20, 60, 0.02);
  box-sizing: border-box;
}

.param-answer-input:focus {
  outline: none;
  border-color: rgba(30, 20, 60, 0.2);
}

.prompt-area {
  width: 100%;
  min-height: 44px;
  max-height: 80px;
  resize: none;
  border: 1px solid rgba(30, 20, 60, 0.08);
  border-radius: 12px;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text);
  background: rgba(30, 20, 60, 0.02);
  box-sizing: border-box;
}

.prompt-area:focus {
  outline: none;
  border-color: rgba(30, 20, 60, 0.2);
}

.cost-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  flex: 0 0 auto;
  background: none;
  border: none;
  border-radius: 0;
  margin-bottom: 0;
}

.cost-bar-label {
  margin: 0 0 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #8B87A0;
  letter-spacing: 0.05em;
}

.cost-bar-value {
  margin: 0;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 500;
}

.btn-generate {
  font-weight: 600;
  font-size: 14px;
  padding: 13px 28px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--accent-shadow);
}

.btn-generate:disabled {
  background: rgba(30, 20, 60, 0.08);
  color: #B8B4C6;
  cursor: default;
  box-shadow: none;
}

/* —— styles gallery —— */
.screen-styles .styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding-bottom: 8px;
  margin-top: 18px;
}

.style-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.style-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}

.style-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.style-card-cost {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #fff;
  z-index: 2;
  pointer-events: none;
}

/* —— generating —— */
.screen-generating {
  height: 100%;
  position: relative;
  overflow: hidden;
  background: var(--gen-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.gen-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.55);
  transform: scale(1.15);
}

.gen-scrim {
  position: absolute;
  inset: 0;
  background: rgba(11, 10, 16, 0.55);
}

.gen-spinner {
  position: relative;
  z-index: 2;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gen-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-right-color: var(--coral);
  animation: spinRing 1s linear infinite;
}

.gen-core {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 8px 24px var(--accent-shadow);
}

.gen-status,
.gen-cost {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  color: #fff;
  margin: 0;
}

.gen-status {
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gen-cost {
  font-size: 13px;
  font-weight: 600;
}

/* —— result —— */
.screen-result {
  height: 100%;
  position: relative;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.result-back {
  position: absolute;
  top: 18px;
  left: 22px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(30, 20, 60, 0.08);
  color: var(--text);
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.result-tile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 94%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--accent), var(--coral));
  box-shadow: var(--shadow-result);
}

.result-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.result-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: flex-start;
  gap: 6px;
  padding: 28px 16px 18px;
  background: linear-gradient(
    to top,
    rgba(12, 10, 18, 0.9) 0%,
    rgba(18, 12, 32, 0.45) 55%,
    rgba(18, 12, 32, 0) 100%
  );
}

.result-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 2px;
  margin: 0;
  color: rgba(255, 255, 255, 0.96);
  appearance: none;
  -webkit-appearance: none;
}

.result-action:active {
  opacity: 0.75;
}

.result-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: none;
  border: none;
  line-height: 1;
}

.result-action-btn svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.result-action-label {
  display: block;
  width: 100%;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

/* —— edit sheet —— */
.edit-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10;
  animation: scrimIn 0.2s ease;
}

.edit-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 11;
  background: var(--edit-bg);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.4);
  padding: 20px 24px 28px;
  animation: sheetUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.edit-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.edit-sheet-title {
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  margin: 0;
}

.edit-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.edit-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
  outline: none;
}

.edit-textarea:focus {
  border-color: var(--accent);
}

.edit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.edit-cost {
  color: #8B8798;
  font-size: 12px;
  font-family: var(--font-mono);
}

.btn-edit-submit {
  font-weight: 700;
  font-size: 13.5px;
  padding: 13px 20px;
  border-radius: var(--radius-pill);
  text-align: center;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.btn-edit-submit:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: #8B8798;
  cursor: default;
}

/* —— profile —— */
.profile-guest {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.profile-guest p {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 22px;
  color: var(--dim);
  overflow: hidden;
  flex: 0 0 auto;
}

.profile-avatar img,
.profile-avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-name {
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
  margin: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 4px;
  min-height: 28px;
}

.provider-badges {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.provider-badge-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  overflow: hidden;
}

.provider-badge-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.provider-badge--tg {
  background: rgba(42, 171, 238, 0.14);
  color: #2aabee;
}

.provider-badge--tg .provider-badge-icon {
  background: #2aabee;
  border-radius: 50%;
  padding: 2px;
  box-sizing: border-box;
}

.provider-badge--tg .provider-badge-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: translate(-1.1px, 1.1px);
}

.provider-badge--ya {
  background: rgba(252, 63, 29, 0.12);
  color: #fc3f1d;
}

.provider-badge--ya .provider-badge-icon {
  background: #fc3f1d;
  font-size: 10px;
}

.provider-badge--vk {
  background: rgba(0, 119, 255, 0.12);
  color: #0077ff;
}

.provider-badge--vk .provider-badge-icon {
  background: #0077ff;
  font-size: 7px;
  letter-spacing: -0.03em;
}

.provider-badge--mail {
  background: rgba(30, 20, 60, 0.08);
  color: #6f6b7e;
}

.provider-badge--mail .provider-badge-icon {
  background: transparent;
  color: #6f6b7e;
  border-radius: 0;
}

.provider-badge--mail .provider-badge-icon svg {
  width: 14px;
  height: 14px;
}

.profile-edit-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--dim);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.profile-edit-name:hover {
  color: var(--text);
  background: rgba(30, 20, 60, 0.06);
}

.profile-name-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 10px;
  outline: none;
}

.profile-name-input:focus {
  border-color: var(--accent);
}

.profile-name-input:disabled {
  opacity: 0.65;
}

.profile-handle {
  font-size: 13px;
  color: var(--dim);
  margin: 0;
}

.profile-divider {
  height: 1px;
  background: rgba(30, 20, 60, 0.08);
  margin: 0 0 24px;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 34px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dim);
  margin: 0 0 6px;
}

.stat-value {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.stat-suffix {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--success);
}

.topup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 34px;
  gap: 16px;
}

.referral-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  gap: 16px;
}

.referral-row-text {
  flex: 1 1 auto;
  min-width: 0;
}

.referral-row-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 4px;
}

.referral-row-sub {
  font-size: 12.5px;
  color: var(--dim);
  margin: 0 0 12px;
}

.referral-link-input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-mono, var(--font-body));
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg, transparent);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

.topup-row-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 4px;
}

.topup-row-sub {
  font-size: 12.5px;
  color: var(--dim);
  margin: 0;
}

.btn-topup {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 11px 22px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  flex: 0 0 auto;
}

.history-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.history-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.history-all {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
}

.history-empty {
  margin: 0 0 24px;
  opacity: 0.55;
  font-size: 14px;
}

.history-preview-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.history-thumb-btn,
.history-more-btn {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(30, 20, 60, 0.06);
  border: none;
  padding: 0;
  cursor: pointer;
}

.history-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-more-btn {
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px;
  line-height: 1.3;
}

.history-thumb-btn:hover,
.history-more-btn:hover {
  opacity: 0.88;
}

.screen-history {
  padding-bottom: 40px;
}

.history-page-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.history-page-back {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.history-page-title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 18px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.history-grid-card {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(30, 20, 60, 0.06);
  border: none;
  padding: 0;
  cursor: pointer;
}

.history-grid-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-grid-card:hover {
  opacity: 0.9;
}

.history-page-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 24px;
  text-align: center;
  color: var(--dim);
}

.history-page-empty-sub {
  margin: 0;
  font-size: 13px;
  color: var(--dim2, #8b87a0);
}

.show-more {
  font-size: 13px;
  color: #6b4fe0;
  cursor: pointer;
  margin: 0 0 40px;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
}

.show-more:disabled {
  opacity: 0.55;
  cursor: default;
}

.prompt-card {
  width: min(440px, calc(100vw - 32px));
  background: #fff;
  border-radius: 20px;
  padding: 24px 24px 22px;
  position: relative;
  box-shadow: var(--shadow-modal);
}

.prompt-sheet-text {
  margin: 4px 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(30, 20, 60, 0.05);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: min(55vh, 480px);
  overflow-y: auto;
  overflow-wrap: anywhere;
}

.btn-prompt-copy {
  display: block;
  width: 100%;
  border-radius: var(--radius-pill);
  padding: 13px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
}

.btn-prompt-copy:hover {
  opacity: 0.92;
}

/* —— modals —— */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-scrim.topup {
  background: rgba(0, 0, 0, 0.6);
}

.lightbox-card {
  width: 360px;
  background: var(--modal-bg);
  border-radius: 22px;
  overflow: hidden;
  position: relative;
}

.lightbox-close,
.topup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  font-size: 13px;
}

.topup-close {
  top: 16px;
  right: 16px;
  background: var(--surface);
  color: var(--dim);
}

.lightbox-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.lightbox-body {
  padding: 18px 20px;
}

.lightbox-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}

.lightbox-sub {
  font-size: 12.5px;
  color: var(--dim);
  margin: 0 0 16px;
}

.btn-download {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 11px 0;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.topup-card {
  width: min(520px, calc(100vw - 32px));
  background: var(--modal-bg);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-modal);
}

.topup-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px;
}

.topup-sub {
  font-size: 13px;
  color: var(--dim);
  margin: 0 0 22px;
}

.error-modal-card {
  width: min(420px, calc(100vw - 32px));
  background: var(--modal-bg);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 28px 22px;
  position: relative;
  box-shadow: var(--shadow-modal);
}

.error-modal-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  margin: 0 28px 14px 0;
}

.error-modal-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 20px;
}

.error-modal-body b {
  font-weight: 600;
}

.error-modal-body i {
  font-style: italic;
  color: var(--dim);
}

.btn-error-ok {
  display: block;
  width: 100%;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 12px 0;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
}

.btn-error-ok:hover {
  opacity: 0.9;
}

#turnstile-container {
  display: flex;
  justify-content: center;
  min-height: 65px;
  margin-top: 16px;
}

.packs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pack-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  text-align: left;
  background: var(--modal-bg);
  min-width: 0;
}

.pack-card--featured {
  border: 1.5px solid var(--accent);
  box-shadow: none;
}

.pack-card:disabled,
.pack-card.disabled {
  opacity: 0.55;
  cursor: wait;
  pointer-events: none;
}

.pack-badge {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  margin: 0;
}

.payment-notice {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 36px 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.payment-notice.success {
  background: #1a3d2e;
  color: #d8f5e5;
}

.payment-notice.neutral {
  background: #2a2a32;
  color: #eee;
}

.payment-notice-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 4px;
}

.pack-amount {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.25;
  white-space: nowrap;
}

.pack-meta {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--dim);
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .screen-upload {
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 24px 24px 40px;
  }

  .hero-wrap,
  .hero-stage {
    width: min(546px, 100%);
  }

  .cta-row {
    flex-wrap: wrap;
  }

  .hero-float {
    width: 96%;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .history-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .topbar {
    padding: 0 20px;
  }

  .screen-scroll {
    padding: 28px 20px;
  }

  .screen-params.screen-scroll {
    padding: 28px 20px;
  }

  .screen-panel-head {
    padding: 28px 20px 12px;
  }

  .screen-panel--auto-hide .screen-panel-head {
    padding: 14px 20px 8px;
  }

  .screen-panel-body {
    padding: 12px 20px 28px;
  }
}

/* ── Web Push: тумблер в профиле ───────────────────────────────────────── */
.push-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--line, rgba(30, 20, 60, 0.1));
  gap: 16px;
}

.push-toggle-text {
  flex: 1;
  min-width: 0;
}

.push-toggle-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 3px;
}

.push-toggle-sub {
  font-size: 12px;
  color: var(--dim, #6f6b7e);
  margin: 0;
}

.push-toggle-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1.5px solid rgba(30, 20, 60, 0.12);
  background: rgba(30, 20, 60, 0.045);
  color: var(--dim, #6f6b7e);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.push-toggle-btn--on {
  background: var(--accent, #8b5cff);
  border-color: var(--accent, #8b5cff);
  color: #fff;
}

.push-toggle-btn--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Web Push: контекстный баннер при генерации ────────────────────────── */
.push-gen-banner {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 320px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(30, 20, 60, 0.18);
  padding: 16px 18px;
  z-index: 200;
  animation: pushBannerIn 0.22s ease;
}

@keyframes pushBannerIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.push-gen-banner-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
}

.push-gen-banner-actions {
  display: flex;
  gap: 8px;
}

.push-gen-banner-yes {
  flex: 1;
  padding: 9px 0;
  border-radius: 10px;
  border: none;
  background: var(--accent, #8b5cff);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.push-gen-banner-no {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1.5px solid rgba(30, 20, 60, 0.12);
  background: transparent;
  color: var(--dim, #6f6b7e);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
