:root {
    color-scheme: light;
    --bg: #f8fbff;
    --bg-soft: #eef7ff;
    --text: #07101f;
    --muted: #657083;
    --line: rgba(14, 23, 38, 0.12);
    --panel: rgba(255, 255, 255, 0.72);
    --panel-strong: rgba(255, 255, 255, 0.9);
    --shadow: 0 24px 80px rgba(41, 52, 86, 0.14);
    --shadow-soft: 0 12px 40px rgba(43, 58, 92, 0.1);
    --rainbow: linear-gradient(95deg, #ff695f 0%, #ffbf2f 21%, #3ed579 42%, #10a6f5 63%, #6438ff 82%, #b735ed 100%);
    --rainbow-soft: linear-gradient(135deg, rgba(255, 104, 95, 0.18), rgba(55, 212, 136, 0.13), rgba(95, 63, 255, 0.16));
    --purple: #7937ff;
    --blue: #128af3;
    --green: #22b85f;
    --pink: #fb3d87;
    --orange: #ff7b48;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --topbar-height: 76px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #060812;
    --bg-soft: #0b1020;
    --text: #f6f8ff;
    --muted: #a8b2c5;
    --line: rgba(255, 255, 255, 0.12);
    --panel: rgba(11, 16, 30, 0.66);
    --panel-strong: rgba(16, 21, 36, 0.88);
    --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
    --shadow-soft: 0 18px 44px rgba(0, 0, 0, 0.28);
    --rainbow-soft: linear-gradient(135deg, rgba(255, 104, 95, 0.16), rgba(18, 138, 243, 0.13), rgba(183, 53, 237, 0.17));
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background:
        linear-gradient(130deg, rgba(255, 255, 255, 0.96), rgba(246, 252, 255, 0.84) 34%, rgba(245, 241, 255, 0.78) 68%, rgba(255, 250, 246, 0.92)),
        linear-gradient(90deg, rgba(255, 92, 140, 0.1), rgba(30, 164, 244, 0.09), rgba(45, 214, 133, 0.08));
    transition: background 260ms ease, color 260ms ease;
}

[data-theme="dark"] body {
    background:
        linear-gradient(135deg, #050711 0%, #0a1020 37%, #101126 64%, #050711 100%),
        linear-gradient(90deg, rgba(253, 92, 120, 0.18), rgba(30, 164, 244, 0.16), rgba(150, 75, 255, 0.14));
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}

.glass-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0;
    font-size: 1.25rem;
}

.brand-mark {
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(125, 64, 255, 0.24));
}

.hero-logo {
    width: clamp(160px, 22vw, 300px);
    margin-inline: auto;
    filter: drop-shadow(0 28px 46px rgba(124, 70, 255, 0.28));
}

.rainbow-button {
    border: 0;
    border-radius: 18px;
    min-height: 54px;
    padding: 0 26px;
    color: #fff;
    font-weight: 800;
    background: var(--rainbow);
    box-shadow: 0 16px 36px rgba(120, 55, 255, 0.28);
    transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.rainbow-button:hover {
    transform: translateY(-1px);
    filter: saturate(112%);
    box-shadow: 0 20px 46px rgba(120, 55, 255, 0.36);
}

.rainbow-button:active {
    transform: translateY(0);
}

.rainbow-button.small {
    min-height: 42px;
    border-radius: 14px;
    padding: 0 18px;
    font-size: 0.92rem;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.44);
    color: var(--text);
    font-weight: 700;
}

[data-theme="dark"] .ghost-button {
    background: rgba(255, 255, 255, 0.06);
}

.field {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.88rem;
}

.field input,
.field textarea,
.field select,
.chat-compose input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    min-height: 54px;
    padding: 0 18px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.55);
    outline: 0;
    transition: border 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field textarea {
    padding-block: 16px;
    resize: vertical;
}

[data-theme="dark"] .field input,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .field select,
[data-theme="dark"] .chat-compose input {
    background: rgba(255, 255, 255, 0.06);
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.chat-compose input:focus {
    border-color: rgba(121, 55, 255, 0.58);
    box-shadow: 0 0 0 4px rgba(121, 55, 255, 0.12);
}

.form-message {
    min-height: 20px;
    color: var(--pink);
    font-size: 0.9rem;
    text-align: center;
}

.form-message.is-success {
    color: var(--green);
}

.theme-toggle,
.icon-theme-button {
    display: inline-grid;
    grid-auto-flow: column;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    min-height: 42px;
    padding: 4px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .icon-theme-button {
    background: rgba(255, 255, 255, 0.06);
}

.theme-toggle span,
.icon-theme-button span {
    min-width: 58px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

[data-theme="light"] .theme-sun,
[data-theme="dark"] .theme-moon {
    background: var(--panel-strong);
    color: var(--text);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.compact span {
    min-width: 44px;
}

.app-body {
    padding: 18px;
}

.app-topbar {
    position: sticky;
    top: 18px;
    z-index: 20;
    min-height: var(--topbar-height);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 14px 18px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.desktop-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 750;
    transition: background 180ms ease, color 180ms ease;
}

.desktop-nav a:hover,
.desktop-nav a.is-active {
    color: var(--text);
    background: rgba(121, 55, 255, 0.1);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-pill {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--rainbow);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(121, 55, 255, 0.22);
}

.avatar-pill img,
.avatar-ring img,
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-main {
    width: min(1240px, 100%);
    margin: 28px auto 110px;
}

.feed-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
}

.feed-column {
    display: grid;
    gap: 18px;
}

.stories-bar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(88px, 1fr);
    gap: 12px;
    overflow-x: auto;
    padding: 14px;
}

.stories-bar button {
    border: 0;
    background: transparent;
    color: var(--muted);
    display: grid;
    justify-items: center;
    gap: 8px;
    font-weight: 760;
}

.stories-bar span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--rainbow);
    box-shadow: 0 12px 28px rgba(121, 55, 255, 0.24);
}

.composer {
    padding: 18px;
}

.composer textarea {
    width: 100%;
    border: 0;
    outline: 0;
    resize: vertical;
    min-height: 110px;
    color: var(--text);
    background: transparent;
    font-size: 1rem;
}

.composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.post-feed {
    display: grid;
    gap: 18px;
}

.post-card {
    padding: 18px;
}

.post-card header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.avatar-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 2px;
    background: var(--rainbow);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    overflow: hidden;
}

.post-card header span {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
    margin-top: 2px;
}

.post-card p {
    color: var(--text);
    line-height: 1.65;
    margin: 0 0 14px;
}

.post-media {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--line);
    margin: 12px 0;
}

.post-card footer {
    display: flex;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.post-card footer button {
    border: 0;
    border-radius: 999px;
    padding: 9px 13px;
    color: var(--muted);
    background: rgba(121, 55, 255, 0.08);
    font-weight: 760;
}

.side-column {
    display: grid;
    gap: 18px;
    align-content: start;
}

.side-card {
    padding: 18px;
}

.side-card h2 {
    margin: 0 0 14px;
    font-size: 1.08rem;
}

.side-card a {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.side-card a:last-child {
    border-bottom: 0;
}

.side-card span,
.side-card p {
    color: var(--muted);
    line-height: 1.5;
}

.page-heading {
    margin: 8px 0 22px;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 4rem);
    letter-spacing: 0;
}

.page-heading p {
    color: var(--muted);
    max-width: 620px;
    font-size: 1.05rem;
    line-height: 1.6;
}

.discover-grid,
.resource-grid,
.admin-stat-grid,
.settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.discover-card,
.resource-card,
.stat-card {
    padding: 18px;
}

.discover-photo,
.resource-visual {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 4rem;
    font-weight: 900;
    background: var(--rainbow);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.discover-card h2,
.resource-card h2 {
    margin: 16px 0 8px;
}

.discover-card p,
.resource-card p {
    color: var(--muted);
    line-height: 1.55;
}

.discover-card span,
.resource-card span,
.resource-card b {
    display: block;
    color: var(--muted);
    margin-bottom: 14px;
}

.event-visual {
    aspect-ratio: 16 / 10;
    background:
        linear-gradient(135deg, rgba(255, 105, 95, 0.84), rgba(19, 166, 245, 0.8)),
        linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.28) 49%, transparent 51%);
}

.place-visual {
    aspect-ratio: 16 / 10;
    background:
        linear-gradient(135deg, rgba(62, 213, 121, 0.82), rgba(121, 55, 255, 0.86)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent);
}

.messages-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 18px;
    min-height: calc(100vh - 180px);
}

.thread-list,
.chat-panel {
    padding: 18px;
}

.thread-list h1 {
    margin: 0 0 16px;
}

.thread-list button {
    width: 100%;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 4px 12px;
    text-align: left;
    border: 0;
    border-radius: 16px;
    padding: 12px;
    color: var(--text);
    background: transparent;
}

.thread-list button:hover {
    background: rgba(121, 55, 255, 0.08);
}

.thread-list button span {
    grid-row: span 2;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--rainbow);
    color: #fff;
    font-weight: 900;
}

.thread-list small {
    color: var(--muted);
}

.chat-panel {
    display: grid;
    grid-template-rows: 1fr auto;
}

.chat-empty {
    display: grid;
    place-content: center;
    text-align: center;
    color: var(--muted);
}

.chat-empty h2 {
    color: var(--text);
}

.chat-compose {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) auto;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.profile-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 18px;
}

.profile-card,
.profile-editor {
    padding: 22px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 36px;
    margin-bottom: 18px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    font-size: 4rem;
    font-weight: 900;
    background: var(--rainbow);
}

.profile-card h1 {
    margin: 0 0 6px;
}

.profile-card p {
    color: var(--muted);
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-tags span {
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--muted);
    background: rgba(121, 55, 255, 0.08);
}

.profile-editor form {
    display: grid;
    gap: 14px;
}

.profile-photos {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 18px;
}

.profile-photos img {
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 14px;
}

.admin-table {
    overflow: auto;
    padding: 8px;
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.admin-table th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.stat-card {
    display: grid;
    gap: 10px;
}

.stat-card span {
    color: var(--muted);
}

.stat-card strong {
    font-size: 3rem;
}

.mobile-bottom-nav {
    display: none;
}

code {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
}

