:root {
    color-scheme: dark;
    --ink: #f6f6f8;
    --muted: #aaaab4;
    --muted-2: #73747e;
    --canvas: #09090c;
    --surface: #15151a;
    --surface-2: #202127;
    --line: rgba(255, 255, 255, .12);
    --line-strong: rgba(255, 255, 255, .22);
    --accent: #ff4d67;
    --accent-dark: #d92e4b;
    --success: #4ed495;
    --warning: #ffbf55;
    --danger: #ff6478;
    --nav-height: 72px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --app-width: 540px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: #060608;
    color: var(--ink);
}

body {
    min-width: 320px;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 999;
    top: 10px;
    left: 10px;
    padding: 9px 13px;
    border-radius: 8px;
    background: #fff;
    color: #111;
    transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.ui-icon {
    flex: 0 0 auto;
    vertical-align: middle;
    shape-rendering: geometricPrecision;
}

.avatar-image {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    background: #292d37;
    color: transparent;
}

.creator-badge { display: inline-flex; align-items: center; gap: 4px; width: fit-content; color: #55e0dc; font-size: 10px; font-weight: 850; line-height: 1; vertical-align: middle; white-space: nowrap; }
.creator-badge .ui-icon { filter: drop-shadow(0 0 5px rgba(85, 224, 220, .25)); }
.creator-badge--lg { gap: 6px; padding: 6px 9px; border: 1px solid rgba(85, 224, 220, .28); border-radius: 999px; background: #162529; color: #75efeb; font-size: 11px; }

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.mobile-app {
    position: relative;
    width: min(100%, var(--app-width));
    min-height: 100dvh;
    margin: 0 auto;
    overflow: hidden;
    background: var(--canvas);
}

.toast {
    position: fixed;
    z-index: 300;
    top: calc(var(--safe-top) + 16px);
    left: 50%;
    display: flex;
    align-items: center;
    gap: 9px;
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 11px 15px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(24, 25, 30, .94);
    box-shadow: 0 14px 45px rgba(0, 0, 0, .32);
    font-size: 13px;
    transform: translateX(-50%);
    animation: toast-in .24s ease-out both;
}

.toast--success .ui-icon { color: var(--success); }
.toast--error { border-color: rgba(255, 100, 120, .5); }
.toast.is-leaving { animation: toast-out .2s ease-in both; }

@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -12px); } }

/* Immersive feed */
.feed-app { height: 100dvh; }

.feed-topbar {
    position: absolute;
    z-index: 50;
    top: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    min-height: calc(62px + var(--safe-top));
    padding: calc(10px + var(--safe-top)) 12px 8px;
    pointer-events: none;
}

.feed-topbar > * { pointer-events: auto; }

.feed-topbar__brand {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(12, 12, 15, .55);
    backdrop-filter: blur(12px);
}

.feed-topbar__brand img { width: 27px; height: 27px; }

.feed-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.feed-tabs button {
    position: relative;
    padding: 8px 2px 10px;
    border: 0;
    background: none;
    color: rgba(255,255,255,.66);
    font-size: 16px;
    font-weight: 650;
    text-shadow: 0 1px 7px rgba(0,0,0,.7);
    cursor: pointer;
}

.feed-tabs button.is-active { color: #fff; font-weight: 800; }
.feed-tabs button.is-active::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 50%;
    width: 18px;
    height: 3px;
    border-radius: 4px;
    background: var(--accent);
    transform: translateX(-50%);
}

.topbar-button,
.icon-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(12, 12, 15, .58);
    color: #fff;
    backdrop-filter: blur(12px);
    cursor: pointer;
}

.feed-stack {
    height: 100dvh;
    overflow: auto;
    overscroll-behavior-y: contain;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    touch-action: pan-y;
}

.feed-stack::-webkit-scrollbar { display: none; }

.feed-card {
    position: relative;
    height: 100dvh;
    min-height: 560px;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: #101014;
    isolation: isolate;
}

.feed-card[hidden] { display: none; }

.feed-card__backdrop,
.video-slot,
.video-slot > video,
.video-slot > .video-js,
.video-slot .vjs-tech {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.feed-card__backdrop {
    z-index: -2;
    background-color: #111217;
    background-position: center;
    background-size: cover;
}

.feed-card__backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.22);
}

.video-slot { z-index: -1; background: #0a0a0d; }
.video-slot video,
.video-slot .vjs-tech { object-fit: cover; background: #09090c; }
.video-slot .video-js { padding: 0 !important; }
.video-slot .vjs-control-bar,
.video-slot .vjs-big-play-button,
.video-slot .vjs-loading-spinner { display: none !important; }

.feed-card__tap-zone {
    position: absolute;
    z-index: 2;
    inset: 70px 88px calc(var(--nav-height) + var(--safe-bottom) + 82px) 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.feed-card__tap-zone:focus-visible { outline-offset: -4px; }

.play-state {
    position: absolute;
    z-index: 8;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    background: rgba(0,0,0,.5);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(.85);
    transition: opacity .18s ease, transform .18s ease;
    backdrop-filter: blur(8px);
}

.feed-card.is-paused .play-state { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.feed-card__meta {
    position: absolute;
    z-index: 5;
    left: 14px;
    right: 87px;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 18px);
    padding: 12px 13px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 15px;
    background: rgba(10,10,13,.56);
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    backdrop-filter: blur(10px);
}

.feed-author {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 8px;
    font-weight: 800;
}

.feed-author__avatar {
    width: 31px;
    height: 31px;
    overflow: hidden;
    border: 1.5px solid rgba(255,255,255,.72);
    border-radius: 50%;
    background: var(--surface-2);
}

.feed-author__avatar img { width: 100%; height: 100%; object-fit: cover; }
.feed-author__avatar span { display: grid; place-items: center; width: 100%; height: 100%; font-size: 12px; }

.platform-selection-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(10, 10, 14, .54);
    color: rgba(255, 255, 255, .86);
    font-size: 10px;
    font-style: normal;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .03em;
    vertical-align: middle;
}

.feed-card__caption {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: rgba(255,255,255,.94);
    font-size: 14px;
    line-height: 1.55;
    text-shadow: 0 1px 5px rgba(0,0,0,.46);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.feed-card__caption.is-expanded { display: block; }
.feed-card__caption button { border: 0; background: none; color: #fff; font-weight: 750; cursor: pointer; }

.feed-card__music {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 9px 0 0;
    overflow: hidden;
    color: rgba(255,255,255,.74);
    font-size: 12px;
    white-space: nowrap;
}

.feed-card__music span { overflow: hidden; text-overflow: ellipsis; }

.action-rail {
    position: absolute;
    z-index: 6;
    right: 10px;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 22px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.action-rail__avatar {
    position: relative;
    width: 52px;
    height: 60px;
    margin-bottom: 2px;
}

.action-rail__avatar > img,
.action-rail__avatar > span {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: auto;
    overflow: hidden;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #2b2c33;
    object-fit: cover;
    font-weight: 800;
}

.action-rail__follow {
    position: absolute;
    bottom: 0;
    left: 50%;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 2px solid #0e0e12;
    border-radius: 50%;
    background: var(--accent);
    transform: translateX(-50%);
    cursor: pointer;
}

.action-rail__follow.is-following { background: var(--success); }
.action-rail__follow.is-following .ui-icon { transform: rotate(45deg); }

.action-button,
.action-button-form button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 62px;
    min-height: 55px;
    padding: 4px 0;
    border: 0;
    background: none;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,.72);
    cursor: pointer;
}

.action-button span,
.action-button-form button span { margin-top: 2px; font-size: 11px; font-weight: 750; }
.action-button.is-active,
.action-button-form.is-active button { color: var(--accent); }
.action-button-form.is-active button .ui-icon { fill: currentColor; }
.action-button[aria-busy="true"] { opacity: .55; pointer-events: none; }

.feed-utility {
    position: absolute;
    z-index: 8;
    right: 14px;
    top: calc(var(--safe-top) + 69px);
    display: flex;
    gap: 8px;
}

.feed-utility button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(10,10,13,.52);
    color: #fff;
    font-size: 11px;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.feed-mode-empty {
    position: absolute;
    z-index: 15;
    inset: 0;
    display: none;
    place-items: center;
    padding: 96px 28px 120px;
    background: #0c0c10;
    text-align: center;
}

.feed-mode-empty.is-visible { display: grid; }
.feed-mode-empty img { width: 180px; margin: 0 auto 20px; opacity: .8; }
.feed-mode-empty h2 { margin: 0 0 7px; font-size: 20px; }
.feed-mode-empty p { max-width: 310px; margin: 0; color: var(--muted); font-size: 13px; }

.feed-empty {
    display: grid;
    place-items: center;
    height: 100dvh;
    padding: 90px 28px 120px;
    background: #0d0d11;
    text-align: center;
}

.feed-empty img { width: min(230px, 74%); margin: 0 auto 18px; }
.feed-empty h2 { margin: 0 0 8px; }
.feed-empty p { margin: 0 0 22px; color: var(--muted); }

.feed-load-status {
    position: fixed;
    z-index: 70;
    left: 50%;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 13px);
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: calc(min(100%, var(--app-width)) - 32px);
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(18, 18, 23, .9);
    box-shadow: 0 7px 22px rgba(0, 0, 0, .28);
    color: rgba(255, 255, 255, .82);
    font-size: 12px;
    transform: translateX(-50%);
    backdrop-filter: blur(12px);
}

.feed-load-status[hidden] { display: none; }
.feed-load-status button { padding: 2px 4px; border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 800; cursor: pointer; }
.feed-load-status button[hidden] { display: none; }

/* Bottom navigation and sheets */
.mobile-nav {
    position: fixed;
    z-index: 80;
    bottom: 0;
    left: 50%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: min(100%, var(--app-width));
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding: 7px 5px var(--safe-bottom);
    border-top: 1px solid var(--line);
    background: rgba(10,10,13,.93);
    transform: translateX(-50%);
    backdrop-filter: blur(18px);
}

.mobile-nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 3px;
    border: 0;
    background: none;
    color: #8f9099;
    font-size: 10px;
    cursor: pointer;
}

.mobile-nav__item.is-active { color: #fff; font-weight: 800; }
.mobile-nav__item.is-active > .ui-icon { color: var(--accent); filter: drop-shadow(0 0 8px rgba(255,77,103,.24)); }
.mobile-nav__item.is-active:not(.mobile-nav__create)::after {
    content: "";
    position: absolute;
    bottom: 1px;
    left: 50%;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    transform: translateX(-50%);
}
.mobile-nav__create { position: relative; color: #d8d9df; }
.mobile-nav__create-box {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 29px;
    margin-top: -8px;
    border: 0;
    border-radius: 8px;
    background: #f7f7f8;
    color: #111217;
    box-shadow:
        -4px 0 0 #25d6d1,
        4px 0 0 #ff3f62,
        0 7px 18px rgba(0, 0, 0, .3),
        inset 0 0 0 1px rgba(12, 13, 17, .05);
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.mobile-nav__create-box .ui-icon { display: block; }
.mobile-nav__create.is-active { color: #fff; font-weight: 800; }
.mobile-nav__create.is-active .mobile-nav__create-box {
    background: #fff;
    box-shadow:
        -4px 0 0 #25d6d1,
        4px 0 0 #ff3f62,
        0 8px 20px rgba(0, 0, 0, .34),
        0 0 0 1px rgba(255, 255, 255, .2);
}
.mobile-nav__create:active .mobile-nav__create-box {
    transform: translateY(1px) scale(.96);
    box-shadow:
        -3px 0 0 #25d6d1,
        3px 0 0 #ff3f62,
        0 4px 11px rgba(0, 0, 0, .26);
}
@media (hover: hover) {
    .mobile-nav__create:hover .mobile-nav__create-box {
        transform: translateY(-1px);
        background: #fff;
    }
}

.sheet-dialog {
    position: fixed;
    z-index: 200;
    top: auto;
    bottom: 0;
    width: min(100%, var(--app-width));
    max-width: none;
    max-height: min(76dvh, 680px);
    margin: auto auto 0;
    padding: 10px 18px calc(24px + var(--safe-bottom));
    overflow: auto;
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: 25px 25px 0 0;
    background: #18191e;
    color: var(--ink);
    box-shadow: 0 -20px 60px rgba(0,0,0,.42);
}

.sheet-dialog::backdrop { background: rgba(0,0,0,.62); backdrop-filter: blur(3px); }
.sheet-dialog[open] { animation: sheet-up .24s ease-out both; }
@keyframes sheet-up { from { opacity: 0; transform: translateY(40px); } }

.sheet-dialog__handle { width: 38px; height: 4px; margin: 0 auto 17px; border-radius: 5px; background: #4a4c55; }
.sheet-dialog__header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.sheet-dialog__header h2 { margin: 0; font-size: 21px; }
.sheet-dialog__hint { margin: 13px 3px 0; color: var(--muted); font-size: 12px; }

.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #24252b;
    color: var(--muted);
}

.search-field:focus-within { border-color: rgba(255,77,103,.7); box-shadow: 0 0 0 3px rgba(255,77,103,.12); }
.search-field input { width: 100%; height: 48px; border: 0; outline: 0; background: transparent; color: #fff; }

.honest-placeholder { display: grid; justify-items: center; padding: 25px 12px 30px; text-align: center; }
.honest-placeholder__icon { display: grid; place-items: center; width: 62px; height: 62px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface-2); color: var(--accent); }
.honest-placeholder strong { font-size: 16px; }
.honest-placeholder p { max-width: 330px; margin: 7px 0 0; color: var(--muted); font-size: 13px; }

.sheet-action-list { display: grid; gap: 8px; }
.sheet-action-list > button {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 62px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #202127;
    color: #fff;
    text-align: left;
    cursor: pointer;
}
.sheet-action-list > button > span:first-child { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #2b2c33; color: var(--accent); }
.sheet-action-list > button > span:first-child.is-danger { color: var(--danger); }
.sheet-action-list strong, .sheet-action-list small { display: block; }
.sheet-action-list small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.sheet-action-list > button > .ui-icon { color: var(--muted); }
.report-form { display: grid; gap: 13px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.report-form[hidden] { display: none; }

.comments-dialog { padding-left: 0; padding-right: 0; }
.comments-dialog .sheet-dialog__handle,
.comments-dialog .sheet-dialog__header { margin-left: 18px; margin-right: 18px; }
.comment-list { display: grid; gap: 17px; max-height: 44dvh; padding: 3px 18px 18px; overflow: auto; }
.comment-row { display: grid; grid-template-columns: 36px 1fr; gap: 10px; }
.comment-row__avatar { display: grid; place-items: center; width: 36px; height: 36px; overflow: hidden; border-radius: 50%; background: #31323a; font-size: 12px; }
.comment-row__avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-row strong { display: block; color: #b9bac3; font-size: 12px; }
.comment-row p { margin: 3px 0; font-size: 13px; }
.comment-row time { color: var(--muted-2); font-size: 11px; }
.comment-empty { padding: 30px 0; color: var(--muted); text-align: center; }
.comment-compose { display: flex; gap: 9px; padding: 13px 18px 0; border-top: 1px solid var(--line); }
.comment-compose input { flex: 1; min-width: 0; height: 43px; padding: 0 13px; border: 1px solid var(--line); border-radius: 22px; outline: 0; background: #24252b; color: #fff; }
.comment-compose input:focus { border-color: var(--accent); }
.comment-compose button { min-width: 62px; border: 0; border-radius: 22px; background: var(--accent); color: #fff; font-weight: 750; cursor: pointer; }

/* Common form controls */
.mobile-page {
    width: min(100%, var(--app-width));
    min-height: 100dvh;
    margin: 0 auto;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
    background: var(--canvas);
}

.page-topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(59px + var(--safe-top));
    padding: calc(10px + var(--safe-top)) 16px 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(11,11,14,.91);
    backdrop-filter: blur(18px);
}

.page-topbar h1 { margin: 0; font-size: 17px; }
.page-topbar__side { display: flex; align-items: center; gap: 8px; min-width: 74px; }
.page-topbar__side:last-child { justify-content: flex-end; }
.text-button { padding: 7px 3px; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 750; cursor: pointer; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.button:hover { background: #ff5a72; }
.button:disabled { opacity: .46; cursor: not-allowed; }
.button--secondary { border-color: var(--line); background: var(--surface-2); }
.button--secondary:hover { background: #2b2c33; }
.button--ghost { border-color: var(--line); background: transparent; }
.button--block { width: 100%; }

.field { display: grid; gap: 7px; }
.field > span,
.field > label { font-size: 13px; font-weight: 720; }
.field small { color: var(--muted); font-size: 11px; }
.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: 0;
    background: #1e1f25;
    color: #fff;
}
.field textarea { min-height: 112px; resize: vertical; }
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,77,103,.12); }
.field .is-invalid { border-color: var(--danger); }
.field-error { margin: 0; color: #ff91a0; font-size: 12px; }

.form-alert {
    padding: 12px 14px;
    border: 1px solid rgba(255,100,120,.42);
    border-radius: 12px;
    background: rgba(255,100,120,.08);
    color: #ffc3cb;
    font-size: 13px;
}
.form-alert ul { margin: 7px 0 0; padding-left: 18px; }

/* Login */
.auth-page {
    position: relative;
    display: grid;
    align-items: center;
    width: min(100%, var(--app-width));
    min-height: 100dvh;
    margin: 0 auto;
    padding: calc(28px + var(--safe-top)) 22px calc(28px + var(--safe-bottom));
    overflow: hidden;
    background: #0d0e12;
}

.auth-page::before {
    content: "";
    position: absolute;
    top: 9%;
    right: -90px;
    width: 200px;
    height: 200px;
    border: 36px solid rgba(255,77,103,.12);
    border-radius: 42px;
    transform: rotate(26deg);
}

.auth-card { position: relative; z-index: 1; width: 100%; max-width: 410px; margin: 0 auto; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.auth-brand img { width: 50px; height: 50px; }
.auth-brand strong { display: block; font-size: 19px; letter-spacing: .04em; }
.auth-brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; letter-spacing: .15em; }
.auth-heading { margin-bottom: 27px; }
.auth-heading h1 { margin: 0 0 8px; font-size: clamp(28px, 8vw, 38px); line-height: 1.15; letter-spacing: -.03em; }
.auth-heading p { margin: 0; color: var(--muted); }
.auth-form { display: grid; gap: 17px; }
.password-field { position: relative; }
.password-field input { padding-right: 50px; }
.password-toggle { position: absolute; right: 4px; bottom: 4px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.auth-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -3px; color: var(--muted); font-size: 12px; }
.check-row { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.demo-account { margin-top: 22px; padding: 13px 14px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 12px; }
.demo-account strong { color: #fff; }
.demo-account code { color: #ffd0d7; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 26px; color: var(--muted); font-size: 13px; }
.auth-back .ui-icon { transform: rotate(180deg); }
.auth-switch { margin: 21px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.auth-switch a { color: #fff; font-weight: 800; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.auth-page--register { align-items: start; }
.auth-page--register .auth-card { padding-top: 4vh; padding-bottom: 4vh; }
.auth-page--register .auth-brand { margin-bottom: 28px; }

/* Profile */
.profile-page { background: #0d0e12; }
.profile-hero {
    position: relative;
    min-height: 292px;
    padding: calc(21px + var(--safe-top)) 18px 20px;
    background-color: #17181e;
    background-image: url("../img/profile-texture.svg");
    background-position: center;
    background-size: cover;
}
.profile-hero::after { content: ""; position: absolute; inset: 0; background: rgba(7,7,10,.34); }
.profile-hero > * { position: relative; z-index: 1; }
.profile-hero__actions { display: flex; justify-content: space-between; }
.profile-hero__actions > div { display: flex; gap: 8px; }
.profile-identity { display: flex; align-items: flex-end; gap: 15px; margin-top: 44px; }
.profile-avatar { display: grid; place-items: center; width: 86px; height: 86px; overflow: hidden; border: 3px solid rgba(255,255,255,.86); border-radius: 27px; background: #30313a; color: #fff; font-size: 25px; font-weight: 800; box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-identity__text { min-width: 0; padding-bottom: 3px; }
.profile-identity h1 { margin: 0 0 3px; overflow: hidden; font-size: 24px; text-overflow: ellipsis; white-space: nowrap; }
.profile-identity p { margin: 0; color: rgba(255,255,255,.68); font-size: 12px; }
.profile-bio { min-height: 20px; margin: 15px 0 13px; color: rgba(255,255,255,.86); font-size: 13px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.profile-stat { padding: 8px 5px; border: 0; background: rgba(8,8,11,.36); color: #fff; text-align: center; backdrop-filter: blur(8px); }
.profile-stat:first-child { border-radius: 12px 0 0 12px; }
.profile-stat:last-child { border-radius: 0 12px 12px 0; }
.profile-stat strong { display: block; font-size: 17px; }
.profile-stat span { color: rgba(255,255,255,.64); font-size: 11px; }
.profile-controls { display: grid; grid-template-columns: 1fr auto; gap: 9px; padding: 14px 15px 9px; }
.profile-controls .button { min-height: 41px; padding-top: 8px; padding-bottom: 8px; }
.profile-controls .button--square { width: 43px; padding: 0; }
.profile-tabs { position: sticky; z-index: 20; top: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); background: rgba(13,14,18,.94); backdrop-filter: blur(16px); }
.profile-tabs button { position: relative; height: 48px; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.profile-tabs button.is-active { color: #fff; }
.profile-tabs button.is-active .ui-icon { color: var(--accent); }
.profile-tabs button.is-active::after { content: ""; position: absolute; right: 35%; bottom: 0; left: 35%; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.profile-panel[hidden] { display: none; }
.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 2px; padding: 2px; }
.video-tile { position: relative; aspect-ratio: 9/16; overflow: hidden; background: #202127; }
.video-tile > img { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.video-tile:hover > img { transform: scale(1.025); }
.video-tile--disabled { cursor: not-allowed; opacity: .62; }
.video-tile--disabled:hover > img { transform: none; }
.video-tile__meta { position: absolute; right: 7px; bottom: 7px; left: 7px; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 5px 7px; border-radius: 8px; background: rgba(7,7,10,.65); color: #fff; font-size: 10px; backdrop-filter: blur(5px); }
.video-tile__views { display: inline-flex; align-items: center; gap: 4px; }
.video-tile__status { max-width: 72px; overflow: hidden; color: #ffd6dc; text-overflow: ellipsis; white-space: nowrap; }
.panel-empty { display: grid; justify-items: center; padding: 58px 24px; color: var(--muted); text-align: center; }
.panel-empty .ui-icon { margin-bottom: 11px; color: #575965; }
.panel-empty strong { color: #d4d5db; }
.panel-empty p { margin: 5px 0 0; font-size: 12px; }

/* Upload */
.upload-page { background: #0f1014; }
.upload-content { padding: 18px 16px 32px; }
.upload-intro { margin-bottom: 18px; }
.upload-intro h2 { margin: 0 0 5px; font-size: 24px; }
.upload-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.upload-form { display: grid; gap: 17px; }
.drop-zone { position: relative; display: grid; place-items: center; min-height: 292px; overflow: hidden; border: 1.5px dashed #4c4e59; border-radius: 19px; background: #18191f; text-align: center; cursor: pointer; }
.drop-zone:hover,
.drop-zone.is-dragging { border-color: var(--accent); background: #1d1a20; }
.drop-zone.is-busy { pointer-events: none; opacity: .82; }
.drop-zone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-zone__prompt { display: grid; justify-items: center; padding: 28px; }
.drop-zone__icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 14px; border-radius: 20px; background: var(--accent); box-shadow: 0 11px 28px rgba(255,77,103,.18); }
.drop-zone strong { font-size: 16px; }
.drop-zone p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.upload-preview { position: absolute; inset: 0; display: none; background: #08080b; }
.upload-preview.is-visible { display: block; }
.upload-preview video { width: 100%; height: 100%; object-fit: contain; }
.upload-preview__change { position: absolute; top: 12px; right: 12px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(10,10,13,.72); font-size: 11px; backdrop-filter: blur(8px); }
.upload-file-meta { display: none; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: #18191f; font-size: 12px; }
.upload-file-meta.is-visible { display: grid; }
.upload-file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file-meta span { color: var(--muted); }
.upload-file-meta small { grid-column: 1 / -1; color: var(--muted-2); font-size: 10px; }
.upload-card { display: grid; gap: 15px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: #17181d; }
.upload-card h3 { margin: 0; font-size: 15px; }
.upload-tips { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.upload-tip { padding: 10px 8px; border-radius: 11px; background: #202127; text-align: center; }
.upload-tip strong { display: block; font-size: 12px; }
.upload-tip span { color: var(--muted); font-size: 10px; }
.upload-progress { display: none; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #17181d; }
.upload-progress.is-visible { display: grid; }
.upload-progress__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.upload-progress__head strong { color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.upload-progress__track { height: 8px; overflow: hidden; border-radius: 8px; background: #2a2b32; }
.upload-progress__bar { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .18s ease; }
.upload-progress__detail { min-height: 16px; margin: 0; color: var(--muted-2); font-size: 11px; line-height: 1.45; }
.upload-progress__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.upload-control { min-height: 34px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #22232a; color: #e8e8ed; font-size: 11px; font-weight: 750; cursor: pointer; }
.upload-control:hover { border-color: rgba(255,255,255,.38); background: #292a32; }
.upload-control--primary { border-color: rgba(255,77,103,.58); background: rgba(255,77,103,.13); color: #ffdbe0; }
.upload-control--danger { margin-left: auto; color: #ff9eac; }
.upload-progress[data-phase="paused"] { border-color: rgba(255,191,85,.36); }
.upload-progress[data-phase="paused"] .upload-progress__bar { background: var(--warning); }
.upload-progress[data-phase="failed"] { border-color: rgba(255,100,120,.42); }
.upload-progress[data-phase="failed"] .upload-progress__bar { background: var(--danger); }
.upload-progress[data-phase="completed"] { border-color: rgba(78,212,149,.42); }
.upload-progress[data-phase="completed"] .upload-progress__bar { background: var(--success); }
.upload-fallback { padding: 11px 13px; border: 1px solid rgba(255,191,85,.32); border-radius: 12px; background: rgba(255,191,85,.08); color: #e8c98f; font-size: 11px; }
.upload-form.is-direct-upload .upload-progress { display: none; }
.upload-consent { align-items: flex-start; color: var(--muted); font-size: 12px; }

/* Messages */
.messages-page { background: #0d0e12; }
.message-hub { padding: 22px 15px 28px; }
.message-hub__heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.message-hub__heading h2 { margin: 0; font-size: 25px; }
.message-hub__heading > span { color: var(--muted); font-size: 10px; }
.message-search { margin-bottom: 15px; }
.conversation-list { display: grid; gap: 4px; }
.conversation-row { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 12px; min-height: 76px; padding: 10px 8px; border-bottom: 1px solid var(--line); border-radius: 11px; }
.conversation-row:hover { background: #17181d; }
.conversation-row[hidden] { display: none; }
.conversation-avatar { position: relative; display: grid; flex: 0 0 52px; place-items: center; width: 52px; min-width: 52px; height: 52px; min-height: 52px; overflow: visible; border-radius: 50%; background: #2b2c33; font-weight: 800; }
.conversation-avatar > .avatar-image { position: absolute; inset: 0; width: 52px; min-width: 52px; max-width: none; height: 52px; min-height: 52px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: center; }
.presence-dot { position: absolute; z-index: 1; right: -1px; bottom: -1px; width: 13px; height: 13px; border: 3px solid #0d0e12; border-radius: 50%; background: #555761; }
.presence-dot.is-online { background: var(--success); }
.conversation-main { min-width: 0; }
.conversation-main > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conversation-main > span:first-child { margin-bottom: 5px; }
.conversation-main strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-main time { margin-left: auto; color: var(--muted-2); font-size: 9px; white-space: nowrap; }
.conversation-main small { flex: 1; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-main em { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 9px; font-style: normal; font-weight: 800; }
.mobile-pagination { margin-top: 18px; }

.chat-page { height: 100dvh; padding-bottom: 0; overflow: hidden; background: #0d0e12; }
.chat-topbar { position: relative; height: calc(65px + var(--safe-top)); }
.chat-peer { display: flex; align-items: center; gap: 9px; min-width: 0; }
.chat-peer__avatar { display: grid; flex: 0 0 34px; place-items: center; width: 34px; height: 34px; overflow: hidden; border-radius: 50%; background: #2b2c33; font-size: 11px; font-weight: 800; }
.chat-peer__avatar > .avatar-image { width: 34px; min-width: 34px; max-width: none; height: 34px; min-height: 34px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: center; }
.chat-peer strong, .chat-peer small { display: block; }
.chat-peer strong { max-width: 160px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.chat-peer small { color: var(--muted); font-size: 9px; }
.chat-stream { display: flex; flex-direction: column; gap: 15px; height: calc(100dvh - 67px - var(--safe-top) - 72px - var(--safe-bottom)); padding: 20px 14px; overflow-y: auto; overscroll-behavior: contain; }
.chat-load-older { align-self: center; padding: 5px 10px; border-radius: 12px; background: #1b1c22; color: var(--muted); font-size: 10px; }
.chat-message { display: flex; align-items: flex-end; gap: 8px; max-width: 84%; }
.chat-message.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-message__avatar { display: grid; flex: 0 0 28px; place-items: center; width: 28px; height: 28px; overflow: hidden; border-radius: 50%; background: #2b2c33; font-size: 9px; }
.chat-message__avatar > .avatar-image { width: 28px; min-width: 28px; max-width: none; height: 28px; min-height: 28px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: center; }
.chat-message p { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 15px 15px 15px 4px; background: #202127; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message.is-mine p { border-color: transparent; border-radius: 15px 15px 4px 15px; background: var(--accent); }
.chat-message time { display: block; margin-top: 4px; color: var(--muted-2); font-size: 8px; }
.chat-message.is-mine time { text-align: right; }
.chat-empty { display: grid; justify-items: center; margin: auto; color: var(--muted); text-align: center; }
.chat-empty strong { color: #d9dae0; }
.chat-empty span { margin-top: 5px; font-size: 11px; }
.chat-compose { display: grid; grid-template-columns: 1fr 44px; align-items: end; gap: 9px; min-height: calc(72px + var(--safe-bottom)); padding: 10px 13px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--line); background: #14151a; }
.chat-compose label { display: block; }
.chat-compose textarea { display: block; width: 100%; max-height: 112px; min-height: 44px; padding: 11px 13px; resize: none; border: 1px solid var(--line); border-radius: 15px; outline: 0; background: #202127; color: #fff; }
.chat-compose textarea:focus { border-color: var(--accent); }
.chat-compose button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px; background: var(--accent); color: #fff; cursor: pointer; }
.chat-compose button .ui-icon { transform: rotate(-45deg); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (min-width: 700px) {
    .mobile-app,
    .mobile-page,
    .auth-page {
        border-right: 1px solid #25262d;
        border-left: 1px solid #25262d;
        box-shadow: 0 0 80px rgba(0,0,0,.45);
    }
}

@media (max-height: 670px) {
    :root { --nav-height: 64px; }
    .action-rail { gap: 1px; bottom: calc(var(--nav-height) + var(--safe-bottom) + 10px); }
    .action-button, .action-button-form button { min-height: 49px; }
    .feed-card__meta { bottom: calc(var(--nav-height) + var(--safe-bottom) + 9px); }
    .feed-card__music { display: none; }
    .profile-identity { margin-top: 28px; }
}

@media (max-width: 420px) {
    .field-pair { grid-template-columns: 1fr; }
}

@media (orientation: landscape) and (max-height: 540px) {
    :root { --nav-height: 54px; }
    .feed-card__meta { left: 12px; right: 92px; bottom: calc(var(--nav-height) + 8px); max-width: 54%; }
    .action-rail { right: 8px; bottom: calc(var(--nav-height) + 5px); flex-direction: row; }
    .action-rail__avatar { display: none; }
    .action-button, .action-button-form button { width: 54px; }
    .mobile-nav { padding-top: 3px; }
    .mobile-nav__item { flex-direction: row; gap: 5px; }
    .mobile-nav__create-box { width: 40px; height: 27px; margin: 0; border-radius: 7px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
