body.public-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.public-page > main.public-content {
    flex: 1 0 auto;
}

body.public-page > footer {
    margin-top: auto;
}

main, main.container, .container {
    width: min(96vw, 1760px);
    max-width: none;
    margin: 18px auto;
    padding: 20px;
    min-width: 0;
    overflow-x: hidden;
    overflow-x: clip;
}

.public-content {
    display: grid;
    gap: 18px;
    min-width: 0;
    max-width: 100%;
}

.public-page header,
.public-page footer,
body:not(.member-shell-page):not(.acp):not(.admin) > header,
body:not(.member-shell-page):not(.acp):not(.admin) > footer {
    width: min(96vw, 1760px);
    max-width: none;
    margin: 18px auto;
    padding: 0 20px;
}

.center-frame {
    width: min(94vw, 460px);
    margin: 80px auto;
    padding: 24px;
}

.page-content { max-width: 900px; min-width: 0; }
.account-panel { display: grid; gap: 14px; }
.account-nav { border-bottom: 1px solid var(--tgb-border); padding-bottom: 12px; }

.public-home-intro,
.portal-dashboard {
    display: grid;
    gap: 18px;
    min-width: 0;
    max-width: 100%;
}
.public-home-intro {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--tgb-radius);
    background: rgba(255,255,255,0.04);
    padding: 18px;
}
.public-home-intro h2,
.public-home-intro p { margin: 0; }
.public-home-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.portal-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    min-width: 0;
}
.portal-section-heading h2,
.portal-section-heading h3,
.portal-section-heading p { margin: 0; }
.portal-section-heading.compact { margin-bottom: 12px; }
.portal-kicker {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    color: #bdbdbd;
    font-size: .82rem;
    padding: .28rem .62rem;
    white-space: nowrap;
}
.portal-dashboard { margin-top: 0; }
.portal-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
    gap: 14px;
    align-items: start;
    min-width: 0;
    max-width: 100%;
}
.portal-stats-panel { min-width: 0; }
.portal-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
    margin: 0;
}
.portal-stat {
    border: 1px solid #333;
    border-radius: var(--tgb-radius);
    background: var(--tgb-surface-3);
    padding: 12px;
}
.portal-stat strong { display: block; color: #0f0; font-size: 23px; margin-bottom: 4px; line-height: 1.05; }
.portal-stat span { color: #bdbdbd; font-size: .88rem; }
.portal-feed,
.portal-leaderboard {
    min-width: 0;
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--tgb-radius);
    background: rgba(255,255,255,0.04);
    padding: 14px;
}
.portal-message-feed {
    list-style: none;
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    min-width: 0;
    max-width: 100%;
}
.portal-message-feed li {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(255,255,255,0.055);
    box-shadow: 0 10px 24px rgba(0,0,0,0.22);
    padding: 10px;
    min-width: 0;
    max-width: 100%;
}
.portal-message-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    color: #bdbdbd;
    font-size: .82rem;
    min-width: 0;
}
.portal-message-chip {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #bdbdbd;
    padding: 6px 8px;
}
.portal-message-meta strong { color: #f3f3f3; }
.portal-message-body {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    color: #f3f3f3;
    margin: 8px 0 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
    padding: 8px 10px;
    min-width: 0;
    max-width: 100%;
}

.public-profile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    min-width: 0;
    max-width: 100%;
}
.public-profile-card, .public-channel-profile {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--tgb-radius);
    overflow: hidden;
    background: rgba(255,255,255,0.04);
}
.public-profile-card {
    display: grid;
    align-content: start;
    gap: .75rem;
    color: inherit;
    text-decoration: none;
    padding: 1rem;
    min-width: 0;
}
.public-profile-card:hover { border-color: rgba(52,211,153,0.7); }
.public-profile-heading, .public-channel-heading { display: flex; gap: .75rem; align-items: center; min-width: 0; }
.public-profile-heading > div, .public-channel-heading > div { min-width: 0; }
.public-profile-heading h2, .public-channel-heading h1, .public-profile-heading span, .public-channel-heading p { overflow-wrap: anywhere; }
.public-profile-avatar {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(52,211,153,0.5);
}
.public-profile-fallback { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.public-profile-meta, .public-channel-facts { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .9rem; opacity: .85; min-width: 0; }
.public-profile-status-frame {
    border: 1px solid rgba(52,211,153,0.22);
    border-radius: var(--tgb-radius);
    background: rgba(0,0,0,0.16);
    padding: .75rem;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
.public-channel-status-frame { margin-top: 1rem; }
.public-profile-status-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; min-width: 0; }
.public-profile-status-row span, .public-channel-facts span {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    padding: .24rem .55rem;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.public-profile-status.is-live { border-color: rgba(52,211,153,0.72); color: var(--tgb-accent-soft); }
.public-profile-status.is-offline { color: var(--tgb-muted); }
.public-profile-title { margin: .65rem 0 0; font-weight: 700; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.public-channel-banner { height: 190px; background-size: cover; background-position: center; border-bottom: 1px solid rgba(255,255,255,0.12); }
.public-channel-body { padding: 1rem; }
.public-channel-avatar {
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(52,211,153,0.65);
}
.public-channel-sections {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    align-items: stretch;
}
.public-channel-section {
    min-width: 0;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--tgb-radius);
    padding: 1rem;
    background: rgba(255,255,255,0.04);
}
.public-link-list { display: grid; gap: .5rem; }

@media (max-width: 1180px) {
    .public-profile-grid, .public-channel-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    main, main.container, .container { width: min(96vw, 1760px); margin: 12px auto; padding: 14px; }
    .public-home-intro { grid-template-columns: 1fr; }
    .public-home-actions { justify-content: stretch; }
    .portal-dashboard-grid { grid-template-columns: 1fr; }
    .portal-section-heading { display: grid; }
    .portal-message-meta { grid-template-columns: 1fr; }
    .public-profile-grid, .public-channel-sections { grid-template-columns: 1fr; }
    .public-channel-heading { align-items: flex-start; flex-direction: column; }
}

.access-denied-shell {
                min-height: 100vh;
                display: grid;
                place-items: center;
                padding: 24px;
            }

            .access-denied-panel {
                width: min(560px, 100%);
                background: #151515;
                border: 1px solid #333;
                border-radius: 8px;
                box-shadow: 0 0 28px rgba(0, 255, 120, 0.1);
                padding: 32px;
            }

            .access-denied-kicker {
                color: #89f29f;
                font-size: 0.82rem;
                letter-spacing: 0.08em;
                text-transform: uppercase;
            }

            .access-denied-panel h1 {
                margin: 10px 0;
            }

            .access-denied-actions {
                display: flex;
                flex-wrap: wrap;
                gap: 12px;
                align-items: center;
                margin-top: 22px;
            }

            .access-denied-actions .button {
                border: 1px solid #36d95f;
                border-radius: 8px;
                background: #202820;
                color: #89f29f;
                padding: 10px 14px;
            }

            .access-denied-timer {
                color: #aaa;
                font-size: 0.92rem;
            }
