html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: var(--bg, #0f172a);
    color: var(--fg, #e2e8f0);
}

main {
    min-height: 0;
    overflow-y: auto;
}

/* On /claude-terminal the persistent terminal mount fills the viewport and xterm owns its own scrollback,
   so the page itself must not scroll (a page-level scroll fights the terminal on desktop). ct-immersive-route
   is toggled on <html> by claude-terminal.js syncRoute only while on that route, so every other page keeps
   normal body scrolling. */
html.ct-immersive-route body {
    overflow: hidden;
}

/* On desktop the DevOps, Repos, and Files pages are fixed-height layouts that own their internal scroll
   regions (sidebars, backlog tree, file panes), so the page must not also scroll at the body level. Scoped
   to desktop width: on mobile these pages reflow to stacked, body-scrolling columns. The page roots
   (.repos-layout = DevOps, .repos-page = Repos, .files-page = Files) are matched via :has so no route-class
   plumbing is needed; once navigation removes that content the rule lifts on its own. */
@media (min-width: 769px) {
    body:has(.repos-layout),
    body:has(.repos-page),
    body:has(.files-page) {
        overflow: hidden;
    }
}

article {
    min-height: 0;
}

.dashboard-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem;
}

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

button {
    background: #1d4ed8;
    color: #fff;
    border: 0;
    border-radius: var(--radius-md);
    padding: 0.5rem 0.8rem;
    cursor: pointer;
}

.latest-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.latest-grid article,
.chart-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    min-width: 0;
}

.latest-grid h2,
.chart-card h2 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--info-soft);
}

.latest-grid p {
    margin: 0.4rem 0 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.chart-card {
    margin-top: 0.9rem;
}

#reload-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg-color, #fff);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

#reload-overlay.active {
    opacity: 1;
    pointer-events: all;
}
