@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

:root {
    --site-bg: #eef3f8;
    --site-panel: rgba(255, 255, 255, 0.9);
    --site-panel-strong: rgba(255, 255, 255, 0.96);
    --site-border: rgba(20, 32, 58, 0.08);
    --site-text: #172034;
    --site-muted: #5d6880;
    --site-primary: #2d6cdf;
    --site-primary-strong: #194cb4;
    --site-accent: #f04f8d;
    --site-shadow: 0 20px 45px rgba(17, 27, 45, 0.12);
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, #f7f9fc 0%, #edf2f9 100%);
    color: var(--site-text);
}

a,
.btn-link {
    color: var(--site-primary);
}

a:hover,
.btn-link:hover {
    color: var(--site-primary-strong);
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: var(--site-primary);
    border-color: var(--site-primary-strong);
}

app {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    background: linear-gradient(180deg, rgba(18, 29, 56, 0.95) 0%, rgba(41, 51, 91, 0.96) 100%);
    color: #f5f7fb;
    box-shadow: 8px 0 32px rgba(16, 24, 40, 0.18);
    z-index: 3;
}

.site-brand-bar {
    justify-content: space-between;
    min-height: 4.75rem;
    padding-right: 1rem;
}

.brand-link {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: #fff;
    text-decoration: none;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.76);
}

.nav-scroll-region {
    padding: 0 0.75rem 1rem;
}

.app-main {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.app-background {
    background: linear-gradient(rgba(243, 247, 252, 0.92), rgba(243, 247, 252, 0.98)), url('/Upload/u-3995224717-1957023837-fm-11-gp-0.jpg') center/cover fixed;
}

.top-row {
    display: flex;
    align-items: center;
}

.app-topbar,
.app-topbar.rz-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    height: auto !important;
    min-height: 5rem;
    box-sizing: border-box;
    justify-content: flex-end;
    padding: 0.8rem 1.4rem !important;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--site-border);
    box-shadow: 0 10px 24px rgba(17, 27, 45, 0.08);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    min-height: 2.85rem;
}

.topbar-actions > * {
    min-width: 0;
}

.topbar-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--site-accent), #ff7b54);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(240, 79, 141, 0.24);
}

.topbar-cta:hover {
    color: #fff;
    transform: translateY(-1px);
}

.theme-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--site-border);
}

.theme-picker span {
    color: var(--site-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.theme-picker .rz-dropdown {
    min-width: 0;
}

.page-frame {
    width: min(1160px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 2rem;
}

.content {
    flex: 1;
}

.surface-panel {
    background: var(--site-panel);
    border: 1px solid var(--site-border);
    border-radius: 24px;
    box-shadow: var(--site-shadow);
}

.site-footer,
.identity-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem 1.75rem;
    color: var(--site-muted);
}

.site-footer a,
.identity-footer a {
    color: inherit;
}

.login-links {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.login-link {
    font-weight: 600;
}

.login-link--qq {
    color: #12b7f5;
}

.profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(45, 108, 223, 0.18);
    box-shadow: 0 8px 18px rgba(45, 108, 223, 0.18);
}

.profile-logout-button {
    color: var(--site-text);
    font-weight: 600;
}

.home-page {
    display: grid;
    gap: 1.5rem;
}

.home-hero {
    padding: 2rem;
}

.home-hero__content {
    display: grid;
    gap: 1rem;
    max-width: 64rem;
}

.home-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(45, 108, 223, 0.12);
    color: var(--site-primary-strong);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.home-title {
    margin: 0;
    font-size: clamp(2rem, 3.35vw, 3.15rem);
    line-height: 1.15;
    text-wrap: balance;
}

.home-subtitle {
    margin: 0;
    max-width: 760px;
    color: var(--site-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

.home-language-marquee {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    min-height: clamp(5rem, 11vw, 7rem);
    padding: 0 1.5rem;
    border: 1px solid rgba(45, 108, 223, 0.2);
    border-radius: 999px;
    background: linear-gradient(100deg, rgba(45, 108, 223, 0.18), rgba(255, 255, 255, 0.96), rgba(125, 211, 252, 0.24));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 18px 38px rgba(17, 27, 45, 0.12);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.home-language-marquee__phrase {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: var(--site-primary-strong);
    font-size: clamp(2.25rem, 6vw, 4.9rem);
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1.05;
    text-align: center;
    text-shadow: 0 4px 16px rgba(45, 108, 223, 0.24);
    animation: home-language-slide-in 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
    white-space: nowrap;
}

@keyframes home-language-slide-in {
    0% {
        opacity: 0;
        transform: translateX(110%) scale(0.92);
    }

    70% {
        opacity: 1;
        transform: translateX(-0.35rem) scale(1.03);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.home-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.home-action-card {
    display: grid;
    gap: 0.45rem;
    min-height: 130px;
    padding: 1.1rem 1.2rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(45, 108, 223, 0.08);
    box-shadow: 0 12px 28px rgba(17, 27, 45, 0.08);
}

.home-action-card strong {
    font-size: 1rem;
}

.home-action-card span {
    color: var(--site-muted);
    line-height: 1.65;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.home-panel {
    padding: 1.5rem;
}

.home-panel h2 {
    margin: 0 0 0.85rem;
    font-size: 1.35rem;
}

.home-panel p {
    margin: 0;
    color: var(--site-muted);
    line-height: 1.7;
}

.home-panel__header {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.home-info-list,
.home-donation-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-info-list {
    display: grid;
    gap: 0.85rem;
}

.home-info-list li {
    padding-left: 1rem;
    color: var(--site-muted);
    line-height: 1.75;
    position: relative;
}

.home-info-list li::before {
    content: '';
    position: absolute;
    top: 0.75rem;
    left: 0;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--site-primary);
}

.home-donation-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.home-donation-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(248, 250, 255, 0.92);
    border: 1px solid rgba(45, 108, 223, 0.08);
}

.home-donation-list li span {
    color: var(--site-muted);
}

.home-donation-list li strong {
    color: var(--site-text);
    white-space: nowrap;
}

.identity-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(180deg, rgba(243, 247, 252, 0.94), rgba(243, 247, 252, 0.98)), url('/Upload/u-3995224717-1957023837-fm-11-gp-0.jpg') center/cover fixed;
}

.identity-header {
    padding: 1rem 1.25rem 0;
}

.identity-header__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: min(960px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1rem 1.25rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--site-border);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 36px rgba(17, 27, 45, 0.08);
}

.identity-brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-decoration: none;
    color: var(--site-text);
}

.identity-nav ul {
    margin-bottom: 0;
}

.identity-shell {
    flex: 1;
    width: min(960px, calc(100% - 2rem));
    margin: 1.5rem auto 0;
}

.identity-main {
    padding: 1.75rem;
}

.identity-page {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
    gap: 1.25rem;
    align-items: start;
}

.identity-page--compact {
    grid-template-columns: minmax(0, 0.86fr) minmax(320px, 1fr);
}

.identity-page__hero,
.identity-form-card,
.identity-info-card {
    border: 1px solid rgba(45, 108, 223, 0.1);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 40px rgba(17, 27, 45, 0.08);
}

.identity-page__hero {
    padding: 1.5rem;
    position: sticky;
    top: 1rem;
}

.identity-page__eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: rgba(45, 108, 223, 0.1);
    color: #2257b8;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.identity-page__hero h1,
.identity-info-card h1 {
    margin-bottom: 0.65rem;
    color: var(--site-text);
    font-weight: 800;
}

.identity-page__hero p,
.identity-info-card p,
.identity-form-card__header p {
    margin-bottom: 0;
    color: var(--site-muted);
    line-height: 1.7;
}

.identity-form-card {
    padding: 1.5rem;
}

.identity-form-card__header {
    margin-bottom: 1.25rem;
}

.identity-form-card__header h2 {
    margin-bottom: 0.35rem;
    color: var(--site-text);
    font-size: 1.35rem;
    font-weight: 800;
}

.app-auth-state {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: clamp(1rem, 2vw, 1.5rem);
}

.app-auth-state__card {
    position: relative;
    display: grid;
    justify-items: start;
    gap: 1rem;
    width: min(100%, 760px);
    padding: clamp(1.5rem, 3vw, 2.4rem);
    overflow: hidden;
    border: 1px solid rgba(45, 108, 223, 0.08);
    border-radius: 32px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.78) 38%, rgba(255, 255, 255, 0.92) 100%),
        linear-gradient(135deg, rgba(255, 238, 246, 0.92), rgba(240, 246, 255, 0.92));
    box-shadow:
        0 22px 50px rgba(17, 27, 45, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.app-auth-state__card--compact {
    width: min(100%, 680px);
    text-align: center;
    justify-items: center;
}

.app-auth-state__card--login-simple {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 0.9rem;
    width: min(100%, 560px);
    padding: 1.1rem 1.25rem;
    border-radius: 22px;
    border: 1px solid rgba(255, 142, 172, 0.22);
    background:
        linear-gradient(135deg, rgba(255, 246, 250, 0.96), rgba(241, 247, 255, 0.96)),
        #fff;
    box-shadow: 0 14px 32px rgba(31, 42, 68, 0.08);
    text-align: center;
}

.app-auth-state__card--login-simple .app-auth-state__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 16px;
    font-size: 1.25rem;
}

.app-auth-state__card--login-simple p {
    max-width: none;
    color: var(--site-text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.6;
}

.app-auth-state__card--login-simple a {
    display: inline-flex;
    align-items: center;
    margin: 0 0.18rem;
    padding: 0.18rem 0.65rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff6f91, #ff8a5c);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(255, 111, 145, 0.24);
}

.app-auth-state__card--login-simple a:hover {
    color: #fff;
    transform: translateY(-1px);
}

.app-auth-state__card--login-simple small {
    flex-basis: 100%;
    color: #6b7791;
    font-weight: 600;
}

.app-auth-state__eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.38rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(45, 108, 223, 0.08);
    color: #2257b8;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.app-auth-state__card h1,
.app-auth-state__card h2 {
    margin: 0;
    color: var(--site-text);
    font-weight: 800;
}

.app-auth-state__card h1 {
    max-width: 14ch;
    font-size: clamp(2rem, 4vw, 3.15rem);
    line-height: 1.08;
}

.app-auth-state__card h2 {
    font-size: 1.45rem;
}

.app-auth-state__card p {
    margin: 0;
    color: var(--site-muted);
    line-height: 1.8;
    font-size: 1.02rem;
    max-width: 36rem;
}

.app-auth-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.4rem;
    height: 4.4rem;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 240, 248, 0.92));
    box-shadow:
        0 14px 26px rgba(240, 79, 141, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    font-size: 2rem;
}

.app-auth-state__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.app-auth-state__secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.78rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.app-auth-state__secondary {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(45, 108, 223, 0.1);
    color: var(--site-text);
}

.app-auth-state__secondary:hover {
    color: var(--site-primary-strong);
    transform: translateY(-2px);
}

.identity-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem 1rem;
}

.identity-field {
    margin-bottom: 1rem;
}

.identity-field label {
    margin-bottom: 0.35rem;
    color: #263246;
    font-weight: 700;
}

.identity-field .form-control {
    min-height: 44px;
    border-radius: 14px;
    border-color: rgba(114, 132, 160, 0.35);
    background: rgba(248, 250, 252, 0.92);
}

.identity-validation {
    margin-bottom: 1rem;
}

.identity-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0 1rem;
    color: var(--site-muted);
    font-weight: 700;
}

.identity-checkbox input {
    width: 1rem;
    height: 1rem;
}

.identity-submit {
    min-height: 44px;
    width: 100%;
    border-radius: 999px;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(45, 108, 223, 0.22);
}

.identity-submit--qq {
    background: #12b7f5;
    border-color: #12b7f5;
    box-shadow: 0 12px 24px rgba(18, 183, 245, 0.22);
}

.identity-secondary-submit {
    min-height: 44px;
    width: 100%;
    margin-top: 0.75rem;
    border-radius: 999px;
    font-weight: 800;
}

.identity-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 1rem;
}

.identity-links--center {
    justify-content: center;
}

.identity-links a {
    color: #2257b8;
    font-weight: 700;
    text-decoration: none;
}

.identity-links a:hover {
    text-decoration: underline;
}

.identity-external-card {
    grid-column: 2;
}

.identity-external-actions {
    display: grid;
    gap: 0.75rem;
}

.identity-external-list {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.identity-external-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(114, 132, 160, 0.25);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.92);
}

.identity-external-item p,
.identity-muted {
    margin: 0;
    color: var(--site-muted);
}

.identity-info-card {
    grid-column: 1 / -1;
    padding: 2rem;
    text-align: center;
}

.identity-info-card .btn {
    margin-top: 0.75rem;
    border-radius: 999px;
    font-weight: 800;
}

.identity-manage-page {
    grid-template-columns: 1fr;
}

.identity-manage-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
}

.identity-manage-shell__nav {
    padding: 1rem;
    border: 1px solid rgba(45, 108, 223, 0.1);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 14px 32px rgba(17, 27, 45, 0.06);
}

.identity-manage-shell__nav .nav-pills {
    gap: 0.45rem;
}

.identity-manage-shell__nav .nav-link {
    border-radius: 14px;
    color: var(--site-muted);
    font-weight: 800;
}

.identity-manage-shell__nav .nav-link.active {
    background: #2d6cdf;
    color: #fff;
}

.identity-manage-shell__content {
    min-width: 0;
}

.identity-status-card {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid rgba(45, 108, 223, 0.12);
    border-radius: 20px;
    background: rgba(248, 250, 252, 0.92);
}

.identity-status-card__header {
    margin-bottom: 0.9rem;
}

.identity-status-card__header h3 {
    margin: 0 0 0.25rem;
    color: var(--site-text);
    font-size: 1.05rem;
    font-weight: 800;
}

.identity-status-card__header p,
.identity-inline-note {
    margin: 0;
    color: var(--site-muted);
}

.identity-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.identity-status-item {
    display: grid;
    gap: 0.25rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(45, 108, 223, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
}

.identity-status-item span {
    color: var(--site-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.identity-status-item strong {
    color: var(--site-text);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.identity-inline-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.identity-inline-status .form-control {
    flex: 1 1 240px;
}

.identity-inline-status__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
}

.identity-inline-status__badge--success {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.identity-inline-status__badge--warn {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.identity-inline-note {
    margin: 0 0 1rem;
}

.identity-manage-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.identity-manage-overview__item {
    display: grid;
    gap: 0.3rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(45, 108, 223, 0.12);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.9);
}

.identity-manage-overview__item span {
    color: var(--site-muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.identity-manage-overview__item strong {
    color: var(--site-text);
    font-size: 1rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.identity-manage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (max-width: 991.98px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        min-height: auto;
        position: sticky;
        top: 0;
        box-shadow: 0 10px 28px rgba(16, 24, 40, 0.18);
    }

    .app-topbar {
        padding: 0.85rem 1rem;
    }

    .page-frame {
        width: min(100%, calc(100% - 1rem));
    }

    .home-grid {
        grid-template-columns: 1fr;
    }

    .home-panel__header,
    .identity-header__content {
        flex-direction: column;
        align-items: flex-start;
    }

    .identity-page,
    .identity-page--compact,
    .identity-manage-shell {
        grid-template-columns: 1fr;
    }

    .identity-page__hero {
        position: static;
    }

    .app-auth-state__card {
        padding: 1.35rem;
    }

    .identity-form-grid {
        grid-template-columns: 1fr;
    }

    .identity-external-card {
        grid-column: auto;
    }
}

@media (max-width: 767.98px) {
    .page-frame {
        width: calc(100% - 0.5rem);
        padding: 0.95rem 0 1.25rem;
    }

    .nav-scroll-region {
        padding-bottom: 0.5rem;
    }

    .home-hero,
    .home-panel,
    .identity-main {
        padding: 1.2rem;
    }

    .home-donation-list {
        grid-template-columns: 1fr;
    }

    .home-language-marquee {
        min-height: 4.35rem;
        padding: 0 1rem;
    }

    .home-language-marquee__phrase {
        font-size: clamp(1.7rem, 8vw, 3rem);
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 0.55rem 0.6rem;
        align-items: center;
    }

    .theme-picker,
    .topbar-picker {
        flex: 1 1 calc(50% - 0.3rem);
        width: auto;
        min-width: 0;
        display: grid;
        gap: 0.28rem;
        padding: 0.45rem 0.55rem;
        border: 1px solid var(--site-border);
        border-radius: 0.9rem;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 8px 22px rgba(17, 27, 45, 0.05);
    }

    .theme-picker .rz-dropdown,
    .topbar-picker .rz-dropdown {
        width: 100% !important;
    }

    .topbar-picker span {
        font-size: 0.72rem;
        line-height: 1.1;
        white-space: nowrap;
    }

    .topbar-cta {
        flex: 1 1 auto;
        min-height: 2.3rem;
        padding: 0.45rem 0.85rem;
        box-shadow: 0 8px 20px rgba(240, 79, 141, 0.18);
    }

    .topbar-icon-action,
    .topbar-profile {
        flex: 0 0 auto;
    }

    .topbar-profile-trigger {
        padding: 0.18rem;
        box-shadow: 0 8px 18px rgba(45, 108, 223, 0.1);
    }

    .topbar-profile .profile-avatar {
        width: 38px;
        height: 38px;
    }

    .site-footer,
    .identity-footer {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    .app-topbar {
        padding: 0.5rem !important;
    }

    .page-frame {
        width: calc(100% - 0.25rem);
        padding: 0.65rem 0 1rem;
    }

    .topbar-actions {
        justify-content: flex-start;
        gap: 0.45rem 0.5rem;
    }

    .topbar-actions > * {
        width: auto;
    }

    .topbar-picker {
        flex-basis: calc(50% - 0.3rem);
    }

    .topbar-profile,
    .login-links {
        width: auto;
    }

    .topbar-cta {
        justify-content: center;
    }

    .login-links {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-language-marquee__phrase {
        animation: none;
        transform: none;
    }
}

@media (min-width: 992px) {
    .app-sidebar {
        width: 280px;
        min-height: 100vh;
        position: sticky;
        top: 0;
    }

    .navbar-toggler {
        display: none;
    }

    .sidebar .collapse {
        display: block;
    }
}
