/* Standalone insets. Loaded after styles.css so 100vh shell rules do not win. */

html, body {
    height: 100dvh;
    overscroll-behavior: none;
    background: var(--bg-primary);
}

.app-shell {
    height: 100dvh;
}

/* Literal colors. The installed app's home-indicator gap is the page
   background once the shell includes that inset. */
html[data-theme="dark"] {
    background-color: #05070c;
}

html[data-theme="light"] {
    background-color: #f4f6f8;
}

/* iOS standalone reports 100dvh short by the home-indicator inset, and the
   webview shows the saved light color in the gap. Add the inset back. */
@media (display-mode: standalone) {
    html, body, .app-shell {
        height: calc(100dvh + max(env(safe-area-inset-bottom, 0px), var(--pwa-chin, 0px)));
    }
}

html[data-standalone],
html[data-standalone] body,
html[data-standalone] .app-shell {
    height: calc(100dvh + max(env(safe-area-inset-bottom, 0px), var(--pwa-chin, 0px)));
}

body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: env(safe-area-inset-bottom, 0px);
    background: var(--bg-primary);
    z-index: 12000;
    pointer-events: none;
}

.app-header {
    height: calc(64px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
}

.app-right {
    padding-top: calc(64px + env(safe-area-inset-top, 0px));
}

.app-sidebar {
    top: calc(64px + env(safe-area-inset-top, 0px)) !important;
    height: calc(100dvh - 64px - env(safe-area-inset-top, 0px)) !important;
}

.mobile-menu-overlay {
    height: 100dvh;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
}

#shell-tour-info-btn {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}

.pwa-hint {
    position: fixed;
    top: calc(72px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(520px, calc(100% - 24px));
    margin: 0;
    padding: 10px 12px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--glow-md);
}

.pwa-hint[hidden] {
    display: none;
}

.pwa-hint p {
    margin: 0;
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.pwa-hint-install,
.pwa-hint-close {
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    white-space: nowrap;
}

.pwa-hint-install {
    background: var(--neon-cyan);
    color: var(--bg-primary);
    border: none;
}

.pwa-hint-close {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.pwa-mobile-steps {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.pwa-mobile-steps li + li {
    margin-top: 6px;
}

.pwa-mobile-note {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}
