:root {
  color-scheme: dark;
  --bg: #101114;
  --surface: #17191f;
  --surface-2: #20232b;
  --surface-3: #292d36;
  --text: #f6f3ed;
  --muted: #a9a49a;
  --line: rgba(255, 255, 255, 0.11);
  --accent: #f5c84b;
  --accent-2: #86e6c0;
  --danger: #ff7a90;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 10% -10%, rgba(134, 230, 192, 0.12), transparent 28rem),
    radial-gradient(circle at 90% 0%, rgba(245, 200, 75, 0.1), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Noto Sans",
    "Helvetica Neue",
    Arial,
    sans-serif;
}

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

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 14px 16px 104px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 14px;
  background: linear-gradient(180deg, rgba(16, 17, 20, 0.96), rgba(16, 17, 20, 0.78), transparent);
  backdrop-filter: blur(14px);
}

.brand,
.profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.brand__mark,
.profile-pill span,
.profile-avatar {
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 950;
}

.brand__mark {
  width: 42px;
  height: 42px;
  background: var(--accent);
  color: #17120a;
}

.brand strong,
.profile-pill strong {
  display: block;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.profile-pill {
  min-height: 42px;
  padding: 5px 11px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
}

.profile-pill span {
  width: 32px;
  height: 32px;
  background: var(--surface-3);
  color: var(--accent-2);
  font-size: 12px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  min-height: 250px;
  margin-top: 8px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.62)),
    url("https://images.unsplash.com/photo-1519608487953-e999c86e7455?auto=format&fit=crop&w=1600&q=84") center / cover;
  box-shadow: var(--shadow);
}

.kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-panel h1,
.section-head--stack h1 {
  max-width: 760px;
  font-size: clamp(34px, 8vw, 72px);
  line-height: 0.96;
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  margin: 16px 0 26px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.search span {
  color: var(--accent);
  font-size: 28px;
}

.search input,
.field input,
.field select,
.select-label select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  outline: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.search input {
  border: 0;
  background: transparent;
  font-size: 16px;
}

option {
  background: #1b1d24;
}

.section-head,
.feed-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 12px;
}

.section-head h2,
.feed-toolbar h2 {
  font-size: 24px;
  line-height: 1.1;
}

.section-head--stack {
  display: block;
  max-width: 780px;
  margin-top: 24px;
}

.section-head--stack p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.55;
}

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

.model-card,
.theme-card,
.editor-card,
.repeat-card,
.profile-card,
.publish-card,
.creator-card,
.plans__grid article {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: var(--shadow);
}

.model-card,
.theme-card {
  min-width: 0;
  text-align: left;
}

.model-card {
  position: relative;
  min-height: 152px;
  overflow: hidden;
  padding: 16px;
  color: var(--text);
}

.model-card::after {
  position: absolute;
  right: -36px;
  bottom: -46px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--model-accent) 32%, transparent);
  content: "";
}

.model-card.is-active {
  border-color: color-mix(in srgb, var(--model-accent) 68%, white 10%);
}

.model-card span,
.model-card small,
.model-card em {
  display: block;
  position: relative;
  z-index: 1;
}

.model-card span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 850;
}

.model-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin: 14px 0 8px;
  font-size: 24px;
}

.model-card small {
  min-height: 36px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.model-card em {
  margin-top: 12px;
  color: var(--accent);
  font-style: normal;
  font-weight: 900;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.theme-card {
  min-height: 88px;
  padding: 14px;
  color: var(--text);
}

.theme-card.is-active {
  border-color: rgba(245, 200, 75, 0.64);
  background: rgba(245, 200, 75, 0.12);
}

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

.theme-card strong {
  margin-bottom: 6px;
  font-size: 16px;
}

.theme-card span,
.select-label span,
.hint {
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 900;
}

.select-label {
  display: grid;
  min-width: 190px;
  gap: 6px;
}

.select-label select,
.field select,
.field input {
  min-height: 44px;
  border-radius: 12px;
  padding: 0 12px;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.prompt-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
}

.prompt-card__media {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0;
  background: var(--surface-2);
  padding: 0;
}

.prompt-card--1 .prompt-card__media {
  aspect-ratio: 1 / 1.05;
}

.prompt-card--2 .prompt-card__media {
  aspect-ratio: 4 / 4.8;
}

.prompt-card__media img,
.repeat-card img,
.creator-card img,
.prompt-modal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prompt-card__body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.prompt-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prompt-card__meta span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(134, 230, 192, 0.11);
  color: #c7ffe9;
  font-size: 11px;
  font-weight: 850;
}

.prompt-card h3 {
  font-size: 20px;
}

.prompt-card p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 60px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.prompt-card__footer,
.auth-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.auth-grid--profile {
  grid-template-columns: 1fr;
}

.creator-link,
.repeat,
.primary,
.ghost {
  min-height: 42px;
  border-radius: 13px;
  font-weight: 900;
}

.creator-link,
.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.creator-link {
  overflow: hidden;
  padding: 0 10px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repeat,
.primary {
  border: 0;
  background: var(--accent);
  color: #18130a;
}

.primary--wide {
  width: 100%;
}

.creator-layout,
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 16px;
  margin-top: 18px;
}

.editor-card,
.repeat-card,
.profile-card,
.publish-card {
  padding: 16px;
}

.field,
.control-group {
  display: grid;
  gap: 9px;
}

.field span,
.control-group > span {
  font-weight: 850;
}

.field input,
.field select,
textarea {
  border-radius: 14px;
}

textarea {
  min-height: 142px;
  resize: vertical;
  padding: 13px;
  line-height: 1.5;
}

#promptInput {
  min-height: 426px;
  -webkit-user-select: text;
  user-select: text;
  ime-mode: auto;
}

#publishPromptInput {
  min-height: 200px;
  -webkit-user-select: text;
  user-select: text;
  ime-mode: auto;
}

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

.editor-card > .field {
  margin-bottom: 14px;
}

.prompt-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 6px 0 2px;
}

.segments {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.segments button {
  min-height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.segments button.is-active {
  border-color: rgba(245, 200, 75, 0.72);
  background: rgba(245, 200, 75, 0.14);
  color: #ffe49a;
}

.repeat-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.repeat-card img {
  min-height: 260px;
  border-radius: 18px;
  background: var(--surface-2);
}

.repeat-card img:not([src]) {
  display: none;
}

.repeat-card p {
  color: var(--muted);
  line-height: 1.45;
}

.creator-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.creator-card {
  overflow: hidden;
}

.creator-card.is-focused {
  border-color: rgba(245, 200, 75, 0.72);
}

.creator-card div {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.creator-card span,
.creator-card p {
  color: var(--muted);
  font-size: 13px;
}

.creator-mosaic {
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 11;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-rows: 1fr 1fr;
  overflow: hidden;
  border: 0;
  background: var(--surface-2);
  padding: 0;
}

.creator-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.creator-mosaic img:first-child {
  grid-row: span 2;
}

.creator-profile {
  margin-top: 18px;
}

.creator-profile__hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 14px 0 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: var(--shadow);
}

.creator-profile__hero h1 {
  font-size: clamp(34px, 7vw, 68px);
  line-height: 0.95;
}

.creator-profile__hero p {
  max-width: 620px;
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.profile-avatar--large {
  width: 92px;
  height: 92px;
  font-size: 24px;
}

.telegram-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(134, 230, 192, 0.4);
  border-radius: 999px;
  color: #c7ffe9;
  font-weight: 900;
  text-decoration: none;
}

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

.profile-avatar {
  width: 64px;
  height: 64px;
  background: var(--surface-3);
  color: var(--accent-2);
}

.profile-card p {
  color: var(--muted);
}

.publish-card h2 {
  margin-bottom: 14px;
}

.publish-card form {
  display: grid;
  gap: 14px;
}

.registration-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.my-showcase {
  margin-top: 26px;
}

.plans__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.plans__grid article {
  padding: 18px;
}

.plans__grid span,
.plans__grid strong,
.plans__grid p {
  display: block;
}

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

.plans__grid strong {
  margin: 10px 0 4px;
  font-size: 38px;
}

.plans__grid p {
  color: var(--accent-2);
  font-weight: 900;
}

.app-footer {
  width: min(640px, calc(100% - 24px));
  margin: 0 auto;
  padding: 8px 18px calc(88px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.app-footer a {
  color: var(--accent-2);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

.app-footer__sep {
  margin: 0 6px;
  opacity: 0.5;
}

.bottom-nav {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(640px, calc(100% - 24px));
  margin: 0 auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(25, 27, 33, 0.86);
  backdrop-filter: blur(20px);
}

.bottom-nav button {
  min-height: 48px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.bottom-nav button.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.legal-gate {
  width: min(520px, calc(100% - 28px));
  max-height: min(92vh, 720px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.legal-gate::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.legal-gate__panel {
  padding: 22px 20px 24px;
}

.legal-gate__intro {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.legal-gate__retry {
  margin: 0 0 16px;
  width: 100%;
}

.legal-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
}

.legal-check input {
  margin-top: 4px;
  flex-shrink: 0;
}

.legal-check a {
  color: var(--accent-2);
}

.legal-gate__error {
  margin: 8px 0 12px;
  color: #ff7a7a;
}

.prompt-modal {
  width: min(860px, calc(100% - 24px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  box-shadow: var(--shadow);
}

.prompt-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.prompt-modal__content {
  position: relative;
  margin: 0;
}

.modal-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
}

.prompt-modal img {
  display: block;
  min-height: 480px;
}

.modal-body {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 22px;
}

.modal-body span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 850;
}

.modal-body h3 {
  font-size: 30px;
}

.modal-body p {
  color: #d8d3c9;
  line-height: 1.55;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 24px;
}

.empty {
  grid-column: 1 / -1;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 940px) {
  .hero-panel,
  .creator-layout,
  .profile-layout,
  .creator-profile__hero,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .model-row,
  .feed-grid,
  .creator-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .prompt-modal img {
    min-height: 300px;
    max-height: 52vh;
  }
}

@media (max-width: 620px) {
  .app {
    padding: 10px 10px 98px;
  }

  .topbar {
    padding-top: 6px;
  }

  .profile-pill strong {
    display: none;
  }

  .hero-panel {
    min-height: 320px;
    align-items: end;
    padding: 18px;
    border-radius: 24px;
  }

  .hero-panel h1,
  .section-head--stack h1 {
    font-size: 38px;
  }

  .section-head,
  .feed-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .select-label {
    min-width: 0;
  }

  .model-row,
  .theme-grid,
  .feed-grid,
  .creator-grid,
  .plans__grid,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .theme-grid {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .theme-grid::-webkit-scrollbar {
    display: none;
  }

  .theme-card {
    flex: 0 0 154px;
  }

  .prompt-card__media,
  .prompt-card--1 .prompt-card__media,
  .prompt-card--2 .prompt-card__media {
    aspect-ratio: 4 / 3.3;
  }

  .bottom-nav {
    border-radius: 20px;
  }

  .bottom-nav button {
    min-height: 44px;
    border-radius: 15px;
    font-size: 12px;
  }

  .modal-body {
    padding: 16px;
  }
}
