:root {
    color-scheme: dark;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    color: #f8f7ff;
    background: #0d0e17;
    --muted: #a6a8bd;
    --outline: #28293b;
    --purple: #cc93ff;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at top left, #171427, transparent 54%), #0d0e17; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
h2, h3, p { margin: 0; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }
.dashboard-icon { display: inline-block; width: 1.5rem; height: 1.5rem; flex: none; vertical-align: middle; }

.topbar {
    min-height: 79px;
    display: grid;
    grid-template-columns: 21% auto 1fr;
    align-items: stretch;
    padding: 0 clamp(14px, 2vw, 36px);
    background: linear-gradient(105deg, #2d2049, #151522 34%, #10111a);
    border-bottom: 1px solid var(--outline);
}
.brand, .header-actions, .account { display: flex; align-items: center; }
.brand { gap: 15px; font-size: clamp(1.1rem, 1.65vw, 1.7rem); font-weight: 750; letter-spacing: -.045em; white-space: nowrap; }
.brand sup { font-size: .55rem; color: var(--muted); }
.brand-mark {
    padding-right: 5px;
    color: #b668fb;
    background: linear-gradient(#d37cff, #873fe5);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 3.1rem;
    line-height: 1;
    font-weight: 950;
    font-style: italic;
    letter-spacing: -.12em;
}
.top-nav { display: flex; gap: clamp(2px, 1.8vw, 32px); }
.top-nav a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: clamp(64px, 4.8vw, 80px);
    font-weight: 500;
}
.top-nav .dashboard-icon { width: 29px; height: 29px; color: #c4c7da; }
.top-nav a[aria-current] {
    background: radial-gradient(ellipse at bottom, #7940bfa6, transparent 77%);
    box-shadow: inset 0 -2px #b66dff;
}
.top-nav a[aria-current] .dashboard-icon { color: #f2c0ff; filter: drop-shadow(0 0 6px #b852ff); }
.header-actions { justify-content: flex-end; gap: clamp(12px, 1.8vw, 30px); padding-left: 16px; }
.search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 394px);
    padding: 9px 15px;
    color: var(--muted);
    border: 1px solid #3b3c50;
    border-radius: 99px;
    white-space: nowrap;
    overflow: hidden;
}
.search span { overflow: hidden; text-overflow: ellipsis; }
.notifications { position: relative; color: #c4c7da; }
.notifications > span { position: absolute; right: 0; top: 0; width: 10px; height: 10px; border-radius: 50%; background: #fa4899; }
.account { gap: 6px; }
.account > .dashboard-icon { width: 17px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; background: #ee3f92; font-size: .875rem; font-weight: 700; line-height: 1.1; }
.message-count { position: absolute; top: 10px; right: -2px; padding-inline: 7px; }

.dashboard {
    display: grid;
    grid-template-columns: minmax(185px, 20.4fr) minmax(0, 47.6fr) minmax(280px, 29fr);
    align-items: start;
    gap: clamp(14px, 1.4vw, 24px);
    padding: 14px;
    max-width: 1900px;
    margin-inline: auto;
}
main, .discovery { min-width: 0; }
.sidebar, .panel {
    border: 1px solid var(--outline);
    border-radius: 22px;
    background: linear-gradient(145deg, #141622, #191a28);
}
.sidebar { padding: 20px 12px 26px; border-color: #191a29; }
.profile { display: flex; align-items: center; gap: 14px; padding: 0 9px; }
.profile strong, .profile div > span { display: block; }
.profile strong { font-size: 1.25rem; margin-bottom: 4px; }
.profile div { flex: 1; min-width: 0; }
.profile div > span { font-size: .975rem; }
.level-bar { height: 14px; max-width: 170px; margin-top: 13px; border-radius: 99px; background: #342b49; }
.level-bar::before { content: ""; display: block; width: 72%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9747ef, #ba63f5); }

.avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: var(--avatar, 48px);
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 50%;
    background: radial-gradient(circle at 70% 20%, #483563, #252338 72%) padding-box,
        linear-gradient(145deg, #b845f7, #f96ec6 55%, #ffd3ad) border-box;
    color: #c8b6e6;
}
.avatar .dashboard-icon { width: 42%; height: 42%; }
.profile .avatar { --avatar: clamp(55px, 6vw, 100px); }
.account .avatar { --avatar: 44px; border-color: #4a3d5c; }
.verified { display: inline-grid; place-items: center; vertical-align: 2px; width: 19px; height: 19px; background: #7dc5ff; color: #19334e; font-size: .78rem; border-radius: 38%; }

.side-nav { display: grid; gap: 2px; margin: 23px 0 27px; }
.side-nav a { display: flex; align-items: center; gap: 16px; min-height: 44px; padding: 8px 13px 8px 16px; border-radius: 12px; font-size: 1.1rem; }
.side-nav a[aria-current] { background: #3b2f61; position: relative; }
.side-nav a[aria-current]::before { content: ""; position: absolute; left: -14px; height: 70%; width: 2px; background: #efb2ff; box-shadow: 0 0 12px #cc81ff; }
.side-nav .dashboard-icon { color: #d3d4e4; }
.side-nav .badge { margin-left: auto; }
.purple-badge { background: linear-gradient(#682bd0, #451690); }

.premium {
    padding: 20px;
    border: 1px solid #b353f0;
    border-radius: 22px;
    color: #ffdadc;
    background: radial-gradient(ellipse at top left, #402644, transparent 60%), #191926;
    box-shadow: inset 0 0 20px #ac44e44a, 0 0 19px #a13dea33;
}
.premium h2 { display: flex; align-items: center; gap: 12px; color: #ffe3a7; font-size: 1.45rem; }
.premium h2 .dashboard-icon { width: 40px; height: 40px; color: #ffbcdb; fill: #bc397b; filter: drop-shadow(0 0 7px #f656a5); }
.premium ul { display: grid; gap: 9px; list-style: none; padding: 0; margin: 15px 0; }
.premium li { display: flex; align-items: center; gap: 10px; }
.premium li .dashboard-icon { color: #ffcaad; width: 20px; }
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 6px clamp(14px, 1.7vw, 29px);
    border: 1px solid #8247d6;
    border-radius: 99px;
    background: #6134b3;
    color: #fff;
    box-shadow: inset 0 0 13px #a35af49c, 0 0 12px #7940d040;
    font-weight: 650;
    white-space: nowrap;
}
.premium .pill { width: 100%; min-height: 46px; background: linear-gradient(110deg, #b65bf0, #6235b6 82%); border-color: #bd70ee; }

.stories { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; padding: 22px 5px 25px; }
.stories a { display: grid; justify-items: center; align-content: end; gap: 7px; white-space: nowrap; }
.stories .avatar { --avatar: min(86px, 100%); box-shadow: 0 0 13px #f147bd33; }
.stories .add-story { --avatar: min(76px, 100%); border-color: #807297; background: #292937; color: #fff; box-shadow: none; margin-bottom: 5px; }

.post { padding: 16px 17px 0; margin-bottom: 17px; background: linear-gradient(140deg, #1c1d2a, #181926); }
.post-detail { padding-bottom: 16px; }
.post-header { display: flex; align-items: center; gap: 15px; }
.post-header .avatar { --avatar: 60px; }
.post-header .more { margin-left: auto; padding: 6px; align-self: flex-start; }
.metadata { display: block; margin-top: 4px; color: var(--muted); }
.metadata .dashboard-icon { width: 17px; height: 17px; }
.post p { margin: 7px 0 12px; font-size: 1.125rem; }
.gallery { display: grid; overflow: hidden; gap: 2px; border-radius: 15px; aspect-ratio: 2.07; grid-template-columns: 1fr 1fr; }
.gallery-3 { grid-template-columns: 7fr 3fr; grid-template-rows: repeat(2, minmax(0, 1fr)); }
.gallery-3 > :first-child { grid-row: span 2; }
.gallery-6, .gallery-9 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-6 { aspect-ratio: 2.25; grid-template-rows: repeat(2, minmax(0, 1fr)); }
.gallery-9 { aspect-ratio: 1.5; grid-template-rows: repeat(3, minmax(0, 1fr)); }
.gallery > img, .gallery-photo > img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.gallery-photo { position: relative; min-width: 0; min-height: 0; }
.gallery-photo-count {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgb(0 0 0 / 55%);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}
[data-photo-gallery] .gallery-photo { cursor: zoom-in; }
.gallery-photo:focus-visible { outline-offset: -3px; }
.photo-viewer {
    max-width: calc(100% - 24px);
    max-height: calc(100% - 24px);
    padding: 10px;
    border: 1px solid #454356;
    border-radius: 15px;
    background: #181926;
    color: #fff;
}
.photo-viewer::backdrop { background: #000c; }
.photo-viewer-frame { position: relative; }
.photo-viewer-frame > img { display: block; max-width: 100%; max-height: calc(100dvh - 48px); }
.photo-viewer-frame > form { position: absolute; top: 8px; right: 8px; }
.photo-viewer-arrow { position: absolute; top: 50%; transform: translateY(-50%); }
.photo-viewer-arrow[data-photo-previous] { left: 8px; }
.photo-viewer-arrow[data-photo-next] { right: 8px; }
.photo-viewer button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #777489;
    border-radius: 50%;
    background: #28273a;
    color: inherit;
    font-family: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.photo-viewer button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.media-placeholder { display: grid; place-items: center; color: #cfb4e7; background: radial-gradient(ellipse at 22% 20%, #694279, transparent 67%), linear-gradient(145deg, #29263f, #1b233c); }
.media-placeholder:nth-child(2) { background: radial-gradient(ellipse at 90% 0, #804879, transparent 75%), linear-gradient(140deg, #352345, #222b4c); }
.media-placeholder:nth-child(3) { background: radial-gradient(ellipse at 25% 100%, #74435e, transparent 76%), #32223b; }
.media-placeholder > .dashboard-icon { width: clamp(26px, 4vw, 62px); height: auto; opacity: .63; }
.post-actions { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 40px); min-height: 59px; padding-inline: 7px; }
.post-actions a { display: flex; align-items: center; gap: 7px; }
.post-actions .dashboard-icon { width: 29px; height: 29px; color: #c0c3d7; }
.post-actions .like { color: #ffb1d6; }
.post-actions .like .dashboard-icon { color: #fb499b; fill: currentColor; }
.post-actions a:last-child { margin-left: auto; }

.discovery { display: grid; gap: 17px; padding-top: 4px; }
.discovery .panel { padding: 16px 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.panel-heading a { color: var(--purple); white-space: nowrap; }
.suggestions { display: grid; gap: 11px; padding-inline: 8px 4px; }
.suggestion { display: flex; align-items: center; gap: clamp(8px, 1.2vw, 20px); }
.suggestion .avatar { --avatar: clamp(44px, 4vw, 66px); }
.suggestion .pill { margin-left: auto; }
.suggestion .metadata, .event .metadata { color: #d4d5e6; font-size: .94rem; }
.streams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stream { position: relative; min-width: 0; aspect-ratio: 1.07; min-height: 146px; border-radius: 16px; overflow: hidden; }
.stream-status { position: absolute; top: 10px; left: 8px; display: flex; align-items: center; gap: 4px; }
.stream-status .badge { border-radius: 8px; background: #f73d79; }
.viewers { background: #15101ac9; color: #fff; border-radius: 99px; padding: 3px 7px; font-size: .875rem; }
.stream-details { position: absolute; inset: auto 0 0; display: flex; align-items: center; gap: 8px; padding: 24px 9px 9px; background: linear-gradient(transparent, #101019 78%); color: #fff; }
.stream-details .avatar { --avatar: 34px; }
.stream-details small { display: block; margin-top: 3px; color: #d2cfe1; font-size: .875rem; }
.event { display: grid; grid-template-columns: minmax(65px, 29%) minmax(0, 1fr) auto; gap: clamp(8px, 1.2vw, 20px); align-items: center; padding-block: 6px; }
.event-image { aspect-ratio: 1; border-radius: 13px; }
.event-details h3 { margin-bottom: 9px; }
.event-details .metadata + .metadata { margin-top: 7px; }
.event .pill { padding-inline: clamp(12px, 1.5vw, 25px); }
.pill:hover, .media-placeholder:hover { filter: brightness(1.15); }
.side-nav a:hover { background-color: #34294e; }
.panel-heading a:hover { text-decoration: underline; }

@media (max-width: 1300px) {
    .suggestions { padding-inline: 0; }
    .event { grid-template-columns: 65px minmax(0, 1fr); }
    .event .pill { grid-column: 2; justify-self: start; }
    .side-nav a { gap: 9px; padding-inline: 9px; }
}

@media (max-width: 1050px) {
    .topbar { grid-template-columns: auto 1fr auto; gap: 12px; }
    .top-nav { justify-content: center; }
    .header-actions { padding-left: 0; }
    .search { width: auto; border: 0; padding: 0; }
    .search span { display: none; }
    .dashboard { grid-template-columns: minmax(190px, 26%) minmax(0, 1fr); }
    .discovery { grid-column: 2; }
    .stream { aspect-ratio: 1.4; }
}

@media (max-width: 700px) {
    .topbar { grid-template-columns: 1fr auto; gap: 0; padding-top: 8px; }
    .brand-mark { font-size: 2.35rem; }
    .top-nav { grid-area: 2 / 1 / auto / -1; justify-content: space-between; gap: 0; min-height: 61px; }
    .top-nav a { flex: 1; min-width: 0; font-size: .8rem; }
    .top-nav .dashboard-icon { width: 23px; height: 23px; }
    .message-count { top: 3px; right: 2px; }
    .account .avatar { --avatar: 32px; }
    .account > .dashboard-icon { display: none; }
    .dashboard { grid-template-columns: minmax(0, 1fr); padding: 10px; }
    .discovery { grid-column: auto; }
    .sidebar { grid-row: 3; }
    .stories { grid-template-columns: repeat(7, minmax(60px, 1fr)); overflow-x: auto; padding-block: 10px 14px; }
    .stories a { font-size: .85rem; }
    .stories .avatar { --avatar: 52px; }
    .stories .add-story { --avatar: 47px; }
    .post { padding-inline: 12px; }
    .post-header .avatar { --avatar: 46px; }
}

.theme-toggle {
    display: grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--outline);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle[hidden],
[data-theme="dark"] [data-theme-icon="dark"],
[data-theme="light"] [data-theme-icon="light"] { display: none; }
.theme-toggle:hover { color: var(--purple); border-color: currentColor; }
.theme-toggle:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }

:root[data-theme="light"] {
    color-scheme: light;
    color: #242034;
    background: #f4f1fa;
    --muted: #565168;
    --outline: #ded6ec;
    --purple: #7136ba;
}
[data-theme="light"] body { background: radial-gradient(ellipse at top left, #eee4fb, transparent 54%), #f4f1fa; }
[data-theme="light"] .topbar { background: linear-gradient(105deg, #ebdcfb, #fdfaff 40%, #fff); }
[data-theme="light"] .brand-mark { background-image: linear-gradient(#843fce, #7136ba); }
[data-theme="light"] .sidebar,
[data-theme="light"] .panel { background: #fff; border-color: var(--outline); }
[data-theme="light"] .search { background: #fff; border-color: var(--outline); }
[data-theme="light"] .top-nav .dashboard-icon,
[data-theme="light"] .notifications,
[data-theme="light"] .side-nav .dashboard-icon,
[data-theme="light"] .post-actions .dashboard-icon { color: #544969; }
[data-theme="light"] .top-nav a[aria-current] { background: radial-gradient(ellipse at bottom, #e4cbfc, transparent 85%); }
[data-theme="light"] .top-nav a[aria-current] .dashboard-icon { color: var(--purple); filter: none; }
[data-theme="light"] .side-nav a:hover,
[data-theme="light"] .side-nav a[aria-current] { background: #ede2fc; }
[data-theme="light"] .level-bar { background: #e9def4; }
[data-theme="light"] .premium { background: linear-gradient(145deg, #f8e8ff, #fff8fc); color: #603b58; }
[data-theme="light"] .premium h2 { color: #714627; }
[data-theme="light"] .premium li .dashboard-icon { color: #8a4267; }
[data-theme="light"] .suggestion .metadata,
[data-theme="light"] .event .metadata { color: var(--muted); }
[data-theme="light"] .badge { color: #fff; background-color: #b92368; }
[data-theme="light"] .post-actions .like,
[data-theme="light"] .post-actions .like .dashboard-icon { color: #be2369; }

@media (max-width: 700px) {
    .header-actions { gap: 8px; }
    .brand { gap: 8px; }
    .theme-toggle { width: 32px; height: 32px; }
    .header-actions > a > .dashboard-icon { width: 20px; }
}

.community-profile-content { container-type: inline-size; padding-top: 8px; }
.community-card { margin-top: 16px; padding: clamp(20px, 5vw, 36px); }
.community-cover {
    height: clamp(150px, 42cqw, 280px);
    border-radius: 21px 21px 0 0;
}
.community-profile-details { padding: 0 clamp(16px, 4vw, 34px) 22px; }
.community-profile { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.community-profile .avatar {
    --avatar: clamp(86px, 15vw, 132px);
    position: relative;
    margin-top: -42px;
    box-shadow: 0 0 0 5px var(--outline);
}
.community-follow { font: inherit; font-weight: 700; cursor: pointer; }
.community-follow[hidden] { display: none; }
.community-follow[aria-pressed="true"] { background: transparent; color: var(--purple); border-color: currentColor; }
.community-follow:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
.community-profile-details h1 { margin: 16px 0 0; font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; }
.community-handle { color: var(--purple); margin-top: 4px; }
.community-bio { max-width: 58ch; margin-top: 14px; line-height: 1.6; }
.community-stats { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 18px 0 0; }
.community-stats div { display: flex; flex-direction: row-reverse; gap: 5px; }
.community-stats dt { color: var(--muted); }
.community-stats dd { margin: 0; font-weight: 700; }
.community-profile-nav {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(16px, 4vw, 32px);
    padding-inline: clamp(16px, 4vw, 34px);
    border-top: 1px solid var(--outline);
}
.community-profile-nav a { padding-block: 14px; font-weight: 700; }
.community-profile-nav a:hover { color: var(--purple); }
.community-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; gap: 20px; margin-top: 24px; }
.community-posts > h2 { margin-bottom: 12px; }
.community-post-title { margin: 14px 0 12px; }
.community-profile-sidebar { display: grid; gap: 16px; }
.community-profile-sidebar .community-card { margin: 0; padding: 18px; }
.community-profile-sidebar h2 { margin-bottom: 12px; }
.community-interests { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.community-interests li { padding: 5px 10px; border: 1px solid var(--outline); border-radius: 99px; color: var(--purple); font-size: .875rem; }
.community-engagement { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-block: 14px; color: var(--muted); }
.community-engagement .dashboard-icon { width: 18px; height: 18px; }
.community-engagement a { margin-left: auto; color: var(--purple); }
.community-link:hover { text-decoration: underline; }

@container (max-width: 670px) {
    .community-columns { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
