:root {
    --media-ink: #0b0e1a;
    --media-panel: #151a2a;
    --media-raised: #20263b;
    --media-line: rgba(199,207,248,.16);
    --media-mist: #aab4d0;
    --media-accent: #cdf890;
    --media-violet: #b2a7ff;
    --media-focus: #d0ff9f;
}

body.dashboard-body {
    background: radial-gradient(ellipse at 70% -10%,#242740 0,transparent 40%), var(--media-ink);
    --bg: var(--media-ink);
    --panel: var(--media-panel);
    --panel-2: #181f30;
    --panel-3: var(--media-raised);
    --border: var(--media-line);
    --muted: var(--media-mist);
    --lime: var(--media-accent);
}

.auth-page {
    background: var(--media-ink);
}

.auth-page .auth-brand {
    background: radial-gradient(ellipse at 40% 38%,#34345c,transparent 60%),#14182b;
    border-inline-end-color: var(--media-line);
}

.auth-page .auth-form-box {
    padding: clamp(14px,3.8vw,32px);
    border: 1px solid var(--media-line);
    border-radius: 19px;
    background: var(--media-panel);
}

.auth-page .auth-submit {
    background: var(--media-accent);
}

.dashboard-body .topbar {
    padding-block: 6px 16px;
    margin-bottom: 18px;
    border-bottom-color: var(--media-line);
}

.dashboard-body .topbar h1 {
    letter-spacing: -.05em;
    font-size: clamp(25px,3.2vw,34px);
}

.dashboard-body .logo {
    letter-spacing: -.08em;
}

.dashboard-body .nav-item.active,
.dashboard-body .mobile-nav .mobile-nav-active,
.dashboard-body .feed-tabs [aria-current="page"] {
    background: linear-gradient(120deg,#28333c,#24283e);
    color: var(--media-accent);
    box-shadow: inset 0 0 0 1px rgba(205,248,144,.16);
}

.dashboard-body .nav-item:hover,
.dashboard-body .action-button:hover {
    background: #293048;
}

.dashboard-body .post-card,
.dashboard-body .composer-card,
body.dashboard-body.profile-page .profile-card {
    border-radius: 18px;
    border-color: var(--media-line);
    background: linear-gradient(145deg,#191e31,var(--media-panel) 58%);
}

.dashboard-body .post-card:hover {
    border-color: rgba(178,167,255,.35);
}

.dashboard-body .post-menu-panel {
    background: #222a43;
}

.dashboard-body .action-button {
    background: rgba(205,213,255,.075);
    color: #dce2f6;
}

.dashboard-body .action-button[aria-current="page"],
.dashboard-body .action-button[aria-pressed="true"] {
    color: var(--media-accent);
}

.dashboard-body .action-button.is-liked {
    color: #ff9bc5;
}

.dashboard-body .share-button,
.dashboard-body .follow-button:not(.following) {
    background: linear-gradient(135deg,#dcffa7,#b3ed7b);
    color: #131e16;
    box-shadow: 0 7px 20px rgba(157,244,99,.12);
}

.dashboard-body :focus-visible {
    outline-color: var(--media-focus);
}

.dashboard-body .chat-shell,
.dashboard-body .chat-panel {
    background: #141928;
}

.dashboard-body .chat-contact.current,
.dashboard-body .chat-contact:hover {
    background: #282f48;
}

.dashboard-body .chat-message {
    background: #232b41;
    border-color: #383f56;
}

.dashboard-body .chat-message-mine {
    background: #2e3b34;
    border-color: #496048;
}

.dashboard-body .chat-compose textarea,
.dashboard-body .chat-inbox-search input,
.dashboard-body .chat-thread-search input,
.dashboard-body .edit-field input,
.dashboard-body .edit-field textarea,
.dashboard-body .edit-field select {
    background: #101624;
    color: #f2f4ff;
}

.dashboard-body .notice {
    border-radius: 12px;
}

.feature-disclosure {
    margin-top: 12px;
}

.feature-disclosure > summary {
    cursor: pointer;
    font-weight: 700;
}

.feature-disclosure[open] > summary {
    margin-bottom: 12px;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid var(--media-line);
    border-radius: 999px;
    background: #222a40;
    color: #e0e5ff;
    font-size: 12px;
}

.feature-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-block: 12px;
}

.feature-check input {
    accent-color: var(--media-accent);
}

.feature-callout {
    padding: 13px;
    margin: 12px 0;
    background: #212942;
    border: 1px solid var(--media-line);
    border-radius: 12px;
    overflow-wrap: anywhere;
}

.feature-callout a {
    color: var(--media-violet);
    display: block;
    margin: 10px 0;
}

.event-list {
    display: grid;
    gap: 9px;
}

.event-list article {
    display: grid;
    gap: 6px;
    padding: 11px 13px;
    border-inline-start: 2px solid var(--media-violet);
    border-radius: 8px;
    background: #20273d;
}

.event-list p {
    margin: 0;
    color: var(--media-mist);
}

.event-list time {
    color: var(--media-violet);
    font-size: 12px;
    font-weight: 700;
}

.security-device {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 9px;
    padding: 12px 0;
    border-bottom: 1px solid var(--media-line);
}

.security-device small {
    display: block;
    margin-top: 3px;
    color: var(--media-mist);
}

.security-device .post-tools {
    margin: 0;
}

.security-code-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 7px;
}

.security-code-grid code {
    padding: 8px;
    background: #111726;
    color: var(--media-accent);
    font-size: clamp(10px,2vw,14px);
    overflow-wrap: anywhere;
    border-radius: 8px;
    user-select: all;
}

.recovery-page {
    width: min(100% - 28px,500px);
    margin: max(20px,8vh) auto;
}

.discovery-bar {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.discovery-bar a {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 3px 10px;
    min-height: 78px;
    padding: 12px;
    border: 1px solid rgba(195,183,255,.23);
    border-radius: 16px;
    background: linear-gradient(135deg,#262449,#202640 60%,#1a2537);
    overflow: hidden;
}

.discovery-bar a:nth-child(2) {
    background: linear-gradient(135deg,#21343a,#213d40 65%,#253446);
}

.discovery-bar a:hover {
    border-color: var(--media-violet);
}

.discovery-bar span {
    display: grid;
    place-items: center;
    grid-row: 1 / 3;
    width: 40px;
    aspect-ratio: 1;
    border-radius: 13px;
    background: rgba(255,255,255,.1);
    color: #e1ddff;
}

.discovery-bar a:nth-child(2) span {
    color: var(--media-accent);
}

.discovery-bar strong {
    align-self: end;
    font-family: 'Space Grotesk',sans-serif;
    font-size: 17px;
}

.discovery-bar small {
    align-self: start;
    color: #c1c9e0;
    font-size: 11px;
}

.story-strip {
    display: flex;
    gap: 13px;
    padding: 5px 2px 13px;
    margin-bottom: 10px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.story-ring {
    display: grid;
    gap: 5px;
    justify-items: center;
    flex: 0 0 72px;
    min-width: 0;
}

.story-ring-image {
    display: grid;
    place-items: center;
    width: 59px;
    height: 59px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: linear-gradient(#1b2435,#1b2435) padding-box,
        linear-gradient(140deg,#caaffa,#75d7ae) border-box;
}

.story-ring.story-seen .story-ring-image {
    background: linear-gradient(#1b2435,#1b2435) padding-box,
        linear-gradient(#59627a,#59627a) border-box;
}

.story-ring .avatar {
    width: 47px;
    height: 47px;
}

.story-create .story-ring-image {
    font-size: 26px;
    color: var(--media-accent);
}

.story-ring small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e2e7fa;
}

.reel-preview {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin: 9px 0;
    border: 1px solid var(--media-line);
    border-radius: 13px;
    background: linear-gradient(110deg,#252c49,#2b2c48,#242f49);
}

.reel-preview span {
    display: grid;
    place-items: center;
    width: 35px;
    aspect-ratio: 1;
    border-radius: 11px;
    background: #444363;
    color: #ebe3ff;
}

.reel-preview small {
    color: var(--media-accent);
}

.media-toolbar,
.feed-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

[data-feed-load-status],
.media-status {
    color: var(--media-mist);
    font-size: 12px;
}

.media-status:empty {
    display: none;
}

.reel-stream {
    --reel-height: min(73dvh,700px);
    display: grid;
    gap: 14px;
    width: min(100%,420px);
    max-height: var(--reel-height);
    margin: 14px auto;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-snap-type: y mandatory;
    scrollbar-width: thin;
    border-radius: 19px;
}

.reel-frame {
    position: relative;
    isolation: isolate;
    height: var(--reel-height);
    min-height: 240px;
    aspect-ratio: 9 / 16;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    border-radius: 19px;
    border: 1px solid var(--media-line);
    background: #070910;
}

.reel-frame video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #080a12;
}

.reel-shade {
    position: absolute;
    inset: auto 0 34px;
    height: 35%;
    pointer-events: none;
    background: linear-gradient(0deg,#060713d4,transparent);
}

.reel-caption {
    position: absolute;
    inset: auto 72px 48px 12px;
    color: #f7f9ff;
    pointer-events: none;
}

.reel-caption p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    margin: 7px 0 0;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.reel-caption a {
    pointer-events: auto;
}

.reel-author,
.story-author {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-wrap: anywhere;
}

.reel-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
}

.reel-actions {
    position: absolute;
    display: grid;
    gap: 8px;
    bottom: 52px;
    inset-inline-end: 9px;
}

.reel-actions form {
    margin: 0;
}

.reel-action {
    display: grid;
    justify-items: center;
    align-content: center;
    min-width: 43px;
    min-height: 43px;
    padding: 4px 7px;
    color: #fdfaff;
    border: 1px solid rgba(229,228,255,.22);
    border-radius: 13px;
    background: rgba(17,20,35,.74);
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 21px;
}

.reel-action small {
    font-size: 10px;
}

.reel-action[aria-pressed="true"] {
    color: #ff9bc5;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(130px,1fr));
    gap: 13px;
}

.story-tile {
    display: grid;
    gap: 7px;
    padding: 5px;
    border: 1px solid #656398;
    border-radius: 15px;
    background: #1d233b;
}

.story-tile.story-seen {
    border-color: var(--media-line);
}

.story-tile-media {
    display: grid;
    place-items: center;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    border-radius: 11px;
    background: linear-gradient(155deg,#3f345c,#273c59);
    color: #eae2ff;
    font-size: 23px;
}

.story-tile-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-tile-label {
    padding: 0 5px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: min(100%,420px);
    height: min(72dvh,680px);
    min-height: 250px;
    margin: 12px auto;
    overflow: hidden;
    background: #080a12;
    border: 1px solid var(--media-line);
    border-radius: 19px;
}

.story-stage > img,
.story-stage > video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.story-heading {
    position: absolute;
    z-index: 2;
    inset: 12px 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 8px 14px;
    background: linear-gradient(180deg,#090b19e6,transparent);
}

.story-heading .story-author {
    min-width: 0;
    margin-inline-end: auto;
}

.story-heading strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-meter {
    position: absolute;
    z-index: 3;
    inset: 8px 8px auto;
    height: 3px;
    overflow: hidden;
    border-radius: 9px;
    background: #999aab7d;
}

.story-meter span {
    display: block;
    width: 100%;
    height: 100%;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left;
}

.story-caption {
    position: absolute;
    z-index: 2;
    inset: auto 12px 48px;
    padding: 8px 10px;
    background: #111526c7;
    border-radius: 10px;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.story-pager {
    justify-content: center;
}

.offline-page {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    margin: 0;
    background: #111425;
    color: #f3f5ff;
    font-family: system-ui,sans-serif;
    text-align: center;
}

.offline-page a {
    color: var(--media-accent);
}

.offline-page img {
    border-radius: 16px;
}

@media (max-width: 740px) {
    .dashboard-body .mobile-nav {
        background: #151927f5;
        border-top-color: var(--media-line);
    }

    .discovery-bar a {
        padding: 9px;
        gap: 3px 7px;
    }

    .discovery-bar span {
        width: 32px;
        border-radius: 10px;
    }

    .discovery-bar strong {
        font-size: 15px;
    }

    .reel-stream {
        --reel-height: clamp(255px,64dvh,600px);
        scrollbar-width: none;
    }

    .story-grid {
        grid-template-columns: repeat(auto-fill,minmax(110px,1fr));
        gap: 9px;
    }

    .story-heading .action-button {
        padding-inline: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reel-stream {
        scroll-snap-type: y proximity;
    }
}

.reel-tap-zone {
    position: absolute;
    z-index: 1;
    inset: 0 0 45px;
    background: transparent;
    border: 0;
    padding: 0;
    touch-action: manipulation;
    cursor: pointer;
}
.reel-caption,
.reel-actions {
    z-index: 2;
}
.reel-like-flash {
    position: absolute;
    z-index: 3;
    inset: 50% auto auto 50%;
    transform: translate(-50%,-50%);
    font-size: clamp(56px,16vw,100px);
    color: #ff8bbf;
    opacity: 0;
    pointer-events: none;
}
.reel-like-visible {
    animation: reel-heart-pop .7s ease both;
}
@keyframes reel-heart-pop {
    0% { opacity: 0; scale: .55; }
    30%,65% { opacity: 1; scale: 1; }
    100% { opacity: 0; scale: 1.12; }
}
.reel-comments-dialog {
    width: min(94vw,500px);
    max-height: min(70dvh,620px);
    padding: 0;
    color: var(--text);
    background: #171d2e;
    border: 1px solid var(--media-line);
    border-radius: 18px;
    overflow: hidden;
}
.reel-comments-dialog::backdrop {
    background: #090b16a0;
}
.reel-comments-dialog header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-bottom: 1px solid var(--media-line);
}
.reel-comments-dialog h2 {
    margin: 0;
    font-size: 17px;
}
.reel-comments-dialog [data-reel-comment-status] {
    padding: 0 15px;
    font-size: 13px;
}
.reel-comments-scroll {
    max-height: min(56dvh,490px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 15px 13px;
}
.reel-comments-dialog .comment-disclosure > summary {
    display: none;
}
@media (max-width: 680px) {
    .reel-comments-dialog {
        width: 100%;
        max-width: 100%;
        inset: auto 0 0;
        margin: 0;
        border-radius: 19px 19px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
}
