:root {
    --page-bg: #f5f7fb;
    --ink: #172033;
    --muted: #64748b;
    --brand: #5b5cf0;
    --brand-deep: #3f3fc4;
    --purple: #7c3aed;
    --surface: #ffffff;
    --border-soft: rgba(91, 92, 240, .14);
    --shadow-soft: 0 1rem 2.5rem rgba(15, 23, 42, .08);
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(91, 92, 240, .16), transparent 28rem), linear-gradient(180deg, #ffffff 0%, var(--page-bg) 100%);
    color: var(--ink);
}

.public-auth-shell {
    max-width: 900px;
    padding-bottom: 3rem;
    padding-top: 3rem;
}

.portal-shell {
    min-height: calc(100vh - 48px);
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.portal-menu-toggle,
.portal-sidebar-backdrop {
    display: none;
}

.portal-sidebar {
    background: linear-gradient(180deg, #281052 0%, #35146f 48%, #1b0b3a 100%);
    border-right: 1px solid rgba(255, 255, 255, .12);
    padding: 1.25rem;
    position: sticky;
    top: 48px;
    height: calc(100vh - 48px);
    box-shadow: 1rem 0 2.5rem rgba(15, 23, 42, .12);
}

.portal-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    color: #fff;
    font-weight: 800;
    justify-content: center;
    text-decoration: none;
    margin-bottom: 1.75rem;
    text-align: center;
}

.portal-brand:hover,
.portal-brand:focus,
.portal-brand a:hover,
.portal-brand a:focus {
    color: #fff;
}

.portal-brand-name {
    color: #fff;
    text-decoration: none;
}

.portal-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: .5rem;
    background: linear-gradient(135deg, #c4b5fd, #8b5cf6);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .12);
    display: inline-flex;
    overflow: hidden;
    flex: 0 0 38px;
    text-decoration: none;
}

.portal-brand-mark-wrap {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.portal-artwork-change {
    color: #e9d5ff;
    font-size: .86rem;
    font-weight: 800;
    text-decoration: none;
}

.portal-sidebar .portal-brand-mark {
    width: 120px;
    height: 120px;
    border-radius: 1rem;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .12);
    flex-basis: 120px;
}

.portal-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portal-nav {
    display: grid;
    gap: .35rem;
}

.portal-title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.portal-topbar-categories {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.portal-category-badge {
    background: var(--brand);
    border: 1px solid rgba(91, 92, 240, .18);
    border-radius: 999px;
    color: #fff;
    font-size: .95rem;
    font-weight: 800;
    padding: .5rem .75rem;
}

.portal-nav a {
    color: rgba(255, 255, 255, .86);
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: .85rem;
    padding: .75rem 1rem;
}

.portal-nav a:hover,
.portal-nav a.active {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .18);
    color: #fff;
}

.portal-main {
    min-width: 0;
}

.portal-adminbar {
    align-items: center;
    background: #000;
    color: #fff;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    left: 0;
    min-height: 48px;
    padding: .55rem 1.5rem;
    position: sticky;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.portal-adminbar a,
.portal-adminbar span {
    color: #fff;
    font-size: .92rem;
    font-weight: 800;
    text-decoration: none;
}

.portal-adminbar a:hover,
.portal-adminbar a:focus {
    color: #dbeafe;
    text-decoration: none;
}

.portal-adminbar-left,
.portal-adminbar-right {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.portal-adminbar-right {
    justify-content: flex-end;
    text-align: right;
}

.portal-adminbar-level {
    color: #e9d5ff !important;
}

.portal-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, .78);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(12px);
}

.portal-content {
    padding: 1.5rem;
}

.portal-card {
    border: 0;
    border-radius: 1.25rem;
    box-shadow: var(--shadow-soft);
}

.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-brand:hover {
    background: var(--brand-deep);
    border-color: var(--brand-deep);
    color: #fff;
}

.btn-google {
    align-items: center;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    color: #3c4043;
    display: inline-flex;
    font-family: Arial, sans-serif;
    font-size: .95rem;
    font-weight: 500;
    gap: .75rem;
    min-height: 44px;
    justify-content: center;
    padding: 0 1rem;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.btn-google:hover,
.btn-google:focus {
    background: #f8fafd;
    border-color: #d2e3fc;
    box-shadow: 0 1px 2px rgba(60, 64, 67, .18);
    color: #3c4043;
}

.google-logo {
    flex: 0 0 18px;
    height: 18px;
    width: 18px;
}

.login-divider {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: .85rem;
    font-weight: 800;
    gap: .8rem;
    margin: 1rem 0;
    text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
    background: #e2e8f0;
    content: "";
    flex: 1;
    height: 1px;
}

.login-network-logo {
    height: auto;
    max-width: min(240px, 72vw);
}

.signup-card fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.signup-card legend {
    color: var(--ink);
    margin-bottom: 1rem;
}

.pending-card {
    max-width: 760px;
    margin-inline: auto;
}

@media (max-width: 576px) {
    .public-auth-shell {
        padding: 1rem;
    }

    .portal-card {
        border-radius: .75rem;
    }

    .portal-card .card-body {
        padding: 1.25rem !important;
    }

    .login-network-logo {
        max-width: min(180px, 58vw);
    }

    .btn-google {
        width: 100%;
    }

    .signup-card .card-body {
        padding: 1.25rem !important;
    }

    .signup-card .form-control,
    .signup-card .form-select,
    .signup-card .btn {
        font-size: 1rem;
        min-height: 3rem;
    }
}

.meta {
    color: var(--muted);
    font-size: .92rem;
}

.description-counter {
    color: var(--muted);
    font-size: .92rem;
    font-weight: 700;
}

.description-over-limit {
    color: #dc2626;
    font-size: .92rem;
    font-weight: 800;
}

.stock-symbol-label {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 800;
}

.podcast-artwork-preview {
    border-radius: .75rem;
    box-shadow: var(--shadow-soft);
    height: 180px;
    object-fit: cover;
    width: 180px;
}

.chart-row {
    display: grid;
    gap: .8rem;
}

.bar-track {
    height: .8rem;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--purple));
}

.pie-chart {
    width: 180px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(var(--brand) var(--profile-slice, 50%), var(--purple) 0);
    box-shadow: var(--shadow-soft);
}

.dashboard-shell {
    display: grid;
    gap: 1.25rem;
}

.dashboard-help-callout,
.dashboard-hero,
.help-hero {
    background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
}

.dashboard-help-callout {
    border-left: .35rem solid var(--brand);
}

.dashboard-help-callout h2,
.dashboard-hero h2,
.help-hero h2 {
    font-size: clamp(1.4rem, 2vw, 2rem);
    font-weight: 900;
    margin: 0 0 .5rem;
}

.dashboard-help-callout p,
.dashboard-hero p,
.help-hero p {
    color: var(--muted);
    margin-bottom: 0;
    max-width: 760px;
}

.dashboard-help-callout a {
    color: var(--brand-deep);
    font-weight: 900;
}

.dashboard-hero {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.dashboard-score-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .9rem;
    min-width: 180px;
    padding: 1rem;
    text-align: center;
}

.dashboard-score {
    color: var(--brand-deep);
    display: block;
    font-size: 2.25rem;
    font-weight: 900;
    line-height: 1;
}

.dashboard-layout {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr);
}

.dashboard-side-stack {
    display: grid;
    gap: 1.25rem;
}

.dashboard-panel {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    box-shadow: var(--shadow-soft);
    padding: 1.25rem;
}

.dashboard-panel-primary {
    min-height: 100%;
}

.dashboard-kicker {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .04em;
    margin: 0 0 .35rem;
    text-transform: uppercase;
}

.dashboard-panel h2 {
    font-size: 1.25rem;
    font-weight: 900;
    margin: 0;
}

.dashboard-muted {
    color: var(--muted);
}

.dashboard-task-list {
    display: grid;
    gap: .65rem;
    margin-top: 1rem;
}

.dashboard-task {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
    color: var(--ink);
    display: flex;
    font-weight: 800;
    gap: .7rem;
    padding: .8rem;
    text-decoration: none;
}

.dashboard-task:hover,
.dashboard-task:focus {
    border-color: rgba(91, 92, 240, .38);
    color: var(--brand-deep);
}

.dashboard-task-dot {
    background: #f59e0b;
    border-radius: 50%;
    flex: 0 0 .7rem;
    height: .7rem;
    width: .7rem;
}

.dashboard-metric-row,
.dashboard-level-row,
.dashboard-panel-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.dashboard-metric-row {
    align-items: stretch;
}

.dashboard-metric-row > div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .85rem;
    flex: 1;
    padding: 1rem;
}

.dashboard-metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.dashboard-metric-label {
    color: var(--muted);
    display: block;
    font-size: .88rem;
    font-weight: 800;
    margin-top: .45rem;
}

.dashboard-level {
    background: #eef2ff;
    border-radius: 999px;
    color: var(--brand-deep);
    font-weight: 900;
    padding: .5rem .85rem;
}

.dashboard-activity-table th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
}

.activity-pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}

.activity-page-link {
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: var(--ink);
    display: inline-flex;
    font-size: .9rem;
    font-weight: 800;
    height: 2rem;
    justify-content: center;
    min-width: 2rem;
    padding: 0 .65rem;
    text-decoration: none;
}

.activity-page-link:hover,
.activity-page-link:focus,
.activity-page-link.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.help-doc {
    display: grid;
    gap: 1.25rem;
}

.help-hero {
    display: grid;
    gap: 1rem;
}

.help-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.help-section {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    box-shadow: var(--shadow-soft);
    padding: 1.25rem;
}

.help-section h3 {
    font-size: 1.05rem;
    font-weight: 900;
    margin-bottom: .5rem;
}

.help-section h3 a {
    color: var(--ink);
    text-decoration: none;
}

.help-section h3 a:hover,
.help-section h3 a:focus {
    color: var(--brand-deep);
}

.help-section p {
    color: var(--muted);
    margin-bottom: 1rem;
}

.help-section ul {
    color: var(--muted);
    margin-bottom: 1rem;
    padding-left: 1.25rem;
}

@media (max-width: 820px) {
    .portal-shell {
        grid-template-columns: 1fr;
    }

    .portal-sidebar {
        bottom: 0;
        height: 100vh;
        left: 0;
        overflow-y: auto;
        position: fixed;
        top: 0;
        transform: translateX(-105%);
        transition: transform .22s ease;
        width: min(82vw, 300px);
        z-index: 1100;
    }

    .portal-sidebar-open .portal-sidebar {
        transform: translateX(0);
    }

    .portal-sidebar-backdrop {
        background: rgba(15, 23, 42, .42);
        bottom: 0;
        display: block;
        left: 0;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 0;
        transition: opacity .22s ease;
        z-index: 1090;
    }

    .portal-sidebar-open .portal-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .portal-menu-toggle {
        align-items: center;
        background: #fff;
        border: 1px solid var(--border-soft);
        border-radius: .6rem;
        box-shadow: 0 .5rem 1.25rem rgba(15, 23, 42, .14);
        display: inline-flex;
        flex-direction: column;
        gap: 4px;
        height: 42px;
        justify-content: center;
        left: .85rem;
        padding: 0;
        position: fixed;
        top: .75rem;
        width: 42px;
        z-index: 1200;
    }

    .portal-menu-toggle span {
        background: var(--ink);
        border-radius: 999px;
        display: block;
        height: 2px;
        width: 19px;
    }

    .portal-content {
        padding: 1rem;
    }

    .portal-topbar {
        padding-left: 4rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-adminbar {
        align-items: flex-start;
        flex-direction: column;
        position: sticky;
    }

    .portal-adminbar-right {
        justify-content: flex-start;
        text-align: left;
    }

    .dashboard-layout,
    .help-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-hero,
    .dashboard-panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}
