:root {
    color-scheme: dark;
    font-family: "DM Sans", system-ui, sans-serif;
    --accent: #24b99f;
    --accent-muted: #163e39;
    --background: #111818;
    --panel: #172121;
    --border: #2b3a39;
    --text: #f5f7f6;
    --muted: #9aacab;
}

* { box-sizing: border-box; }

html, body, #app { min-height: 100%; }

body {
    background: var(--background);
    color: var(--text);
    margin: 0;
}

a { color: inherit; }

.app-shell {
    display: grid;
    grid-template-columns: 17rem 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #121b1b;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}

.brand {
    align-items: center;
    display: flex;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.65rem;
    font-weight: 600;
    gap: .8rem;
    letter-spacing: .04em;
    text-decoration: none;
}

.sidebar nav {
    display: grid;
    gap: .35rem;
    margin-top: 3.5rem;
}

.nav-item {
    border-radius: .5rem;
    color: var(--muted);
    font-size: .9rem;
    padding: .75rem .9rem;
    text-decoration: none;
}

.nav-item.active {
    background: var(--accent-muted);
    color: #d8fff7;
}

.nav-item.disabled { cursor: not-allowed; opacity: .55; }

.sidebar-footer {
    border-top: 1px solid var(--border);
    display: grid;
    gap: .35rem;
    margin-top: auto;
    padding-top: 1.25rem;
}

.sidebar-footer span {
    color: var(--accent);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .18em;
}

.sidebar-footer small { color: var(--muted); }
.main-content { padding: 3.5rem clamp(1.5rem, 4vw, 5rem); }

.page-header {
    align-items: flex-start;
    display: flex;
    gap: 2rem;
    justify-content: space-between;
}

.eyebrow {
    color: var(--accent);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    margin: 0 0 .75rem;
    text-transform: uppercase;
}

h1, h2 {
    font-family: "Barlow Condensed", sans-serif;
    margin: 0;
}

h1:focus { outline: none; }

h1 {
    font-size: clamp(2.7rem, 5vw, 5rem);
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: .98;
}

.lead { color: var(--muted); font-size: 1rem; margin: 1.1rem 0 0; }

.status-pill {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #cad5d4;
    display: inline-flex;
    font-size: .78rem;
    gap: .5rem;
    padding: .6rem .85rem;
    white-space: nowrap;
}

.status-pill span {
    background: #e7aa45;
    border-radius: 50%;
    height: .45rem;
    width: .45rem;
}

.foundation-grid {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 4rem;
    overflow: hidden;
}

.foundation-card {
    background: var(--panel);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 19rem;
    padding: 1.6rem;
}

.card-index { color: #526362; font-family: monospace; font-size: .72rem; }
.card-label { color: var(--muted); font-size: .72rem; margin: 3rem 0 .55rem; text-transform: uppercase; }
.foundation-card h2 { font-size: 2rem; font-weight: 500; }
.foundation-card p:not(.card-label) { color: var(--muted); line-height: 1.6; max-width: 28rem; }
.card-status { font-size: .72rem; font-weight: 700; margin-top: auto; text-transform: uppercase; }
.card-status.ready { color: var(--accent); }
.card-status.pending { color: #e7aa45; }

.next-block {
    align-items: end;
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border);
    display: grid;
    gap: 3rem;
    grid-template-columns: 1fr 1fr;
    margin-top: 3rem;
    padding: 2rem 0;
}

.next-block h2 { font-size: 2.4rem; font-weight: 500; }
.next-block > p { color: var(--muted); line-height: 1.65; margin: 0; }
.empty-state { margin: 15vh auto; max-width: 42rem; }
.empty-state > p:not(.eyebrow) { color: var(--muted); }
.primary-link { color: var(--accent); display: inline-block; margin-top: 1rem; }

#blazor-error-ui {
    background: #3d2020;
    bottom: 0;
    display: none;
    left: 0;
    padding: 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

.loading-progress {
    height: 5rem;
    inset: 30vh 0 auto;
    margin: auto;
    position: absolute;
    width: 5rem;
}

.loading-progress circle { fill: none; stroke: var(--border); stroke-width: .5rem; }
.loading-progress circle:last-child { stroke: var(--accent); }
.loading-progress-text { display: none; }

@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar { border-bottom: 1px solid var(--border); border-right: 0; padding: 1rem 1.25rem; }
    .sidebar nav, .sidebar-footer { display: none; }
    .main-content { padding-top: 2rem; }
    .page-header { display: grid; }
    .foundation-grid { grid-template-columns: 1fr; }
    .foundation-card { min-height: 15rem; }
    .next-block { grid-template-columns: 1fr; }
}
