@import "https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap";

*,
*::before,
*::after {
    padding: 0;
    margin: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

:focus, :active {
    outline: none;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(90, 90, 90, 0.3) transparent;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #000;
}

body {
    color: #fff;
    background-color: #000;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
textarea,
select,
button {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

h1, h2, h3, h4, h5, h6 {
    font: inherit;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
}

:root {
    --dvh: 100vh;
    --color-bg: #000;
    --color-surface: rgba(255, 255, 255, 0.05);
    --color-surface-strong: rgba(255, 255, 255, 0.1);
    --color-surface-accent: rgba(255, 255, 255, 0.15);
    --color-border: rgba(255, 255, 255, 0.1);
    --color-muted: rgba(255, 255, 255, 0.6);
    --color-subtle: rgba(255, 255, 255, 0.3);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --shadow-soft: 0 16px 30px rgba(0, 0, 0, 0.35);
}

.nowrap {
    white-space: nowrap;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.scrollbar-hidden {
    scrollbar-width: none;
}
.scrollbar-hidden::-webkit-scrollbar {
    display: none;
}

html, body, #app-content {
    height: var(--dvh);
    width: 100vw;
    overflow: hidden;
}
body {
    background-color: var(--color-bg);
}

#app-content {
    background: radial-gradient(1200px 600px at 12% 8%, rgba(139, 92, 246, .22), transparent 55%), radial-gradient(900px 500px at 88% 20%, rgba(34, 211, 238, .18), transparent 60%), radial-gradient(1000px 700px at 70% 92%, rgba(244, 114, 182, .14), transparent 60%), linear-gradient(180deg, #070812, #0b0d1a);
    background-size: cover;
    background-attachment: fixed;
}
#app-page {
    height: var(--dvh);
    min-height: 100%;
    overflow-y: auto;
    overscroll-behavior: none;
    scrollbar-width: none;
}
#app-page::-webkit-scrollbar {
    display:none;
}

.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

.content {
    min-height: calc(var(--dvh) + 1px);
    touch-action: pan-y;
    padding-top: calc(15px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
    padding-bottom: calc(15px + var(--tg-safe-area-inset-bottom, 0px) / 2);
}

.content-main {
    display: flex;
    flex-direction: column;
}
.content-main .main {
    margin-bottom: 230px;
}

#app-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
}

/* Loader */

.loading__wrap,
.loading__ring {
    width: 50px;
    height: 50px;
}
@keyframes rotate{
    to {transform:rotate(360deg);}
}
.loading__ring {
    position: absolute;
    opacity: 0.75;
}
.loading__ring:first-child {
    transform: skew(30deg, 20deg);
}
.loading__ring:last-child {
    transform: skew(-30deg, -20deg) scale(-1,1);
}
.loading__ring:last-child svg {
    animation-delay: -0.5s;
}
.loading__ring svg {
    animation: rotate 1s linear infinite;
    fill: rgba(0,0,0, 0.7);
}

/* Header */

.header {
    padding: 0 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.header__brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: radial-gradient(18px 18px at 30% 25%, rgba(255, 255, 255, 0.35), transparent 60%),
    linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(34, 211, 238, 0.85) 45%, rgba(244, 114, 182, 0.8));
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
}
.header__title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-block {
    padding: 24px 0 12px;
    display: flex;
    justify-content: space-between;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    transition: color 0.2s ease;
}
.icon-button:hover {
    color: #fff;
}
.icon-button__icon {
    width: 24px;
    height: 24px;
}

.counter-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background-color: var(--color-surface);
    transition: background-color 0.2s ease;
}
.counter-button:hover {
    background-color: var(--color-surface-strong);
}
.counter-button__icon {
    width: 16px;
    height: 16px;
}
.counter-button__value {
    font-weight: 600;
}

.tabs {
    display: flex;
    justify-content: center;
}
.tabs__list {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: var(--radius-sm);
    background-color: var(--color-surface);
}
.tabs__button {
    display: inline-flex;
    align-items: center;
    flex-direction: column;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.tabs__button:hover {
    color: #fff;
    background-color: var(--color-surface-strong);
}
.tabs__button.is-active {
    color: #000;
    background-color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.tabs__icon {
    width: 20px;
    height: 20px;
    font-size: 12px;
}

.button-gradient {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background: linear-gradient(90deg, #a855f7, #6366f1);
    color: #000;
    font-weight: 700;
    transition: filter 0.2s ease;
}
.button-gradient:hover {
    filter: brightness(1.1);
}

#notification {
    display: none;
    position: fixed;
    top: calc(30px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    z-index: 1001;
    pointer-events: none;
}
.notification__wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 75%;
    margin: 0 auto;
}
.notification__cont {
    color: #000;
    font-size: 13px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 4px 20px 0 rgba(0,0,0,0.2);
    padding: 8px 20px;
    border-radius: 20px;
    transition: opacity 0.15s;
}
.notification__cont.success {
    background-color: rgb(var(--green-color));
}
.notification__cont.error {
    background-color: #ff6f6f;
}
.notification__cont.warning {
    background-color: #f1c233;
}

.main {
    flex: 1;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
}

.empty-state__wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.empty-state__icon {
    margin-bottom: 10px;
}
.empty-state__svg {
    width: 48px;
    height: 48px;
    color: rgba(255, 255, 255, 0.2);
}
.empty-state__text {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}
.empty-state__hint {
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
}

.loader-state__img {
    width: 64px;
    height: 64px;
    opacity: 0.4;
}

.fade-overlay {
    position: fixed;
    inset: auto 0 0 0;
    height: 16rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8) 40%, #1c224f 100%);
    pointer-events: none;
    z-index: 40;
    opacity: 0.5;
}

.composer {
    position: fixed;
    inset: auto 0 0 0;
    padding: 0 15px 15px;
    z-index: 50;
}
.composer__inner {
    max-width: calc(720px - 30px);
    margin: 0 auto;
}
.composer__panel {
    position: relative;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    margin-bottom: 12px;
    background: transparent;
}
.composer__panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
/*    background: linear-gradient(150deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));*/
    background: linear-gradient(135deg, rgba(11, 11, 24, 0.8) 0%, rgba(37, 32, 42, 0.8) 50%, rgba(27, 19, 39, 0.8) 100%);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    z-index: 0;
    pointer-events: none;
}
.composer__panel > * {
    position: relative;
    z-index: 1;
}
.composer__wrap {
    max-height: 33vh;
    overflow-y: auto;
}
.composer__textarea {
    padding: 16px;
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    resize: none;
    font-size: 16px;
    line-height: 1.5;
}
.composer__textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.composer-template {
    padding: 0 0 12px;
}
.composer-template--hidden {
    display: none;
}
.composer-template__card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.12), rgba(202, 138, 4, 0.12));
    backdrop-filter: blur(16px);
    border: 1px solid rgba(234, 179, 8, 0.2);
}
.composer-template__image {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.composer-template__content {
    flex: 1;
    min-width: 0;
    line-height: 1.25;
}
.composer-template__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: #facc15;
}
.composer-template__badge-icon {
    width: 12px;
    height: 12px;
}
.composer-template__badge-text {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.composer-template__title {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.composer-template__but {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
}
.composer-template__but:hover,
.composer-template__but:focus {
    background: rgba(255, 255, 255, 0.2);
}
.composer-template__but-icon {
    width: 16px;
    height: 16px;
}
.composer-character {
    margin: 12px 12px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}
.composer-character__header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.composer-character__title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}
.composer-character__subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}
.composer-character__uploads {
    display: grid;
    flex-direction: column;
    gap: 12px;
}
.composer-character__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.composer-character__field-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}
.composer-character__field-hint {
    margin-top: -4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}
.composer-character__upload-button {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: border-color 0.2s ease, background-color 0.2s ease;
    position: relative;
    overflow: hidden;
}
.composer-character__upload-button:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
}
.composer-character__upload-button.is-filled .composer-character__upload-icon,
.composer-character__upload-button.is-filled .composer-character__upload-text {
    opacity: 0;
}
.composer-character__uploads--references {
    grid-template-columns: minmax(0, 1fr);
}
.composer-references__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}
.composer-references__tile {
    width: 100%;
    max-width: none;
    aspect-ratio: 1 / 1;
    border: 1px dashed #fff3;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background-color: #ffffff0d;
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    transition-duration: 0.15s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.composer-references__tile:hover {
    border-color: #ffffff4d;
    background-color: #ffffff1a;
}
.composer-references__tile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.composer-references__add-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #ffffff4d;
}
.composer-references__add-text {
    font-size: 10px;
    color: #ffffff80;
}
.composer-references__tile.is-filled .composer-references__tile-content {
    opacity: 0;
}
.composer-references__add-button.is-hidden {
    display: none;
}.composer-character__preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.composer-character__preview--video {
    background: #000000;
}
.composer-character__play-button {
    position: absolute;
    inset: 0;
    border: none;
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.2s ease;
    z-index: 1;
}
.composer-character__play-button:hover,
.composer-character__play-button:focus {
    opacity: 1;
}
.composer-character__play-icon {
    width: 32px;
    height: 32px;
}
.composer-character__play-icon--pause {
    display: none;
}
.composer-character__play-button.is-playing .composer-character__play-icon--play {
    display: none;
}
.composer-character__play-button.is-playing .composer-character__play-icon--pause {
    display: block;
}
.composer-character__remove-button {
    position: absolute;
    top: 6px;
    right: 6px;
    border: none;
    padding: 6px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    z-index: 2;
}
.composer-character__remove-button:hover,
.composer-character__remove-button:focus {
    background: #dc2626;
}
.composer-character__remove-icon {
    width: 16px;
    height: 16px;
}
.composer-character__upload-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.composer-character__upload-icon-svg {
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.3);
}
.composer-character__upload-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}
.composer-character__tip {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.composer-character__tip-icon {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}
.composer-character__tip-text {
    font-size: 10px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.6);
}
.composer-character__tip-strong {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}
.composer-mode__tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
}
.composer-mode__tabs--triple {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.composer-mode__tabs--stacked .composer-mode__tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}
.composer-mode__tab {
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.composer-mode__tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}
.composer-mode__tab.is-active {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.9);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.composer-mode__tab-subtitle {
    font-size: 11px;
    opacity: 0.6;
}
.composer-mode__panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.composer-mode__section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.composer-video__upload-button {
    cursor: pointer;
}
.composer-video__section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.composer-video__label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}
.composer-video__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.composer-video__toggle-title {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}
.composer-video__toggle-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}
.composer-video__switch {
    position: relative;
    width: 44px;
    height: 26px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    transition: background-color 0.2s ease;
}
.composer-video__switch-thumb {
    position: absolute;
    top: 3px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.composer-video__switch.is-active {
    background: #3b82f6;
}
.composer-video__switch.is-active .composer-video__switch-thumb {
    transform: translateX(16px);
}
.composer__photos {
    display: flex;
    gap: 8px;
    padding: 12px 12px 0;
    overflow-x: auto;
}
.composer__photos--hidden {
    display: none;
}
.composer__photo {
    position: relative;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}
.composer__photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.composer__photo-remove {
    position: absolute;
    inset: 0;
    border: none;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}
.composer__photo:hover .composer__photo-remove {
    opacity: 1;
}
.composer__photo-remove:focus,
.composer__photo-remove:hover {
    opacity: 1;
}
.composer__photo-remove-icon {
    width: 20px;
    height: 20px;
    color: #ffffff;
}
.composer__toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px;
}
.composer__params {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
    gap: 6px;
    overflow-x: auto;
    flex: 1;
}
.composer__param {
    position: relative;
    flex-shrink: 0;
}
.composer__toolbar > .composer__params .composer__param:last-child {
    padding-right: 18px;
}
/*
.composer__toolbar > .composer__param:last-child:before {
    content: '';
    position: absolute;
    left: -24px;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to left, #211f2a 0%, transparent 100%);
}
*/

.chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: var(--color-surface);
    padding: 0 10px;
    height: 36px;
    border-radius: var(--radius-sm);
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    transition-duration: .15s;
    cursor: pointer;
}
.chip:hover {
    background-color: var(--color-surface-strong);
}
.chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.chip__icon {
    width: 16px;
    height: 16px;
}
.chip__value {
    font-size: 12px;
    font-weight: 500;
}

.chip__label {
    color: #ffffffe6;
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
}
.chip__emoji {
    font-size: 16px;
    line-height: 1;
}
.chip__label--desktop {
    display: none;
}
.chip--wide {
    min-width: 60px;
}
.chip--out-photos {
    min-width: 48px;
}
.chip--format {
    min-width: 60px;
}
.chip--mute {
    width: 36px;
    padding: 0;
}
.chip--model {
    width: 90px;
}
.chip--model .chip__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chip__avatar {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #5795ff, #a95bb7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chip__avatar--video {
    background-image: linear-gradient(to bottom right, #e5be66, #f55b11);
}
.chip__avatar svg {
    width: 12px;
    height: 12px;
    color: #fff;
}
.chip__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.primary-button {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background-color: #fff;
    color: #000;
    font-weight: 700;
    transition: filter 0.2s ease;
}
.primary-button[data-balance-insufficient="1"] {
    background-image: linear-gradient(to right, rgb(154 200 255), rgb(211 197 255));;
}
.primary-button:hover {
    filter: brightness(0.95);
}
.primary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.primary-button__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}
.primary-button__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
}
.primary-button__price {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.6);
    min-height: 20px;
}

.price-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.price-status__spinner {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: rgba(0, 0, 0, 0.6);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.modal__wrap {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: radial-gradient(1200px 600px at 12% 8%, rgba(139, 92, 246, .22), transparent 55%), radial-gradient(900px 500px at 88% 20%, rgba(34, 211, 238, .18), transparent 60%), radial-gradient(1000px 700px at 70% 92%, rgba(244, 114, 182, .14), transparent 60%), linear-gradient(180deg, #070812, #0b0d1a);
    backdrop-filter: blur(4px);
}

.modal__panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.modal__header {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal__header-inner {
    padding: 16px;
    padding-top: calc(15px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
}

.modal__header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 16px;
}

.modal__title {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
    color: #bebdff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal__subtitle {
    margin-top: 4px;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgba(255, 255, 255, 0.5);
}

.modal__close {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    margin-top: 4px;
}

.modal__close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal__close-icon {
    width: 20px;
    height: 20px;
    color: #fff;
}

.modal__form {
    padding: 0 16px 16px;
}

.modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(15px + var(--tg-safe-area-inset-bottom, 0px) / 2);
}

.templates__wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.templates__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.templates__card {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background-color: #999;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.templates__card:hover {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.templates__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.templates__fade {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 96px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.6), transparent);
}

.templates__content {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 16px;
}

.templates__title {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    text-transform: uppercase;
}

.templates__icon {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.templates__icon-svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.templates__empty {
    padding: 24px;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.main-content-grid {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr))
}

.main-content-card {
    position: relative;
    aspect-ratio: 1 / 1;
    background-color: #ffffff0d;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition-property: all;
    transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    transition-duration: .15s
}

.main-content-card > img {
    pointer-events: none;
}

.main-content-card:hover {
    box-shadow: 0 0 0 0 #fff, 0 0 0 2px #ffffff33, var(0 0 #0000)
}

.main-content-card__media {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover
}

.main-content-card__media--empty {
    position: relative;
    background-color: #33313d;
}
.main-content-card__media--empty:before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    background-image: urL('../images/no-media.svg');
    background-size: 60px 60px;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.5;
}

.main-content-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-image: linear-gradient(to top, rgb(0 0 0 / .8), rgb(0 0 0 / 0));
    padding: .5rem;
    opacity: 0;
    transition-property: opacity;
    transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    transition-duration: .15s
}

.main-content-card:hover .main-content-card__overlay {
    opacity: 1
}

.main-content-card__text {
    color: rgb(255 255 255);
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2
}

.overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    z-index: 100;
}

.popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #211f2a;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 16px;
    border-top: 1px solid var(--color-border);
    z-index: 110;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: var(--shadow-soft);
}
.popup__title {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.popup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.popup-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background-color: var(--color-surface);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.popup-option:hover {
    background-color: var(--color-surface-strong);
}
.popup-option--active {
    background-color: #383a63;
    color: #fff;
}
.popup-option__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.popup-option__body {
    flex: 1;
    text-align: left;
}
.popup-option__text {
    font-size: 16px;
    font-weight: 600;
}
.popup-option__subtext {
    font-size: 12px;
    opacity: 0.6;
}
.popup-option__price {
    font-size: 14px;
    font-weight: 600;
    margin-left: auto;
}

.model-card {
    display: block;
    width: 100%;
    border-radius: 12px;
    transition-property: all;
    transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    transition-duration: .15s;
    background-color: var(--color-surface);
    overflow: hidden;
    padding: 16px;
    color: #fff;
    cursor: pointer;
}
.model-card--active {
    background-color: #383a63;
/*    box-shadow: 0 0 0 2px #141414, 0 0 0 4px #383a63, 0 0 #0000;*/
}
.model-card:not(.model-card--active):hover {
    background-color: var(--color-surface-strong);
}
.model-card__header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.model-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #5795ff, #a95bb7);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.model-card__avatar--video {
    background-image: linear-gradient(to bottom right, #e5be66, #f55b11);
}
.model-card__avatar svg {
    width: 20px;
    height: 20px;
    color: #fff;
}
.model-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}
.model-card__content {
    flex: 1;
    min-width: 0;
    text-align: left;
}
.model-card__title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}
.model-card__name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}
.model-card__price {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.2);
}
.model-card__price > span {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.model-card__price > img {
    width: 12px;
    height: 12px;
}

.model-card__label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

.model-card__desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.model-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.model-card__meta-item {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.model-card--active .model-card__price {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.model-card--active .model-card__label {
    color: rgba(255, 255, 255, 0.8);
}

.model-card--active .model-card__desc {
    color: rgba(255, 255, 255, 0.9);
}

.model-card--active .model-card__meta-item {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.icon-stack {
    display: flex;
    gap: 2px;
}
.icon-stack--wide {
    gap: 4px;
}
.icon-stack--grid {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 2px;
}
.icon-stack--grid-wide {
    gap: 4px;
}
.icon-frame {
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 4px;
    width: var(--icon-w);
    height: var(--icon-h);
}
.icon-frame--solid {
    border-color: #fff;
    border-radius: 6px;
}
.icon-frame--square-s {
    --icon-w: 12px;
    --icon-h: 12px;
}
.icon-frame--square-xs {
    --icon-w: 6px;
    --icon-h: 6px;
}
.icon-frame--square-md {
    --icon-w: 16px;
    --icon-h: 16px;
}
.icon-frame--square-lg {
    --icon-w: 24px;
    --icon-h: 24px;
}
.icon-frame--rect-xs {
    --icon-w: 6px;
    --icon-h: 12px;
}
.icon-frame--rect-sm {
    --icon-w: 8px;
    --icon-h: 12px;
}
.icon-frame--rect-md {
    --icon-w: 12px;
    --icon-h: 24px;
}
.icon-frame--rect-lg {
    --icon-w: 16px;
    --icon-h: 24px;
}
.format-icon--square-xl {
    --icon-w: 28px;
    --icon-h: 28px;
}
.format-icon--rect-32-24 {
    --icon-w: 32px;
    --icon-h: 24px;
}
.format-icon--rect-20-32 {
    --icon-w: 20px;
    --icon-h: 32px;
}
.format-icon--rect-24-32 {
    --icon-w: 24px;
    --icon-h: 32px;
}
.format-icon--rect-24-28 {
    --icon-w: 24px;
    --icon-h: 28px;
}
.format-icon--rect-32-20 {
    --icon-w: 32px;
    --icon-h: 20px;
}
.format-icon--rect-28-24 {
    --icon-w: 28px;
    --icon-h: 24px;
}
.format-icon--rect-20-36 {
    --icon-w: 20px;
    --icon-h: 36px;
}
.format-icon--rect-36-20 {
    --icon-w: 36px;
    --icon-h: 20px;
}
.format-icon--rect-40-16 {
    --icon-w: 40px;
    --icon-h: 16px;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border-radius: 16px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    color: #fff;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.action-button:hover {
    background-color: var(--color-surface-strong);
}
.action-button--primary {
    background-color: #fff;
    color: #000;
    border-color: transparent;
    font-weight: 600;
}
.action-button--primary:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Шапка страницы */

.back-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.back-header__back-button {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s ease;
    font-size: 0;
}
.back-header__back-button:hover {
    color: #fff;
}
.back-header__back-icon {
    width: 24px;
    height: 24px;
}
.back-header__title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}
.header + .back-header {
    padding-top: 12px;
}

/* Профиль */

.profile {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 4px 24px;
}
.profile__header {
    text-align: center;
    padding: 24px 0 8px;
}
.profile__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: #fff;
}
.profile__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}
.profile__name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}
.profile__username {
    font-size: 13px;
    color: var(--color-subtle);
}
.profile__card {
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 18px;
}
.profile__card--flat {
    background: transparent;
    border: none;
    padding: 0;
}
.profile__label {
    font-size: 12px;
    color: var(--color-muted);
    text-align: center;
    margin-bottom: 8px;
}
.profile__balance-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}
.profile__balance-value {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
}
.profile__balance-icon {
    width: 28px;
    height: 28px;
}
.profile__button {
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: #fff;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.profile__button:hover {
    background: var(--color-surface-strong);
}
.profile__button--primary {
    background: #fff;
    color: #000;
    border-color: transparent;
}
.profile__button--primary:hover {
    background: rgba(255, 255, 255, 0.9);
}
.profile__title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 0 4px;
}
.profile__subtitle {
    font-size: 13px;
    color: var(--color-muted);
    margin-bottom: 12px;
    padding: 0 4px;
}
.profile__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.profile__stat {
    text-align: center;
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    padding: 14px;
}
.profile__stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}
.profile__stat-label {
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 4px;
}
.profile__ref-link {
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: var(--color-muted);
    word-break: break-all;
    margin-bottom: 12px;
}
.profile__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.profile__support {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    transition: background 0.2s ease;
}
.profile__support:hover {
    background: var(--color-surface-strong);
}
.profile__support-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.profile__support-icon {
    font-size: 18px;
}
.profile__support-text {
    font-size: 13px;
    font-weight: 600;
}
.profile__support-arrow {
    color: var(--color-subtle);
}

.app__footer {
    text-align: center;
    font-size: 12px;
    color: var(--color-subtle);
    padding: 4px 0 12px;
}

.block-results {
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.block-results__media {
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    overflow: hidden;
    min-height: 300px;
}
.block-results__media .main-content-card__media--empty {
    min-height: 300px;
}
.block-results__card {
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 18px;
}
.block-results__card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 0 4px;
}
.block-results__card-prompt {
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: var(--color-muted);
    word-break: break-all;
    margin-bottom: 12px;
}
.block-results__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 12px 8px;
}
.block-results__loader {
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
}
.block-results__loading-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}
.block-results__loading-subtitle {
    font-size: 12px;
    color: var(--color-muted);
}
.block-results__loading-time {
    font-size: 12px;
    color: var(--color-subtle);
}
.block-results__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.block-results__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: #fff;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.block-results__button:hover {
    background: var(--color-surface-strong);
}
.block-results__button--primary {
    background: #fff;
    color: #000;
    border-color: transparent;
}
.block-results__button--primary:hover {
    background: rgba(255, 255, 255, 0.9);
}
.block-results__template .composer-template__card {
    padding: 12px;
}
.block-results__template .composer-template__image {
    width: 48px;
    height: 48px;
}

/* Auth */

.auth-page {
    position: relative;
    min-height: calc(var(--dvh) - 30px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0 48px;
}
.auth-page--center .auth-page__card {
    text-align: center;
}
.auth-page__card {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
.auth-page__card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 70% at 0% 0%, rgba(255, 255, 255, 0.15), transparent 60%);
    opacity: 0.6;
    pointer-events: none;
}
.auth-page__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 600;
}
.auth-page__brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.auth-page__logo {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.25);
}
.auth-page__logo img {
    object-fit: cover;
    border-radius: 18px;
}
.auth-page__brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.auth-page__eyebrow {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.5);
}
.auth-page__tagline {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}
.auth-page__icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.25);
}
.auth-page__icon i {
    font-size: 28px;
}
.auth-page__title {
    position: relative;
    z-index: 1;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}
.auth-page__subtitle {
    position: relative;
    z-index: 1;
    display: block;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-muted);
    margin-bottom: 16px;
}
.auth-page__features {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}
.auth-feature {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}
.auth-feature__icon {
    font-size: 18px;
    line-height: 1;
}
.auth-feature__text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
}
.auth-page__buts {
    position: relative;
    margin-top: 10px;
}
.auth-page__action {
    position: relative;
    overflow: hidden;
    width: 100%;
    border-radius: var(--radius-sm);
}
.auth-page__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    background: linear-gradient(90deg, #64a6f5, #ae93ff);
    color: #fff;
    box-shadow: 0 16px 28px rgba(104, 154, 247, 0.25);
    transition: transform 0.2s ease, filter 0.2s ease;
}
.auth-page__action-btn--outline {
    background: transparent;
    border: 1px solid var(--color-border);
    box-shadow: none;
}
.auth-page__action-btn:hover,
.auth-page__action:hover .auth-page__action-btn {
    filter: brightness(0.95);
    transform: translateY(-1px);
}
.auth-page__action-btn.loading {
    opacity: 0.7;
    cursor: wait;
    filter: brightness(0.9);
}
.auth-page__note {
    position: relative;
    z-index: 1;
    margin-top: 16px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--color-subtle);
}

.tg-button .auth-page__buts {
    z-index: 1;
}
.tg-button .auth-page__action-btn {
    position: relative;
    z-index: 1;
    pointer-events: none;
}
.tg-button iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    pointer-events: auto;
    transform: scale(5);
    transform-origin: left top;
}

@media (min-width: 430px) {
    .composer-character__uploads {
        flex-direction: row;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .main-content-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }
}

@media (min-width: 640px) {

    .composer__params {
        gap: 8px;
        overflow: visible;
    }

    .chip__label--desktop {
        display: inline;
    }
    .chip {
        gap: 8px;
        height: 40px;
        padding: 0 12px;
    }
    .chip--mute {
        width: 40px;
        padding: 0;
    }
    .chip--model {
        width: auto;
    }
    .chip__avatar {
        width: 24px;
        height: 24px;
    }
    .chip__avatar svg {
        width: 14px;
        height: 14px;
    }

    .popup {
        position: absolute;
        left: auto;
        bottom: 100%;
        margin-bottom: 8px;
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border);
        max-height: 400px;
    }
    .popup--left {
        right: auto;
        min-width: 280px;
    }
    .popup--right {
        right: 0;
        width: 340px;
    }

    .templates__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .overlay {
        display: none;
    }

    .icon-frame--square-s {
        --icon-w: 14px;
        --icon-h: 14px;
    }
    .icon-frame--square-xs {
        --icon-w: 8px;
        --icon-h: 8px;
    }
    .icon-frame--rect-sm {
        --icon-w: 10px;
        --icon-h: 14px;
    }
    .icon-frame--rect-xs {
        --icon-w: 8px;
        --icon-h: 14px;
    }
}

@supports (height: 100dvh) {
    :root {
      --dvh: min(100vh, 100dvh);
    }
}