/* Application shell */
.app-body {
    background:
        linear-gradient(90deg, rgba(226, 209, 192, .10) 1px, transparent 1px) 0 0 / 80px 80px,
        var(--color-background);
}

.app-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, var(--content-width)) 220px;
    gap: 32px;
    width: min(calc(100% - 48px), 1200px);
    min-height: 100vh;
    margin-inline: auto;
}

.side-nav__inner {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 34px 0 28px;
}

.side-nav .preview-pill {
    margin-top: 16px;
}

.primary-nav {
    display: grid;
    gap: 7px;
    margin-top: 44px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 48px;
    padding: 0 15px;
    border-radius: 14px;
    color: var(--color-text-muted);
    font-weight: 600;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.nav-item:hover {
    background: rgba(255, 253, 249, .62);
    color: var(--color-text);
    transform: translateX(2px);
}

.nav-item.is-active {
    background: var(--color-surface);
    color: var(--color-primary-dark);
    box-shadow: var(--shadow-soft);
}

.nav-item.is-active .rs-icon {
    stroke-width: 2.2;
}

.nav-item { position: relative; }

.notification-badge {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--color-tertiary);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    line-height: 1;
}


#runscape-app-navigation.appnav {
    position: relative;
    height: 100dvh;
    min-height: 100vh;
    --appnav-background: var(--color-surface);
    --appnav-text: var(--color-text);
}

/* In-Page Initial Loader (僅在首次載入未就緒時於內容欄呈現，就緒後優雅淡出) */
.rs-initial-loader {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface, #FFFDF9);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rs-initial-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.appnav-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 48px 24px;
    text-align: center;
}

.rs-loading-runner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 32px 24px;
    text-align: center;
}

.rs-loading-runner__icon {
    width: 56px;
    height: 56px;
    display: block;
    filter: drop-shadow(0 6px 16px rgba(113, 59, 46, .18));
}

.rs-loading-runner__text {
    color: var(--color-text-muted, #7e6357);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .05em;
    animation: rs-loading-pulse 1.8s ease-in-out infinite;
}

@keyframes rs-loading-pulse {
    0%, 100% { opacity: .65; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1); }
}

.rs-loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 32px;
    text-align: center;
}

.rs-loading-box .rs-loading-runner__icon {
    width: 48px;
    height: 48px;
}

.runscape-page {
    min-height: 100%;
}

.app-body.appnav-enabled {
    overflow: hidden;
}

.top-bar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 66px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--color-border);
    background: rgba(255, 253, 249, .88);
    backdrop-filter: blur(18px);
}

.top-bar__leading,
.top-bar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar__leading {
    min-width: 0;
}

.top-bar__actions {
    flex: 0 0 auto;
}

.top-bar__profile-edit {
    white-space: nowrap;
}

.top-bar__leading > div {
    display: grid;
    line-height: 1.15;
}

.top-bar h1 {
    font-size: 18px;
    letter-spacing: -.025em;
}

.top-bar small {
    margin-top: 3px;
    color: var(--color-text-muted);
    font-size: 10px;
}

.page-content {
    min-height: calc(100vh - 66px);
}

.bottom-nav {
    display: none;
}

.avatar {
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, .84);
    border-radius: 50%;
    background: linear-gradient(145deg, #bd7446, #843c29);
    color: #fff;
    box-shadow: 0 3px 10px rgba(58, 48, 42, .12);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .02em;
}

.avatar--sage { background: linear-gradient(145deg, #9bb39c, #536a5a); }
.avatar--sun { background: linear-gradient(145deg, #e5ae57, #bd642d); }
.avatar--sky { background: linear-gradient(145deg, #8db6c1, #446977); }
.avatar--rose { background: linear-gradient(145deg, #ca8e8b, #82494c); }
.avatar--clay { background: linear-gradient(145deg, #c47c50, #834029); }
.avatar--sm { flex-basis: 34px; width: 34px; height: 34px; font-size: 9px; }
.avatar--xl { flex-basis: 92px; width: 92px; height: 92px; font-size: 22px; border-width: 4px; }

.avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

