:root {
    color-scheme: dark;
    --bg: #111316;
    --bg-soft: #171b20;
    --panel: #20252c;
    --panel-2: #252b34;
    --line: #343c47;
    --text: #eef3f7;
    --muted: #9da8b5;
    --primary: #39d98a;
    --primary-2: #7dd3fc;
    --accent: #fbbf24;
    --rose: #f472b6;
    --danger: #fb7185;
    --shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(57, 217, 138, .14), transparent 34rem),
        linear-gradient(180deg, #15181d 0%, var(--bg) 30%, #0d0f12 100%);
    color: var(--text);
    font: 15px/1.5 "Segoe UI", Arial, sans-serif;
}

a {
    color: var(--primary-2);
    text-decoration: none;
}

a:hover {
    color: var(--primary);
}

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #12161b;
    color: var(--text);
    outline: none;
    padding: 11px 12px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(57, 217, 138, .12);
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 430px);
    gap: 34px;
    max-width: 1180px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 56px 24px;
    align-items: center;
}

.auth-hero {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(125, 211, 252, .25);
    border-radius: 8px;
    padding: 42px;
    background:
        linear-gradient(135deg, rgba(57, 217, 138, .16), transparent 36%),
        linear-gradient(145deg, rgba(125, 211, 252, .16), transparent 58%),
        linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01));
    box-shadow: var(--shadow);
}

.brand-lockup,
.topbar,
.brand,
.profile-card,
.profile-hero,
.feed-item,
.member-row,
.request-row,
.stats-row,
.tag-list {
    display: flex;
    align-items: center;
}

.brand-lockup {
    gap: 18px;
}

.auth-brand-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    margin-bottom: 30px;
    padding: 8px 12px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    background: rgba(57, 217, 138, .07);
    box-shadow: 0 0 0 1px rgba(57, 217, 138, .1), 0 16px 34px rgba(0, 0, 0, .22);
}

.auth-brand-card .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 14px;
    box-shadow: none;
}

.auth-brand-card strong {
    font-size: 18px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #071014;
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: 0 12px 30px rgba(57, 217, 138, .2);
}

.brand-mark.small {
    width: 36px;
    height: 36px;
    font-size: 13px;
}

.eyebrow {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-size: 12px;
}

.auth-hero h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(42px, 7vw, 76px);
    line-height: .95;
    letter-spacing: 0;
}

.lead {
    max-width: 570px;
    margin: 22px 0;
    color: #c5d0da;
    font-size: 20px;
}

.auth-hero .lead:not(.fresh-lead) {
    display: none;
}

.auth-teasers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 4px 0 24px;
}

.auth-teasers span {
    min-height: 78px;
    padding: 13px;
    border: 1px solid rgba(125, 211, 252, .22);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(57, 217, 138, .12), transparent 62%),
        rgba(18, 22, 27, .74);
    color: #eef3f7;
    font-weight: 800;
}

.stats-row {
    gap: 12px;
    flex-wrap: wrap;
}

.stats-row span,
.tag-list span {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    padding: 8px 12px;
}

.stats-row strong {
    color: var(--primary);
}

.legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.legal-links a {
    color: #dce5ec;
    border-bottom: 1px solid rgba(125, 211, 252, .45);
}

.auth-panels {
    display: grid;
    gap: 16px;
}

.auth-panels > .compact-panel {
    display: none;
}

.panel,
.mini-panel,
.profile-card,
.profile-hero,
.install-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--panel), #1b2027);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

.panel:nth-of-type(3n + 1),
.mini-panel:nth-of-type(3n + 1) {
    border-top-color: rgba(57, 217, 138, .45);
}

.panel:nth-of-type(3n + 2),
.mini-panel:nth-of-type(3n + 2) {
    border-top-color: rgba(125, 211, 252, .45);
}

.panel:nth-of-type(3n + 3),
.mini-panel:nth-of-type(3n + 3) {
    border-top-color: rgba(251, 191, 36, .45);
}

.panel {
    padding: 20px;
}

.compact-panel {
    background: linear-gradient(180deg, #241f2a, #1b2027);
}

.auth-login-panel {
    border-color: rgba(57, 217, 138, .34);
}

.password-reset-inline {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.password-reset-inline summary {
    cursor: pointer;
    color: var(--primary-2);
    font-weight: 800;
}

.password-reset-inline form {
    margin-top: 12px;
}

.panel form,
form.panel {
    display: grid;
    gap: 14px;
}

.button,
button {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #2a313b;
    color: var(--text);
    cursor: pointer;
    padding: 10px 14px;
    font-weight: 700;
}

.button.primary,
button.primary {
    border-color: rgba(57, 217, 138, .35);
    background: linear-gradient(180deg, var(--primary), #26b978);
    color: #06120d;
}

.button.danger,
button.danger {
    border-color: rgba(251, 113, 133, .45);
    background: linear-gradient(180deg, var(--danger), #dc3551);
    color: #fff;
}

.danger-panel {
    border-color: rgba(251, 113, 133, .45);
    background:
        linear-gradient(135deg, rgba(251, 113, 133, .12), transparent 44%),
        linear-gradient(180deg, var(--panel), #1b2027);
}

.button:not(.primary):hover,
button:not(.primary):hover {
    border-color: rgba(125, 211, 252, .55);
}

.button:hover,
button:hover {
    transform: translateY(-1px);
}

.hint,
.muted,
time,
small {
    color: var(--muted);
}

.notice {
    border-radius: 6px;
    padding: 12px 14px;
    background: rgba(125, 211, 252, .12);
    border: 1px solid rgba(125, 211, 252, .25);
}

.notice.success,
.success {
    background: rgba(57, 217, 138, .12);
    border-color: rgba(57, 217, 138, .25);
    color: #b9f7d4;
}

.notice.error,
.error {
    background: rgba(251, 113, 133, .12);
    border-color: rgba(251, 113, 133, .25);
    color: #fecdd3;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    justify-content: space-between;
    gap: 18px;
    min-height: 66px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(17, 19, 22, .92);
    backdrop-filter: blur(16px);
}

.brand {
    gap: 10px;
    color: var(--text);
    font-weight: 800;
    border: 2px solid var(--primary);
    border-radius: 9px;
    padding: 7px 10px;
    background: rgba(57, 217, 138, .06);
    box-shadow: 0 0 0 1px rgba(57, 217, 138, .08), 0 12px 26px rgba(0, 0, 0, .18);
}

.search {
    display: flex;
    gap: 8px;
    max-width: 430px;
    width: 100%;
}

.topbar nav {
    display: flex;
    gap: 14px;
}

.layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 280px;
    gap: 18px;
    max-width: 1360px;
    margin: 0 auto;
    padding: 24px;
}

.sidebar,
.rightbar,
.content {
    display: grid;
    gap: 16px;
    align-content: start;
}

.profile-card {
    flex-direction: column;
    text-align: center;
    padding: 22px;
}

.profile-card h2 {
    margin: 12px 0 2px;
}

.avatar {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: var(--avatar);
    color: #071014;
    font-weight: 900;
}

.avatar.xl {
    width: 96px;
    height: 96px;
    font-size: 38px;
}

.avatar.tiny {
    width: 34px;
    height: 34px;
    font-size: 13px;
}

.image-avatar {
    object-fit: cover;
    display: block;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary);
    margin-right: 7px;
    box-shadow: 0 0 14px var(--primary);
}

.mini-panel {
    padding: 16px;
}

.mini-panel h3 {
    margin-bottom: 12px;
}

.mini-panel form {
    display: grid;
    gap: 10px;
}

.mini-panel textarea {
    min-height: 84px;
}

.invite-panel {
    border-color: rgba(125, 211, 252, .35);
    background:
        linear-gradient(135deg, rgba(125, 211, 252, .12), transparent 42%),
        linear-gradient(180deg, var(--panel), #1b2027);
}

.contact-panel {
    border-color: rgba(244, 114, 182, .32);
    background:
        linear-gradient(135deg, rgba(244, 114, 182, .10), transparent 42%),
        linear-gradient(180deg, var(--panel), #1b2027);
}

.sidebar .invite-panel,
.sidebar .contact-panel,
.rightbar .online-panel {
    display: none;
}

.share-community {
    margin-top: 10px;
}

.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mini-stats span {
    display: grid;
    gap: 2px;
    padding: 10px;
    border-radius: 6px;
    background: #151a20;
    text-align: center;
    font-weight: 800;
}

.compose h1 {
    margin-bottom: 14px;
}

.compose form {
    display: grid;
    gap: 12px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: -4px;
}

.editor-toolbar button {
    min-width: 36px;
    min-height: 32px;
    padding: 6px 10px;
    border-color: #3a4552;
    background: #151a20;
    color: #dce5ec;
    font-size: 13px;
}

.editor-toolbar button:hover {
    border-color: var(--primary);
    background: #1d2630;
}

.feed {
    display: grid;
    gap: 12px;
}

.feed-item {
    align-items: flex-start;
    gap: 12px;
}

.feed-body {
    width: 100%;
    min-width: 0;
}

.feed-item.panel {
    padding: 16px;
}

.feed-name {
    display: inline-block;
    font-weight: 800;
    color: var(--text);
}

.feed-item time {
    display: block;
    font-size: 12px;
}

.feed-item p {
    margin: 8px 0 0;
    color: #dce5ec;
}

.post-image-upload {
    padding: 10px;
    border: 1px dashed rgba(125, 211, 252, .35);
    border-radius: 6px;
    background: rgba(125, 211, 252, .06);
}

.post-image-upload small {
    display: block;
    margin-top: 4px;
}

.post-image-frame {
    display: inline-block;
    margin-top: 12px;
    max-width: min(100%, 420px);
}

.post-image {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0f1318;
}

.post-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.post-actions form {
    margin: 0;
}

.reaction-button {
    min-height: 32px;
    padding: 6px 10px;
    border-color: rgba(57, 217, 138, .32);
    background: rgba(57, 217, 138, .08);
    color: #c8f7dd;
    font-size: 13px;
}

.reaction-button.bad {
    border-color: rgba(251, 113, 133, .32);
    background: rgba(251, 113, 133, .08);
    color: #fecdd3;
}

.reaction-button.active {
    background: var(--primary);
    color: #06120d;
}

.reaction-button.bad.active {
    background: var(--danger);
    color: #fff;
}

.post-share {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.post-share a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #151a20;
    color: #dce5ec;
    font-size: 13px;
    font-weight: 700;
}

.post-share a:hover {
    border-color: var(--primary-2);
    color: var(--primary-2);
}

.post-admin {
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding-top: 10px;
}

.post-admin summary {
    cursor: pointer;
    color: var(--primary-2);
    font-weight: 700;
}

.post-admin form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.post-admin textarea {
    min-height: 90px;
}

.feed-item blockquote {
    margin: 10px 0 0;
    padding: 8px 10px;
    border-left: 3px solid var(--primary);
    background: rgba(57, 217, 138, .08);
    color: #cfe7da;
}

.profile-hero {
    gap: 18px;
    justify-content: space-between;
    padding: 24px;
}

.profile-hero h1 {
    margin-bottom: 6px;
    font-size: 34px;
}

.tag-list {
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.tag-list span {
    font-size: 13px;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.body-copy {
    color: #dce5ec;
}

.profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.section-head h1 {
    margin-bottom: 0;
}

.admin-user-list {
    display: grid;
    gap: 12px;
}

.admin-user-card {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(18, 22, 27, .64);
}

.admin-user-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-user-card dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin: 0;
}

.admin-user-card dt {
    color: var(--muted);
    font-size: 12px;
}

.admin-user-card dd {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
    color: #eef3f7;
}

.admin-user-about {
    grid-column: 1 / -1;
}

.birthday-panel {
    border-color: rgba(251, 191, 36, .36);
    background:
        linear-gradient(135deg, rgba(251, 191, 36, .16), transparent 44%),
        linear-gradient(180deg, var(--panel), #1b2027);
}

.birthday-panel h1 {
    margin-bottom: 8px;
}

.birthday-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.check-row input {
    width: auto;
}

.member-row {
    gap: 10px;
    padding: 9px;
    border-radius: 6px;
    color: var(--text);
}

.member-row:hover {
    background: var(--panel-2);
}

.online-user {
    position: relative;
}

.online-user::after {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 12px var(--primary);
    margin-left: auto;
}

.member-row span:last-child {
    display: grid;
}

.request-row {
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
}

.request-row button {
    padding: 6px 9px;
}

.message-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.message-row:first-of-type {
    border-top: 0;
}

.message-row.unread {
    color: var(--text);
}

.message-row.unread a::after {
    content: " neu";
    color: var(--primary);
    font-size: 12px;
}

.message-row p {
    margin: 5px 0 0;
    color: #dce5ec;
}

.messages-center {
    padding: 0;
    overflow: hidden;
}

.messages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px;
    border-bottom: 1px solid var(--line);
}

.messages-header h1 {
    margin-bottom: 0;
}

.messages-header span {
    color: var(--muted);
}

.messages-layout {
    display: grid;
    grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
    min-height: 560px;
}

.conversation-list {
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 12px;
    border-right: 1px solid var(--line);
    background: rgba(0, 0, 0, .12);
}

.new-message-box {
    display: grid;
    gap: 9px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #151a20;
}

.new-message-box textarea {
    min-height: 76px;
}

.conversation-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    color: var(--text);
}

.conversation-item:hover,
.conversation-item.active {
    background: var(--panel-2);
}

.conversation-item span {
    display: grid;
    min-width: 0;
}

.conversation-item strong,
.conversation-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item b {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--primary);
    color: #06120d;
    font-size: 12px;
}

.chat-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chat-title div {
    display: grid;
    min-width: 0;
}

.chat-delete-form {
    margin-left: auto;
}

.chat-delete-form .button {
    width: auto;
    margin-top: 0;
    padding: 8px 11px;
    white-space: nowrap;
}

.message-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 16px;
    background: #14181e;
}

.bubble {
    max-width: min(72%, 620px);
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.bubble.own {
    align-self: flex-end;
    border-color: rgba(57, 217, 138, .28);
    background: rgba(57, 217, 138, .14);
}

.bubble.other {
    align-self: flex-start;
    background: #20262e;
}

.bubble p {
    margin: 0;
}

.bubble time {
    display: block;
    margin-top: 6px;
    font-size: 11px;
}

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

.reply-box textarea {
    min-height: 54px;
    max-height: 140px;
}

.empty-chat {
    display: grid;
    place-content: center;
    min-height: 420px;
    padding: 24px;
    text-align: center;
}

.install-app[hidden] {
    display: none;
}

.public-post {
    width: min(860px, calc(100% - 28px));
    margin: 34px auto;
}

.public-post-card {
    align-items: flex-start;
    padding: 22px;
}

.public-post-card .post-image-frame {
    max-width: 100%;
}

.mini-panel .button {
    display: inline-block;
    width: 100%;
    margin-top: 8px;
    text-align: center;
}

.install-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.legal-topbar {
    position: sticky;
}

.legal-shell {
    width: min(980px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.legal-document {
    padding: clamp(22px, 4vw, 42px);
}

.legal-document h1 {
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1;
    margin-bottom: 26px;
}

.legal-document h2 {
    margin-top: 28px;
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 20px;
}

.legal-document p,
.legal-document li {
    color: #dce5ec;
}

.legal-document ul {
    margin-top: 0;
    padding-left: 22px;
}

.install-box {
    width: min(520px, 100%);
    padding: 28px;
}

pre {
    white-space: pre-wrap;
    color: #fecdd3;
}

@media (max-width: 1050px) {
    .layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .rightbar {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .auth-shell,
    .layout,
    .two-column {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        min-height: 380px;
    }

    .auth-teasers {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search {
        max-width: none;
    }

    .profile-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .layout {
        padding: 14px;
    }

    .panel,
    .mini-panel,
    .profile-card,
    .profile-hero {
        border-radius: 6px;
    }

    .auth-shell {
        padding: 18px 12px;
    }

    .auth-hero {
        padding: 24px;
    }

    .auth-hero h1 {
        font-size: 42px;
    }

    .editor-toolbar button {
        min-width: 42px;
    }

    .messages-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .conversation-list {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        max-height: 260px;
        overflow-y: auto;
    }

    .message-thread {
        min-height: 360px;
    }

    .bubble {
        max-width: 88%;
    }

    .post-image-frame {
        max-width: 100%;
    }

    .post-image {
        max-height: 240px;
    }

    .reply-box {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .search {
        flex-direction: column;
    }

    .topbar nav {
        flex-wrap: wrap;
    }

    .profile-card {
        align-items: flex-start;
        text-align: left;
    }

    .stats-row span,
    .tag-list span {
        width: 100%;
    }
}
