.surface-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: 0 0.75rem 2rem var(--color-shadow);
}

.page-scroll-sentinel {
    height: 0.625rem;
    margin-bottom: -0.625rem;
    pointer-events: none;
}

.page-header {
    position: sticky;
    z-index: 100;
    top: 0;
    padding-top: env(safe-area-inset-top);
    background: transparent;
    transition:
        background-color var(--transition-header),
        box-shadow var(--transition-header),
        backdrop-filter var(--transition-header),
        -webkit-backdrop-filter var(--transition-header);
}

/*
 * Scrolled, the header paints the same field the page top has (gradient, glow, rings), measured
 * from its own top edge, so it looks like the top of the page stayed put rather than a flat bar.
 */
.page-header.is-scrolled {
    background: var(--app-backdrop);
    background-color: var(--color-bg);
    box-shadow: var(--shadow-header);
    backdrop-filter: blur(1rem);
    -webkit-backdrop-filter: blur(1rem);
}

.page-header__inner {
    display: flex;
    min-height: var(--header-height);
    align-items: center;
    gap: var(--space-2);
    padding-inline: var(--page-gutter);
}

.page-header__lead {
    min-width: 0;
    flex: 1;
}

.page-header__title {
    overflow: hidden;
    font-size: var(--text-md);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-header--lg .page-header__title {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.page-header__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--space-1);
    margin-inline-end: calc(var(--space-2) * -1);
}

.page-header__icon {
    position: relative;
    display: inline-grid;
    width: var(--tap-target);
    height: var(--tap-target);
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-icon);
    cursor: pointer;
}

.page-header__badge {
    position: absolute;
    top: 0.35rem;
    inset-inline-end: 0.35rem;
    width: 0.45rem;
    height: 0.45rem;
    border: 1.5px solid var(--color-bg);
    border-radius: 50%;
    background: #ff4d5e;
    pointer-events: none;
    animation: live-blink 1.4s ease-in-out infinite;
}

.page-header__badge::after {
    content: "";
    position: absolute;
    inset: -1.5px;
    border-radius: inherit;
    background: #ff4d5e;
    animation: live-halo 1.4s ease-out infinite;
}

@keyframes live-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@keyframes live-halo {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 0; transform: scale(2.6); }
}

@media (prefers-reduced-motion: reduce) {
    .page-header__badge,
    .page-header__badge::after {
        animation: none;
    }
}

.page-header__inner > .page-header__icon:first-child {
    margin-inline-start: calc(var(--space-2) * -1);
}

.page-header__icon iconify-icon {
    font-size: 1.5rem;
}

.page-header__icon .brand-icon,
.page-header__icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.page-header__link {
    display: inline-flex;
    min-width: var(--tap-target);
    min-height: var(--tap-target);
    align-items: center;
    justify-content: flex-end;
    padding-inline: var(--space-2);
    background: transparent;
    color: var(--color-action-text);
    font-size: var(--text-body);
    font-weight: 600;
}

.page-header .app-brand {
    gap: var(--space-2);
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.022em;
}

.page-header .app-brand img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    font-size: var(--text-lg);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.app-brand img {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.app-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Underline tab strip shared by the market and task pages. */
.seg-tabs,
.mkt-tabs {
    display: flex;
    height: var(--tap-target);
    align-items: stretch;
    gap: var(--space-5);
}

/* Category names are admin supplied, so the row has to survive any number of them. */
.seg-tabs {
    overflow-x: auto;
    scrollbar-width: none;
}

.seg-tabs::-webkit-scrollbar {
    display: none;
}

.seg-tabs button {
    flex: 0 0 auto;
}

.mkt-tabs {
    justify-content: space-between;
    gap: var(--space-3);
}

.seg-tabs button,
.mkt-tabs button {
    position: relative;
    min-width: 0;
    padding: 0;
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--text-body);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.seg-tabs button.is-active,
.mkt-tabs button.is-active {
    color: var(--color-text);
    font-weight: 600;
}

.seg-tabs button.is-active::after,
.mkt-tabs button.is-active::after {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 1.5rem;
    height: 2px;
    border-radius: var(--radius-pill);
    background: var(--color-action);
    content: '';
    transform: translateX(-50%);
}

.promo-banner,
.feature-banner,
.swiper {
    position: relative;
    width: 100%;
    height: clamp(8.25rem, 40vw, 9.75rem);
    min-height: 0;
    max-height: 9.75rem;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-surface);
}

/*
 * The uploaded artwork decides the height: full width, natural ratio, no border or card behind it,
 * so the image meets the rounded edge itself instead of sitting inside a frame.
 */
.promo-banner.swiper {
    height: auto;
    max-height: none;
    border: 0;
    border-radius: var(--radius-lg);
    background: transparent;
}

.promo-banner .swiper-wrapper,
.promo-banner .swiper-slide {
    height: auto;
}

.promo-banner img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: initial;
}

.promo-banner__fallback {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.125rem;
    padding-inline: var(--space-4);
    background: linear-gradient(120deg, var(--color-surface-raised), var(--color-surface));
}

.promo-banner__fallback strong {
    font-size: var(--text-md);
    font-weight: 700;
}

.promo-banner__fallback span {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.swiper-wrapper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex-shrink: 0;
    object-fit: cover;
}

.swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feature-banner__fallback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--card-pad-lg);
    background:
        radial-gradient(circle at 82% 48%, var(--color-action-soft), transparent 34%),
        linear-gradient(145deg, var(--color-surface-raised), var(--color-surface));
}

.feature-banner__fallback h1 {
    font-size: var(--text-xl);
    line-height: var(--leading-tight);
}

.feature-banner__fallback p {
    max-width: 14rem;
    margin-top: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.feature-banner__fallback iconify-icon {
    flex: 0 0 auto;
}

.promo-banner .swiper-pagination-bullet,
.feature-banner .swiper-pagination-bullet {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--color-text-dim);
    opacity: 1;
}

.promo-banner .swiper-pagination-bullet-active,
.feature-banner .swiper-pagination-bullet-active {
    background: var(--color-action);
}

.promo-banner.swiper .swiper-pagination.swiper-pagination-bullets,
.feature-banner.swiper .swiper-pagination.swiper-pagination-bullets {
    bottom: var(--space-1);
    line-height: 0;
}

.brand-icon {
    width: 2rem;
    height: 2rem;
    overflow: visible;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.brand-icon__base {
    stroke: var(--color-icon);
}

.brand-icon__accent {
    stroke: var(--color-brand-accent);
}

.telegram-card {
    display: grid;
    width: 100%;
    height: 4rem;
    grid-template-columns: 2.5rem minmax(0, 1fr) 1.25rem;
    align-items: center;
    gap: var(--space-3);
    padding-inline: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    color: var(--color-text);
    text-align: start;
    text-decoration: none;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.telegram-card:active {
    transform: scale(0.99);
}

.telegram-card__icon {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: var(--radius-pill);
    background: var(--color-action);
}

.telegram-card__icon .brand-icon {
    width: 1.4rem;
    height: 1.4rem;
}

.telegram-card__icon .brand-icon__base,
.telegram-card__icon .brand-icon__accent {
    stroke: var(--color-text);
}

.telegram-card__copy {
    min-width: 0;
}

.telegram-card__copy strong,
.telegram-card__copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.telegram-card__copy strong {
    font-size: var(--text-body);
    font-weight: 600;
    line-height: 1.125rem;
}

.telegram-card__copy small {
    margin-top: 0.125rem;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    line-height: 0.9375rem;
}

.telegram-card__arrow,
.telegram-card__arrow .brand-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.telegram-card__arrow .brand-icon__base,
.telegram-card__arrow .brand-icon__accent {
    stroke: var(--color-action-text);
}

.tabs {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    min-height: 2.75rem;
    border-bottom: 1px solid var(--color-border);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.section-heading h2 {
    font-size: var(--text-md);
}

.section-heading a {
    color: var(--color-brand-accent);
    font-size: var(--text-sm);
}

.btn,
.btn-submit,
.button-primary,
.Buy,
.openProduct {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    background: var(--color-action);
    color: var(--color-on-action);
    font-weight: 700;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn:active,
.btn-submit:active,
.button-primary:active,
.Buy:active,
.openProduct:active {
    transform: translateY(1px);
    background: var(--color-action-press);
}

.btn:disabled,
.btn-submit:disabled,
.button-primary:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.form-control {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-control > p:first-child {
    color: var(--color-text);
    font-size: var(--text-sm);
    font-weight: 600;
}

.form-control > div {
    display: flex;
    min-height: var(--input-height);
    align-items: center;
    gap: var(--space-3);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-brand-accent);
}

.form-control input,
.form-control select,
.form-control textarea {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--color-text);
}

.form-control input::placeholder,
.form-control textarea::placeholder {
    color: var(--color-text-dim);
}

.form-control > p:last-child:not(:first-child) {
    display: none;
    color: var(--color-danger);
    font-size: var(--text-xs);
}

.form-control.is-invalid > p:last-child {
    display: block;
}

.form-control.is-invalid > div {
    border-color: var(--color-danger);
}

/*
 * The footer as a floating pill in the footer's own blue: lifted off the bottom edge and inset from
 * the sides, with the page blurred behind it. The current tab's icon sits in a filled gold chip. To go back to the flat
 * edge-to-edge bar, restore this block from version control.
 */
.my-bottom-nav {
    position: fixed;
    z-index: 900;
    bottom: max(env(safe-area-inset-bottom), 0.75rem);
    left: 50%;
    width: calc(min(100%, var(--container-max)) - 1.5rem);
    height: 4rem;
    border: 1px solid var(--color-border);
    border-radius: 2rem;
    background: var(--color-nav-bg);
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / 25%),
        0 0.75rem 1.75rem -0.5rem rgb(3 10 34 / 45%);
    transform: translateX(-50%);
    backdrop-filter: blur(1rem) saturate(160%);
    -webkit-backdrop-filter: blur(1rem) saturate(160%);
}

.my-bottom-nav > div {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    padding-inline: 0.25rem;
}

.my-bottom-nav a,
.my-bottom-nav button {
    position: relative;
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.1875rem;
    padding: 0;
    background: transparent;
    color: rgb(255 255 255 / 72%);
    font-size: 0.65625rem;
    font-weight: 600;
    line-height: 0.875rem;
    transition: color var(--transition-fast);
}

/* The icon sits in a chip that fills in gold for the current tab. */
.my-bottom-nav a svg,
.my-bottom-nav a iconify-icon,
.my-bottom-nav button svg {
    width: 2.125rem;
    height: 1.75rem;
    padding: 0.1875rem 0.4375rem;
    border-radius: 0.625rem;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.my-bottom-nav button p,
.my-bottom-nav a p {
    margin: 0;
}

.my-bottom-nav a .brand-icon__base {
    stroke: rgb(255 255 255 / 80%);
}

.my-bottom-nav a .brand-icon__accent {
    stroke: var(--color-action-light);
}

.my-bottom-nav a.active {
    color: #ffd66b;
}

.my-bottom-nav a.active svg {
    background: linear-gradient(180deg, #ffe08a 0%, #ffa11f 100%);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 55%), 0 2px 0 #a04c00;
}

.my-bottom-nav a.active .brand-icon__base,
.my-bottom-nav a.active .brand-icon__accent {
    stroke: #341400;
}

/* Solid icons: no chip, the colour follows the tab's text colour. */
.my-bottom-nav a .bottom-nav__icon {
    width: auto;
    height: auto;
    padding: 0;
    border-radius: 0;
    font-size: 1.625rem;
}

.preloader {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    background: #f5f7fb;
    transition: opacity 200ms ease, visibility 200ms ease;
}

.theme-light .preloader {
    background: #fff;
}

/* The loading card: small, dark, a white ring turning inside. Used for page loads and actions. */
.loading-card {
    display: grid;
    width: 4.5rem;
    height: 4.5rem;
    place-items: center;
    border-radius: 1rem;
    background: rgb(17 24 39 / 88%);
    box-shadow: 0 0.75rem 2rem -0.75rem rgb(15 23 42 / 45%);
}

.loading-card__spin {
    width: 1.875rem;
    height: 1.875rem;
    border: 3px solid rgb(255 255 255 / 22%);
    border-top-color: #fff;
    border-radius: 50%;
    animation: app-spin 750ms linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .loading-card__spin {
        animation-duration: 1.6s;
    }
}

.preloader.is-hidden {
    visibility: hidden;
    opacity: 0;
}

.app-spinner {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-action);
    border-radius: var(--radius-pill);
    animation: app-spin 700ms linear infinite;
}

/* Toasts sit above everything, anchored top so they never fight the bottom nav or the
   button the member just tapped. */
.toast-stack {
    position: fixed;
    z-index: 1200;
    top: max(env(safe-area-inset-top), var(--space-3));
    left: 50%;
    display: grid;
    width: min(100% - (var(--page-gutter) * 2), var(--container-max));
    justify-items: center;
    gap: var(--space-2);
    pointer-events: none;
    transform: translateX(-50%);
}

.toast {
    display: grid;
    max-width: 100%;
    align-items: center;
    gap: var(--space-3);
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.6875rem var(--space-4);
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: var(--radius-lg);
    opacity: 0;
    background: var(--color-toast);
    box-shadow: 0 0.75rem 2rem var(--color-shadow);
    color: var(--color-text);
    cursor: pointer;
    pointer-events: auto;
    transform: translateY(-0.75rem) scale(0.94);
    transition: opacity var(--transition-fast), transform 240ms var(--ease-out);
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(-0.5rem) scale(0.98);
}

.toast__icon {
    display: grid;
    place-items: center;
}

.toast__text {
    margin: 0;
    font-size: var(--text-body);
    line-height: var(--leading-body);
}

.toast--success {
    border-color: rgba(34, 197, 94, 0.38);
}

.toast--success .toast__icon {
    color: var(--color-success);
}

.toast--error {
    border-color: rgba(239, 68, 68, 0.38);
}

.toast--error .toast__icon {
    color: var(--color-danger);
}

.toast--info .toast__icon {
    color: var(--color-action-text);
}

/* A repeat of the same message nudges the toast already on screen rather than stacking a copy. */
.toast.is-repeat {
    animation: toast-repeat 320ms var(--ease-out);
}

@keyframes toast-repeat {
    40% {
        transform: translateY(0) scale(1.03);
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast.is-repeat {
        animation: none;
    }
}

/* Three dots walking up and down, for actions that resolve in place. */
.dot-loader {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.dot-loader span {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: var(--radius-pill);
    background: currentColor;
    animation: dot-walk 1s var(--ease-out) infinite;
}

.dot-loader span:nth-child(2) {
    animation-delay: 140ms;
}

.dot-loader span:nth-child(3) {
    animation-delay: 280ms;
}

@keyframes dot-walk {
    0%,
    60%,
    100% {
        opacity: 0.4;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-0.25rem);
    }
}

.loader_boss {
    position: fixed;
    z-index: 1100;
    inset: 0;
    display: none;
    place-items: center;
    background: transparent;
}

.loader_boss.is-visible {
    display: grid;
}

.loader_boss__content {
    display: flex;
    min-width: 8rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

@media (hover: hover) and (pointer: fine) {
    .btn:hover,
    .btn-submit:hover,
    .button-primary:hover,
    .Buy:hover,
    .openProduct:hover {
        background: var(--color-action-hover);
    }
}

@keyframes app-spin {
    to { transform: rotate(360deg); }
}

.modal,
.c_modal {
    position: fixed;
    z-index: 950;
    inset: 0;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: var(--space-4);
    background: var(--color-overlay);
}

.modal.open,
.modal.is-open,
.c_modal.open {
    display: flex;
}

.modal > div,
.c_modal > div {
    width: min(100%, var(--container-max));
    max-height: 85vh;
    overflow-y: auto;
    padding: var(--card-pad-lg);
    border: 1px solid var(--sheet-border);
    border-radius: var(--radius-lg);
    background: var(--sheet-bg);
}

.telegram,
.bonus {
    display: grid;
    gap: var(--space-4);
}

.telegram > .btn,
.bonus > .btn {
    width: 2.75rem;
    min-height: 2.75rem;
    justify-self: end;
    padding: 0;
    background: var(--color-surface-raised);
}

.telegram > .title,
.bonus > .title {
    font-size: var(--text-lg);
    font-weight: 700;
}

.telegram > p:not(.title),
.bonus > p:not(.title) {
    color: var(--color-text-muted);
}

.telegram .tl {
    display: grid;
    gap: var(--space-2);
}

.telegram .tl a,
.telegram .tl button {
    display: flex;
    min-height: 3.25rem;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-raised);
}


