:root {
    --portal-bg: #0b1120;
    --portal-surface: #131c31;
    --portal-surface-alt: #1b2742;
    --portal-border: #253456;
    --portal-accent: #0da69f;
    --portal-text: #f1f5f9;
    --portal-muted: #94a3b8;
    --portal-warn: #f59e0b;
    --portal-danger: #ef4444;
    --portal-ok: #10b981;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--portal-bg);
    color: var(--portal-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.portal-boot {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--portal-muted);
}

.portal-boot__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--portal-border);
    border-top-color: var(--portal-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.portal-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 72px;
}

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
}

.portal-topbar__title {
    font-weight: 700;
    font-size: 1rem;
}

.portal-topbar__sub {
    font-size: 0.75rem;
    color: var(--portal-muted);
}

.portal-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.portal-status-pill--online { background: rgba(16, 185, 129, 0.16); color: var(--portal-ok); }
.portal-status-pill--offline { background: rgba(245, 158, 11, 0.18); color: var(--portal-warn); }

.portal-content {
    flex: 1;
    padding: 1rem;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
}

.portal-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.portal-card--tap {
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.portal-card--tap:active {
    border-color: var(--portal-accent);
}

.portal-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
}

.portal-badge--pending { background: rgba(245, 158, 11, 0.2); color: var(--portal-warn); }
.portal-badge--synced { background: rgba(16, 185, 129, 0.18); color: var(--portal-ok); }
.portal-badge--failed { background: rgba(239, 68, 68, 0.2); color: var(--portal-danger); }

.portal-fab {
    position: fixed;
    right: 1rem;
    bottom: 84px;
    z-index: 30;
    height: 52px;
    padding: 0 1.25rem;
    border-radius: 999px;
    border: none;
    background: var(--portal-accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.portal-bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    z-index: 25;
    background: var(--portal-surface);
    border-top: 1px solid var(--portal-border);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.portal-bottomnav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    color: var(--portal-muted);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
}

.portal-bottomnav__item.active {
    color: var(--portal-accent);
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #7f1d1d;
    color: #fff;
    padding: 0.75rem 1rem;
    z-index: 100;
}
