:root {
  --bg: #f6f1ea;
  --ink: #191714;
  --muted: #6d665e;
  --line: #ded4c7;
  --panel: #fffdf8;
  --rail: #14120f;
  --rail-muted: #bfb6a9;
  --accent: #cf4b2b;
  --accent-2: #146c5b;
  --warn: #a95f00;
  --bad: #b42318;
  --ok: #147447;
  --shadow: 0 18px 48px rgba(32, 24, 16, 0.09);
  --h5-width: 488px;
  --h5-safe-x: 14px;
  --h5-safe-top: 16px;
  --space-1: 4px;
  --space-2: 6px;
  --space-3: 8px;
  --space-4: 10px;
  --space-5: 12px;
  --space-6: 14px;
  --space-7: 16px;
  --radius-1: 10px;
  --radius-2: 12px;
  --radius-3: 14px;
  --poster-gap: 8px;
  --poster-radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

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

button, select {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(207, 75, 43, 0.32);
  outline-offset: 2px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--rail);
  color: #fff;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.logo {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.logo span {
  color: #f4a38d;
}

.rail nav {
  display: grid;
  gap: 8px;
}

.nav {
  border: 0;
  text-align: left;
  text-decoration: none;
  color: var(--rail-muted);
  background: transparent;
  border-radius: 8px;
  padding: 11px 12px;
}

.nav.active,
.nav:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.admin-link {
  margin-top: auto;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}

.workspace {
  padding: 30px;
}

.hero {
  min-height: 190px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 24px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 900;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  font-size: 48px;
  line-height: 1.02;
  margin-bottom: 12px;
}

h2 {
  margin-bottom: 6px;
}

.sub,
.muted,
.section-head p {
  color: var(--muted);
}

.account,
.surface,
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.account {
  min-width: 190px;
  padding: 18px;
  display: grid;
  gap: 6px;
}

.account strong {
  font-size: 42px;
}

.account button,
.surface button,
.primary {
  border: 0;
  border-radius: 8px;
  padding: 10px 13px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.primary {
  background: var(--accent);
  width: 100%;
}

.promo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.promo-strip button {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 16px;
  text-align: left;
  font-weight: 900;
}

.promo-strip span {
  display: block;
  color: var(--accent);
  margin-top: 4px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.88fr) minmax(420px, 1.12fr);
  gap: 20px;
  margin-bottom: 20px;
}

.layout.lower {
  grid-template-columns: 1.15fr 0.85fr;
}

.surface {
  padding: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.segmented button,
.option {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.segmented button.active,
.option.selected {
  background: var(--ink);
  color: #fff;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 900;
  margin-bottom: 14px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

details {
  margin: 14px 0;
}

summary {
  cursor: pointer;
  font-weight: 900;
}

.message {
  min-height: 22px;
  color: var(--muted);
  margin: 12px 0 0;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.template-card {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  text-align: left;
  display: grid;
  align-content: space-between;
}

.template-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eee5da;
  color: var(--ink);
  font-size: 13px;
}

.badge.ok { background: #e6f3ed; color: var(--ok); }
.badge.warn { background: #fff2dc; color: var(--warn); }
.badge.bad { background: #fde8e6; color: var(--bad); }

.rows {
  display: grid;
  gap: 10px;
}

.row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.row strong {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric {
  padding: 16px;
}

.metric strong {
  display: block;
  font-size: 30px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 14px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

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

  .rail {
    position: static;
    height: auto;
  }

  .hero,
  .section-head {
    display: grid;
  }

  .layout,
  .layout.lower,
  .promo-strip,
  .metric-grid,
  .template-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 36px;
  }
}

/* User product shell: matches the narrow dark app surface used by AI_MEDIA. */
.user-app {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 28%, rgba(92, 29, 42, 0.26), transparent 30%),
    radial-gradient(circle at 10% 20%, rgba(50, 34, 96, 0.18), transparent 32%),
    #050507;
  color: #f7f2f6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: block;
}

.icon-rail {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 64px;
  height: 100vh;
  padding: 20px 10px;
  background: rgba(8, 8, 12, 0.94);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: grid;
  grid-template-rows: auto repeat(4, 48px) 1fr repeat(4, 40px);
  gap: 8px;
  justify-items: center;
}

.mini-logo {
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 16px;
}

.mini-logo span,
.phone-head h1 span {
  color: #ff5eae;
}

.icon-rail button,
.icon-rail a {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #777384;
  text-decoration: none;
  font-size: 20px;
}

.icon-rail button.active,
.icon-rail button:hover,
.icon-rail a:hover {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 73, 155, 0.28), rgba(143, 84, 255, 0.2));
  box-shadow: inset 3px 0 0 #ff4fa1;
}

.rail-spacer {
  width: 1px;
}

.stage {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 0;
}

.phone {
  width: min(var(--h5-width), calc(100vw - 92px));
  min-height: 100vh;
  padding: var(--h5-safe-top) var(--h5-safe-x) 28px;
  background: rgba(13, 12, 18, 0.92);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transform: translateX(-36px);
}

.phone-head {
  height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
}

.phone-head h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.head-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  min-width: 112px;
  justify-content: flex-end;
}

.login,
.menu,
.offer-strip button,
.drawer-head button {
  border: 0;
  border-radius: var(--radius-2);
  background: #181720;
  color: #f8d7e7;
  padding: 9px 12px;
  font-weight: 800;
  font-size: 12px;
}

.menu {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  color: #fff;
  background: linear-gradient(135deg, #ff7a18, #ff2e9a);
}

.offer-carousel {
  margin-bottom: var(--space-6);
}

.quick-tools {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 2px 0 14px;
}

.quick-tool {
  min-width: 0;
  border: 0;
  border-radius: 18px;
  padding: 8px 2px 7px;
  color: rgba(255, 255, 255, 0.66);
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.05;
  transition: transform 180ms ease, color 180ms ease;
}

.quick-tool span {
  width: min(54px, 12.2vw);
  height: min(54px, 12.2vw);
  min-width: 44px;
  min-height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #f7eef8;
  font-size: 20px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.quick-tool strong {
  min-height: 22px;
  display: grid;
  place-items: center;
  overflow-wrap: anywhere;
}

.quick-tool:hover,
.quick-tool:focus-visible,
.quick-tool.active {
  color: #fff;
  transform: translateY(-1px);
}

.quick-tool.active span {
  border-color: rgba(255, 110, 192, 0.36);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(145deg, rgba(255, 78, 166, 0.82), rgba(126, 84, 255, 0.76));
  box-shadow: 0 12px 28px rgba(255, 64, 164, 0.16);
}

.offer-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.offer-track::-webkit-scrollbar {
  display: none;
}

.offer-card {
  min-height: 96px;
  padding: 16px;
  margin-bottom: var(--space-6);
  border-radius: var(--radius-2);
  overflow: hidden;
  display: grid;
  align-content: end;
  justify-items: start;
  background:
    linear-gradient(90deg, rgba(15, 9, 19, 0.92), rgba(39, 15, 38, 0.62)),
    radial-gradient(circle at 75% 20%, rgba(255, 109, 172, 0.65), transparent 34%),
    #15101a;
  border: 1px solid rgba(5, 5, 8, 0.74);
  color: #fff;
  text-align: left;
  scroll-snap-align: start;
}

.offer-card strong,
.offer-card span,
.offer-card small {
  display: block;
}

.offer-card span {
  width: fit-content;
  margin-bottom: 4px;
  border-radius: 999px;
  padding: 2px 8px;
  color: #ff87c8;
  background: rgba(255, 255, 255, 0.09);
  font-size: 10px;
  font-weight: 900;
}

.offer-card strong {
  font-size: 17px;
}

.offer-card small {
  color: #c8bfca;
  margin-top: var(--space-2);
  max-width: 260px;
  font-size: 12px;
}

.offer-card em {
  position: absolute;
  right: 14px;
  bottom: 14px;
  border-radius: 999px;
  padding: 9px 13px;
  color: #fff;
  background: #ec5fc0;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.offer-card {
  position: relative;
}

.offer-1 {
  background:
    linear-gradient(90deg, rgba(12, 12, 18, 0.84), rgba(33, 35, 48, 0.44)),
    radial-gradient(circle at 78% 42%, rgba(150, 204, 255, 0.26), transparent 34%),
    #181820;
}

.offer-2 {
  background:
    linear-gradient(90deg, rgba(15, 9, 19, 0.92), rgba(39, 15, 38, 0.62)),
    radial-gradient(circle at 76% 22%, rgba(255, 109, 172, 0.65), transparent 34%),
    #15101a;
}

.offer-3 {
  background:
    linear-gradient(90deg, rgba(20, 13, 22, 0.9), rgba(45, 27, 19, 0.64)),
    radial-gradient(circle at 78% 35%, rgba(255, 168, 84, 0.4), transparent 34%),
    #191218;
}

.offer-dots {
  height: 9px;
  margin: -7px 0 var(--space-5);
  display: flex;
  justify-content: center;
  gap: 5px;
}

.offer-dots span {
  width: 5px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.offer-dots span.active {
  width: 18px;
  color: #fff;
  background: #ec5fc0;
}

.guest .auth-panel {
  display: none;
}

.guest .dev-field {
  display: none;
}

.auth-only {
  display: none;
}

.authed .auth-only {
  display: initial;
}

.authed .guest-only {
  display: none !important;
}

#generatorView[hidden],
.profile-view[hidden],
.recharge-view[hidden],
.settings-view[hidden],
.template-wall[hidden] {
  display: none;
}

.checkin-pill,
.recharge-pill {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0 10px;
  color: #fff;
  background: #191821;
  font-size: 12px;
  font-weight: 900;
}

.checkin-pill {
  color: #ffb85b;
}

.recharge-pill {
  background: linear-gradient(135deg, #2a1b11, #17151b);
  color: #ffd170;
}

.checkin-card {
  margin: 0 0 12px;
  padding: 12px;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 130, 38, 0.14), rgba(255, 56, 154, 0.11)), #15141c;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.authed .checkin-card.auth-only {
  display: grid;
}

.checkin-card strong,
.checkin-card small {
  display: block;
}

.checkin-card strong {
  font-size: 12px;
}

.checkin-card small {
  margin-top: 4px;
  color: #9d95a5;
  font-size: 10px;
}

.checkin-progress {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8c22 46%, rgba(255, 255, 255, 0.12) 46%);
}

.checkin-card button {
  border: 0;
  border-radius: 999px;
  padding: 8px 11px;
  color: #fff;
  background: linear-gradient(135deg, #ff7b1f, #ff3f91);
  font-size: 11px;
  font-weight: 900;
}

.checkin-card .dismiss-checkin {
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #bfb6c6;
}

.profile-view {
  min-height: calc(100vh - 108px);
  padding: 12px 12px 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  text-align: center;
}

.profile-view h2 {
  display: none;
}

.profile-orb {
  width: 112px;
  height: 112px;
  margin: 6px 0 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 42px;
  background:
    radial-gradient(circle, rgba(255, 120, 65, 0.24), transparent 61%),
    radial-gradient(circle at 72% 34%, rgba(255, 60, 162, 0.72), transparent 36%),
    #19131a;
  border: 1px solid rgba(255, 119, 70, 0.7);
  box-shadow: 0 0 0 11px rgba(255, 79, 144, 0.08), 0 0 38px rgba(255, 88, 45, 0.36);
}

.profile-view h3 {
  margin: 0;
  font-size: 25px;
  line-height: 1.12;
  letter-spacing: 0;
}

.profile-view p {
  margin: 10px 0 24px;
  color: #9e98a5;
  font-size: 12px;
}

.profile-capabilities {
  width: 100%;
  padding: 11px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  border-radius: 16px 16px 0 0;
  background: rgba(15, 14, 21, 0.94);
  border: 1px solid rgba(5, 5, 8, 0.74);
  border-bottom: 0;
}

.profile-capabilities button {
  min-height: 70px;
  border: 0;
  border-radius: 11px;
  display: grid;
  place-items: center;
  gap: 8px;
  color: #d9d4de;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 800;
}

.profile-capabilities span {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #ff8b4f;
  background: rgba(255, 139, 79, 0.12);
}

.profile-credit {
  width: 100%;
  min-height: 42px;
  padding: 0 13px 13px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  border-radius: 0 0 16px 16px;
  color: #dcd6df;
  background: rgba(15, 14, 21, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 0;
  text-align: left;
}

.profile-credit span {
  color: #ff9c4c;
}

.profile-credit strong {
  font-size: 12px;
}

.profile-credit em {
  color: #d9d2dd;
  font-size: 11px;
  font-style: normal;
}

.profile-start {
  width: 100%;
  min-height: 54px;
  margin: 24px 0 9px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #ff7a1f, #ff2f8e);
  box-shadow: 0 10px 24px rgba(255, 78, 62, 0.34);
  font-size: 15px;
  font-weight: 950;
}

.profile-view > small {
  color: #807889;
  font-size: 11px;
}

.profile-proof {
  width: 100%;
  min-height: 58px;
  margin-top: 34px;
  padding: 12px 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: #fff;
  background: rgba(15, 14, 21, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.profile-proof > span {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #58f1aa;
  background: rgba(44, 217, 139, 0.13);
}

.profile-proof strong,
.profile-proof small {
  display: block;
}

.profile-proof strong {
  font-size: 12px;
}

.profile-proof small {
  margin-top: 3px;
  color: #8f8796;
  font-size: 10px;
}

.profile-creations {
  width: 100%;
  margin-top: 18px;
  padding-bottom: 12px;
  text-align: left;
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.profile-section-head strong {
  font-size: 15px;
}

.profile-section-head small {
  color: #8f8796;
  font-size: 11px;
}

.profile-job-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.profile-job {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  min-width: 0;
  border-radius: 12px;
  background: rgba(15, 14, 21, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: inherit;
  text-decoration: none;
  text-align: left;
  font: inherit;
}

.profile-job-media {
  position: relative;
  aspect-ratio: 0.74;
  background: var(--job-image), #111018;
  background-size: cover;
  background-position: center top;
}

.profile-job-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.58));
}

.profile-job-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.48);
  font-size: 9px;
  font-weight: 900;
}

.profile-job-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.48);
  font-size: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.profile-job-media em {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

.profile-job.completed .profile-job-media em,
.profile-job.failed .profile-job-media em {
  display: none;
}

.profile-job-copy {
  padding: 8px;
}

.profile-job-copy strong,
.profile-job-copy small,
.profile-job-copy a,
.profile-job-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-job.processing .profile-job-copy strong,
.profile-job.queued .profile-job-copy strong {
  color: rgba(255, 255, 255, 0.86);
}

.profile-job-copy strong {
  color: #fff;
  font-size: 12px;
}

.profile-job-copy small {
  margin-top: 3px;
  color: #9b93a2;
  font-size: 10px;
}

.profile-job-copy a,
.profile-job-copy span {
  margin-top: 7px;
  color: #ff9b47;
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

.profile-job.failed .profile-job-copy a,
.profile-job.failed .profile-job-copy span {
  color: #ff6f7d;
}

.profile-empty {
  grid-column: 1 / -1;
  min-height: 72px;
  padding: 16px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #8f8796;
  background: rgba(15, 14, 21, 0.82);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 12px;
  text-align: center;
}

.recharge-view {
  min-height: calc(100vh - 40px);
  padding-bottom: 34px;
  color: #fff;
}

.recharge-head {
  height: 42px;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  margin-bottom: 14px;
}

.recharge-head h2 {
  margin: 0;
  text-align: center;
  font-size: 17px;
}

.recharge-head button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  font-size: 22px;
}

.balance-card {
  min-height: 92px;
  margin-bottom: 14px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 7px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 82% 24%, rgba(255, 179, 66, 0.32), transparent 30%),
    linear-gradient(135deg, rgba(255, 128, 29, 0.22), rgba(255, 63, 164, 0.14)),
    #15141c;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.balance-card > span {
  color: #9d95a5;
  font-size: 11px;
  font-weight: 900;
}

.balance-card strong {
  font-size: 30px;
}

.recharge-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 14px;
  background: #181720;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.recharge-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  color: #8d8794;
  background: transparent;
  font-weight: 900;
}

.recharge-tabs button.active {
  color: #ffac4d;
  background: #24222b;
}

.recharge-panel {
  display: none;
}

.recharge-panel.active {
  display: block;
}

.billing-switch {
  width: 100%;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.billing-switch button,
.payment-methods button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #d9d1dd;
  background: #14131b;
  font-size: 12px;
  font-weight: 900;
}

.billing-switch button.active,
.payment-methods button.active {
  color: #ffac4d;
  border-color: rgba(255, 155, 66, 0.44);
  background: rgba(255, 139, 31, 0.1);
}

.billing-switch span {
  color: #ff5fa8;
}

.vip-card {
  padding: 14px;
  border-radius: 16px;
  background: #14131b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vip-badge {
  margin: -4px -4px 12px;
  padding: 9px 10px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #ff8d1f, #ff3e98);
  text-align: center;
  font-size: 11px;
  font-weight: 950;
}

.vip-card h3 {
  margin: 0 0 6px;
  color: #ffd173;
  font-size: 19px;
}

.vip-card > strong {
  display: block;
  font-size: 32px;
}

.vip-card > strong span,
.vip-card p,
.vip-card > small {
  color: #9b93a2;
  font-size: 12px;
}

.vip-compare {
  margin: 14px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.vip-compare span,
.vip-compare small,
.vip-compare b {
  min-height: 34px;
  padding: 9px 10px;
  background: #0f0e15;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.vip-compare span {
  color: #ffad4f;
  font-size: 12px;
  font-weight: 900;
}

.vip-compare small {
  color: #a69dac;
}

.vip-compare b {
  color: #fff;
  font-size: 12px;
}

.vip-card > button,
.diamond-card button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #ff8d1f, #ff6a17);
  font-weight: 950;
}

.payment-methods {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.payment-methods strong {
  color: #9d95a5;
  font-size: 11px;
}

.payment-methods small {
  display: block;
  color: #827a89;
  font-size: 10px;
}

.diamond-grid {
  display: grid;
  gap: 10px;
}

.diamond-card {
  position: relative;
  padding: 14px;
  border-radius: 15px;
  background: #14131b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.diamond-card em {
  position: absolute;
  top: 12px;
  right: 12px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  background: #ff4d9b;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
}

.diamond-card small,
.diamond-card span,
.diamond-card p {
  display: block;
  color: #9b93a2;
  font-size: 12px;
}

.diamond-card strong {
  display: block;
  margin: 5px 0;
  font-size: 18px;
}

.diamond-card b {
  display: block;
  margin: 8px 0 2px;
  color: #ffd073;
  font-size: 28px;
}

.checkout-note {
  margin: 12px 0 0;
  color: #817987;
  text-align: center;
  font-size: 11px;
}

.settings-view {
  min-height: calc(100vh - 40px);
  padding: 4px 0 32px;
  color: #fff;
}

.settings-head {
  height: 42px;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.settings-head button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  font-size: 24px;
}

.settings-head h2 {
  display: none;
}

.settings-view h3 {
  margin: 0 0 26px;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
}

.settings-group {
  margin-bottom: 22px;
}

.settings-group > span {
  display: block;
  margin: 0 0 10px 12px;
  color: #8b8492;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.settings-group button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0 14px;
  display: grid;
  grid-template-columns: 26px 1fr auto 18px;
  align-items: center;
  gap: 10px;
  color: #fff;
  background: #14131a;
  text-align: left;
}

.settings-group button:first-of-type {
  border-radius: 14px 14px 0 0;
}

.settings-group button:last-of-type {
  border-bottom: 0;
  border-radius: 0 0 14px 14px;
}

.settings-group b {
  color: #b8b0be;
  font-weight: 700;
  text-align: center;
}

.settings-group strong {
  font-size: 14px;
  font-weight: 650;
}

.settings-group small {
  color: #8e8794;
  font-size: 13px;
}

.settings-group em {
  color: #7d7584;
  font-style: normal;
  font-size: 24px;
}

.settings-logout {
  width: 100%;
  min-height: 50px;
  margin: 4px 0 22px;
  border: 0;
  border-radius: 14px;
  color: #ff6d6d;
  background: #14131a;
  font-weight: 900;
}

.settings-view > p {
  margin: 0;
  color: #6f6874;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
}

.menu-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.menu-sheet[aria-hidden="true"],
.language-sheet[aria-hidden="true"],
.video-sheet[aria-hidden="true"] {
  display: none !important;
}

.menu-sheet.open {
  opacity: 1;
  visibility: visible;
}

.menu-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: auto;
  transition: opacity 180ms ease;
}

.menu-sheet.open .menu-backdrop {
  opacity: 1;
}

.language-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.language-sheet.open {
  display: flex;
}

.language-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(5px);
  pointer-events: auto;
}

.language-panel {
  position: relative;
  width: min(520px, calc(100vw - 24px));
  max-height: min(78vh, 720px);
  padding: 12px 14px 18px;
  border-radius: 22px 22px 0 0;
  color: #fff;
  background: #171720;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -18px 80px rgba(0, 0, 0, 0.54);
  overflow-y: auto;
  pointer-events: auto;
}

.language-panel h2 {
  margin: 8px 0 14px;
  text-align: center;
  font-size: 18px;
}

.language-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.language-grid button {
  min-height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 0 8px;
  color: #fff;
  background: #20202a;
  direction: ltr;
  text-align: left;
  overflow: hidden;
}

.language-grid button.selected {
  border-color: rgba(255, 78, 161, 0.8);
  background: linear-gradient(135deg, rgba(255, 64, 153, 0.24), rgba(126, 88, 255, 0.13)), #211924;
}

.language-flag {
  grid-column: 1;
  font-size: 18px;
}

.language-copy {
  grid-column: 2;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.language-copy strong,
.language-copy small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.language-copy strong {
  font-size: 13px;
}

.language-copy small {
  color: #9b93a2;
  font-size: 11px;
}

.language-grid em {
  grid-column: 3;
  color: #ff6caf;
  font-style: normal;
  font-weight: 900;
  justify-self: end;
}

html[dir="rtl"] .language-grid button,
html[dir="rtl"] .settings-group button,
html[dir="rtl"] .menu-row,
html[dir="rtl"] .menu-account {
  direction: ltr;
}

html[dir="rtl"] .settings-view,
html[dir="rtl"] .recharge-view,
html[dir="rtl"] .profile-view {
  direction: rtl;
}

.menu-panel {
  position: relative;
  width: min(342px, calc(100vw - 56px));
  height: 100dvh;
  margin: 0;
  padding: 18px 16px 22px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 26%),
    #111018;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -28px 0 80px rgba(0, 0, 0, 0.54);
  overflow-y: auto;
  transform: translateX(104%);
  transition: transform 220ms cubic-bezier(.22, .61, .36, 1);
  pointer-events: auto;
}

.menu-sheet.open .menu-panel {
  transform: translateX(0);
}

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.menu-head h2 {
  margin: 0;
  font-size: 17px;
}

.menu-head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  font-size: 21px;
}

.menu-login {
  width: 100%;
  min-height: 43px;
  margin-bottom: 18px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #ff8b21, #ff591c);
  font-weight: 950;
}

.menu-account {
  min-height: 58px;
  margin-bottom: 18px;
  padding: 10px;
  grid-template-columns: 34px 1fr 30px 30px;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.authed .menu-account.auth-only {
  display: grid;
}

.menu-account > span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #ff7a1f, #ff2f8e);
}

.menu-account strong,
.menu-account small {
  display: block;
}

.menu-account strong {
  font-size: 12px;
}

.menu-account small {
  margin-top: 3px;
  max-width: 130px;
  overflow: hidden;
  color: #9b93a2;
  text-overflow: ellipsis;
}

.menu-account button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.menu-row {
  width: 100%;
  min-height: 58px;
  margin-bottom: 6px;
  border: 0;
  border-radius: 12px;
  padding: 10px 9px;
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
  color: #fff;
  background: transparent;
  text-align: left;
  text-decoration: none;
  transition: background 140ms ease, transform 140ms ease;
}

.menu-row:hover {
  background: rgba(255, 255, 255, 0.055);
}

.menu-row:active {
  transform: scale(0.992);
}

.menu-row span {
  grid-row: 1 / span 2;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #ec7fb5;
  background: rgba(236, 127, 181, 0.09);
}

.menu-row:nth-of-type(3) span {
  color: #f2a24d;
  background: rgba(242, 162, 77, 0.1);
}

.menu-row:nth-of-type(4) span {
  color: #8c91ff;
  background: rgba(140, 145, 255, 0.1);
}

.menu-row:nth-of-type(5) span {
  color: #6de29c;
  background: rgba(109, 226, 156, 0.1);
}

.menu-row strong {
  font-size: 13px;
}

.menu-row small {
  color: #7e7785;
  font-size: 10px;
}

.menu-social {
  position: sticky;
  left: auto;
  right: auto;
  bottom: 0;
  margin-top: max(28px, 18vh);
  padding: 14px 0 4px;
  display: flex;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(180deg, transparent, #111018 22%);
}

.menu-social a {
  color: #8d8594;
  font-size: 12px;
  text-decoration: none;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: var(--space-1);
  margin-bottom: var(--space-6);
  background: #181720;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-3);
}

.tabs button {
  border: 0;
  border-radius: var(--radius-1);
  color: #898391;
  background: transparent;
  padding: 12px;
  font-weight: 900;
}

.tabs button.active {
  color: #ff9b47;
  background: #24222b;
}

.tabs small {
  color: #ff6fc1;
  margin-left: 6px;
  font-size: 9px;
}

.custom-card {
  width: 100%;
  min-height: 62px;
  margin-bottom: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-3);
  background: linear-gradient(135deg, #1a1922, #15141c);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  font-weight: 900;
}

.swap-mode .custom-card {
  display: flex;
}

.custom-icon {
  font-size: 28px;
  color: #f4edff;
}

.template-wall {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--poster-gap);
  align-items: start;
}

.poster {
  aspect-ratio: 0.76;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--poster-radius);
  overflow: hidden;
  padding: var(--space-5);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.72)),
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.3), transparent 14%),
    var(--poster);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
  text-align: left;
}

.poster::before {
  content: "";
  position: absolute;
  inset: 16% 24% 24%;
  border-radius: 999px 999px 35% 35%;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(1px);
}

.poster span,
.poster strong {
  position: relative;
  z-index: 1;
}

.video-mode .poster {
  min-height: 0;
}

.video-mode .poster::before {
  inset: 14% 18% 22%;
  border-radius: 48% 48% 18% 18%;
}

.poster span {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.38);
  color: #ffd6e7;
  font-size: 11px;
  text-transform: uppercase;
}

.poster strong {
  font-size: 16px;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.poster.selected {
  border-color: #ff5ead;
  box-shadow: 0 0 0 2px rgba(255, 94, 173, 0.22), 0 14px 28px rgba(0, 0, 0, 0.3);
}

.poster::before {
  content: none;
}

.video-mode .poster::before {
  content: none;
}

.poster {
  isolation: isolate;
  padding: 0;
  display: block;
  border-color: rgba(5, 5, 8, 0.74);
  background-color: #050508;
  background:
    var(--image),
    var(--poster),
    #050508;
  background-position: center top;
  background-size: cover;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  animation: cardIn 360ms ease both;
  animation-delay: calc(min(var(--card-index, 0), 8) * 34ms);
}

.template-wall.no-card-animation .poster {
  animation: none;
}

.poster:hover,
.poster:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 94, 173, 0.58);
}

.poster::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  z-index: 2;
  pointer-events: none;
  border-radius: 0 0 var(--poster-radius) var(--poster-radius);
  background: linear-gradient(180deg, rgba(5, 5, 8, 0), rgba(5, 5, 8, 0.42) 44%, rgba(5, 5, 8, 0.86));
}

.poster-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.poster-video.ready {
  opacity: 1;
}

.poster-media {
  display: none !important;
}

.poster-media::before,
.poster-media::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.poster-media::before {
  inset: 8% 8% 24%;
  border-radius: 16px;
  background: linear-gradient(110deg, transparent 0 34%, rgba(255, 255, 255, 0.2) 42%, transparent 50% 100%);
  opacity: 0.18;
  transform: rotate(var(--tilt));
  animation: templateDrift 7s ease-in-out infinite;
  animation-delay: var(--delay);
}

.poster-media::after {
  left: 10%;
  right: 10%;
  bottom: 22%;
  height: 28%;
  border-radius: 999px 999px 20px 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone-c, #fff) 42%, transparent), transparent);
  filter: blur(8px);
  opacity: 0.22;
}

.poster-person {
  position: absolute;
  left: 50%;
  top: 16%;
  width: 40%;
  height: 58%;
  border-radius: 999px 999px 28px 28px;
  background:
    radial-gradient(circle at 50% 12%, color-mix(in srgb, var(--tone-c, #fff) 82%, #fff 18%) 0 18%, transparent 19%),
    linear-gradient(180deg, color-mix(in srgb, var(--tone-c, #fff) 72%, transparent), color-mix(in srgb, var(--tone-b, #888) 62%, transparent));
  transform: translateX(-50%);
  opacity: 0;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

.poster-frame {
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.12) 50%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(255, 255, 255, 0.1) 50%, transparent 52%);
  opacity: 0.42;
}

.has-provider-media .poster-frame {
  opacity: 0.18;
}

.poster-shine {
  position: absolute;
  inset: -42% -70%;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.24) 50%, transparent 58%);
  transform: translateX(-30%);
  animation: shineSweep 4.8s ease-in-out infinite;
  animation-delay: var(--delay);
}

.has-provider-media .poster-shine {
  opacity: 0.55;
}

.motion-poster .poster-frame::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 10%;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 18px color-mix(in srgb, var(--tone-c, #fff) 70%, transparent);
  animation: scanLine 2.6s ease-in-out infinite;
}

.image-poster .poster-person {
  animation: portraitPulse 5.4s ease-in-out infinite;
  animation-delay: var(--delay);
}

.poster-badge,
.poster strong,
.poster small {
  z-index: 3;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.68);
}

.poster .poster-badge,
.poster-badge {
  display: none !important;
}

.poster strong {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 7px;
  margin: 0;
  font-size: clamp(13px, 1.9vw, 16px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.poster small {
  display: none !important;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  line-height: 1.15;
}

.poster small i {
  width: fit-content;
  font-style: normal;
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.38);
}

.poster small em {
  font-style: normal;
  opacity: 0.82;
  overflow-wrap: anywhere;
}

@keyframes templateDrift {
  0%, 100% { transform: rotate(var(--tilt)) translate3d(0, 0, 0) scale(1); }
  50% { transform: rotate(calc(var(--tilt) * -0.6)) translate3d(3px, -5px, 0) scale(1.035); }
}

@keyframes shineSweep {
  0%, 38% { transform: translateX(-38%); opacity: 0; }
  48% { opacity: 1; }
  72%, 100% { transform: translateX(38%); opacity: 0; }
}

@keyframes scanLine {
  0%, 100% { transform: translateY(0); opacity: 0.24; }
  50% { transform: translateY(128px); opacity: 0.82; }
}

@keyframes portraitPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.035); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.template-status {
  width: 100%;
  margin: var(--space-4) 0 0;
  padding: 13px 8px;
  color: #d5cbd6;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
  background: transparent;
}

.template-status.done {
  color: rgba(255, 255, 255, 0.45);
}

.compose-panel {
  display: none;
  margin-top: var(--space-5);
  padding: var(--space-6);
  border-radius: var(--radius-3);
  background: #121119;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.upload-box {
  min-height: 128px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: #0d0c13;
  color: #efeaf2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.upload-box span {
  font-size: 26px;
  color: #ff72bb;
}

.upload-box small {
  color: #8f8797;
}

.upload-box.filled {
  border-style: solid;
  border-color: rgba(255, 93, 173, 0.48);
  background: linear-gradient(135deg, rgba(255, 93, 173, 0.12), rgba(126, 88, 255, 0.12));
}

.upload-box.loading,
.upload-box:disabled {
  cursor: progress;
  opacity: 0.82;
}

.upload-box.loading::after,
.upload-float.loading::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

.upload-box.loading::after {
  position: absolute;
  right: 10px;
  top: 10px;
}

.upload-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 1;
}

.upload-box strong,
.upload-box small,
.upload-box span {
  position: relative;
  z-index: 1;
}

.upload-box.filled strong,
.upload-box.filled small,
.upload-box.filled span {
  display: none;
}

.source-url-field {
  display: none !important;
}

.compose-panel.open {
  display: block;
}

.video-only {
  display: none;
}

.video-mode .video-only {
  display: flex;
}

.custom-prompt-mode .compose-panel {
  margin-top: 0;
  border-color: rgba(255, 255, 255, 0.07);
  background: transparent;
  padding: 0;
}

.custom-prompt-mode .compose-head {
  display: none;
}

.prompt-tools {
  justify-content: flex-end;
  margin-bottom: 8px;
}

.prompt-tools button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 8px 12px;
  color: #f4ecf6;
  background: #191821;
  font-size: 12px;
  font-weight: 900;
}

.compose-head,
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.compose-panel label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  color: #dcd5df;
  font-size: 12px;
  font-weight: 800;
}

.dev-field {
  display: none;
}

.compose-panel input,
.compose-panel select,
.compose-panel textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  padding: 11px;
  background: #0b0a10;
  color: #fff;
}

.compose-panel textarea {
  min-height: 86px;
  resize: vertical;
}

.custom-prompt-mode .compose-panel textarea {
  min-height: 142px;
  background: #111018;
}

.custom-prompt-mode .upload-grid {
  gap: 10px;
  margin: 12px 0 14px;
}

.custom-prompt-mode .upload-box {
  min-height: 164px;
  border-color: rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.07), transparent 34%),
    #111018;
}

.custom-prompt-mode .upload-box:nth-child(2) {
  border-color: rgba(207, 151, 67, 0.56);
  background: #16120f;
}

.compose-label {
  margin: 0 0 7px;
  color: #dcd5df;
  font-size: 12px;
  font-weight: 800;
}

.video-options {
  display: none;
  margin: 0 0 12px;
}

.video-options.open {
  display: block;
}

.duration-row.inline {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 10px;
}

.video-options details {
  margin: 8px 0 2px;
  border-radius: 12px;
  background: #0d0c13;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 11px;
}

.video-options summary {
  color: #dcd5df;
  font-size: 12px;
  font-weight: 900;
}

.advanced-grid {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.ratio-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ratio {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #cfc6d3;
  background: #111018;
  font-size: 12px;
  font-weight: 900;
}

.ratio.selected {
  color: #ffae4e;
  border-color: rgba(255, 156, 64, 0.5);
  background: rgba(255, 143, 45, 0.09);
}

.vip-toggle {
  min-height: 42px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 11px;
  background: #111018;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.vip-toggle span {
  color: #e8e0eb;
  font-size: 12px;
  font-weight: 900;
}

.vip-toggle em {
  margin-left: 5px;
  color: #ff5bac;
  font-size: 9px;
  font-style: normal;
}

.vip-toggle button {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: #d2a354;
  background: #211910;
  font-size: 11px;
  font-weight: 900;
}

.generate {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px;
  background: linear-gradient(135deg, #ff6b37, #ff39a4);
  color: #fff;
  font-weight: 900;
}

.message,
.empty {
  color: #afa6b4;
  font-size: 12px;
}

.history-drawer {
  margin-top: var(--space-6);
  padding: var(--space-6);
  border-radius: var(--radius-3);
  background: rgba(18, 17, 25, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.paywall {
  margin-top: var(--space-6);
  min-height: 74px;
  padding: var(--space-6);
  border-radius: var(--radius-3);
  background:
    linear-gradient(100deg, rgba(255, 105, 54, 0.18), rgba(255, 54, 155, 0.18)),
    #15131d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.paywall strong,
.paywall span {
  display: block;
}

.paywall span {
  margin-top: 4px;
  color: #bcb2c3;
  font-size: 12px;
}

.paywall button {
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  color: #fff;
  background: linear-gradient(135deg, #ff7a32, #ff3fa8);
  font-weight: 900;
  white-space: nowrap;
}

.mini-actions {
  margin-top: var(--space-5);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.mini-actions button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-2);
  background: #14131b;
  color: #d7cfdd;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 800;
}

.job-line {
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.job-line strong,
.job-line span {
  display: block;
}

.video-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.video-sheet.open {
  display: flex;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  pointer-events: auto;
}

.sheet-panel {
  position: relative;
  width: min(var(--h5-width), calc(100vw - 92px));
  max-height: 86vh;
  margin: 0 auto;
  padding: 10px 12px 14px;
  border-radius: 20px 20px 0 0;
  background: #171720;
  color: #fff;
  box-shadow: 0 -20px 80px rgba(0, 0, 0, 0.55);
  transform: translateX(-36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}

.sheet-grip {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 auto 14px;
}

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

.sheet-head h2 {
  margin: 0;
  min-width: 0;
  font-size: 18px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.sheet-head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
}

.sheet-preview {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 0.76;
  max-height: min(520px, 58vh);
  border-radius: 14px;
  margin-bottom: 10px;
  display: grid;
  place-items: end center;
  padding: 14px;
  background:
    linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.42)),
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.28), transparent 14%),
    var(--poster, linear-gradient(145deg, #5f382e, #f0c5aa));
  background-size: cover;
  background-position: center top;
  isolation: isolate;
}

.sheet-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 0;
}

.sheet-source {
  position: relative;
  z-index: 1;
  justify-self: start;
  align-self: start;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
  display: block;
}

.sheet-source img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center top;
}

.upload-float {
  position: relative;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  font-weight: 900;
}

.upload-float:disabled {
  cursor: progress;
  opacity: 0.78;
}

.upload-float.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.duration-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 72px;
  gap: 6px;
  margin-bottom: 10px;
}

.duration {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #ffb453;
  background: #111018;
  font-weight: 800;
  font-size: 12px;
}

.duration.selected {
  border-color: rgba(255, 141, 26, 0.72);
  color: #fff;
  background: rgba(255, 141, 26, 0.14);
}

.duration.locked {
  color: #c39751;
  background: #1c1714;
}

.sheet-message {
  min-height: 18px;
  margin: 0 0 8px;
  color: #d8cfdd;
  font-size: 12px;
  text-align: center;
}

.sheet-generate {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #ff8d1a, #ff6a17);
  font-size: 16px;
  font-weight: 900;
}

.sheet-generate:disabled,
.generate:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.result-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  background: #000;
  color: #fff;
}

.completion-notice {
  position: fixed;
  left: 50%;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 90;
  width: min(420px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(18, 17, 25, 0.94);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.completion-notice.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.completion-notice strong,
.completion-notice small {
  display: block;
}

.completion-notice strong {
  font-size: 14px;
}

.completion-notice small {
  margin-top: 3px;
  color: #afa6b4;
  font-size: 12px;
}

.completion-notice button {
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  color: #fff;
  background: linear-gradient(135deg, #ff6b37, #ff39a4);
  font-size: 12px;
  font-weight: 900;
}

.result-viewer.open {
  display: block;
}

.result-title {
  position: absolute;
  top: 22px;
  left: 18px;
  z-index: 2;
  max-width: calc(100vw - 96px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.result-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 24px;
}

.result-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.result-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.result-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  font-size: 26px;
  backdrop-filter: blur(12px);
}

.result-actions {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.result-actions button,
.result-actions a {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  backdrop-filter: blur(12px);
}

.result-actions button {
  background: linear-gradient(135deg, #ff8d1a, #ff5c8a);
}

.result-viewer.controls-hidden .result-actions,
.result-viewer.controls-hidden .result-title,
.result-viewer.controls-hidden .result-close {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

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

.modal {
  width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 0;
  color: #fff;
  background: #15131d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(5px);
}

.modal form {
  position: relative;
  padding: 22px;
}

.modal h2 {
  margin: 8px 0;
  font-size: 22px;
}

.modal p {
  color: #bcb2c3;
  margin-bottom: 16px;
}

.modal-list {
  margin: 0 0 16px;
  padding-left: 18px;
  color: #c7bdcc;
  font-size: 13px;
}

.rows.dark .row {
  border-color: rgba(255, 255, 255, 0.08);
  background: #0f0e15;
  color: #fff;
}

.rows.dark .row span {
  display: block;
  margin-top: 4px;
  color: #aaa1b1;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.auth-button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px;
  margin-top: 10px;
  color: #fff;
  background: linear-gradient(135deg, #ff6f37, #ff3fa8);
  font-weight: 900;
}

.auth-button.secondary {
  background: #22202b;
}

.modal-preview {
  height: 230px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.62)),
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.3), transparent 14%),
    var(--poster, linear-gradient(145deg, #5f382e, #f0c5aa));
  margin-bottom: 14px;
}

.job-line span {
  color: #afa6b4;
  font-size: 12px;
  margin-top: 3px;
}

.bottom-nav {
  display: none;
}

@media (max-width: 720px) {
  :root {
    --h5-width: 100vw;
    --h5-safe-x: 10px;
    --h5-safe-top: 12px;
    --poster-gap: 6px;
    --poster-radius: 11px;
  }

  .user-app {
    grid-template-columns: 1fr;
  }

  .icon-rail {
    display: none;
  }

  .stage {
    padding: 0;
  }

  .phone {
    width: var(--h5-width);
    min-height: 100vh;
    padding-bottom: 82px;
    border: 0;
    transform: none;
  }

  .sheet-panel {
    width: 100vw;
    max-height: calc(100dvh - 8px);
    padding: 8px 10px calc(14px + env(safe-area-inset-bottom));
    transform: none;
  }

  .sheet-preview {
    max-height: min(520px, 58dvh);
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: 62px;
    padding: 7px 10px 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    background: rgba(12, 12, 18, 0.94);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
  }

  .bottom-nav button {
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #7f7a88;
    display: grid;
    place-items: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 800;
  }

  .bottom-nav button span {
    font-size: 17px;
  }

  .bottom-nav button.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
  }
}

@media (min-width: 721px) {
  .video-mode .auth-panel {
    display: none;
  }

  .video-sheet.open {
    align-items: center;
    justify-content: center;
  }

  .sheet-panel {
    width: min(760px, calc(100vw - 128px));
    max-height: min(720px, calc(100vh - 64px));
    padding: 14px;
    border-radius: 20px;
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(240px, 1fr);
    grid-template-areas:
      "grip grip"
      "preview head"
      "preview durations"
      "preview message"
      "preview generate";
    gap: 10px 14px;
    transform: none;
    box-shadow: 0 24px 96px rgba(0, 0, 0, 0.62);
  }

  .sheet-grip {
    grid-area: grip;
    margin-bottom: 2px;
  }

  .sheet-head {
    grid-area: head;
    margin-bottom: 0;
  }

  .duration-row {
    grid-area: durations;
    grid-template-columns: 1fr 1fr;
    align-self: start;
    margin-bottom: 0;
  }

  .sheet-preview {
    grid-area: preview;
    margin-bottom: 0;
    max-height: min(560px, calc(100vh - 128px));
  }

  .sheet-message {
    grid-area: message;
    align-self: end;
  }

  .sheet-generate {
    grid-area: generate;
    align-self: end;
  }

  .recharge-view {
    padding-bottom: 42px;
  }
}

@media (max-width: 420px) {
  :root {
    --h5-safe-x: 10px;
    --space-5: 10px;
    --space-6: 12px;
  }

  .phone {
    padding: var(--h5-safe-top) var(--h5-safe-x) 22px;
  }

.login {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .poster {
    min-height: 0;
  }

  .phone-head h1 {
    font-size: 17px;
  }

  .tabs button {
    padding: 11px 8px;
    font-size: 13px;
  }

  .poster strong {
    font-size: 14px;
  }

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

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

  .paywall {
    align-items: stretch;
    flex-direction: column;
  }

  .mini-actions {
    grid-template-columns: 1fr;
  }
}

.poster-video {
  opacity: 0;
}

.poster-video.ready {
  opacity: 1;
}

.template-status {
  min-height: 42px;
}

.offer-dots {
  display: none !important;
}
