:root {
  --bg: #090b10;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-2: rgba(255, 255, 255, 0.075);
  --text: rgba(255, 255, 255, 0.93);
  --muted: rgba(255, 255, 255, 0.66);
  --border: rgba(255, 255, 255, 0.14);
  --accent: #f06b85;
  --accent-2: #d94f79;
  --gold: #d9b56a;
  --ok: #34d399;
  --wait: #fbbf24;
  --danger: #fb7185;
}

* { box-sizing: border-box; }

/* Global scrollbar styling */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 107, 133, 0.75) rgba(255, 255, 255, 0.08);
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(240, 107, 133, 0.88), rgba(217, 181, 106, 0.75));
  border-radius: 999px;
  border: 2px solid rgba(9, 11, 16, 0.55);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(240, 107, 133, 0.98), rgba(217, 181, 106, 0.9));
}

::-webkit-scrollbar-corner {
  background: transparent;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(1200px 520px at 12% -14%, rgba(240, 107, 133, 0.22), transparent 62%),
    radial-gradient(860px 420px at 88% -8%, rgba(217, 79, 121, 0.16), transparent 66%),
    radial-gradient(760px 560px at 50% 122%, rgba(217, 181, 106, 0.06), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Auth-only pages (no sidebar/header) */
.auth-page {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 1.25rem 1rem 2rem;
}

.auth-page__inner {
  position: relative;
  width: 100%;
  max-width: 560px;
}

.auth-page__brand {
  display: inline-block;
  font-weight: 900;
  letter-spacing: 0.3px;
  font-size: 1.18rem;
  opacity: 0.95;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.auth-lang-switcher {
  display: inline-flex;
  gap: 0.42rem;
}

.auth-lang-switcher__btn {
  min-width: 50px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.auth-shell {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1.35rem;
  padding: 1.2rem 1.15rem 1.25rem;
  background:
    linear-gradient(170deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04) 45%, rgba(255,255,255,0.02)),
    rgba(9, 12, 21, 0.86);
  box-shadow:
    0 24px 60px rgba(0,0,0,0.48),
    inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
}

.auth-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(28px);
  z-index: -1;
  pointer-events: none;
}

.auth-glow--one {
  width: 220px;
  height: 220px;
  top: -70px;
  right: -90px;
  background: rgba(240, 107, 133, 0.13);
}

.auth-glow--two {
  width: 180px;
  height: 180px;
  bottom: -55px;
  left: -70px;
  background: rgba(217, 181, 106, 0.1);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(0, 0, 0, 0.25);
  padding: 0.15rem 0.35rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(255,255,255,0.10);
}

a { color: inherit; text-decoration: none; }

.app {
  display: grid;
  grid-template-columns: 324px minmax(0, 1fr);
  min-height: 100%;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: start;
  border-right: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  padding: 1.6rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.brand {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start;
  gap: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.3px;
  font-size: 2rem;
  line-height: 1.05;
  margin-top: 0.45rem;
  margin-bottom: 0.55rem;
  white-space: nowrap;
  width: fit-content;
  max-width: 100%;
}

.brand__image {
  display: inline-block !important;
  width: 50px !important;
  height: 50px !important;
  min-width: 50px;
  max-width: 50px;
  min-height: 50px;
  max-height: 50px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  flex: 0 0 auto;
  align-self: center;
  vertical-align: middle;
}

.brand > span {
  display: inline-block;
  white-space: nowrap;
}

.brand__text--ru {
  font-size: 0.86em;
}

.nav__title {
  margin-top: 1.25rem;
  margin-bottom: 0.08rem;
  padding: 0 0.2rem;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.12rem;
}

.nav__link {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.1;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav__link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.2);
  transform: translateX(2px);
}

.nav__link--active {
  color: var(--text);
  border-color: rgba(240, 107, 133, 0.45);
  background: linear-gradient(135deg, rgba(240,107,133,0.16), rgba(217,181,106,0.08));
  box-shadow: 0 0 0 3px rgba(240, 107, 133, 0.08);
}

.nav__icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.nav__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nav__link > span:last-child {
  display: block;
  line-height: 1.1;
}

.auth-form-wrap {
  max-width: 380px;
  margin: 0 auto;
}

.auth-form-wrap--wide {
  max-width: 420px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.auth-form--elevated {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
  padding: 0.9rem;
  background: rgba(0,0,0,0.16);
}

.auth-form--spaced {
  margin-top: 1rem;
}

.auth-label {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.73);
  font-weight: 600;
}

.auth-input {
  padding: 0.72rem 0.82rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.26);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(240, 107, 133, 0.44);
  box-shadow: 0 0 0 4px rgba(240, 107, 133, 0.1);
  background: rgba(10, 12, 18, 0.72);
}

.auth-error {
  color: var(--danger);
  margin-bottom: 0.8rem;
  border: 1px solid rgba(251, 113, 133, 0.35);
  background: rgba(127, 29, 29, 0.22);
  border-radius: 0.82rem;
  padding: 0.62rem 0.74rem;
}

.auth-success {
  color: var(--ok);
  margin-bottom: 0.8rem;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(6, 78, 59, 0.26);
  border-radius: 0.82rem;
  padding: 0.62rem 0.74rem;
}

.auth-hint {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.auth-hint--compact {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.auth-hint--spaced {
  margin-top: 1rem;
}

.auth-hint a {
  color: var(--accent);
}

.auth-enter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  max-width: 560px;
  margin: 0 auto;
}

.auth-enter__card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--panel);
  color: inherit;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.auth-enter__card:hover {
  border-color: var(--accent);
  background: var(--panel-2);
}

.auth-enter__icon {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.auth-enter__title {
  font-weight: 600;
  font-size: 1.05rem;
}

.auth-enter__desc {
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-bot-link {
  display: inline-block;
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 0.85rem;
}

.hero--auth {
  margin: 0 0 1rem;
  text-align: left;
}

.title--auth {
  margin: 0 0 0.4rem;
  font-size: clamp(1.45rem, 3.2vw, 1.95rem);
}

.subtitle--auth {
  max-width: 36ch;
}

.auth-card {
  padding: 0.95rem;
}

.option-pills--auth {
  margin-bottom: 0.95rem;
}

.content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  box-sizing: border-box;
  height: 56px;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.header__menu-btn {
  display: none;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.2rem;
  cursor: pointer;
}

.header__menu-btn > span {
  display: block;
  width: 0.95rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.app__drawer-backdrop {
  display: none;
}

.header__section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.header__spacer {
  flex: 1;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-switcher {
  position: relative;
}

.lang-switcher__trigger {
  width: 1.32rem;
  height: 1.32rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.lang-switcher__trigger:hover {
  background: var(--panel-2);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.35);
}

.lang-switcher__trigger:active {
  transform: translateY(0);
}

.lang-switcher__flag {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 0;
  box-shadow: none;
}

.lang-switcher__item-flag {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.lang-switcher__menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 180px;
  padding: 0.35rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 110;
}

.lang-switcher__menu[hidden] {
  display: none;
}

.lang-switcher__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.lang-switcher__item:hover {
  background: var(--panel-2);
}

.lang-switcher__check {
  margin-left: auto;
  opacity: 0;
  color: var(--muted);
}

.lang-switcher__item.is-active .lang-switcher__check {
  opacity: 1;
}

.lang-switcher__item.is-active {
  background: rgba(255, 255, 255, 0.06);
}

.header__balance {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
}

.header__bonus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  line-height: 1;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 0.7rem;
  padding: 0.38rem 0.72rem;
  background: linear-gradient(135deg, rgba(217,181,106,0.34), rgba(240,107,133,0.18));
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.header__bonus:hover {
  border-color: rgba(255,255,255,0.35);
}

.header__bonus:disabled {
  opacity: 0.7;
  cursor: default;
}

.header__bonus-icon {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.header__bonus-label {
  display: inline-flex;
  align-items: center;
}

.site-notifications {
  position: relative;
}

.site-notifications__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.95rem;
  height: 1.95rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.98rem;
  cursor: pointer;
  position: relative;
}

.site-notifications__trigger:hover {
  background: var(--panel-2);
  border-color: rgba(255, 255, 255, 0.2);
}

.site-notifications__icon {
  line-height: 1;
}

.site-notifications__count {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  padding: 0 4px;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(251, 113, 133, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.site-notifications__menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  width: min(380px, 84vw);
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 0.35rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 120;
}

.site-notifications__list {
  display: grid;
  gap: 0.35rem;
}

.site-notifications__item {
  display: block;
  padding: 0.52rem 0.6rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.45rem;
  background: rgba(255,255,255,0.02);
  color: var(--text);
}

.site-notifications__item:hover {
  background: var(--panel-2);
}

.site-notifications__item.is-unread {
  border-color: rgba(240, 107, 133, 0.42);
}

.site-notifications__item--inline {
  cursor: default;
}

.site-notifications__title {
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.3;
}

.site-notifications__title-meta {
  font-weight: 500;
  font-size: 0.79rem;
  color: var(--muted);
  white-space: nowrap;
}

.site-notifications__empty {
  padding: 0.6rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.header__login {
  padding: 0.4rem 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 0.95rem;
}

.header__login:hover {
  background: var(--panel-2);
  border-color: rgba(255, 255, 255, 0.2);
}

.profile {
  position: relative;
}

.profile__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  padding: 0.38rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  width: fit-content;
  max-width: min(42vw, 360px);
}

.profile__trigger:hover {
  background: var(--panel-2);
  border-color: rgba(255, 255, 255, 0.2);
}

.profile__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  flex-shrink: 0;
}

.profile__avatar-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile__avatar-wrap .profile__avatar {
  width: 28px;
  height: 28px;
}

.profile__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
  min-width: 0;
  max-width: 100%;
}

.profile__name {
  font-size: 0.86rem;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile__balance {
  margin-top: 0.16rem;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile__balance-badge {
  position: absolute;
  right: -6px;
  top: -6px;
  height: 16px;
  min-width: 16px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  pointer-events: none;
  white-space: nowrap;
}

.profile__balance-badge::after {
  content: "👑";
  margin-left: 2px;
  font-size: 0.8em;
  opacity: 0.85;
}

.profile__dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 180px;
  padding: 0.35rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.profile__dropdown[hidden] {
  display: none;
}

.profile__item {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  color: var(--text);
  font-size: 0.95rem;
}

.profile__item:hover {
  background: var(--panel-2);
}

.profile__item--danger:hover {
  color: var(--danger);
}

.app-toast-container {
  position: fixed;
  right: 24px;
  top: 72px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: min(94vw, 560px);
}

.app-toast {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 15px 17px;
  color: #fff;
  box-shadow: 0 14px 44px rgba(0,0,0,0.4);
  font-size: 1.05rem;
  line-height: 1.35;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.26s ease, transform 0.26s ease;
}

.app-toast.is-hiding {
  opacity: 0;
  transform: translateY(8px);
}

.app-toast--error {
  background: rgba(220, 38, 38, 0.95);
  --app-toast-timer-color: rgba(255, 205, 210, 0.95);
}

.app-toast--success {
  background: rgba(22, 163, 74, 0.95);
  --app-toast-timer-color: rgba(187, 247, 208, 0.96);
}

.app-toast__text {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.app-toast__close {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.05rem 0.35rem;
  opacity: 0.9;
}

.app-toast__close:hover {
  opacity: 1;
}

.app-toast__timer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--app-toast-timer-color, rgba(255, 255, 255, 0.94));
  transform-origin: left center;
  transform: scaleX(1);
  transition-property: transform;
  transition-timing-function: linear;
  transition-duration: 0ms;
  will-change: transform;
  pointer-events: none;
}

@media (max-width: 768px) {
  .app-toast-container {
    right: 12px;
    top: 36px;
    gap: 0.6rem;
    max-width: min(96vw, 560px);
  }

  .app-toast {
    font-size: 0.95rem;
    padding: 11px 12px;
    border-radius: 14px;
  }

  .app-toast__close {
    font-size: 1.15rem;
    padding: 0.05rem 0.2rem;
  }
}

.main {
  flex: 1;
  padding: 1.5rem 1.5rem 2.5rem;
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
}

.main--home {
  max-width: none;
  margin: 0;
  padding-top: 2.35rem;
}

.footer {
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.footer__inner {
  padding: 1rem 1.5rem;
}

.footer__docs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.footer__docs-link {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.footer__docs-link:hover {
  text-decoration: underline;
}

.footer__docs-sep {
  color: var(--muted);
  font-size: 0.82rem;
}

.generation-history {
  margin-top: 1.25rem;
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

.generation-history__list {
  margin: 0 0 0 1.1rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.generation-history__list li {
  margin-bottom: 0.35rem;
}

.generation-history__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.generation-history__link {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

button.generation-history__link {
  font: inherit;
  text-align: left;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  width: 100%;
}

.generation-history__date {
  color: var(--muted);
  font-size: 0.88em;
  flex-shrink: 0;
}

.generation-history__scenario {
  font-weight: 600;
}

.generation-history__link:hover {
  color: var(--accent-2);
}

.generation-history__action-btn {
  min-height: 2.25rem;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.modal--history-preview {
  max-width: min(96vw, 920px);
  width: 100%;
}

.modal__body--history-preview {
  padding: 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.22);
}

.modal__body--history-preview video,
.modal__body--history-preview img {
  display: block;
  max-width: 100%;
  max-height: min(78vh, 640px);
  width: auto;
  height: auto;
  border-radius: 0.5rem;
}

.form__actions--history-preview {
  justify-content: center;
  align-items: stretch;
  gap: 0.65rem;
  padding: 0 0.8rem 0.85rem;
  margin-top: 0.2rem;
}

.form__actions--history-preview .button,
.form__actions--history-preview > .button,
.form__actions--history-preview > a.button {
  min-height: 44px;
  flex: 1 1 220px;
  max-width: 300px;
  margin: 0 !important;
  text-align: center;
}

.hero {
  margin: 0.5rem 0 1.2rem;
  text-align: center;
}

.title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero--home {
  text-align: left !important;
}

.title--home {
  margin: 0;
}

.home-hero__brand {
  display: block;
}

.home-hero__tagline {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.55em;
  font-weight: 400;
  color: var(--muted);
}

.card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  border-radius: 1.1rem;
  padding: 1.1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.form__row {
  margin-bottom: 1rem;
}

.edit-mode-tabs {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
}

.edit-mode-tab {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.edit-mode-tab:hover {
  color: var(--text);
  background: rgba(240, 107, 133, 0.11);
}

.edit-mode-tab.is-active {
  color: #15080c;
  background: linear-gradient(180deg, #f4a1b4, #e56f8f);
}

.label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.hint {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.input--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form__row--photo {
  margin-bottom: 0.5rem;
}

.photo-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.photo-row__head .label {
  margin-bottom: 0;
}

.form__row--photo .label {
  margin-bottom: 0.5rem;
}

.form__row--scenario {
  margin-top: 1.75rem;
}

.upload-dropzone {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 1rem;
  border: 1px dashed rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.16);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.upload-dropzone:hover {
  border-color: rgba(240, 107, 133, 0.34);
  background: rgba(22, 10, 16, 0.52);
}

.upload-dropzone__placeholder {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
}

.upload-dropzone__title {
  font-weight: 800;
  font-size: 1.05rem;
}

.upload-dropzone__subtitle {
  color: var(--muted);
  font-size: 0.92rem;
}

.upload-dropzone__preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.field-error {
  margin-top: 0.4rem;
  color: #fca5a5;
  font-size: 0.9rem;
}

.input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  outline: none;
}

.input:focus {
  border-color: rgba(240, 107, 133, 0.38);
  box-shadow: 0 0 0 4px rgba(240, 107, 133, 0.1);
}

.scenarios {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

@media (max-width: 720px) {
  .scenarios { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .photo-row__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

.scenario {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.16);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.scenario:hover {
  border-color: rgba(240, 107, 133, 0.34);
  background: rgba(23, 10, 16, 0.56);
  transform: translateY(-1px);
}

.scenario__radio {
  display: none;
}

.scenario__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.scenario__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.scenario__title {
  font-weight: 700;
  margin-bottom: 0.2rem;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.scenario__desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.scenario__price {
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.scenario__preview {
  margin-top: 0.25rem;
}

.scenario__preview video {
  width: 100%;
  border-radius: 0.7rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(15, 23, 42, 0.95);
  max-height: 240px;
  object-fit: contain;
}

.scenario__preview-empty {
  width: 100%;
  min-height: 120px;
  border-radius: 0.7rem;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.45);
}

.scenario__radio:checked + .scenario__body {
  border-radius: 0.7rem;
  box-shadow: 0 0 0 1px rgba(240, 107, 133, 0.48), 0 0 0 4px rgba(240, 107, 133, 0.12);
}

.form__row--options {
  margin-top: 1rem;
}

/* Страница «Оживить»: сценарий | качество + длительность в одной строке */
.animate-params-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: center;
  margin-top: 1.75rem;
}

.animate-params-col--options {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  min-width: 0;
  padding-top: 0.45rem;
}

.animate-params-col--options .animate-params__subrow:first-child {
  margin-top: 0.4rem;
}

/* Компактные pill’ы, чтобы две строки по высоте укладывались у блока сценария */
.animate-params-col--options .label {
  font-size: 0.8rem;
  margin-bottom: 0.62rem;
  line-height: 1.2;
}

.animate-params-col--options .option-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  width: 100%;
}

.animate-params-col--options .option-pill {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  overflow: visible;
}

.animate-params-col--options .option-pill > span.option-pill__face {
  width: 100%;
  box-sizing: border-box;
  height: 2.1rem;
  min-height: 2.1rem;
  padding: 0 0.35rem;
  font-size: 0.8rem;
  line-height: 1.15;
  border-radius: 0.55rem;
  flex-wrap: nowrap;
  gap: 0;
  justify-content: center;
  align-items: center;
}

.animate-params-col--options .option-pill__label {
  font: inherit;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}

/* Доп. стоимость в углу кнопки: тёмный фон, квадратная рамка (как раньше по смыслу) */
.animate-params-col--options .option-pill__extra {
  position: absolute;
  top: -7px;
  right: -8px;
  z-index: 2;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.32rem;
  line-height: 1.1;
  border-radius: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(8, 10, 16, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.animate-params__scenario.form__row--scenario {
  margin-top: 0;
  margin-bottom: 0;
}

.animate-params-col--scenario {
  min-width: 0;
}

/* В узкой колонке сетки строка «текст | кнопка» ломала текст; нужна колонка: заголовок → кнопка */
.animate-params-col--scenario .scenario-selected {
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.animate-params-col--scenario .scenario-selected > div:first-child {
  flex: 0 1 auto;
  width: 100%;
  min-width: 0;
}

.animate-params-col--scenario .scenario-selected__title {
  line-height: 1.35;
}

.animate-params-col--scenario .scenario-selected__actions {
  align-self: stretch;
  width: 100%;
}

.animate-params-col--scenario .scenario-selected__actions .button {
  width: 100%;
}

.animate-params__subrow.form__row--options {
  margin-top: 0;
}

@media (max-width: 720px) {
  .animate-params-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.option-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.admin-editor-btn {
  min-width: 2.2rem;
  padding: 0.45rem 0.58rem;
  font-size: 0.9rem;
}

.admin-editor-btn.is-active {
  border-color: rgba(240, 107, 133, 0.58);
  background: linear-gradient(135deg, rgba(240,107,133,0.2), rgba(217,181,106,0.12));
  box-shadow: 0 0 0 3px rgba(240, 107, 133, 0.09);
}

.admin-history__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.admin-history__main {
  min-width: 0;
}

.admin-history__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.admin-history__icon-btn {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-history__delete-form {
  margin: 0;
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 25, 0.7);
  backdrop-filter: blur(2px);
}

.admin-modal__dialog {
  position: relative;
  width: min(760px, 94vw);
  max-height: 92vh;
  overflow: auto;
  margin: 4vh auto;
  z-index: 1;
}

.option-pill {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.option-pill input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.option-pill > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  box-sizing: border-box;
  min-height: 2.65rem;
  padding: 0.45rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.option-pill:hover > span {
  border-color: rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.25);
}

.option-pill input:checked + span {
  border-color: rgba(240, 107, 133, 0.48);
  background: linear-gradient(135deg, rgba(240,107,133,0.14), rgba(217,181,106,0.08));
}

/* Старый инлайн-вариант «+50» (если где-то остался); на «Оживить» — бейдж в .animate-params-col--options */
.option-pill__extra {
  font-size: 0.8em;
  font-weight: 500;
  color: var(--muted);
}

.form__cost-hint {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.form__actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

.result-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
  justify-content: center;
  width: 100%;
}

.result-actions .button,
.result-actions > .button,
.result-actions > a.button {
  min-height: 44px;
  flex: 1 1 220px;
  max-width: 320px;
  margin: 0 !important;
  text-align: center;
}

.complaint-modal-label {
  margin-top: 0.75rem;
}

.complaint-modal-actions {
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(135deg, rgba(240,107,133,0.18), rgba(217,79,121,0.16));
  color: rgba(255,255,255,0.94);
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

.button--secondary {
  background: rgba(255,255,255,0.06);
}

.button[hidden] {
  display: none !important;
}

.button.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.95;
}

.button.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: rgba(255,255,255,0.95);
  animation: button-spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes button-spin {
  to { transform: rotate(360deg); }
}

.button--primary {
  padding: 1rem 1.75rem;
  font-size: 1.05rem;
  background: linear-gradient(135deg, rgba(240,107,133,0.3), rgba(217,181,106,0.2));
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 20px rgba(240, 107, 133, 0.2);
  animation: button-glow 2.5s ease-in-out infinite;
}

.button--primary:hover {
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 6px 28px rgba(240, 107, 133, 0.3);
  transform: translateY(-2px);
}

@keyframes button-glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(240, 107, 133, 0.18); }
  50% { box-shadow: 0 4px 24px rgba(217, 181, 106, 0.24); }
}

.muted { color: var(--muted); }

.status {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: 0.9rem;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-weight: 800;
  border-radius: 0.7rem;
  font-size: 0.86rem;
  border: 1px solid rgba(255,255,255,0.16);
}

.badge--ok { color: var(--ok); }
.badge--wait { color: var(--wait); }
.badge--danger { color: var(--danger); }

.video {
  margin: 0.9rem 0 0.25rem;
}

video {
  width: 100%;
  max-height: 520px;
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
}

.placeholder {
  border-radius: 1rem;
  border: 1px dashed rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.18);
  padding: 1rem;
}

.placeholder__title {
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.placeholder__text {
  color: var(--muted);
  line-height: 1.55;
}

/* Блок результата — тот же размер, что и блок фото (3:4), выравнивание по верху с фото */
.result-media {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.2);
  overflow: hidden;
  margin-top: 0;
}

.result-media__inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.result-media__inner video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  display: block;
}

.result-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}

.result-placeholder__text {
  color: var(--muted);
  font-size: 0.95rem;
}

.result-spinner {
  display: none;
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: result-spinner 0.9s linear infinite;
}

.result-spinner.is-visible {
  display: block;
}

@keyframes result-spinner {
  to { transform: rotate(360deg); }
}

.status--compact {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.progress-status {
  display: grid;
  gap: 0.55rem;
}

.progress-status__text {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.35;
  text-align: center;
  margin-bottom: 0.45rem;
}

.progress-status__lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
}

.progress-status__line {
  height: 0.52rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.progress-status__line.is-active {
  background: rgba(251, 191, 36, 0.95);
}

.progress-status__line.is-done {
  background: rgba(52, 211, 153, 0.95);
}

.progress-status__line.is-error {
  background: rgba(251, 113, 133, 0.95);
}

.result-status-text {
  display: block;
  margin-top: 0.35rem;
  max-width: 100%;
  max-height: 4.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.35;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2.1rem;
}

@media (max-width: 1180px) {
  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

.home-card {
  border-radius: 0.8rem;
  border: 1px solid rgba(255,255,255,0.14);
  padding: 1.25rem 1.35rem;
  min-height: 154px;
  background: rgba(0,0,0,0.24);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  cursor: pointer;
}

.home-card--with-icon {
  gap: 0.9rem;
  justify-content: flex-start;
  text-align: left;
}

.home-card__icon {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-card__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.home-card__icon--animate {
  width: 5.2rem;
  height: 5.2rem;
}

.home-card:hover {
  border-color: rgba(240, 107, 133, 0.34);
  background: rgba(22, 10, 16, 0.74);
  transform: translateY(-1px);
}

.home-card__label {
  font-weight: 700;
  font-size: 1.2rem;
}

.scenario-selected {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.6rem;
  padding: 0.75rem 0.85rem;
  border-radius: 1rem;
  border: 1px solid rgba(240, 107, 133, 0.24);
  background: linear-gradient(135deg, rgba(240,107,133,0.1), rgba(217,181,106,0.05));
  min-width: 0;
}

.scenario-selected > div:first-child {
  min-width: 0;
  flex: 1;
}

.scenario-selected__title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.scenario-selected__meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

.scenario-selected__actions {
  flex-shrink: 0;
}

.scenario-selected__preview video {
  width: 100%;
  max-height: 220px;
  border-radius: 0.9rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.modal-backdrop--open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: min(1120px, calc(100% - 2rem));
  max-height: 90vh;
  background: rgba(15,23,42,0.98);
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 30px 80px rgba(0,0,0,0.65);
  display: flex;
  flex-direction: column;
}

.modal__header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  font-weight: 700;
}

.modal__close {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.modal__body {
  padding: 0.85rem 1rem 1rem;
  overflow: auto;
}

.modal-group {
  margin-bottom: 1.25rem;
  padding: 1rem 1rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.25);
}

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

.modal-group__title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.6rem;
  background: linear-gradient(135deg, rgba(240,107,133,0.15), rgba(217,181,106,0.08));
  border: 1px solid rgba(255,255,255,0.12);
  display: inline-block;
}

.modal .scenarios {
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.modal .scenario {
  max-width: none;
}

@media (max-width: 900px) {
  .modal .scenarios {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .modal .scenarios {
    grid-template-columns: 1fr;
  }
}

.layout-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  max-width: 960px;
  margin: 0 auto;
}

.layout-two__left,
.layout-two__right {
  align-self: start;
  display: flex;
  flex-direction: column;
}

.layout-two__left .card,
.layout-two__right .card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.side-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.layout-two__right .side-title {
  margin-bottom: 0.5rem;
  min-height: 2.25rem;
  display: flex;
  align-items: center;
}

.side-list {
  margin: 0.6rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 880px) {
  .layout-two {
    grid-template-columns: minmax(0, 1fr);
  }
}

.balance-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 1rem;
  align-items: start;
}

.balance-methods {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.balance-method {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 0.95rem;
  padding: 0.58rem 0.95rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  backdrop-filter: blur(6px);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.1px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.28);
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.2s ease, background 0.2s ease;
}

.balance-method:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 10px 26px rgba(0,0,0,0.36);
}

.balance-method.is-active {
  border-color: rgba(240, 107, 133, 0.52);
  background: linear-gradient(135deg, rgba(240,107,133,0.2), rgba(217,181,106,0.12));
  box-shadow:
    0 8px 24px rgba(240, 107, 133, 0.14),
    0 0 0 3px rgba(240, 107, 133, 0.08);
}

.balance-panel__title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.balance-panel__hint {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.amount-btn {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 1rem;
  padding: 0.72rem 0.88rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.11), rgba(255,255,255,0.04)),
    rgba(0,0,0,0.18);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  transition:
    transform 0.18s ease,
    box-shadow 0.22s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.amount-btn span {
  color: var(--ok);
  font-weight: 800;
}

.amount-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.34);
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}

.amount-btn.is-active {
  border-color: rgba(240, 107, 133, 0.5);
  background:
    linear-gradient(135deg, rgba(240,107,133,0.18), rgba(217,181,106,0.12)),
    rgba(0,0,0,0.22);
  box-shadow:
    0 10px 28px rgba(240, 107, 133, 0.12),
    0 0 0 3px rgba(240, 107, 133, 0.08);
}

.amount-btn:active,
.balance-method:active {
  transform: translateY(0);
}

.amount-btn--manual {
  grid-column: 1 / -1;
}

.manual-amount {
  margin-top: 0.9rem;
}

.balance-summary {
  margin-top: 0.9rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0.9rem;
  background: rgba(0,0,0,0.16);
  padding: 0.8rem;
  display: grid;
  gap: 0.45rem;
}

.balance-summary[hidden] {
  display: none !important;
}

.balance-summary__line {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
}

.balance-summary__line strong {
  color: var(--text);
}

.balance-bonus-card {
  display: grid;
  gap: 0.7rem;
}

.balance-bonus-text {
  text-align: left;
}

.bonus-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bonus-pill {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  background: rgba(0,0,0,0.2);
  font-weight: 700;
  color: var(--ok);
}

@media (max-width: 940px) {
  .balance-layout {
    grid-template-columns: 1fr;
  }
}

.earn-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.earn-subtitle {
  text-align: left;
}

.earn-ref-link__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.earn-stats {
  display: grid;
  gap: 0.45rem;
}

.earn-stats__item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0.8rem;
  background: rgba(0,0,0,0.18);
  padding: 0.6rem 0.75rem;
}

.earn-stats__item span {
  color: var(--muted);
}

.earn-payouts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.docs-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.complaint-review-hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.complaint-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  line-height: 1.4;
}

.complaint-consent-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

@media (max-width: 940px) {
  /* Документ скроллится на body (iOS/Android), без вложенного scroll-container на .app/.content */
  html {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-x: none;
  }

  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-x: none;
    position: relative;
    width: 100%;
    max-width: 100%;
  }

  .app {
    display: block;
    min-height: 100%;
    height: auto;
    width: 100%;
    max-width: 100%;
    /* clip не даёт fixed-детям обойти обрезку так же, как hidden+scroll; см. ниже .sidebar */
    overflow-x: clip;
    overflow-y: visible;
    overscroll-behavior: auto;
  }

  /* clip — без отдельного scroll-container (в отличие от overflow-x: hidden), не ломает вертикальный скролл body */
  .layout-two {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  .hero {
    max-width: 100%;
  }

  .hero .title {
    overflow-wrap: anywhere;
  }

  .photo-row__head {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .generation-history {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  /* Без transform: у translateX WebKit часто раздувает горизонтальный scroll у fixed-панелей */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    width: min(86vw, 320px);
    max-width: 320px;
    height: 100dvh;
    z-index: 210;
    left: calc(-1 * min(86vw, 320px));
    transform: none;
    transition: left 0.2s ease;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 16px 0 36px rgba(0, 0, 0, 0.48);
    background: #0b0d12;
    border-right: 1px solid var(--border);
    backdrop-filter: none;
  }

  .app.app--nav-open .sidebar {
    left: 0;
  }

  .app__drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 205;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
  }

  .header {
    height: 56px;
    padding: 0.4rem 0.75rem;
    gap: 0.55rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
    justify-content: flex-start;
  }

  .header__menu-btn {
    display: inline-flex;
    flex-shrink: 0;
  }

  /* Иначе два flex:1 (заголовок и spacer) делят середину и ломают ellipsis */
  .header__spacer {
    display: none;
  }

  .header__section-title {
    font-size: 1rem;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header__right {
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: 0;
  }

  .header__bonus {
    display: inline-flex;
    padding: 0.32rem 0.38rem;
    gap: 0;
  }

  .header__bonus-label {
    display: none;
  }

  .profile__trigger {
    padding: 0.32rem 0.5rem;
    max-width: none;
  }

  .profile__meta {
    display: flex;
    min-width: 0;
    max-width: min(42vw, 200px);
  }

  .main {
    padding: 1rem 0.85rem 1.45rem;
    min-width: 0;
    overflow-x: clip;
    overflow-y: visible;
  }

  .content {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    overflow-y: visible;
  }

  .main--home {
    padding-top: 1.2rem;
  }

  .footer__inner {
    padding: 0.8rem 0.85rem;
  }
}

@media (max-width: 640px) {
  .header__section-title {
    font-size: 0.96rem;
  }

  .site-notifications__menu {
    right: 0;
    left: auto;
    width: min(92vw, 360px);
  }

  .card {
    padding: 0.9rem;
    border-radius: 0.95rem;
  }

  .layout-two {
    gap: 0.85rem;
    min-width: 0;
  }

  .layout-two__left,
  .layout-two__right {
    min-width: 0;
  }

  .layout-two__right .side-title {
    min-height: 0;
  }

  .photo-row__head {
    min-width: 0;
  }

  .edit-mode-tabs {
    width: 100%;
    max-width: 100%;
    justify-content: space-between;
    min-width: 0;
  }

  .edit-mode-tab {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .subtitle {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .generation-history {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .form__actions .button {
    width: 100%;
  }

  .modal {
    width: calc(100% - 1rem);
    max-height: 92dvh;
    border-radius: 0.85rem;
  }

  .modal__header {
    padding: 0.72rem 0.8rem;
  }

  .modal__body {
    padding: 0.72rem 0.8rem 0.85rem;
  }

  .result-actions .button,
  .result-actions > .button {
    width: 100%;
  }

  .result-actions > a.button {
    margin-left: 0 !important;
  }

  .complaint-modal-actions .button {
    width: 100%;
  }

  .generation-history__list {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .generation-history__item {
    margin-bottom: 0.45rem;
  }

  button.generation-history__link {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.7rem;
    background: rgba(0, 0, 0, 0.16);
    padding: 0.5rem 0.55rem;
    gap: 0.25rem 0.45rem;
  }

  .amount-grid {
    grid-template-columns: 1fr;
  }

  .balance-method {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
    text-align: center;
  }

  .main .card .auth-form .button,
  .main .card > .button {
    width: 100%;
  }

  .site-notifications__title-meta {
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: min(92vw, 320px);
  }

  .brand {
    font-size: 1.55rem;
    gap: 0.45rem;
  }

  .brand__image {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    max-width: 40px;
    min-height: 40px;
    max-height: 40px;
  }

  .header {
    padding: 0.35rem 0.6rem;
  }

  .header__right {
    gap: 0.38rem;
  }

  .site-notifications__trigger {
    width: 1.8rem;
    height: 1.8rem;
  }

  .profile__trigger {
    padding: 0.3rem 0.42rem;
  }

  .profile__avatar,
  .profile__avatar-wrap,
  .profile__avatar-wrap .profile__avatar {
    width: 24px;
    height: 24px;
  }

  .main {
    padding: 0.85rem 0.65rem 1.25rem;
  }

  .hero {
    margin: 0.25rem 0 0.9rem;
  }

  .home-grid {
    gap: 0.72rem;
  }

  .home-card {
    min-height: 124px;
    padding: 0.95rem 1rem;
    border-radius: 0.72rem;
  }

  .home-card--with-icon {
    gap: 0.7rem;
  }

  .home-card__icon {
    width: 1.9rem;
    height: 1.9rem;
  }

  .home-card__icon--animate {
    width: 3.1rem;
    height: 3.1rem;
  }

  .balance-methods {
    gap: 0.42rem;
  }

  .balance-method {
    flex: 1 1 100%;
    padding: 0.52rem 0.7rem;
    font-size: 0.92rem;
  }

  .amount-btn {
    padding: 0.62rem 0.75rem;
    font-size: 0.95rem;
  }

  .earn-ref-link__row {
    grid-template-columns: 1fr;
  }

  .earn-ref-link__row .button {
    width: 100%;
  }

  .auth-page {
    padding: 0.85rem 0.7rem 1.3rem;
  }

  .auth-shell {
    border-radius: 1rem;
    padding: 0.95rem 0.85rem 1rem;
  }

  .auth-topbar {
    margin-bottom: 0.7rem;
  }

  .auth-lang-switcher__btn {
    min-width: 44px;
    padding: 0.3rem 0.55rem;
    font-size: 0.9rem;
  }

  .footer__docs {
    gap: 0.5rem;
  }

  .footer__docs-sep {
    display: none;
  }

  .auth-hint .button {
    margin-left: 0 !important;
    margin-top: 0.55rem;
  }
}

@media (max-width: 360px) {
  .header__section-title {
    font-size: 0.9rem;
  }

  .lang-switcher__menu {
    right: 0;
    min-width: 160px;
  }

  .site-notifications__menu {
    right: 0;
    width: min(94vw, 340px);
  }

  .button {
    padding: 0.65rem 0.8rem;
    font-size: 0.92rem;
  }

  .button--primary {
    padding: 0.82rem 1rem;
    font-size: 0.98rem;
  }

  .title {
    font-size: 1.35rem;
  }
}

