:root {
    --portal-nav-bg: rgba(8, 18, 34, 0.82);
    --portal-nav-line: rgba(128, 168, 255, 0.2);
    --portal-nav-text: #eff6ff;
    --portal-nav-muted: #9bb0d0;
    --portal-nav-brand: #57e3ff;
    --portal-nav-brand-strong: #1bb8ea;
    --portal-nav-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

* {
    -webkit-tap-highlight-color: transparent;
}

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    padding: 12px 16px 0;
}

.portal-topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-radius: 22px;
    border: 1px solid var(--portal-nav-line);
    background: var(--portal-nav-bg);
    box-shadow: var(--portal-nav-shadow);
    backdrop-filter: blur(18px);
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: 0;
}

.portal-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.84rem;
    font-weight: 800;
    color: #04111f;
    background: linear-gradient(135deg, var(--portal-nav-brand) 0%, var(--portal-nav-brand-strong) 100%);
    box-shadow: 0 12px 28px rgba(27, 184, 234, 0.2);
}

.portal-brand-copy {
    min-width: 0;
}

.portal-brand-title {
    display: block;
    color: var(--portal-nav-text);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.98rem;
    line-height: 1.05;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.portal-brand-subtitle {
    display: block;
    color: var(--portal-nav-muted);
    font-size: 0.8rem;
    line-height: 1.2;
}

.portal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 320px;
}

.portal-nav-link,
.portal-utility-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.72rem 0.95rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--portal-nav-muted);
    border: 1px solid rgba(128, 168, 255, 0.14);
    background: rgba(255, 255, 255, 0.03);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.portal-nav-link:hover,
.portal-nav-link:focus-visible,
.portal-utility-link:hover,
.portal-utility-link:focus-visible {
    color: var(--portal-nav-text);
    border-color: rgba(87, 227, 255, 0.34);
    background: rgba(87, 227, 255, 0.08);
    transform: translateY(-1px);
}

.portal-nav-link.is-active {
    color: #04111f;
    border-color: transparent;
    background: linear-gradient(135deg, var(--portal-nav-brand) 0%, var(--portal-nav-brand-strong) 100%);
    box-shadow: 0 10px 26px rgba(27, 184, 234, 0.24);
}

.portal-utility {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.portal-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0.58rem 0.82rem;
    border-radius: 999px;
    border: 1px solid rgba(128, 168, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--portal-nav-text);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.76rem;
    font-weight: 700;
}

.portal-pill::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #57e3ff;
    box-shadow: 0 0 0 5px rgba(87, 227, 255, 0.12);
}

.portal-pill.tone-success::before {
    background: #7cffc4;
    box-shadow: 0 0 0 5px rgba(124, 255, 196, 0.12);
}

.portal-pill.tone-warning::before {
    background: #ffb65f;
    box-shadow: 0 0 0 5px rgba(255, 182, 95, 0.12);
}

.portal-pill.tone-secondary::before {
    background: #9aa8c3;
    box-shadow: 0 0 0 5px rgba(154, 168, 195, 0.12);
}

.portal-page-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 16px 44px;
}

.portal-hero,
.portal-card,
.portal-note,
.portal-surface {
    border-radius: 26px;
    border: 1px solid rgba(128, 168, 255, 0.2);
    background: rgba(10, 20, 39, 0.78);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

.portal-hero {
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.portal-hero::after {
    content: '';
    position: absolute;
    top: -84px;
    right: -36px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(87, 227, 255, 0.18) 0%, rgba(87, 227, 255, 0) 72%);
    pointer-events: none;
}

.portal-kicker {
    display: inline-block;
    color: #57e3ff;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.portal-hero h1 {
    margin: 0.8rem 0 0.95rem;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.03;
    text-transform: uppercase;
    color: #f3f7ff;
}

.portal-hero p,
.portal-card p,
.portal-note,
.portal-list,
.portal-list li,
.portal-muted {
    color: #9bb0d0;
}

.portal-hero-actions,
.portal-inline-actions,
.portal-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.48rem 0.8rem;
    border: 1px solid rgba(128, 168, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: #eff6ff;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
}

.portal-button,
.portal-button-soft,
.portal-button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.04em;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.portal-button {
    color: #04111f;
    border: none;
    background: linear-gradient(135deg, #57e3ff 0%, #1bb8ea 100%);
}

.portal-button-soft,
.portal-button-danger {
    color: #eff6ff;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(128, 168, 255, 0.18);
}

.portal-button-danger {
    border-color: rgba(255, 139, 152, 0.18);
}

.portal-button:hover,
.portal-button-soft:hover,
.portal-button-danger:hover,
.portal-button:focus-visible,
.portal-button-soft:focus-visible,
.portal-button-danger:focus-visible {
    transform: translateY(-1px);
    color: inherit;
}

.portal-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.portal-card {
    padding: 20px;
}

.portal-card h2,
.portal-card h3 {
    margin: 0.55rem 0 0.8rem;
    color: #f3f7ff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    line-height: 1.15;
}

.portal-section-label {
    color: #57e3ff;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.74rem;
    font-weight: 700;
}

.portal-list {
    margin: 0;
    padding-left: 1.05rem;
}

.portal-list li + li {
    margin-top: 0.45rem;
}

.portal-note {
    margin-top: 18px;
    padding: 18px;
}

.portal-stack {
    display: grid;
    gap: 18px;
}

.portal-stat-strip {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-top: 16px;
}

.portal-stat {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(128, 168, 255, 0.16);
}

.portal-stat-label {
    display: block;
    color: #9bb0d0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.portal-stat-value {
    display: block;
    margin-top: 0.38rem;
    color: #f3f7ff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(87, 227, 255, 0.82);
    outline-offset: 2px;
}

@media (max-width: 991px) {
    .portal-topbar-inner {
        align-items: flex-start;
    }

    .portal-nav,
    .portal-utility {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .portal-topbar {
        padding: 10px 12px 0;
    }

    .portal-topbar-inner {
        padding: 12px;
        border-radius: 20px;
    }

    .portal-page-shell {
        padding: 18px 12px 38px;
    }

    .portal-hero,
    .portal-card,
    .portal-note,
    .portal-surface {
        border-radius: 22px;
    }

    .portal-hero {
        padding: 20px;
    }

    .portal-hero-actions,
    .portal-inline-actions,
    .portal-nav,
    .portal-utility {
        gap: 8px;
    }

    .portal-nav-link,
    .portal-utility-link,
    .portal-button,
    .portal-button-soft,
    .portal-button-danger {
        width: 100%;
    }

    .portal-nav-link,
    .portal-utility-link {
        min-height: 44px;
    }

    .portal-grid,
    .portal-stat-strip {
        grid-template-columns: 1fr;
    }
}